All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
displayHitOverlays Namespace Reference

Functions

def GetObject
 
def makePlots
 
def main
 

Variables

 myargv = sys.argv
 
tuple rc = main(sys.argv)
 

Function Documentation

def displayHitOverlays.GetObject (   name,
  list 
)

Definition at line 20 of file icarusalg/icarusalg/gallery/galleryAnalysis/C++/displayHitOverlays.py.

20 
21 def GetObject(name,list):
22  for i in list:
23  if i.GetName()==name:
24  return i.ReadObj()
25  return 0
26 
27 # Print help.
def displayHitOverlays.main (   argv)

Definition at line 165 of file icarusalg/icarusalg/gallery/galleryAnalysis/C++/displayHitOverlays.py.

166 def main(argv):
167  infile='TrackAnalysis.root'
168  outdir= ''
169  release=''
170  calorimetry = 0
171  hit = 0
172  tracking = 0
173  momresol = 0
174  flash = 0
175  pid = 0
176 
177  args = argv[1:]
178 
179  if len(args) > 0 :
180  if args[0] == '--input' and len(args) > 1 :
181  infile = args[1]
182 
183  makePlots(infile)
184 
185  currdir = os.getcwd()
186  if outdir != currdir:
187  os.chdir(currdir)
def displayHitOverlays.makePlots (   inputHitFileName)

Definition at line 28 of file icarusalg/icarusalg/gallery/galleryAnalysis/C++/displayHitOverlays.py.

