7 from ROOT
import (gDirectory, gROOT, gStyle, kTRUE,
8 TCanvas, TFile, TLegend, TPad, kBlack, kBlue,
9 kRed, kGreen, kOrange, kCyan, kPink, kGray)
15 {
'name':
'clusterAll',
'title':
'Clusters - Inclusive'},
16 {
'name':
'cluster10GeV',
'title':
'Clusters - 10 GeV'},
17 {
'name':
'clusterPromptAll',
'title':
'Clusters from Prompt - Inclusive'},
18 {
'name':
'clusterPrompt10GeV',
'title':
'Clusters from Prompt - 10 GeV'},
21 cluster_list_photon = [
22 {
'name':
'clusterUnconvPhoton',
23 'title':
'Clusters Unconverted Photons'},
24 {
'name':
'clusterConvPhoton',
25 'title':
'Clusters Converted Photons'},
26 {
'name':
'clusterConvPhotonSi',
27 'title':
'Clusters Converted Photons - Si'},
28 {
'name':
'clusterConvPhotonSiSi',
29 'title':
'Clusters Converted Photons - SiSi'},
30 {
'name':
'clusterConvPhotonTRT',
31 'title':
'Clusters Converted Photons - TRT'},
32 {
'name':
'clusterConvPhotonTRTTRT',
33 'title':
'Clusters Converted Photons - TRTTRT'},
34 {
'name':
'clusterConvPhotonSiTRT',
35 'title':
'Clusters Converted Photons - SiTRT'},
38 photon_cluster_list = [
39 {
'name':
'clusterUnconvPhoton',
40 'title':
'Clusters Unconverted Photons'},
41 {
'name':
'clusterConvPhoton',
42 'title':
'Clusters Converted Photons'},
43 {
'name':
'clusterConvPhotonSi',
44 'title':
'Clusters Converted Photons - Si'},
45 {
'name':
'clusterConvPhotonSiSi',
46 'title':
'Clusters Converted Photons - SiSi'},
47 {
'name':
'clusterConvPhotonTRT',
48 'title':
'Clusters Converted Photons - TRT'},
49 {
'name':
'clusterConvPhotonTRTTRT',
50 'title':
'Clusters Converted Photons - TRTTRT'},
51 {
'name':
'clusterConvPhotonSiTRT',
52 'title':
'Clusters Converted Photons - SiTRT'},
57 electron_comparison_list = [
58 {
'name':
'showerShapesAll',
59 'title':
'Shower Shape - Inclusive'},
60 {
'name':
'showerShapes10GeV',
61 'title':
'Shower Shape - 10 GeV'},
62 {
'name':
'isolationAll',
63 'title':
'Isolation'},
64 {
'name':
'recoElectronAll',
65 'title':
'Reconstructed Electron'},
66 {
'name':
'truthRecoElectronLooseLH',
67 'title':
'Reconstructed Electron LooseLH'},
68 {
'name':
'truthRecoElectronMediumLH',
69 'title':
'Reconstructed Electron MediumLH'},
70 {
'name':
'truthRecoElectronTightLH',
71 'title':
'Reconstructed Electron TightLH'},
72 {
'name':
'truthElectronAll',
73 'title':
'True Electron'},
74 {
'name':
'truthPromptElectronAll',
75 'title':
'True Prompt Electron'},
76 {
'name':
'truthElectronRecoElectronAll',
77 'title':
'True Electron Reconstructed as Electron'},
78 {
'name':
'truthPromptElectronWithTrack',
79 'title':
'True Prompt Electron with Track'},
80 {
'name':
'truthPromptElectronWithGSFTrack',
81 'title':
'True Prompt Electron with GSFTrack'},
82 {
'name':
'truthPromptElectronWithReco',
83 'title':
'True Prompt Electron with Reco Electron'},
84 {
'name':
'trackingEfficiency',
85 'title':
'Tracking Efficiency'},
86 {
'name':
'GSFEfficiency',
87 'title':
'GSF Efficiency'},
88 {
'name':
'matchingEfficiency',
89 'title':
'Matching Efficiency'},
90 {
'name':
'reconstructionEfficiency',
91 'title':
'Reconstruction Efficiency'},
92 {
'name':
'recoElectronLooseLHEfficiency',
93 'title':
'Reconstructed Electron LooseLH Efficiency'},
94 {
'name':
'recoElectronMediumLHEfficiency',
95 'title':
'Reconstructed Electron MediumLH Efficiency'},
96 {
'name':
'recoElectronTightLHEfficiency',
97 'title':
'Reconstructed Electron TightLH Efficiency'},
100 photon_comparison_list = [
101 {
'name':
'recoPhotonAll',
102 'title':
'Reconstructed Photon'},
103 {
'name':
'truthPhotonRecoPhoton',
104 'title':
'True photon reconstructed as photon'},
105 {
'name':
'truthConvPhoton',
106 'title':
'True converted photon'},
107 {
'name':
'truthConvRecoConv',
108 'title':
'True conversion reconstructed as converted photon'},
109 {
'name':
'truthConvRecoConv1Si',
110 'title':
'True conversion reconstructed as 1 Si conv'},
111 {
'name':
'truthConvRecoConv1TRT',
112 'title':
'True conversion reconstructed as 1 TRT conv'},
113 {
'name':
'truthConvRecoConv2Si',
114 'title':
'True conversion reconstructed as Si-Si conv'},
115 {
'name':
'truthConvRecoConv2TRT',
116 'title':
'True conversion reconstructed as TRT-TRT conv'},
117 {
'name':
'truthConvRecoConv2SiTRT',
118 'title':
'True conversion reconstructed as Si-TRT conv'},
119 {
'name':
'truthConvRecoUnconv',
120 'title':
'True conversion reconstructed as unconverted photon'},
121 {
'name':
'truthUnconvPhoton',
'title':
'True unconverted photon'},
122 {
'name':
'truthUnconvRecoConv',
123 'title':
'True unconverted reconstructed as conv photon'},
124 {
'name':
'truthUnconvRecoUnconv',
125 'title':
'True unconverted reconstructed as unconverted photon'},
126 {
'name':
'showerShapesAll',
127 'title':
'Shower Shape - Inclusive'},
128 {
'name':
'showerShapes10GeV',
129 'title':
'Shower Shape - 10 GeV'},
130 {
'name':
'isolationAll',
131 'title':
'Isolation'},
132 {
'name':
'recoPhotonUnconvLooseLH',
133 'title':
'Unconverted Photon LooseLH'},
134 {
'name':
'recoPhotonUnconvTightLH',
135 'title':
'Unconverted Photon TightLH'},
136 {
'name':
'recoPhotonConvLooseLH',
137 'title':
'Converted Photon LooseLH'},
138 {
'name':
'recoPhotonConvTightLH',
139 'title':
'Converted Photon TightLH'},
140 {
'name':
'recoPhotonUnconvIsoFixedCutTight',
141 'title':
'FixedCutTight Unconverted Photon'},
142 {
'name':
'recoPhotonUnconvIsoFixedCutTightCaloOnly',
143 'title':
'FixedCutTightCaloOnly Unconverted Photon'},
144 {
'name':
'recoPhotonUnconvIsoFixedCutLoose',
145 'title':
'FixedCutLoose Unconverted Photon'},
146 {
'name':
'recoPhotonConvIsoFixedCutTight',
147 'title':
'FixedCutTight Converted Photon'},
148 {
'name':
'recoPhotonConvIsoFixedCutTightCaloOnly',
149 'title':
'FixedCutTightCaloOnly Converted Photon'},
150 {
'name':
'recoPhotonConvIsoFixedCutLoose',
151 'title':
'FixedCutLoose Converted Photon'},
152 {
'name':
'truthPhotonUnconvRecoUnconvEfficiency',
153 'title':
'True Conv #rightarrow Conv'},
154 {
'name':
'truthPhotonRecoConvEfficiency',
155 'title':
'True Conv #rightarrow Conv'},
156 {
'name':
'recoPhotonUnconvIsoFixedCutTightEfficiency',
157 'title':
'True Conv #rightarrow Conv'},
158 {
'name':
'recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency',
159 'title':
'True Conv #rightarrow Conv'},
160 {
'name':
'recoPhotonUnconvIsoFixedCutLooseEfficiency',
161 'title':
'True Conv #rightarrow Conv'},
162 {
'name':
'recoPhotonConvIsoFixedCutTightEfficiency',
163 'title':
'True Conv #rightarrow Conv'},
164 {
'name':
'recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency',
165 'title':
'True Conv #rightarrow Conv'},
166 {
'name':
'recoPhotonConvIsoFixedCutLooseEfficiency',
167 'title':
'True Conv #rightarrow Conv'},
168 {
'name':
'recoPhotonUnconvLooseLHEfficiency',
169 'title':
'Unconverted Photon LooseLH Efficiency'},
170 {
'name':
'recoPhotonUnconvTightLHEfficiency',
171 'title':
'Unconverted Photon TightLH Efficiency'},
172 {
'name':
'recoPhotonConvLooseLHEfficiency',
173 'title':
'Converted Photon LooseLH Efficiency'},
174 {
'name':
'recoPhotonConvTightLHEfficiency',
175 'title':
'Converted Photon TightLH Efficiency'},
178 photon_fraction_list = [
179 {
'name':
'truthPhotonConvRecoConvEfficiency',
180 'color': kBlack,
'title':
'True Conv #rightarrow Conv'},
181 {
'name':
'truthPhotonConvRecoConv1SiEfficiency',
'color': kBlue +
182 2,
'title':
'True Conv #rightarrow 1 Si Conv'},
183 {
'name':
'truthPhotonConvRecoConv1TRTEfficiency',
'color': kRed +
184 2,
'title':
'True Conv #rightarrow 1 TRT Conv'},
185 {
'name':
'truthPhotonConvRecoConv2SiEfficiency',
'color': kGreen +
186 2,
'title':
'True Conv #rightarrow Si-Si Conv'},
187 {
'name':
'truthPhotonConvRecoConv2TRTEfficiency',
'color': kOrange + 2,
188 'title':
'True Conv #rightarrow TRT-TRT Conv'},
189 {
'name':
'truthPhotonConvRecoConv2SiTRTEfficiency',
'color': kCyan + 2,
190 'title':
'True Conv #rightarrow Si-TRT Conv'},
191 {
'name':
'truthPhotonConvRecoUnconvEfficiency',
192 'color': kPink + 2,
'title':
'True Conv #rightarrow Unconv'}
195 photonfake_fraction_list = [
196 {
'name':
'truthPhotonUnconvRecoConvEfficiency',
197 'color': kBlack,
'title':
'True Unconv #rightarrow Conv'},
198 {
'name':
'truthPhotonUnconvRecoConv1SiEfficiency',
'color': kBlue +
199 2,
'title':
'True Unconv #rightarrow 1 Si Conv'},
200 {
'name':
'truthPhotonUnconvRecoConv1TRTEfficiency',
'color': kRed +
201 2,
'title':
'True Unconv #rightarrow 1 TRT Conv'},
202 {
'name':
'truthPhotonUnconvRecoConv2SiEfficiency',
'color': kGreen +
203 2,
'title':
'True Unconv #rightarrow Si-Si Conv'},
204 {
'name':
'truthPhotonUnconvRecoConv2TRTEfficiency',
'color': kOrange + 2,
205 'title':
'True Unconv #rightarrow TRT-TRT Conv'},
206 {
'name':
'truthPhotonUnconvRecoConv2SiTRTEfficiency',
'color': kCyan + 2,
207 'title':
'True Unconv #rightarrow Si-TRT Conv'},
210 photon_efficiency_list = [
211 {
'name':
'truthPhotonRecoPhotonEfficiency',
212 'color': kBlack,
'title':
'All photons'},
213 {
'name':
'truthPhotonRecoPhotonOrElectronEfficiency',
'color': kGreen + 2,
214 'title':
'All photons + electrons'},
215 {
'name':
'truthPhotonConvRecoEfficiency',
'color': kRed,
216 'title':
'True converted'},
217 {
'name':
'truthPhotonUnconvRecoEfficiency',
'color': kBlue,
218 'title':
'True unconverted'}
221 photon_conversion_list = [
222 {
'name':
'truthConvRecoConv2Si',
'color': kGreen +
223 2,
'title':
'True Conv #rightarrow Si-Si Conv'},
224 {
'name':
'truthConvRecoConv1Si',
'color': kBlue +
225 2,
'title':
'True Conv #rightarrow 1 Si Conv'},
226 {
'name':
'truthConvRecoConv1TRT',
'color': kRed +
227 2,
'title':
'True Conv #rightarrow 1 TRT Conv'},
228 {
'name':
'truthConvRecoConv2TRT',
'color': kOrange +
229 2,
'title':
'True Conv #rightarrow TRT-TRT Conv'},
230 {
'name':
'truthConvRecoConv2SiTRT',
'color': kCyan +
231 2,
'title':
'True Conv #rightarrow Si-TRT Conv'},
234 photon_track_list = [
235 {
'name':
'InDetTracks',
'color': kBlack,
236 'title':
'All tracks'},
237 {
'name':
'InDetTracksMatchElectron',
'color': kOrange,
238 'title':
'Matched to true electrons'},
239 {
'name':
'InDetTracksNotElectron',
'color': kBlue,
240 'title':
'Not matched to true electrons'},
241 {
'name':
'InDetTracksMatchPion',
'color': kGreen +
242 2,
'title':
'Matched to true Pion'},
243 {
'name':
'InDetTracksNotMatched',
'color': kCyan +
244 2,
'title':
'Not matched to truth'}
247 photon_trackTRT_list = [
248 {
'name':
'InDetTracksTRT',
'color': kBlack,
249 'title':
'All tracks'},
250 {
'name':
'InDetTracksTRTMatchElectron',
'color': kOrange,
251 'title':
'Matched to true electrons'},
252 {
'name':
'InDetTracksTRTNotElectron',
'color': kBlue,
253 'title':
'Not matched to true electrons'},
254 {
'name':
'InDetTracksTRTMatchPion',
'color': kGreen +
255 2,
'title':
'Matched to true Pion'},
256 {
'name':
'InDetTracksTRTNotMatched',
'color': kCyan +
257 2,
'title':
'Not matched to truth'}
260 photon_trackhighpT_list = [
261 {
'name':
'InDetTrackshighpT',
'color': kBlack,
262 'title':
'All tracks'},
263 {
'name':
'InDetTracksMatchElectronhighpT',
'color': kOrange,
264 'title':
'Matched to true electrons'},
265 {
'name':
'InDetTracksNotElectronhighpT',
'color': kBlue,
266 'title':
'Not matched to true electrons'},
267 {
'name':
'InDetTracksMatchPionhighpT',
'color': kGreen +
268 2,
'title':
'Matched to true Pion'},
269 {
'name':
'InDetTracksNotMatchedhighpT',
'color': kCyan +
270 2,
'title':
'Not matched to truth'}
273 photon_trackTRThighpT_list = [
274 {
'name':
'InDetTracksTRThighpT',
'color': kBlack,
275 'title':
'All tracks'},
276 {
'name':
'InDetTracksTRTMatchElectronhighpT',
'color': kOrange,
277 'title':
'Matched to true electrons'},
278 {
'name':
'InDetTracksTRTNotElectronhighpT',
'color': kBlue,
279 'title':
'Not matched to true electrons'},
280 {
'name':
'InDetTracksTRTMatchPionhighpT',
'color': kGreen +
281 2,
'title':
'Matched to true Pion'},
282 {
'name':
'InDetTracksTRTNotMatchedhighpT',
'color': kCyan +
283 2,
'title':
'Not matched to truth'}
289 Function to get the key elements name from a given directory
291 :param directory: Directory
295 return [key.GetName()
for key
in gDirectory.GetListOfKeys()]
301 :param type: electron or gamma
302 :param f_base: TFile with the baseline plots
303 :param f_nightly: TFile with the nightly plots
304 :param result_file: TFile with the resulting comparison
307 photon_comparison_list
if type ==
'gamma'
308 else electron_comparison_list)
309 for folder
in comparison_list:
311 h_base = f_base.Get(folder[
'name'] +
'/' + histo)
312 h_nightly = f_nightly.Get(folder[
'name'] +
'/' + histo)
313 if not h_base
or not h_nightly:
314 print(histo,
' is missing in one of the files ',h_base,h_nightly)
316 if h_base.GetEntries() == 0
or h_nightly.GetEntries() == 0:
322 outHist = inHist.QuantilesX(0.75,
"EResolution_IQE_mu")
323 outHist.GetXaxis().SetTitle(
"<#mu>")
324 outHist.GetYaxis().SetTitle(
"IQE")
325 outHist25 = inHist.QuantilesX(0.25,
"EResolutio_IQE_mu_25")
326 outHist.Add(outHist25, -1)
327 outHist.Scale(1/1.349)
329 return outHist.Clone(inHist.GetName() +
"_" + name)
334 cluster_list_to_loop = cluster_list
336 if particle_type ==
"gamma":
337 cluster_list_to_loop = cluster_list + cluster_list_photon
339 for i, folder
in enumerate(cluster_list_to_loop):
341 if '2D' not in histo
and not 'profile' in histo:
343 h_base = f_base.Get(folder[
'name'] +
'/' + histo)
344 h_nightly = f_nightly.Get(folder[
'name'] +
'/' + histo)
345 if not h_base
or not h_nightly:
346 print(histo,
' is missing in one of the files ',h_base,h_nightly)
348 if h_base.GetEntries() == 0
or h_nightly.GetEntries() == 0:
355 h_base.SetDirectory(0)
356 h_nightly.SetDirectory(0)
357 y_axis_label =
"Mean %s" % (h_base.GetTitle())
360 folder[
'title'], result_file, y_axis_label)
365 This function creates conversion plots to study reco vs true
366 converion radius for the various conversion categoried
368 for histo
in get_key_names(f_nightly,
'truthConvRecoConv2Si'):
369 variable_name = histo.split(
"_", 1)[1]
371 if variable_name !=
"convRadiusTrueVsReco":
376 leg = TLegend(0.1, 0.75, 0.9, 0.9)
379 leg2 = TLegend(0.5, 0.7, 0.9, 0.75)
382 for i, folder
in enumerate(photon_conversion_list):
384 baseline = f_base.Get(
385 folder[
'name'] +
'/' + folder[
'name'] +
"_" + variable_name)
386 baseline.SetDirectory(0)
387 nightly = f_nightly.Get(
388 folder[
'name'] +
'/' + folder[
'name'] +
"_" + variable_name)
389 nightly.SetDirectory(0)
391 if baseline.Integral() != 0:
392 baseline.Scale(1/baseline.Integral())
393 if nightly.Integral() != 0:
394 nightly.Scale(1/nightly.Integral())
397 min(baseline.GetMinimum(), baseline.GetMinimum()) * 0.7)
399 max(baseline.GetMaximum(), baseline.GetMaximum()) * 1.4)
401 baseline.GetXaxis().SetTitle(
402 "R^{reco}_{conv. vtx} - R^{true}_{conv. vtx} [mm]")
403 baseline.GetYaxis().SetTitle(
"normalized to unity")
405 baseline.SetLineColor(folder[
'color'])
406 nightly.SetLineColor(folder[
'color'])
407 baseline.SetMarkerColor(folder[
'color'])
408 nightly.SetMarkerColor(folder[
'color'])
410 baseline.SetMarkerStyle(1)
411 nightly.SetMarkerStyle(20)
413 leg.AddEntry(nightly, folder[
'title'],
"p")
416 baseline.Draw(
"hist ")
418 baselineDummy = baseline.Clone()
419 baselineDummy.SetLineColor(kGray+3)
420 baselineDummy.SetMarkerColor(kGray+3)
421 nightlyDummy = nightly.Clone()
422 nightlyDummy.SetLineColor(kGray+3)
423 nightlyDummy.SetMarkerColor(kGray+3)
424 leg2.AddEntry(baselineDummy,
"Baseline",
"l")
425 leg2.AddEntry(nightlyDummy,
"Nightly",
"p")
427 baseline.Draw(
"same hist")
429 nightly.Draw(
"p same")
438 c1.SaveAs(
"ConversionRadiusTrueVsReco.png")
440 c1.Write(
"ConversionRadiusTrueVsReco")
444 f_base, f_nightly, result_file,
445 example_folder, folder_list, plot_name,
446 axis_title, ymin, ymax, normalize=False):
448 This functions created a photon validation plot with efficiencies
451 :param f_base TFile with the baseline histograms:
452 :param f_nightly TFile with the nightly histograms:
456 variable_name = histo.split(
"_", 1)[1]
460 leg = TLegend(0.1, 0.75, 0.9, 0.9)
463 leg2 = TLegend(0.5, 0.7, 0.9, 0.75)
466 for i, folder
in enumerate(folder_list):
468 baseline = f_base.Get(
469 folder[
'name'] +
'/' + folder[
'name'] +
"_" + variable_name)
470 baseline.SetDirectory(0)
471 nightly = f_nightly.Get(
472 folder[
'name'] +
'/' + folder[
'name'] +
"_" + variable_name)
473 nightly.SetDirectory(0)
475 if normalize
and 'vs' not in variable_name:
476 if baseline.Integral() != 0:
477 baseline.Scale(1/baseline.Integral())
478 if nightly.Integral() != 0:
479 nightly.Scale(1/nightly.Integral())
481 baseline.SetMinimum(ymin)
482 baseline.SetMaximum(ymax)
484 baseline.GetYaxis().SetTitle(axis_title)
486 baseline.SetLineColor(folder[
'color'])
487 nightly.SetLineColor(folder[
'color'])
488 baseline.SetMarkerColor(folder[
'color'])
489 nightly.SetMarkerColor(folder[
'color'])
491 baseline.SetMarkerStyle(1)
492 nightly.SetMarkerStyle(20)
494 leg.AddEntry(nightly, folder[
'title'],
"p")
497 baseline.Draw(
"hist ")
499 baselineDummy = baseline.Clone()
500 baselineDummy.SetLineColor(kGray+3)
501 baselineDummy.SetMarkerColor(kGray+3)
502 nightlyDummy = nightly.Clone()
503 nightlyDummy.SetLineColor(kGray+3)
504 nightlyDummy.SetMarkerColor(kGray+3)
505 leg2.AddEntry(baselineDummy,
"Baseline",
"l")
506 leg2.AddEntry(nightlyDummy,
"Nightly",
"p")
508 baseline.Draw(
"same hist")
510 nightly.Draw(
"p same")
519 c1.SaveAs(plot_name +
"_" + variable_name +
".png")
521 c1.Write(plot_name +
"_" + variable_name)
527 :param h_base: Baseline histogram
528 :param h_nightly: Nightly histogram
529 :param name: Human-readable name of the histogram
530 :param result_file: TFile where the output is saved
531 :param y_axis_label: Y axis label is case is needed
532 (fraction vs efficiency)
534 histogram_name = h_nightly.GetName()
536 type_name = histogram_name.split(
"_", 1)[0]
537 variable_name = histogram_name.split(
"_", 1)[1]
541 main_pad = TPad(
"main_pad",
"top", 0.00, 0.25, 1.00, 1.00)
542 main_pad.SetLeftMargin(0.12)
543 main_pad.SetRightMargin(0.04)
544 main_pad.SetTopMargin(0.02)
545 main_pad.SetBottomMargin(0.02)
550 ratio_pad = TPad(
"ratio_pad",
"bottom", 0.00, 0.00, 1.00, 0.25)
551 ratio_pad.SetLeftMargin(0.12)
552 ratio_pad.SetRightMargin(0.04)
553 ratio_pad.SetTopMargin(0.03)
554 ratio_pad.SetTickx(0)
555 ratio_pad.SetBottomMargin(0.36)
558 h_base.SetLineColor(4)
559 h_base.SetLineWidth(2)
561 h_nightly.SetMarkerStyle(8)
562 h_nightly.SetMarkerSize(0.5)
566 if y_axis_label
is not None:
567 h_base.GetYaxis().SetTitle(y_axis_label)
568 h_base.GetYaxis().SetTitle(y_axis_label)
570 if '2D' not in variable_name
or 'profile' in variable_name:
574 "same p" if '2D' not in variable_name
or 'profile' in variable_name
579 h_base.GetXaxis().SetLabelSize(0)
580 h_base.GetXaxis().SetLabelOffset(999)
582 h_base.SetMinimum(
min(h_base.GetMinimum(), h_nightly.GetMinimum()) * 0.7)
583 h_base.SetMaximum(
max(h_base.GetMaximum(), h_nightly.GetMaximum()) * 1.3)
585 leg = TLegend(0.4, 0.88, 0.9, 0.95)
586 leg.SetHeader(name,
"C")
590 leg.AddEntry(h_base,
"Baseline",
"l")
591 leg.AddEntry(h_nightly,
"Nightly",
"p")
598 h1clone = h_nightly.Clone()
601 h1clone.Divide(h_base)
602 h1clone.SetMarkerColor(1)
603 h1clone.SetMarkerStyle(20)
604 h1clone.GetYaxis().SetRangeUser(0.95, 1.05)
606 h1clone.GetXaxis().SetLabelSize(0.10)
607 h1clone.GetXaxis().SetTitleSize(0.17)
608 h1clone.GetYaxis().SetLabelSize(0.10)
609 h1clone.GetYaxis().SetTitle(
"Ratio")
610 h1clone.GetYaxis().CenterTitle(1)
611 h1clone.GetYaxis().SetTitleSize(0.15)
612 h1clone.GetYaxis().SetTitleOffset(0.3)
613 h1clone.GetYaxis().SetNdivisions(505)
621 c1.SaveAs(type_name +
'_' + variable_name +
".png")
623 c1.Write(type_name +
'_' + variable_name)
626 if __name__ ==
'__main__':
628 gROOT.SetBatch(kTRUE)
631 baseline_file = TFile(sys.argv[1])
632 nightly_file = TFile(sys.argv[2])
633 particle_type = sys.argv[3]
635 output_file = TFile(
"BN_ComparisonPlots_" +
636 particle_type +
".hist.root",
"RECREATE")
638 if particle_type ==
'gamma':
643 output_file,
'truthPhotonConvRecoConvEfficiency',
644 photon_fraction_list,
'ConvertionEff_TrueConv',
645 "Efficiency and fraction", 0., 1.3)
647 baseline_file, nightly_file,
648 output_file,
'truthPhotonUnconvRecoConvEfficiency',
649 photonfake_fraction_list,
'ConvertionEff_TrueUnconv',
650 "Efficiency and fraction", 0., 0.2)
652 baseline_file, nightly_file,
653 output_file,
'truthPhotonRecoPhotonEfficiency',
654 photon_efficiency_list,
'PhotonEff',
655 "Efficiency", 0.8, 1.15)
657 baseline_file, nightly_file, output_file,
658 'InDetTracks', photon_track_list,
'Track',
659 "Tracks", 0., 1.3,
True)
661 baseline_file, nightly_file, output_file,
663 photon_trackTRT_list,
'TrackTRT',
664 "Tracks", 0., 1.3,
True)
666 baseline_file, nightly_file,
667 output_file,
'InDetTrackshighpT',
668 photon_trackhighpT_list,
'TrackhighpT',
669 "Tracks", 0., 1.3,
True)
671 baseline_file, nightly_file,
672 output_file,
'InDetTracksTRThighpT',
673 photon_trackTRThighpT_list,
'TrackTRThighpT',
674 "Tracks", 0., 1.3,
True)
678 nightly_file, output_file)