Skip to content
Snippets Groups Projects
Commit ffc0b7c9 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'master-py3trigval' into 'master'

Py3 fixes for trigval tool for histsize checking

See merge request !31397
parents 269edf0e abf8a64b
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!31397Py3 fixes for trigval tool for histsize checking
#!/usr/bin/env python #!/usr/bin/env python
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
""" """
filterREGTEST.py filterREGTEST.py
Filter to remove DEBUG messages but keep REGTEST messages. Filter to remove DEBUG messages but keep REGTEST messages.
...@@ -11,7 +11,7 @@ import re ...@@ -11,7 +11,7 @@ import re
def main(): def main():
if len(sys.argv)>1: if len(sys.argv)>1:
print __doc__ print(__doc__)
return 1 return 1
re_debug = re.compile('\S+\s+DEBUG.*') re_debug = re.compile('\S+\s+DEBUG.*')
...@@ -20,14 +20,14 @@ def main(): ...@@ -20,14 +20,14 @@ def main():
if re_debug.match(line)!=None and line.find("REGTEST")==-1: if re_debug.match(line)!=None and line.find("REGTEST")==-1:
pass pass
else: else:
print line, print(line, end=' ')
return 0 return 0
if __name__ == "__main__": if __name__ == "__main__":
try: try:
sys.exit(main()) sys.exit(main())
except IOError, e: except IOError as e:
(code, msg) = e (code, msg) = e
if (code==32): pass # ignore broken pipe exception if (code==32): pass # ignore broken pipe exception
else: raise e else: raise e
......
#!/usr/bin/env python #!/usr/bin/env python
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
"""Print number of histograms in ROOT file""" """Print number of histograms in ROOT file"""
import sys import sys
...@@ -109,24 +109,24 @@ def main(): ...@@ -109,24 +109,24 @@ def main():
if not opts.byAlg: opts.byName = True if not opts.byAlg: opts.byName = True
if opts.byName==True: if opts.byName==True:
for h,v in sorted(hists.iteritems(), key=sortKey): for h,v in sorted(hists.items(), key=sortKey):
print '%-80s %10s %10s' % (h,v[0],v[1]) print('%-80s %10s %10s' % (h,v[0],v[1]))
if opts.byAlg==True: if opts.byAlg==True:
algs = byAlg(hists) algs = byAlg(hists)
for h,v in sorted(algs.iteritems(), key=sortKey): for h,v in sorted(algs.items(), key=sortKey):
print '%-80s %10s %10s' % (h,v[0],v[1]) print('%-80s %10s %10s' % (h,v[0],v[1]))
if opts.total: if opts.total:
print print()
print "Total histograms: %15s" % len(hists) print("Total histograms: %15s" % len(hists))
print "Total %sbins: %15s" % ("filled " if opts.filled else "", sum([h[1] for h in hists.values()])) print("Total %sbins: %15s" % ("filled " if opts.filled else "", sum([h[1] for h in hists.values()])))
if __name__ == '__main__': if __name__ == '__main__':
try: try:
sys.exit(main()) sys.exit(main())
except IOError, e: except IOError as e:
(code, msg) = e (code, msg) = e
if (code==32): pass # ignore broken pipe exception if (code==32): pass # ignore broken pipe exception
else: raise e else: raise e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment