5 ROOT.gROOT.SetBatch(
True)
6 ROOT.PyConfig.IgnoreCommandLineOptions =
True 8 from plotting
import Subtract, FakeDuplicate, CutEfficiency, Transform, AggregateBins, ROC, Plot, PlotGroup, PlotFolder, Plotter
11 from html
import PlotPurpose
19 _maxEff = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025, 1.2, 1.5, 2]
20 _maxFake = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025]
23 _minMaxResol = [1e-5, 4e-5, 1e-4, 4e-4, 1e-3, 4e-3, 1e-2, 4e-2, 0.1, 0.4, 1]
24 _minMaxN = [5e-1, 5, 5e1, 5e2, 5e3, 5e4, 5e5, 5e6, 5e7, 5e8, 5e9]
27 _maxHits = [5, 10, 20, 40, 60, 80]
28 _minLayers = [0, 5, 10]
29 _maxLayers = [5, 10, 25]
31 _min3DLayers = [0, 5, 10]
32 _max3DLayers = [5, 10, 20]
33 _minPU = [0, 10, 20, 50, 100, 150]
34 _maxPU = [20, 50, 65, 80, 100, 150, 200, 250]
35 _minMaxTracks = [0, 200, 500, 1000, 1500, 2000]
38 _legendDy_2rows = -0.025
39 _legendDy_2rows_3cols = -0.17
40 _legendDy_4rows = 0.09
42 _trackingNumberOfEventsHistogram =
"DQMData/Run 1/Tracking/Run summary/Track/general_trackingParticleRecoAsssociation/tracks" 49 xq +=
" (" + unit +
")" 51 effargs =
dict(xtitle=
"TP "+xq , ytitle=
"efficiency vs "+q , ymax=_maxEff)
52 fakeargs =
dict(xtitle=
"track "+xq, ytitle=
"fake+duplicates rate vs "+q, ymax=_maxFake)
53 effargs.update(common)
54 fakeargs.update(common)
55 effargs.update(effopts)
56 fakeargs.update(fakeopts)
59 Plot(
"effic_vs_"+p, **effargs),
60 Plot(
FakeDuplicate(
"fakeduprate_vs_"+p, assoc=
"num_assoc(recoToSim)_"+p, dup=
"num_duplicate_"+p, reco=
"num_reco_"+p, title=
"fake+duplicates vs "+q), **fakeargs)
72 xq +=
" (" + unit +
")" 76 Plot(
"fakerate_vs_"+p , xtitle=xtitle, ytitle=
"fakerate vs "+q , ymax=_maxFake, **common),
77 Plot(
"duplicatesRate_"+p, xtitle=xtitle, ytitle=
"duplicates rate vs "+q, ymax=_maxFake, **common),
78 Plot(
"pileuprate_"+p , xtitle=xtitle, ytitle=
"pileup rate vs "+q , ymax=_maxFake, **common),
85 args =
dict(xtitle=
"track "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
89 Plot(
"num_reco_"+p , ytitle=
"tracks", **args),
90 Plot(
"num_assoc(recoToSim)_"+p, ytitle=
"true tracks", **args),
91 Plot(
Subtract(
"num_fake_"+p,
"num_reco_"+p,
"num_assoc(recoToSim)_"+p), ytitle=
"fake tracks", **args),
92 Plot(
"num_duplicate_"+p , ytitle=
"duplicate tracks", **args),
99 args =
dict(xtitle=
"TP "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
103 Plot(
"num_simul_"+p , ytitle=
"TrackingParticles", **args),
104 Plot(
"num_assoc(simToReco)_"+p, ytitle=
"Reconstructed TPs", **args),
108 pfix =
"_hp" if hp
else "" 109 pfix2 =
"Hp" if hp
else "" 111 xtitle =
"MVA%d output"%num
112 xtitlecut =
"Cut on MVA%d output"%num
113 args =
dict(xtitle=xtitle, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
116 xtitle=
"Efficiency (excl. trk eff)", ytitle=
"Fake rate",
117 xmax=_maxEff, ymax=_maxFake,
121 ztitle=
"Cut on MVA%d"%num,
122 xtitleoffset=5, ytitleoffset=6.5, ztitleoffset=4,
123 adjustMarginRight=0.12
125 argsroc2.update(argsroc)
126 argsroc2[
"drawStyle"] =
"pcolz" 128 true_cuteff =
CutEfficiency(
"trueeff_vs_mva%dcut%s"%(num,pfix),
"num_assoc(recoToSim)_mva%dcut%s"%(num,pfix))
129 fake_cuteff =
CutEfficiency(
"fakeeff_vs_mva%dcut%s"%(num,pfix),
Subtract(
"num_fake_mva%dcut%s"%(num,pfix),
"num_reco_mva%dcut%s"%(num,pfix),
"num_assoc(recoToSim)_mva%dcut%s"%(num,pfix)))
131 return PlotGroup(
"mva%d%s"%(num,pfix2), [
132 Plot(
"num_assoc(recoToSim)_mva%d%s"%(num,pfix), ytitle=
"true tracks", **args),
133 Plot(
Subtract(
"num_fake_mva%d%s"%(num,pfix),
"num_reco_mva%d%s"%(num,pfix),
"num_assoc(recoToSim)_mva%d%s"%(num,pfix)), ytitle=
"fake tracks", **args),
134 Plot(
"effic_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
136 Plot(
"fakerate_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Fake rate", ymax=_maxFake),
137 Plot(
ROC(
"effic_vs_fake_mva%d%s"%(num,pfix),
"effic_vs_mva%dcut%s"%(num,pfix),
"fakerate_vs_mva%dcut%s"%(num,pfix)), **argsroc),
138 Plot(
ROC(
"effic_vs_fake_mva%d%s"%(num,pfix),
"effic_vs_mva%dcut%s"%(num,pfix),
"fakerate_vs_mva%dcut%s"%(num,pfix), zaxis=
True), **argsroc2),
140 Plot(true_cuteff, xtitle=xtitlecut, ytitle=
"True track selection efficiency", ymax=_maxEff),
141 Plot(fake_cuteff, xtitle=xtitlecut, ytitle=
"Fake track selection efficiency", ymax=_maxEff),
142 Plot(
ROC(
"true_eff_vs_fake_rej_mva%d%s"%(num,pfix), true_cuteff,
Transform(
"fake_rej_mva%d%s"%(num,pfix), fake_cuteff,
lambda x: 1-x)), xtitle=
"True track selection efficiency", ytitle=
"Fake track rejection", xmax=_maxEff, ymax=_maxEff),
143 ], ncols=3, legendDy=_legendDy_1row)
146 Plot(
"efficPt", title=
"Efficiency vs p_{T}", xtitle=
"TP p_{T} (GeV)", ytitle=
"efficiency vs p_{T}", xlog=
True, ymax=_maxEff),
147 Plot(
FakeDuplicate(
"fakeduprate_vs_pT", assoc=
"num_assoc(recoToSim)_pT", dup=
"num_duplicate_pT", reco=
"num_reco_pT", title=
"fake+duplicates vs p_{T}"),
148 xtitle=
"track p_{T} (GeV)", ytitle=
"fake+duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
149 Plot(
"effic", xtitle=
"TP #eta", ytitle=
"efficiency vs #eta", title=
"", ymax=_maxEff),
150 Plot(
FakeDuplicate(
"fakeduprate_vs_eta", assoc=
"num_assoc(recoToSim)_eta", dup=
"num_duplicate_eta", reco=
"num_reco_eta", title=
""),
151 xtitle=
"track #eta", ytitle=
"fake+duplicates rate vs #eta", ymax=_maxFake),
161 legendDy=_legendDy_4rows
168 legendDy=_legendDy_4rows
170 _common = {
"ymin": 0,
"ymax": _maxEff}
173 _makeEffFakeDupPlots(
"zpos" ,
"vert z",
"cm", fakeopts=
dict(xtitle=
"track ref. point z (cm)", ytitle=
"fake+duplicates vs. z")) +
176 legendDy=_legendDy_4rows
180 Plot(
"fakeratePt", xtitle=
"track p_{T} (GeV)", ytitle=
"fakerate vs p_{T}", xlog=
True, ymax=_maxFake),
181 Plot(
"duplicatesRate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
182 Plot(
"pileuprate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"pileup rate vs p_{T}", ymax=_maxFake, xlog=
True),
183 Plot(
"fakerate", xtitle=
"track #eta", ytitle=
"fakerate vs #eta", title=
"", ymax=_maxFake),
184 Plot(
"duplicatesRate", xtitle=
"track #eta", ytitle=
"duplicates rate vs #eta", title=
"", ymax=_maxFake),
185 Plot(
"pileuprate", xtitle=
"track #eta", ytitle=
"pileup rate vs #eta", title=
"", ymax=_maxFake),
194 ncols=3, legendDy=_legendDy_4rows
201 ncols=3, legendDy=_legendDy_4rows
208 ncols=3, legendDy=_legendDy_4rows
210 _seedingLayerSet_common =
dict(removeEmptyBins=
True, xbinlabelsize=8, xinlabeloption=
"d", adjustMarginRight=0.1)
214 ncols=3, legendDy=_legendDy_2rows_3cols
219 "ytitle":
"Fake+pileup rate",
224 _common2.update(_common)
225 _common2[
"drawStyle"] =
"pcolz" 226 _common2[
"ztitleoffset"] = 1.5
227 _common2[
"xtitleoffset"] = 7
228 _common2[
"ytitleoffset"] = 10
229 _common2[
"ztitleoffset"] = 6
231 Plot(
ROC(
"effic_vs_fakepileup_dzpvcut",
"effic_vs_dzpvcut",
FakeDuplicate(
"fakepileup_vs_dzpvcut", assoc=
"num_assoc(recoToSim)_dzpvcut", reco=
"num_reco_dzpvcut", dup=
"num_pileup_dzpvcut")),
232 xtitle=
"Efficiency vs. cut on dz(PV)", **_common),
233 Plot(
ROC(
"effic_vs_fakepileup2_dzpvcut",
"effic_vs_dzpvcut",
FakeDuplicate(
"fakepileup_vs_dzpvcut", assoc=
"num_assoc(recoToSim)_dzpvcut", reco=
"num_reco_dzpvcut", dup=
"num_pileup_dzpvcut"), zaxis=
True),
234 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)", **_common2),
236 Plot(
ROC(
"effic_vs_fakepileup_dzpvsigcut",
"effic_vs_dzpvsigcut",
FakeDuplicate(
"fakepileup_vs_dzpvsigcut", assoc=
"num_assoc(recoToSim)_dzpvsigcut", reco=
"num_reco_dzpvsigcut", dup=
"num_pileup_dzpvsigcut")),
237 xtitle=
"Efficiency vs. cut on dz(PV)/dzError", **_common),
238 Plot(
ROC(
"effic_vs_fakepileup2_dzpvsigcut",
"effic_vs_dzpvsigcut",
FakeDuplicate(
"fakepileup_vs_dzpvsigcut", assoc=
"num_assoc(recoToSim)_dzpvsigcut", reco=
"num_reco_dzpvsigcut", dup=
"num_pileup_dzpvsigcut"), zaxis=
True),
239 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)/dzError", **_common2),
241 Plot(
ROC(
"effic_vs_fakepileup_dzpvcut_pt",
"effic_vs_dzpvcut_pt",
FakeDuplicate(
"fakepileup_vs_dzpvcut_pt", assoc=
"num_assoc(recoToSim)_dzpvcut_pt", reco=
"num_reco_dzpvcut_pt", dup=
"num_pileup_dzpvcut_pt")),
242 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)", **_common),
243 Plot(
ROC(
"effic_vs_fakepileup2_dzpvcut_pt",
"effic_vs_dzpvcut_pt",
FakeDuplicate(
"fakepileup_vs_dzpvcut_pt", assoc=
"num_assoc(recoToSim)_dzpvcut_pt", reco=
"num_reco_dzpvcut_pt", dup=
"num_pileup_dzpvcut_pt"), zaxis=
True),
244 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)", **_common2),
246 Plot(
ROC(
"effic_vs_fakepileup_dzpvsigcut_pt",
"effic_vs_dzpvsigcut_pt",
FakeDuplicate(
"fakepileup_vs_dzpvsigcut_pt", assoc=
"num_assoc(recoToSim)_dzpvsigcut_pt", reco=
"num_reco_dzpvsigcut_pt", dup=
"num_pileup_dzpvsigcut_pt")),
247 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)/dzError", **_common),
248 Plot(
ROC(
"effic_vs_fakepileup2_dzpvsigcut_pt",
"effic_vs_dzpvsigcut_pt",
FakeDuplicate(
"fakepileup_vs_dzpvsigcut_pt", assoc=
"num_assoc(recoToSim)_dzpvsigcut_pt", reco=
"num_reco_dzpvsigcut_pt", dup=
"num_pileup_dzpvsigcut_pt"), zaxis=
True),
249 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)/dzError", **_common2),
250 ], onlyForPileup=
True,
251 legendDy=_legendDy_4rows
254 Plot(
"effic_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency vs. cut on dz(PV)", ymax=_maxEff),
255 Plot(
"effic_vs_dzpvcut2", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
256 Plot(
"fakerate_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate vs. cut on dz(PV)", ymax=_maxFake),
257 Plot(
"pileuprate_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate vs. cut on dz(PV)", ymax=_maxFake),
259 Plot(
"effic_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency vs. cut on dz(PV)/dzError", ymax=_maxEff),
260 Plot(
"effic_vs_dzpvsigcut2", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
261 Plot(
"fakerate_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
262 Plot(
"pileuprate_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
263 ], onlyForPileup=
True,
264 legendDy=_legendDy_4rows
267 Plot(
"effic_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
268 Plot(
"effic_vs_dzpvcut2_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
269 Plot(
"fakerate_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
270 Plot(
"pileuprate_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
272 Plot(
"effic_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
273 Plot(
"effic_vs_dzpvsigcut2_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
274 Plot(
"fakerate_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
275 Plot(
"pileuprate_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
276 ], onlyForPileup=
True,
277 legendDy=_legendDy_4rows
282 _common = {
"normalizeToUnitArea":
True,
"stat":
True,
"drawStyle":
"hist"}
284 Plot(
"h_dedx_estim1", xtitle=
"dE/dx, harm2", **_common),
285 Plot(
"h_dedx_estim2", xtitle=
"dE/dx, trunc40", **_common),
286 Plot(
"h_dedx_nom1", xtitle=
"dE/dx number of measurements", title=
"", **_common),
287 Plot(
"h_dedx_sat1", xtitle=
"dE/dx number of measurements with saturation", title=
"", **_common),
289 legendDy=_legendDy_2rows
293 Plot(
"chargeMisIdRate", xtitle=
"#eta", ytitle=
"charge mis-id rate vs #eta", ymax=0.05),
294 Plot(
"chargeMisIdRate_Pt", xtitle=
"p_{T}", ytitle=
"charge mis-id rate vs p_{T}", xmax=300, ymax=0.1, xlog=
True),
295 Plot(
"chargeMisIdRate_hit", xtitle=
"hits", ytitle=
"charge mis-id rate vs hits", title=
""),
296 Plot(
"chargeMisIdRate_phi", xtitle=
"#phi", ytitle=
"charge mis-id rate vs #phi", title=
"", ymax=0.01),
297 Plot(
"chargeMisIdRate_dxy", xtitle=
"dxy", ytitle=
"charge mis-id rate vs dxy", ymax=0.1),
298 Plot(
"chargeMisIdRate_dz", xtitle=
"dz", ytitle=
"charge mis-id rate vs dz", ymax=0.1)
300 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"ylog":
True,
"ymin": 1e-6,
"drawStyle":
"hist"}
302 Plot(
"missing_inner_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
303 Plot(
"missing_outer_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
304 Plot(
"hits_eta", xtitle=
"track #eta", ytitle=
"<hits> vs #eta", ymin=_minHits, ymax=_maxHits, statyadjust=[0,0,-0.15],
305 fallback={
"name":
"nhits_vs_eta",
"profileX":
True}),
306 Plot(
"hits", stat=
True, xtitle=
"track hits", xmin=_minHits, xmax=_maxHits, ylog=
True, ymin=[5e-1, 5, 5e1, 5e2, 5e3], drawStyle=
"hist"),
307 Plot(
"num_simul_pT", xtitle=
"TP p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common),
308 Plot(
"num_reco_pT", xtitle=
"track p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common)
311 Plot(
"chi2", stat=
True, normalizeToUnitArea=
True, ylog=
True, ymin=1e-6, ymax=[0.1, 0.2, 0.5, 1.0001], drawStyle=
"hist", xtitle=
"#chi^{2}", ratioUncertainty=
False),
312 Plot(
"chi2_prob", stat=
True, normalizeToUnitArea=
True, drawStyle=
"hist", xtitle=
"Prob(#chi^{2})"),
313 Plot(
"chi2mean", title=
"", xtitle=
"#eta", ytitle=
"< #chi^{2} / ndf >", ymin=[0, 0.5], ymax=[2, 2.5, 3, 5],
314 fallback={
"name":
"chi2_vs_eta",
"profileX":
True}),
315 Plot(
"ptres_vs_eta_Mean", scale=100, title=
"", xtitle=
"TP #eta (PCA to beamline)", ytitle=
"< #delta p_{T} / p_{T} > [%]", ymin=-1.5, ymax=1.5)
317 _common = {
"stat":
True,
"fit":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist",
"drawCommand":
"",
"xmin": -10,
"xmax": 10,
"ylog":
True,
"ymin": 5e-5,
"ymax": [0.01, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025],
"ratioUncertainty":
False}
319 Plot(
"pullPt", **_common),
320 Plot(
"pullQoverp", **_common),
321 Plot(
"pullPhi", **_common),
322 Plot(
"pullTheta", **_common),
323 Plot(
"pullDxy", **_common),
324 Plot(
"pullDz", **_common),
326 legendDx=0.1, legendDw=-0.1, legendDh=-0.015
328 _common = {
"title":
"",
"ylog":
True,
"xtitle":
"TP #eta (PCA to beamline)",
"ymin": _minMaxResol,
"ymax": _minMaxResol}
330 Plot(
"phires_vs_eta_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
331 Plot(
"cotThetares_vs_eta_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
332 Plot(
"dxyres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
333 Plot(
"dzres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
334 Plot(
"ptres_vs_eta_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
336 _common = {
"title":
"",
"ylog":
True,
"xlog":
True,
"xtitle":
"TP p_{T} (PCA to beamline)",
"xmin": 0.1,
"xmax": 1000,
"ymin": _minMaxResol,
"ymax": _minMaxResol}
338 Plot(
"phires_vs_pt_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
339 Plot(
"cotThetares_vs_pt_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
340 Plot(
"dxyres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
341 Plot(
"dzres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
342 Plot(
"ptres_vs_pt_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
356 ncols=4, legendDy=_legendDy_4rows)
361 _makeDistPlots(
"3Dlayer" ,
"3D layers" , common=
dict(xmin=_min3DLayers, xmax=_max3DLayers)),
362 ncols=4, legendDy=_legendDy_4rows,
372 _makeDistPlots(
"seedingLayerSet",
"seeding layers", common=
dict(xtitle=
"", **_seedingLayerSet_common)),
373 ncols=4, legendDy=_legendDy_2rows_3cols
375 _common =
dict(title=
"", ytitle=
"Selected tracks/TrackingParticles", ymax=_maxEff)
377 Plot(
"nrec_vs_nsim", title=
"", xtitle=
"TrackingParticles", ytitle=
"Tracks", profileX=
True, xmin=_minMaxTracks, xmax=_minMaxTracks, ymin=_minMaxTracks, ymax=_minMaxTracks),
378 Plot(
"nrecPerNsim_vs_pu", xtitle=
"Pileup", xmin=_minPU, xmax=_maxPU, **_common),
379 Plot(
"nrecPerNsimPt", xtitle=
"p_{T} (GeV)", xlog=
True, **_common),
380 Plot(
"nrecPerNsim", xtitle=
"#eta", **_common)
381 ], legendDy=_legendDy_2rows)
383 Plot(
"PXLhits_vs_eta", xtitle=
"#eta", ytitle=
"<pixel hits>"),
384 Plot(
"PXLlayersWithMeas_vs_eta", xtitle=
"#eta", ytitle=
"<pixel layers>"),
385 Plot(
"STRIPhits_vs_eta", xtitle=
"#eta", ytitle=
"<strip hits>"),
386 Plot(
"STRIPlayersWithMeas_vs_eta", xtitle=
"#eta", ytitle=
"<strip layers>"),
387 ], legendDy=_legendDy_2rows)
401 ncols=2, legendDy=_legendDy_4rows)
407 ncols=2, legendDy=_legendDy_4rows,
422 _possibleTrackingNonIterationColls = [
426 _possibleTrackingColls = [
427 'initialStepPreSplitting',
431 'detachedTripletStep',
442 'jetCoreRegionalStep',
443 'muonSeededStepInOut',
444 'muonSeededStepOutIn',
446 ] + _possibleTrackingNonIterationColls
447 _possibleTrackingCollsOld = {
461 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
462 for (old, new)
in [(
"InitialStep",
"Zero"),
463 (
"LowPtTripletStep",
"First"),
464 (
"PixelPairStep",
"Second"),
465 (
"MixedTripletStep",
"Fourth"),
466 (
"MuonSeededStepInOut",
"Ninth"),
467 (
"MuonSeededStepOutIn",
"Tenth")]:
469 ret = ret.replace(old, new)
474 for (old, new)
in [(
"initialStep",
"iter0"),
475 (
"lowPtTripletStep",
"iter1"),
476 (
"pixelPairStep",
"iter2"),
477 (
"mixedTripletStep",
"iter4"),
478 (
"muonSeededStepInOut",
"iter9"),
479 (
"muonSeededStepOutIn",
"iter10")]:
480 path = path.replace(old, new)
484 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
485 for (old, new)
in [(
"InitialStep",
"Zero"),
486 (
"HighPtTripletStep",
"First"),
487 (
"LowPtQuadStep",
"Second"),
488 (
"LowPtTripletStep",
"Third"),
489 (
"DetachedQuadStep",
"Fourth"),
490 (
"PixelPairStep",
"Fifth"),
491 (
"MuonSeededStepInOut",
"Ninth"),
492 (
"MuonSeededStepOutIn",
"Tenth")]:
493 ret = ret.replace(old, new)
498 for (old, new)
in [(
"initialStep",
"iter0"),
499 (
"highPtTripletStep",
"iter1"),
500 (
"lowPtQuadStep",
"iter2"),
501 (
"lowPtTripletStep",
"iter3"),
502 (
"detachedQuadStep",
"iter4"),
503 (
"pixelPairStep",
"iter5"),
504 (
"muonSeededStepInOut",
"iter9"),
505 (
"muonSeededStepOutIn",
"iter10")]:
506 path = path.replace(old, new)
510 return subfolder.replace(
"trackingParticleRecoAsssociation",
"trackingParticleRecoAsssociationSignal")
512 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsConversion")
516 quality =
"highPurity" 519 hasPtCut =
"Pt09" in collName
520 collNameNoQuality = collName.replace(
"Hp",
"")
523 collNameNoQuality = collNameNoQuality.replace(
"Pt09",
"")
524 if "ByOriginalAlgo" in collName:
525 quality +=
"ByOriginalAlgo" 526 collNameNoQuality = collNameNoQuality.replace(
"ByOriginalAlgo",
"")
527 if "ByAlgoMask" in collName:
528 quality +=
"ByAlgoMask" 529 collNameNoQuality = collNameNoQuality.replace(
"ByAlgoMask",
"")
530 collNameNoQuality = collNameNoQuality.replace(
"Tracks",
"", 1)
533 if collNameLow.find(
"seed") == 0:
535 raise Exception(
"Assumption of empty quality for seeds failed, got quality '%s'" % quality)
536 collNameLow = collNameLow[4:]
537 if collNameLow ==
"initialstepseedspresplitting":
538 collNameLow =
"initialsteppresplittingseeds" 539 elif collNameLow ==
"muonseededseedsinout":
540 collNameLow =
"muonseededstepinoutseeds" 541 elif collNameLow ==
"muonseededseedsoutin":
542 collNameLow =
"muonseededstepoutinseeds" 544 i_seeds = collNameLow.index(
"seeds")
545 quality = collNameLow[i_seeds:]
547 collNameLow = collNameLow[:i_seeds]
550 prefixes = [
"cutsreco",
"cutsrecofrompv",
"cutsrecofrompv2",
"cutsrecofrompvalltp"]
551 if collNameLow
in [
"general",
"generalfrompv"]+prefixes:
556 if coll == collNameLow.replace(pfx,
""):
560 for coll
in _possibleTrackingColls:
561 if testColl(coll.lower()):
566 for coll, name
in _possibleTrackingCollsOld.iteritems():
567 if testColl(coll.lower()):
573 algo = collNameNoQuality
576 if algo ==
"muonSeededInOut":
577 algo =
"muonSeededStepInOut" 578 if algo ==
"muonSeededOutIn":
579 algo =
"muonSeededStepOutIn" 581 return (algo, quality)
584 return (name, [name])
585 _collLabelMap = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+_possibleTrackingColls))
586 _collLabelMapHp = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+
filter(
lambda n:
"Step" in n, _possibleTrackingColls)))
590 algo =
"generalTracks" 594 if algo !=
"generalTracks" and "ByOriginalAlgo" not in quality:
596 quality = quality.replace(
"ByOriginalAlgo",
"")
598 if algo !=
"generalTracks" and "ByAlgoMask" not in quality:
600 quality = quality.replace(
"ByAlgoMask",
"")
602 if algo !=
"generalTracks" and "Pt09" not in quality:
604 quality = quality.replace(
"Pt09",
"")
607 if quality ==
"highPurity":
610 i_seeds = quality.find(
"seeds")
613 seedSubColl = quality[i_seeds+5:]
614 if seedSubColl !=
"":
615 ret += seedSubColl[0].
upper() + seedSubColl[1:]
622 def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix=""):
623 _common = {
"drawStyle":
"EP",
"xbinlabelsize": 10,
"xbinlabeloption":
"d"}
624 _commonN =
dict(ylog=
True, ymin=_minMaxN, ymax=_minMaxN,
625 normalizeToNumberOfEvents=
True,
627 _commonN.update(_common)
628 _commonAB =
dict(mapping=mapping,
629 renameBin=
lambda bl:
_summaryBinRename(bl, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds),
630 ignoreMissingBins=
True,
633 if byOriginalAlgo
or byAlgoMask:
634 _commonAB[
"minExistingBins"] = 2
635 prefix =
"summary"+midfix
637 h_eff =
"effic_vs_coll" 638 h_eff_allpt =
"effic_vs_coll_allPt" 639 h_fakerate =
"fakerate_vs_coll" 640 h_duplicaterate =
"duplicatesRate_coll" 641 h_pileuprate =
"pileuprate_coll" 643 h_reco =
"num_reco_coll" 644 h_true =
"num_assoc(recoToSim)_coll" 645 h_fake =
Subtract(
"num_fake_coll_orig",
"num_reco_coll",
"num_assoc(recoToSim)_coll")
646 h_duplicate =
"num_duplicate_coll" 647 h_pileup =
"num_pileup_coll" 648 if mapping
is not None:
650 h_eff_allpt =
AggregateBins(
"efficiencyAllPt", h_eff_allpt, **_commonAB)
651 h_fakerate =
AggregateBins(
"fakerate", h_fakerate, **_commonAB)
652 h_duplicaterate =
AggregateBins(
"duplicatesRate", h_duplicaterate, **_commonAB)
653 h_pileuprate =
AggregateBins(
"pileuprate", h_pileuprate, **_commonAB)
658 h_duplicate =
AggregateBins(
"num_duplicate_coll", h_duplicate, **_commonAB)
659 h_pileup =
AggregateBins(
"num_pileup_coll", h_pileup, **_commonAB)
662 Plot(h_eff, title=
"Efficiency vs collection", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
663 Plot(h_eff_allpt, title=
"Efficiency vs collection (no pT cut in denominator)", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
665 Plot(h_fakerate, title=
"Fakerate vs collection", ytitle=
"Fake rate", ymax=_maxFake, **_common),
666 Plot(h_duplicaterate, title=
"Duplicates rate vs collection", ytitle=
"Duplicates rate", ymax=_maxFake, **_common),
667 Plot(h_pileuprate, title=
"Pileup rate vs collection", ytitle=
"Pileup rate", ymax=_maxFake, **_common),
669 summaryN =
PlotGroup(prefix+
"_ntracks", [
670 Plot(h_reco, ytitle=
"Tracks/event", title=
"Number of tracks/event vs collection", **_commonN),
671 Plot(h_true, ytitle=
"True tracks/event", title=
"Number of true tracks/event vs collection", **_commonN),
672 Plot(h_fake, ytitle=
"Fake tracks/event", title=
"Number of fake tracks/event vs collection", **_commonN),
673 Plot(h_duplicate, ytitle=
"Duplicate tracks/event", title=
"Number of duplicate tracks/event vs collection", **_commonN),
674 Plot(h_pileup, ytitle=
"Pileup tracks/event", title=
"Number of pileup tracks/event vs collection", **_commonN),
677 return (summary, summaryN)
682 (_summaryByOriginalAlgo, _summaryByOriginalAlgoN) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo")
683 (_summaryByOriginalAlgoHp, _summaryByOriginalAlgoNHp) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo", highPurity=
True)
684 (_summaryByAlgoMask, _summaryByAlgoMaskN) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask")
685 (_summaryByAlgoMaskHp, _summaryByAlgoMaskNHp) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask", highPurity=
True)
686 (_summaryPt09, _summaryPt09N) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09")
687 (_summaryPt09Hp, _summaryPt09NHp) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09", highPurity=
True)
696 _common = {
"normalizeToUnitArea":
True,
"ylog":
True,
"ymin": [1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2],
"ymax": [1e-2, 1e-1, 1.1]}
698 _commonStatus.update(_common)
699 _commonStatus.update({
"xbinlabelsize": 10,
"xbinlabeloption":
"d",
"drawStyle":
"hist",
"adjustMarginRight": 0.08})
700 _commonLabelSize = {}
701 _commonLabelSize.update(_common)
702 _commonLabelSize.update({
"xlabelsize": 17})
705 Plot(
"selectionFlow", xbinlabelsize=10, xbinlabeloption=
"d", adjustMarginRight=0.1, drawStyle=
"hist", ylog=
True, ymin=[0.9, 9, 9e1, 9e2, 9e3, 9e4, 9e5, 9e6, 9e7]),
706 Plot(
"diffCharge", xtitle=
"Charge", **_common),
707 Plot(
"diffIsHighPurity", xtitle=
"High purity status", **_common),
708 Plot(
"diffNdof", xtitle=
"ndof", **_common),
709 Plot(
"diffNormalizedChi2", xtitle=
"#chi^{2}/ndof", **_common),
712 _packedCandidateHitsHitPattern =
PlotGroup(
"hitsHitPattern", [
713 Plot(
"diffHitPatternNumberOfValidHits", xtitle=
"Valid hits (via HitPattern)", **_common),
714 Plot(
"diffHitPatternNumberOfValidPixelHits", xtitle=
"Valid pixel hits (via HitPattern)", **_common),
715 Plot(
"diffHitPatternHasValidHitInFirstPixelBarrel", xtitle=
"Has valid hit in BPix1 layer (via HitPattern)", **_common),
716 Plot(
"diffHitPatternNumberOfLostPixelHits", xtitle=
"Lost pixel hits (via HitPattern)", **_common),
718 legendDy=_legendDy_2rows
721 Plot(
"diffNumberOfHits", xtitle=
"Hits", **_common),
722 Plot(
"diffNumberOfPixelHits", xtitle=
"Pixel hits", **_common),
723 Plot(
"diffLostInnerHits", xtitle=
"Lost inner hits", **_common),
724 Plot(
"numberHitsOverMax", xtitle=
"Number of overflown hits", **_common),
725 Plot(
"numberPixelHitsOverMax", xtitle=
"Number of overflown pixel hits", **_common),
726 Plot(
"numberStripHitsOverMax", xtitle=
"Number of overflown strip hits", **_common),
728 ncols=3, legendDy=_legendDy_2rows_3cols
731 _packedCandidateImpactParameter1 =
PlotGroup(
"impactParameter1", [
732 Plot(
"diffDxyAssocPV", xtitle=
"dxy(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
733 Plot(
"diffDxyAssocPVStatus", **_commonStatus),
734 Plot(
"diffDxyAssocPVUnderOverFlowSign", xtitle=
"dxy(assocPV)", **_common),
735 Plot(
"diffDzAssocPV", xtitle=
"dz(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
736 Plot(
"diffDzAssocPVStatus", **_commonStatus),
737 Plot(
"diffDzAssocPVUnderOverFlowSign", xtitle=
"dz(assocPV)", **_common),
738 Plot(
"diffDxyError", xtitle=
"dxyError()", adjustMarginRight=0.02, **_commonLabelSize),
739 Plot(
"diffDszError", xtitle=
"dszError()", adjustMarginRight=0.02, **_commonLabelSize),
740 Plot(
"diffDzError", xtitle=
"dzError()", adjustMarginRight=0.02, **_commonLabelSize),
746 _packedCandidateImpactParameter2 =
PlotGroup(
"impactParameter2", [
747 Plot(
"diffDxyPV", xtitle=
"dxy(PV) via PC", **_commonLabelSize),
748 Plot(
"diffDzPV", xtitle=
"dz(PV) via PC", **_commonLabelSize),
749 Plot(
"diffTrackDxyAssocPV", xtitle=
"dxy(PV) via PC::bestTrack()", **_commonLabelSize),
750 Plot(
"diffTrackDzAssocPV", xtitle=
"dz(PV) via PC::bestTrack()", **_commonLabelSize),
751 Plot(
"diffTrackDxyError", xtitle=
"dxyError() via PC::bestTrack()", adjustMarginRight=0.02, **_commonLabelSize),
752 Plot(
"diffTrackDzError", xtitle=
"dzError() via PC::bestTrack()", **_commonLabelSize),
755 _packedCandidateCovarianceMatrix1 =
PlotGroup(
"covarianceMatrix1", [
756 Plot(
"diffCovQoverpQoverp", xtitle=
"cov(qoverp, qoverp)", **_commonLabelSize),
757 Plot(
"diffCovQoverpQoverpStatus", **_commonStatus),
758 Plot(
"diffCovQoverpQoverpUnderOverFlowSign", xtitle=
"cov(qoverp, qoverp)", **_common),
759 Plot(
"diffCovLambdaLambda", xtitle=
"cov(lambda, lambda)", **_commonLabelSize),
760 Plot(
"diffCovLambdaLambdaStatus", **_commonStatus),
761 Plot(
"diffCovLambdaLambdaUnderOverFlowSign", xtitle=
"cov(lambda, lambda)", **_common),
762 Plot(
"diffCovLambdaDsz", xtitle=
"cov(lambda, dsz)", **_commonLabelSize),
763 Plot(
"diffCovLambdaDszStatus", **_commonStatus),
764 Plot(
"diffCovLambdaDszUnderOverFlowSign", xtitle=
"cov(lambda, dsz)", **_common),
765 Plot(
"diffCovPhiPhi", xtitle=
"cov(phi, phi)", **_commonLabelSize),
766 Plot(
"diffCovPhiPhiStatus", **_commonStatus),
767 Plot(
"diffCovPhiPhiUnderOverFlowSign", xtitle=
"cov(phi, phi)", **_common),
769 ncols=3, legendDy=_legendDy_4rows
771 _packedCandidateCovarianceMatrix2 =
PlotGroup(
"covarianceMatrix2", [
772 Plot(
"diffCovPhiDxy", xtitle=
"cov(phi, dxy)", **_commonLabelSize),
773 Plot(
"diffCovPhiDxyStatus", **_commonStatus),
774 Plot(
"diffCovPhiDxyUnderOverFlowSign", xtitle=
"cov(phi, dxy)", **_common),
775 Plot(
"diffCovDxyDxy", xtitle=
"cov(dxy, dxy)", adjustMarginRight=0.02, **_commonLabelSize),
776 Plot(
"diffCovDxyDxyStatus", **_commonStatus),
777 Plot(
"diffCovDxyDxyUnderOverFlowSign", xtitle=
"cov(dxy, dxy)", **_common),
778 Plot(
"diffCovDxyDsz", xtitle=
"cov(dxy, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
779 Plot(
"diffCovDxyDszStatus", **_commonStatus),
780 Plot(
"diffCovDxyDszUnderOverFlowSign", xtitle=
"cov(dxy, dsz)", **_common),
781 Plot(
"diffCovDszDsz", xtitle=
"cov(dsz, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
782 Plot(
"diffCovDszDszStatus", **_commonStatus),
783 Plot(
"diffCovDszDszUnderOverFlowSign", xtitle=
"cov(dsz, dsz)", **_common),
785 ncols=3, legendDy=_legendDy_4rows
788 _common[
"xlabelsize"] = 16
790 Plot(
"diffVx", xtitle=
"Reference point x", **_common),
791 Plot(
"diffVy", xtitle=
"Reference point y", **_common),
792 Plot(
"diffVz", xtitle=
"Reference point z", **_common),
794 legendDy=_legendDy_2rows
797 _common[
"adjustMarginRight"] = 0.05
799 Plot(
"diffPt", xtitle=
"p_{T}", **_common),
800 Plot(
"diffPtError", xtitle=
"p_{T} error", **_common),
801 Plot(
"diffEta", xtitle=
"#eta", **_common),
802 Plot(
"diffEtaError", xtitle=
"#eta error", **_common),
803 Plot(
"diffPhi", xtitle=
"#phi", **_common),
809 PlotFolder.__init__(self, *args, **kwargs)
812 spl = dqmSubFolderName.split(
"_")
819 (algoOrig, quality) = translatedDqmSubFolder
825 if plotFolderName !=
"":
826 ret +=
"_"+plotFolderName
829 if not (algo ==
"ootb" and quality !=
""):
834 """Return True if this subfolder should be processed 837 limitOnlyTo -- Function '(algo, quality) -> bool' 838 translatedDqmSubFolder -- Return value of translateSubFolder 840 (algo, quality) = translatedDqmSubFolder
841 return limitOnlyTo(algo, quality)
845 return algo
not in _possibleTrackingNonIterationColls
853 def __init__(self, section, collection=GeneralTracks):
869 def _getAlgoQuality(data, algo, quality):
870 for label, value
in data.iteritems():
872 if a == algo
and q == quality:
876 h = tdirectory.Get(hname)
881 return _getAlgoQuality(data,
"ootb",
"")
883 return _getAlgoQuality(data,
"ootb",
"highPurity")
885 return _getAlgoQuality(data,
"btvLike",
"")
887 return _getAlgoQuality(data,
"ak4PFJets",
"")
890 def _formatOrNone(num, func):
895 n_tps = _formatOrNone(_getN(
"num_simul_coll"), int)
896 n_m_tps = _formatOrNone(_getN(
"num_assoc(simToReco)_coll"), int)
898 n_tracks = _formatOrNone(_getN(
"num_reco_coll"), int)
899 n_true = _formatOrNone(_getN(
"num_assoc(recoToSim)_coll"), int)
900 if n_tracks
is not None and n_true
is not None:
901 n_fake = n_tracks-n_true
904 n_pileup = _formatOrNone(_getN(
"num_pileup_coll"), int)
905 n_duplicate = _formatOrNone(_getN(
"num_duplicate_coll"), int)
907 eff = _formatOrNone(_getN(
"effic_vs_coll"),
lambda n:
"%.4f" % n)
908 eff_nopt = _formatOrNone(_getN(
"effic_vs_coll_allPt"),
lambda n:
"%.4f" % n)
909 fake = _formatOrNone(_getN(
"fakerate_vs_coll"),
lambda n:
"%.4f" % n)
910 duplicate = _formatOrNone(_getN(
"duplicatesRate_coll"),
lambda n:
"%.4f" % n)
912 ret = [eff, n_tps, n_m_tps,
913 eff_nopt, fake, duplicate,
914 n_tracks, n_true, n_fake, n_pileup, n_duplicate]
915 if ret.count(
None) == len(ret):
922 "Number of TrackingParticles (after cuts)",
923 "Number of matched TrackingParticles",
924 "Efficiency (w/o pT cut)",
928 "Number of true tracks",
929 "Number of fake tracks",
930 "Number of pileup tracks",
931 "Number of duplicate tracks" 936 "DQMData/Run 1/Tracking/Run summary/"+lastDirName,
937 "DQMData/Tracking/"+lastDirName,
938 "DQMData/Run 1/RecoTrackV/Run summary/"+lastDirName,
939 "DQMData/RecoTrackV/"+lastDirName,
965 _seedingBuildingPlots = _simBasedPlots + [
994 _summaryByOriginalAlgo,
995 _summaryByOriginalAlgoN,
1004 _summaryByOriginalAlgoHp,
1005 _summaryByOriginalAlgoNHp,
1006 _summaryByAlgoMaskHp,
1007 _summaryByAlgoMaskNHp,
1011 _summaryPlotsSeeds = [
1015 _packedCandidatePlots = [
1016 _packedCandidateFlow,
1017 _packedCandidateKinematics,
1018 _packedCandidateVertex,
1019 _packedCandidateImpactParameter1,
1020 _packedCandidateImpactParameter2,
1021 _packedCandidateCovarianceMatrix1,
1022 _packedCandidateCovarianceMatrix2,
1023 _packedCandidateHits,
1024 _packedCandidateHitsHitPattern,
1028 def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, seeding=False, rawSummary=False):
1031 limiters =
dict(onlyForPileup=onlyForPileup, onlyForElectron=onlyForElectron, onlyForConversion=onlyForConversion)
1034 _trackingRefFileFallbackSLHC_Phase1PU140
1036 common =
dict(fallbackDqmSubFolders=[
1038 _trackingSubFoldersFallbackSLHC_Phase1PU140,
1039 _trackingSubFoldersFallbackFromPV, _trackingSubFoldersFallbackConversion])
1040 plotter.append(name, folders,
TrackingPlotFolder(*algoPlots, **commonForTPF), **common)
1041 plotterExt.append(name, folders,
TrackingPlotFolder(*_extendedPlots, **commonForTPF), **common)
1045 summaryName += name+
"_" 1046 summaryName +=
"summary" 1049 summaryPlots.extend([_summaryRaw, _summaryRawN])
1050 summaryPlots.extend(_summaryPlots)
1052 common =
dict(loopSubFolders=
False, purpose=
PlotPurpose.TrackingSummary, page=
"summary", numberOfEventsHistogram=_trackingNumberOfEventsHistogram, **limiters)
1053 plotter.append(summaryName, folders,
1054 PlotFolder(*summaryPlots, section=name, **common))
1055 plotter.append(summaryName+
"_highPurity", folders,
1056 PlotFolder(*_summaryPlotsHp, section=name+
"_highPurity" if name !=
"" else "highPurity", **common),
1057 fallbackNames=[summaryName])
1059 plotter.append(summaryName+
"_seeds", folders,
1060 PlotFolder(*_summaryPlotsSeeds, section=name+
"_seeds", **common))
1069 _appendTrackingPlots(
"TrackFromPV",
"fromPV", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1070 _appendTrackingPlots(
"TrackFromPVAllTP",
"fromPVAllTP", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1071 _appendTrackingPlots(
"TrackFromPVAllTP2",
"fromPVAllTP2", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1074 _appendTrackingPlots(
"TrackConversion",
"conversion", _simBasedPlots+_recoBasedPlots, onlyForConversion=
True, rawSummary=
True)
1075 _appendTrackingPlots(
"TrackGsf",
"gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=
True, rawSummary=
True)
1079 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1081 plotter.append(
"packedCandidateLostTracks",
_trackingFolders(
"PackedCandidate/lostTracks"),
1082 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1087 "DQMData/Run 1/HLT/Run summary/Tracking/ValidationWRTtp",
1092 plotterHLT.append(
"hlt", _hltFolder,
TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
1093 plotterHLTExt.append(
"hlt", _hltFolder,
TrackingPlotFolder(*_extendedPlots, **_common))
1097 def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[]):
1100 def _set(param, name, modules):
1101 if param
is not None:
1102 setattr(self, name, param)
1104 setattr(self, name, modules)
1106 _set(clusterMasking,
"_clusterMasking", [self.
_name+
"Clusters"])
1109 _set(seeding,
"_seeding", [self.
_name+
"SeedingLayers", self.
_name+
"TrackingRegions", self.
_name+
"HitDoublets", self.
_name+
"HitTriplets", self.
_name+
"HitQuadruplets", self.
_name+
"Seeds"])
1110 _set(building,
"_building", [self.
_name+
"TrackCandidates"])
1111 _set(fit,
"_fit", [self.
_name+
"Tracks"])
1112 _set(selection,
"_selection", [self.
_name])
1119 return self._clusterMasking+self._seeding+self._building+self._fit+self._selection+self.
_other 1122 return self._clusterMasking
1125 return self._seeding
1128 return self._building
1134 return self._selection
1143 (
"Fit", self.
fit()),
1145 (
"Other", self.
other())]
1150 seeding=[
"initialStepSeedLayersPreSplitting",
1151 "initialStepTrackingRegionsPreSplitting",
1152 "initialStepHitDoubletsPreSplitting",
1153 "initialStepHitTripletsPreSplitting",
1154 "initialStepHitQuadrupletsPreSplitting",
1155 "initialStepSeedsPreSplitting"],
1156 building=[
"initialStepTrackCandidatesPreSplitting"],
1157 fit=[
"initialStepTracksPreSplitting"],
1158 other=[
"firstStepPrimaryVerticesPreSplitting",
1159 "initialStepTrackRefsForJetsPreSplitting",
1160 "caloTowerForTrkPreSplitting",
1161 "ak4CaloJetsForTrkPreSplitting",
1162 "jetsForCoreTrackingPreSplitting",
1165 "MeasurementTrackerEvent",
1166 "siPixelClusterShapeCache"]),
1167 Iteration(
"initialStep", clusterMasking=[],
1168 selection=[
"initialStepClassifier1",
1169 "initialStepClassifier2",
1170 "initialStepClassifier3",
1172 other=[
"firstStepPrimaryVertices"]),
1174 selection=[
"highPtTripletStepClassifier1",
1175 "highPtTripletStepClassifier2",
1176 "highPtTripletStepClassifier3",
1177 "highPtTripletStep"]),
1179 selection=[
"detachedQuadStepClassifier1",
1180 "detachedQuadStepClassifier2",
1181 "detachedQuadStep"]),
1183 selection=[
"detachedTripletStepClassifier1",
1184 "detachedTripletStepClassifier2",
1185 "detachedTripletStep"]),
1190 seeding=[
"mixedTripletStepSeedLayersA",
1191 "mixedTripletStepSeedLayersB",
1192 "mixedTripletStepTrackingRegionsA",
1193 "mixedTripletStepTrackingRegionsB",
1194 "mixedTripletStepHitDoubletsA",
1195 "mixedTripletStepHitDoubletsB",
1196 "mixedTripletStepHitTripletsA",
1197 "mixedTripletStepHitTripletsB",
1198 "mixedTripletStepSeedsA",
1199 "mixedTripletStepSeedsB",
1200 "mixedTripletStepSeeds"],
1201 selection=[
"mixedTripletStepClassifier1",
1202 "mixedTripletStepClassifier2",
1203 "mixedTripletStep"]),
1205 selection=[
"pixelLessStepClassifier1",
1206 "pixelLessStepClassifier2",
1209 seeding=[
"tobTecStepSeedLayersTripl",
1210 "tobTecStepSeedLayersPair",
1211 "tobTecStepTrackingRegionsTripl",
1212 "tobTecStepTrackingRegionsPair",
1213 "tobTecStepHitDoubletsTripl",
1214 "tobTecStepHitDoubletsPair",
1215 "tobTecStepHitTripletsTripl",
1216 "tobTecStepSeedsTripl",
1217 "tobTecStepSeedsPair",
1219 selection=[
"tobTecStepClassifier1",
1220 "tobTecStepClassifier2",
1224 other=[
"initialStepTrackRefsForJets",
1226 "jetsForCoreTracking",
1227 "firstStepGoodPrimaryVertices",
1231 seeding=[
"muonSeededSeedsInOut",
1232 "muonSeededSeedsOutIn"],
1233 building=[
"muonSeededTrackCandidatesInOut",
1234 "muonSeededTrackCandidatesOutIn"],
1235 fit=[
"muonSeededTracksInOut",
1236 "muonSeededTracksOutIn"],
1237 selection=[
"muonSeededTracksInOutClassifier",
1238 "muonSeededTracksOutIntClassifier"],
1242 clusterMasking=[], seeding=[],
1243 building=[
"duplicateTrackCandidates"],
1244 fit=[
"mergedDuplicateTracks"],
1245 selection=[
"duplicateTrackClassifier"]),
1247 clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1248 other=[
"preDuplicateMergingGeneralTracks",
1251 clusterMasking=[
"convClusters"],
1252 seeding=[
"convLayerPairs",
1253 "photonConvTrajSeedFromSingleLeg"],
1254 building=[
"convTrackCandidates"],
1255 fit=[
"convStepTracks"],
1256 selection=[
"convStepSelector"]),
1257 Iteration(
"Other", clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1258 other=[
"trackerClusterCheckPreSplitting",
1259 "trackerClusterCheck"]),
1263 iterations = _iterations
1264 if not includeConvStep:
1265 iterations =
filter(
lambda i: i.name() !=
"ConvStep", iterations)
1267 iterations =
filter(
lambda i: i.name() ==
"ConvStep", iterations)
1268 return collections.OrderedDict([(i.name(), i.all())
for i
in iterations])
1272 for i
in _iterations:
1273 if i.name() ==
"ConvStep":
1275 ret.extend(getattr(i, prop)())
1278 return collections.OrderedDict([
1279 (
"ClusterMask", getProp(
"clusterMasking")),
1280 (
"Seeding", getProp(
"seeding")),
1281 (
"Building", getProp(
"building")),
1282 (
"Fitting", getProp(
"fit")),
1283 (
"Selection", getProp(
"selection")),
1284 (
"Other", getProp(
"other"))
1303 h = tdirectory.Get(
"reconstruction_step_module_average")
1306 totalReco =
"%.1f" % h.Integral()
1308 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(includeConvStep=
False), ignoreMissingBins=
True)
1309 h = creator.create(tdirectory)
1310 totalTracking =
None 1312 totalTracking =
"%.1f" % h.Integral()
1314 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(onlyConvStep=
True), ignoreMissingBins=
True)
1315 h = creator.create(tdirectory)
1316 totalConvStep =
None 1318 totalConvStep =
"%.1f" % h.Integral()
1328 "Average reco time / event (ms)",
1329 "Average tracking (w/o convStep) time / event (ms)",
1330 "Average convStep time / event (ms)",
1333 def __init__(self, name, timeHisto, selectedTracks=False):
1343 tdir = tfile.Get(dirName)
1355 tfile = tdirectory.GetFile()
1360 iterMap = copy.copy(_collLabelMapHp)
1361 del iterMap[
"generalTracks"]
1362 del iterMap[
"jetCoreRegionalStep"]
1364 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
True, byOriginalAlgo=
False, byAlgoMask=
True, ptCut=
False, seeds=
False)
1366 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
False, byOriginalAlgo=
False, byAlgoMask=
False, ptCut=
False, seeds=
False)
1367 recoAB =
AggregateBins(
"tmp",
"num_reco_coll", mapping=iterMap,ignoreMissingBins=
True, renameBin=renameBin)
1368 h_reco_per_iter = recoAB.create(trkDir)
1369 if h_reco_per_iter
is None:
1372 for i
in xrange(1, h_reco_per_iter.GetNbinsX()+1):
1373 values[h_reco_per_iter.GetXaxis().GetBinLabel(i)] = h_reco_per_iter.GetBinContent(i)
1377 for i
in xrange(1, timeTh1.GetNbinsX()+1):
1378 iterName = timeTh1.GetXaxis().GetBinLabel(i)
1379 if iterName
in values:
1380 ntrk = values[iterName]
1381 result.append( (iterName,
1382 timeTh1.GetBinContent(i)/ntrk
if ntrk > 0
else 0,
1383 timeTh1.GetBinError(i)/ntrk
if ntrk > 0
else 0) )
1385 if len(result) == 0:
1388 res = ROOT.TH1F(self.
_name, self.
_name, len(result), 0, len(result))
1389 for i, (label, value, error)
in enumerate(result):
1390 res.GetXaxis().SetBinLabel(i+1, label)
1391 res.SetBinContent(i+1, value)
1392 res.SetBinError(i+1, error)
1398 "xbinlabelsize": 10,
1399 "xbinlabeloption":
"d" 1403 Plot(_time_per_iter,
1404 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", legendDx=-0.4, **_common),
1406 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1409 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", **_common),
1411 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1414 ytitle=
"Average time / built track (ms)", title=
"Average time / built track", **_common),
1416 ytitle=
"Average time / selected track (ms)", title=
"Average time / selected HP track by algoMask", **_common),
1423 Plot(
AggregateBins(i.name(),
"reconstruction_step_module_average", collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1424 ytitle=
"Average processing time (ms)", title=i.name(), **_common)
1425 for i
in _iterations
1427 ncols=4, legend=
False 1430 Plot(
AggregateBins(
"pixel",
"reconstruction_step_module_average", {
"pixelTracks": [
"pixelTracks"]}), ytitle=
"Average processing time [ms]", title=
"Average processing time / event", drawStyle=
"HIST")
1434 "DQMData/Run 1/DQM/Run summary/TimerService/Paths",
1435 "DQMData/Run 1/DQM/Run summary/TimerService/process RECO/Paths",
1438 timePlotter.append(
"timing", _timeFolders,
PlotFolder(
1446 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist"}
1448 Plot(
"TPlip", xtitle=
"TP lip", **_common),
1449 Plot(
"TPtip", xtitle=
"TP tip", **_common),
1453 tpPlotter.append(
"tp", [
1454 "DQMData/Run 1/Tracking/Run summary/TrackingMCTruth/TrackingParticle",
1455 "DQMData/Tracking/TrackingMCTruth/TrackingParticle",
def iterSelectionName(self, plotFolderName, translatedDqmSubFolder)
def create(self, tdirectory)
def getSection(self, dqmSubFolder)
def _makeFakeDupPileupPlots(postfix, quantity, unit="", xquantity="", xtitle=None, common={})
def _getOrCreateObject(tdirectory, nameOrCreator)
def _iterModuleMap(includeConvStep=True, onlyConvStep=False)
def replace(string, replacements)
def _getDirectory(self, tfile)
def _makeDistSimPlots(postfix, quantity, common={})
def _trackingSubFoldersFallbackSLHC_Phase1PU70_OldMapping(subfolder)
def getSection(self, dqmSubFolder)
def _summaryBinRename(binLabel, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds)
def isAlgoIterative(self, algo)
def translateSubFolder(self, dqmSubFolderName)
def _mapCollectionToAlgoQuality(collName)
def __init__(self, section, collection=GeneralTracks)
def __init__(self, args, kwargs)
def _trackingSubFoldersFallbackConversion(subfolder)
def _trackingSubFoldersFallbackSLHC_Phase1PU140(subfolder)
def create(self, tdirectory)
def _trackingRefFileFallbackSLHC_Phase1PU70_OldMapping(path)
def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder)
def __init__(self, name, timeHisto, selectedTracks=False)
def _makeMVAPlots(num, hp=False)
def _trackingRefFileFallbackSLHC_Phase1PU140(path)
def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix="")
def _trackingSubFoldersFallbackFromPV(subfolder)
def _makeDistPlots(postfix, quantity, common={})
def create(self, tdirectory)
def _trackingFolders(lastDirName="Track")
def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[])
def _makeEffFakeDupPlots(postfix, quantity, unit="", common={}, effopts={}, fakeopts={})
def _th1ToOrderedDict(th1, renameBin=None)
def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, seeding=False, rawSummary=False)