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]

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2011-10-03 - AnnaSfyrla
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback