4 if os.environ.has_key(
'TERM'):
12 from ROOT
import TFile, TCanvas, TH1F, TH2F, TProfile, TLegend, TF1
13 from ROOT
import gDirectory, gROOT, gPad, gApplication
37 hitTFile = TFile(inputHitFileName)
38 list1 = hitTFile.GetListOfKeys()
40 print '==> In plotHits, using file name {0:s}'.
format(inputHitFileName)
44 if i.GetClassName() ==
'TDirectoryFile':
45 if i.GetName() !=
"mcassociations":
47 hitTFile.cd(i.GetName())
48 histogramList = gDirectory.GetListOfKeys()
49 can[canIdx] = TCanvas(
"MC vs Reco",
"MC vs Reco", 800, 600)
50 can[canIdx].Divide(2,2)
51 nHitsPerPrimary =
GetObject(
"NHitsPerPrimary", histogramList)
52 primaryRecoNHits =
GetObject(
"PrimaryRecoNHits", histogramList)
53 deltaNHits =
GetObject(
"DeltaNHits", histogramList)
54 primaryLength =
GetObject(
"PrimaryLength", histogramList)
55 primaryRecLength =
GetObject(
"PrimaryRecLength", histogramList)
56 deltaTrackLen =
GetObject(
"DeltaTrackLen", histogramList)
58 nHitsPerPrimary.SetLineColor(4)
59 nHitsPerPrimary.SetStats(0)
60 nHitsPerPrimary.Draw()
61 primaryRecoNHits.SetLineColor(2)
62 primaryRecoNHits.SetStats(0)
63 primaryRecoNHits.Draw(
"SAMES")
65 deltaNHits.SetLineColor(4)
66 deltaNHits.SetStats(0)
69 primaryLength.SetLineColor(4)
70 primaryLength.SetStats(0)
72 primaryRecLength.SetLineColor(2)
73 primaryRecLength.SetStats(0)
74 primaryRecLength.Draw(
"SAMES")
76 deltaTrackLen.SetLineColor(4)
77 deltaTrackLen.SetStats(0)
83 can[canIdx] = TCanvas(
"Completeness",
"Completeness", 800, 600)
84 can[canIdx].Divide(2,2)
85 primCompleteness =
GetObject(
"PrimaryCompleteness", histogramList)
86 primCompVsNHits =
GetObject(
"PrimaryCompVsLogHits", histogramList)
87 primCompVsLen =
GetObject(
"PrimaryCompVsLen", histogramList)
88 primCompVsMom =
GetObject(
"PrimaryCompVsMom", histogramList)
90 primCompleteness.SetLineColor(4)
91 primCompleteness.SetStats(0)
92 primCompleteness.Draw()
94 primCompVsNHits.SetLineColor(4)
95 primCompVsNHits.SetStats(0)
96 primCompVsNHits.Draw()
98 primCompVsLen.SetLineColor(4)
99 primCompVsLen.SetStats(0)
102 primCompVsMom.SetLineColor(4)
103 primCompVsMom.SetStats(0)
109 can[canIdx] = TCanvas(
"Efficiency",
"Efficiency", 800, 600)
110 can[canIdx].Divide(2,2)
111 primEfficiency =
GetObject(
"PrimaryEfficiency", histogramList)
112 primEffVsNHits =
GetObject(
"PrimaryEffVsLogHits", histogramList)
113 primEffVsLen =
GetObject(
"PrimaryEffVsLen", histogramList)
114 primEffVsMom =
GetObject(
"PrimaryEffVsMom", histogramList)
116 primEfficiency.SetLineColor(4)
117 primEfficiency.SetStats(0)
118 primEfficiency.Draw()
120 primEffVsNHits.SetLineColor(4)
121 primEffVsNHits.SetStats(0)
122 primEffVsNHits.Draw()
124 primEffVsLen.SetLineColor(4)
125 primEffVsLen.SetStats(0)
128 primEffVsMom.SetLineColor(4)
129 primEffVsMom.SetStats(0)
135 can[canIdx] = TCanvas(
"Purity",
"Purity", 800, 600)
136 can[canIdx].Divide(2,2)
137 primPurity =
GetObject(
"PrimaryPurity", histogramList)
138 primPurVsNHits =
GetObject(
"PrimaryPurityVsLogHits", histogramList)
139 primPurVsLen =
GetObject(
"PrimaryPurVsLen", histogramList)
140 primPurVsMom =
GetObject(
"PrimaryPurVsMom", histogramList)
142 primPurity.SetLineColor(4)
143 primPurity.SetStats(0)
146 primPurVsNHits.SetLineColor(4)
147 primPurVsNHits.SetStats(0)
148 primPurVsNHits.Draw()
150 primPurVsLen.SetLineColor(4)
151 primPurVsLen.SetStats(0)
154 primPurVsMom.SetLineColor(4)
155 primPurVsMom.SetStats(0)
166 infile=
'TrackAnalysis.root'
179 if args[0] ==
'--input' and len(args) > 1 :
184 currdir = os.getcwd()
185 if outdir != currdir:
188 if __name__ ==
'__main__':
static std::string format(PyObject *obj, unsigned int pos, unsigned int indent, unsigned int maxlen, unsigned int depth)
bool Update(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, PFPStruct &pfp, bool prt)