1 from builtins
import range
4 from Validation.RecoTrack.plotting.plotting
import Plot, PlotGroup, PlotFolder, Plotter
5 import Validation.RecoTrack.plotting.validation
as validation
6 from Validation.RecoTrack.plotting.html
import PlotPurpose
7 from Validation.RecoTrack.plotting.trackingPlots
import _legendDy_1row, _legendDy_2rows, _legendDy_2rows_3cols, _legendDy_4rows, _minMaxResidual
9 _minPU = [0, 10, 20, 40, 80, 120]
10 _maxPU = [60, 80, 100, 150, 200, 250]
11 _minVtx = [0, 80, 120]
12 _maxVtx = [60, 100, 150, 200, 250]
14 _maxFake = [0.05, 0.1, 0.2, 0.5, 0.7, 1.025]
15 _minMaxRes = [0.1, 0.5, 1, 5, 10, 50, 100, 200, 500, 1000, 2000, 5000]
17 _minMaxPt = [5e-1, 1, 5, 1e1, 5e1, 1e2, 5e2, 1e3, 5e3, 1e4]
18 _minPull = [0, 0.5, 0.8, 0.9]
19 _maxPull = [1.1, 1.2, 1.5, 2]
20 _minVertexZ = list(
range(-60,-10,10))
21 _maxVertexZ = list(
range(20,70,10))
23 _vertexNumberOfEventsHistogram =
"DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV/GenPV_Z" 25 _common = {
"xtitle":
"Simulated interactions",
"xmin": _minPU,
"xmax": _maxPU,
"ymin": _minVtx,
"ymax": _maxVtx}
26 _recovsgen = PlotGroup(
"recovsgen", [
27 Plot(
"RecoVtx_vs_GenVtx", ytitle=
"Reco vertices", **_common),
28 Plot(
"MatchedRecoVtx_vs_GenVtx", ytitle=
"Matched reco vertices", **_common),
29 Plot(
"merged_vs_ClosestVertexInZ", xtitle=
"Closest distance in Z (cm)", ytitle=
"Merge rate", xlog=
True, xmin=1e-3, ymax=_maxFake),
30 Plot(
"merged_vs_Z", xtitle=
"Z (cm)", ytitle=
"Merge rate", xmin=-20, xmax=20, ymax=_maxFake),
32 legendDy=_legendDy_2rows, onlyForPileup=
True,
34 _pvtagging = PlotGroup(
"pvtagging", [
35 Plot(
"TruePVLocationIndexCumulative", xtitle=
"Signal PV status in reco collection", ytitle=
"Fraction of events", drawStyle=
"hist", normalizeToUnitArea=
True, xbinlabels=[
"Not reconstructed",
"Reco and identified",
"Reco, not identified"], xbinlabelsize=15, xbinlabeloption=
"h", xgrid=
False, ylog=
True, ymin=1e-3, ratioCoverageXrange=[-0.5, 0.5]),
36 Plot(
"TruePVLocationIndex", xtitle=
"Index of signal PV in reco collection", ytitle=
"Fraction of events", drawStyle=
"hist", normalizeToUnitArea=
True, ylog=
True, ymin=1e-5),
37 Plot(
"MisTagRate_vs_PU", xtitle=
"Number of simulated interactions", ytitle=
"Mistag rate", title=
"", xmax=_maxPU, ymax=_maxFake),
38 Plot(
"MisTagRate_vs_sum-pt2", xtitle=
"#Sigmap_{T}^{2} (GeV^{2})", ytitle=
"Mistag rate", title=
"", xlog=
True, ymax=_maxFake),
40 legendDy=_legendDy_2rows
42 _effandfake = PlotGroup(
"effandfake", [
43 Plot(
"effic_vs_NumVertices", xtitle=
"Number of simulated interactions", ytitle=
"Efficiency", xmin=_minPU, xmax=_maxPU, ymax=_maxEff),
44 Plot(
"fakerate_vs_PU", xtitle=
"Number of simulated interactions", ytitle=
"Fake rate", xmin=_minPU, xmax=_maxPU, ymax=_maxFake),
45 Plot(
"effic_vs_NumTracks", xtitle=
"Tracks", ytitle=
"Efficiency", title=
"", ymax=_maxEff),
46 Plot(
"fakerate_vs_NumTracks", xtitle=
"Tracks", ytitle=
"Fake rate", title=
"", ymax=_maxFake),
47 Plot(
"effic_vs_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Efficiency", xlog=
True, ymax=_maxEff),
48 Plot(
"fakerate_vs_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Fake rate", xlog=
True, ymax=_maxFake),
50 _common = {
"title":
"",
"stat":
True,
"fit":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist",
"drawCommand":
"",
"ylog":
True,
"ymin": [5e-7, 5e-6, 5e-5, 5e-4]}
51 _resolution = PlotGroup(
"resolution", [
52 Plot(
"RecoPVAssoc2GenPVMatched_ResolX", xtitle=
"Resolution in x (#mum) for PV", **_common),
53 Plot(
"RecoAllAssoc2GenMatched_ResolX", xtitle=
"Resolution in x (#mum)", **_common),
54 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX", xtitle=
"Resolution in x for merged vertices (#mum)", **_common),
56 Plot(
"RecoPVAssoc2GenPVMatched_ResolY", xtitle=
"Resolution in y (#mum)", **_common),
57 Plot(
"RecoAllAssoc2GenMatched_ResolY", xtitle=
"Resolution in y (#mum)", **_common),
58 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY", xtitle=
"Resolution in y for merged vertices (#mum)", **_common),
60 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ", xtitle=
"Resolution in z (#mum)", **_common),
61 Plot(
"RecoAllAssoc2GenMatched_ResolZ", xtitle=
"Resolution in z (#mum)", **_common),
62 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ", xtitle=
"Resolution in z for merged vertices (#mum)", **_common),
64 _commonNumTracks = dict(title=
"", xtitle=
"Number of tracks", scale=1e4, ylog=
True, ymin=_minMaxRes , ymax=_minMaxRes)
65 _resolutionNumTracks = PlotGroup(
"resolutionNumTracks", [
66 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta x) (#mum) for PV", **_commonNumTracks),
67 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta x) (#mum)", **_commonNumTracks),
68 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta x) x for merged vertices (#mum)", **_commonNumTracks),
70 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta y) (#mum) for PV", **_commonNumTracks),
71 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta y) (#mum)", **_commonNumTracks),
72 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta y) for merged vertices (#mum)", **_commonNumTracks),
74 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta z) (#mum) for PV", **_commonNumTracks),
75 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta z) (#mum)", **_commonNumTracks),
76 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta z) for merged vertices (#mum)", **_commonNumTracks),
78 _commonPt = copy.copy(_commonNumTracks)
79 _commonPt.update(dict(xtitle=
"#sum^{}p_{T} (GeV)", xlog=
True, xmin=_minMaxPt, xmax=_minMaxPt))
80 _resolutionPt = PlotGroup(
"resolutionPt", [
81 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Pt_Sigma", ytitle=
"#sigma(#delta x) (#mum) for PV", **_commonPt),
82 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Pt_Sigma", ytitle=
"#sigma(#delta x) (#mum)", **_commonPt),
83 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Pt_Sigma", ytitle=
"#sigma(#delta x) for merged vertices (#mum)", **_commonPt),
85 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Pt_Sigma", ytitle=
"#sigma(#delta y) (#mum) for PV", **_commonPt),
86 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Pt_Sigma", ytitle=
"#sigma(#delta y) (#mum)", **_commonPt),
87 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Pt_Sigma", ytitle=
"#sigma(#delta y) for merged vertices (#mum)", **_commonPt),
89 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Pt_Sigma", ytitle=
"#sigma(#delta z) (#mum) for PV", **_commonPt),
90 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Pt_Sigma", ytitle=
"#sigma(#delta z) (#mum)", **_commonPt),
91 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Pt_Sigma", ytitle=
"#sigma(#delta z) for merged vertices (#mum)", **_commonPt),
93 _common = {
"stat":
True,
"fit":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist",
"drawCommand":
"",
"xmin": -6,
"xmax": 6,
"ylog":
True,
"ymin": 5e-5,
"ymax": [0.01, 0.05, 0.1, 0.2, 0.5, 0.8, 1.025]}
94 _pull = PlotGroup(
"pull", [
95 Plot(
"RecoPVAssoc2GenPVMatched_PullX", xtitle=
"x", ytitle=
"Pull of x for PV", **_common),
96 Plot(
"RecoAllAssoc2GenMatched_PullX", xtitle=
"x", ytitle=
"Pull of x", **_common),
97 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX", xtitle=
"x", ytitle=
"Pull of x for merged vertices", **_common),
99 Plot(
"RecoPVAssoc2GenPVMatched_PullY", xtitle=
"y", ytitle=
"Pull of y for PV", **_common),
100 Plot(
"RecoAllAssoc2GenMatched_PullY", xtitle=
"y", ytitle=
"Pull of y", **_common),
101 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY", xtitle=
"y", ytitle=
"Pull of y for merged vertices", **_common),
103 Plot(
"RecoPVAssoc2GenPVMatched_PullZ", xtitle=
"z", ytitle=
"Pull of z for PV", **_common),
104 Plot(
"RecoAllAssoc2GenMatched_PullZ", xtitle=
"z", ytitle=
"Pull of z", **_common),
105 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ", xtitle=
"z", ytitle=
"Pull of z for merged vertices", **_common),
107 _commonNumTracks.update(dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
108 _pullNumTracks = PlotGroup(
"pullNumTracks", [
109 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x for PV", **_commonNumTracks),
110 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x", **_commonNumTracks),
111 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x for merged vertices", **_commonNumTracks),
113 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y for PV", **_commonNumTracks),
114 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y", **_commonNumTracks),
115 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y for merged vertices", **_commonNumTracks),
117 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z for PV", **_commonNumTracks),
118 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z", **_commonNumTracks),
119 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z for merged vertices", **_commonNumTracks),
121 _commonPt.update(dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
122 _pullPt = PlotGroup(
"pullPt", [
123 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_Pt_Sigma", ytitle=
"Pull of x for PV", **_commonPt),
124 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_Pt_Sigma", ytitle=
"Pull of x", **_commonPt),
125 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_Pt_Sigma", ytitle=
"Pull of x for merged vertices", **_commonPt),
127 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_Pt_Sigma", ytitle=
"Pull of y for PV", **_commonPt),
128 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_Pt_Sigma", ytitle=
"Pull of y", **_commonPt),
129 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_Pt_Sigma", ytitle=
"Pull of y for merged vertices", **_commonPt),
131 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z for PV", **_commonPt),
132 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z", **_commonPt),
133 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z for merged vertices", **_commonPt),
136 _common={
"drawStyle":
"HIST",
"normalizeToUnitArea":
True}
137 _puritymissing = PlotGroup(
"puritymissing", [
138 Plot(
"RecoPVAssoc2GenPVMatched_Purity", xtitle=
"Purity", ytitle=
"Number of reco PVs matched to gen PVs", ylog=
True, ymin=1e-4, **_common),
139 Plot(
"RecoPVAssoc2GenPVNotMatched_Purity", xtitle=
"Purity", ytitle=
"Number of reco PVs not matcched to gen PVs", ylog=
True, ymin=1e-3, **_common),
140 Plot(
"RecoPVAssoc2GenPVMatched_Missing", xtitle=
"Fraction of reco p_{T} associated to gen PV \"missing\" from reco PV", ytitle=
"Number of reco PVs matched to gen PVs", ylog=
True, ymin=1e-4, **_common),
141 Plot(
"RecoPVAssoc2GenPVNotMatched_Missing", xtitle=
"Fraction of reco p_{T} associated to gen PV \"missing\" from reco PV", ytitle=
"Number of reco PVs not matcched to gen PVs", ylog=
True, ymin=1e-3, **_common),
145 _common={
"drawStyle":
"HIST",
"xlog":
True,
"ylog":
True,
"ymin": 0.5}
146 _sumpt2 = PlotGroup(
"sumpt2", [
147 Plot(
"RecoAssoc2GenPVMatched_Pt2", xtitle=
"#sum^{}p_{T}^{2} (GeV^{2})", ytitle=
"Reco vertices matched to gen PV", **_common),
148 Plot(
"RecoAssoc2GenPVMatchedNotHighest_Pt2", xtitle=
"#sum^{}p_{T}^{2} (GeV^{2})", ytitle=
"Reco non-PV-vertices matched to gen PV", **_common),
149 Plot(
"RecoAssoc2GenPVNotMatched_Pt2", xtitle=
"#sum^{}p_{T}^{2} (GeV^{2})", ytitle=
"Reco vertices not matched to gen PV", **_common),
150 Plot(
"RecoAssoc2GenPVNotMatched_GenPVTracksRemoved_Pt2", xtitle=
"#sum^{}p_{T}^{2} (GeV^{2}), gen PV tracks removed", ytitle=
"Reco vertices not matched to gen PV", **_common),
152 legendDy=_legendDy_2rows, onlyForPileup=
True,
155 _k0_effandfake = PlotGroup(
"effandfake", [
156 Plot(
"K0sEffVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Efficiency vs. p_{T}"),
157 Plot(
"K0sFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
158 Plot(
"K0sEffVsEta", xtitle=
"#eta", ytitle=
"Efficiency vs. #eta"),
159 Plot(
"K0sFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
160 Plot(
"K0sEffVsR", xtitle=
"R (cm)", ytitle=
"Efficiency vs. R"),
161 Plot(
"K0sFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
163 _k0_effandfakeTk = PlotGroup(
"effandfakeTk", [
165 Plot(
"K0sTkFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
167 Plot(
"K0sTkFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
169 Plot(
"K0sTkFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
171 legendDy=_legendDy_2rows
173 _common = dict(normalizeToUnitArea=
True, drawStyle=
"HIST", stat=
True)
174 _k0_mass = PlotGroup(
"mass", [
175 Plot(
"ksMassAll", xtitle=
"mass of all (GeV)", **_common),
176 Plot(
"ksMassGood", xtitle=
"mass of good (GeV)", **_common),
177 Plot(
"ksMassFake", xtitle=
"mass of fake (GeV)", **_common),
179 legendDy=_legendDy_2rows
181 _lambda_effandfake = PlotGroup(
"effandfake", [
182 Plot(
"LamEffVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Efficiency vs. p_{T}"),
183 Plot(
"LamFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
184 Plot(
"LamEffVsEta", xtitle=
"#eta", ytitle=
"Efficiency vs. #eta"),
185 Plot(
"LamFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
186 Plot(
"LamEffVsR", xtitle=
"R (cm)", ytitle=
"Efficiency vs. R"),
187 Plot(
"LamFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
189 _lambda_effandfakeTk = PlotGroup(
"effandfakeTk", [
191 Plot(
"LamTkFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
193 Plot(
"LamTkFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
195 Plot(
"LamTkFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
197 legendDy=_legendDy_2rows
199 _lambda_mass = PlotGroup(
"mass", [
200 Plot(
"lamMassAll", xtitle=
"mass of all (GeV)", **_common),
201 Plot(
"lamMassGood", xtitle=
"mass of good (GeV)", **_common),
202 Plot(
"lamMassFake", xtitle=
"mass of fake (GeV)", **_common),
204 legendDy=_legendDy_2rows
208 _common = dict(drawStyle =
"HIST", stat=
True)
209 _commonXY = dict(xmin=[x*0.1
for x
in range(-6, 6, 1)], xmax=[x*0.1
for x
in range(-5, 7, 1)])
210 _commonZ = dict(xmin=[-60,-30], xmax=[30,60])
211 _commonXY.update(_common)
212 _commonZ.update(_common)
213 _extGenpos = PlotGroup(
"genpos", [
214 Plot(
"GenAllV_X", xtitle=
"Gen AllV pos x (cm)", ytitle=
"N", **_commonXY),
215 Plot(
"GenPV_X", xtitle=
"Gen PV pos x (cm)", ytitle=
"N", **_commonXY),
216 Plot(
"GenAllV_Y", xtitle=
"Gen AllV pos y (cm)", ytitle=
"N", **_commonXY),
217 Plot(
"GenPV_Y", xtitle=
"Gen PV pos y (cm)", ytitle=
"N", **_commonXY),
218 Plot(
"GenAllV_Z", xtitle=
"Gen AllV pos z (cm)", ytitle=
"N", **_commonZ),
219 Plot(
"GenPV_Z", xtitle=
"Gen PV pos z (cm)", ytitle=
"N", **_commonZ),
221 _extDist = PlotGroup(
"dist", [
222 Plot(
"RecoAllAssoc2Gen_X", xtitle=
"Reco vertex pos x (cm)", ytitle=
"N", **_commonXY),
223 Plot(
"RecoAllAssoc2Gen_Y", xtitle=
"Reco vertex pos y (cm)", ytitle=
"N", **_commonXY),
224 Plot(
"RecoAllAssoc2Gen_R", xtitle=
"Reco vertex pos r (cm)", ytitle=
"N", **_commonXY),
225 Plot(
"RecoAllAssoc2Gen_Z", xtitle=
"Reco vertex pos z (cm)", ytitle=
"N", **_commonZ),
226 Plot(
"RecoAllAssoc2Gen_NumVertices", xtitle=
"Number of reco vertices", ytitle=
"A.u.", normalizeToUnitArea=
True, stat=
True, drawStyle=
"hist", min=_minVtx, xmax=_maxVtx),
227 Plot(
"RecoAllAssoc2Gen_NumTracks", xtitle=
"Number of tracks in vertex fit", ytitle=
"N", stat=
True, drawStyle=
"hist"),
229 _commonZ = dict(title=
"", xtitle=
"Vertex z (cm)", scale=1e4, ylog=
True, ymin=_minMaxRes , ymax=_minMaxRes, xmin=_minVertexZ, xmax=_maxVertexZ)
230 _extResolutionZ = PlotGroup(
"resolutionZ", [
231 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Z_Sigma", ytitle=
"#sigma(#delta x) (#mum) for PV", **_commonZ),
232 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Z_Sigma", ytitle=
"#sigma(#delta x) (#mum)", **_commonZ),
233 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Z_Sigma", ytitle=
"#sigma(#delta x) for merged vertices (#mum)", **_commonZ),
235 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Z_Sigma", ytitle=
"#sigma(#delta y) (#mum) for PV", **_commonZ),
236 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Z_Sigma", ytitle=
"#sigma(#delta y) (#mum)", **_commonZ),
237 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Z_Sigma", ytitle=
"#sigma(#delta y) for merged vertices (#mum)", **_commonZ),
239 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Z_Sigma", ytitle=
"#sigma(#delta z) (#mum) for PV", **_commonZ),
240 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Z_Sigma", ytitle=
"#sigma(#delta z) (#mum)", **_commonZ),
241 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Z_Sigma", ytitle=
"#sigma(#delta z) for merged vertices (#mum)", **_commonZ),
243 _commonPU = copy.copy(_commonZ)
244 _commonPU.update(dict(xtitle=
"Simulated interactions", xmin=_minPU, xmax=_maxPU))
245 _extResolutionPU = PlotGroup(
"resolutionPU", [
246 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x (#mum) for PV", **_commonPU),
247 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x (#mum)", **_commonPU),
248 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x for merged vertices (#mum)", **_commonPU),
250 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y (#mum) for PV", **_commonPU),
251 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y (#mum)", **_commonPU),
252 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y for merged vertices (#mum)", **_commonPU),
254 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z (#mum) for PV", **_commonPU),
255 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z (#mum)", **_commonPU),
256 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z for merged vertices (#mum)", **_commonPU),
258 _commonZ.update(dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
259 _extPullZ = PlotGroup(
"pullZ", [
260 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_Z_Sigma", ytitle=
"Pull of x for PV", **_commonZ),
261 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_Z_Sigma", ytitle=
"Pull of x", **_commonZ),
262 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_Z_Sigma", ytitle=
"Pull of x for merged vertices", **_commonZ),
264 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_Z_Sigma", ytitle=
"Pull of y for PV", **_commonZ),
265 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_Z_Sigma", ytitle=
"Pull of y", **_commonZ),
266 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_Z_Sigma", ytitle=
"Pull of y for merged vertices", **_commonZ),
268 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_Z_Sigma", ytitle=
"Pull of z for PV", **_commonZ),
269 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_Z_Sigma", ytitle=
"Pull of z", **_commonZ),
270 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_Z_Sigma", ytitle=
"Pull of z for merged vertices", **_commonZ),
272 _commonPU.update(dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
273 _extPullPU = PlotGroup(
"pullPU", [
274 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_PU_Sigma", ytitle=
"Pull of x for PV", **_commonPU),
275 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_PU_Sigma", ytitle=
"Pull of x", **_commonPU),
276 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_PU_Sigma", ytitle=
"Pull of x for merged vertices", **_commonPU),
278 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_PU_Sigma", ytitle=
"Pull of y for PV", **_commonPU),
279 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_PU_Sigma", ytitle=
"Pull of y", **_commonPU),
280 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_PU_Sigma", ytitle=
"Pull of y for merged vertices", **_commonPU),
282 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_PU_Sigma", ytitle=
"Pull of z for PV", **_commonPU),
283 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_PU_Sigma", ytitle=
"Pull of z", **_commonPU),
284 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_PU_Sigma", ytitle=
"Pull of z for merged vertices", **_commonPU),
286 _commonNumTracks.update(dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
287 _extResidualNumTracks = PlotGroup(
"residualNumTracks", [
288 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_NumTracks_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonNumTracks),
289 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_NumTracks_Mean", ytitle=
"< #delta x > (#mum)", **_commonNumTracks),
290 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_NumTracks_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonNumTracks),
292 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_NumTracks_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonNumTracks),
293 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_NumTracks_Mean", ytitle=
"< #delta y > (#mum)", **_commonNumTracks),
294 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_NumTracks_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonNumTracks),
296 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_NumTracks_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonNumTracks),
297 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_NumTracks_Mean", ytitle=
"< #delta z > (#mum)", **_commonNumTracks),
298 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_NumTracks_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonNumTracks),
300 _commonPt.update(dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
301 _extResidualPt = PlotGroup(
"residualPt", [
302 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Pt_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonPt),
303 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Pt_Mean", ytitle=
"< #delta x > (#mum)", **_commonPt),
304 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Pt_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonPt),
306 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Pt_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonPt),
307 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Pt_Mean", ytitle=
"< #delta y > (#mum)", **_commonPt),
308 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Pt_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonPt),
310 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Pt_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonPt),
311 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Pt_Mean", ytitle=
"< #delta z > (#mum)", **_commonPt),
312 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Pt_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonPt),
314 _commonZ.update(dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
315 _extResidualZ = PlotGroup(
"residualZ", [
316 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Z_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonZ),
317 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Z_Mean", ytitle=
"< #delta x > (#mum)", **_commonZ),
318 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Z_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonZ),
320 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Z_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonZ),
321 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Z_Mean", ytitle=
"< #delta y > (#mum)", **_commonZ),
322 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Z_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonZ),
324 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Z_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonZ),
325 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Z_Mean", ytitle=
"< #delta z > (#mum)", **_commonZ),
326 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Z_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonZ),
328 _commonPU.update(dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
329 _extResidualPU = PlotGroup(
"residualPU", [
330 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_PU_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonPU),
331 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_PU_Mean", ytitle=
"< #delta x > (#mum)", **_commonPU),
332 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_PU_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonPU),
334 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_PU_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonPU),
335 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_PU_Mean", ytitle=
"< #delta y > (#mum)", **_commonPU),
336 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_PU_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonPU),
338 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_PU_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonPU),
339 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_PU_Mean", ytitle=
"< #delta z > (#mum)", **_commonPU),
340 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_PU_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonPU),
342 _extDqm = PlotGroup(
"dqm", [
343 Plot(
"tagVtxTrksVsZ", xtitle=
"z_{vertex} - z_{beamspot} (cm)", ytitle=
"Tracks / selected PV"),
344 Plot(
"otherVtxTrksVsZ", xtitle=
"z_{vertex} - z_{beamspot} (cm)", ytitle=
"Tracks / pileup vertex"),
345 Plot(
"vtxNbr", xtitle=
"Reconstructed vertices", ytitle=
"Events", stat=
True, drawStyle=
"hist", xmin=_minVtx, xmax=_maxVtx),
347 _common = dict(ytitle=
"Vertices", stat=
True)
348 _extDqmDiff = PlotGroup(
"dqmDiff", [
349 Plot(
"tagDiffX", xtitle=
"PV x_{vertex} - x_{beamspot} (#mum)", **_common),
350 Plot(
"otherDiffX", xtitle=
"Pileup vertex x_{vertex} - x_{beamspot} (#mum)", **_common),
352 Plot(
"tagDiffY", xtitle=
"PV y_{vertex} - y_{beamspot} (#mum)", **_common),
353 Plot(
"otherDiffY", xtitle=
"Pileup vertex y_{vertex} - y_{beamspot} (#mum)", **_common),
355 _extDqmErr = PlotGroup(
"dqmErr", [
356 Plot(
"tagErrX", xtitle=
"PV uncertainty in x (um)", **_common),
357 Plot(
"otherErrX", xtitle=
"Pileup vertex uncertainty in x (um)", **_common),
359 Plot(
"otherErrY", xtitle=
"Pileup vertex uncertainty in y (um)", **_common),
360 Plot(
"tagErrY", xtitle=
"PV uncertainty in y (um)", **_common),
362 Plot(
"otherErrZ", xtitle=
"Pileup vertex uncertainty in z (um)", **_common),
363 Plot(
"tagErrZ", xtitle=
"PV uncertainty in z (um)", **_common),
381 def _formatOrNone(num, func):
387 h = tdirectory.Get(
"TruePVLocationIndexCumulative")
389 n_events = h.GetEntries()
390 n_pvtagged = h.GetBinContent(2)
391 ret.extend([
int(n_events),
"%.4f"%(
float(n_pvtagged)/
float(n_events))])
393 ret.extend([
None,
None])
395 h = tdirectory.Get(
"globalEfficiencies")
398 for i
in range(1, h.GetNbinsX()+1):
399 d[h.GetXaxis().GetBinLabel(i)] = h.GetBinContent(i)
401 _formatOrNone(d.get(
"effic_vs_Z",
None),
lambda n:
"%.4f"%n),
402 _formatOrNone(d.get(
"fakerate_vs_Z",
None),
lambda n:
"%.4f"%n),
403 _formatOrNone(d.get(
"merged_vs_Z",
None),
lambda n:
"%.4f"%n),
404 _formatOrNone(d.get(
"duplicate_vs_Z",
None),
lambda n:
"%.4f"%n),
409 if ret.count(
None) == len(ret):
417 "PV reco+tag efficiency",
425 "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
426 "DQMData/Vertexing/PrimaryVertex",
427 "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
428 "DQMData/Vertexing/PrimaryVertexV",
430 _vertexDqmFolders = [
431 "DQMData/Run 1/OfflinePV/Run summary/offlinePrimaryVertices",
432 "DQMData/OffinePV/offlinePrimaryVertices",
435 "DQMData/Run 1/Vertexing/Run summary/V0",
436 "DQMData/Vertexing/V0",
437 "DQMData/Run 1/Vertexing/Run summary/V0V",
438 "DQMData/Vertexing/V0V",
441 plotterExt = Plotter()
442 plotter.append(
"", _vertexFolders, PlotFolder(
447 _resolutionNumTracks,
454 purpose=PlotPurpose.Vertexing,
458 plotter.append(
"K0", [x+
"/K0" for x
in _v0Folders], PlotFolder(
462 loopSubFolders=
False,
463 purpose=PlotPurpose.Vertexing,
464 page=
"v0", section=
"k0" 466 plotter.append(
"Lambda", [x+
"/Lambda" for x
in _v0Folders], PlotFolder(
468 _lambda_effandfakeTk,
470 loopSubFolders=
False,
471 purpose=PlotPurpose.Vertexing,
472 page=
"v0", section=
"lambda" 474 plotterExt.append(
"", _vertexFolders, PlotFolder(
480 _extResidualNumTracks,
484 purpose=PlotPurpose.Vertexing,
487 numberOfEventsHistogram=_vertexNumberOfEventsHistogram
489 plotterExt.append(
"dqm", _vertexDqmFolders, PlotFolder(
493 loopSubFolders=
False,
494 purpose=PlotPurpose.Vertexing,
496 section=
"offlinePrimaryVertices",
499 plotterExt.append(
"gen", _vertexFolders, PlotFolder(
501 loopSubFolders=
False,
502 purpose=PlotPurpose.Vertexing,
510 super(TrackingValidation, self).
__init__(*args, **kwargs)
def getSection(self, dqmSubFolder)
def __init__(self, fullsimSamples, fastsimSamples, refRelease, refRepository, newRelease, newRepository, newFileModifier=None, selectionName="")
def _getSelectionName(self, quality, algo)
def _getDirectoryName(self, quality, algo)
def __init__(self, page="vertex")
def _init__(self, args, kwargs)
def create(self, tdirectory)