Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions | Variables
PrintTrkAnaSummary Namespace Reference

Functions

def processFile (inFileName, dirName, label, data, index, updateIndex=True)
 

Variables

 commandName = os.path.basename( sys.argv[0] )
 
string summaryDirDefault = "InDetTrackPerfMonPlots/TrkAnaEF/Offline/Tracks/"
 
 parser = argparse.ArgumentParser( description = commandName+" options:" )
 
 help
 
 default
 
 MyArgs = parser.parse_args()
 
dictionary data = {}
 
list index = []
 
 inFileName
 Processing test file. More...
 
 dirName
 
 label
 
 updateIndex
 
 df = pd.DataFrame( data, index=index )
 printing table to screen More...
 
 file
 printing table to html output file More...
 

Function Documentation

◆ processFile()

def PrintTrkAnaSummary.processFile (   inFileName,
  dirName,
  label,
  data,
  index,
  updateIndex = True 
)

Definition at line 26 of file PrintTrkAnaSummary.py.

26 def processFile( inFileName, dirName, label, data, index, updateIndex=True ):
27  sList = []
28  inFile = ROOT.TFile.Open( inFileName, "READ" )
29 
30 
31  hs = inFile.Get( dirName+"Multiplicities/summary" )
32  if hs:
33  for i in range( 1, hs.GetNbinsX()+1 ) :
34  if updateIndex : index.append( hs.GetXaxis().GetBinLabel(i) )
35  c = hs.GetBinContent(i)
36  e = hs.GetBinError(i)
37  sList.append( f"{c:.1f} +/- {e:.1f}" )
38 
39 
40  he = inFile.Get( dirName+"Efficiencies/eff_vs_truth_inclusive" )
41  if updateIndex : index.append( " " )
42  sList.append( " " )
43  if updateIndex : index.append( "Eff_vs_truth" )
44  if he:
45  c = 100*he.GetEfficiency(1)
46  eu = 100*he.GetEfficiencyErrorUp(1)
47  el = 100*he.GetEfficiencyErrorLow(1)
48  sList.append( f"{c:.2f} +{eu:.2f}/-{el:.2f} %" )
49  else : sList.append( "-" )
50 
51 
52  het = inFile.Get( dirName+"Efficiencies/Technical/eff_vs_truth_inclusive" )
53  if updateIndex : index.append( "Tech_eff_vs_truth" )
54  if het:
55  c = 100*het.GetEfficiency(1)
56  eu = 100*het.GetEfficiencyErrorUp(1)
57  el = 100*het.GetEfficiencyErrorLow(1)
58  sList.append( f"{c:.2f} +{eu:.2f}/-{el:.2f} %" )
59  else : sList.append( "-" )
60 
61 
62 
63  hrpt = inFile.Get( dirName+"Resolutions/resolution_pt_vs_truth_inclusive" )
64  if updateIndex : index.append( " " )
65  sList.append( " " )
66  if updateIndex : index.append( "Resolution_pT_vs_truth" )
67  if hrpt:
68  c = hrpt.GetBinContent(1)
69  e = hrpt.GetBinError(1)
70  sList.append( f"{c:.2f} +/- {e:.2f} GeV" )
71  else : sList.append( "-" )
72 
73 
74 
75  hrd0 = inFile.Get( dirName+"Resolutions/resolution_d0_vs_truth_inclusive" )
76  if updateIndex : index.append( "Resolution_d0_vs_truth" )
77  if hrd0:
78  c = hrd0.GetBinContent(1)
79  e = hrd0.GetBinError(1)
80  sList.append( f"{c:.2f} +/- {e:.2f} mm" )
81  else : sList.append( "-" )
82 
83 
84 
85  hrz0 = inFile.Get( dirName+"Resolutions/resolution_z0_vs_truth_inclusive" )
86  if updateIndex : index.append( "Resolution_z0_vs_truth" )
87  if hrz0:
88  c = hrz0.GetBinContent(1)
89  e = hrz0.GetBinError(1)
90  sList.append( f"{c:.2f} +/- {e:.2f} mm" )
91  else : sList.append( "-" )
92 
93 
94 
95  hf = inFile.Get( dirName+"FakeRates/fakerate_vs_offl_inclusive" )
96  if updateIndex : index.append( " " )
97  sList.append( " " )
98  if updateIndex : index.append( "FakeRate_vs_reco" )
99  if hf:
100  c = 100*hf.GetEfficiency(1)
101  eu = 100*hf.GetEfficiencyErrorUp(1)
102  el = 100*hf.GetEfficiencyErrorLow(1)
103  sList.append( f"{c:.2f} +{eu:.2f}/-{el:.2f} %" )
104  else : sList.append( "-" )
105 
106 
107 
108  hd = inFile.Get( dirName+"Duplicates/duplrate_vs_truth_inclusive" )
109  if updateIndex : index.append( "DuplicateRate_vs_truth" )
110  if hd:
111  c = 100*hd.GetEfficiency(1)
112  eu = 100*hd.GetEfficiencyErrorUp(1)
113  el = 100*hd.GetEfficiencyErrorLow(1)
114  sList.append( f"{c:.2f} +{eu:.2f}/-{el:.2f} %" )
115  else : sList.append( "-" )
116 
117 
118 
119  data.update( { label : sList } )
120  inFile.Close()
121 
122 

Variable Documentation

◆ commandName

PrintTrkAnaSummary.commandName = os.path.basename( sys.argv[0] )

Definition at line 8 of file PrintTrkAnaSummary.py.

◆ data

PrintTrkAnaSummary.data = {}

Definition at line 23 of file PrintTrkAnaSummary.py.

◆ default

PrintTrkAnaSummary.default

Definition at line 12 of file PrintTrkAnaSummary.py.

◆ df

PrintTrkAnaSummary.df = pd.DataFrame( data, index=index )

printing table to screen

Definition at line 144 of file PrintTrkAnaSummary.py.

◆ dirName

PrintTrkAnaSummary.dirName

Definition at line 126 of file PrintTrkAnaSummary.py.

◆ file

PrintTrkAnaSummary.file

printing table to html output file

Definition at line 149 of file PrintTrkAnaSummary.py.

◆ help

PrintTrkAnaSummary.help

Definition at line 11 of file PrintTrkAnaSummary.py.

◆ index

PrintTrkAnaSummary.index = []

Definition at line 24 of file PrintTrkAnaSummary.py.

◆ inFileName

PrintTrkAnaSummary.inFileName

Processing test file.

Processing reference file.

Definition at line 125 of file PrintTrkAnaSummary.py.

◆ label

PrintTrkAnaSummary.label

Definition at line 127 of file PrintTrkAnaSummary.py.

◆ MyArgs

PrintTrkAnaSummary.MyArgs = parser.parse_args()

Definition at line 17 of file PrintTrkAnaSummary.py.

◆ parser

PrintTrkAnaSummary.parser = argparse.ArgumentParser( description = commandName+" options:" )

Definition at line 10 of file PrintTrkAnaSummary.py.

◆ summaryDirDefault

PrintTrkAnaSummary.summaryDirDefault = "InDetTrackPerfMonPlots/TrkAnaEF/Offline/Tracks/"

Definition at line 9 of file PrintTrkAnaSummary.py.

◆ updateIndex

PrintTrkAnaSummary.updateIndex

Definition at line 140 of file PrintTrkAnaSummary.py.

PrintTrkAnaSummary.processFile
def processFile(inFileName, dirName, label, data, index, updateIndex=True)
Definition: PrintTrkAnaSummary.py:26
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195