ATLAS Offline Software
Functions | Variables
inspect_truth_file Namespace Reference

Functions

def EventLoop (tree, outputhistfile, nDarkPhotons)
 

Variables

 parser = optparse.OptionParser()
 
 dest
 
 help
 
 default
 
 type
 
 options
 
 args
 
 ntup_file = ROOT.TFile.Open(options.file_in, 'r')
 
 truth_tree = ROOT.TTree()
 

Function Documentation

◆ EventLoop()

def inspect_truth_file.EventLoop (   tree,
  outputhistfile,
  nDarkPhotons 
)

Definition at line 18 of file inspect_truth_file.py.

18 def EventLoop(tree, outputhistfile, nDarkPhotons):
19 
20  eventanalyzer = EventAnalyzer.EventAnalyzer( histControlName=outputhistfile, numberOfDarkPhotons=nDarkPhotons )
21  nBadOnes = 0
22  nEvents = tree.GetEntries()
23 
24  # setup toolbar
25  toolbar_width = 50
26  sys.stdout.write("Process: [%s]" % (" " * toolbar_width))
27  sys.stdout.flush()
28  sys.stdout.write("\b" * (toolbar_width+1)) # return to start of line, after '['
29 
30  nEvents = tree.GetEntries()
31  nEventsForUpdate = int(nEvents/toolbar_width)
32 
33  for (nevent,event) in enumerate(tree):
34  if (nevent %nEventsForUpdate) == 0:
35  sys.stdout.write('#')
36  sys.stdout.flush()
37  pass
38  if not eventanalyzer.processEvent(event):
39  nBadOnes += 1
40  pass
41  pass
42 
43  sys.stdout.write("\n")
44 
45  print 'Total events:', nEvents
46  print 'Total bad events:', nBadOnes
47 
48  eventanalyzer.finalize()
49 
50 

Variable Documentation

◆ args

inspect_truth_file.args

Definition at line 63 of file inspect_truth_file.py.

◆ default

inspect_truth_file.default

Definition at line 59 of file inspect_truth_file.py.

◆ dest

inspect_truth_file.dest

Definition at line 58 of file inspect_truth_file.py.

◆ help

inspect_truth_file.help

Definition at line 58 of file inspect_truth_file.py.

◆ ntup_file

inspect_truth_file.ntup_file = ROOT.TFile.Open(options.file_in, 'r')

Definition at line 70 of file inspect_truth_file.py.

◆ options

inspect_truth_file.options

Definition at line 63 of file inspect_truth_file.py.

◆ parser

inspect_truth_file.parser = optparse.OptionParser()

Definition at line 57 of file inspect_truth_file.py.

◆ truth_tree

inspect_truth_file.truth_tree = ROOT.TTree()

Definition at line 75 of file inspect_truth_file.py.

◆ type

inspect_truth_file.type

Definition at line 60 of file inspect_truth_file.py.

inspect_truth_file.EventLoop
def EventLoop(tree, outputhistfile, nDarkPhotons)
Definition: inspect_truth_file.py:18
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
EventAnalyzer.EventAnalyzer
Definition: EventAnalyzer.py:6