How to access the SUSY D3PD Meta-Data information
def susyTrigMeta():
treeTrigMeta = TChain("susyMeta/TrigConfTree")
## This tree contains the full trigger configuration.
for i in range(0,len(files)):
treeTrigMeta.Add(files[i])
treeTrigMeta.SetBranchStatus("*",1)
numberOfEntries = treeTrigMeta.GetEntries()
chainID_chainName_Map = {}
print "** Number of Entries in trigMeta:",numberOfEntries
if numberOfEntries > 0:
for i in range(0,1):
treeTrigMeta.GetEntry(i)
mapLVL1Prescale = treeTrigMeta.LVL1PrescaleMap
mapHLTPrescale = treeTrigMeta.HLTPrescaleMap
mapName = treeTrigMeta.HLTLowerChainNameMap
HLTnameMap = treeTrigMeta.HLTNameMap
LVL1nameMap = treeTrigMeta.LVL1NameMap
for k,j in mapLVL1Prescale:
chainID_chainName_Map[LVL1nameMap[k]] = k
for k,j in mapHLTPrescale:
if "EF" in k:
chainID_chainName_Map[HLTnameMap[k]] = k
print "==> Got trigger configuration"
else:
print "==> Didn't get configuration, MetaData Tree was empty."
return chainID_chainName_Map
#print "Into trigger configuration ==>"
####################################
#chain_ID_Name_Map = susyTrigMeta()
#print chain_ID_Name_Map
####################################
- You can use it in the loop over events in the D3PD:
# for L2Chain in susyTree.trig_L2_passedPhysics:
# print L2Chain, chain_ID_Name_Map[L2Chain]
# print " ==> Chains that passed this event:"
# for EFChain in susyTree.trig_EF_passedPhysics:
# print "Chain ID:", EFChain, "Chain Name", chain_ID_Name_Map[EFChain]