1 from __future__
import absolute_import
2 from builtins
import range
9 ROOT.gROOT.SetBatch(
True)
10 ROOT.PyConfig.IgnoreCommandLineOptions =
True
12 from .plotting
import Subtract, FakeDuplicate, CutEfficiency, Transform, AggregateBins, ROC, Plot, PlotEmpty, PlotGroup, PlotOnSideGroup, PlotFolder, Plotter
13 from .html
import PlotPurpose
14 from .
import plotting
15 from .
import validation
24 _maxEff = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025, 1.2, 1.5, 2]
25 _maxFake = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025]
28 _minMaxResol = [1e-5, 4e-5, 1e-4, 4e-4, 1e-3, 4e-3, 1e-2, 4e-2, 0.1, 0.4, 1]
29 _minMaxN = [5e-1, 5, 5e1, 5e2, 5e3, 5e4, 5e5, 5e6, 5e7, 5e8, 5e9]
32 _maxHits = [5, 10, 20, 40, 60, 80]
33 _minLayers = [0, 5, 10]
34 _maxLayers = [5, 10, 25]
36 _min3DLayers = [0, 5, 10]
37 _max3DLayers = [5, 10, 20]
38 _minZ = [-60, -40, -20, -10, -5]
39 _maxZ = [5, 10, 20, 40, 60]
40 _minPU = [0, 10, 20, 50, 100, 150]
41 _maxPU = [20, 50, 65, 80, 100, 150, 200, 250]
42 _minMaxTracks = [0, 200, 500, 1000, 1500, 2000]
43 _minMaxMVA = [-1.025, -0.5, 0, 0.5, 1.025]
47 return ([-x
for x
in ma], ma)
50 (_minResidualCotTheta, _maxResidualCotTheta) =
_minMaxResidual([1e-4, 2e-4])
52 (_minResidualDz, _maxResidualDz) = (_minResidualDxy, _maxResidualDxy)
57 _legendDy_2rows = -0.025
58 _legendDy_2rows_3cols = -0.17
59 _legendDy_4rows = 0.09
66 _trackingIterationOrderHistogram =
"DQMData/Run 1/Tracking/Run summary/TrackBuilding/num_reco_coll"
73 xq +=
" (" + unit +
")"
75 effargs = dict(xtitle=
"TP "+xq , ytitle=
"efficiency vs "+q , ymax=_maxEff)
76 fakeargs = dict(xtitle=
"track "+xq, ytitle=
"fake+duplicates rate vs "+q, ymax=_maxFake)
77 effargs.update(common)
78 fakeargs.update(common)
79 effargs.update(effopts)
80 fakeargs.update(fakeopts)
83 Plot(
"effic_vs_"+p, **effargs),
84 Plot(
FakeDuplicate(
"fakeduprate_vs_"+p, assoc=
"num_assoc(recoToSim)_"+p, dup=
"num_duplicate_"+p, reco=
"num_reco_"+p, title=
"fake+duplicates vs "+q), **fakeargs)
96 xq +=
" (" + unit +
")"
100 Plot(
"fakerate_vs_"+p , xtitle=xtitle, ytitle=
"fakerate vs "+q , ymax=_maxFake, **common),
101 Plot(
"duplicatesRate_"+p, xtitle=xtitle, ytitle=
"duplicates rate vs "+q, ymax=_maxFake, **common),
102 Plot(
"pileuprate_"+p , xtitle=xtitle, ytitle=
"pileup rate vs "+q , ymax=_maxFake, **common),
106 return Subtract(
"num_fake_"+postfix,
"num_reco_"+postfix,
"num_assoc(recoToSim)_"+postfix)
112 args = dict(xtitle=
"track "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
116 Plot(
"num_reco_"+p , ytitle=
"tracks", **args),
117 Plot(
"num_assoc(recoToSim)_"+p, ytitle=
"true tracks", **args),
119 Plot(
"num_duplicate_"+p , ytitle=
"duplicate tracks", **args),
126 args = dict(xtitle=
"TP "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
130 Plot(
"num_simul_"+p , ytitle=
"TrackingParticles", **args),
131 Plot(
"num_assoc(simToReco)_"+p, ytitle=
"Reconstructed TPs", **args),
135 pfix =
"_hp" if hp
else ""
136 pfix2 =
"Hp" if hp
else ""
138 xtitle =
"MVA%d output"%num
139 xtitlecut =
"Cut on MVA%d output"%num
140 args = dict(xtitle=xtitle, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
143 xtitle=
"Efficiency (excl. trk eff)", ytitle=
"Fake rate",
144 xmax=_maxEff, ymax=_maxFake,
148 ztitle=
"Cut on MVA%d"%num,
149 xtitleoffset=5, ytitleoffset=6.5, ztitleoffset=4,
150 adjustMarginRight=0.12
152 argsroc2.update(argsroc)
153 argsroc2[
"drawStyle"] =
"pcolz"
155 argsprofile = dict(ymin=_minMaxMVA, ymax=_minMaxMVA)
157 true_cuteff =
CutEfficiency(
"trueeff_vs_mva%dcut%s"%(num,pfix),
"num_assoc(recoToSim)_mva%dcut%s"%(num,pfix))
158 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)))
162 Plot(
"num_assoc(recoToSim)_mva%d%s"%(num,pfix), ytitle=
"true tracks", **args),
163 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),
164 Plot(
"effic_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
166 Plot(
"fakerate_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Fake rate", ymax=_maxFake),
167 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),
168 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),
170 Plot(true_cuteff, xtitle=xtitlecut, ytitle=
"True track selection efficiency", ymax=_maxEff),
171 Plot(fake_cuteff, xtitle=xtitlecut, ytitle=
"Fake track selection efficiency", ymax=_maxEff),
172 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),
173 ], ncols=3, legendDy=_legendDy_1row),
175 Plot(
"mva_assoc(recoToSim)_mva%d%s_pT"%(num,pfix), xtitle=
"Track p_{T} (GeV)", ytitle=xtitle+
" for true tracks", xlog=
True, **argsprofile),
176 Plot(
"mva_fake_mva%d%s_pT"%(num,pfix), xtitle=
"Track p_{T} (GeV)", ytitle=xtitle+
" for fake tracks", xlog=
True, **argsprofile),
177 Plot(
"mva_assoc(recoToSim)_mva%d%s_eta"%(num,pfix), xtitle=
"Track #eta", ytitle=xtitle+
" for true tracks", **argsprofile),
178 Plot(
"mva_fake_mva%d%s_eta"%(num,pfix), xtitle=
"Track #eta", ytitle=xtitle+
" for fake tracks", **argsprofile),
179 ], legendDy=_legendDy_2rows)
183 Plot(
"efficPt", title=
"Efficiency vs p_{T}", xtitle=
"TP p_{T} (GeV)", ytitle=
"efficiency vs p_{T}", xlog=
True, ymax=_maxEff),
184 Plot(
FakeDuplicate(
"fakeduprate_vs_pT", assoc=
"num_assoc(recoToSim)_pT", dup=
"num_duplicate_pT", reco=
"num_reco_pT", title=
"fake+duplicates vs p_{T}"),
185 xtitle=
"track p_{T} (GeV)", ytitle=
"fake+duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
186 Plot(
"effic", xtitle=
"TP #eta", ytitle=
"efficiency vs #eta", title=
"", ymax=_maxEff),
187 Plot(
FakeDuplicate(
"fakeduprate_vs_eta", assoc=
"num_assoc(recoToSim)_eta", dup=
"num_duplicate_eta", reco=
"num_reco_eta", title=
""),
188 xtitle=
"track #eta", ytitle=
"fake+duplicates rate vs #eta", ymax=_maxFake),
196 legendDy=_legendDy_2rows
203 legendDy=_legendDy_4rows
205 _effandfakeHitsLayers =
PlotGroup(
"effandfakeHitsLayers",
209 _makeEffFakeDupPlots(
"3Dlayer" ,
"3D layers" , common=dict(xmin=_min3DLayers, xmax=_max3DLayers)),
210 legendDy=_legendDy_4rows
212 _common = {
"ymin": 0,
"ymax": _maxEff}
214 _makeEffFakeDupPlots(
"vertpos",
"vert r",
"cm", fakeopts=dict(xtitle=
"track ref. point r (cm)", ytitle=
"fake+duplicates vs. r"), common=dict(xlog=
True)) +
215 _makeEffFakeDupPlots(
"zpos" ,
"vert z",
"cm", fakeopts=dict(xtitle=
"track ref. point z (cm)", ytitle=
"fake+duplicates vs. z")) +
216 _makeEffFakeDupPlots(
"simpvz" ,
"Sim. PV z",
"cm", common=dict(xtitle=
"Sim. PV z (cm)", xmin=_minZ, xmax=_maxZ))
219 _makeEffFakeDupPlots(
"dr" ,
"#DeltaR", effopts=dict(xtitle=
"TP min #DeltaR"), fakeopts=dict(xtitle=
"track min #DeltaR"), common=dict(xlog=
True)) +
220 _makeEffFakeDupPlots(
"drj" ,
"#DeltaR(track, jet)", effopts=dict(xtitle=
"#DeltaR(TP, jet)", ytitle=
"efficiency vs #DeltaR(TP, jet"), fakeopts=dict(xtitle=
"#DeltaR(track, jet)"), common=dict(xlog=
True, xmax=_maxDRJ))+
222 legendDy=_legendDy_4rows
226 _algos_common = dict(removeEmptyBins=
True, xbinlabelsize=10, xbinlabeloption=
"d")
227 _duplicateAlgo =
PlotOnSideGroup(
"duplicateAlgo",
Plot(
"duplicates_oriAlgo_vs_oriAlgo", drawStyle=
"COLZ", adjustMarginLeft=0.1, adjustMarginRight=0.1, **_algos_common))
230 Plot(
"fakeratePt", xtitle=
"track p_{T} (GeV)", ytitle=
"fakerate vs p_{T}", xlog=
True, ymax=_maxFake),
231 Plot(
"duplicatesRate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
232 Plot(
"pileuprate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"pileup rate vs p_{T}", ymax=_maxFake, xlog=
True),
233 Plot(
"fakerate", xtitle=
"track #eta", ytitle=
"fakerate vs #eta", title=
"", ymax=_maxFake),
234 Plot(
"duplicatesRate", xtitle=
"track #eta", ytitle=
"duplicates rate vs #eta", title=
"", ymax=_maxFake),
235 Plot(
"pileuprate", xtitle=
"track #eta", ytitle=
"pileup rate vs #eta", title=
"", ymax=_maxFake),
242 ncols=3, legendDy=_legendDy_2rows_3cols
249 ncols=3, legendDy=_legendDy_4rows
251 _dupandfakeHitsLayers =
PlotGroup(
"dupandfakeHitsLayers",
256 ncols=3, legendDy=_legendDy_4rows
266 _makeFakeDupPileupPlots(
"drj" ,
"#DeltaR(track, jet)", xtitle=
"#DeltaR(track, jet)", common=dict(xlog=
True, xmax=_maxDRJ)) +
270 _seedingLayerSet_common = dict(removeEmptyBins=
True, xbinlabelsize=8, xbinlabeloption=
"d", adjustMarginRight=0.1)
271 _dupandfakeSeedingPlots =
_makeFakeDupPileupPlots(
"seedingLayerSet",
"seeding layers", xtitle=
"", common=_seedingLayerSet_common)
272 _dupandfakeChi2Seeding =
PlotGroup(
"dupandfakeChi2Seeding",
274 _dupandfakeSeedingPlots,
275 ncols=3, legendDy=_legendDy_2rows_3cols
279 "ytitle":
"Fake+pileup rate",
284 _common2.update(_common)
285 _common2[
"drawStyle"] =
"pcolz"
286 _common2[
"ztitleoffset"] = 1.5
287 _common2[
"xtitleoffset"] = 7
288 _common2[
"ytitleoffset"] = 10
289 _common2[
"ztitleoffset"] = 6
291 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")),
292 xtitle=
"Efficiency vs. cut on dz(PV)", **_common),
293 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),
294 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)", **_common2),
296 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")),
297 xtitle=
"Efficiency vs. cut on dz(PV)/dzError", **_common),
298 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),
299 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)/dzError", **_common2),
301 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")),
302 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)", **_common),
303 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),
304 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)", **_common2),
306 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")),
307 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)/dzError", **_common),
308 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),
309 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)/dzError", **_common2),
310 ], onlyForPileup=
True,
311 legendDy=_legendDy_4rows
314 Plot(
"effic_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency vs. cut on dz(PV)", ymax=_maxEff),
315 Plot(
"effic_vs_dzpvcut2", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
316 Plot(
"fakerate_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate vs. cut on dz(PV)", ymax=_maxFake),
317 Plot(
"pileuprate_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate vs. cut on dz(PV)", ymax=_maxFake),
319 Plot(
"effic_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency vs. cut on dz(PV)/dzError", ymax=_maxEff),
320 Plot(
"effic_vs_dzpvsigcut2", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
321 Plot(
"fakerate_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
322 Plot(
"pileuprate_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
323 ], onlyForPileup=
True,
324 legendDy=_legendDy_4rows
327 Plot(
"effic_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
328 Plot(
"effic_vs_dzpvcut2_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
329 Plot(
"fakerate_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
330 Plot(
"pileuprate_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
332 Plot(
"effic_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
333 Plot(
"effic_vs_dzpvsigcut2_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
334 Plot(
"fakerate_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
335 Plot(
"pileuprate_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
336 ], onlyForPileup=
True,
337 legendDy=_legendDy_4rows
342 _common = {
"normalizeToUnitArea":
True,
"stat":
True,
"drawStyle":
"hist"}
344 Plot(
"h_dedx_estim1", xtitle=
"dE/dx, harm2", **_common),
345 Plot(
"h_dedx_estim2", xtitle=
"dE/dx, trunc40", **_common),
346 Plot(
"h_dedx_nom1", xtitle=
"dE/dx number of measurements", title=
"", **_common),
347 Plot(
"h_dedx_sat1", xtitle=
"dE/dx number of measurements with saturation", title=
"", **_common),
349 legendDy=_legendDy_2rows
353 Plot(
"chargeMisIdRate", xtitle=
"#eta", ytitle=
"charge mis-id rate vs #eta", ymax=0.05),
354 Plot(
"chargeMisIdRate_Pt", xtitle=
"p_{T}", ytitle=
"charge mis-id rate vs p_{T}", xmax=300, ymax=0.1, xlog=
True),
355 Plot(
"chargeMisIdRate_hit", xtitle=
"hits", ytitle=
"charge mis-id rate vs hits", title=
""),
356 Plot(
"chargeMisIdRate_phi", xtitle=
"#phi", ytitle=
"charge mis-id rate vs #phi", title=
"", ymax=0.01),
357 Plot(
"chargeMisIdRate_dxy", xtitle=
"dxy", ytitle=
"charge mis-id rate vs dxy", ymax=0.1),
358 Plot(
"chargeMisIdRate_dz", xtitle=
"dz", ytitle=
"charge mis-id rate vs dz", ymax=0.1)
360 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"ylog":
True,
"ymin": 1e-6,
"drawStyle":
"hist"}
362 Plot(
"missing_inner_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
363 Plot(
"missing_outer_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
364 Plot(
"hits_eta", xtitle=
"track #eta", ytitle=
"<hits> vs #eta", ymin=_minHits, ymax=_maxHits, statyadjust=[0,0,-0.15],
365 fallback={
"name":
"nhits_vs_eta",
"profileX":
True}),
366 Plot(
"hits", stat=
True, xtitle=
"track hits", xmin=_minHits, xmax=_maxHits, ylog=
True, ymin=[5e-1, 5, 5e1, 5e2, 5e3], drawStyle=
"hist"),
367 Plot(
"num_simul_pT", xtitle=
"TP p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common),
368 Plot(
"num_reco_pT", xtitle=
"track p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common)
371 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),
372 Plot(
"chi2_prob", stat=
True, normalizeToUnitArea=
True, drawStyle=
"hist", xtitle=
"Prob(#chi^{2})"),
373 Plot(
"chi2mean", title=
"", xtitle=
"#eta", ytitle=
"< #chi^{2} / ndf >", ymin=[0, 0.5], ymax=[2, 2.5, 3, 5],
374 fallback={
"name":
"chi2_vs_eta",
"profileX":
True}),
375 Plot(
"ptres_vs_eta_Mean", scale=100, title=
"", xtitle=
"TP #eta (PCA to beamline)", ytitle=
"< #delta p_{T} / p_{T} > (%)", ymin=_minResidualPt, ymax=_maxResidualPt),
376 Plot(
"chi2mean_vs_pt", title=
"", xtitle=
"p_{T}", ytitle=
"< #chi^{2} / ndf >", ymin=[0, 0.5], ymax=[2, 2.5, 3, 5], xlog=
True, fallback={
"name":
"chi2_vs_pt",
"profileX":
True}),
377 Plot(
"chi2mean_vs_drj", title=
"", xtitle=
"#DeltaR(track, jet)", ytitle=
"< #chi^{2} / ndf >", ymin=[0, 0.5], ymax=[2, 2.5, 3, 5], xlog=
True, xmax=_maxDRJ, fallback={
"name":
"chi2_vs_drj",
"profileX":
True}),
378 Plot(
"ptres_vs_pt_Mean", title=
"", xtitle=
"p_{T}", ytitle=
"< #delta p_{T}/p_{T} > (%)", scale=100, ymin=_minResidualPt, ymax=_maxResidualPt,xlog=
True)
380 _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}
382 Plot(
"pullPt", **_common),
383 Plot(
"pullQoverp", **_common),
384 Plot(
"pullPhi", **_common),
385 Plot(
"pullTheta", **_common),
386 Plot(
"pullDxy", **_common),
387 Plot(
"pullDz", **_common),
389 legendDx=0.1, legendDw=-0.1, legendDh=-0.015
391 _common = {
"title":
"",
"ylog":
True,
"xtitle":
"TP #eta (PCA to beamline)",
"ymin": _minMaxResol,
"ymax": _minMaxResol}
393 Plot(
"phires_vs_eta_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
394 Plot(
"cotThetares_vs_eta_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
395 Plot(
"dxyres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
396 Plot(
"dzres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
397 Plot(
"ptres_vs_eta_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
399 _common = {
"title":
"",
"ylog":
True,
"xlog":
True,
"xtitle":
"TP p_{T} (PCA to beamline)",
"xmin": 0.1,
"xmax": 1000,
"ymin": _minMaxResol,
"ymax": _minMaxResol}
401 Plot(
"phires_vs_pt_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
402 Plot(
"cotThetares_vs_pt_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
403 Plot(
"dxyres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
404 Plot(
"dzres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
405 Plot(
"ptres_vs_pt_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
407 _common = {
"title":
"",
"ylog":
True,
"xtitle":
"TP #Phi (PCA to beamline)",
"ymin": _minMaxResol,
"ymax": _minMaxResol}
409 Plot(
"dxyres_vs_phi_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
410 Plot(
"dzres_vs_phi_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
411 Plot(
"phires_vs_phi_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
412 Plot(
"ptres_vs_phi_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
424 ncols=4, legendDy=_legendDy_2rows)
430 ncols=4, legendDy=_legendDy_4rows)
432 _makeDistPlots(
"hit" ,
"hits" , common=dict(xmin=_minHits , xmax=_maxHits)) +
433 _makeDistPlots(
"layer" ,
"layers" , common=dict(xmin=_minLayers , xmax=_maxLayers)) +
434 _makeDistPlots(
"pixellayer",
"pixel layers", common=dict( xmax=_maxPixelLayers)) +
435 _makeDistPlots(
"3Dlayer" ,
"3D layers" , common=dict(xmin=_min3DLayers, xmax=_max3DLayers)),
436 ncols=4, legendDy=_legendDy_4rows,
439 _makeDistPlots(
"vertpos",
"ref. point r (cm)", common=dict(xlog=
True)) +
441 _makeDistPlots(
"simpvz" ,
"Sim. PV z (cm)", common=dict(xmin=_minZ, xmax=_maxZ)),
446 _makeDistPlots(
"drj" ,
"#DeltaR(track, jet)", common=dict(xlog=
True, xmax=_maxDRJ)),
447 ncols=2, legendDy=_legendDy_2rows,
449 _extDistSeedingPlots =
_makeDistPlots(
"seedingLayerSet",
"seeding layers", common=dict(xtitle=
"", **_seedingLayerSet_common))
452 _extDistSeedingPlots,
453 ncols=4, legendDy=_legendDy_2rows_3cols
455 _common = dict(title=
"", xtitle=
"TP #eta (PCA to beamline)")
457 Plot(
"phires_vs_eta_Mean", ytitle=
"< #delta #phi > (rad)", ymin=_minResidualPhi, ymax=_maxResidualPhi, **_common),
458 Plot(
"cotThetares_vs_eta_Mean", ytitle=
"< #delta cot(#theta) >", ymin=_minResidualCotTheta, ymax=_maxResidualCotTheta, **_common),
459 Plot(
"dxyres_vs_eta_Mean", ytitle=
"< #delta d_{xy} > (#mum)", scale=10000, ymin=_minResidualDxy, ymax=_maxResidualDxy, **_common),
460 Plot(
"dzres_vs_eta_Mean", ytitle=
"< #delta d_{z} > (#mum)", scale=10000, ymin=_minResidualDz, ymax=_maxResidualDz, **_common),
461 Plot(
"ptres_vs_eta_Mean", ytitle=
"< #delta p_{T}/p_{T} > (%)", scale=100, ymin=_minResidualPt, ymax=_maxResidualPt, **_common),
463 _common = dict(title=
"", xlog=
True, xtitle=
"TP p_{T} (PCA to beamline)", xmin=0.1, xmax=1000)
465 Plot(
"phires_vs_pt_Mean", ytitle=
"< #delta #phi > (rad)", ymin=_minResidualPhi, ymax=_maxResidualPhi, **_common),
466 Plot(
"cotThetares_vs_pt_Mean", ytitle=
"< #delta cot(#theta > )", ymin=_minResidualCotTheta, ymax=_maxResidualCotTheta, **_common),
467 Plot(
"dxyres_vs_pt_Mean", ytitle=
"< #delta d_{xy} > (#mum)", scale=10000, ymin=_minResidualDxy, ymax=_maxResidualDxy, **_common),
468 Plot(
"dzres_vs_pt_Mean", ytitle=
"< #delta d_{z} > (#mum)", scale=10000, ymin=_minResidualDz, ymax=_maxResidualDz, **_common),
469 Plot(
"ptres_vs_pt_Mean", ytitle=
"< #delta p_{T}/p_{T} > (%)", scale=100, ymin=_minResidualPt, ymax=_maxResidualPt, **_common),
471 _common = dict(title=
"", ytitle=
"Selected tracks/TrackingParticles", ymax=_maxEff)
473 Plot(
"nrec_vs_nsim", title=
"", xtitle=
"TrackingParticles", ytitle=
"Tracks", profileX=
True, xmin=_minMaxTracks, xmax=_minMaxTracks, ymin=_minMaxTracks, ymax=_minMaxTracks),
474 Plot(
"nrecPerNsim_vs_pu", xtitle=
"Pileup", xmin=_minPU, xmax=_maxPU, **_common),
475 Plot(
"nrecPerNsimPt", xtitle=
"p_{T} (GeV)", xlog=
True, **_common),
476 Plot(
"nrecPerNsim", xtitle=
"#eta", **_common)
477 ], legendDy=_legendDy_2rows)
479 Plot(
"PXLhits_vs_eta", xtitle=
"#eta", ytitle=
"<pixel hits>"),
480 Plot(
"PXLlayersWithMeas_vs_eta", xtitle=
"#eta", ytitle=
"<pixel layers>"),
481 Plot(
"STRIPhits_vs_eta", xtitle=
"#eta", ytitle=
"<strip hits>"),
482 Plot(
"STRIPlayersWithMeas_vs_eta", xtitle=
"#eta", ytitle=
"<strip layers>"),
483 ], legendDy=_legendDy_2rows)
495 ncols=2, legendDy=_legendDy_2rows)
501 ncols=2, legendDy=_legendDy_4rows)
504 _makeDistSimPlots(
"layer" ,
"layers" , common=dict(xmin=_minLayers , xmax=_maxLayers)) +
505 _makeDistSimPlots(
"pixellayer",
"pixel layers", common=dict( xmax=_maxPixelLayers)) +
506 _makeDistSimPlots(
"3Dlayer" ,
"3D layers" , common=dict(xmin=_min3DLayers, xmax=_max3DLayers)),
507 ncols=2, legendDy=_legendDy_4rows,
512 _makeDistSimPlots(
"simpvz" ,
"Sim. PV z (cm)", common=dict(xmin=_minZ, xmax=_maxZ)),
517 _makeDistSimPlots(
"drj" ,
"#DeltaR(TP, jet)", common=dict(xlog=
True, xmax=_maxDRJ)),
518 ncols=2, legendDy=_legendDy_2rows,
527 _possibleTrackingNonIterationColls = [
531 _possibleTrackingColls = [
532 'initialStepPreSplitting',
536 'detachedTripletStep',
550 'jetCoreRegionalStep',
551 'muonSeededStepInOut',
552 'muonSeededStepOutIn',
554 ] + _possibleTrackingNonIterationColls
555 _possibleTrackingCollsOld = {
569 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
570 for (old, new)
in [(
"InitialStep",
"Zero"),
571 (
"HighPtTripletStep",
"First"),
572 (
"LowPtQuadStep",
"Second"),
573 (
"LowPtTripletStep",
"Third"),
574 (
"DetachedQuadStep",
"Fourth"),
575 (
"PixelPairStep",
"Fifth"),
576 (
"MuonSeededStepInOut",
"Ninth"),
577 (
"MuonSeededStepOutIn",
"Tenth")]:
578 ret = ret.replace(old, new)
583 for (old, new)
in [(
"initialStep",
"iter0"),
584 (
"highPtTripletStep",
"iter1"),
585 (
"lowPtQuadStep",
"iter2"),
586 (
"lowPtTripletStep",
"iter3"),
587 (
"detachedQuadStep",
"iter4"),
588 (
"pixelPairStep",
"iter5"),
589 (
"muonSeededStepInOut",
"iter9"),
590 (
"muonSeededStepOutIn",
"iter10")]:
591 path = path.replace(old, new)
595 return subfolder.replace(
"trackingParticleRecoAsssociation",
"trackingParticleRecoAsssociationSignal")
597 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsConversion")
599 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsPreSplitting")
603 _additionalTrackQualities = [
610 quality =
"highPurity"
613 collNameNoQuality = collName.replace(
"Hp",
"")
614 for qual
in _additionalTrackQualities:
617 collNameNoQuality = collNameNoQuality.replace(qual,
"")
619 collNameNoQuality = collNameNoQuality.replace(
"Tracks",
"", 1)
622 if collNameLow.find(
"seed") == 0:
623 collNameLow = collNameLow[4:]
624 if collNameLow ==
"initialstepseedspresplitting":
625 collNameLow =
"initialsteppresplittingseeds"
626 elif collNameLow ==
"muonseededseedsinout":
627 collNameLow =
"muonseededstepinoutseeds"
628 elif collNameLow ==
"muonseededseedsoutin":
629 collNameLow =
"muonseededstepoutinseeds"
631 i_seeds = collNameLow.index(
"seeds")
632 quality = collNameLow[i_seeds:]+quality
634 collNameLow = collNameLow[:i_seeds]
637 prefixes = [
"cutsreco",
"cutsrecofrompv",
"cutsrecofrompv2",
"cutsrecofrompvalltp",
"cutsrecoetagreater2p7"]
638 if collNameLow
in [
"general",
"generalfrompv",
"generaletagreater2p7"]+prefixes:
643 if coll == collNameLow.replace(pfx,
""):
647 for coll
in _possibleTrackingColls:
648 if testColl(coll.lower()):
653 for coll, name
in six.iteritems(_possibleTrackingCollsOld):
654 if testColl(coll.lower()):
660 algo = collNameNoQuality
663 if algo ==
"muonSeededInOut":
664 algo =
"muonSeededStepInOut"
665 if algo ==
"muonSeededOutIn":
666 algo =
"muonSeededStepOutIn"
668 return (algo, quality)
671 return (name, [name])
672 _collLabelMap = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+_possibleTrackingColls))
673 _collLabelMapHp = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+[n
for n
in _possibleTrackingColls
if "Step" in n]))
677 algo =
"generalTracks"
681 if algo !=
"generalTracks" and "ByOriginalAlgo" not in quality:
683 quality = quality.replace(
"ByOriginalAlgo",
"")
685 if algo !=
"generalTracks" and "ByAlgoMask" not in quality:
687 quality = quality.replace(
"ByAlgoMask",
"")
689 if "Pt09" not in quality:
691 quality = quality.replace(
"Pt09",
"")
694 if quality ==
"highPurity":
697 i_seeds = quality.find(
"seeds")
700 seedSubColl = quality[i_seeds+5:]
701 if seedSubColl !=
"":
702 ret += seedSubColl[0].
upper() + seedSubColl[1:]
709 def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix=""):
710 _common = {
"drawStyle":
"EP",
"xbinlabelsize": 10,
"xbinlabeloption":
"d"}
711 _commonN = dict(ylog=
True, ymin=_minMaxN, ymax=_minMaxN,
712 normalizeToNumberOfEvents=
True,
714 _commonN.update(_common)
715 _commonAB = dict(mapping=mapping,
716 renameBin=
lambda bl:
_summaryBinRename(bl, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds),
717 ignoreMissingBins=
True,
720 if byOriginalAlgo
or byAlgoMask:
721 _commonAB[
"minExistingBins"] = 2
722 prefix =
"summary"+midfix
724 h_eff =
"effic_vs_coll"
725 h_fakerate =
"fakerate_vs_coll"
726 h_duplicaterate =
"duplicatesRate_coll"
727 h_pileuprate =
"pileuprate_coll"
729 h_reco =
"num_reco_coll"
730 h_true =
"num_assoc(recoToSim)_coll"
731 h_fake =
Subtract(
"num_fake_coll_orig",
"num_reco_coll",
"num_assoc(recoToSim)_coll")
732 h_duplicate =
"num_duplicate_coll"
733 h_pileup =
"num_pileup_coll"
734 if mapping
is not None:
736 h_fakerate =
AggregateBins(
"fakerate", h_fakerate, **_commonAB)
737 h_duplicaterate =
AggregateBins(
"duplicatesRate", h_duplicaterate, **_commonAB)
738 h_pileuprate =
AggregateBins(
"pileuprate", h_pileuprate, **_commonAB)
743 h_duplicate =
AggregateBins(
"num_duplicate_coll", h_duplicate, **_commonAB)
744 h_pileup =
AggregateBins(
"num_pileup_coll", h_pileup, **_commonAB)
747 Plot(h_eff, title=
"Efficiency vs collection", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
748 Plot(h_fakerate, title=
"Fakerate vs collection", ytitle=
"Fake rate", ymax=_maxFake, **_common),
750 Plot(h_duplicaterate, title=
"Duplicates rate vs collection", ytitle=
"Duplicates rate", ymax=_maxFake, **_common),
751 Plot(h_pileuprate, title=
"Pileup rate vs collection", ytitle=
"Pileup rate", ymax=_maxFake, **_common),
753 legendDy=_legendDy_2rows
755 summaryN =
PlotGroup(prefix+
"_ntracks", [
762 Plot(h_reco, ytitle=
"Tracks", title=
"Number of tracks vs collection", **_commonN),
763 Plot(h_true, ytitle=
"True tracks", title=
"Number of true tracks vs collection", **_commonN),
764 Plot(h_fake, ytitle=
"Fake tracks", title=
"Number of fake tracks vs collection", **_commonN),
765 Plot(h_duplicate, ytitle=
"Duplicate tracks", title=
"Number of duplicate tracks vs collection", **_commonN),
766 Plot(h_pileup, ytitle=
"Pileup tracks", title=
"Number of pileup tracks vs collection", **_commonN),
769 return (summary, summaryN)
774 (_summaryByOriginalAlgo, _summaryByOriginalAlgoN) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo")
775 (_summaryByOriginalAlgoHp, _summaryByOriginalAlgoNHp) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo", highPurity=
True)
776 (_summaryByAlgoMask, _summaryByAlgoMaskN) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask")
777 (_summaryByAlgoMaskHp, _summaryByAlgoMaskNHp) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask", highPurity=
True)
778 (_summaryPt09, _summaryPt09N) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09")
779 (_summaryPt09Hp, _summaryPt09NHp) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09", highPurity=
True)
788 _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]}
790 _commonStatus.update(_common)
791 _commonStatus.update({
"xbinlabelsize": 10,
"xbinlabeloption":
"d",
"drawStyle":
"hist",
"adjustMarginRight": 0.08})
792 _commonLabelSize = {}
793 _commonLabelSize.update(_common)
794 _commonLabelSize.update({
"xlabelsize": 17})
797 Plot(
"selectionFlow", xbinlabelsize=10, xbinlabeloption=
"d", adjustMarginRight=0.1, drawStyle=
"hist", ylog=
True, ymin=[0.9, 9, 9e1, 9e2, 9e3, 9e4, 9e5, 9e6, 9e7]),
798 Plot(
"diffCharge", xtitle=
"Charge", **_common),
799 Plot(
"diffIsHighPurity", xtitle=
"High purity status", **_common),
800 Plot(
"diffNdof", xtitle=
"ndof", **_common),
801 Plot(
"diffNormalizedChi2", xtitle=
"#chi^{2}/ndof", **_common),
804 _packedCandidateHitsHitPattern =
PlotGroup(
"hitsHitPattern", [
805 Plot(
"diffHitPatternNumberOfValidHits", xtitle=
"Valid hits (via HitPattern)", **_common),
806 Plot(
"diffHitPatternNumberOfValidPixelHits", xtitle=
"Valid pixel hits (via HitPattern)", **_common),
807 Plot(
"diffHitPatternHasValidHitInFirstPixelBarrel", xtitle=
"Has valid hit in BPix1 layer (via HitPattern)", **_common),
808 Plot(
"diffHitPatternNumberOfLostPixelHits", xtitle=
"Lost pixel hits (via HitPattern)", **_common),
810 legendDy=_legendDy_2rows
813 Plot(
"diffNumberOfHits", xtitle=
"Hits", **_common),
814 Plot(
"diffNumberOfPixelHits", xtitle=
"Pixel hits", **_common),
815 Plot(
"diffLostInnerHits", xtitle=
"Lost inner hits", **_common),
816 Plot(
"numberHitsOverMax", xtitle=
"Number of overflown hits", **_common),
817 Plot(
"numberPixelHitsOverMax", xtitle=
"Number of overflown pixel hits", **_common),
818 Plot(
"numberStripHitsOverMax", xtitle=
"Number of overflown strip hits", **_common),
820 ncols=3, legendDy=_legendDy_2rows_3cols
825 Plot(
"diffNumberOfPixelLayers", xtitle=
"Pixel layers", **_common),
826 Plot(
"diffNumberOfStripLayers", xtitle=
"Strip layers", **_common),
828 Plot(
"diffHitPatternTrackerLayersWithMeasurement", xtitle=
"Layers (via HitPattern)", **_common),
829 Plot(
"diffHitPatternPixelLayersWithMeasurement", xtitle=
"Pixel layers (via HitPattern)", **_common),
830 Plot(
"diffHitPatternStripLayersWithMeasurement", xtitle=
"Strip layers (via HitPattern)", **_common),
832 Plot(
"numberLayersOverMax", xtitle=
"Number of overflown layers", **_common),
833 Plot(
"numberPixelLayersOverMax", xtitle=
"Number of overflown pixel layers", **_common),
834 Plot(
"numberStripLayersOverMax", xtitle=
"Number of overflown strip layers", **_common),
840 _packedCandidateImpactParameter1 =
PlotGroup(
"impactParameter1", [
841 Plot(
"diffDxyAssocPV", xtitle=
"dxy(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
842 Plot(
"diffDxyAssocPVStatus", **_commonStatus),
843 Plot(
"diffDxyAssocPVUnderOverFlowSign", xtitle=
"dxy(assocPV)", **_common),
844 Plot(
"diffDzAssocPV", xtitle=
"dz(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
845 Plot(
"diffDzAssocPVStatus", **_commonStatus),
846 Plot(
"diffDzAssocPVUnderOverFlowSign", xtitle=
"dz(assocPV)", **_common),
847 Plot(
"diffDxyError", xtitle=
"dxyError()", adjustMarginRight=0.02, **_commonLabelSize),
848 Plot(
"diffDszError", xtitle=
"dszError()", adjustMarginRight=0.02, **_commonLabelSize),
849 Plot(
"diffDzError", xtitle=
"dzError()", adjustMarginRight=0.02, **_commonLabelSize),
855 _packedCandidateImpactParameter2 =
PlotGroup(
"impactParameter2", [
856 Plot(
"diffDxyPV", xtitle=
"dxy(PV) via PC", **_commonLabelSize),
857 Plot(
"diffDzPV", xtitle=
"dz(PV) via PC", **_commonLabelSize),
858 Plot(
"diffTrackDxyAssocPV", xtitle=
"dxy(PV) via PC::bestTrack()", **_commonLabelSize),
859 Plot(
"diffTrackDzAssocPV", xtitle=
"dz(PV) via PC::bestTrack()", **_commonLabelSize),
860 Plot(
"diffTrackDxyError", xtitle=
"dxyError() via PC::bestTrack()", adjustMarginRight=0.02, **_commonLabelSize),
861 Plot(
"diffTrackDzError", xtitle=
"dzError() via PC::bestTrack()", **_commonLabelSize),
864 _packedCandidateCovarianceMatrix1 =
PlotGroup(
"covarianceMatrix1", [
865 Plot(
"diffCovQoverpQoverp", xtitle=
"cov(qoverp, qoverp)", **_commonLabelSize),
866 Plot(
"diffCovQoverpQoverpStatus", **_commonStatus),
867 Plot(
"diffCovQoverpQoverpUnderOverFlowSign", xtitle=
"cov(qoverp, qoverp)", **_common),
868 Plot(
"diffCovLambdaLambda", xtitle=
"cov(lambda, lambda)", **_commonLabelSize),
869 Plot(
"diffCovLambdaLambdaStatus", **_commonStatus),
870 Plot(
"diffCovLambdaLambdaUnderOverFlowSign", xtitle=
"cov(lambda, lambda)", **_common),
871 Plot(
"diffCovLambdaDsz", xtitle=
"cov(lambda, dsz)", **_commonLabelSize),
872 Plot(
"diffCovLambdaDszStatus", **_commonStatus),
873 Plot(
"diffCovLambdaDszUnderOverFlowSign", xtitle=
"cov(lambda, dsz)", **_common),
874 Plot(
"diffCovPhiPhi", xtitle=
"cov(phi, phi)", **_commonLabelSize),
875 Plot(
"diffCovPhiPhiStatus", **_commonStatus),
876 Plot(
"diffCovPhiPhiUnderOverFlowSign", xtitle=
"cov(phi, phi)", **_common),
878 ncols=3, legendDy=_legendDy_4rows
880 _packedCandidateCovarianceMatrix2 =
PlotGroup(
"covarianceMatrix2", [
881 Plot(
"diffCovPhiDxy", xtitle=
"cov(phi, dxy)", **_commonLabelSize),
882 Plot(
"diffCovPhiDxyStatus", **_commonStatus),
883 Plot(
"diffCovPhiDxyUnderOverFlowSign", xtitle=
"cov(phi, dxy)", **_common),
884 Plot(
"diffCovDxyDxy", xtitle=
"cov(dxy, dxy)", adjustMarginRight=0.02, **_commonLabelSize),
885 Plot(
"diffCovDxyDxyStatus", **_commonStatus),
886 Plot(
"diffCovDxyDxyUnderOverFlowSign", xtitle=
"cov(dxy, dxy)", **_common),
887 Plot(
"diffCovDxyDsz", xtitle=
"cov(dxy, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
888 Plot(
"diffCovDxyDszStatus", **_commonStatus),
889 Plot(
"diffCovDxyDszUnderOverFlowSign", xtitle=
"cov(dxy, dsz)", **_common),
890 Plot(
"diffCovDszDsz", xtitle=
"cov(dsz, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
891 Plot(
"diffCovDszDszStatus", **_commonStatus),
892 Plot(
"diffCovDszDszUnderOverFlowSign", xtitle=
"cov(dsz, dsz)", **_common),
894 ncols=3, legendDy=_legendDy_4rows
897 _common[
"xlabelsize"] = 16
899 Plot(
"diffVx", xtitle=
"Reference point x", **_common),
900 Plot(
"diffVy", xtitle=
"Reference point y", **_common),
901 Plot(
"diffVz", xtitle=
"Reference point z", **_common),
903 legendDy=_legendDy_2rows
906 _common[
"adjustMarginRight"] = 0.05
908 Plot(
"diffPt", xtitle=
"p_{T}", **_common),
909 Plot(
"diffPtError", xtitle=
"p_{T} error", **_common),
910 Plot(
"diffEta", xtitle=
"#eta", **_common),
911 Plot(
"diffEtaError", xtitle=
"#eta error", **_common),
912 Plot(
"diffPhi", xtitle=
"#phi", **_common),
918 PlotFolder.__init__(self, *args, **kwargs)
921 spl = dqmSubFolderName.split(
"_")
928 (algoOrig, quality) = translatedDqmSubFolder
934 if plotFolderName !=
"":
935 ret +=
"_"+plotFolderName
938 if not (algo ==
"ootb" and quality !=
""):
943 """Return True if this subfolder should be processed
946 limitOnlyTo -- Function '(algo, quality) -> bool'
947 translatedDqmSubFolder -- Return value of translateSubFolder
949 (algo, quality) = translatedDqmSubFolder
950 return limitOnlyTo(algo, quality)
954 return algo
not in _possibleTrackingNonIterationColls
965 def __init__(self, section, collection=GeneralTracks):
981 def _getAlgoQuality(data, algo, quality):
982 for label, value
in six.iteritems(data):
984 if a == algo
and q == quality:
988 h = tdirectory.Get(hname)
993 return _getAlgoQuality(data,
"ootb",
"")
995 return _getAlgoQuality(data,
"ootb",
"Pt09")
997 return _getAlgoQuality(data,
"ootb",
"highPurity")
999 return _getAlgoQuality(data,
"ootb",
"highPurityPt09")
1001 return _getAlgoQuality(data,
"btvLike",
"")
1003 return _getAlgoQuality(data,
"ak4PFJets",
"")
1005 return _getAlgoQuality(data,
"pixel",
"")
1008 def _formatOrNone(num, func):
1013 n_tps = _formatOrNone(_getN(
"num_simul_coll"), int)
1014 n_m_tps = _formatOrNone(_getN(
"num_assoc(simToReco)_coll"), int)
1016 n_tracks = _formatOrNone(_getN(
"num_reco_coll"), int)
1017 n_true = _formatOrNone(_getN(
"num_assoc(recoToSim)_coll"), int)
1018 if n_tracks
is not None and n_true
is not None:
1019 n_fake = n_tracks-n_true
1022 n_pileup = _formatOrNone(_getN(
"num_pileup_coll"), int)
1023 n_duplicate = _formatOrNone(_getN(
"num_duplicate_coll"), int)
1025 eff = _formatOrNone(_getN(
"effic_vs_coll"),
lambda n:
"%.4f" % n)
1026 eff_nopt = _formatOrNone(_getN(
"effic_vs_coll_allPt"),
lambda n:
"%.4f" % n)
1027 fake = _formatOrNone(_getN(
"fakerate_vs_coll"),
lambda n:
"%.4f" % n)
1028 duplicate = _formatOrNone(_getN(
"duplicatesRate_coll"),
lambda n:
"%.4f" % n)
1030 ret = [eff, n_tps, n_m_tps,
1031 eff_nopt, fake, duplicate,
1032 n_tracks, n_true, n_fake, n_pileup, n_duplicate]
1033 if ret.count(
None) == len(ret):
1040 "Number of TrackingParticles (after cuts)",
1041 "Number of matched TrackingParticles",
1042 "Efficiency (w/o pT cut)",
1046 "Number of true tracks",
1047 "Number of fake tracks",
1048 "Number of pileup tracks",
1049 "Number of duplicate tracks"
1054 def __init__(self, fileName, plots, titles, isRate, **kwargs):
1060 if len(plots) != len(titles):
1061 raise Exception(
"Number of plots (%d) has to be the same as number of titles (%d)" % (len(plots), len(titles)))
1063 def _set(attr, default):
1064 setattr(self,
"_"+attr, kwargs.get(attr, default))
1066 _set(
"onlyForPileup",
False)
1069 """Return True if the PlotGroup is intended only for pileup samples"""
1070 return self._onlyForPileup
1072 def create(self, tdirectoryNEvents, requireAllHistograms=False):
1075 plot.create(tdirectoryNEvents, requireAllHistograms)
1077 def draw(self, legendLabels, prefix=None, directory="", *args, **kwargs):
1079 onlyEmptyPlots =
True
1081 if not plot.isEmpty():
1082 onlyEmptyPlots =
False
1087 haveShortLabels =
False
1088 legendLabels = legendLabels[:]
1089 if max(
map(len, legendLabels)) > 20:
1090 haveShortLabels =
True
1091 labels_short = [
str(chr(ord(
'A')+i))
for i
in range(len(legendLabels))]
1092 for i, ls
in enumerate(labels_short):
1093 legendLabels[i] =
"%s: %s" % (ls, legendLabels[i])
1095 labels_short = legendLabels
1100 ' <table border="1">',
1111 for h, l
in zip(plot._histograms, labels_short):
1113 h_tmp.append(len(histos_linear))
1114 histos_linear.append(h)
1118 histos_index.append(h_tmp)
1119 labels.append(l_tmp)
1122 ' <td colspan="%d">%s</td>' % (len(h_tmp), title),
1125 if len(histos_linear) == 0:
1135 if len(histos_linear) == 0:
1139 if len(histos_linear_new) > 0
and len(histos_linear_new) != len(histos_linear):
1140 raise Exception(
"This should never happen. len(histos_linear_new) %d != len(histos_linear) %d" % (len(histos_linear_new), len(histos_linear)))
1141 histos_linear = histos_linear_new
1142 if len(histos_linear) == 0:
1145 data = [ [h.GetBinContent(i)
for i
in range(1, h.GetNbinsX()+1)]
for h
in histos_linear]
1146 table =
html.Table([
"dummy"]*len(histos_linear), xbinlabels, data,
None,
None,
None)
1147 data = table.tableAsRowColumn()
1150 content.append(
' <td></td>')
1151 content.extend([
' <td>%s</td>' % lab
for lab
in labs])
1156 for irow, row
in enumerate(data):
1159 ' <td>%s</td>' % table.rowHeaders()[irow]
1162 for hindices
in histos_index:
1163 for hindex
in hindices:
1165 formatted = self.
_format%item
if item
is not None else ""
1166 content.append(
' <td align="right">%s</td>' % formatted)
1167 content.append(
' <td></td>')
1169 content.append(
' </tr>')
1171 content.append(
' </table>')
1173 for lab
in legendLabels:
1174 content.append(
' %s<br/>' % lab)
1182 if prefix
is not None:
1185 name = os.path.join(directory, name)
1187 with open(name,
"w")
as f:
1188 for line
in content:
1194 [
"Fake rate",
"Duplicate rate",
"Pileup rate"], isRate=
True)
1196 [
"All tracks",
"True tracks",
"Fake tracks",
"Duplicate tracks"], isRate=
False)
1200 "DQMData/Run 1/Tracking/Run summary/"+lastDirName,
1201 "DQMData/Tracking/"+lastDirName,
1202 "DQMData/Run 1/RecoTrackV/Run summary/"+lastDirName,
1203 "DQMData/RecoTrackV/"+lastDirName,
1207 _effandfakePtEtaPhi,
1210 _effandfakeHitsLayers,
1212 _effandfakeDeltaRPU,
1216 _dupandfakePtEtaPhi,
1219 _dupandfakeHitsLayers,
1221 _dupandfakeDeltaRPU,
1222 _dupandfakeChi2Seeding,
1223 _dupandfakeSeedingTable,
1236 _seedingBuildingPlots = _simBasedPlots + [
1237 _dupandfakePtEtaPhi,
1240 _dupandfakeHitsLayers,
1242 _dupandfakeDeltaRPU,
1243 _dupandfakeChi2Seeding,
1244 _dupandfakeSeedingTable,
1252 _buildingExtendedPlots = [
1266 _extDistChi2Seeding,
1267 _extDistSeedingTable,
1272 _extDistSimPtEtaPhi,
1275 _extDistSimHitsLayers,
1282 _summaryByOriginalAlgo,
1283 _summaryByOriginalAlgoN,
1285 _summaryByAlgoMaskN,
1292 _summaryByOriginalAlgoHp,
1293 _summaryByOriginalAlgoNHp,
1294 _summaryByAlgoMaskHp,
1295 _summaryByAlgoMaskNHp,
1299 _summaryPlotsSeeds = [
1303 _packedCandidatePlots = [
1304 _packedCandidateFlow,
1305 _packedCandidateKinematics,
1306 _packedCandidateVertex,
1307 _packedCandidateImpactParameter1,
1308 _packedCandidateImpactParameter2,
1309 _packedCandidateCovarianceMatrix1,
1310 _packedCandidateCovarianceMatrix2,
1311 _packedCandidateHits,
1312 _packedCandidateHitsHitPattern,
1313 _packedCandidateLayers,
1317 def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, onlyForBHadron=False, seeding=False, building=False, rawSummary=False, highPuritySummary=True):
1320 limiters = dict(onlyForPileup=onlyForPileup, onlyForElectron=onlyForElectron, onlyForConversion=onlyForConversion, onlyForBHadron=onlyForBHadron)
1322 _trackingRefFileFallbackSLHC_Phase1PU140
1324 common = dict(fallbackDqmSubFolders=[
1325 _trackingSubFoldersFallbackSLHC_Phase1PU140,
1326 _trackingSubFoldersFallbackFromPV, _trackingSubFoldersFallbackConversion,
1327 _trackingSubFoldersFallbackPreSplitting])
1328 plotter.append(name, folders,
TrackingPlotFolder(*algoPlots, **commonForTPF), **common)
1331 extendedPlots.extend(_buildingExtendedPlots)
1332 extendedPlots.extend(_extendedPlots)
1333 plotterExt.append(name, folders,
TrackingPlotFolder(*extendedPlots, **commonForTPF), **common)
1337 summaryName += name+
"_"
1338 summaryName +=
"summary"
1341 summaryPlots.extend([_summaryRaw, _summaryRawN])
1342 summaryPlots.extend(_summaryPlots)
1347 plotter.append(summaryName, folders,
1348 PlotFolder(*summaryPlots, section=name, **common))
1349 if highPuritySummary:
1350 plotter.append(summaryName+
"_highPurity", folders,
1351 PlotFolder(*_summaryPlotsHp, section=name+
"_highPurity" if name !=
"" else "highPurity", **common),
1352 fallbackNames=[summaryName])
1354 plotter.append(summaryName+
"_seeds", folders,
1355 PlotFolder(*_summaryPlotsSeeds, section=name+
"_seeds", **common))
1359 if highPuritySummary:
1360 sectionName = name+
"_highPurity" if name !=
"" else "highPurity"
1368 _appendTrackingPlots(
"TrackTPEtaGreater2p7",
"tpEtaGreater2p7", _simBasedPlots+_recoBasedPlots)
1370 _appendTrackingPlots(
"TrackFromPV",
"fromPV", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1371 _appendTrackingPlots(
"TrackFromPVAllTP",
"fromPVAllTP", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1372 _appendTrackingPlots(
"TrackFromPVAllTP2",
"fromPVAllTP2", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1375 _appendTrackingPlots(
"TrackConversion",
"conversion", _simBasedPlots+_recoBasedPlots, onlyForConversion=
True, rawSummary=
True, highPuritySummary=
False)
1376 _appendTrackingPlots(
"TrackGsf",
"gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=
True, rawSummary=
True, highPuritySummary=
False)
1377 _appendTrackingPlots(
"TrackBHadron",
"bhadron", _simBasedPlots+_recoBasedPlots, onlyForBHadron=
True)
1388 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1390 plotter.append(
"packedCandidateLostTracks",
_trackingFolders(
"PackedCandidate/lostTracks"),
1391 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1396 "DQMData/Run 1/HLT/Run summary/Tracking/ValidationWRTtp",
1401 plotterHLT.append(
"hlt", _hltFolder,
TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
1402 plotterHLTExt.append(
"hlt", _hltFolder,
TrackingPlotFolder(*_extendedPlots, **_common))
1406 def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[]):
1409 def _set(param, name, modules):
1410 if param
is not None:
1411 setattr(self, name, param)
1413 setattr(self, name, modules)
1415 _set(clusterMasking,
"_clusterMasking", [self.
_name+
"Clusters"])
1418 _set(seeding,
"_seeding", [self.
_name+
"SeedingLayers", self.
_name+
"TrackingRegions", self.
_name+
"HitDoublets", self.
_name+
"HitTriplets", self.
_name+
"HitQuadruplets", self.
_name+
"Seeds"])
1419 _set(building,
"_building", [self.
_name+
"TrackCandidates"])
1420 _set(fit,
"_fit", [self.
_name+
"Tracks"])
1421 _set(selection,
"_selection", [self.
_name])
1428 return self._clusterMasking+self._seeding+self._building+self._fit+self._selection+self.
_other
1431 return self._clusterMasking
1434 return self._seeding
1437 return self._building
1443 return self._selection
1452 (
"Fit", self.
fit()),
1454 (
"Other", self.
other())]
1459 seeding=[
"initialStepSeedLayersPreSplitting",
1460 "initialStepTrackingRegionsPreSplitting",
1461 "initialStepHitDoubletsPreSplitting",
1462 "initialStepHitTripletsPreSplitting",
1463 "initialStepHitQuadrupletsPreSplitting",
1464 "initialStepSeedsPreSplitting"],
1465 building=[
"initialStepTrackCandidatesPreSplitting"],
1466 fit=[
"initialStepTracksPreSplitting"],
1467 other=[
"firstStepPrimaryVerticesPreSplitting",
1468 "initialStepTrackRefsForJetsPreSplitting",
1469 "caloTowerForTrkPreSplitting",
1470 "ak4CaloJetsForTrkPreSplitting",
1471 "jetsForCoreTrackingPreSplitting",
1474 "MeasurementTrackerEvent",
1475 "siPixelClusterShapeCache"]),
1476 Iteration(
"initialStep", clusterMasking=[],
1477 selection=[
"initialStepClassifier1",
1478 "initialStepClassifier2",
1479 "initialStepClassifier3",
1481 "initialStepSelector"],
1482 building=[
"initialStepTrackCandidatesMkFitInput",
1483 "initialStepTrackCandidatesMkFit",
1484 "initialStepTrackCandidates"],
1485 other=[
"firstStepPrimaryVerticesUnsorted",
1486 "initialStepTrackRefsForJets",
1488 "ak4CaloJetsForTrk",
1489 "firstStepPrimaryVertices"]),
1491 selection=[
"highPtTripletStepClassifier1",
1492 "highPtTripletStepClassifier2",
1493 "highPtTripletStepClassifier3",
1494 "highPtTripletStep",
1495 "highPtTripletStepSelector"]),
1497 selection=[
"detachedQuadStepClassifier1",
1498 "detachedQuadStepClassifier2",
1500 "detachedQuadStepSelector"]),
1502 selection=[
"detachedTripletStepClassifier1",
1503 "detachedTripletStepClassifier2",
1504 "detachedTripletStep",
1505 "detachedTripletStepSelector"]),
1507 selection=[
"lowPtQuadStepClassifier1",
1508 "lowPtQuadStepClassifier2",
1510 "lowPtQuadStepSelector"]),
1512 selection=[
"lowPtTripletStepClassifier1",
1513 "lowPtTripletStepClassifier2",
1515 "lowPtTripletStepSelector"]),
1517 seeding=[
"pixelPairStepSeedLayers",
1518 "pixelPairStepSeedLayersB",
1519 "pixelPairStepSeedLayersC",
1520 "pixelPairStepTrackingRegions",
1521 "pixelPairStepTrackingRegionsB",
1522 "pixelPairStepTrackingRegionsC",
1523 "pixelPairStepTrackingRegionsSeedLayersB",
1524 "pixelPairStepHitDoublets",
1525 "pixelPairStepHitDoubletsB",
1526 "pixelPairStepHitDoubletsC",
1527 "pixelPairStepSeedsA",
1528 "pixelPairStepSeedsB",
1529 "pixelPairStepSeedsC",
1530 "pixelPairStepSeeds",],
1531 selection=[
"pixelPairStep",
1532 "pixelPairStepSelector"]),
1534 seeding=[
"mixedTripletStepSeedLayersA",
1535 "mixedTripletStepSeedLayersB",
1536 "mixedTripletStepTrackingRegionsA",
1537 "mixedTripletStepTrackingRegionsB",
1538 "mixedTripletStepHitDoubletsA",
1539 "mixedTripletStepHitDoubletsB",
1540 "mixedTripletStepHitTripletsA",
1541 "mixedTripletStepHitTripletsB",
1542 "mixedTripletStepSeedsA",
1543 "mixedTripletStepSeedsB",
1544 "mixedTripletStepSeeds"],
1545 selection=[
"mixedTripletStepClassifier1",
1546 "mixedTripletStepClassifier2",
1548 "mixedTripletStepSelector"]),
1550 selection=[
"pixelLessStepClassifier1",
1551 "pixelLessStepClassifier2",
1553 "pixelLessStepSelector"]),
1555 seeding=[
"tobTecStepSeedLayersTripl",
1556 "tobTecStepSeedLayersPair",
1557 "tobTecStepTrackingRegionsTripl",
1558 "tobTecStepTrackingRegionsPair",
1559 "tobTecStepHitDoubletsTripl",
1560 "tobTecStepHitDoubletsPair",
1561 "tobTecStepHitTripletsTripl",
1562 "tobTecStepSeedsTripl",
1563 "tobTecStepSeedsPair",
1565 selection=[
"tobTecStepClassifier1",
1566 "tobTecStepClassifier2",
1568 "tobTecStepSelector"]),
1571 other=[
"jetsForCoreTracking",
1572 "firstStepGoodPrimaryVertices",
1576 seeding=[
"muonSeededSeedsInOut",
1577 "muonSeededSeedsOutIn"],
1578 building=[
"muonSeededTrackCandidatesInOut",
1579 "muonSeededTrackCandidatesOutIn"],
1580 fit=[
"muonSeededTracksInOut",
1581 "muonSeededTracksOutIn"],
1582 selection=[
"muonSeededTracksInOutClassifier",
1583 "muonSeededTracksInOutSelector",
1584 "muonSeededTracksOutIntClassifier",
1585 "muonSeededTracksOutIntSelector"],
1589 clusterMasking=[], seeding=[],
1590 building=[
"duplicateTrackCandidates"],
1591 fit=[
"mergedDuplicateTracks"],
1592 selection=[
"duplicateTrackClassifier"]),
1594 clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1595 other=[
"preDuplicateMergingGeneralTracks",
1598 clusterMasking=[
"convClusters"],
1599 seeding=[
"convLayerPairs",
1600 "photonConvTrajSeedFromSingleLeg"],
1601 building=[
"convTrackCandidates"],
1602 fit=[
"convStepTracks"],
1603 selection=[
"convStepSelector"]),
1604 Iteration(
"Other", clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1605 other=[
"trackerClusterCheckPreSplitting",
1606 "trackerClusterCheck"]),
1610 iterations = _iterations
1611 if not includeConvStep:
1612 iterations = [i
for i
in iterations
if i.name() !=
"ConvStep"]
1614 iterations = [i
for i
in iterations
if i.name() ==
"ConvStep"]
1615 return collections.OrderedDict([(i.name(), i.all())
for i
in iterations])
1619 for i
in _iterations:
1620 if i.name() ==
"ConvStep":
1622 ret.extend(getattr(i, prop)())
1625 return collections.OrderedDict([
1626 (
"ClusterMask", getProp(
"clusterMasking")),
1627 (
"Seeding", getProp(
"seeding")),
1628 (
"Building", getProp(
"building")),
1629 (
"Fitting", getProp(
"fit")),
1630 (
"Selection", getProp(
"selection")),
1631 (
"Other", getProp(
"other"))
1650 if eventsTh1
is None:
1652 nevents = eventsTh1.GetEntries()
1656 ret = timeTh1.Clone(self.
_name)
1657 xaxis = ret.GetXaxis()
1658 for i
in range(1, ret.GetNbinsX()+1):
1659 ret.SetBinContent(i, ret.GetBinContent(i)/nevents)
1660 ret.SetBinError(i, ret.GetBinError(i)/nevents)
1661 xaxis.SetBinLabel(i, xaxis.GetBinLabel(i).
replace(
" (unscheduled)",
""))
1665 path = tdirectory.GetPath()
1666 if path
not in self.
_cache:
1671 def __init__(self, name, timeHisto, selectedTracks=False):
1681 tdir = tfile.Get(dirName)
1693 tfile = tdirectory.GetFile()
1698 iterMap = copy.copy(_collLabelMapHp)
1699 del iterMap[
"generalTracks"]
1700 del iterMap[
"jetCoreRegionalStep"]
1702 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
True, byOriginalAlgo=
False, byAlgoMask=
True, ptCut=
False, seeds=
False)
1704 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
False, byOriginalAlgo=
False, byAlgoMask=
False, ptCut=
False, seeds=
False)
1705 recoAB =
AggregateBins(
"tmp",
"num_reco_coll", mapping=iterMap,ignoreMissingBins=
True, renameBin=renameBin)
1706 h_reco_per_iter = recoAB.create(trkDir)
1707 if h_reco_per_iter
is None:
1710 for i
in range(1, h_reco_per_iter.GetNbinsX()+1):
1711 values[h_reco_per_iter.GetXaxis().GetBinLabel(i)] = h_reco_per_iter.GetBinContent(i)
1715 for i
in range(1, timeTh1.GetNbinsX()+1):
1716 iterName = timeTh1.GetXaxis().GetBinLabel(i)
1717 if iterName
in values:
1718 ntrk = values[iterName]
1719 result.append( (iterName,
1720 timeTh1.GetBinContent(i)/ntrk
if ntrk > 0
else 0,
1721 timeTh1.GetBinError(i)/ntrk
if ntrk > 0
else 0) )
1723 if len(result) == 0:
1726 res = ROOT.TH1F(self.
_name, self.
_name, len(result), 0, len(result))
1727 for i, (label, value, error)
in enumerate(result):
1728 res.GetXaxis().SetBinLabel(i+1, label)
1729 res.SetBinContent(i+1, value)
1730 res.SetBinError(i+1, error)
1739 h = f.Get(_trackingIterationOrderHistogram)
1742 xaxis = h.GetXaxis()
1746 return s.replace(
"Tracks",
"").
replace(
"muonSeeded",
"muonSeededStep")
1747 return [_edit(xaxis.GetBinLabel(i))
for i
in range(1, h.GetNbinsX()+1)]
1750 ret = list(
range(0, len(labels)))
1751 f = tdirectory.GetFile()
1755 if not f.GetName()
in self.
_cache:
1759 self.
_cache[f.GetName()] = r
1760 order = self.
_cache[f.GetName()]
1766 orderIndices.append(labels.index(l))
1770 for i, l
in enumerate(labels):
1773 found = orderIndices.index(i)
1777 ret.append(orderIndices[0])
1779 ret.append(orderIndices[0])
1804 h = tdirectory.Get(histo)
1807 totalReco =
"%.1f" % h.Integral()
1810 h = creator.create(tdirectory)
1811 totalTracking =
None
1813 totalTracking =
"%.1f" % h.Integral()
1816 h = creator.create(tdirectory)
1817 totalConvStep =
None
1819 totalConvStep =
"%.1f" % h.Integral()
1828 cpuValues = self.
_getValues(tdirectory, _time_per_event_cpu)
1829 realValues = self.
_getValues(tdirectory, _time_per_event_real)
1831 return cpuValues + realValues
1835 "Average reco CPU time / event (ms)",
1836 "Average tracking (w/o convStep) CPU time / event (ms)",
1837 "Average convStep CPU time / event (ms)",
1838 "Average reco real time / event (ms)",
1839 "Average tracking (w/o convStep) real time / event (ms)",
1840 "Average convStep real time / event (ms)",
1845 "xbinlabelsize": 10,
1846 "xbinlabeloption":
"d"
1854 Plot(_time_per_iter_cpu,
1855 ytitle=
"Average CPU time (ms)", title=
"Average CPU time / event", legendDx=-0.4, **_common),
1857 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1860 ytitle=
"Average CPU time (ms)", title=
"Average CPU time / event", **_common),
1862 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1865 ytitle=
"Average CPU time / built track (ms)", title=
"Average CPU time / built track", **_common),
1867 ytitle=
"Average CPU time / selected track (ms)", title=
"Average CPU time / selected HP track by algoMask", **_common),
1871 Plot(_time_per_iter_real,
1872 ytitle=
"Average real time (ms)", title=
"Average real time / event", legendDx=-0.4, **_common),
1874 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1877 ytitle=
"Average real time (ms)", title=
"Average real time / event", **_common),
1879 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1882 ytitle=
"Average real time / built track (ms)", title=
"Average real time / built track", **_common),
1884 ytitle=
"Average real time / selected track (ms)", title=
"Average real time / selected HP track by algoMask", **_common),
1889 Plot(
AggregateBins(i.name(), _time_per_event_cpu, collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1890 ytitle=
"Average CPU time (ms)", title=i.name(), **_common)
1891 for i
in _iterations
1893 ncols=4, legend=
False
1896 Plot(
AggregateBins(i.name(), _time_per_event_real, collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1897 ytitle=
"Average real time (ms)", title=i.name(), **_common)
1898 for i
in _iterations
1900 ncols=4, legend=
False
1910 "DQMData/Run 1/DQM/Run summary/TimerService/process RECO paths/path prevalidation_step",
1913 timePlotter.append(
"timing", _timeFolders,
PlotFolder(
1915 _timing_iterationsCPU,
1916 _timing_summaryReal,
1917 _timing_iterationsReal,
1923 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist"}
1925 Plot(
"TPlip", xtitle=
"TP lip", **_common),
1926 Plot(
"TPtip", xtitle=
"TP tip", **_common),
1930 tpPlotter.append(
"tp", [
1931 "DQMData/Run 1/Tracking/Run summary/TrackingMCTruth/TrackingParticle",
1932 "DQMData/Tracking/TrackingMCTruth/TrackingParticle",