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',
445 'jetCoreRegionalStep',
446 'muonSeededStepInOut',
447 'muonSeededStepOutIn',
449 ] + _possibleTrackingNonIterationColls
450 _possibleTrackingCollsOld = {
464 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
465 for (old, new)
in [(
"InitialStep",
"Zero"),
466 (
"HighPtTripletStep",
"First"),
467 (
"LowPtQuadStep",
"Second"),
468 (
"LowPtTripletStep",
"Third"),
469 (
"DetachedQuadStep",
"Fourth"),
470 (
"PixelPairStep",
"Fifth"),
471 (
"MuonSeededStepInOut",
"Ninth"),
472 (
"MuonSeededStepOutIn",
"Tenth")]:
473 ret = ret.replace(old, new)
478 for (old, new)
in [(
"initialStep",
"iter0"),
479 (
"highPtTripletStep",
"iter1"),
480 (
"lowPtQuadStep",
"iter2"),
481 (
"lowPtTripletStep",
"iter3"),
482 (
"detachedQuadStep",
"iter4"),
483 (
"pixelPairStep",
"iter5"),
484 (
"muonSeededStepInOut",
"iter9"),
485 (
"muonSeededStepOutIn",
"iter10")]:
486 path = path.replace(old, new)
490 return subfolder.replace(
"trackingParticleRecoAsssociation",
"trackingParticleRecoAsssociationSignal")
492 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsConversion")
496 quality =
"highPurity" 499 hasPtCut =
"Pt09" in collName
500 collNameNoQuality = collName.replace(
"Hp",
"")
503 collNameNoQuality = collNameNoQuality.replace(
"Pt09",
"")
504 if "ByOriginalAlgo" in collName:
505 quality +=
"ByOriginalAlgo" 506 collNameNoQuality = collNameNoQuality.replace(
"ByOriginalAlgo",
"")
507 if "ByAlgoMask" in collName:
508 quality +=
"ByAlgoMask" 509 collNameNoQuality = collNameNoQuality.replace(
"ByAlgoMask",
"")
510 collNameNoQuality = collNameNoQuality.replace(
"Tracks",
"", 1)
513 if collNameLow.find(
"seed") == 0:
515 raise Exception(
"Assumption of empty quality for seeds failed, got quality '%s'" % quality)
516 collNameLow = collNameLow[4:]
517 if collNameLow ==
"initialstepseedspresplitting":
518 collNameLow =
"initialsteppresplittingseeds" 519 elif collNameLow ==
"muonseededseedsinout":
520 collNameLow =
"muonseededstepinoutseeds" 521 elif collNameLow ==
"muonseededseedsoutin":
522 collNameLow =
"muonseededstepoutinseeds" 524 i_seeds = collNameLow.index(
"seeds")
525 quality = collNameLow[i_seeds:]
527 collNameLow = collNameLow[:i_seeds]
530 prefixes = [
"cutsreco",
"cutsrecofrompv",
"cutsrecofrompv2",
"cutsrecofrompvalltp"]
531 if collNameLow
in [
"general",
"generalfrompv"]+prefixes:
536 if coll == collNameLow.replace(pfx,
""):
540 for coll
in _possibleTrackingColls:
541 if testColl(coll.lower()):
546 for coll, name
in _possibleTrackingCollsOld.iteritems():
547 if testColl(coll.lower()):
553 algo = collNameNoQuality
556 if algo ==
"muonSeededInOut":
557 algo =
"muonSeededStepInOut" 558 if algo ==
"muonSeededOutIn":
559 algo =
"muonSeededStepOutIn" 561 return (algo, quality)
564 return (name, [name])
565 _collLabelMap = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+_possibleTrackingColls))
566 _collLabelMapHp = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+
filter(
lambda n:
"Step" in n, _possibleTrackingColls)))
570 algo =
"generalTracks" 574 if algo !=
"generalTracks" and "ByOriginalAlgo" not in quality:
576 quality = quality.replace(
"ByOriginalAlgo",
"")
578 if algo !=
"generalTracks" and "ByAlgoMask" not in quality:
580 quality = quality.replace(
"ByAlgoMask",
"")
582 if algo !=
"generalTracks" and "Pt09" not in quality:
584 quality = quality.replace(
"Pt09",
"")
587 if quality ==
"highPurity":
590 i_seeds = quality.find(
"seeds")
593 seedSubColl = quality[i_seeds+5:]
594 if seedSubColl !=
"":
595 ret += seedSubColl[0].
upper() + seedSubColl[1:]
602 def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix=""):
603 _common = {
"drawStyle":
"EP",
"xbinlabelsize": 10,
"xbinlabeloption":
"d"}
604 _commonN =
dict(ylog=
True, ymin=_minMaxN, ymax=_minMaxN,
605 normalizeToNumberOfEvents=
True,
607 _commonN.update(_common)
608 _commonAB =
dict(mapping=mapping,
609 renameBin=
lambda bl:
_summaryBinRename(bl, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds),
610 ignoreMissingBins=
True,
613 if byOriginalAlgo
or byAlgoMask:
614 _commonAB[
"minExistingBins"] = 2
615 prefix =
"summary"+midfix
617 h_eff =
"effic_vs_coll" 618 h_eff_allpt =
"effic_vs_coll_allPt" 619 h_fakerate =
"fakerate_vs_coll" 620 h_duplicaterate =
"duplicatesRate_coll" 621 h_pileuprate =
"pileuprate_coll" 623 h_reco =
"num_reco_coll" 624 h_true =
"num_assoc(recoToSim)_coll" 625 h_fake =
Subtract(
"num_fake_coll_orig",
"num_reco_coll",
"num_assoc(recoToSim)_coll")
626 h_duplicate =
"num_duplicate_coll" 627 h_pileup =
"num_pileup_coll" 628 if mapping
is not None:
630 h_eff_allpt =
AggregateBins(
"efficiencyAllPt", h_eff_allpt, **_commonAB)
631 h_fakerate =
AggregateBins(
"fakerate", h_fakerate, **_commonAB)
632 h_duplicaterate =
AggregateBins(
"duplicatesRate", h_duplicaterate, **_commonAB)
633 h_pileuprate =
AggregateBins(
"pileuprate", h_pileuprate, **_commonAB)
638 h_duplicate =
AggregateBins(
"num_duplicate_coll", h_duplicate, **_commonAB)
639 h_pileup =
AggregateBins(
"num_pileup_coll", h_pileup, **_commonAB)
642 Plot(h_eff, title=
"Efficiency vs collection", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
643 Plot(h_eff_allpt, title=
"Efficiency vs collection (no pT cut in denominator)", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
645 Plot(h_fakerate, title=
"Fakerate vs collection", ytitle=
"Fake rate", ymax=_maxFake, **_common),
646 Plot(h_duplicaterate, title=
"Duplicates rate vs collection", ytitle=
"Duplicates rate", ymax=_maxFake, **_common),
647 Plot(h_pileuprate, title=
"Pileup rate vs collection", ytitle=
"Pileup rate", ymax=_maxFake, **_common),
649 summaryN =
PlotGroup(prefix+
"_ntracks", [
650 Plot(h_reco, ytitle=
"Tracks/event", title=
"Number of tracks/event vs collection", **_commonN),
651 Plot(h_true, ytitle=
"True tracks/event", title=
"Number of true tracks/event vs collection", **_commonN),
652 Plot(h_fake, ytitle=
"Fake tracks/event", title=
"Number of fake tracks/event vs collection", **_commonN),
653 Plot(h_duplicate, ytitle=
"Duplicate tracks/event", title=
"Number of duplicate tracks/event vs collection", **_commonN),
654 Plot(h_pileup, ytitle=
"Pileup tracks/event", title=
"Number of pileup tracks/event vs collection", **_commonN),
657 return (summary, summaryN)
662 (_summaryByOriginalAlgo, _summaryByOriginalAlgoN) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo")
663 (_summaryByOriginalAlgoHp, _summaryByOriginalAlgoNHp) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo", highPurity=
True)
664 (_summaryByAlgoMask, _summaryByAlgoMaskN) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask")
665 (_summaryByAlgoMaskHp, _summaryByAlgoMaskNHp) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask", highPurity=
True)
666 (_summaryPt09, _summaryPt09N) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09")
667 (_summaryPt09Hp, _summaryPt09NHp) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09", highPurity=
True)
676 _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]}
678 _commonStatus.update(_common)
679 _commonStatus.update({
"xbinlabelsize": 10,
"xbinlabeloption":
"d",
"drawStyle":
"hist",
"adjustMarginRight": 0.08})
680 _commonLabelSize = {}
681 _commonLabelSize.update(_common)
682 _commonLabelSize.update({
"xlabelsize": 17})
685 Plot(
"selectionFlow", xbinlabelsize=10, xbinlabeloption=
"d", adjustMarginRight=0.1, drawStyle=
"hist", ylog=
True, ymin=[0.9, 9, 9e1, 9e2, 9e3, 9e4, 9e5, 9e6, 9e7]),
686 Plot(
"diffCharge", xtitle=
"Charge", **_common),
687 Plot(
"diffIsHighPurity", xtitle=
"High purity status", **_common),
688 Plot(
"diffNdof", xtitle=
"ndof", **_common),
689 Plot(
"diffNormalizedChi2", xtitle=
"#chi^{2}/ndof", **_common),
692 _packedCandidateHitsHitPattern =
PlotGroup(
"hitsHitPattern", [
693 Plot(
"diffHitPatternNumberOfValidHits", xtitle=
"Valid hits (via HitPattern)", **_common),
694 Plot(
"diffHitPatternNumberOfValidPixelHits", xtitle=
"Valid pixel hits (via HitPattern)", **_common),
695 Plot(
"diffHitPatternHasValidHitInFirstPixelBarrel", xtitle=
"Has valid hit in BPix1 layer (via HitPattern)", **_common),
696 Plot(
"diffHitPatternNumberOfLostPixelHits", xtitle=
"Lost pixel hits (via HitPattern)", **_common),
698 legendDy=_legendDy_2rows
701 Plot(
"diffNumberOfHits", xtitle=
"Hits", **_common),
702 Plot(
"diffNumberOfPixelHits", xtitle=
"Pixel hits", **_common),
703 Plot(
"diffLostInnerHits", xtitle=
"Lost inner hits", **_common),
704 Plot(
"numberHitsOverMax", xtitle=
"Number of overflown hits", **_common),
705 Plot(
"numberPixelHitsOverMax", xtitle=
"Number of overflown pixel hits", **_common),
706 Plot(
"numberStripHitsOverMax", xtitle=
"Number of overflown strip hits", **_common),
708 ncols=3, legendDy=_legendDy_2rows_3cols
711 _packedCandidateImpactParameter1 =
PlotGroup(
"impactParameter1", [
712 Plot(
"diffDxyAssocPV", xtitle=
"dxy(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
713 Plot(
"diffDxyAssocPVStatus", **_commonStatus),
714 Plot(
"diffDxyAssocPVUnderOverFlowSign", xtitle=
"dxy(assocPV)", **_common),
715 Plot(
"diffDzAssocPV", xtitle=
"dz(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
716 Plot(
"diffDzAssocPVStatus", **_commonStatus),
717 Plot(
"diffDzAssocPVUnderOverFlowSign", xtitle=
"dz(assocPV)", **_common),
718 Plot(
"diffDxyError", xtitle=
"dxyError()", adjustMarginRight=0.02, **_commonLabelSize),
719 Plot(
"diffDszError", xtitle=
"dszError()", adjustMarginRight=0.02, **_commonLabelSize),
720 Plot(
"diffDzError", xtitle=
"dzError()", adjustMarginRight=0.02, **_commonLabelSize),
726 _packedCandidateImpactParameter2 =
PlotGroup(
"impactParameter2", [
727 Plot(
"diffDxyPV", xtitle=
"dxy(PV) via PC", **_commonLabelSize),
728 Plot(
"diffDzPV", xtitle=
"dz(PV) via PC", **_commonLabelSize),
729 Plot(
"diffTrackDxyAssocPV", xtitle=
"dxy(PV) via PC::bestTrack()", **_commonLabelSize),
730 Plot(
"diffTrackDzAssocPV", xtitle=
"dz(PV) via PC::bestTrack()", **_commonLabelSize),
731 Plot(
"diffTrackDxyError", xtitle=
"dxyError() via PC::bestTrack()", adjustMarginRight=0.02, **_commonLabelSize),
732 Plot(
"diffTrackDzError", xtitle=
"dzError() via PC::bestTrack()", **_commonLabelSize),
735 _packedCandidateCovarianceMatrix1 =
PlotGroup(
"covarianceMatrix1", [
736 Plot(
"diffCovQoverpQoverp", xtitle=
"cov(qoverp, qoverp)", **_commonLabelSize),
737 Plot(
"diffCovQoverpQoverpStatus", **_commonStatus),
738 Plot(
"diffCovQoverpQoverpUnderOverFlowSign", xtitle=
"cov(qoverp, qoverp)", **_common),
739 Plot(
"diffCovLambdaLambda", xtitle=
"cov(lambda, lambda)", **_commonLabelSize),
740 Plot(
"diffCovLambdaLambdaStatus", **_commonStatus),
741 Plot(
"diffCovLambdaLambdaUnderOverFlowSign", xtitle=
"cov(lambda, lambda)", **_common),
742 Plot(
"diffCovLambdaDsz", xtitle=
"cov(lambda, dsz)", **_commonLabelSize),
743 Plot(
"diffCovLambdaDszStatus", **_commonStatus),
744 Plot(
"diffCovLambdaDszUnderOverFlowSign", xtitle=
"cov(lambda, dsz)", **_common),
745 Plot(
"diffCovPhiPhi", xtitle=
"cov(phi, phi)", **_commonLabelSize),
746 Plot(
"diffCovPhiPhiStatus", **_commonStatus),
747 Plot(
"diffCovPhiPhiUnderOverFlowSign", xtitle=
"cov(phi, phi)", **_common),
749 ncols=3, legendDy=_legendDy_4rows
751 _packedCandidateCovarianceMatrix2 =
PlotGroup(
"covarianceMatrix2", [
752 Plot(
"diffCovPhiDxy", xtitle=
"cov(phi, dxy)", **_commonLabelSize),
753 Plot(
"diffCovPhiDxyStatus", **_commonStatus),
754 Plot(
"diffCovPhiDxyUnderOverFlowSign", xtitle=
"cov(phi, dxy)", **_common),
755 Plot(
"diffCovDxyDxy", xtitle=
"cov(dxy, dxy)", adjustMarginRight=0.02, **_commonLabelSize),
756 Plot(
"diffCovDxyDxyStatus", **_commonStatus),
757 Plot(
"diffCovDxyDxyUnderOverFlowSign", xtitle=
"cov(dxy, dxy)", **_common),
758 Plot(
"diffCovDxyDsz", xtitle=
"cov(dxy, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
759 Plot(
"diffCovDxyDszStatus", **_commonStatus),
760 Plot(
"diffCovDxyDszUnderOverFlowSign", xtitle=
"cov(dxy, dsz)", **_common),
761 Plot(
"diffCovDszDsz", xtitle=
"cov(dsz, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
762 Plot(
"diffCovDszDszStatus", **_commonStatus),
763 Plot(
"diffCovDszDszUnderOverFlowSign", xtitle=
"cov(dsz, dsz)", **_common),
765 ncols=3, legendDy=_legendDy_4rows
768 _common[
"xlabelsize"] = 16
770 Plot(
"diffVx", xtitle=
"Reference point x", **_common),
771 Plot(
"diffVy", xtitle=
"Reference point y", **_common),
772 Plot(
"diffVz", xtitle=
"Reference point z", **_common),
774 legendDy=_legendDy_2rows
777 _common[
"adjustMarginRight"] = 0.05
779 Plot(
"diffPt", xtitle=
"p_{T}", **_common),
780 Plot(
"diffPtError", xtitle=
"p_{T} error", **_common),
781 Plot(
"diffEta", xtitle=
"#eta", **_common),
782 Plot(
"diffEtaError", xtitle=
"#eta error", **_common),
783 Plot(
"diffPhi", xtitle=
"#phi", **_common),
789 PlotFolder.__init__(self, *args, **kwargs)
792 spl = dqmSubFolderName.split(
"_")
799 (algoOrig, quality) = translatedDqmSubFolder
805 if plotFolderName !=
"":
806 ret +=
"_"+plotFolderName
809 if not (algo ==
"ootb" and quality !=
""):
814 """Return True if this subfolder should be processed 817 limitOnlyTo -- Function '(algo, quality) -> bool' 818 translatedDqmSubFolder -- Return value of translateSubFolder 820 (algo, quality) = translatedDqmSubFolder
821 return limitOnlyTo(algo, quality)
825 return algo
not in _possibleTrackingNonIterationColls
833 def __init__(self, section, collection=GeneralTracks):
849 def _getAlgoQuality(data, algo, quality):
850 for label, value
in data.iteritems():
852 if a == algo
and q == quality:
856 h = tdirectory.Get(hname)
861 return _getAlgoQuality(data,
"ootb",
"")
863 return _getAlgoQuality(data,
"ootb",
"highPurity")
865 return _getAlgoQuality(data,
"btvLike",
"")
867 return _getAlgoQuality(data,
"ak4PFJets",
"")
870 def _formatOrNone(num, func):
875 n_tps = _formatOrNone(_getN(
"num_simul_coll"), int)
876 n_m_tps = _formatOrNone(_getN(
"num_assoc(simToReco)_coll"), int)
878 n_tracks = _formatOrNone(_getN(
"num_reco_coll"), int)
879 n_true = _formatOrNone(_getN(
"num_assoc(recoToSim)_coll"), int)
880 if n_tracks
is not None and n_true
is not None:
881 n_fake = n_tracks-n_true
884 n_pileup = _formatOrNone(_getN(
"num_pileup_coll"), int)
885 n_duplicate = _formatOrNone(_getN(
"num_duplicate_coll"), int)
887 eff = _formatOrNone(_getN(
"effic_vs_coll"),
lambda n:
"%.4f" % n)
888 eff_nopt = _formatOrNone(_getN(
"effic_vs_coll_allPt"),
lambda n:
"%.4f" % n)
889 fake = _formatOrNone(_getN(
"fakerate_vs_coll"),
lambda n:
"%.4f" % n)
890 duplicate = _formatOrNone(_getN(
"duplicatesRate_coll"),
lambda n:
"%.4f" % n)
892 ret = [eff, n_tps, n_m_tps,
893 eff_nopt, fake, duplicate,
894 n_tracks, n_true, n_fake, n_pileup, n_duplicate]
895 if ret.count(
None) == len(ret):
902 "Number of TrackingParticles (after cuts)",
903 "Number of matched TrackingParticles",
904 "Efficiency (w/o pT cut)",
908 "Number of true tracks",
909 "Number of fake tracks",
910 "Number of pileup tracks",
911 "Number of duplicate tracks" 916 "DQMData/Run 1/Tracking/Run summary/"+lastDirName,
917 "DQMData/Tracking/"+lastDirName,
918 "DQMData/Run 1/RecoTrackV/Run summary/"+lastDirName,
919 "DQMData/RecoTrackV/"+lastDirName,
945 _seedingBuildingPlots = _simBasedPlots + [
974 _summaryByOriginalAlgo,
975 _summaryByOriginalAlgoN,
984 _summaryByOriginalAlgoHp,
985 _summaryByOriginalAlgoNHp,
986 _summaryByAlgoMaskHp,
987 _summaryByAlgoMaskNHp,
991 _summaryPlotsSeeds = [
995 _packedCandidatePlots = [
996 _packedCandidateFlow,
997 _packedCandidateKinematics,
998 _packedCandidateVertex,
999 _packedCandidateImpactParameter1,
1000 _packedCandidateImpactParameter2,
1001 _packedCandidateCovarianceMatrix1,
1002 _packedCandidateCovarianceMatrix2,
1003 _packedCandidateHits,
1004 _packedCandidateHitsHitPattern,
1008 def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, seeding=False, rawSummary=False):
1011 limiters =
dict(onlyForPileup=onlyForPileup, onlyForElectron=onlyForElectron, onlyForConversion=onlyForConversion)
1013 _trackingRefFileFallbackSLHC_Phase1PU140
1015 common =
dict(fallbackDqmSubFolders=[
1016 _trackingSubFoldersFallbackSLHC_Phase1PU140,
1017 _trackingSubFoldersFallbackFromPV, _trackingSubFoldersFallbackConversion])
1018 plotter.append(name, folders,
TrackingPlotFolder(*algoPlots, **commonForTPF), **common)
1019 plotterExt.append(name, folders,
TrackingPlotFolder(*_extendedPlots, **commonForTPF), **common)
1023 summaryName += name+
"_" 1024 summaryName +=
"summary" 1027 summaryPlots.extend([_summaryRaw, _summaryRawN])
1028 summaryPlots.extend(_summaryPlots)
1030 common =
dict(loopSubFolders=
False, purpose=
PlotPurpose.TrackingSummary, page=
"summary", numberOfEventsHistogram=_trackingNumberOfEventsHistogram, **limiters)
1031 plotter.append(summaryName, folders,
1032 PlotFolder(*summaryPlots, section=name, **common))
1033 plotter.append(summaryName+
"_highPurity", folders,
1034 PlotFolder(*_summaryPlotsHp, section=name+
"_highPurity" if name !=
"" else "highPurity", **common),
1035 fallbackNames=[summaryName])
1037 plotter.append(summaryName+
"_seeds", folders,
1038 PlotFolder(*_summaryPlotsSeeds, section=name+
"_seeds", **common))
1047 _appendTrackingPlots(
"TrackFromPV",
"fromPV", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1048 _appendTrackingPlots(
"TrackFromPVAllTP",
"fromPVAllTP", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1049 _appendTrackingPlots(
"TrackFromPVAllTP2",
"fromPVAllTP2", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1052 _appendTrackingPlots(
"TrackConversion",
"conversion", _simBasedPlots+_recoBasedPlots, onlyForConversion=
True, rawSummary=
True)
1053 _appendTrackingPlots(
"TrackGsf",
"gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=
True, rawSummary=
True)
1057 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1059 plotter.append(
"packedCandidateLostTracks",
_trackingFolders(
"PackedCandidate/lostTracks"),
1060 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1065 "DQMData/Run 1/HLT/Run summary/Tracking/ValidationWRTtp",
1070 plotterHLT.append(
"hlt", _hltFolder,
TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
1071 plotterHLTExt.append(
"hlt", _hltFolder,
TrackingPlotFolder(*_extendedPlots, **_common))
1075 def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[]):
1078 def _set(param, name, modules):
1079 if param
is not None:
1080 setattr(self, name, param)
1082 setattr(self, name, modules)
1084 _set(clusterMasking,
"_clusterMasking", [self.
_name+
"Clusters"])
1087 _set(seeding,
"_seeding", [self.
_name+
"SeedingLayers", self.
_name+
"TrackingRegions", self.
_name+
"HitDoublets", self.
_name+
"HitTriplets", self.
_name+
"HitQuadruplets", self.
_name+
"Seeds"])
1088 _set(building,
"_building", [self.
_name+
"TrackCandidates"])
1089 _set(fit,
"_fit", [self.
_name+
"Tracks"])
1090 _set(selection,
"_selection", [self.
_name])
1097 return self._clusterMasking+self._seeding+self._building+self._fit+self._selection+self.
_other 1100 return self._clusterMasking
1103 return self._seeding
1106 return self._building
1112 return self._selection
1121 (
"Fit", self.
fit()),
1123 (
"Other", self.
other())]
1128 seeding=[
"initialStepSeedLayersPreSplitting",
1129 "initialStepTrackingRegionsPreSplitting",
1130 "initialStepHitDoubletsPreSplitting",
1131 "initialStepHitTripletsPreSplitting",
1132 "initialStepHitQuadrupletsPreSplitting",
1133 "initialStepSeedsPreSplitting"],
1134 building=[
"initialStepTrackCandidatesPreSplitting"],
1135 fit=[
"initialStepTracksPreSplitting"],
1136 other=[
"firstStepPrimaryVerticesPreSplitting",
1137 "initialStepTrackRefsForJetsPreSplitting",
1138 "caloTowerForTrkPreSplitting",
1139 "ak4CaloJetsForTrkPreSplitting",
1140 "jetsForCoreTrackingPreSplitting",
1143 "MeasurementTrackerEvent",
1144 "siPixelClusterShapeCache"]),
1145 Iteration(
"initialStep", clusterMasking=[],
1146 selection=[
"initialStepClassifier1",
1147 "initialStepClassifier2",
1148 "initialStepClassifier3",
1150 other=[
"firstStepPrimaryVerticesUnsorted",
1151 "initialStepTrackRefsForJets",
1153 "ak4CaloJetsForTrk",
1154 "firstStepPrimaryVertices"]),
1156 selection=[
"highPtTripletStepClassifier1",
1157 "highPtTripletStepClassifier2",
1158 "highPtTripletStepClassifier3",
1159 "highPtTripletStep"]),
1161 selection=[
"detachedQuadStepClassifier1",
1162 "detachedQuadStepClassifier2",
1163 "detachedQuadStep"]),
1165 selection=[
"detachedTripletStepClassifier1",
1166 "detachedTripletStepClassifier2",
1167 "detachedTripletStep"]),
1171 seeding=[
"pixelPairStepSeedLayers",
1172 "pixelPairStepSeedLayersB",
1173 "pixelPairStepSeedLayersC",
1174 "pixelPairStepTrackingRegions",
1175 "pixelPairStepTrackingRegionsB",
1176 "pixelPairStepTrackingRegionsC",
1177 "pixelPairStepHitDoublets",
1178 "pixelPairStepHitDoubletsB",
1179 "pixelPairStepHitDoubletsC",
1180 "pixelPairStepSeedsA",
1181 "pixelPairStepSeedsB",
1182 "pixelPairStepSeedsC",
1183 "pixelPairStepSeeds"]),
1185 seeding=[
"mixedTripletStepSeedLayersA",
1186 "mixedTripletStepSeedLayersB",
1187 "mixedTripletStepTrackingRegionsA",
1188 "mixedTripletStepTrackingRegionsB",
1189 "mixedTripletStepHitDoubletsA",
1190 "mixedTripletStepHitDoubletsB",
1191 "mixedTripletStepHitTripletsA",
1192 "mixedTripletStepHitTripletsB",
1193 "mixedTripletStepSeedsA",
1194 "mixedTripletStepSeedsB",
1195 "mixedTripletStepSeeds"],
1196 selection=[
"mixedTripletStepClassifier1",
1197 "mixedTripletStepClassifier2",
1198 "mixedTripletStep"]),
1200 selection=[
"pixelLessStepClassifier1",
1201 "pixelLessStepClassifier2",
1204 seeding=[
"tobTecStepSeedLayersTripl",
1205 "tobTecStepSeedLayersPair",
1206 "tobTecStepTrackingRegionsTripl",
1207 "tobTecStepTrackingRegionsPair",
1208 "tobTecStepHitDoubletsTripl",
1209 "tobTecStepHitDoubletsPair",
1210 "tobTecStepHitTripletsTripl",
1211 "tobTecStepSeedsTripl",
1212 "tobTecStepSeedsPair",
1214 selection=[
"tobTecStepClassifier1",
1215 "tobTecStepClassifier2",
1219 other=[
"jetsForCoreTracking",
1220 "firstStepGoodPrimaryVertices",
1224 seeding=[
"muonSeededSeedsInOut",
1225 "muonSeededSeedsOutIn"],
1226 building=[
"muonSeededTrackCandidatesInOut",
1227 "muonSeededTrackCandidatesOutIn"],
1228 fit=[
"muonSeededTracksInOut",
1229 "muonSeededTracksOutIn"],
1230 selection=[
"muonSeededTracksInOutClassifier",
1231 "muonSeededTracksOutIntClassifier"],
1235 clusterMasking=[], seeding=[],
1236 building=[
"duplicateTrackCandidates"],
1237 fit=[
"mergedDuplicateTracks"],
1238 selection=[
"duplicateTrackClassifier"]),
1240 clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1241 other=[
"preDuplicateMergingGeneralTracks",
1244 clusterMasking=[
"convClusters"],
1245 seeding=[
"convLayerPairs",
1246 "photonConvTrajSeedFromSingleLeg"],
1247 building=[
"convTrackCandidates"],
1248 fit=[
"convStepTracks"],
1249 selection=[
"convStepSelector"]),
1250 Iteration(
"Other", clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1251 other=[
"trackerClusterCheckPreSplitting",
1252 "trackerClusterCheck"]),
1256 iterations = _iterations
1257 if not includeConvStep:
1258 iterations =
filter(
lambda i: i.name() !=
"ConvStep", iterations)
1260 iterations =
filter(
lambda i: i.name() ==
"ConvStep", iterations)
1261 return collections.OrderedDict([(i.name(), i.all())
for i
in iterations])
1265 for i
in _iterations:
1266 if i.name() ==
"ConvStep":
1268 ret.extend(getattr(i, prop)())
1271 return collections.OrderedDict([
1272 (
"ClusterMask", getProp(
"clusterMasking")),
1273 (
"Seeding", getProp(
"seeding")),
1274 (
"Building", getProp(
"building")),
1275 (
"Fitting", getProp(
"fit")),
1276 (
"Selection", getProp(
"selection")),
1277 (
"Other", getProp(
"other"))
1296 h = tdirectory.Get(
"reconstruction_step_module_average")
1299 totalReco =
"%.1f" % h.Integral()
1301 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(includeConvStep=
False), ignoreMissingBins=
True)
1302 h = creator.create(tdirectory)
1303 totalTracking =
None 1305 totalTracking =
"%.1f" % h.Integral()
1307 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(onlyConvStep=
True), ignoreMissingBins=
True)
1308 h = creator.create(tdirectory)
1309 totalConvStep =
None 1311 totalConvStep =
"%.1f" % h.Integral()
1321 "Average reco time / event (ms)",
1322 "Average tracking (w/o convStep) time / event (ms)",
1323 "Average convStep time / event (ms)",
1326 def __init__(self, name, timeHisto, selectedTracks=False):
1336 tdir = tfile.Get(dirName)
1348 tfile = tdirectory.GetFile()
1353 iterMap = copy.copy(_collLabelMapHp)
1354 del iterMap[
"generalTracks"]
1355 del iterMap[
"jetCoreRegionalStep"]
1357 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
True, byOriginalAlgo=
False, byAlgoMask=
True, ptCut=
False, seeds=
False)
1359 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
False, byOriginalAlgo=
False, byAlgoMask=
False, ptCut=
False, seeds=
False)
1360 recoAB =
AggregateBins(
"tmp",
"num_reco_coll", mapping=iterMap,ignoreMissingBins=
True, renameBin=renameBin)
1361 h_reco_per_iter = recoAB.create(trkDir)
1362 if h_reco_per_iter
is None:
1365 for i
in xrange(1, h_reco_per_iter.GetNbinsX()+1):
1366 values[h_reco_per_iter.GetXaxis().GetBinLabel(i)] = h_reco_per_iter.GetBinContent(i)
1370 for i
in xrange(1, timeTh1.GetNbinsX()+1):
1371 iterName = timeTh1.GetXaxis().GetBinLabel(i)
1372 if iterName
in values:
1373 ntrk = values[iterName]
1374 result.append( (iterName,
1375 timeTh1.GetBinContent(i)/ntrk
if ntrk > 0
else 0,
1376 timeTh1.GetBinError(i)/ntrk
if ntrk > 0
else 0) )
1378 if len(result) == 0:
1381 res = ROOT.TH1F(self.
_name, self.
_name, len(result), 0, len(result))
1382 for i, (label, value, error)
in enumerate(result):
1383 res.GetXaxis().SetBinLabel(i+1, label)
1384 res.SetBinContent(i+1, value)
1385 res.SetBinError(i+1, error)
1391 "xbinlabelsize": 10,
1392 "xbinlabeloption":
"d" 1396 Plot(_time_per_iter,
1397 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", legendDx=-0.4, **_common),
1399 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1402 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", **_common),
1404 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1407 ytitle=
"Average time / built track (ms)", title=
"Average time / built track", **_common),
1409 ytitle=
"Average time / selected track (ms)", title=
"Average time / selected HP track by algoMask", **_common),
1416 Plot(
AggregateBins(i.name(),
"reconstruction_step_module_average", collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1417 ytitle=
"Average processing time (ms)", title=i.name(), **_common)
1418 for i
in _iterations
1420 ncols=4, legend=
False 1423 Plot(
AggregateBins(
"pixel",
"reconstruction_step_module_average", {
"pixelTracks": [
"pixelTracks"]}), ytitle=
"Average processing time [ms]", title=
"Average processing time / event", drawStyle=
"HIST")
1427 "DQMData/Run 1/DQM/Run summary/TimerService/Paths",
1428 "DQMData/Run 1/DQM/Run summary/TimerService/process RECO/Paths",
1431 timePlotter.append(
"timing", _timeFolders,
PlotFolder(
1439 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist"}
1441 Plot(
"TPlip", xtitle=
"TP lip", **_common),
1442 Plot(
"TPtip", xtitle=
"TP tip", **_common),
1446 tpPlotter.append(
"tp", [
1447 "DQMData/Run 1/Tracking/Run summary/TrackingMCTruth/TrackingParticle",
1448 "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 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 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)