Skip to content

Commit

Permalink
Merge pull request #9589 from fwyzard/hltDumpStream_update_75x
Browse files Browse the repository at this point in the history
hltDumpStream update (75x)
  • Loading branch information
cmsbuild committed Jun 12, 2015
2 parents 9f68ee0 + dce3f6c commit c439569
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions HLTrigger/Configuration/scripts/hltDumpStream
Expand Up @@ -15,7 +15,14 @@ else:
config = open(configname)
exec config in globals(), hlt.__dict__
config.close()
process = hlt.process

if 'process' in hlt.__dict__:
process = hlt.process
elif 'fragment' in hlt.__dict__:
process = hlt.fragment
else:
sys.stderr.write("Error: the input is not a valid HLT configuration")
sys.exit(1)

# read global prescale service
prescale = dict()
Expand Down Expand Up @@ -207,8 +214,10 @@ def getPrescalesDescription(name, out, end):

# format the information about a path associated to a specific endpath
def dumpPath(name, out, end):
if name not in process.paths:
return ' %-*s*** missing ***' % (length, name)

path = process.paths[name]
length = max(len(p) for p in process.paths) + 4

# look for prescales
preDesc = getPrescalesDescription(name, out, end)
Expand All @@ -231,8 +240,6 @@ def getEndPath(output):
if searchOut.found:
out = o.label_()
break
else:
print " *** corresponding EndPath not found ***"
return out


Expand Down Expand Up @@ -264,11 +271,14 @@ def dumpStream(stream):
for path in sorted(unassigned):
print dumpPath(path, out, end)

missing = assigned - allpaths
if missing:
print ' *** missing paths in the output module ***'
for path in sorted(missing):
print dumpPath(path, out, end)
if not end:
print ' *** corresponding EndPath not found ***'
else:
missing = assigned - allpaths
if missing:
print ' *** paths missing from the EndPath\'s output module ***'
for path in sorted(missing):
print dumpPath(path, out, end)


def dumpOutput(stream):
Expand All @@ -287,5 +297,11 @@ def dumpOutput(stream):
streams = process.streams._Parameterizable__parameterNames
streams.sort()

# figure the longest path name
length = 32
length_p = max(len(p) for p in process.paths)
length_d = max(len(p) for d in process.datasets.__dict__ if not d.startswith('_') for p in process.datasets.__dict__[d])
length = max(length_p, length_d, length) + 4

for stream in streams:
dumpStream(stream)

0 comments on commit c439569

Please sign in to comment.