3 from plotting
import Subtract, FakeDuplicate, AggregateBins, ROC, Plot, PlotGroup, PlotFolder, Plotter
5 from html
import PlotPurpose
13 _maxEff = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025]
14 _maxFake = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025]
17 _minMaxResol = [1e-5, 4e-5, 1e-4, 4e-4, 1e-3, 4e-3, 1e-2, 4e-2, 0.1, 0.4, 1]
18 _minMaxN = [5e-1, 5, 5e1, 5e2, 5e3, 5e4, 5e5, 5e6, 5e7, 5e8, 5e9]
21 _maxHits = [5, 10, 20, 40, 60, 80]
22 _minLayers = [0, 5, 10]
23 _maxLayers = [5, 10, 25]
25 _min3DLayers = [0, 5, 10]
26 _max3DLayers = [5, 10, 20]
28 _legendDy_4rows = 0.09
29 _legendDy_2rows = -0.025
30 _legendDy_2rows_3cols = -0.17
34 Plot(
"efficPt", title=
"Efficiency vs p_{T}", xtitle=
"TP p_{T} (GeV)", ytitle=
"efficiency vs p_{T}", xlog=
True, ymax=_maxEff),
35 Plot(
FakeDuplicate(
"fakeduprate_vs_pT", assoc=
"num_assoc(recoToSim)_pT", dup=
"num_duplicate_pT", reco=
"num_reco_pT", title=
"fake+duplicates vs p_{T}"),
36 xtitle=
"track p_{T} (GeV)", ytitle=
"fake+duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
37 Plot(
"effic", xtitle=
"TP #eta", ytitle=
"efficiency vs #eta", title=
"", ymax=_maxEff),
38 Plot(
FakeDuplicate(
"fakeduprate_vs_eta", assoc=
"num_assoc(recoToSim)_eta", dup=
"num_duplicate_eta", reco=
"num_reco_eta", title=
""),
39 xtitle=
"track #eta", ytitle=
"fake+duplicates rate vs #eta", ymax=_maxFake),
40 Plot(
"effic_vs_phi", xtitle=
"TP #phi", ytitle=
"efficiency vs #phi", ymax=_maxEff),
41 Plot(
FakeDuplicate(
"fakeduprate_vs_phi", assoc=
"num_assoc(recoToSim)_phi", dup=
"num_duplicate_phi", reco=
"num_reco_phi", title=
"fake+duplicates vs #phi"),
42 xtitle=
"track #phi", ytitle=
"fake+duplicates rate vs #phi", ymax=_maxFake),
46 Plot(
"effic_vs_dxy", title=
"Efficiency vs dxy", xtitle=
"TP dxy (cm)", ytitle=
"efficiency vs dxy", ymax=_maxEff),
47 Plot(
FakeDuplicate(
"fakeduprate_vs_dxy", assoc=
"num_assoc(recoToSim)_dxy", dup=
"num_duplicate_dxy", reco=
"num_reco_dxy", title=
"fake+duplicates vs dxy"),
48 xtitle=
"track dxy (cm)", ytitle=
"fake+duplicates rate vs dxy", ymax=_maxFake),
49 Plot(
"effic_vs_dxypv", title=
"Efficiency vs dxy(PV)", xtitle=
"TP dxy(PV) (cm)", ytitle=
"efficiency vs dxy(PV)", ymax=_maxEff),
50 Plot(
FakeDuplicate(
"fakeduprate_vs_dxypv", assoc=
"num_assoc(recoToSim)_dxypv", dup=
"num_duplicate_dxypv", reco=
"num_reco_dxypv", title=
"fake+duplicates vs dxy(PV)"),
51 xtitle=
"track dxy(PV) (cm)", ytitle=
"fake+duplicates rate vs dxy(PV)", ymax=_maxFake),
52 Plot(
"effic_vs_dz", xtitle=
"TP dz (cm)", ytitle=
"Efficiency vs dz", title=
"", ymax=_maxEff),
53 Plot(
FakeDuplicate(
"fakeduprate_vs_dz", assoc=
"num_assoc(recoToSim)_dz", dup=
"num_duplicate_dz", reco=
"num_reco_dz", title=
""),
54 xtitle=
"track dz (cm)", ytitle=
"fake+duplicates rate vs dz", ymax=_maxFake),
55 Plot(
"effic_vs_dzpv", xtitle=
"TP dz(PV) (cm)", ytitle=
"Efficiency vs dz(PV)", title=
"", ymax=_maxEff),
56 Plot(
FakeDuplicate(
"fakeduprate_vs_dz(PV)", assoc=
"num_assoc(recoToSim)_dzpv", dup=
"num_duplicate_dzpv", reco=
"num_reco_dzpv", title=
""),
57 xtitle=
"track dz(PV) (cm)", ytitle=
"fake+duplicates rate vs dz(PV)", ymax=_maxFake),
59 legendDy=_legendDy_4rows
62 Plot(
"effic_vs_hit", xtitle=
"TP hits", ytitle=
"efficiency vs hits", xmin=_minHits, xmax=_maxHits, ymax=_maxEff),
63 Plot(
FakeDuplicate(
"fakeduprate_vs_hit", assoc=
"num_assoc(recoToSim)_hit", dup=
"num_duplicate_hit", reco=
"num_reco_hit", title=
"fake+duplicates vs hit"),
64 xtitle=
"track hits", ytitle=
"fake+duplicates rate vs hits", xmin=_minHits, xmax=_maxHits, ymax=_maxFake),
65 Plot(
"effic_vs_layer", xtitle=
"TP layers", ytitle=
"efficiency vs layers", xmin=_minLayers, xmax=_maxLayers, ymax=_maxEff),
66 Plot(
FakeDuplicate(
"fakeduprate_vs_layer", assoc=
"num_assoc(recoToSim)_layer", dup=
"num_duplicate_layer", reco=
"num_reco_layer", title=
"fake+duplicates vs layer"),
67 xtitle=
"track layers", ytitle=
"fake+duplicates rate vs layers", xmin=_minLayers, xmax=_maxLayers, ymax=_maxFake),
68 Plot(
"effic_vs_pixellayer", xtitle=
"TP pixel layers", ytitle=
"efficiency vs pixel layers", title=
"", xmax=_maxPixelLayers, ymax=_maxEff),
69 Plot(
FakeDuplicate(
"fakeduprate_vs_pixellayer", assoc=
"num_assoc(recoToSim)_pixellayer", dup=
"num_duplicate_pixellayer", reco=
"num_reco_pixellayer", title=
""),
70 xtitle=
"track pixel layers", ytitle=
"fake+duplicates rate vs pixel layers", xmax=_maxPixelLayers, ymax=_maxFake),
71 Plot(
"effic_vs_3Dlayer", xtitle=
"TP 3D layers", ytitle=
"efficiency vs 3D layers", xmin=_min3DLayers, xmax=_max3DLayers, ymax=_maxEff),
72 Plot(
FakeDuplicate(
"fakeduprate_vs_3Dlayer", assoc=
"num_assoc(recoToSim)_3Dlayer", dup=
"num_duplicate_3Dlayer", reco=
"num_reco_3Dlayer", title=
"fake+duplicates vs 3D layer"),
73 xtitle=
"track 3D layers", ytitle=
"fake+duplicates rate vs 3D layers", xmin=_min3DLayers, xmax=_max3DLayers, ymax=_maxFake),
75 legendDy=_legendDy_4rows
77 _common = {
"ymin": 0,
"ymax": _maxEff}
79 Plot(
"effic_vs_vertpos", xtitle=
"TP vert xy (cm)", ytitle=
"efficiency vs vert xy", **_common),
80 Plot(
FakeDuplicate(
"fakeduprate_vs_vertpos", assoc=
"num_assoc(recoToSim)_vertpos", dup=
"num_duplicate_vertpos", reco=
"num_reco_vertpos", title=
"fake+duplicates vs. ref. point xy"),
81 xtitle=
"track ref. point xy (cm)", ytitle=
"fake+duplicates vs xy", ymax=_maxFake),
82 Plot(
"effic_vs_zpos", xtitle=
"TP vert z (cm)", ytitle=
"efficiency vs vert z", **_common),
83 Plot(
FakeDuplicate(
"fakeduprate_vs_zpos", assoc=
"num_assoc(recoToSim)_zpos", dup=
"num_duplicate_zpos", reco=
"num_reco_zpos", title=
"fake+duplicates vs. ref. point z"),
84 xtitle=
"track ref. point z (cm)", ytitle=
"fake+duplicates vs z", ymax=_maxFake),
85 Plot(
"effic_vs_dr", xlog=
True, xtitle=
"TP min #DeltaR", ytitle=
"efficiency vs dr", **_common),
86 Plot(
FakeDuplicate(
"fakeduprate_vs_dr", assoc=
"num_assoc(recoToSim)_dr", dup=
"num_duplicate_dr", reco=
"num_reco_dr", title=
"fake+duplicates vs. #DeltaR"),
87 xtitle=
"track min #DeltaR", ytitle=
"fake+duplicates vs #DeltaR", xlog=
True, ymax=_maxFake),
91 Plot(
"fakeratePt", xtitle=
"track p_{T} (GeV)", ytitle=
"fakerate vs p_{T}", xlog=
True, ymax=_maxFake),
92 Plot(
"duplicatesRate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"duplicates rate vs p_{T}", ymax=_maxFake, xlog=
True),
93 Plot(
"pileuprate_Pt", xtitle=
"track p_{T} (GeV)", ytitle=
"pileup rate vs p_{T}", ymax=_maxFake, xlog=
True),
94 Plot(
"fakerate", xtitle=
"track #eta", ytitle=
"fakerate vs #eta", title=
"", ymax=_maxFake),
95 Plot(
"duplicatesRate", xtitle=
"track #eta", ytitle=
"duplicates rate vs #eta", title=
"", ymax=_maxFake),
96 Plot(
"pileuprate", xtitle=
"track #eta", ytitle=
"pileup rate vs #eta", title=
"", ymax=_maxFake),
97 Plot(
"fakerate_vs_phi", xtitle=
"track #phi", ytitle=
"fakerate vs #phi", ymax=_maxFake),
98 Plot(
"duplicatesRate_phi", xtitle=
"track #phi", ytitle=
"duplicates rate vs #phi", ymax=_maxFake),
99 Plot(
"pileuprate_phi", xtitle=
"track #phi", ytitle=
"pileup rate vs #phi", ymax=_maxFake),
102 Plot(
"fakerate_vs_dxy", xtitle=
"track dxy (cm)", ytitle=
"fakerate vs dxy", ymax=_maxFake),
103 Plot(
"duplicatesRate_dxy", xtitle=
"track dxy (cm)", ytitle=
"duplicates rate vs dxy", ymax=_maxFake),
104 Plot(
"pileuprate_dxy", xtitle=
"track dxy (cm)", ytitle=
"pileup rate vs dxy", ymax=_maxFake),
106 Plot(
"fakerate_vs_dxypv", xtitle=
"track dxy(PV) (cm)", ytitle=
"fakerate vs dxy(PV)", ymax=_maxFake),
107 Plot(
"duplicatesRate_dxypv", xtitle=
"track dxy(PV) (cm)", ytitle=
"duplicates rate vs dxy(PV)", ymax=_maxFake),
108 Plot(
"pileuprate_dxypv", xtitle=
"track dxy(PV) (cm)", ytitle=
"pileup rate vs dxy(PV)", ymax=_maxFake),
110 Plot(
"fakerate_vs_dz", xtitle=
"track dz (cm)", ytitle=
"fakerate vs dz", title=
"", ymax=_maxFake),
111 Plot(
"duplicatesRate_dz", xtitle=
"track dz (cm)", ytitle=
"duplicates rate vs dz", title=
"", ymax=_maxFake),
112 Plot(
"pileuprate_dz", xtitle=
"track dz (cm)", ytitle=
"pileup rate vs dz", title=
"", ymax=_maxFake),
114 Plot(
"fakerate_vs_dzpv", xtitle=
"track dz(PV) (cm)", ytitle=
"fakerate vs dz(PV)", title=
"", ymax=_maxFake),
115 Plot(
"duplicatesRate_dzpv", xtitle=
"track dz(PV) (cm)", ytitle=
"duplicates rate vs dz(PV)", title=
"", ymax=_maxFake),
116 Plot(
"pileuprate_dzpv", xtitle=
"track dz(PV) (cm)", ytitle=
"pileup rate vs dz(PV)", title=
"", ymax=_maxFake),
118 ncols=3, legendDy=_legendDy_4rows
121 Plot(
"fakerate_vs_hit", xtitle=
"track hits", ytitle=
"fakerate vs hits", ymax=_maxFake, xmin=_minHits, xmax=_maxHits),
122 Plot(
"duplicatesRate_hit", xtitle=
"track hits", ytitle=
"duplicates rate vs hits", ymax=_maxFake, xmin=_minHits, xmax=_maxHits),
123 Plot(
"pileuprate_hit", xtitle=
"track hits", ytitle=
"pileup rate vs hits", ymax=_maxFake, xmin=_minHits, xmax=_maxHits),
125 Plot(
"fakerate_vs_layer", xtitle=
"track layers", ytitle=
"fakerate vs layer", ymax=_maxFake, xmin=_minLayers, xmax=_maxLayers),
126 Plot(
"duplicatesRate_layer", xtitle=
"track layers", ytitle=
"duplicates rate vs layers", ymax=_maxFake, xmin=_minLayers, xmax=_maxLayers),
127 Plot(
"pileuprate_layer", xtitle=
"track layers", ytitle=
"pileup rate vs layers", ymax=_maxFake, xmin=_minLayers, xmax=_maxLayers),
129 Plot(
"fakerate_vs_pixellayer", xtitle=
"track pixel layers", ytitle=
"fakerate vs pixel layers", title=
"", ymax=_maxFake, xmax=_maxPixelLayers),
130 Plot(
"duplicatesRate_pixellayer", xtitle=
"track pixel layers", ytitle=
"duplicates rate vs pixel layers", title=
"", ymax=_maxFake, xmax=_maxPixelLayers),
131 Plot(
"pileuprate_pixellayer", xtitle=
"track pixel layers", ytitle=
"pileup rate vs pixel layers", title=
"", ymax=_maxFake, xmax=_maxPixelLayers),
133 Plot(
"fakerate_vs_3Dlayer", xtitle=
"track 3D layers", ytitle=
"fakerate vs 3D layers", ymax=_maxFake, xmin=_min3DLayers, xmax=_max3DLayers),
134 Plot(
"duplicatesRate_3Dlayer", xtitle=
"track 3D layers", ytitle=
"duplicates rate vs 3D layers", ymax=_maxFake, xmin=_min3DLayers, xmax=_max3DLayers),
135 Plot(
"pileuprate_3Dlayer", xtitle=
"track 3D layers", ytitle=
"pileup rate vs 3D layers", ymax=_maxFake, xmin=_min3DLayers, xmax=_max3DLayers)
137 ncols=3, legendDy=_legendDy_4rows
140 Plot(
"fakerate_vs_vertpos", xtitle=
"track ref. point xy (cm)", ytitle=
"fakerate vs xy", ymax=_maxFake),
141 Plot(
"duplicatesRate_vertpos", xtitle=
"track ref. point xy (cm)", ytitle=
"duplicates rate vs xy", ymax=_maxFake),
142 Plot(
"pileuprate_vertpos", xtitle=
"track ref. point xy (cm)", ytitle=
"pileup rate vs xy", ymax=_maxFake),
144 Plot(
"fakerate_vs_zpos", xtitle=
"track ref. point z (cm)", ytitle=
"fakerate vs z", ymax=_maxFake),
145 Plot(
"duplicatesRate_zpos", xtitle=
"track ref. point z (cm)", ytitle=
"duplicates rate vs z", ymax=_maxFake),
146 Plot(
"pileuprate_zpos", xtitle=
"track ref. point z (cm)", ytitle=
"pileup rate vs z", ymax=_maxFake),
148 Plot(
"fakerate_vs_dr", xtitle=
"track min #DeltaR", ytitle=
"fakerate vs #DeltaR", xlog=
True, ymax=_maxFake),
149 Plot(
"duplicatesRate_dr", xtitle=
"track min #DeltaR", ytitle=
"duplicates rate vs #DeltaR", xlog=
True, ymax=_maxFake),
150 Plot(
"pileuprate_dr", xtitle=
"track min #DeltaR", ytitle=
"pileup rate vs #DeltaR", xlog=
True, ymax=_maxFake),
152 Plot(
"fakerate_vs_chi2", xtitle=
"track #chi^{2}", ytitle=
"fakerate vs #chi^{2}", ymax=_maxFake),
153 Plot(
"duplicatesRate_chi2", xtitle=
"track #chi^{2}", ytitle=
"duplicates rate vs #chi^{2}", ymax=_maxFake),
154 Plot(
"pileuprate_chi2", xtitle=
"track #chi^{2}", ytitle=
"pileup rate vs #chi^{2}", ymax=_maxFake)
156 ncols=3, legendDy=_legendDy_4rows
159 "ytitle":
"Fake+pileup rate",
164 _common2.update(_common)
165 _common2[
"drawStyle"] =
"pcolz"
166 _common2[
"ztitleoffset"] = 1.5
167 _common2[
"xtitleoffset"] = 7
168 _common2[
"ytitleoffset"] = 10
169 _common2[
"ztitleoffset"] = 6
171 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")),
172 xtitle=
"Efficiency vs. cut on dz(PV)", **_common),
173 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),
174 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)", **_common2),
176 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")),
177 xtitle=
"Efficiency vs. cut on dz(PV)/dzError", **_common),
178 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),
179 xtitle=
"Efficiency", ztitle=
"Cut on dz(PV)/dzError", **_common2),
181 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")),
182 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)", **_common),
183 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),
184 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)", **_common2),
186 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")),
187 xtitle=
"Efficiency (p_{T} weighted) vs. cut on dz(PV)/dzError", **_common),
188 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),
189 xtitle=
"Efficiency (p_{T} weighted)", ztitle=
"Cut on dz(PV)/dzError", **_common2),
190 ], onlyForPileup=
True,
191 legendDy=_legendDy_4rows
194 Plot(
"effic_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency vs. cut on dz(PV)", ymax=_maxEff),
195 Plot(
"effic_vs_dzpvcut2", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
196 Plot(
"fakerate_vs_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate vs. cut on dz(PV)", ymax=_maxFake),
197 Plot(
"pileuprate_dzpvcut", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate vs. cut on dz(PV)", ymax=_maxFake),
199 Plot(
"effic_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency vs. cut on dz(PV)/dzError", ymax=_maxEff),
200 Plot(
"effic_vs_dzpvsigcut2", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (excl. trk eff)", ymax=_maxEff),
201 Plot(
"fakerate_vs_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
202 Plot(
"pileuprate_dzpvsigcut", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate vs. cut on dz(PV)/dzError", ymax=_maxFake),
203 ], onlyForPileup=
True,
204 legendDy=_legendDy_4rows
207 Plot(
"effic_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
208 Plot(
"effic_vs_dzpvcut2_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
209 Plot(
"fakerate_vs_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
210 Plot(
"pileuprate_dzpvcut_pt", xtitle=
"Cut on dz(PV) (cm)", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
212 Plot(
"effic_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted)", ymax=_maxEff),
213 Plot(
"effic_vs_dzpvsigcut2_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Efficiency (p_{T} weighted, excl. trk eff)", ymax=_maxEff),
214 Plot(
"fakerate_vs_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Fake rate (p_{T} weighted)", ymax=_maxFake),
215 Plot(
"pileuprate_dzpvsigcut_pt", xtitle=
"Cut on dz(PV)/dzError", ytitle=
"Pileup rate (p_{T} weighted)", ymax=_maxFake),
216 ], onlyForPileup=
True,
217 legendDy=_legendDy_4rows
222 _common = {
"normalizeToUnitArea":
True,
"stat":
True,
"drawStyle":
"hist"}
224 Plot(
"h_dedx_estim1", xtitle=
"dE/dx, harm2", **_common),
225 Plot(
"h_dedx_estim2", xtitle=
"dE/dx, trunc40", **_common),
226 Plot(
"h_dedx_nom1", xtitle=
"dE/dx number of measurements", title=
"", **_common),
227 Plot(
"h_dedx_sat1", xtitle=
"dE/dx number of measurements with saturation", title=
"", **_common),
229 legendDy=_legendDy_2rows
233 Plot(
"chargeMisIdRate", xtitle=
"#eta", ytitle=
"charge mis-id rate vs #eta", ymax=0.05),
234 Plot(
"chargeMisIdRate_Pt", xtitle=
"p_{T}", ytitle=
"charge mis-id rate vs p_{T}", xmax=300, ymax=0.1, xlog=
True),
235 Plot(
"chargeMisIdRate_hit", xtitle=
"hits", ytitle=
"charge mis-id rate vs hits", title=
""),
236 Plot(
"chargeMisIdRate_phi", xtitle=
"#phi", ytitle=
"charge mis-id rate vs #phi", title=
"", ymax=0.01),
237 Plot(
"chargeMisIdRate_dxy", xtitle=
"dxy", ytitle=
"charge mis-id rate vs dxy", ymax=0.1),
238 Plot(
"chargeMisIdRate_dz", xtitle=
"dz", ytitle=
"charge mis-id rate vs dz", ymax=0.1)
240 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"ylog":
True,
"ymin": 1e-6,
"drawStyle":
"hist"}
242 Plot(
"missing_inner_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
243 Plot(
"missing_outer_layers", xmin=_minLayers, xmax=_maxLayers, ymax=1, **_common),
244 Plot(
"hits_eta", stat=
True, statx=0.38, xtitle=
"track #eta", ytitle=
"<hits> vs #eta", ymin=_minHits, ymax=_maxHits, statyadjust=[0,0,-0.15],
245 fallback={
"name":
"nhits_vs_eta",
"profileX":
True}),
246 Plot(
"hits", stat=
True, xtitle=
"track hits", xmin=_minHits, xmax=_maxHits, ylog=
True, ymin=[5e-1, 5, 5e1, 5e2, 5e3], drawStyle=
"hist"),
247 Plot(
"num_simul_pT", xtitle=
"TP p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common),
248 Plot(
"num_reco_pT", xtitle=
"track p_{T}", xlog=
True, ymax=[1e-1, 2e-1, 5e-1, 1], **_common)
251 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),
252 Plot(
"chi2_prob", stat=
True, normalizeToUnitArea=
True, drawStyle=
"hist", xtitle=
"Prob(#chi^{2})"),
253 Plot(
"chi2mean", stat=
True, title=
"", xtitle=
"#eta", ytitle=
"< #chi^{2} / ndf >", ymax=2.5,
254 fallback={
"name":
"chi2_vs_eta",
"profileX":
True}),
255 Plot(
"ptres_vs_eta_Mean", stat=
True, scale=100, title=
"", xtitle=
"#eta", ytitle=
"< #delta p_{T} / p_{T} > [%]", ymin=-1.5, ymax=1.5)
257 _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}
259 Plot(
"pullPt", **_common),
260 Plot(
"pullQoverp", **_common),
261 Plot(
"pullPhi", **_common),
262 Plot(
"pullTheta", **_common),
263 Plot(
"pullDxy", **_common),
264 Plot(
"pullDz", **_common),
266 legendDx=0.1, legendDw=-0.1, legendDh=-0.015
268 _common = {
"title":
"",
"ylog":
True,
"xtitle":
"#eta",
"ymin": _minMaxResol,
"ymax": _minMaxResol}
270 Plot(
"phires_vs_eta_Sigma", ytitle=
"#sigma(#delta #phi) [rad]", **_common),
271 Plot(
"cotThetares_vs_eta_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
272 Plot(
"dxyres_vs_eta_Sigma", ytitle=
"#sigma(#delta d_{0}) [cm]", **_common),
273 Plot(
"dzres_vs_eta_Sigma", ytitle=
"#sigma(#delta z_{0}) [cm]", **_common),
274 Plot(
"ptres_vs_eta_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
276 _common = {
"title":
"",
"ylog":
True,
"xlog":
True,
"xtitle":
"p_{T}",
"xmin": 0.1,
"xmax": 1000,
"ymin": _minMaxResol,
"ymax": _minMaxResol}
278 Plot(
"phires_vs_pt_Sigma", ytitle=
"#sigma(#delta #phi) [rad]", **_common),
279 Plot(
"cotThetares_vs_pt_Sigma", ytitle=
"#sigma(#delta cot(#theta))", **_common),
280 Plot(
"dxyres_vs_pt_Sigma", ytitle=
"#sigma(#delta d_{0}) [cm]", **_common),
281 Plot(
"dzres_vs_pt_Sigma", ytitle=
"#sigma(#delta z_{0}) [cm]", **_common),
282 Plot(
"ptres_vs_pt_Sigma", ytitle=
"#sigma(#delta p_{T}/p_{T})", **_common),
291 _possibleTrackingNonIterationColls = [
295 _possibleTrackingColls = [
296 'initialStepPreSplitting',
303 'detachedTripletStep',
311 'jetCoreRegionalStep',
312 'muonSeededStepInOut',
313 'muonSeededStepOutIn',
315 ] + _possibleTrackingNonIterationColls
316 _possibleTrackingCollsOld = {
330 ret = subfolder.replace(
"trackingParticleRecoAsssociation",
"AssociatorByHitsRecoDenom")
331 for (old, new)
in [(
"InitialStep",
"Zero"),
332 (
"LowPtTripletStep",
"First"),
333 (
"PixelPairStep",
"Second"),
334 (
"MixedTripletStep",
"Fourth"),
335 (
"MuonSeededStepInOut",
"Ninth"),
336 (
"MuonSeededStepOutIn",
"Tenth")]:
337 ret = ret.replace(old, new)
342 for (old, new)
in [(
"initialStep",
"iter0"),
343 (
"lowPtTripletStep",
"iter1"),
344 (
"pixelPairStep",
"iter2"),
345 (
"mixedTripletStep",
"iter4"),
346 (
"muonSeededStepInOut",
"iter9"),
347 (
"muonSeededStepOutIn",
"iter10")]:
348 path = path.replace(old, new)
353 quality =
"highPurity"
358 if "Step" in collName:
359 hasPtCut = collName.index(
"Pt") > collName.index(
"Step")
362 collNameNoQuality = collName.replace(
"Hp",
"")
365 collNameNoQuality = collNameNoQuality.replace(
"Pt",
"")
366 if "ByOriginalAlgo" in collName:
367 quality +=
"ByOriginalAlgo"
368 collNameNoQuality = collNameNoQuality.replace(
"ByOriginalAlgo",
"")
369 if "ByAlgoMask" in collName:
370 quality +=
"ByAlgoMask"
371 collNameNoQuality = collNameNoQuality.replace(
"ByAlgoMask",
"")
372 collNameNoQuality = collNameNoQuality.replace(
"Tracks",
"", 1)
375 if collNameLow.find(
"seed") == 0:
377 raise Exception(
"Assumption of empty quality for seeds failed, got quality '%s'" % quality)
378 collNameLow = collNameLow[4:]
379 if collNameLow ==
"initialstepseedspresplitting":
380 collNameLow =
"initialsteppresplittingseeds"
381 elif collNameLow ==
"muonseededseedsinout":
382 collNameLow =
"muonseededstepinoutseeds"
383 elif collNameLow ==
"muonseededseedsoutin":
384 collNameLow =
"muonseededstepoutinseeds"
386 i_seeds = collNameLow.index(
"seeds")
387 quality = collNameLow[i_seeds:]
389 collNameLow = collNameLow[:i_seeds]
392 prefixes = [
"cutsreco",
"cutsrecofrompv",
"cutsrecofrompv2",
"cutsrecofrompvalltp"]
393 if collNameLow
in [
"general",
"generalfrompv"]+prefixes:
398 if coll == collNameLow.replace(pfx,
""):
402 for coll
in _possibleTrackingColls:
403 if testColl(coll.lower()):
408 for coll, name
in _possibleTrackingCollsOld.iteritems():
409 if testColl(coll.lower()):
415 algo = collNameNoQuality
418 if algo ==
"muonSeededInOut":
419 algo =
"muonSeededStepInOut"
420 if algo ==
"muonSeededOutIn":
421 algo =
"muonSeededStepOutIn"
423 return (algo, quality)
426 return (name, [name])
427 _collLabelMap = collections.OrderedDict(map(_collhelper, [
"generalTracks"]+_possibleTrackingColls))
428 _collLabelMapHp = collections.OrderedDict(map(_collhelper, [
"generalTracks"]+
filter(
lambda n:
"Step" in n, _possibleTrackingColls)))
432 algo =
"generalTracks"
436 if algo !=
"generalTracks" and "ByOriginalAlgo" not in quality:
438 quality = quality.replace(
"ByOriginalAlgo",
"")
440 if algo !=
"generalTracks" and "ByAlgoMask" not in quality:
442 quality = quality.replace(
"ByAlgoMask",
"")
445 if quality ==
"highPurity":
448 i_seeds = quality.find(
"seeds")
451 seedSubColl = quality[i_seeds+5:]
452 if seedSubColl !=
"":
453 ret += seedSubColl[0].
upper() + seedSubColl[1:]
460 def _constructSummary(mapping=None, highPurity=False, byOriginalAlgo=False, byAlgoMask=False, seeds=False, midfix=""):
461 _common = {
"drawStyle":
"EP",
"xbinlabelsize": 10,
"xbinlabeloption":
"d"}
462 _commonN = {
"ylog":
True,
"ymin": _minMaxN,
"ymax": _minMaxN}
463 _commonN.update(_common)
464 _commonAB = {
"mapping": mapping,
465 "renameBin":
lambda bl:
_summaryBinRename(bl, highPurity, byOriginalAlgo, byAlgoMask, seeds),
466 "ignoreMissingBins":
True,
468 if byOriginalAlgo
or byAlgoMask:
469 _commonAB[
"minExistingBins"] = 2
470 prefix =
"summary"+midfix
472 h_eff =
"effic_vs_coll"
473 h_eff_allpt =
"effic_vs_coll_allPt"
474 h_fakerate =
"fakerate_vs_coll"
475 h_duplicaterate =
"duplicatesRate_coll"
476 h_pileuprate =
"pileuprate_coll"
478 h_reco =
"num_reco_coll"
479 h_true =
"num_assoc(recoToSim)_coll"
480 h_fake =
Subtract(
"num_fake_coll_orig",
"num_reco_coll",
"num_assoc(recoToSim)_coll")
481 h_duplicate =
"num_duplicate_coll"
482 h_pileup =
"num_pileup_coll"
483 if mapping
is not None:
485 h_eff_allpt =
AggregateBins(
"efficiencyAllPt", h_eff_allpt, **_commonAB)
486 h_fakerate =
AggregateBins(
"fakerate", h_fakerate, **_commonAB)
487 h_duplicaterate =
AggregateBins(
"duplicatesRate", h_duplicaterate, **_commonAB)
488 h_pileuprate =
AggregateBins(
"pileuprate", h_pileuprate, **_commonAB)
493 h_duplicate =
AggregateBins(
"num_duplicate_coll", h_duplicate, **_commonAB)
494 h_pileup =
AggregateBins(
"num_pileup_coll", h_pileup, **_commonAB)
497 Plot(h_eff, title=
"Efficiency vs collection", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
498 Plot(h_eff_allpt, title=
"Efficiency vs collection (no pT cut in denominator)", ytitle=
"Efficiency", ymin=1e-3, ymax=1, ylog=
True, **_common),
500 Plot(h_fakerate, title=
"Fakerate vs collection", ytitle=
"Fake rate", ymax=_maxFake, **_common),
501 Plot(h_duplicaterate, title=
"Duplicates rate vs collection", ytitle=
"Duplicates rate", ymax=_maxFake, **_common),
502 Plot(h_pileuprate, title=
"Pileup rate vs collection", ytitle=
"Pileup rate", ymax=_maxFake, **_common),
504 summaryN =
PlotGroup(prefix+
"_ntracks", [
505 Plot(h_reco, ytitle=
"Tracks", title=
"Number of tracks vs collection", **_commonN),
506 Plot(h_true, ytitle=
"True tracks", title=
"Number of true tracks vs collection", **_commonN),
507 Plot(h_fake, ytitle=
"Fake tracks", title=
"Number of fake tracks vs collection", **_commonN),
508 Plot(h_duplicate, ytitle=
"Duplicate tracks", title=
"Number of duplicate tracks vs collection", **_commonN),
509 Plot(h_pileup, ytitle=
"Pileup tracks", title=
"Number of pileup tracks vs collection", **_commonN),
512 return (summary, summaryN)
517 (_summaryByOriginalAlgo, _summaryByOriginalAlgoN) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo")
518 (_summaryByOriginalAlgoHp, _summaryByOriginalAlgoNHp) =
_constructSummary(_collLabelMapHp, byOriginalAlgo=
True, midfix=
"ByOriginalAlgo", highPurity=
True)
519 (_summaryByAlgoMask, _summaryByAlgoMaskN) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask")
520 (_summaryByAlgoMaskHp, _summaryByAlgoMaskNHp) =
_constructSummary(_collLabelMapHp, byAlgoMask=
True, midfix=
"ByAlgoMask", highPurity=
True)
529 _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]}
531 _commonStatus.update(_common)
532 _commonStatus.update({
"xbinlabelsize": 10,
"xbinlabeloption":
"d",
"drawStyle":
"hist",
"adjustMarginRight": 0.08})
533 _commonLabelSize = {}
534 _commonLabelSize.update(_common)
535 _commonLabelSize.update({
"xlabelsize": 17})
538 Plot(
"selectionFlow", xbinlabelsize=10, xbinlabeloption=
"d", adjustMarginRight=0.1, drawStyle=
"hist", ylog=
True, ymin=[0.9, 9, 9e1, 9e2, 9e3, 9e4, 9e5, 9e6, 9e7]),
539 Plot(
"diffCharge", xtitle=
"Charge", **_common),
540 Plot(
"diffIsHighPurity", xtitle=
"High purity status", **_common),
541 Plot(
"diffNdof", xtitle=
"ndof", **_common),
542 Plot(
"diffNormalizedChi2", xtitle=
"#chi^{2}/ndof", **_common),
545 _packedCandidateHitsHitPattern =
PlotGroup(
"hitsHitPattern", [
546 Plot(
"diffHitPatternNumberOfValidHits", xtitle=
"Valid hits (via HitPattern)", **_common),
547 Plot(
"diffHitPatternNumberOfValidPixelHits", xtitle=
"Valid pixel hits (via HitPattern)", **_common),
548 Plot(
"diffHitPatternHasValidHitInFirstPixelBarrel", xtitle=
"Has valid hit in BPix1 layer (via HitPattern)", **_common),
549 Plot(
"diffHitPatternNumberOfLostPixelHits", xtitle=
"Lost pixel hits (via HitPattern)", **_common),
551 legendDy=_legendDy_2rows
554 Plot(
"diffNumberOfHits", xtitle=
"Hits", **_common),
555 Plot(
"diffNumberOfPixelHits", xtitle=
"Pixel hits", **_common),
556 Plot(
"diffLostInnerHits", xtitle=
"Lost inner hits", **_common),
557 Plot(
"numberHitsOverMax", xtitle=
"Number of overflown hits", **_common),
558 Plot(
"numberPixelHitsOverMax", xtitle=
"Number of overflown pixel hits", **_common),
559 Plot(
"numberStripHitsOverMax", xtitle=
"Number of overflown strip hits", **_common),
561 ncols=3, legendDy=_legendDy_2rows_3cols
564 _packedCandidateImpactParameter1 =
PlotGroup(
"impactParameter1", [
565 Plot(
"diffDxyAssocPV", xtitle=
"dxy(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
566 Plot(
"diffDxyAssocPVStatus", **_commonStatus),
567 Plot(
"diffDxyAssocPVUnderOverFlowSign", xtitle=
"dxy(assocPV)", **_common),
568 Plot(
"diffDzAssocPV", xtitle=
"dz(assocPV)", adjustMarginRight=0.02, **_commonLabelSize),
569 Plot(
"diffDzAssocPVStatus", **_commonStatus),
570 Plot(
"diffDzAssocPVUnderOverFlowSign", xtitle=
"dz(assocPV)", **_common),
571 Plot(
"diffDxyError", xtitle=
"dxyError()", adjustMarginRight=0.02, **_commonLabelSize),
572 Plot(
"diffDszError", xtitle=
"dszError()", adjustMarginRight=0.02, **_commonLabelSize),
573 Plot(
"diffDzError", xtitle=
"dzError()", adjustMarginRight=0.02, **_commonLabelSize),
579 _packedCandidateImpactParameter2 =
PlotGroup(
"impactParameter2", [
580 Plot(
"diffDxyPV", xtitle=
"dxy(PV) via PC", **_commonLabelSize),
581 Plot(
"diffDzPV", xtitle=
"dz(PV) via PC", **_commonLabelSize),
582 Plot(
"diffTrackDxyAssocPV", xtitle=
"dxy(PV) via PC::bestTrack()", **_commonLabelSize),
583 Plot(
"diffTrackDzAssocPV", xtitle=
"dz(PV) via PC::bestTrack()", **_commonLabelSize),
584 Plot(
"diffTrackDxyError", xtitle=
"dxyError() via PC::bestTrack()", adjustMarginRight=0.02, **_commonLabelSize),
585 Plot(
"diffTrackDzError", xtitle=
"dzError() via PC::bestTrack()", **_commonLabelSize),
588 _packedCandidateCovarianceMatrix1 =
PlotGroup(
"covarianceMatrix1", [
589 Plot(
"diffCovQoverpQoverp", xtitle=
"cov(qoverp, qoverp)", **_commonLabelSize),
590 Plot(
"diffCovQoverpQoverpStatus", **_commonStatus),
591 Plot(
"diffCovQoverpQoverpUnderOverFlowSign", xtitle=
"cov(qoverp, qoverp)", **_common),
592 Plot(
"diffCovLambdaLambda", xtitle=
"cov(lambda, lambda)", **_commonLabelSize),
593 Plot(
"diffCovLambdaLambdaStatus", **_commonStatus),
594 Plot(
"diffCovLambdaLambdaUnderOverFlowSign", xtitle=
"cov(lambda, lambda)", **_common),
595 Plot(
"diffCovLambdaDsz", xtitle=
"cov(lambda, dsz)", **_commonLabelSize),
596 Plot(
"diffCovLambdaDszStatus", **_commonStatus),
597 Plot(
"diffCovLambdaDszUnderOverFlowSign", xtitle=
"cov(lambda, dsz)", **_common),
598 Plot(
"diffCovPhiPhi", xtitle=
"cov(phi, phi)", **_commonLabelSize),
599 Plot(
"diffCovPhiPhiStatus", **_commonStatus),
600 Plot(
"diffCovPhiPhiUnderOverFlowSign", xtitle=
"cov(phi, phi)", **_common),
602 ncols=3, legendDy=_legendDy_4rows
604 _packedCandidateCovarianceMatrix2 =
PlotGroup(
"covarianceMatrix2", [
605 Plot(
"diffCovPhiDxy", xtitle=
"cov(phi, dxy)", **_commonLabelSize),
606 Plot(
"diffCovPhiDxyStatus", **_commonStatus),
607 Plot(
"diffCovPhiDxyUnderOverFlowSign", xtitle=
"cov(phi, dxy)", **_common),
608 Plot(
"diffCovDxyDxy", xtitle=
"cov(dxy, dxy)", adjustMarginRight=0.02, **_commonLabelSize),
609 Plot(
"diffCovDxyDxyStatus", **_commonStatus),
610 Plot(
"diffCovDxyDxyUnderOverFlowSign", xtitle=
"cov(dxy, dxy)", **_common),
611 Plot(
"diffCovDxyDsz", xtitle=
"cov(dxy, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
612 Plot(
"diffCovDxyDszStatus", **_commonStatus),
613 Plot(
"diffCovDxyDszUnderOverFlowSign", xtitle=
"cov(dxy, dsz)", **_common),
614 Plot(
"diffCovDszDsz", xtitle=
"cov(dsz, dsz)", adjustMarginRight=0.02, **_commonLabelSize),
615 Plot(
"diffCovDszDszStatus", **_commonStatus),
616 Plot(
"diffCovDszDszUnderOverFlowSign", xtitle=
"cov(dsz, dsz)", **_common),
618 ncols=3, legendDy=_legendDy_4rows
621 _common[
"xlabelsize"] = 16
623 Plot(
"diffVx", xtitle=
"Reference point x", **_common),
624 Plot(
"diffVy", xtitle=
"Reference point y", **_common),
625 Plot(
"diffVz", xtitle=
"Reference point z", **_common),
627 legendDy=_legendDy_2rows
630 _common[
"adjustMarginRight"] = 0.05
632 Plot(
"diffPt", xtitle=
"p_{T}", **_common),
633 Plot(
"diffPtError", xtitle=
"p_{T} error", **_common),
634 Plot(
"diffEta", xtitle=
"#eta", **_common),
635 Plot(
"diffEtaError", xtitle=
"#eta error", **_common),
636 Plot(
"diffPhi", xtitle=
"#phi", **_common),
642 PlotFolder.__init__(self, *args, **kwargs)
645 spl = dqmSubFolderName.split(
"_")
652 (algoOrig, quality) = translatedDqmSubFolder
655 algo = fallback(algoOrig)
658 if plotFolderName !=
"":
659 ret +=
"_"+plotFolderName
662 if not (algo ==
"ootb" and quality !=
""):
667 """Return True if this subfolder should be processed
670 limitOnlyTo -- Function '(algo, quality) -> bool'
671 translatedDqmSubFolder -- Return value of translateSubFolder
673 (algo, quality) = translatedDqmSubFolder
674 return limitOnlyTo(algo, quality)
678 return algo
not in _possibleTrackingNonIterationColls
698 h = tdirectory.Get(hname)
703 if algo !=
"ootb" and quality !=
"highPurity":
705 return h.GetBinContent(2)
708 if algo !=
"ootb" and quality !=
"":
710 return h.GetBinContent(1)
711 def _formatOrNone(num, func):
716 n_tracks = _formatOrNone(_getN(
"num_reco_coll"), int)
717 n_true = _formatOrNone(_getN(
"num_assoc(recoToSim)_coll"), int)
718 if n_tracks
is not None and n_true
is not None:
719 n_fake = n_tracks-n_true
722 n_pileup = _formatOrNone(_getN(
"num_pileup_coll"), int)
723 n_duplicate = _formatOrNone(_getN(
"num_duplicate_coll"), int)
725 eff = _formatOrNone(_getN(
"effic_vs_coll"),
lambda n:
"%.4f" % n)
727 ret = [eff, n_tracks, n_true, n_fake, n_pileup, n_duplicate]
728 if ret.count(
None) == len(ret):
736 "Number of true tracks",
737 "Number of fake tracks",
738 "Number of pileup tracks",
739 "Number of duplicate tracks"
744 "DQMData/Run 1/Tracking/Run summary/"+lastDirName,
745 "DQMData/Tracking/"+lastDirName,
746 "DQMData/Run 1/RecoTrackV/Run summary/"+lastDirName,
747 "DQMData/RecoTrackV/"+lastDirName,
772 _seedingBuildingPlots = _simBasedPlots + [
782 _summaryByOriginalAlgo,
783 _summaryByOriginalAlgoN,
790 _summaryByOriginalAlgoHp,
791 _summaryByOriginalAlgoNHp,
792 _summaryByAlgoMaskHp,
793 _summaryByAlgoMaskNHp,
795 _summaryPlotsSeeds = [
799 _packedCandidatePlots = [
800 _packedCandidateFlow,
801 _packedCandidateKinematics,
802 _packedCandidateVertex,
803 _packedCandidateImpactParameter1,
804 _packedCandidateImpactParameter2,
805 _packedCandidateCovarianceMatrix1,
806 _packedCandidateCovarianceMatrix2,
807 _packedCandidateHits,
808 _packedCandidateHitsHitPattern,
816 summaryName += name+
"_"
817 summaryName +=
"summary"
820 summaryPlots.extend([_summaryRaw, _summaryRawN])
821 summaryPlots.extend(_summaryPlots)
823 PlotFolder(*summaryPlots, loopSubFolders=
False, onlyForPileup=onlyForPileup,
826 PlotFolder(*_summaryPlotsHp, loopSubFolders=
False, onlyForPileup=onlyForPileup,
828 section=name+
"_highPurity" if name !=
"" else "highPurity"),
829 fallbackNames=[summaryName])
832 PlotFolder(*_summaryPlotsSeeds, loopSubFolders=
False, onlyForPileup=onlyForPileup,
834 section=name+
"_seeds"))
837 plotter.appendTable(summaryName+
"_highPurity",
_trackingFolders(lastDirName),
TrackingSummaryTable(section=name+
"_highPurity" if name !=
"" else "highPurity", highPurity=
True))
840 _appendTrackingPlots(
"TrackFromPV",
"fromPV", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
841 _appendTrackingPlots(
"TrackFromPVAllTP",
"fromPVAllTP", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
842 _appendTrackingPlots(
"TrackFromPVAllTP2",
"fromPVAllTP2", _simBasedPlots+_recoBasedPlots, onlyForPileup=
True)
845 _appendTrackingPlots(
"TrackConversion",
"conversion", _simBasedPlots+_recoBasedPlots, rawSummary=
True)
849 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
851 plotter.append(
"packedCandidateLostTracks",
_trackingFolders(
"PackedCandidate/lostTracks"),
852 PlotFolder(*_packedCandidatePlots, loopSubFolders=
False,
857 def __init__(self, name, clusterMasking=None, seeding=None, building=None, fit=None, selection=None, other=[]):
860 def _set(param, name, modules):
861 if param
is not None:
862 setattr(self, name, param)
864 setattr(self, name, modules)
866 _set(clusterMasking,
"_clusterMasking", [self.
_name+
"Clusters"])
867 _set(seeding,
"_seeding", [self.
_name+
"SeedingLayers", self.
_name+
"Seeds"])
868 _set(building,
"_building", [self.
_name+
"TrackCandidates"])
870 _set(selection,
"_selection", [self.
_name])
877 return self._clusterMasking+self._seeding+self._building+self._fit+self._selection+self.
_other
880 return self._clusterMasking
886 return self._building
892 return self._selection
903 (
"Other", self.
other())]
907 Iteration(
"initialStepPreSplitting", clusterMasking=[],
908 seeding=[
"initialStepSeedLayersPreSplitting",
909 "initialStepSeedsPreSplitting"],
910 building=[
"initialStepTrackCandidatesPreSplitting"],
911 fit=[
"initialStepTracksPreSplitting"],
912 other=[
"firstStepPrimaryVerticesPreSplitting",
913 "initialStepTrackRefsForJetsPreSplitting",
914 "caloTowerForTrkPreSplitting",
915 "ak4CaloJetsForTrkPreSplitting",
916 "jetsForCoreTrackingPreSplitting",
919 "MeasurementTrackerEvent",
920 "siPixelClusterShapeCache"]),
921 Iteration(
"initialStep", clusterMasking=[],
922 selection=[
"initialStepClassifier1",
923 "initialStepClassifier2",
924 "initialStepClassifier3",
926 other=[
"firstStepPrimaryVertices"]),
928 selection=[
"highPtTripletStepClassifier1",
929 "highPtTripletStepClassifier2",
930 "highPtTripletStepClassifier3",
931 "highPtTripletStep"]),
933 selection=[
"detachedQuadStepClassifier1",
934 "detachedQuadStepClassifier2",
935 "detachedQuadStep"]),
937 selection=[
"detachedTripletStepClassifier1",
938 "detachedTripletStepClassifier2",
939 "detachedTripletStep"]),
944 seeding=[
"mixedTripletStepSeedLayersA",
945 "mixedTripletStepSeedLayersB",
946 "mixedTripletStepSeedsA",
947 "mixedTripletStepSeedsB",
948 "mixedTripletStepSeeds"],
949 selection=[
"mixedTripletStepClassifier1",
950 "mixedTripletStepClassifier2",
951 "mixedTripletStep"]),
953 selection=[
"pixelLessStepClassifier1",
954 "pixelLessStepClassifier2",
957 seeding=[
"tobTecStepSeedLayersTripl",
958 "tobTecStepSeedLayersPair",
959 "tobTecStepSeedsTripl",
960 "tobTecStepSeedsPair",
962 selection=[
"tobTecStepClassifier1",
963 "tobTecStepClassifier2",
967 other=[
"initialStepTrackRefsForJets",
969 "jetsForCoreTracking",
970 "firstStepGoodPrimaryVertices",
974 seeding=[
"muonSeededSeedsInOut",
975 "muonSeededSeedsOutIn"],
976 building=[
"muonSeededTrackCandidatesInOut",
977 "muonSeededTrackCandidatesOutIn"],
978 fit=[
"muonSeededTracksInOut",
979 "muonSeededTracksOutIn"],
980 selection=[
"muonSeededTracksInOutClassifier",
981 "muonSeededTracksOutIntClassifier"],
985 clusterMasking=[], seeding=[],
986 building=[
"duplicateTrackCandidates"],
987 fit=[
"mergedDuplicateTracks"],
988 selection=[
"duplicateTrackClassifier"]),
990 clusterMasking=[], seeding=[], building=[], fit=[], selection=[],
991 other=[
"preDuplicateMergingGeneralTracks",
994 clusterMasking=[
"convClusters"],
995 seeding=[
"convLayerPairs",
996 "photonConvTrajSeedFromSingleLeg"],
997 building=[
"convTrackCandidates"],
998 fit=[
"convStepTracks"],
999 selection=[
"convStepSelector"]),
1003 iterations = _iterations
1004 if not includeConvStep:
1005 iterations =
filter(
lambda i: i.name() !=
"ConvStep", iterations)
1007 iterations =
filter(
lambda i: i.name() ==
"ConvStep", iterations)
1008 return collections.OrderedDict([(i.name(), i.all())
for i
in iterations])
1012 for i
in _iterations:
1013 if i.name() ==
"ConvStep":
1015 ret.extend(getattr(i, prop)())
1018 return collections.OrderedDict([
1019 (
"ClusterMask", getProp(
"clusterMasking")),
1020 (
"Seeding", getProp(
"seeding")),
1021 (
"Building", getProp(
"building")),
1022 (
"Fitting", getProp(
"fit")),
1023 (
"Selection", getProp(
"selection")),
1024 (
"Other", getProp(
"other"))
1043 h = tdirectory.Get(
"reconstruction_step_module_average")
1046 totalReco =
"%.1f" % h.Integral()
1048 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(includeConvStep=
False), ignoreMissingBins=
True)
1049 h = creator.create(tdirectory)
1050 totalTracking =
None
1052 totalTracking =
"%.1f" % h.Integral()
1054 creator =
AggregateBins(
"iteration",
"reconstruction_step_module_average",
_iterModuleMap(onlyConvStep=
True), ignoreMissingBins=
True)
1055 h = creator.create(tdirectory)
1056 totalConvStep =
None
1058 totalConvStep =
"%.1f" % h.Integral()
1068 "Average reco time / event (ms)",
1069 "Average tracking (w/o convStep) time / event (ms)",
1070 "Average convStep time / event (ms)",
1075 "xbinlabelsize": 10,
1076 "xbinlabeloption":
"d"
1080 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", legendDx=-0.4, **_common),
1082 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1085 ytitle=
"Average processing time (ms)", title=
"Average processing time / event", **_common),
1087 ytitle=
"Fraction", title=
"", normalizeToUnitArea=
True, **_common),
1092 legendDy=_legendDy_2rows
1095 Plot(
AggregateBins(i.name(),
"reconstruction_step_module_average", collections.OrderedDict(i.modules()), ignoreMissingBins=
True),
1096 ytitle=
"Average processing time (ms)", title=i.name(), **_common)
1097 for i
in _iterations
1102 Plot(
AggregateBins(
"pixel",
"reconstruction_step_module_average", {
"pixelTracks": [
"pixelTracks"]}), ytitle=
"Average processing time [ms]", title=
"Average processing time / event", drawStyle=
"HIST")
1106 "DQMData/Run 1/DQM/Run summary/TimerService/Paths",
1107 "DQMData/Run 1/DQM/Run summary/TimerService/process RECO/Paths",
1110 timePlotter.append(
"timing", _timeFolders,
PlotFolder(
1118 _common = {
"stat":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist"}
1120 Plot(
"TPlip", xtitle=
"TP lip", **_common),
1121 Plot(
"TPtip", xtitle=
"TP tip", **_common),
1125 tpPlotter.append(
"tp", [
1126 "DQMData/Run 1/Tracking/Run summary/TrackingMCTruth/TrackingParticle",
1127 "DQMData/Tracking/TrackingMCTruth/TrackingParticle",
def _trackingSubFoldersFallbackSLHC
def _trackingRefFileFallbackSLHC
def _mapCollectionToAlgoQuality