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]
46 return ([-x
for x
in ma], ma)
49 (_minResidualCotTheta, _maxResidualCotTheta) =
_minMaxResidual([1e-4, 2e-4])
51 (_minResidualDz, _maxResidualDz) = (_minResidualDxy, _maxResidualDxy)
56 _legendDy_2rows = -0.025
57 _legendDy_2rows_3cols = -0.17
58 _legendDy_4rows = 0.09
65 _trackingIterationOrderHistogram =
"DQMData/Run 1/Tracking/Run summary/TrackBuilding/num_reco_coll" 72 xq +=
" (" + unit +
")" 74 effargs = dict(xtitle=
"TP "+xq , ytitle=
"efficiency vs "+q , ymax=_maxEff)
75 fakeargs = dict(xtitle=
"track "+xq, ytitle=
"fake+duplicates rate vs "+q, ymax=_maxFake)
76 effargs.update(common)
77 fakeargs.update(common)
78 effargs.update(effopts)
79 fakeargs.update(fakeopts)
82 Plot(
"effic_vs_"+p, **effargs),
83 Plot(
FakeDuplicate(
"fakeduprate_vs_"+p, assoc=
"num_assoc(recoToSim)_"+p, dup=
"num_duplicate_"+p, reco=
"num_reco_"+p, title=
"fake+duplicates vs "+q), **fakeargs)
95 xq +=
" (" + unit +
")" 99 Plot(
"fakerate_vs_"+p , xtitle=xtitle, ytitle=
"fakerate vs "+q , ymax=_maxFake, **common),
100 Plot(
"duplicatesRate_"+p, xtitle=xtitle, ytitle=
"duplicates rate vs "+q, ymax=_maxFake, **common),
101 Plot(
"pileuprate_"+p , xtitle=xtitle, ytitle=
"pileup rate vs "+q , ymax=_maxFake, **common),
105 return Subtract(
"num_fake_"+postfix,
"num_reco_"+postfix,
"num_assoc(recoToSim)_"+postfix)
111 args = dict(xtitle=
"track "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
115 Plot(
"num_reco_"+p , ytitle=
"tracks", **args),
116 Plot(
"num_assoc(recoToSim)_"+p, ytitle=
"true tracks", **args),
118 Plot(
"num_duplicate_"+p , ytitle=
"duplicate tracks", **args),
125 args = dict(xtitle=
"TP "+q, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
129 Plot(
"num_simul_"+p , ytitle=
"TrackingParticles", **args),
130 Plot(
"num_assoc(simToReco)_"+p, ytitle=
"Reconstructed TPs", **args),
134 pfix =
"_hp" if hp
else "" 135 pfix2 =
"Hp" if hp
else "" 137 xtitle =
"MVA%d output"%num
138 xtitlecut =
"Cut on MVA%d output"%num
139 args = dict(xtitle=xtitle, ylog=
True, ymin=_minMaxN, ymax=_minMaxN)
142 xtitle=
"Efficiency (excl. trk eff)", ytitle=
"Fake rate",
143 xmax=_maxEff, ymax=_maxFake,
147 ztitle=
"Cut on MVA%d"%num,
148 xtitleoffset=5, ytitleoffset=6.5, ztitleoffset=4,
149 adjustMarginRight=0.12
151 argsroc2.update(argsroc)
152 argsroc2[
"drawStyle"] =
"pcolz" 154 argsprofile = dict(ymin=_minMaxMVA, ymax=_minMaxMVA)
156 true_cuteff =
CutEfficiency(
"trueeff_vs_mva%dcut%s"%(num,pfix),
"num_assoc(recoToSim)_mva%dcut%s"%(num,pfix))
157 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)))
161 Plot(
"num_assoc(recoToSim)_mva%d%s"%(num,pfix), ytitle=
"true tracks", **args),
162 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),
163 Plot(
"effic_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
165 Plot(
"fakerate_vs_mva%dcut%s"%(num,pfix), xtitle=xtitlecut, ytitle=
"Fake rate", ymax=_maxFake),
166 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),
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), zaxis=
True), **argsroc2),
169 Plot(true_cuteff, xtitle=xtitlecut, ytitle=
"True track selection efficiency", ymax=_maxEff),
170 Plot(fake_cuteff, xtitle=xtitlecut, ytitle=
"Fake track selection efficiency", ymax=_maxEff),
171 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),
172 ], ncols=3, legendDy=_legendDy_1row),
174 Plot(
"mva_assoc(recoToSim)_mva%d%s_pT"%(num,pfix), xtitle=
"Track p_{T} (GeV)", ytitle=xtitle+
" for true tracks", xlog=
True, **argsprofile),
175 Plot(
"mva_fake_mva%d%s_pT"%(num,pfix), xtitle=
"Track p_{T} (GeV)", ytitle=xtitle+
" for fake tracks", xlog=
True, **argsprofile),
176 Plot(
"mva_assoc(recoToSim)_mva%d%s_eta"%(num,pfix), xtitle=
"Track #eta", ytitle=xtitle+
" for true tracks", **argsprofile),
177 Plot(
"mva_fake_mva%d%s_eta"%(num,pfix), xtitle=
"Track #eta", ytitle=xtitle+
" for fake tracks", **argsprofile),
178 ], legendDy=_legendDy_2rows)
182 Plot(
"efficPt", title=
"Efficiency vs p_{T}", xtitle=
"TP p_{T} (GeV)", ytitle=
"efficiency vs p_{T}", xlog=
True, ymax=_maxEff),
183 Plot(
FakeDuplicate(
"fakeduprate_vs_pT", assoc=
"num_assoc(recoToSim)_pT", dup=
"num_duplicate_pT", reco=
"num_reco_pT", title=
"fake+duplicates vs p_{T}"),
184 xtitle=
"track p_{T} (GeV)", ytitle=
"fake+duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
185 Plot(
"effic", xtitle=
"TP #eta", ytitle=
"efficiency vs #eta", title=
"", ymax=_maxEff),
186 Plot(
FakeDuplicate(
"fakeduprate_vs_eta", assoc=
"num_assoc(recoToSim)_eta", dup=
"num_duplicate_eta", reco=
"num_reco_eta", title=
""),
187 xtitle=
"track #eta", ytitle=
"fake+duplicates rate vs #eta", ymax=_maxFake),
195 legendDy=_legendDy_2rows
202 legendDy=_legendDy_4rows
204 _effandfakeHitsLayers =
PlotGroup(
"effandfakeHitsLayers",
208 _makeEffFakeDupPlots(
"3Dlayer" ,
"3D layers" , common=dict(xmin=_min3DLayers, xmax=_max3DLayers)),
209 legendDy=_legendDy_4rows
211 _common = {
"ymin": 0,
"ymax": _maxEff}
213 _makeEffFakeDupPlots(
"vertpos",
"vert r",
"cm", fakeopts=dict(xtitle=
"track ref. point r (cm)", ytitle=
"fake+duplicates vs. r"), common=dict(xlog=
True)) +
214 _makeEffFakeDupPlots(
"zpos" ,
"vert z",
"cm", fakeopts=dict(xtitle=
"track ref. point z (cm)", ytitle=
"fake+duplicates vs. z")) +
215 _makeEffFakeDupPlots(
"simpvz" ,
"Sim. PV z",
"cm", common=dict(xtitle=
"Sim. PV z (cm)", xmin=_minZ, xmax=_maxZ))
218 _makeEffFakeDupPlots(
"dr" ,
"#DeltaR", effopts=dict(xtitle=
"TP min #DeltaR"), fakeopts=dict(xtitle=
"track min #DeltaR"), common=dict(xlog=
True)) +
219 _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))+
221 legendDy=_legendDy_4rows
225 _algos_common = dict(removeEmptyBins=
True, xbinlabelsize=10, xbinlabeloption=
"d")
226 _duplicateAlgo =
PlotOnSideGroup(
"duplicateAlgo",
Plot(
"duplicates_oriAlgo_vs_oriAlgo", drawStyle=
"COLZ", adjustMarginLeft=0.1, adjustMarginRight=0.1, **_algos_common))
229 Plot(
"fakeratePt", xtitle=
"track p_{T} (GeV)", ytitle=
"fakerate vs p_{T}", xlog=
True, ymax=_maxFake),
230 Plot(
"duplicatesRate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
231 Plot(
"pileuprate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"pileup rate vs p_{T}", ymax=_maxFake, xlog=
True),
232 Plot(
"fakerate", xtitle=
"track #eta", ytitle=
"fakerate vs #eta", title=
"", ymax=_maxFake),
233 Plot(
"duplicatesRate", xtitle=
"track #eta", ytitle=
"duplicates rate vs #eta", title=
"", ymax=_maxFake),
234 Plot(
"pileuprate", xtitle=
"track #eta", ytitle=
"pileup rate vs #eta", title=
"", ymax=_maxFake),
241 ncols=3, legendDy=_legendDy_2rows_3cols
248 ncols=3, legendDy=_legendDy_4rows
250 _dupandfakeHitsLayers =
PlotGroup(
"dupandfakeHitsLayers",
255 ncols=3, legendDy=_legendDy_4rows
269 _seedingLayerSet_common = dict(removeEmptyBins=
True, xbinlabelsize=8, xbinlabeloption=
"d", adjustMarginRight=0.1)
270 _dupandfakeSeedingPlots =
_makeFakeDupPileupPlots(
"seedingLayerSet",
"seeding layers", xtitle=
"", common=_seedingLayerSet_common)
271 _dupandfakeChi2Seeding =
PlotGroup(
"dupandfakeChi2Seeding",
273 _dupandfakeSeedingPlots,
274 ncols=3, legendDy=_legendDy_2rows_3cols
278 "ytitle":
"Fake+pileup rate",
283 _common2.update(_common)
284 _common2[
"drawStyle"] =
"pcolz" 285 _common2[
"ztitleoffset"] = 1.5
286 _common2[
"xtitleoffset"] = 7
287 _common2[
"ytitleoffset"] = 10
288 _common2[
"ztitleoffset"] = 6
290 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")),
291 xtitle=
"Efficiency vs. cut on dz(PV)", **_common),
292 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),
293 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)", **_common2),
295 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")),
296 xtitle=
"Efficiency vs. cut on dz(PV)/dzError", **_common),
297 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),
298 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)/dzError", **_common2),
300 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")),
301 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)", **_common),
302 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),
303 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)", **_common2),
305 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")),
306 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)/dzError", **_common),
307 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),
308 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)/dzError", **_common2),
309 ], onlyForPileup=
True,
310 legendDy=_legendDy_4rows
313 Plot(
"effic_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency vs. cut on dz(PV)", ymax=_maxEff),
314 Plot(
"effic_vs_dzpvcut2", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
315 Plot(
"fakerate_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate vs. cut on dz(PV)", ymax=_maxFake),
316 Plot(
"pileuprate_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate vs. cut on dz(PV)", ymax=_maxFake),
318 Plot(
"effic_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency vs. cut on dz(PV)/dzError", ymax=_maxEff),
319 Plot(
"effic_vs_dzpvsigcut2", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
320 Plot(
"fakerate_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
321 Plot(
"pileuprate_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
322 ], onlyForPileup=
True,
323 legendDy=_legendDy_4rows
326 Plot(
"effic_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
327 Plot(
"effic_vs_dzpvcut2_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
328 Plot(
"fakerate_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
329 Plot(
"pileuprate_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
331 Plot(
"effic_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
332 Plot(
"effic_vs_dzpvsigcut2_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
333 Plot(
"fakerate_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
334 Plot(
"pileuprate_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
335 ], onlyForPileup=
True,
336 legendDy=_legendDy_4rows
341 _common = {
"normalizeToUnitArea":
True,
"stat":
True,
"drawStyle":
"hist"}
343 Plot(
"h_dedx_estim1", xtitle=
"dE/dx, harm2", **_common),
344 Plot(
"h_dedx_estim2", xtitle=
"dE/dx, trunc40", **_common),
345 Plot(
"h_dedx_nom1", xtitle=
"dE/dx number of measurements", title=
"", **_common),
346 Plot(
"h_dedx_sat1", xtitle=
"dE/dx number of measurements with saturation", title=
"", **_common),
348 legendDy=_legendDy_2rows
352 Plot(
"chargeMisIdRate", xtitle=
"#eta", ytitle=
"charge mis-id rate vs #eta", ymax=0.05),
353 Plot(
"chargeMisIdRate_Pt", xtitle=
"p_{T}", ytitle=
"charge mis-id rate vs p_{T}", xmax=300, ymax=0.1, xlog=
True),
354 Plot(
"chargeMisIdRate_hit", xtitle=
"hits", ytitle=
"charge mis-id rate vs hits", title=
""),
355 Plot(
"chargeMisIdRate_phi", xtitle=
"#phi", ytitle=
"charge mis-id rate vs #phi", title=
"", ymax=0.01),
356 Plot(
"chargeMisIdRate_dxy", xtitle=
"dxy", ytitle=
"charge mis-id rate vs dxy", ymax=0.1),
357 Plot(
"chargeMisIdRate_dz", xtitle=
"dz", ytitle=
"charge mis-id rate vs dz", ymax=0.1)
359 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"ylog":
True,
"ymin": 1e-6,
"drawStyle":
"hist"}
361 Plot(
"missing_inner_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
362 Plot(
"missing_outer_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
363 Plot(
"hits_eta", xtitle=
"track #eta", ytitle=
"<hits> vs #eta", ymin=_minHits, ymax=_maxHits, statyadjust=[0,0,-0.15],
364 fallback={
"name":
"nhits_vs_eta",
"profileX":
True}),
365 Plot(
"hits", stat=
True, xtitle=
"track hits", xmin=_minHits, xmax=_maxHits, ylog=
True, ymin=[5e-1, 5, 5e1, 5e2, 5e3], drawStyle=
"hist"),
366 Plot(
"num_simul_pT", xtitle=
"TP p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common),
367 Plot(
"num_reco_pT", xtitle=
"track p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common)
370 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),
371 Plot(
"chi2_prob", stat=
True, normalizeToUnitArea=
True, drawStyle=
"hist", xtitle=
"Prob(#chi^{2})"),
372 Plot(
"chi2mean", title=
"", xtitle=
"#eta", ytitle=
"< #chi^{2} / ndf >", ymin=[0, 0.5], ymax=[2, 2.5, 3, 5],
373 fallback={
"name":
"chi2_vs_eta",
"profileX":
True}),
374 Plot(
"ptres_vs_eta_Mean", scale=100, title=
"", xtitle=
"TP #eta (PCA to beamline)", ytitle=
"< #delta p_{T} / p_{T} > (%)", ymin=_minResidualPt, ymax=_maxResidualPt),
375 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}),
376 Plot(
"ptres_vs_pt_Mean", title=
"", xtitle=
"p_{T}", ytitle=
"< #delta p_{T}/p_{T} > (%)", scale=100, ymin=_minResidualPt, ymax=_maxResidualPt,xlog=
True)
378 _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}
380 Plot(
"pullPt", **_common),
381 Plot(
"pullQoverp", **_common),
382 Plot(
"pullPhi", **_common),
383 Plot(
"pullTheta", **_common),
384 Plot(
"pullDxy", **_common),
385 Plot(
"pullDz", **_common),
387 legendDx=0.1, legendDw=-0.1, legendDh=-0.015
389 _common = {
"title":
"",
"ylog":
True,
"xtitle":
"TP #eta (PCA to beamline)",
"ymin": _minMaxResol,
"ymax": _minMaxResol}
391 Plot(
"phires_vs_eta_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
392 Plot(
"cotThetares_vs_eta_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
393 Plot(
"dxyres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
394 Plot(
"dzres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
395 Plot(
"ptres_vs_eta_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
397 _common = {
"title":
"",
"ylog":
True,
"xlog":
True,
"xtitle":
"TP p_{T} (PCA to beamline)",
"xmin": 0.1,
"xmax": 1000,
"ymin": _minMaxResol,
"ymax": _minMaxResol}
399 Plot(
"phires_vs_pt_Sigma", ytitle=
"#sigma(#delta #phi) (rad)", **_common),
400 Plot(
"cotThetares_vs_pt_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
401 Plot(
"dxyres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{xy}) (cm)", **_common),
402 Plot(
"dzres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{z}) (cm)", **_common),
403 Plot(
"ptres_vs_pt_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
415 ncols=4, legendDy=_legendDy_2rows)
421 ncols=4, legendDy=_legendDy_4rows)
423 _makeDistPlots(
"hit" ,
"hits" , common=dict(xmin=_minHits , xmax=_maxHits)) +
424 _makeDistPlots(
"layer" ,
"layers" , common=dict(xmin=_minLayers , xmax=_maxLayers)) +
425 _makeDistPlots(
"pixellayer",
"pixel layers", common=dict( xmax=_maxPixelLayers)) +
426 _makeDistPlots(
"3Dlayer" ,
"3D layers" , common=dict(xmin=_min3DLayers, xmax=_max3DLayers)),
427 ncols=4, legendDy=_legendDy_4rows,
430 _makeDistPlots(
"vertpos",
"ref. point r (cm)", common=dict(xlog=
True)) +
432 _makeDistPlots(
"simpvz" ,
"Sim. PV z (cm)", common=dict(xmin=_minZ, xmax=_maxZ)),
437 _makeDistPlots(
"drj" ,
"#DeltaR(track, jet)", common=dict(xlog=
True)),
438 ncols=2, legendDy=_legendDy_2rows,
440 _extDistSeedingPlots =
_makeDistPlots(
"seedingLayerSet",
"seeding layers", common=dict(xtitle=
"", **_seedingLayerSet_common))
443 _extDistSeedingPlots,
444 ncols=4, legendDy=_legendDy_2rows_3cols
446 _common = dict(title=
"", xtitle=
"TP #eta (PCA to beamline)")
448 Plot(
"phires_vs_eta_Mean", ytitle=
"< #delta #phi > (rad)", ymin=_minResidualPhi, ymax=_maxResidualPhi, **_common),
449 Plot(
"cotThetares_vs_eta_Mean", ytitle=
"< #delta cot(#theta) >", ymin=_minResidualCotTheta, ymax=_maxResidualCotTheta, **_common),
450 Plot(
"dxyres_vs_eta_Mean", ytitle=
"< #delta d_{xy} > (#mum)", scale=10000, ymin=_minResidualDxy, ymax=_maxResidualDxy, **_common),
451 Plot(
"dzres_vs_eta_Mean", ytitle=
"< #delta d_{z} > (#mum)", scale=10000, ymin=_minResidualDz, ymax=_maxResidualDz, **_common),
452 Plot(
"ptres_vs_eta_Mean", ytitle=
"< #delta p_{T}/p_{T} > (%)", scale=100, ymin=_minResidualPt, ymax=_maxResidualPt, **_common),
454 _common = dict(title=
"", xlog=
True, xtitle=
"TP p_{T} (PCA to beamline)", xmin=0.1, xmax=1000)
456 Plot(
"phires_vs_pt_Mean", ytitle=
"< #delta #phi > (rad)", ymin=_minResidualPhi, ymax=_maxResidualPhi, **_common),
457 Plot(
"cotThetares_vs_pt_Mean", ytitle=
"< #delta cot(#theta > )", ymin=_minResidualCotTheta, ymax=_maxResidualCotTheta, **_common),
458 Plot(
"dxyres_vs_pt_Mean", ytitle=
"< #delta d_{xy} > (#mum)", scale=10000, ymin=_minResidualDxy, ymax=_maxResidualDxy, **_common),
459 Plot(
"dzres_vs_pt_Mean", ytitle=
"< #delta d_{z} > (#mum)", scale=10000, ymin=_minResidualDz, ymax=_maxResidualDz, **_common),
460 Plot(
"ptres_vs_pt_Mean", ytitle=
"< #delta p_{T}/p_{T} > (%)", scale=100, ymin=_minResidualPt, ymax=_maxResidualPt, **_common),
462 _common = dict(title=
"", ytitle=
"Selected tracks/TrackingParticles", ymax=_maxEff)
464 Plot(
"nrec_vs_nsim", title=
"", xtitle=
"TrackingParticles", ytitle=
"Tracks", profileX=
True, xmin=_minMaxTracks, xmax=_minMaxTracks, ymin=_minMaxTracks, ymax=_minMaxTracks),
465 Plot(
"nrecPerNsim_vs_pu", xtitle=
"Pileup", xmin=_minPU, xmax=_maxPU, **_common),
466 Plot(
"nrecPerNsimPt", xtitle=
"p_{T} (GeV)", xlog=
True, **_common),
467 Plot(
"nrecPerNsim", xtitle=
"#eta", **_common)
468 ], legendDy=_legendDy_2rows)
470 Plot(
"PXLhits_vs_eta", xtitle=
"#eta", ytitle=
"<pixel hits>"),
471 Plot(
"PXLlayersWithMeas_vs_eta", xtitle=
"#eta", ytitle=
"<pixel layers>"),
472 Plot(
"STRIPhits_vs_eta", xtitle=
"#eta", ytitle=
"<strip hits>"),
473 Plot(
"STRIPlayersWithMeas_vs_eta", xtitle=
"#eta", ytitle=
"<strip layers>"),
474 ], legendDy=_legendDy_2rows)
486 ncols=2, legendDy=_legendDy_2rows)
492 ncols=2, legendDy=_legendDy_4rows)
495 _makeDistSimPlots(
"layer" ,
"layers" , common=dict(xmin=_minLayers , xmax=_maxLayers)) +
496 _makeDistSimPlots(
"pixellayer",
"pixel layers", common=dict( xmax=_maxPixelLayers)) +
497 _makeDistSimPlots(
"3Dlayer" ,
"3D layers" , common=dict(xmin=_min3DLayers, xmax=_max3DLayers)),
498 ncols=2, legendDy=_legendDy_4rows,
503 _makeDistSimPlots(
"simpvz" ,
"Sim. PV z (cm)", common=dict(xmin=_minZ, xmax=_maxZ)),
509 ncols=2, legendDy=_legendDy_2rows,
518 _possibleTrackingNonIterationColls = [
522 _possibleTrackingColls = [
523 'initialStepPreSplitting',
527 'detachedTripletStep',
541 'jetCoreRegionalStep',
542 'muonSeededStepInOut',
543 'muonSeededStepOutIn',
545 ] + _possibleTrackingNonIterationColls
546 _possibleTrackingCollsOld = {
560 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
561 for (old, new)
in [(
"InitialStep",
"Zero"),
562 (
"HighPtTripletStep",
"First"),
563 (
"LowPtQuadStep",
"Second"),
564 (
"LowPtTripletStep",
"Third"),
565 (
"DetachedQuadStep",
"Fourth"),
566 (
"PixelPairStep",
"Fifth"),
567 (
"MuonSeededStepInOut",
"Ninth"),
568 (
"MuonSeededStepOutIn",
"Tenth")]:
569 ret = ret.replace(old, new)
574 for (old, new)
in [(
"initialStep",
"iter0"),
575 (
"highPtTripletStep",
"iter1"),
576 (
"lowPtQuadStep",
"iter2"),
577 (
"lowPtTripletStep",
"iter3"),
578 (
"detachedQuadStep",
"iter4"),
579 (
"pixelPairStep",
"iter5"),
580 (
"muonSeededStepInOut",
"iter9"),
581 (
"muonSeededStepOutIn",
"iter10")]:
582 path = path.replace(old, new)
586 return subfolder.replace(
"trackingParticleRecoAsssociation",
"trackingParticleRecoAsssociationSignal")
588 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsConversion")
590 return subfolder.replace(
"quickAssociatorByHits",
"quickAssociatorByHitsPreSplitting")
594 _additionalTrackQualities = [
601 quality =
"highPurity" 604 collNameNoQuality = collName.replace(
"Hp",
"")
605 for qual
in _additionalTrackQualities:
608 collNameNoQuality = collNameNoQuality.replace(qual,
"")
610 collNameNoQuality = collNameNoQuality.replace(
"Tracks",
"", 1)
613 if collNameLow.find(
"seed") == 0:
614 collNameLow = collNameLow[4:]
615 if collNameLow ==
"initialstepseedspresplitting":
616 collNameLow =
"initialsteppresplittingseeds" 617 elif collNameLow ==
"muonseededseedsinout":
618 collNameLow =
"muonseededstepinoutseeds" 619 elif collNameLow ==
"muonseededseedsoutin":
620 collNameLow =
"muonseededstepoutinseeds" 622 i_seeds = collNameLow.index(
"seeds")
623 quality = collNameLow[i_seeds:]+quality
625 collNameLow = collNameLow[:i_seeds]
628 prefixes = [
"cutsreco",
"cutsrecofrompv",
"cutsrecofrompv2",
"cutsrecofrompvalltp"]
629 if collNameLow
in [
"general",
"generalfrompv"]+prefixes:
634 if coll == collNameLow.replace(pfx,
""):
638 for coll
in _possibleTrackingColls:
639 if testColl(coll.lower()):
644 for coll, name
in six.iteritems(_possibleTrackingCollsOld):
645 if testColl(coll.lower()):
651 algo = collNameNoQuality
654 if algo ==
"muonSeededInOut":
655 algo =
"muonSeededStepInOut" 656 if algo ==
"muonSeededOutIn":
657 algo =
"muonSeededStepOutIn" 659 return (algo, quality)
662 return (name, [name])
663 _collLabelMap = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+_possibleTrackingColls))
664 _collLabelMapHp = collections.OrderedDict(
map(_collhelper, [
"generalTracks"]+[n
for n
in _possibleTrackingColls
if "Step" in n]))
668 algo =
"generalTracks" 672 if algo !=
"generalTracks" and "ByOriginalAlgo" not in quality:
674 quality = quality.replace(
"ByOriginalAlgo",
"")
676 if algo !=
"generalTracks" and "ByAlgoMask" not in quality:
678 quality = quality.replace(
"ByAlgoMask",
"")
680 if "Pt09" not in quality:
682 quality = quality.replace(
"Pt09",
"")
685 if quality ==
"highPurity":
688 i_seeds = quality.find(
"seeds")
691 seedSubColl = quality[i_seeds+5:]
692 if seedSubColl !=
"":
693 ret += seedSubColl[0].
upper() + seedSubColl[1:]
700 def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix=""):
701 _common = {
"drawStyle":
"EP",
"xbinlabelsize": 10,
"xbinlabeloption":
"d"}
702 _commonN = dict(ylog=
True, ymin=_minMaxN, ymax=_minMaxN,
703 normalizeToNumberOfEvents=
True,
705 _commonN.update(_common)
706 _commonAB = dict(mapping=mapping,
707 renameBin=
lambda bl:
_summaryBinRename(bl, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds),
708 ignoreMissingBins=
True,
711 if byOriginalAlgo
or byAlgoMask:
712 _commonAB[
"minExistingBins"] = 2
713 prefix =
"summary"+midfix
715 h_eff =
"effic_vs_coll" 716 h_fakerate =
"fakerate_vs_coll" 717 h_duplicaterate =
"duplicatesRate_coll" 718 h_pileuprate =
"pileuprate_coll" 720 h_reco =
"num_reco_coll" 721 h_true =
"num_assoc(recoToSim)_coll" 722 h_fake =
Subtract(
"num_fake_coll_orig",
"num_reco_coll",
"num_assoc(recoToSim)_coll")
723 h_duplicate =
"num_duplicate_coll" 724 h_pileup =
"num_pileup_coll" 725 if mapping
is not None:
727 h_fakerate =
AggregateBins(
"fakerate", h_fakerate, **_commonAB)
728 h_duplicaterate =
AggregateBins(
"duplicatesRate", h_duplicaterate, **_commonAB)
729 h_pileuprate =
AggregateBins(
"pileuprate", h_pileuprate, **_commonAB)
734 h_duplicate =
AggregateBins(
"num_duplicate_coll", h_duplicate, **_commonAB)
735 h_pileup =
AggregateBins(
"num_pileup_coll", h_pileup, **_commonAB)
738 Plot(h_eff, title=
"Efficiency vs collection", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
739 Plot(h_fakerate, title=
"Fakerate vs collection", ytitle=
"Fake rate", ymax=_maxFake, **_common),
741 Plot(h_duplicaterate, title=
"Duplicates rate vs collection", ytitle=
"Duplicates rate", ymax=_maxFake, **_common),
742 Plot(h_pileuprate, title=
"Pileup rate vs collection", ytitle=
"Pileup rate", ymax=_maxFake, **_common),
744 legendDy=_legendDy_2rows
746 summaryN =
PlotGroup(prefix+
"_ntracks", [
753 Plot(h_reco, ytitle=
"Tracks", title=
"Number of tracks vs collection", **_commonN),
754 Plot(h_true, ytitle=
"True tracks", title=
"Number of true tracks vs collection", **_commonN),
755 Plot(h_fake, ytitle=
"Fake tracks", title=
"Number of fake tracks vs collection", **_commonN),
756 Plot(h_duplicate, ytitle=
"Duplicate tracks", title=
"Number of duplicate tracks vs collection", **_commonN),
757 Plot(h_pileup, ytitle=
"Pileup tracks", title=
"Number of pileup tracks vs collection", **_commonN),
760 return (summary, summaryN)
765 (_summaryByOriginalAlgo, _summaryByOriginalAlgoN) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo")
766 (_summaryByOriginalAlgoHp, _summaryByOriginalAlgoNHp) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo", highPurity=
True)
767 (_summaryByAlgoMask, _summaryByAlgoMaskN) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask")
768 (_summaryByAlgoMaskHp, _summaryByAlgoMaskNHp) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask", highPurity=
True)
769 (_summaryPt09, _summaryPt09N) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09")
770 (_summaryPt09Hp, _summaryPt09NHp) =
_constructSummary(_collLabelMap, ptCut=
True, midfix=
"Pt09", highPurity=
True)
779 _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]}
781 _commonStatus.update(_common)
782 _commonStatus.update({
"xbinlabelsize": 10,
"xbinlabeloption":
"d",
"drawStyle":
"hist",
"adjustMarginRight": 0.08})
783 _commonLabelSize = {}
784 _commonLabelSize.update(_common)
785 _commonLabelSize.update({
"xlabelsize": 17})
788 Plot(
"selectionFlow", xbinlabelsize=10, xbinlabeloption=
"d", adjustMarginRight=0.1, drawStyle=
"hist", ylog=
True, ymin=[0.9, 9, 9e1, 9e2, 9e3, 9e4, 9e5, 9e6, 9e7]),
789 Plot(
"diffCharge", xtitle=
"Charge", **_common),
790 Plot(
"diffIsHighPurity", xtitle=
"High purity status", **_common),
791 Plot(
"diffNdof", xtitle=
"ndof", **_common),
792 Plot(
"diffNormalizedChi2", xtitle=
"#chi^{2}/ndof", **_common),
795 _packedCandidateHitsHitPattern =
PlotGroup(
"hitsHitPattern", [
796 Plot(
"diffHitPatternNumberOfValidHits", xtitle=
"Valid hits (via HitPattern)", **_common),
797 Plot(
"diffHitPatternNumberOfValidPixelHits", xtitle=
"Valid pixel hits (via HitPattern)", **_common),
798 Plot(
"diffHitPatternHasValidHitInFirstPixelBarrel", xtitle=
"Has valid hit in BPix1 layer (via HitPattern)", **_common),
799 Plot(
"diffHitPatternNumberOfLostPixelHits", xtitle=
"Lost pixel hits (via HitPattern)", **_common),
801 legendDy=_legendDy_2rows
804 Plot(
"diffNumberOfHits", xtitle=
"Hits", **_common),
805 Plot(
"diffNumberOfPixelHits", xtitle=
"Pixel hits", **_common),
806 Plot(
"diffLostInnerHits", xtitle=
"Lost inner hits", **_common),
807 Plot(
"numberHitsOverMax", xtitle=
"Number of overflown hits", **_common),
808 Plot(
"numberPixelHitsOverMax", xtitle=
"Number of overflown pixel hits", **_common),
809 Plot(
"numberStripHitsOverMax", xtitle=
"Number of overflown strip hits", **_common),
811 ncols=3, legendDy=_legendDy_2rows_3cols
816 Plot(
"diffNumberOfPixelLayers", xtitle=
"Pixel layers", **_common),
817 Plot(
"diffNumberOfStripLayers", xtitle=
"Strip layers", **_common),
819 Plot(
"diffHitPatternTrackerLayersWithMeasurement", xtitle=
"Layers (via HitPattern)", **_common),
820 Plot(
"diffHitPatternPixelLayersWithMeasurement", xtitle=
"Pixel layers (via HitPattern)", **_common),
821 Plot(
"diffHitPatternStripLayersWithMeasurement", xtitle=
"Strip layers (via HitPattern)", **_common),
823 Plot(
"numberLayersOverMax", xtitle=
"Number of overflown layers", **_common),
824 Plot(
"numberPixelLayersOverMax", xtitle=
"Number of overflown pixel layers", **_common),
825 Plot(
"numberStripLayersOverMax", xtitle=
"Number of overflown strip layers", **_common),
831 _packedCandidateImpactParameter1 =
PlotGroup(
"impactParameter1", [
832 Plot(
"diffDxyAssocPV", xtitle=
"dxy(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
833 Plot(
"diffDxyAssocPVStatus", **_commonStatus),
834 Plot(
"diffDxyAssocPVUnderOverFlowSign", xtitle=
"dxy(assocPV)", **_common),
835 Plot(
"diffDzAssocPV", xtitle=
"dz(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
836 Plot(
"diffDzAssocPVStatus", **_commonStatus),
837 Plot(
"diffDzAssocPVUnderOverFlowSign", xtitle=
"dz(assocPV)", **_common),
838 Plot(
"diffDxyError", xtitle=
"dxyError()", adjustMarginRight=0.02, **_commonLabelSize),
839 Plot(
"diffDszError", xtitle=
"dszError()", adjustMarginRight=0.02, **_commonLabelSize),
840 Plot(
"diffDzError", xtitle=
"dzError()", adjustMarginRight=0.02, **_commonLabelSize),
846 _packedCandidateImpactParameter2 =
PlotGroup(
"impactParameter2", [
847 Plot(
"diffDxyPV", xtitle=
"dxy(PV) via PC", **_commonLabelSize),
848 Plot(
"diffDzPV", xtitle=
"dz(PV) via PC", **_commonLabelSize),
849 Plot(
"diffTrackDxyAssocPV", xtitle=
"dxy(PV) via PC::bestTrack()", **_commonLabelSize),
850 Plot(
"diffTrackDzAssocPV", xtitle=
"dz(PV) via PC::bestTrack()", **_commonLabelSize),
851 Plot(
"diffTrackDxyError", xtitle=
"dxyError() via PC::bestTrack()", adjustMarginRight=0.02, **_commonLabelSize),
852 Plot(
"diffTrackDzError", xtitle=
"dzError() via PC::bestTrack()", **_commonLabelSize),
855 _packedCandidateCovarianceMatrix1 =
PlotGroup(
"covarianceMatrix1", [
856 Plot(
"diffCovQoverpQoverp", xtitle=
"cov(qoverp, qoverp)", **_commonLabelSize),
857 Plot(
"diffCovQoverpQoverpStatus", **_commonStatus),
858 Plot(
"diffCovQoverpQoverpUnderOverFlowSign", xtitle=
"cov(qoverp, qoverp)", **_common),
859 Plot(
"diffCovLambdaLambda", xtitle=
"cov(lambda, lambda)", **_commonLabelSize),
860 Plot(
"diffCovLambdaLambdaStatus", **_commonStatus),
861 Plot(
"diffCovLambdaLambdaUnderOverFlowSign", xtitle=
"cov(lambda, lambda)", **_common),
862 Plot(
"diffCovLambdaDsz", xtitle=
"cov(lambda, dsz)", **_commonLabelSize),
863 Plot(
"diffCovLambdaDszStatus", **_commonStatus),
864 Plot(
"diffCovLambdaDszUnderOverFlowSign", xtitle=
"cov(lambda, dsz)", **_common),
865 Plot(
"diffCovPhiPhi", xtitle=
"cov(phi, phi)", **_commonLabelSize),
866 Plot(
"diffCovPhiPhiStatus", **_commonStatus),
867 Plot(
"diffCovPhiPhiUnderOverFlowSign", xtitle=
"cov(phi, phi)", **_common),
869 ncols=3, legendDy=_legendDy_4rows
871 _packedCandidateCovarianceMatrix2 =
PlotGroup(
"covarianceMatrix2", [
872 Plot(
"diffCovPhiDxy", xtitle=
"cov(phi, dxy)", **_commonLabelSize),
873 Plot(
"diffCovPhiDxyStatus", **_commonStatus),
874 Plot(
"diffCovPhiDxyUnderOverFlowSign", xtitle=
"cov(phi, dxy)", **_common),
875 Plot(
"diffCovDxyDxy", xtitle=
"cov(dxy, dxy)", adjustMarginRight=0.02, **_commonLabelSize),
876 Plot(
"diffCovDxyDxyStatus", **_commonStatus),
877 Plot(
"diffCovDxyDxyUnderOverFlowSign", xtitle=
"cov(dxy, dxy)", **_common),
878 Plot(
"diffCovDxyDsz", xtitle=
"cov(dxy, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
879 Plot(
"diffCovDxyDszStatus", **_commonStatus),
880 Plot(
"diffCovDxyDszUnderOverFlowSign", xtitle=
"cov(dxy, dsz)", **_common),
881 Plot(
"diffCovDszDsz", xtitle=
"cov(dsz, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
882 Plot(
"diffCovDszDszStatus", **_commonStatus),
883 Plot(
"diffCovDszDszUnderOverFlowSign", xtitle=
"cov(dsz, dsz)", **_common),
885 ncols=3, legendDy=_legendDy_4rows
888 _common[
"xlabelsize"] = 16
890 Plot(
"diffVx", xtitle=
"Reference point x", **_common),
891 Plot(
"diffVy", xtitle=
"Reference point y", **_common),
892 Plot(
"diffVz", xtitle=
"Reference point z", **_common),
894 legendDy=_legendDy_2rows
897 _common[
"adjustMarginRight"] = 0.05
899 Plot(
"diffPt", xtitle=
"p_{T}", **_common),
900 Plot(
"diffPtError", xtitle=
"p_{T} error", **_common),
901 Plot(
"diffEta", xtitle=
"#eta", **_common),
902 Plot(
"diffEtaError", xtitle=
"#eta error", **_common),
903 Plot(
"diffPhi", xtitle=
"#phi", **_common),
909 PlotFolder.__init__(self, *args, **kwargs)
912 spl = dqmSubFolderName.split(
"_")
919 (algoOrig, quality) = translatedDqmSubFolder
925 if plotFolderName !=
"":
926 ret +=
"_"+plotFolderName
929 if not (algo ==
"ootb" and quality !=
""):
934 """Return True if this subfolder should be processed 937 limitOnlyTo -- Function '(algo, quality) -> bool' 938 translatedDqmSubFolder -- Return value of translateSubFolder 940 (algo, quality) = translatedDqmSubFolder
941 return limitOnlyTo(algo, quality)
945 return algo
not in _possibleTrackingNonIterationColls
956 def __init__(self, section, collection=GeneralTracks):
972 def _getAlgoQuality(data, algo, quality):
973 for label, value
in six.iteritems(data):
975 if a == algo
and q == quality:
979 h = tdirectory.Get(hname)
984 return _getAlgoQuality(data,
"ootb",
"")
986 return _getAlgoQuality(data,
"ootb",
"Pt09")
988 return _getAlgoQuality(data,
"ootb",
"highPurity")
990 return _getAlgoQuality(data,
"ootb",
"highPurityPt09")
992 return _getAlgoQuality(data,
"btvLike",
"")
994 return _getAlgoQuality(data,
"ak4PFJets",
"")
996 return _getAlgoQuality(data,
"pixel",
"")
999 def _formatOrNone(num, func):
1004 n_tps = _formatOrNone(_getN(
"num_simul_coll"), int)
1005 n_m_tps = _formatOrNone(_getN(
"num_assoc(simToReco)_coll"), int)
1007 n_tracks = _formatOrNone(_getN(
"num_reco_coll"), int)
1008 n_true = _formatOrNone(_getN(
"num_assoc(recoToSim)_coll"), int)
1009 if n_tracks
is not None and n_true
is not None:
1010 n_fake = n_tracks-n_true
1013 n_pileup = _formatOrNone(_getN(
"num_pileup_coll"), int)
1014 n_duplicate = _formatOrNone(_getN(
"num_duplicate_coll"), int)
1016 eff = _formatOrNone(_getN(
"effic_vs_coll"),
lambda n:
"%.4f" % n)
1017 eff_nopt = _formatOrNone(_getN(
"effic_vs_coll_allPt"),
lambda n:
"%.4f" % n)
1018 fake = _formatOrNone(_getN(
"fakerate_vs_coll"),
lambda n:
"%.4f" % n)
1019 duplicate = _formatOrNone(_getN(
"duplicatesRate_coll"),
lambda n:
"%.4f" % n)
1021 ret = [eff, n_tps, n_m_tps,
1022 eff_nopt, fake, duplicate,
1023 n_tracks, n_true, n_fake, n_pileup, n_duplicate]
1024 if ret.count(
None) == len(ret):
1031 "Number of TrackingParticles (after cuts)",
1032 "Number of matched TrackingParticles",
1033 "Efficiency (w/o pT cut)",
1037 "Number of true tracks",
1038 "Number of fake tracks",
1039 "Number of pileup tracks",
1040 "Number of duplicate tracks" 1045 def __init__(self, fileName, plots, titles, isRate, **kwargs):
1051 if len(plots) != len(titles):
1052 raise Exception(
"Number of plots (%d) has to be the same as number of titles (%d)" % (len(plots), len(titles)))
1054 def _set(attr, default):
1055 setattr(self,
"_"+attr, kwargs.get(attr, default))
1057 _set(
"onlyForPileup",
False)
1060 """Return True if the PlotGroup is intended only for pileup samples""" 1061 return self._onlyForPileup
1063 def create(self, tdirectoryNEvents, requireAllHistograms=False):
1066 plot.create(tdirectoryNEvents, requireAllHistograms)
1068 def draw(self, legendLabels, prefix=None, directory="", *args, **kwargs):
1070 onlyEmptyPlots =
True 1072 if not plot.isEmpty():
1073 onlyEmptyPlots =
False 1078 haveShortLabels =
False 1079 legendLabels = legendLabels[:]
1080 if max(
map(len, legendLabels)) > 20:
1081 haveShortLabels =
True 1082 labels_short = [
str(chr(ord(
'A')+i))
for i
in range(len(legendLabels))]
1083 for i, ls
in enumerate(labels_short):
1084 legendLabels[i] =
"%s: %s" % (ls, legendLabels[i])
1086 labels_short = legendLabels
1091 ' <table border="1">',
1102 for h, l
in zip(plot._histograms, labels_short):
1104 h_tmp.append(len(histos_linear))
1105 histos_linear.append(h)
1109 histos_index.append(h_tmp)
1110 labels.append(l_tmp)
1113 ' <td colspan="%d">%s</td>' % (len(h_tmp), title),
1116 if len(histos_linear) == 0:
1126 if len(histos_linear) == 0:
1130 if len(histos_linear_new) > 0
and len(histos_linear_new) != len(histos_linear):
1131 raise Exception(
"This should never happen. len(histos_linear_new) %d != len(histos_linear) %d" % (len(histos_linear_new), len(histos_linear)))
1132 histos_linear = histos_linear_new
1133 if len(histos_linear) == 0:
1136 data = [ [h.GetBinContent(i)
for i
in range(1, h.GetNbinsX()+1)]
for h
in histos_linear]
1137 table =
html.Table([
"dummy"]*len(histos_linear), xbinlabels, data,
None,
None,
None)
1138 data = table.tableAsRowColumn()
1141 content.append(
' <td></td>')
1142 content.extend([
' <td>%s</td>' % lab
for lab
in labs])
1147 for irow, row
in enumerate(data):
1150 ' <td>%s</td>' % table.rowHeaders()[irow]
1153 for hindices
in histos_index:
1154 for hindex
in hindices:
1156 formatted = self.
_format%item
if item
is not None else "" 1157 content.append(
' <td align="right">%s</td>' % formatted)
1158 content.append(
' <td></td>')
1160 content.append(
' </tr>')
1162 content.append(
' </table>')
1164 for lab
in legendLabels:
1165 content.append(
' %s<br/>' % lab)
1173 if prefix
is not None:
1176 name = os.path.join(directory, name)
1178 with open(name,
"w")
as f:
1179 for line
in content:
1185 [
"Fake rate",
"Duplicate rate",
"Pileup rate"], isRate=
True)
1187 [
"All tracks",
"True tracks",
"Fake tracks",
"Duplicate tracks"], isRate=
False)
1191 "DQMData/Run 1/Tracking/Run summary/"+lastDirName,
1192 "DQMData/Tracking/"+lastDirName,
1193 "DQMData/Run 1/RecoTrackV/Run summary/"+lastDirName,
1194 "DQMData/RecoTrackV/"+lastDirName,
1198 _effandfakePtEtaPhi,
1201 _effandfakeHitsLayers,
1203 _effandfakeDeltaRPU,
1207 _dupandfakePtEtaPhi,
1210 _dupandfakeHitsLayers,
1212 _dupandfakeDeltaRPU,
1213 _dupandfakeChi2Seeding,
1214 _dupandfakeSeedingTable,
1226 _seedingBuildingPlots = _simBasedPlots + [
1227 _dupandfakePtEtaPhi,
1230 _dupandfakeHitsLayers,
1232 _dupandfakeDeltaRPU,
1233 _dupandfakeChi2Seeding,
1234 _dupandfakeSeedingTable,
1242 _buildingExtendedPlots = [
1255 _extDistChi2Seeding,
1256 _extDistSeedingTable,
1261 _extDistSimPtEtaPhi,
1264 _extDistSimHitsLayers,
1271 _summaryByOriginalAlgo,
1272 _summaryByOriginalAlgoN,
1274 _summaryByAlgoMaskN,
1281 _summaryByOriginalAlgoHp,
1282 _summaryByOriginalAlgoNHp,
1283 _summaryByAlgoMaskHp,
1284 _summaryByAlgoMaskNHp,
1288 _summaryPlotsSeeds = [
1292 _packedCandidatePlots = [
1293 _packedCandidateFlow,
1294 _packedCandidateKinematics,
1295 _packedCandidateVertex,
1296 _packedCandidateImpactParameter1,
1297 _packedCandidateImpactParameter2,
1298 _packedCandidateCovarianceMatrix1,
1299 _packedCandidateCovarianceMatrix2,
1300 _packedCandidateHits,
1301 _packedCandidateHitsHitPattern,
1302 _packedCandidateLayers,
1306 def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, onlyForBHadron=False, seeding=False, building=False, rawSummary=False, highPuritySummary=True):
1309 limiters = dict(onlyForPileup=onlyForPileup, onlyForElectron=onlyForElectron, onlyForConversion=onlyForConversion, onlyForBHadron=onlyForBHadron)
1311 _trackingRefFileFallbackSLHC_Phase1PU140
1313 common = dict(fallbackDqmSubFolders=[
1314 _trackingSubFoldersFallbackSLHC_Phase1PU140,
1315 _trackingSubFoldersFallbackFromPV, _trackingSubFoldersFallbackConversion,
1316 _trackingSubFoldersFallbackPreSplitting])
1317 plotter.append(name, folders,
TrackingPlotFolder(*algoPlots, **commonForTPF), **common)
1320 extendedPlots.extend(_buildingExtendedPlots)
1321 extendedPlots.extend(_extendedPlots)
1322 plotterExt.append(name, folders,
TrackingPlotFolder(*extendedPlots, **commonForTPF), **common)
1326 summaryName += name+
"_" 1327 summaryName +=
"summary" 1330 summaryPlots.extend([_summaryRaw, _summaryRawN])
1331 summaryPlots.extend(_summaryPlots)
1336 plotter.append(summaryName, folders,
1337 PlotFolder(*summaryPlots, section=name, **common))
1338 if highPuritySummary:
1339 plotter.append(summaryName+
"_highPurity", folders,
1340 PlotFolder(*_summaryPlotsHp, section=name+
"_highPurity" if name !=
"" else "highPurity", **common),
1341 fallbackNames=[summaryName])
1343 plotter.append(summaryName+
"_seeds", folders,
1344 PlotFolder(*_summaryPlotsSeeds, section=name+
"_seeds", **common))
1348 if highPuritySummary:
1349 sectionName = name+
"_highPurity" if name !=
"" else "highPurity" 1358 _appendTrackingPlots(
"TrackFromPV",
"fromPV", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1359 _appendTrackingPlots(
"TrackFromPVAllTP",
"fromPVAllTP", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1360 _appendTrackingPlots(
"TrackFromPVAllTP2",
"fromPVAllTP2", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
1363 _appendTrackingPlots(
"TrackConversion",
"conversion", _simBasedPlots+_recoBasedPlots, onlyForConversion=
True, rawSummary=
True, highPuritySummary=
False)
1364 _appendTrackingPlots(
"TrackGsf",
"gsf", _simBasedPlots+_recoBasedPlots, onlyForElectron=
True, rawSummary=
True, highPuritySummary=
False)
1365 _appendTrackingPlots(
"TrackBHadron",
"bhadron", _simBasedPlots+_recoBasedPlots, onlyForBHadron=
True)
1376 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1378 plotter.append(
"packedCandidateLostTracks",
_trackingFolders(
"PackedCandidate/lostTracks"),
1379 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
1384 "DQMData/Run 1/HLT/Run summary/Tracking/ValidationWRTtp",
1389 plotterHLT.append(
"hlt", _hltFolder,
TrackingPlotFolder(*(_simBasedPlots+_recoBasedPlots), **_common))
1390 plotterHLTExt.append(
"hlt", _hltFolder,
TrackingPlotFolder(*_extendedPlots, **_common))
1394 def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[]):
1397 def _set(param, name, modules):
1398 if param
is not None:
1399 setattr(self, name, param)
1401 setattr(self, name, modules)
1403 _set(clusterMasking,
"_clusterMasking", [self.
_name+
"Clusters"])
1406 _set(seeding,
"_seeding", [self.
_name+
"SeedingLayers", self.
_name+
"TrackingRegions", self.
_name+
"HitDoublets", self.
_name+
"HitTriplets", self.
_name+
"HitQuadruplets", self.
_name+
"Seeds"])
1407 _set(building,
"_building", [self.
_name+
"TrackCandidates"])
1408 _set(fit,
"_fit", [self.
_name+
"Tracks"])
1409 _set(selection,
"_selection", [self.
_name])
1416 return self._clusterMasking+self._seeding+self._building+self._fit+self._selection+self.
_other 1419 return self._clusterMasking
1422 return self._seeding
1425 return self._building
1431 return self._selection
1440 (
"Fit", self.
fit()),
1442 (
"Other", self.
other())]
1447 seeding=[
"initialStepSeedLayersPreSplitting",
1448 "initialStepTrackingRegionsPreSplitting",
1449 "initialStepHitDoubletsPreSplitting",
1450 "initialStepHitTripletsPreSplitting",
1451 "initialStepHitQuadrupletsPreSplitting",
1452 "initialStepSeedsPreSplitting"],
1453 building=[
"initialStepTrackCandidatesPreSplitting"],
1454 fit=[
"initialStepTracksPreSplitting"],
1455 other=[
"firstStepPrimaryVerticesPreSplitting",
1456 "initialStepTrackRefsForJetsPreSplitting",
1457 "caloTowerForTrkPreSplitting",
1458 "ak4CaloJetsForTrkPreSplitting",
1459 "jetsForCoreTrackingPreSplitting",
1462 "MeasurementTrackerEvent",
1463 "siPixelClusterShapeCache"]),
1464 Iteration(
"initialStep", clusterMasking=[],
1465 selection=[
"initialStepClassifier1",
1466 "initialStepClassifier2",
1467 "initialStepClassifier3",
1469 "initialStepSelector"],
1470 building=[
"initialStepTrackCandidatesMkFitInput",
1471 "initialStepTrackCandidatesMkFit",
1472 "initialStepTrackCandidates"],
1473 other=[
"firstStepPrimaryVerticesUnsorted",
1474 "initialStepTrackRefsForJets",
1476 "ak4CaloJetsForTrk",
1477 "firstStepPrimaryVertices"]),
1479 selection=[
"highPtTripletStepClassifier1",
1480 "highPtTripletStepClassifier2",
1481 "highPtTripletStepClassifier3",
1482 "highPtTripletStep",
1483 "highPtTripletStepSelector"]),
1485 selection=[
"detachedQuadStepClassifier1",
1486 "detachedQuadStepClassifier2",
1488 "detachedQuadStepSelector"]),
1490 selection=[
"detachedTripletStepClassifier1",
1491 "detachedTripletStepClassifier2",
1492 "detachedTripletStep",
1493 "detachedTripletStepSelector"]),
1495 selection=[
"lowPtQuadStepClassifier1",
1496 "lowPtQuadStepClassifier2",
1498 "lowPtQuadStepSelector"]),
1500 selection=[
"lowPtTripletStepClassifier1",
1501 "lowPtTripletStepClassifier2",
1503 "lowPtTripletStepSelector"]),
1505 seeding=[
"pixelPairStepSeedLayers",
1506 "pixelPairStepSeedLayersB",
1507 "pixelPairStepSeedLayersC",
1508 "pixelPairStepTrackingRegions",
1509 "pixelPairStepTrackingRegionsB",
1510 "pixelPairStepTrackingRegionsC",
1511 "pixelPairStepTrackingRegionsSeedLayersB",
1512 "pixelPairStepHitDoublets",
1513 "pixelPairStepHitDoubletsB",
1514 "pixelPairStepHitDoubletsC",
1515 "pixelPairStepSeedsA",
1516 "pixelPairStepSeedsB",
1517 "pixelPairStepSeedsC",
1518 "pixelPairStepSeeds",],
1519 selection=[
"pixelPairStep",
1520 "pixelPairStepSelector"]),
1522 seeding=[
"mixedTripletStepSeedLayersA",
1523 "mixedTripletStepSeedLayersB",
1524 "mixedTripletStepTrackingRegionsA",
1525 "mixedTripletStepTrackingRegionsB",
1526 "mixedTripletStepHitDoubletsA",
1527 "mixedTripletStepHitDoubletsB",
1528 "mixedTripletStepHitTripletsA",
1529 "mixedTripletStepHitTripletsB",
1530 "mixedTripletStepSeedsA",
1531 "mixedTripletStepSeedsB",
1532 "mixedTripletStepSeeds"],
1533 selection=[
"mixedTripletStepClassifier1",
1534 "mixedTripletStepClassifier2",
1536 "mixedTripletStepSelector"]),
1538 selection=[
"pixelLessStepClassifier1",
1539 "pixelLessStepClassifier2",
1541 "pixelLessStepSelector"]),
1543 seeding=[
"tobTecStepSeedLayersTripl",
1544 "tobTecStepSeedLayersPair",
1545 "tobTecStepTrackingRegionsTripl",
1546 "tobTecStepTrackingRegionsPair",
1547 "tobTecStepHitDoubletsTripl",
1548 "tobTecStepHitDoubletsPair",
1549 "tobTecStepHitTripletsTripl",
1550 "tobTecStepSeedsTripl",
1551 "tobTecStepSeedsPair",
1553 selection=[
"tobTecStepClassifier1",
1554 "tobTecStepClassifier2",
1556 "tobTecStepSelector"]),
1559 other=[
"jetsForCoreTracking",
1560 "firstStepGoodPrimaryVertices",
1564 seeding=[
"muonSeededSeedsInOut",
1565 "muonSeededSeedsOutIn"],
1566 building=[
"muonSeededTrackCandidatesInOut",
1567 "muonSeededTrackCandidatesOutIn"],
1568 fit=[
"muonSeededTracksInOut",
1569 "muonSeededTracksOutIn"],
1570 selection=[
"muonSeededTracksInOutClassifier",
1571 "muonSeededTracksInOutSelector",
1572 "muonSeededTracksOutIntClassifier",
1573 "muonSeededTracksOutIntSelector"],
1577 clusterMasking=[], seeding=[],
1578 building=[
"duplicateTrackCandidates"],
1579 fit=[
"mergedDuplicateTracks"],
1580 selection=[
"duplicateTrackClassifier"]),
1582 clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1583 other=[
"preDuplicateMergingGeneralTracks",
1586 clusterMasking=[
"convClusters"],
1587 seeding=[
"convLayerPairs",
1588 "photonConvTrajSeedFromSingleLeg"],
1589 building=[
"convTrackCandidates"],
1590 fit=[
"convStepTracks"],
1591 selection=[
"convStepSelector"]),
1592 Iteration(
"Other", clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
1593 other=[
"trackerClusterCheckPreSplitting",
1594 "trackerClusterCheck"]),
1598 iterations = _iterations
1599 if not includeConvStep:
1600 iterations = [i
for i
in iterations
if i.name() !=
"ConvStep"]
1602 iterations = [i
for i
in iterations
if i.name() ==
"ConvStep"]
1603 return collections.OrderedDict([(i.name(), i.all())
for i
in iterations])
1607 for i
in _iterations:
1608 if i.name() ==
"ConvStep":
1610 ret.extend(getattr(i, prop)())
1613 return collections.OrderedDict([
1614 (
"ClusterMask", getProp(
"clusterMasking")),
1615 (
"Seeding", getProp(
"seeding")),
1616 (
"Building", getProp(
"building")),
1617 (
"Fitting", getProp(
"fit")),
1618 (
"Selection", getProp(
"selection")),
1619 (
"Other", getProp(
"other"))
1638 if eventsTh1
is None:
1640 nevents = eventsTh1.GetEntries()
1644 ret = timeTh1.Clone(self.
_name)
1645 xaxis = ret.GetXaxis()
1646 for i
in range(1, ret.GetNbinsX()+1):
1647 ret.SetBinContent(i, ret.GetBinContent(i)/nevents)
1648 ret.SetBinError(i, ret.GetBinError(i)/nevents)
1649 xaxis.SetBinLabel(i, xaxis.GetBinLabel(i).
replace(
" (unscheduled)",
""))
1653 path = tdirectory.GetPath()
1654 if path
not in self.
_cache:
1659 def __init__(self, name, timeHisto, selectedTracks=False):
1669 tdir = tfile.Get(dirName)
1681 tfile = tdirectory.GetFile()
1686 iterMap = copy.copy(_collLabelMapHp)
1687 del iterMap[
"generalTracks"]
1688 del iterMap[
"jetCoreRegionalStep"]
1690 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
True, byOriginalAlgo=
False, byAlgoMask=
True, ptCut=
False, seeds=
False)
1692 renameBin =
lambda bl:
_summaryBinRename(bl, highPurity=
False, byOriginalAlgo=
False, byAlgoMask=
False, ptCut=
False, seeds=
False)
1693 recoAB =
AggregateBins(
"tmp",
"num_reco_coll", mapping=iterMap,ignoreMissingBins=
True, renameBin=renameBin)
1694 h_reco_per_iter = recoAB.create(trkDir)
1695 if h_reco_per_iter
is None:
1698 for i
in range(1, h_reco_per_iter.GetNbinsX()+1):
1699 values[h_reco_per_iter.GetXaxis().GetBinLabel(i)] = h_reco_per_iter.GetBinContent(i)
1703 for i
in range(1, timeTh1.GetNbinsX()+1):
1704 iterName = timeTh1.GetXaxis().GetBinLabel(i)
1705 if iterName
in values:
1706 ntrk = values[iterName]
1707 result.append( (iterName,
1708 timeTh1.GetBinContent(i)/ntrk
if ntrk > 0
else 0,
1709 timeTh1.GetBinError(i)/ntrk
if ntrk > 0
else 0) )
1711 if len(result) == 0:
1714 res = ROOT.TH1F(self.
_name, self.
_name, len(result), 0, len(result))
1715 for i, (label, value, error)
in enumerate(result):
1716 res.GetXaxis().SetBinLabel(i+1, label)
1717 res.SetBinContent(i+1, value)
1718 res.SetBinError(i+1, error)
1727 h = f.Get(_trackingIterationOrderHistogram)
1730 xaxis = h.GetXaxis()
1734 return s.replace(
"Tracks",
"").
replace(
"muonSeeded",
"muonSeededStep")
1735 return [_edit(xaxis.GetBinLabel(i))
for i
in range(1, h.GetNbinsX()+1)]
1739 f = tdirectory.GetFile()
1743 if not f.GetName()
in self.
_cache:
1747 self.
_cache[f.GetName()] = r
1748 order = self.
_cache[f.GetName()]
1754 orderIndices.append(labels.index(l))
1758 for i, l
in enumerate(labels):
1761 found = orderIndices.index(i)
1765 ret.append(orderIndices[0])
1767 ret.append(orderIndices[0])
1792 h = tdirectory.Get(histo)
1795 totalReco =
"%.1f" % h.Integral()
1798 h = creator.create(tdirectory)
1799 totalTracking =
None 1801 totalTracking =
"%.1f" % h.Integral()
1804 h = creator.create(tdirectory)
1805 totalConvStep =
None 1807 totalConvStep =
"%.1f" % h.Integral()
1816 cpuValues = self.
_getValues(tdirectory, _time_per_event_cpu)
1817 realValues = self.
_getValues(tdirectory, _time_per_event_real)
1819 return cpuValues + realValues
1823 "Average reco CPU time / event (ms)",
1824 "Average tracking (w/o convStep) CPU time / event (ms)",
1825 "Average convStep CPU time / event (ms)",
1826 "Average reco real time / event (ms)",
1827 "Average tracking (w/o convStep) real time / event (ms)",
1828 "Average convStep real time / event (ms)",
1833 "xbinlabelsize": 10,
1834 "xbinlabeloption":
"d" 1842 Plot(_time_per_iter_cpu,
1843 ytitle=
"Average CPU time (ms)", title=
"Average CPU time / event", legendDx=-0.4, **_common),
1845 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1848 ytitle=
"Average CPU time (ms)", title=
"Average CPU time / event", **_common),
1850 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1853 ytitle=
"Average CPU time / built track (ms)", title=
"Average CPU time / built track", **_common),
1855 ytitle=
"Average CPU time / selected track (ms)", title=
"Average CPU time / selected HP track by algoMask", **_common),
1859 Plot(_time_per_iter_real,
1860 ytitle=
"Average real time (ms)", title=
"Average real time / event", legendDx=-0.4, **_common),
1862 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1865 ytitle=
"Average real time (ms)", title=
"Average real time / event", **_common),
1867 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1870 ytitle=
"Average real time / built track (ms)", title=
"Average real time / built track", **_common),
1872 ytitle=
"Average real time / selected track (ms)", title=
"Average real time / selected HP track by algoMask", **_common),
1877 Plot(
AggregateBins(i.name(), _time_per_event_cpu, collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1878 ytitle=
"Average CPU time (ms)", title=i.name(), **_common)
1879 for i
in _iterations
1881 ncols=4, legend=
False 1884 Plot(
AggregateBins(i.name(), _time_per_event_real, collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1885 ytitle=
"Average real time (ms)", title=i.name(), **_common)
1886 for i
in _iterations
1888 ncols=4, legend=
False 1898 "DQMData/Run 1/DQM/Run summary/TimerService/process RECO paths/path prevalidation_step",
1901 timePlotter.append(
"timing", _timeFolders,
PlotFolder(
1903 _timing_iterationsCPU,
1904 _timing_summaryReal,
1905 _timing_iterationsReal,
1911 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist"}
1913 Plot(
"TPlip", xtitle=
"TP lip", **_common),
1914 Plot(
"TPtip", xtitle=
"TP tip", **_common),
1918 tpPlotter.append(
"tp", [
1919 "DQMData/Run 1/Tracking/Run summary/TrackingMCTruth/TrackingParticle",
1920 "DQMData/Tracking/TrackingMCTruth/TrackingParticle",
def iterSelectionName(self, plotFolderName, translatedDqmSubFolder)
def create(self, tdirectory)
def getSection(self, dqmSubFolder)
def _makeFakeDist(postfix)
def _makeFakeDupPileupPlots(postfix, quantity, unit="", xquantity="", xtitle=None, common={})
def __init__(self, name, timeHisto)
def _getOrCreateObject(tdirectory, nameOrCreator)
def _iterModuleMap(includeConvStep=True, onlyConvStep=False)
def replace(string, replacements)
def _getDirectory(self, tfile)
def _makeDistSimPlots(postfix, quantity, common={})
def getSection(self, dqmSubFolder)
def create(self, tdirectory)
def _summaryBinRename(binLabel, highPurity, byOriginalAlgo, byAlgoMask, ptCut, seeds)
def isAlgoIterative(self, algo)
def _trackingSubFoldersFallbackPreSplitting(subfolder)
def translateSubFolder(self, dqmSubFolderName)
def _mapCollectionToAlgoQuality(collName)
def __init__(self, section, collection=GeneralTracks)
def __init__(self, args, kwargs)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def create(self, tdirectoryNEvents, requireAllHistograms=False)
def _trackingSubFoldersFallbackConversion(subfolder)
def __call__(self, tdirectory, labels)
def _appendTrackingPlots(lastDirName, name, algoPlots, onlyForPileup=False, onlyForElectron=False, onlyForConversion=False, onlyForBHadron=False, seeding=False, building=False, rawSummary=False, highPuritySummary=True)
def _trackingSubFoldersFallbackSLHC_Phase1PU140(subfolder)
def create(self, tdirectory)
def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder)
def __init__(self, name, timeHisto, selectedTracks=False)
def _makeMVAPlots(num, hp=False)
def _trackingRefFileFallbackSLHC_Phase1PU140(path)
def _th1RemoveEmptyBins(histos, xbinlabels)
def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, ptCut=False, seeds=False, midfix="")
def _trackingSubFoldersFallbackFromPV(subfolder)
def _makeDistPlots(postfix, quantity, common={})
def __init__(self, fileName, plots, titles, isRate, kwargs)
def _create(self, tdirectory)
def create(self, tdirectory)
def _trackingFolders(lastDirName="Track")
def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[])
def _makeEffFakeDupPlots(postfix, quantity, unit="", common={}, effopts={}, fakeopts={})
def _th1ToOrderedDict(th1, renameBin=None)
def draw(self, legendLabels, prefix=None, directory="", args, kwargs)
def _mergeBinLabelsX(histos)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def _th1IncludeOnlyBins(histos, xbinlabels)
def _getValues(self, tdirectory, histo)