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]
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]
37 _legendDy_2rows = -0.025
38 _legendDy_2rows_3cols = -0.17
39 _legendDy_4rows = 0.09
41 _trackingNumberOfEventsHistogram =
"DQMData/Run 1/Tracking/Run summary/Track/general_trackingParticleRecoAsssociation/tracks"
48 xq +=
" (" + unit +
")"
50 effargs =
dict(xtitle=
"TP "+xq , ytitle=
"efficiency vs "+q , ymax=_maxEff)
51 fakeargs =
dict(xtitle=
"track "+xq, ytitle=
"fake+duplicates rate vs "+q, ymax=_maxFake)
52 effargs.update(common)
53 fakeargs.update(common)
54 effargs.update(effopts)
55 fakeargs.update(fakeopts)
58 Plot(
"effic_vs_"+p, **effargs),
59 Plot(
FakeDuplicate(
"fakeduprate_vs_"+p, assoc=
"num_assoc(recoToSim)_"+p, dup=
"num_duplicate_"+p, reco=
"num_reco_"+p, title=
"fake+duplicates vs "+q), **fakeargs)
71 xq +=
" (" + unit +
")"
75 Plot(
"fakerate_vs_"+p , xtitle=xtitle, ytitle=
"fakerate vs "+q , ymax=_maxFake, **common),
76 Plot(
"duplicatesRate_"+p, xtitle=xtitle, ytitle=
"duplicates rate vs "+q, ymax=_maxFake, **common),
77 Plot(
"pileuprate_"+p , xtitle=xtitle, ytitle=
"pileup rate vs "+q , ymax=_maxFake, **common),
84 args =
dict(xtitle=
"track "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
88 Plot(
"num_reco_"+p , ytitle=
"tracks", **args),
89 Plot(
"num_assoc(recoToSim)_"+p, ytitle=
"true tracks", **args),
90 Plot(
Subtract(
"num_fake_"+p,
"num_reco_"+p,
"num_assoc(recoToSim)_"+p), ytitle=
"fake tracks", **args),
91 Plot(
"num_duplicate_"+p , ytitle=
"duplicate tracks", **args),
98 args =
dict(xtitle=
"TP "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
102 Plot(
"num_simul_"+p , ytitle=
"TrackingParticles", **args),
103 Plot(
"num_assoc(simToReco)_"+p, ytitle=
"Reconstructed TPs", **args),
107 pfix =
"_hp" if hp
else ""
108 pfix2 =
"Hp" if hp
else ""
110 xtitle =
"MVA%d output"%num
111 xtitlecut =
"Cut on MVA%d output"%num
112 args =
dict(xtitle=xtitle, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
115 xtitle=
"Efficiency (excl. trk eff)", ytitle=
"Fake rate",
116 xmax=_maxEff, ymax=_maxFake,
120 ztitle=
"Cut on MVA%d"%num,
121 xtitleoffset=5, ytitleoffset=6.5, ztitleoffset=4,
122 adjustMarginRight=0.12
124 argsroc2.update(argsroc)
125 argsroc2[
"drawStyle"] =
"pcolz"
127 true_cuteff =
CutEfficiency(
"trueeff_vs_mva%dcut%s"%(num,pfix),
"num_assoc(recoToSim)_mva%dcut%s"%(num,pfix))
128 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)))
130 return PlotGroup(
"mva%d%s"%(num,pfix2), [
131 Plot(
"num_assoc(recoToSim)_mva%d%s"%(num,pfix), ytitle=
"true tracks", **args),
132 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),
133 Plot(
"effic_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
135 Plot(
"fakerate_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Fake rate", ymax=_maxFake),
136 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),
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), zaxis=
True), **argsroc2),
139 Plot(true_cuteff, xtitle=xtitlecut, ytitle=
"True track selection efficiency", ymax=_maxEff),
140 Plot(fake_cuteff, xtitle=xtitlecut, ytitle=
"Fake track selection efficiency", ymax=_maxEff),
141 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),
142 ], ncols=3, legendDy=_legendDy_1row)
145 Plot(
"efficPt", title=
"Efficiency vs p_{T}", xtitle=
"TP p_{T} (GeV)", ytitle=
"efficiency vs p_{T}", xlog=
True, ymax=_maxEff),
146 Plot(
FakeDuplicate(
"fakeduprate_vs_pT", assoc=
"num_assoc(recoToSim)_pT", dup=
"num_duplicate_pT", reco=
"num_reco_pT", title=
"fake+duplicates vs p_{T}"),
147 xtitle=
"track p_{T} (GeV)", ytitle=
"fake+duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
148 Plot(
"effic", xtitle=
"TP #eta", ytitle=
"efficiency vs #eta", title=
"", ymax=_maxEff),
149 Plot(
FakeDuplicate(
"fakeduprate_vs_eta", assoc=
"num_assoc(recoToSim)_eta", dup=
"num_duplicate_eta", reco=
"num_reco_eta", title=
""),
150 xtitle=
"track #eta", ytitle=
"fake+duplicates rate vs #eta", ymax=_maxFake),
160 legendDy=_legendDy_4rows
167 legendDy=_legendDy_4rows
169 _common = {
"ymin": 0,
"ymax": _maxEff}
171 _makeEffFakeDupPlots(
"vertpos",
"vert r",
"cm", fakeopts=
dict(xtitle=
"track ref. point r (cm)", ytitle=
"fake+duplicates vs. r")) +
172 _makeEffFakeDupPlots(
"zpos" ,
"vert z",
"cm", fakeopts=
dict(xtitle=
"track ref. point z (cm)", ytitle=
"fake+duplicates vs. z")) +
175 legendDy=_legendDy_4rows
179 Plot(
"fakeratePt", xtitle=
"track p_{T} (GeV)", ytitle=
"fakerate vs p_{T}", xlog=
True, ymax=_maxFake),
180 Plot(
"duplicatesRate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
181 Plot(
"pileuprate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"pileup rate vs p_{T}", ymax=_maxFake, xlog=
True),
182 Plot(
"fakerate", xtitle=
"track #eta", ytitle=
"fakerate vs #eta", title=
"", ymax=_maxFake),
183 Plot(
"duplicatesRate", xtitle=
"track #eta", ytitle=
"duplicates rate vs #eta", title=
"", ymax=_maxFake),
184 Plot(
"pileuprate", xtitle=
"track #eta", ytitle=
"pileup rate vs #eta", title=
"", ymax=_maxFake),
193 ncols=3, legendDy=_legendDy_4rows
200 ncols=3, legendDy=_legendDy_4rows
207 ncols=3, legendDy=_legendDy_4rows
209 _seedingLayerSet_common =
dict(removeEmptyBins=
True, xbinlabelsize=8, xinlabeloption=
"d", adjustMarginRight=0.1)
213 ncols=3, legendDy=_legendDy_2rows_3cols
218 "ytitle":
"Fake+pileup rate",
223 _common2.update(_common)
224 _common2[
"drawStyle"] =
"pcolz"
225 _common2[
"ztitleoffset"] = 1.5
226 _common2[
"xtitleoffset"] = 7
227 _common2[
"ytitleoffset"] = 10
228 _common2[
"ztitleoffset"] = 6
230 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")),
231 xtitle=
"Efficiency vs. cut on dz(PV)", **_common),
232 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),
233 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)", **_common2),
235 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")),
236 xtitle=
"Efficiency vs. cut on dz(PV)/dzError", **_common),
237 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),
238 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)/dzError", **_common2),
240 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")),
241 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)", **_common),
242 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),
243 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)", **_common2),
245 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")),
246 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)/dzError", **_common),
247 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),
248 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)/dzError", **_common2),
249 ], onlyForPileup=
True,
250 legendDy=_legendDy_4rows
253 Plot(
"effic_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency vs. cut on dz(PV)", ymax=_maxEff),
254 Plot(
"effic_vs_dzpvcut2", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
255 Plot(
"fakerate_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate vs. cut on dz(PV)", ymax=_maxFake),
256 Plot(
"pileuprate_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate vs. cut on dz(PV)", ymax=_maxFake),
258 Plot(
"effic_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency vs. cut on dz(PV)/dzError", ymax=_maxEff),
259 Plot(
"effic_vs_dzpvsigcut2", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
260 Plot(
"fakerate_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
261 Plot(
"pileuprate_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
262 ], onlyForPileup=
True,
263 legendDy=_legendDy_4rows
266 Plot(
"effic_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
267 Plot(
"effic_vs_dzpvcut2_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
268 Plot(
"fakerate_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
269 Plot(
"pileuprate_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
271 Plot(
"effic_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
272 Plot(
"effic_vs_dzpvsigcut2_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
273 Plot(
"fakerate_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
274 Plot(
"pileuprate_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
275 ], onlyForPileup=
True,
276 legendDy=_legendDy_4rows
281 _common = {
"normalizeToUnitArea":
True,
"stat":
True,
"drawStyle":
"hist"}
283 Plot(
"h_dedx_estim1", xtitle=
"dE/dx, harm2", **_common),
284 Plot(
"h_dedx_estim2", xtitle=
"dE/dx, trunc40", **_common),
285 Plot(
"h_dedx_nom1", xtitle=
"dE/dx number of measurements", title=
"", **_common),
286 Plot(
"h_dedx_sat1", xtitle=
"dE/dx number of measurements with saturation", title=
"", **_common),
288 legendDy=_legendDy_2rows
292 Plot(
"chargeMisIdRate", xtitle=
"#eta", ytitle=
"charge mis-id rate vs #eta", ymax=0.05),
293 Plot(
"chargeMisIdRate_Pt", xtitle=
"p_{T}", ytitle=
"charge mis-id rate vs p_{T}", xmax=300, ymax=0.1, xlog=
True),
294 Plot(
"chargeMisIdRate_hit", xtitle=
"hits", ytitle=
"charge mis-id rate vs hits", title=
""),
295 Plot(
"chargeMisIdRate_phi", xtitle=
"#phi", ytitle=
"charge mis-id rate vs #phi", title=
"", ymax=0.01),
296 Plot(
"chargeMisIdRate_dxy", xtitle=
"dxy", ytitle=
"charge mis-id rate vs dxy", ymax=0.1),
297 Plot(
"chargeMisIdRate_dz", xtitle=
"dz", ytitle=
"charge mis-id rate vs dz", ymax=0.1)
299 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"ylog":
True,
"ymin": 1e-6,
"drawStyle":
"hist"}
301 Plot(
"missing_inner_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
302 Plot(
"missing_outer_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
303 Plot(
"hits_eta", xtitle=
"track #eta", ytitle=
"<hits> vs #eta", ymin=_minHits, ymax=_maxHits, statyadjust=[0,0,-0.15],
304 fallback={
"name":
"nhits_vs_eta",
"profileX":
True}),
305 Plot(
"hits", stat=
True, xtitle=
"track hits", xmin=_minHits, xmax=_maxHits, ylog=
True, ymin=[5e-1, 5, 5e1, 5e2, 5e3], drawStyle=
"hist"),
306 Plot(
"num_simul_pT", xtitle=
"TP p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common),
307 Plot(
"num_reco_pT", xtitle=
"track p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common)
310 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),
311 Plot(
"chi2_prob", stat=
True, normalizeToUnitArea=
True, drawStyle=
"hist", xtitle=
"Prob(#chi^{2})"),
312 Plot(
"chi2mean", title=
"", xtitle=
"#eta", ytitle=
"< #chi^{2} / ndf >", ymin=[0, 0.5], ymax=[2, 2.5, 3, 5],
313 fallback={
"name":
"chi2_vs_eta",
"profileX":
True}),
314 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)
316 _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}
318 Plot(
"pullPt", **_common),
319 Plot(
"pullQoverp", **_common),
320 Plot(
"pullPhi", **_common),
321 Plot(
"pullTheta", **_common),
322 Plot(
"pullDxy", **_common),
323 Plot(
"pullDz", **_common),
325 legendDx=0.1, legendDw=-0.1, legendDh=-0.015
327 _common = {
"title":
"",
"ylog":
True,
"xtitle":
"TP #eta (PCA to beamline)",
"ymin": _minMaxResol,
"ymax": _minMaxResol}
329 Plot(
"phires_vs_eta_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
330 Plot(
"cotThetares_vs_eta_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
331 Plot(
"dxyres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
332 Plot(
"dzres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
333 Plot(
"ptres_vs_eta_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
335 _common = {
"title":
"",
"ylog":
True,
"xlog":
True,
"xtitle":
"TP p_{T} (PCA to beamline)",
"xmin": 0.1,
"xmax": 1000,
"ymin": _minMaxResol,
"ymax": _minMaxResol}
337 Plot(
"phires_vs_pt_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
338 Plot(
"cotThetares_vs_pt_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
339 Plot(
"dxyres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
340 Plot(
"dzres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
341 Plot(
"ptres_vs_pt_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
355 ncols=4, legendDy=_legendDy_4rows)
360 _makeDistPlots(
"3Dlayer" ,
"3D layers" , common=
dict(xmin=_min3DLayers, xmax=_max3DLayers)),
361 ncols=4, legendDy=_legendDy_4rows,
371 _makeDistPlots(
"seedingLayerSet",
"seeding layers", common=
dict(xtitle=
"", **_seedingLayerSet_common)),
372 ncols=4, legendDy=_legendDy_2rows_3cols
386 ncols=2, legendDy=_legendDy_4rows)
392 ncols=2, legendDy=_legendDy_4rows,
407 _possibleTrackingNonIterationColls = [
411 _possibleTrackingColls = [
412 'initialStepPreSplitting',
416 'detachedTripletStep',
427 'jetCoreRegionalStep',
428 'muonSeededStepInOut',
429 'muonSeededStepOutIn',
431 ] + _possibleTrackingNonIterationColls
432 _possibleTrackingCollsOld = {
446 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
447 for (old, new)
in [(
"InitialStep",
"Zero"),
448 (
"LowPtTripletStep",
"First"),
449 (
"PixelPairStep",
"Second"),
450 (
"MixedTripletStep",
"Fourth"),
451 (
"MuonSeededStepInOut",
"Ninth"),
452 (
"MuonSeededStepOutIn",
"Tenth")]:
454 ret = ret.replace(old, new)
459 for (old, new)
in [(
"initialStep",
"iter0"),
460 (
"lowPtTripletStep",
"iter1"),
461 (
"pixelPairStep",
"iter2"),
462 (
"mixedTripletStep",
"iter4"),
463 (
"muonSeededStepInOut",
"iter9"),
464 (
"muonSeededStepOutIn",
"iter10")]:
465 path = path.replace(old, new)
469 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
470 for (old, new)
in [(
"InitialStep",
"Zero"),
471 (
"HighPtTripletStep",
"First"),
472 (
"LowPtQuadStep",
"Second"),
473 (
"LowPtTripletStep",
"Third"),
474 (
"DetachedQuadStep",
"Fourth"),
475 (
"PixelPairStep",
"Fifth"),
476 (
"MuonSeededStepInOut",
"Ninth"),
477 (
"MuonSeededStepOutIn",
"Tenth")]:
478 ret = ret.replace(old, new)
483 for (old, new)
in [(
"initialStep",
"iter0"),
484 (
"highPtTripletStep",
"iter1"),
485 (
"lowPtQuadStep",
"iter2"),
486 (
"lowPtTripletStep",
"iter3"),
487 (
"detachedQuadStep",
"iter4"),
488 (
"pixelPairStep",
"iter5"),
489 (
"muonSeededStepInOut",
"iter9"),
490 (
"muonSeededStepOutIn",
"iter10")]:
491 path = path.replace(old, new)
495 return subfolder.replace(
"trackingParticleRecoAsssociation",
"trackingParticleRecoAsssociationSignal")
497 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsConversion")
501 quality =
"highPurity"
504 hasPtCut =
"Pt09" in collName
505 collNameNoQuality = collName.replace(
"Hp",
"")
508 collNameNoQuality = collNameNoQuality.replace(
"Pt09",
"")
509 if "ByOriginalAlgo" in collName:
510 quality +=
"ByOriginalAlgo"
511 collNameNoQuality = collNameNoQuality.replace(
"ByOriginalAlgo",
"")
512 if "ByAlgoMask" in collName:
513 quality +=
"ByAlgoMask"
514 collNameNoQuality = collNameNoQuality.replace(
"ByAlgoMask",
"")
515 collNameNoQuality = collNameNoQuality.replace(
"Tracks",
"", 1)
518 if collNameLow.find(
"seed") == 0:
520 raise Exception(
"Assumption of empty quality for seeds failed, got quality '%s'" % quality)
521 collNameLow = collNameLow[4:]
522 if collNameLow ==
"initialstepseedspresplitting":
523 collNameLow =
"initialsteppresplittingseeds"
524 elif collNameLow ==
"muonseededseedsinout":
525 collNameLow =
"muonseededstepinoutseeds"
526 elif collNameLow ==
"muonseededseedsoutin":
527 collNameLow =
"muonseededstepoutinseeds"
529 i_seeds = collNameLow.index(
"seeds")
530 quality = collNameLow[i_seeds:]
532 collNameLow = collNameLow[:i_seeds]
535 prefixes = [
"cutsreco",
"cutsrecofrompv",
"cutsrecofrompv2",
"cutsrecofrompvalltp"]
536 if collNameLow
in [
"general",
"generalfrompv"]+prefixes:
541 if coll == collNameLow.replace(pfx,
""):
545 for coll
in _possibleTrackingColls:
546 if testColl(coll.lower()):
551 for coll, name
in _possibleTrackingCollsOld.iteritems():
552 if testColl(coll.lower()):
558 algo = collNameNoQuality
561 if algo ==
"muonSeededInOut":
562 algo =
"muonSeededStepInOut"
563 if algo ==
"muonSeededOutIn":
564 algo =
"muonSeededStepOutIn"
566 return (algo, quality)
569 return (name, [name])
570 _collLabelMap = collections.OrderedDict(map(_collhelper, [
"generalTracks"]+_possibleTrackingColls))
571 _collLabelMapHp = collections.OrderedDict(map(_collhelper, [
"generalTracks"]+
filter(
lambda n:
"Step" in n, _possibleTrackingColls)))
575 algo =
"generalTracks"
579 if algo !=
"generalTracks" and "ByOriginalAlgo" not in quality:
581 quality = quality.replace(
"ByOriginalAlgo",
"")
583 if algo !=
"generalTracks" and "ByAlgoMask" not in quality:
585 quality = quality.replace(
"ByAlgoMask",
"")
587 if algo !=
"generalTracks" and "Pt09" not in quality:
589 quality = quality.replace(
"Pt09",
"")
592 if quality ==
"highPurity":
595 i_seeds = quality.find(
"seeds")
598 seedSubColl = quality[i_seeds+5:]
599 if seedSubColl !=
"":
600 ret += seedSubColl[0].
upper() + seedSubColl[1:]
607 def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix=""):
608 _common = {
"drawStyle":
"EP",
"xbinlabelsize": 10,
"xbinlabeloption":
"d"}
609 _commonN =
dict(ylog=
True, ymin=_minMaxN, ymax=_minMaxN,
610 normalizeToNumberOfEvents=
True,
612 _commonN.update(_common)
613 _commonAB =
dict(mapping=mapping,
614 renameBin=
lambda bl:
_summaryBinRename(bl, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds),
615 ignoreMissingBins=
True,
618 if byOriginalAlgo
or byAlgoMask:
619 _commonAB[
"minExistingBins"] = 2
620 prefix =
"summary"+midfix
622 h_eff =
"effic_vs_coll"
623 h_eff_allpt =
"effic_vs_coll_allPt"
624 h_fakerate =
"fakerate_vs_coll"
625 h_duplicaterate =
"duplicatesRate_coll"
626 h_pileuprate =
"pileuprate_coll"
628 h_reco =
"num_reco_coll"
629 h_true =
"num_assoc(recoToSim)_coll"
630 h_fake =
Subtract(
"num_fake_coll_orig",
"num_reco_coll",
"num_assoc(recoToSim)_coll")
631 h_duplicate =
"num_duplicate_coll"
632 h_pileup =
"num_pileup_coll"
633 if mapping
is not None:
635 h_eff_allpt =
AggregateBins(
"efficiencyAllPt", h_eff_allpt, **_commonAB)
636 h_fakerate =
AggregateBins(
"fakerate", h_fakerate, **_commonAB)
637 h_duplicaterate =
AggregateBins(
"duplicatesRate", h_duplicaterate, **_commonAB)
638 h_pileuprate =
AggregateBins(
"pileuprate", h_pileuprate, **_commonAB)
643 h_duplicate =
AggregateBins(
"num_duplicate_coll", h_duplicate, **_commonAB)
644 h_pileup =
AggregateBins(
"num_pileup_coll", h_pileup, **_commonAB)
647 Plot(h_eff, title=
"Efficiency vs collection", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
648 Plot(h_eff_allpt, title=
"Efficiency vs collection (no pT cut in denominator)", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
650 Plot(h_fakerate, title=
"Fakerate vs collection", ytitle=
"Fake rate", ymax=_maxFake, **_common),
651 Plot(h_duplicaterate, title=
"Duplicates rate vs collection", ytitle=
"Duplicates rate", ymax=_maxFake, **_common),
652 Plot(h_pileuprate, title=
"Pileup rate vs collection", ytitle=
"Pileup rate", ymax=_maxFake, **_common),
654 summaryN =
PlotGroup(prefix+
"_ntracks", [
655 Plot(h_reco, ytitle=
"Tracks/event", title=
"Number of tracks/event vs collection", **_commonN),
656 Plot(h_true, ytitle=
"True tracks/event", title=
"Number of true tracks/event vs collection", **_commonN),
657 Plot(h_fake, ytitle=
"Fake tracks/event", title=
"Number of fake tracks/event vs collection", **_commonN),
658 Plot(h_duplicate, ytitle=
"Duplicate tracks/event", title=
"Number of duplicate tracks/event vs collection", **_commonN),
659 Plot(h_pileup, ytitle=
"Pileup tracks/event", title=
"Number of pileup tracks/event vs collection", **_commonN),
662 return (summary, summaryN)
667 (_summaryByOriginalAlgo, _summaryByOriginalAlgoN) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo")
668 (_summaryByOriginalAlgoHp, _summaryByOriginalAlgoNHp) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo", highPurity=
True)
669 (_summaryByAlgoMask, _summaryByAlgoMaskN) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask")
670 (_summaryByAlgoMaskHp, _summaryByAlgoMaskNHp) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask", highPurity=
True)
671 (_summaryPt09, _summaryPt09N) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09")
672 (_summaryPt09Hp, _summaryPt09NHp) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09", highPurity=
True)
681 _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]}
683 _commonStatus.update(_common)
684 _commonStatus.update({
"xbinlabelsize": 10,
"xbinlabeloption":
"d",
"drawStyle":
"hist",
"adjustMarginRight": 0.08})
685 _commonLabelSize = {}
686 _commonLabelSize.update(_common)
687 _commonLabelSize.update({
"xlabelsize": 17})
690 Plot(
"selectionFlow", xbinlabelsize=10, xbinlabeloption=
"d", adjustMarginRight=0.1, drawStyle=
"hist", ylog=
True, ymin=[0.9, 9, 9e1, 9e2, 9e3, 9e4, 9e5, 9e6, 9e7]),
691 Plot(
"diffCharge", xtitle=
"Charge", **_common),
692 Plot(
"diffIsHighPurity", xtitle=
"High purity status", **_common),
693 Plot(
"diffNdof", xtitle=
"ndof", **_common),
694 Plot(
"diffNormalizedChi2", xtitle=
"#chi^{2}/ndof", **_common),
697 _packedCandidateHitsHitPattern =
PlotGroup(
"hitsHitPattern", [
698 Plot(
"diffHitPatternNumberOfValidHits", xtitle=
"Valid hits (via HitPattern)", **_common),
699 Plot(
"diffHitPatternNumberOfValidPixelHits", xtitle=
"Valid pixel hits (via HitPattern)", **_common),
700 Plot(
"diffHitPatternHasValidHitInFirstPixelBarrel", xtitle=
"Has valid hit in BPix1 layer (via HitPattern)", **_common),
701 Plot(
"diffHitPatternNumberOfLostPixelHits", xtitle=
"Lost pixel hits (via HitPattern)", **_common),
703 legendDy=_legendDy_2rows
706 Plot(
"diffNumberOfHits", xtitle=
"Hits", **_common),
707 Plot(
"diffNumberOfPixelHits", xtitle=
"Pixel hits", **_common),
708 Plot(
"diffLostInnerHits", xtitle=
"Lost inner hits", **_common),
709 Plot(
"numberHitsOverMax", xtitle=
"Number of overflown hits", **_common),
710 Plot(
"numberPixelHitsOverMax", xtitle=
"Number of overflown pixel hits", **_common),
711 Plot(
"numberStripHitsOverMax", xtitle=
"Number of overflown strip hits", **_common),
713 ncols=3, legendDy=_legendDy_2rows_3cols
716 _packedCandidateImpactParameter1 =
PlotGroup(
"impactParameter1", [
717 Plot(
"diffDxyAssocPV", xtitle=
"dxy(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
718 Plot(
"diffDxyAssocPVStatus", **_commonStatus),
719 Plot(
"diffDxyAssocPVUnderOverFlowSign", xtitle=
"dxy(assocPV)", **_common),
720 Plot(
"diffDzAssocPV", xtitle=
"dz(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
721 Plot(
"diffDzAssocPVStatus", **_commonStatus),
722 Plot(
"diffDzAssocPVUnderOverFlowSign", xtitle=
"dz(assocPV)", **_common),
723 Plot(
"diffDxyError", xtitle=
"dxyError()", adjustMarginRight=0.02, **_commonLabelSize),
724 Plot(
"diffDszError", xtitle=
"dszError()", adjustMarginRight=0.02, **_commonLabelSize),
725 Plot(
"diffDzError", xtitle=
"dzError()", adjustMarginRight=0.02, **_commonLabelSize),
731 _packedCandidateImpactParameter2 =
PlotGroup(
"impactParameter2", [
732 Plot(
"diffDxyPV", xtitle=
"dxy(PV) via PC", **_commonLabelSize),
733 Plot(
"diffDzPV", xtitle=
"dz(PV) via PC", **_commonLabelSize),
734 Plot(
"diffTrackDxyAssocPV", xtitle=
"dxy(PV) via PC::bestTrack()", **_commonLabelSize),
735 Plot(
"diffTrackDzAssocPV", xtitle=
"dz(PV) via PC::bestTrack()", **_commonLabelSize),
736 Plot(
"diffTrackDxyError", xtitle=
"dxyError() via PC::bestTrack()", adjustMarginRight=0.02, **_commonLabelSize),
737 Plot(
"diffTrackDzError", xtitle=
"dzError() via PC::bestTrack()", **_commonLabelSize),
740 _packedCandidateCovarianceMatrix1 =
PlotGroup(
"covarianceMatrix1", [
741 Plot(
"diffCovQoverpQoverp", xtitle=
"cov(qoverp, qoverp)", **_commonLabelSize),
742 Plot(
"diffCovQoverpQoverpStatus", **_commonStatus),
743 Plot(
"diffCovQoverpQoverpUnderOverFlowSign", xtitle=
"cov(qoverp, qoverp)", **_common),
744 Plot(
"diffCovLambdaLambda", xtitle=
"cov(lambda, lambda)", **_commonLabelSize),
745 Plot(
"diffCovLambdaLambdaStatus", **_commonStatus),
746 Plot(
"diffCovLambdaLambdaUnderOverFlowSign", xtitle=
"cov(lambda, lambda)", **_common),
747 Plot(
"diffCovLambdaDsz", xtitle=
"cov(lambda, dsz)", **_commonLabelSize),
748 Plot(
"diffCovLambdaDszStatus", **_commonStatus),
749 Plot(
"diffCovLambdaDszUnderOverFlowSign", xtitle=
"cov(lambda, dsz)", **_common),
750 Plot(
"diffCovPhiPhi", xtitle=
"cov(phi, phi)", **_commonLabelSize),
751 Plot(
"diffCovPhiPhiStatus", **_commonStatus),
752 Plot(
"diffCovPhiPhiUnderOverFlowSign", xtitle=
"cov(phi, phi)", **_common),
754 ncols=3, legendDy=_legendDy_4rows
756 _packedCandidateCovarianceMatrix2 =
PlotGroup(
"covarianceMatrix2", [
757 Plot(
"diffCovPhiDxy", xtitle=
"cov(phi, dxy)", **_commonLabelSize),
758 Plot(
"diffCovPhiDxyStatus", **_commonStatus),
759 Plot(
"diffCovPhiDxyUnderOverFlowSign", xtitle=
"cov(phi, dxy)", **_common),
760 Plot(
"diffCovDxyDxy", xtitle=
"cov(dxy, dxy)", adjustMarginRight=0.02, **_commonLabelSize),
761 Plot(
"diffCovDxyDxyStatus", **_commonStatus),
762 Plot(
"diffCovDxyDxyUnderOverFlowSign", xtitle=
"cov(dxy, dxy)", **_common),
763 Plot(
"diffCovDxyDsz", xtitle=
"cov(dxy, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
764 Plot(
"diffCovDxyDszStatus", **_commonStatus),
765 Plot(
"diffCovDxyDszUnderOverFlowSign", xtitle=
"cov(dxy, dsz)", **_common),
766 Plot(
"diffCovDszDsz", xtitle=
"cov(dsz, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
767 Plot(
"diffCovDszDszStatus", **_commonStatus),
768 Plot(
"diffCovDszDszUnderOverFlowSign", xtitle=
"cov(dsz, dsz)", **_common),
770 ncols=3, legendDy=_legendDy_4rows
773 _common[
"xlabelsize"] = 16
775 Plot(
"diffVx", xtitle=
"Reference point x", **_common),
776 Plot(
"diffVy", xtitle=
"Reference point y", **_common),
777 Plot(
"diffVz", xtitle=
"Reference point z", **_common),
779 legendDy=_legendDy_2rows
782 _common[
"adjustMarginRight"] = 0.05
784 Plot(
"diffPt", xtitle=
"p_{T}", **_common),
785 Plot(
"diffPtError", xtitle=
"p_{T} error", **_common),
786 Plot(
"diffEta", xtitle=
"#eta", **_common),
787 Plot(
"diffEtaError", xtitle=
"#eta error", **_common),
788 Plot(
"diffPhi", xtitle=
"#phi", **_common),
794 PlotFolder.__init__(self, *args, **kwargs)
797 spl = dqmSubFolderName.split(
"_")
804 (algoOrig, quality) = translatedDqmSubFolder
807 algo = fallback(algoOrig)
810 if plotFolderName !=
"":
811 ret +=
"_"+plotFolderName
814 if not (algo ==
"ootb" and quality !=
""):
819 """Return True if this subfolder should be processed
822 limitOnlyTo -- Function '(algo, quality) -> bool'
823 translatedDqmSubFolder -- Return value of translateSubFolder
825 (algo, quality) = translatedDqmSubFolder
826 return limitOnlyTo(algo, quality)
830 return algo
not in _possibleTrackingNonIterationColls
838 def __init__(self, section, collection=GeneralTracks):
854 def _getAlgoQuality(data, algo, quality):
855 for label, value
in data.iteritems():
857 if a == algo
and q == quality:
861 h = tdirectory.Get(hname)
866 return _getAlgoQuality(data,
"ootb",
"")
868 return _getAlgoQuality(data,
"ootb",
"highPurity")
870 return _getAlgoQuality(data,
"btvLike",
"")
872 return _getAlgoQuality(data,
"ak4PFJets",
"")
875 def _formatOrNone(num, func):
880 n_tps = _formatOrNone(_getN(
"num_simul_coll"), int)
881 n_m_tps = _formatOrNone(_getN(
"num_assoc(simToReco)_coll"), int)
883 n_tracks = _formatOrNone(_getN(
"num_reco_coll"), int)
884 n_true = _formatOrNone(_getN(
"num_assoc(recoToSim)_coll"), int)
885 if n_tracks
is not None and n_true
is not None:
886 n_fake = n_tracks-n_true
889 n_pileup = _formatOrNone(_getN(
"num_pileup_coll"), int)
890 n_duplicate = _formatOrNone(_getN(
"num_duplicate_coll"), int)
892 eff = _formatOrNone(_getN(
"effic_vs_coll"),
lambda n:
"%.4f" % n)
893 eff_nopt = _formatOrNone(_getN(
"effic_vs_coll_allPt"),
lambda n:
"%.4f" % n)
894 fake = _formatOrNone(_getN(
"fakerate_vs_coll"),
lambda n:
"%.4f" % n)
895 duplicate = _formatOrNone(_getN(
"duplicatesRate_coll"),
lambda n:
"%.4f" % n)
897 ret = [eff, n_tps, n_m_tps,
898 eff_nopt, fake, duplicate,
899 n_tracks, n_true, n_fake, n_pileup, n_duplicate]
900 if ret.count(
None) == len(ret):
907 "Number of TrackingParticles (after cuts)",
908 "Number of matched TrackingParticles",
909 "Efficiency (w/o pT cut)",
913 "Number of true tracks",
914 "Number of fake tracks",
915 "Number of pileup tracks",
916 "Number of duplicate tracks"
921 "DQMData/Run 1/Tracking/Run summary/"+lastDirName,
922 "DQMData/Tracking/"+lastDirName,
923 "DQMData/Run 1/RecoTrackV/Run summary/"+lastDirName,
924 "DQMData/RecoTrackV/"+lastDirName,
950 _seedingBuildingPlots = _simBasedPlots + [
977 _summaryByOriginalAlgo,
978 _summaryByOriginalAlgoN,
987 _summaryByOriginalAlgoHp,
988 _summaryByOriginalAlgoNHp,
989 _summaryByAlgoMaskHp,
990 _summaryByAlgoMaskNHp,
994 _summaryPlotsSeeds = [
998 _packedCandidatePlots = [
999 _packedCandidateFlow,
1000 _packedCandidateKinematics,
1001 _packedCandidateVertex,
1002 _packedCandidateImpactParameter1,
1003 _packedCandidateImpactParameter2,
1004 _packedCandidateCovarianceMatrix1,
1005 _packedCandidateCovarianceMatrix2,
1006 _packedCandidateHits,
1007 _packedCandidateHitsHitPattern,
1011 def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, seeding=False, rawSummary=False):
1014 limiters =
dict(onlyForPileup=onlyForPileup, onlyForElectron=onlyForElectron, onlyForConversion=onlyForConversion)
1017 _trackingRefFileFallbackSLHC_Phase1PU140
1019 common =
dict(fallbackDqmSubFolders=[
1021 _trackingSubFoldersFallbackSLHC_Phase1PU140,
1022 _trackingSubFoldersFallbackFromPV, _trackingSubFoldersFallbackConversion])
1023 plotter.append(name, folders,
TrackingPlotFolder(*algoPlots, **commonForTPF), **common)
1024 plotterExt.append(name, folders,
TrackingPlotFolder(*_extendedPlots, **commonForTPF), **common)
1028 summaryName += name+
"_"
1029 summaryName +=
"summary"
1032 summaryPlots.extend([_summaryRaw, _summaryRawN])
1033 summaryPlots.extend(_summaryPlots)
1035 common =
dict(loopSubFolders=
False, purpose=
PlotPurpose.TrackingSummary, page=
"summary", numberOfEventsHistogram=_trackingNumberOfEventsHistogram, **limiters)
1036 plotter.append(summaryName, folders,
1037 PlotFolder(*summaryPlots, section=name, **common))
1038 plotter.append(summaryName+
"_highPurity", folders,
1039 PlotFolder(*_summaryPlotsHp, section=name+
"_highPurity" if name !=
"" else "highPurity", **common),
1040 fallbackNames=[summaryName])
1042 plotter.append(summaryName+
"_seeds", folders,
1043 PlotFolder(*_summaryPlotsSeeds, section=name+
"_seeds", **common))
1052 _appendTrackingPlots(
"TrackFromPV",
"fromPV", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1053 _appendTrackingPlots(
"TrackFromPVAllTP",
"fromPVAllTP", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1054 _appendTrackingPlots(
"TrackFromPVAllTP2",
"fromPVAllTP2", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1057 _appendTrackingPlots(
"TrackConversion",
"conversion", _simBasedPlots+_recoBasedPlots, onlyForConversion=
True, rawSummary=
True)
1058 _appendTrackingPlots(
"TrackGsf",
"gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=
True, rawSummary=
True)
1062 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1064 plotter.append(
"packedCandidateLostTracks",
_trackingFolders(
"PackedCandidate/lostTracks"),
1065 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1070 def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[]):
1073 def _set(param, name, modules):
1074 if param
is not None:
1075 setattr(self, name, param)
1077 setattr(self, name, modules)
1079 _set(clusterMasking,
"_clusterMasking", [self.
_name+
"Clusters"])
1082 _set(seeding,
"_seeding", [self.
_name+
"SeedingLayers", self.
_name+
"TrackingRegions", self.
_name+
"HitDoublets", self.
_name+
"HitTriplets", self.
_name+
"HitQuadruplets", self.
_name+
"Seeds"])
1083 _set(building,
"_building", [self.
_name+
"TrackCandidates"])
1084 _set(fit,
"_fit", [self.
_name+
"Tracks"])
1085 _set(selection,
"_selection", [self.
_name])
1092 return self._clusterMasking+self._seeding+self._building+self._fit+self._selection+self.
_other
1095 return self._clusterMasking
1098 return self._seeding
1101 return self._building
1107 return self._selection
1116 (
"Fit", self.
fit()),
1118 (
"Other", self.
other())]
1122 Iteration(
"initialStepPreSplitting", clusterMasking=[],
1123 seeding=[
"initialStepSeedLayersPreSplitting",
1124 "initialStepTrackingRegionsPreSplitting",
1125 "initialStepHitDoubletsPreSplitting",
1126 "initialStepHitTripletsPreSplitting",
1127 "initialStepHitQuadrupletsPreSplitting",
1128 "initialStepSeedsPreSplitting"],
1129 building=[
"initialStepTrackCandidatesPreSplitting"],
1130 fit=[
"initialStepTracksPreSplitting"],
1131 other=[
"firstStepPrimaryVerticesPreSplitting",
1132 "initialStepTrackRefsForJetsPreSplitting",
1133 "caloTowerForTrkPreSplitting",
1134 "ak4CaloJetsForTrkPreSplitting",
1135 "jetsForCoreTrackingPreSplitting",
1138 "MeasurementTrackerEvent",
1139 "siPixelClusterShapeCache"]),
1140 Iteration(
"initialStep", clusterMasking=[],
1141 selection=[
"initialStepClassifier1",
1142 "initialStepClassifier2",
1143 "initialStepClassifier3",
1145 other=[
"firstStepPrimaryVertices"]),
1147 selection=[
"highPtTripletStepClassifier1",
1148 "highPtTripletStepClassifier2",
1149 "highPtTripletStepClassifier3",
1150 "highPtTripletStep"]),
1152 selection=[
"detachedQuadStepClassifier1",
1153 "detachedQuadStepClassifier2",
1154 "detachedQuadStep"]),
1156 selection=[
"detachedTripletStepClassifier1",
1157 "detachedTripletStepClassifier2",
1158 "detachedTripletStep"]),
1163 seeding=[
"mixedTripletStepSeedLayersA",
1164 "mixedTripletStepSeedLayersB",
1165 "mixedTripletStepTrackingRegionsA",
1166 "mixedTripletStepTrackingRegionsB",
1167 "mixedTripletStepHitDoubletsA",
1168 "mixedTripletStepHitDoubletsB",
1169 "mixedTripletStepHitTripletsA",
1170 "mixedTripletStepHitTripletsB",
1171 "mixedTripletStepSeedsA",
1172 "mixedTripletStepSeedsB",
1173 "mixedTripletStepSeeds"],
1174 selection=[
"mixedTripletStepClassifier1",
1175 "mixedTripletStepClassifier2",
1176 "mixedTripletStep"]),
1178 selection=[
"pixelLessStepClassifier1",
1179 "pixelLessStepClassifier2",
1182 seeding=[
"tobTecStepSeedLayersTripl",
1183 "tobTecStepSeedLayersPair",
1184 "tobTecStepTrackingRegionsTripl",
1185 "tobTecStepTrackingRegionsPair",
1186 "tobTecStepHitDoubletsTripl",
1187 "tobTecStepHitDoubletsPair",
1188 "tobTecStepHitTripletsTripl",
1189 "tobTecStepSeedsTripl",
1190 "tobTecStepSeedsPair",
1192 selection=[
"tobTecStepClassifier1",
1193 "tobTecStepClassifier2",
1197 other=[
"initialStepTrackRefsForJets",
1199 "jetsForCoreTracking",
1200 "firstStepGoodPrimaryVertices",
1204 seeding=[
"muonSeededSeedsInOut",
1205 "muonSeededSeedsOutIn"],
1206 building=[
"muonSeededTrackCandidatesInOut",
1207 "muonSeededTrackCandidatesOutIn"],
1208 fit=[
"muonSeededTracksInOut",
1209 "muonSeededTracksOutIn"],
1210 selection=[
"muonSeededTracksInOutClassifier",
1211 "muonSeededTracksOutIntClassifier"],
1215 clusterMasking=[], seeding=[],
1216 building=[
"duplicateTrackCandidates"],
1217 fit=[
"mergedDuplicateTracks"],
1218 selection=[
"duplicateTrackClassifier"]),
1220 clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1221 other=[
"preDuplicateMergingGeneralTracks",
1224 clusterMasking=[
"convClusters"],
1225 seeding=[
"convLayerPairs",
1226 "photonConvTrajSeedFromSingleLeg"],
1227 building=[
"convTrackCandidates"],
1228 fit=[
"convStepTracks"],
1229 selection=[
"convStepSelector"]),
1230 Iteration(
"Other", clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1231 other=[
"trackerClusterCheckPreSplitting",
1232 "trackerClusterCheck"]),
1236 iterations = _iterations
1237 if not includeConvStep:
1238 iterations =
filter(
lambda i: i.name() !=
"ConvStep", iterations)
1240 iterations =
filter(
lambda i: i.name() ==
"ConvStep", iterations)
1241 return collections.OrderedDict([(i.name(), i.all())
for i
in iterations])
1245 for i
in _iterations:
1246 if i.name() ==
"ConvStep":
1248 ret.extend(getattr(i, prop)())
1251 return collections.OrderedDict([
1252 (
"ClusterMask", getProp(
"clusterMasking")),
1253 (
"Seeding", getProp(
"seeding")),
1254 (
"Building", getProp(
"building")),
1255 (
"Fitting", getProp(
"fit")),
1256 (
"Selection", getProp(
"selection")),
1257 (
"Other", getProp(
"other"))
1276 h = tdirectory.Get(
"reconstruction_step_module_average")
1279 totalReco =
"%.1f" % h.Integral()
1281 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(includeConvStep=
False), ignoreMissingBins=
True)
1282 h = creator.create(tdirectory)
1283 totalTracking =
None
1285 totalTracking =
"%.1f" % h.Integral()
1287 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(onlyConvStep=
True), ignoreMissingBins=
True)
1288 h = creator.create(tdirectory)
1289 totalConvStep =
None
1291 totalConvStep =
"%.1f" % h.Integral()
1301 "Average reco time / event (ms)",
1302 "Average tracking (w/o convStep) time / event (ms)",
1303 "Average convStep time / event (ms)",
1306 def __init__(self, name, timeHisto, selectedTracks=False):
1316 tdir = tfile.Get(dirName)
1328 tfile = tdirectory.GetFile()
1333 iterMap = copy.copy(_collLabelMapHp)
1334 del iterMap[
"generalTracks"]
1335 del iterMap[
"jetCoreRegionalStep"]
1337 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
True, byOriginalAlgo=
False, byAlgoMask=
True, ptCut=
False, seeds=
False)
1339 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
False, byOriginalAlgo=
False, byAlgoMask=
False, ptCut=
False, seeds=
False)
1340 recoAB =
AggregateBins(
"tmp",
"num_reco_coll", mapping=iterMap,ignoreMissingBins=
True, renameBin=renameBin)
1341 h_reco_per_iter = recoAB.create(trkDir)
1342 if h_reco_per_iter
is None:
1345 for i
in xrange(1, h_reco_per_iter.GetNbinsX()+1):
1346 values[h_reco_per_iter.GetXaxis().GetBinLabel(i)] = h_reco_per_iter.GetBinContent(i)
1350 for i
in xrange(1, timeTh1.GetNbinsX()+1):
1351 iterName = timeTh1.GetXaxis().GetBinLabel(i)
1352 if iterName
in values:
1353 ntrk = values[iterName]
1354 result.append( (iterName,
1355 timeTh1.GetBinContent(i)/ntrk
if ntrk > 0
else 0,
1356 timeTh1.GetBinError(i)/ntrk
if ntrk > 0
else 0) )
1358 if len(result) == 0:
1361 res = ROOT.TH1F(self.
_name, self.
_name, len(result), 0, len(result))
1362 for i, (label, value, error)
in enumerate(result):
1363 res.GetXaxis().SetBinLabel(i+1, label)
1364 res.SetBinContent(i+1, value)
1365 res.SetBinError(i+1, error)
1371 "xbinlabelsize": 10,
1372 "xbinlabeloption":
"d"
1376 Plot(_time_per_iter,
1377 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", legendDx=-0.4, **_common),
1379 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1382 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", **_common),
1384 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1387 ytitle=
"Average time / built track (ms)", title=
"Average time / built track", **_common),
1389 ytitle=
"Average time / selected track (ms)", title=
"Average time / selected HP track by algoMask", **_common),
1396 Plot(
AggregateBins(i.name(),
"reconstruction_step_module_average", collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1397 ytitle=
"Average processing time (ms)", title=i.name(), **_common)
1398 for i
in _iterations
1400 ncols=4, legend=
False
1403 Plot(
AggregateBins(
"pixel",
"reconstruction_step_module_average", {
"pixelTracks": [
"pixelTracks"]}), ytitle=
"Average processing time [ms]", title=
"Average processing time / event", drawStyle=
"HIST")
1407 "DQMData/Run 1/DQM/Run summary/TimerService/Paths",
1408 "DQMData/Run 1/DQM/Run summary/TimerService/process RECO/Paths",
1411 timePlotter.append(
"timing", _timeFolders,
PlotFolder(
1419 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist"}
1421 Plot(
"TPlip", xtitle=
"TP lip", **_common),
1422 Plot(
"TPtip", xtitle=
"TP tip", **_common),
1426 tpPlotter.append(
"tp", [
1427 "DQMData/Run 1/Tracking/Run summary/TrackingMCTruth/TrackingParticle",
1428 "DQMData/Tracking/TrackingMCTruth/TrackingParticle",
def _trackingSubFoldersFallbackConversion
def _makeFakeDupPileupPlots
def _trackingSubFoldersFallbackSLHC_Phase1PU70_OldMapping
def _trackingRefFileFallbackSLHC_Phase1PU140
def _trackingSubFoldersFallbackFromPV
def _trackingRefFileFallbackSLHC_Phase1PU70_OldMapping
def _mapCollectionToAlgoQuality
def _trackingSubFoldersFallbackSLHC_Phase1PU140