7 from pprint
import pprint
11 for i
in range(0,evt.getEntries()):
16 acc_chargedFE_muon=ROOT.SG.ConstAccessor(
17 "vector<ElementLink<xAOD::MuonContainer>>"
19 acc_neutralFE_muon=ROOT.SG.ConstAccessor(
20 "vector<ElementLink<xAOD::MuonContainer>>"
23 chargedFEcont=evt.retrieve(
"xAOD::FlowElementContainer",
"JetETMissChargedParticleFlowObjects")
24 nchargedFE=chargedFEcont.size()
26 for cfe
in chargedFEcont:
28 print(
"Charged Flow Element Pt(): {}".
format(cfe_pt))
29 if (acc_chargedFE_muon.isAvailable(cfe)):
30 auxcont_cfe=acc_charged_FE_muon(cfe)
31 for itr
in range(0,auxcont_cfe.size()):
32 auxlink=auxcont_cfe[itr]
33 if(auxlink.isValid()):
34 print(
"Got a link to a muon")
36 print(
"No auxdata retrieved")
39 neutralFEcont=evt.retrieve(
"xAOD::FlowElementContainer",
"JetETMissNeutralParticleFlowObjects")
41 nneutralFE=neutralFEcont.size()
42 for nfe
in neutralFEcont:
44 print(
"Neutral Flow Element Pt(): {}".
format(cfe_pt))
45 if (acc_neutralFE_muon.isAvailable(cfe)):
46 auxcont_nfe=acc_neutral_FE_muon(cfe)
47 for itr
in range(0,auxcont_nfe.size()):
48 auxlink=auxcont_nfe[itr]
49 if(auxlink.isValid()):
50 print(
"Got a link to a muon")
52 print(
"No auxdata retrieved")
54 print(
"No charged FE container accessible")
57 outputdict={
"nChargedFE":nchargedFE,
"nNeutralFE":nneutralFE}
58 result.append(outputdict)
62 parser=argparse.ArgumentParser(
"validateFlowElements.py - script to read xAOD and dump a nice histogram of the efraction")
63 parser.add_argument(
"--f",dest=
"files",action=
"store",default=
"",help=
'Input file (default = "")')
64 opts=parser.parse_args()
66 print(
"No file specified")
69 evt=ROOT.POOL.TEvent(ROOT.POOL.TEvent.kClassAccess)
70 stat=evt.readFrom(opts.files)
73 print(
"\n Printing output")
77 if __name__==
"__main__":