if 'pool.root' in sys.argv[-1]: exec('PoolAODInput=["' + sys.argv[-1] + '"]') ### define the list of input files print '... define list of files' if not ('PoolAODInput' in dir()): PoolAODInput = [ '/afs/cern.ch/user/t/tbold/public/TDTtest/menu1/AOD.pool.root' ] for f in PoolAODInput: print ' + %s' % f ### build the transient event and metadata trees #print '... build collection and metadata trees' from TrigDecisionTool.BuildTransientTrees import BuildTransientTrees (transientTree, transientMetaDataTree) = BuildTransientTrees(PoolAODInput) ### instantiate the TrigDecisionToolARA #print '... instantiate TrigDecisionToolARA' tdt = ROOT.Trig.TrigDecisionToolARA(transientTree, transientMetaDataTree) ### changing the output level of the TrigDecisionTool (default is ERROR) #import AthenaCommon.Constants as Constants #tdt.setOutputLevel(Constants.WARNING) ### create two triggers #allL2 = tdt.getChainGroup('L2_.*') #allEF = tdt.getChainGroup('EF_.*') all = tdt.getChainGroup('(EF|L2)_.*') ### possible HLT objects
import sys if len(sys.argv) == 1: print 'checkTriggerEDM.py poolfile [poolfile2]' sys.exit(1) # all the rest besides the 0th element is assumed to be file names PoolAODInput = sys.argv[1:] print PoolAODInput ### build the transient event and metadata trees print '... build collection and metadata trees' from TrigDecisionTool.BuildTransientTrees import BuildTransientTrees, filtBasic (transientTree, transientMetaDataTree) = BuildTransientTrees(PoolAODInput, filtBasic) ### instantiate the TrigDecisionToolARA print '... instantiate TrigDecisionToolARA' tdt = ROOT.Trig.TrigDecisionToolARA(transientTree, transientMetaDataTree) ### changing the output level of the TrigDecisionTool (default is ERROR) #import AthenaCommon.Constants as Constants #tdt.setOutputLevel(Constants.WARNING) ### create two triggers allChains = tdt.getChainGroup('(L2|EF).*') # error counters l2errors = {} eferrors = {}
pattern = arg.split("=")[1] print "selected chains in pattern: ", pattern if '--nev' in arg: nevt = int(arg.split("=")[1]) print "number of events: ", nevt else: PoolAODInput.append(arg) print PoolAODInput import ROOT #, PyCintex ### build the transient event and metadata trees #print '... build collection and metadata trees' from TrigDecisionTool.BuildTransientTrees import BuildTransientTrees, filtEDMAccess (transientTree, transientMetaDataTree) = BuildTransientTrees(PoolAODInput, filtEDMAccess) ### instantiate the TrigDecisionToolARA #print '... instantiate TrigDecisionToolARA' tdt = ROOT.Trig.TrigDecisionToolARA(transientTree, transientMetaDataTree) ### changing the output level of the TrigDecisionTool (default is ERROR) #import AthenaCommon.Constants as Constants #tdt.setOutputLevel(Constants.WARNING) ### create two triggers #allL2 = tdt.getChainGroup('L2_.*') #allEF = tdt.getChainGroup('EF_.*') all = tdt.getChainGroup(pattern) ### possible HLT objects
sys.exit(1) if options.fileName != None: fileName = os.path.expandvars(os.path.expanduser(options.fileName)) fileNames.append(fileName) fileNames = set(fileNames) sc = 0 #fileNames=['/afs/cern.ch/user/t/tbold/public/TDTtest/menu1/AOD.pool.root'] ################################## # Instantiate TrigDecisionTool print '...building transient trees...' from TrigDecisionTool.BuildTransientTrees import BuildTransientTrees (transientTree, transientMetaDataTree) = BuildTransientTrees(fileNames) tdt = ROOT.Trig.TrigDecisionToolARA(transientTree, transientMetaDataTree) import AthenaCommon.Constants as Constants tdt.setOutputLevel(Constants.FATAL) bits = [ 'EF_passedRaw', 'EF_passThrough', 'EF_prescaled', 'EF_resurrected', 'L2_passedRaw', 'L2_passThrough', 'L2_prescaled', 'L2_resurrected', 'L1_isPassedAfterPrescale', 'L1_isPassedBeforePrescale', 'L1_isPassedAfterVeto' ] BITS = [(i, getattr(ROOT.TrigDefs, i)) for i in bits] ################################## # loop over all events DATA = {} for evt in xrange(transientTree.GetEntries()): transientTree.GetEntry(evt)