ATLAS Offline Software
Functions
validateFlowElements Namespace Reference

Functions

def ReadMyxAOD (evt)
 
def main ()
 

Function Documentation

◆ main()

def validateFlowElements.main ( )

Definition at line 63 of file validateFlowElements.py.

63 def main():
64  parser=argparse.ArgumentParser("validateFlowElements.py - script to read xAOD and dump a nice histogram of the efraction")
65  parser.add_argument("--f",dest="files",action="store",default="",help='Input file (default = "")')
66  opts=parser.parse_args()
67  if(opts.files==""):
68  print("No file specified")
69  sys.exit(-1)
70 
71  evt=ROOT.POOL.TEvent(ROOT.POOL.TEvent.kClassAccess)
72  stat=evt.readFrom(opts.files)
73 
74  result=ReadMyxAOD(evt)
75  print("\n Printing output")
76  for item in result:
77  print(item)
78 

◆ ReadMyxAOD()

def validateFlowElements.ReadMyxAOD (   evt)

Definition at line 9 of file validateFlowElements.py.

9 def ReadMyxAOD(evt):
10  result=[]
11  for i in range(0,evt.getEntries()):
12  evt.getEntry(i)
13 
14 
15 
16  acc_chargedFE_muon=ROOT.SG.ConstAccessor(
17  "vector<ElementLink<xAOD::MuonContainer>>"
18  )("FE_MuonLinks") # accessor matches type in the aux branch
19  acc_neutralFE_muon=ROOT.SG.ConstAccessor(
20  "vector<ElementLink<xAOD::MuonContainer>>"
21  )("FE_MuonLinks") # accessor matches type in the aux branch
22 
23  chargedFEcont=evt.retrieve("xAOD::FlowElementContainer","JetETMissChargedParticleFlowObjects")
24  nchargedFE=chargedFEcont.size()
25  try:
26  for cfe in chargedFEcont:
27  cfe_pt=cfe.p4().Pt()
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")
35  else:
36  print("No auxdata retrieved")
37  except:
38  print("Problem in accessing charged FE container")
39 
40  try:
41  neutralFEcont=evt.retrieve("xAOD::FlowElementContainer","JetETMissNeutralParticleFlowObjects")
42  print("\n")
43  nneutralFE=neutralFEcont.size()
44  for nfe in neutralFEcont:
45  nfe_pt=nfe.p4().Pt()
46  print("Neutral Flow Element Pt(): {}".format(cfe_pt))
47  if (acc_neutralFE_muon.isAvailable(cfe)):
48  auxcont_nfe=acc_neutral_FE_muon(cfe)
49  for itr in range(0,auxcont_nfe.size()):
50  auxlink=auxcont_nfe[itr]
51  if(auxlink.isValid()):
52  print("Got a link to a muon")
53  else:
54  print("No auxdata retrieved")
55  except:
56  print("No neutral FE container accessible")
57  nneutralFE=0
58 
59  outputdict={"nChargedFE":nchargedFE,"nNeutralFE":nneutralFE}
60  result.append(outputdict)
61  return result
62 
vtune_athena.format
format
Definition: vtune_athena.py:14
validateFlowElements.main
def main()
Definition: validateFlowElements.py:63
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
Prompt::Def::Pt
@ Pt
Definition: VarHolder.h:76
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
validateFlowElements.ReadMyxAOD
def ReadMyxAOD(evt)
Definition: validateFlowElements.py:9