28 
29 def makePlots(inputHitFileName):
30  can = {}
31  canIdx = 0
32 
33  fitTrackPH = {}
34  allHitPH = {}
35 
36  ###########################################################################################################
37  # Open all the input root files.
38  hitTFile = TFile(inputHitFileName)
39  list1 = hitTFile.GetListOfKeys()
40 
41  print '==> In plotHits, using file name {0:s}'.format(inputHitFileName)
42 
43  # Go to directory for the TrackHitAna output
44  for i in list1:
45  if i.GetClassName() == 'TDirectoryFile':
46  if i.GetName() != "mcassociations":
47  continue
48  hitTFile.cd(i.GetName())
49  histogramList = gDirectory.GetListOfKeys()
50  can[canIdx] = TCanvas("MC vs Reco", "MC vs Reco", 800, 600)
51  can[canIdx].Divide(2,2)
52  nHitsPerPrimary = GetObject("NHitsPerPrimary", histogramList)
53  primaryRecoNHits = GetObject("PrimaryRecoNHits", histogramList)
54  deltaNHits = GetObject("DeltaNHits", histogramList)
55  primaryLength = GetObject("PrimaryLength", histogramList)
56  primaryRecLength = GetObject("PrimaryRecLength", histogramList)
57  deltaTrackLen = GetObject("DeltaTrackLen", histogramList)
58  can[canIdx].cd(1)
59  nHitsPerPrimary.SetLineColor(4)
60  nHitsPerPrimary.SetStats(0)
61  nHitsPerPrimary.Draw()
62  primaryRecoNHits.SetLineColor(2)
63  primaryRecoNHits.SetStats(0)
64  primaryRecoNHits.Draw("SAMES")
65  can[canIdx].cd(2)
66  deltaNHits.SetLineColor(4)
67  deltaNHits.SetStats(0)
68  deltaNHits.Draw()
69  can[canIdx].cd(3)
70  primaryLength.SetLineColor(4)
71  primaryLength.SetStats(0)
72  primaryLength.Draw()
73  primaryRecLength.SetLineColor(2)
74  primaryRecLength.SetStats(0)
75  primaryRecLength.Draw("SAMES")
76  can[canIdx].cd(4)
77  deltaTrackLen.SetLineColor(4)
78  deltaTrackLen.SetStats(0)
79  deltaTrackLen.Draw()
80  can[canIdx].Update()
81 
82  canIdx += 1
83 
84  can[canIdx] = TCanvas("Completeness", "Completeness", 800, 600)
85  can[canIdx].Divide(2,2)
86  primCompleteness = GetObject("PrimaryCompleteness", histogramList)
87  primCompVsNHits = GetObject("PrimaryCompVsLogHits", histogramList)
88  primCompVsLen = GetObject("PrimaryCompVsLen", histogramList)
89  primCompVsMom = GetObject("PrimaryCompVsMom", histogramList)
90  can[canIdx].cd(1)
91  primCompleteness.SetLineColor(4)
92  primCompleteness.SetStats(0)
93  primCompleteness.Draw()
94  can[canIdx].cd(2)
95  primCompVsNHits.SetLineColor(4)
96  primCompVsNHits.SetStats(0)
97  primCompVsNHits.Draw()
98  can[canIdx].cd(3)
99  primCompVsLen.SetLineColor(4)
100  primCompVsLen.SetStats(0)
101  primCompVsLen.Draw()
102  can[canIdx].cd(4)
103  primCompVsMom.SetLineColor(4)
104  primCompVsMom.SetStats(0)
105  primCompVsMom.Draw()
106  can[canIdx].Update()
107 
108  canIdx += 1
109 
110  can[canIdx] = TCanvas("Efficiency", "Efficiency", 800, 600)
111  can[canIdx].Divide(2,2)
112  primEfficiency = GetObject("PrimaryEfficiency", histogramList)
113  primEffVsNHits = GetObject("PrimaryEffVsLogHits", histogramList)
114  primEffVsLen = GetObject("PrimaryEffVsLen", histogramList)
115  primEffVsMom = GetObject("PrimaryEffVsMom", histogramList)
116  can[canIdx].cd(1)
117  primEfficiency.SetLineColor(4)
118  primEfficiency.SetStats(0)
119  primEfficiency.Draw()
120  can[canIdx].cd(2)
121  primEffVsNHits.SetLineColor(4)
122  primEffVsNHits.SetStats(0)
123  primEffVsNHits.Draw()
124  can[canIdx].cd(3)
125  primEffVsLen.SetLineColor(4)
126  primEffVsLen.SetStats(0)
127  primEffVsLen.Draw()
128  can[canIdx].cd(4)
129  primEffVsMom.SetLineColor(4)
130  primEffVsMom.SetStats(0)
131  primEffVsMom.Draw()
132  can[canIdx].Update()
133 
134  canIdx += 1
135 
136  can[canIdx] = TCanvas("Purity", "Purity", 800, 600)
137  can[canIdx].Divide(2,2)
138  primPurity = GetObject("PrimaryPurity", histogramList)
139  primPurVsNHits = GetObject("PrimaryPurityVsLogHits", histogramList)
140  primPurVsLen = GetObject("PrimaryPurVsLen", histogramList)
141  primPurVsMom = GetObject("PrimaryPurVsMom", histogramList)
142  can[canIdx].cd(1)
143  primPurity.SetLineColor(4)
144  primPurity.SetStats(0)
145  primPurity.Draw()
146  can[canIdx].cd(2)
147  primPurVsNHits.SetLineColor(4)
148  primPurVsNHits.SetStats(0)
149  primPurVsNHits.Draw()
150  can[canIdx].cd(3)
151  primPurVsLen.SetLineColor(4)
152  primPurVsLen.SetStats(0)
153  primPurVsLen.Draw()
154  can[canIdx].cd(4)
155  primPurVsMom.SetLineColor(4)
156  primPurVsMom.SetStats(0)
157  primPurVsMom.Draw()
158  can[canIdx].Update()
159 
160  canIdx += 1
161 
162 
163  gApplication.Run()
164 
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen, unsigned int depth)
Definition: fclmodule.cxx:374
do cd
bool Update(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, PFPStruct &pfp, bool prt)
Definition: PFPUtils.cxx:1057

Variable Documentation

displayHitOverlays.myargv = sys.argv

Definition at line 8 of file icarusalg/icarusalg/gallery/galleryAnalysis/C++/displayHitOverlays.py.

tuple displayHitOverlays.rc = main(sys.argv)

Definition at line 189 of file icarusalg/icarusalg/gallery/galleryAnalysis/C++/displayHitOverlays.py.