3 from Validation.RecoTrack.plotting.plotting
import Plot, PlotGroup, PlotFolder, Plotter
4 import Validation.RecoTrack.plotting.validation
as validation
5 from Validation.RecoTrack.plotting.html
import PlotPurpose
6 from Validation.RecoTrack.plotting.trackingPlots
import _legendDy_1row, _legendDy_2rows, _legendDy_2rows_3cols, _legendDy_4rows, _minMaxResidual
8 _minPU = [0, 10, 20, 40, 80, 120]
9 _maxPU = [60, 80, 100, 150, 200, 250]
10 _minVtx = [0, 80, 120]
11 _maxVtx = [60, 100, 150, 200, 250]
13 _maxFake = [0.05, 0.1, 0.2, 0.5, 0.7, 1.025]
14 _minMaxRes = [0.1, 0.5, 1, 5, 10, 50, 100, 200, 500, 1000, 2000, 5000]
16 _minMaxPt = [5e-1, 1, 5, 1e1, 5e1, 1e2, 5e2, 1e3, 5e3, 1e4]
17 _minPull = [0, 0.5, 0.8, 0.9]
18 _maxPull = [1.1, 1.2, 1.5, 2]
19 _minVertexZ = range(-60,-10,10)
20 _maxVertexZ = range(20,70,10)
22 _vertexNumberOfEventsHistogram =
"DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV/GenPV_Z" 24 _common = {
"xtitle":
"Simulated interactions",
"xmin": _minPU,
"xmax": _maxPU,
"ymin": _minVtx,
"ymax": _maxVtx}
25 _recovsgen = PlotGroup(
"recovsgen", [
26 Plot(
"RecoVtx_vs_GenVtx", ytitle=
"Reco vertices", **_common),
27 Plot(
"MatchedRecoVtx_vs_GenVtx", ytitle=
"Matched reco vertices", **_common),
28 Plot(
"merged_vs_ClosestVertexInZ", xtitle=
"Closest distance in Z (cm)", ytitle=
"Merge rate", xlog=
True, xmin=1e-3, ymax=_maxFake),
29 Plot(
"merged_vs_Z", xtitle=
"Z (cm)", ytitle=
"Merge rate", xmin=-20, xmax=20, ymax=_maxFake),
31 legendDy=_legendDy_2rows, onlyForPileup=
True,
33 _pvtagging = PlotGroup(
"pvtagging", [
34 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]),
35 Plot(
"TruePVLocationIndex", xtitle=
"Index of signal PV in reco collection", ytitle=
"Fraction of events", drawStyle=
"hist", normalizeToUnitArea=
True, ylog=
True, ymin=1e-5),
36 Plot(
"MisTagRate_vs_PU", xtitle=
"PU", ytitle=
"Mistag rate vs. PU", title=
"", xmax=_maxPU, ymax=_maxFake),
37 Plot(
"MisTagRate_vs_sum-pt2", xtitle=
"#Sigmap_{T}^{2}", ytitle=
"Mistag rate vs. #Sigmap_{T}^{2}", title=
"", xlog=
True, ymax=_maxFake),
39 legendDy=_legendDy_2rows
41 _effandfake = PlotGroup(
"effandfake", [
42 Plot(
"effic_vs_NumVertices", xtitle=
"Simulated interactions", ytitle=
"Efficiency vs. N sim vertices", xmin=_minPU, xmax=_maxPU, ymax=_maxEff),
43 Plot(
"fakerate_vs_PU", xtitle=
"Simulated interactions", ytitle=
"Fake rate vs. N sim vertices", xmin=_minPU, xmax=_maxPU, ymax=_maxFake),
44 Plot(
"effic_vs_NumTracks", xtitle=
"Tracks", ytitle=
"Efficiency vs. N tracks", title=
"", ymax=_maxEff),
45 Plot(
"fakerate_vs_NumTracks", xtitle=
"Tracks", ytitle=
"Fake rate vs. N tracks", title=
"", ymax=_maxFake),
46 Plot(
"effic_vs_Pt2", xtitle=
"Sum p_{T}^{2} ", ytitle=
"Efficiency vs. sum p_{T}^{2}", xlog=
True, ymax=_maxEff),
47 Plot(
"fakerate_vs_Pt2", xtitle=
"Sum p_{T}^{2} ", ytitle=
"Fake rate vs. sum p_{T}^{2}", xlog=
True, ymax=_maxFake),
49 _common = {
"title":
"",
"stat":
True,
"fit":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist",
"drawCommand":
"",
"ylog":
True,
"ymin": [5e-7, 5e-6, 5e-5, 5e-4]}
50 _resolution = PlotGroup(
"resolution", [
51 Plot(
"RecoPVAssoc2GenPVMatched_ResolX", xtitle=
"Resolution in x (#mum) for PV", **_common),
52 Plot(
"RecoAllAssoc2GenMatched_ResolX", xtitle=
"Resolution in x (#mum)", **_common),
53 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX", xtitle=
"Resolution in x for merged vertices (#mum)", **_common),
55 Plot(
"RecoPVAssoc2GenPVMatched_ResolY", xtitle=
"Resolution in y (#mum)", **_common),
56 Plot(
"RecoAllAssoc2GenMatched_ResolY", xtitle=
"Resolution in y (#mum)", **_common),
57 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY", xtitle=
"Resolution in y for merged vertices (#mum)", **_common),
59 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ", xtitle=
"Resolution in z (#mum)", **_common),
60 Plot(
"RecoAllAssoc2GenMatched_ResolZ", xtitle=
"Resolution in z (#mum)", **_common),
61 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ", xtitle=
"Resolution in z for merged vertices (#mum)", **_common),
63 _commonNumTracks =
dict(title=
"", xtitle=
"Number of tracks", scale=1e4, ylog=
True, ymin=_minMaxRes , ymax=_minMaxRes)
64 _resolutionNumTracks = PlotGroup(
"resolutionNumTracks", [
65 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta x) (#mum) for PV", **_commonNumTracks),
66 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta x) (#mum)", **_commonNumTracks),
67 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta x) x for merged vertices (#mum)", **_commonNumTracks),
69 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta y) (#mum) for PV", **_commonNumTracks),
70 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta y) (#mum)", **_commonNumTracks),
71 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta y) for merged vertices (#mum)", **_commonNumTracks),
73 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta z) (#mum) for PV", **_commonNumTracks),
74 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta z) (#mum)", **_commonNumTracks),
75 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_NumTracks_Sigma", ytitle=
"#sigma(#delta z) for merged vertices (#mum)", **_commonNumTracks),
77 _commonPt = copy.copy(_commonNumTracks)
78 _commonPt.update(
dict(xtitle=
"Sum of track p_{T} (GeV)", xlog=
True, xmin=_minMaxPt, xmax=_minMaxPt))
79 _resolutionPt = PlotGroup(
"resolutionPt", [
80 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Pt_Sigma", ytitle=
"#sigma(#delta x) (#mum) for PV", **_commonPt),
81 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Pt_Sigma", ytitle=
"#sigma(#delta x) (#mum)", **_commonPt),
82 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Pt_Sigma", ytitle=
"#sigma(#delta x) for merged vertices (#mum)", **_commonPt),
84 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Pt_Sigma", ytitle=
"#sigma(#delta y) (#mum) for PV", **_commonPt),
85 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Pt_Sigma", ytitle=
"#sigma(#delta y) (#mum)", **_commonPt),
86 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Pt_Sigma", ytitle=
"#sigma(#delta y) for merged vertices (#mum)", **_commonPt),
88 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Pt_Sigma", ytitle=
"#sigma(#delta z) (#mum) for PV", **_commonPt),
89 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Pt_Sigma", ytitle=
"#sigma(#delta z) (#mum)", **_commonPt),
90 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Pt_Sigma", ytitle=
"#sigma(#delta z) for merged vertices (#mum)", **_commonPt),
92 _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]}
93 _pull = PlotGroup(
"pull", [
94 Plot(
"RecoPVAssoc2GenPVMatched_PullX", xtitle=
"x", ytitle=
"Pull of x for PV", **_common),
95 Plot(
"RecoAllAssoc2GenMatched_PullX", xtitle=
"x", ytitle=
"Pull of x", **_common),
96 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX", xtitle=
"x", ytitle=
"Pull of x for merged vertices", **_common),
98 Plot(
"RecoPVAssoc2GenPVMatched_PullY", xtitle=
"y", ytitle=
"Pull of y for PV", **_common),
99 Plot(
"RecoAllAssoc2GenMatched_PullY", xtitle=
"y", ytitle=
"Pull of y", **_common),
100 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY", xtitle=
"y", ytitle=
"Pull of y for merged vertices", **_common),
102 Plot(
"RecoPVAssoc2GenPVMatched_PullZ", xtitle=
"z", ytitle=
"Pull of z for PV", **_common),
103 Plot(
"RecoAllAssoc2GenMatched_PullZ", xtitle=
"z", ytitle=
"Pull of z", **_common),
104 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ", xtitle=
"z", ytitle=
"Pull of z for merged vertices", **_common),
106 _commonNumTracks.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
107 _pullNumTracks = PlotGroup(
"pullNumTracks", [
108 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x for PV", **_commonNumTracks),
109 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x", **_commonNumTracks),
110 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x for merged vertices", **_commonNumTracks),
112 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y for PV", **_commonNumTracks),
113 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y", **_commonNumTracks),
114 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y for merged vertices", **_commonNumTracks),
116 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z for PV", **_commonNumTracks),
117 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z", **_commonNumTracks),
118 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z for merged vertices", **_commonNumTracks),
120 _commonPt.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
121 _pullPt = PlotGroup(
"pullPt", [
122 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_Pt_Sigma", ytitle=
"Pull of x for PV", **_commonPt),
123 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_Pt_Sigma", ytitle=
"Pull of x", **_commonPt),
124 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_Pt_Sigma", ytitle=
"Pull of x for merged vertices", **_commonPt),
126 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_Pt_Sigma", ytitle=
"Pull of y for PV", **_commonPt),
127 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_Pt_Sigma", ytitle=
"Pull of y", **_commonPt),
128 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_Pt_Sigma", ytitle=
"Pull of y for merged vertices", **_commonPt),
130 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z for PV", **_commonPt),
131 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z", **_commonPt),
132 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z for merged vertices", **_commonPt),
135 _common={
"drawStyle":
"HIST",
"normalizeToUnitArea":
True}
136 _puritymissing = PlotGroup(
"puritymissing", [
137 Plot(
"RecoPVAssoc2GenPVMatched_Purity", xtitle=
"Purity", ytitle=
"Number of reco PVs matched to gen PVs", ylog=
True, ymin=1e-4, **_common),
138 Plot(
"RecoPVAssoc2GenPVNotMatched_Purity", xtitle=
"Purity", ytitle=
"Number of reco PVs not matcched to gen PVs", ylog=
True, ymin=1e-3, **_common),
139 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),
140 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),
144 _common={
"drawStyle":
"HIST",
"xlog":
True,
"ylog":
True,
"ymin": 0.5}
145 _sumpt2 = PlotGroup(
"sumpt2", [
146 Plot(
"RecoAssoc2GenPVMatched_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Reco vertices matched to gen PV", **_common),
147 Plot(
"RecoAssoc2GenPVMatchedNotHighest_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Reco non-PV-vertices matched to gen PV", **_common),
148 Plot(
"RecoAssoc2GenPVNotMatched_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Reco vertices not matched to gen PV", **_common),
149 Plot(
"RecoAssoc2GenPVNotMatched_GenPVTracksRemoved_Pt2", xtitle=
"#sum^{}p_{T}^{2}, gen PV tracks removed", ytitle=
"Reco vertices not matched to gen PV", **_common),
151 legendDy=_legendDy_2rows, onlyForPileup=
True,
154 _k0_effandfake = PlotGroup(
"effandfake", [
155 Plot(
"K0sEffVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Efficiency vs. p_{T}"),
156 Plot(
"K0sFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
157 Plot(
"K0sEffVsEta", xtitle=
"#eta", ytitle=
"Efficiency vs. #eta"),
158 Plot(
"K0sFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
159 Plot(
"K0sEffVsR", xtitle=
"R (cm)", ytitle=
"Efficiency vs. R"),
160 Plot(
"K0sFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
162 _k0_effandfakeTk = PlotGroup(
"effandfakeTk", [
164 Plot(
"K0sTkFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
166 Plot(
"K0sTkFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
168 Plot(
"K0sTkFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
170 legendDy=_legendDy_2rows
172 _common =
dict(normalizeToUnitArea=
True, drawStyle=
"HIST", stat=
True)
173 _k0_mass = PlotGroup(
"mass", [
174 Plot(
"ksMassAll", xtitle=
"mass of all (GeV)", **_common),
175 Plot(
"ksMassGood", xtitle=
"mass of good (GeV)", **_common),
176 Plot(
"ksMassFake", xtitle=
"mass of fake (GeV)", **_common),
178 legendDy=_legendDy_2rows
180 _lambda_effandfake = PlotGroup(
"effandfake", [
181 Plot(
"LamEffVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Efficiency vs. p_{T}"),
182 Plot(
"LamFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
183 Plot(
"LamEffVsEta", xtitle=
"#eta", ytitle=
"Efficiency vs. #eta"),
184 Plot(
"LamFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
185 Plot(
"LamEffVsR", xtitle=
"R (cm)", ytitle=
"Efficiency vs. R"),
186 Plot(
"LamFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
188 _lambda_effandfakeTk = PlotGroup(
"effandfakeTk", [
190 Plot(
"LamTkFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
192 Plot(
"LamTkFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
194 Plot(
"LamTkFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
196 legendDy=_legendDy_2rows
198 _lambda_mass = PlotGroup(
"mass", [
199 Plot(
"lamMassAll", xtitle=
"mass of all (GeV)", **_common),
200 Plot(
"lamMassGood", xtitle=
"mass of good (GeV)", **_common),
201 Plot(
"lamMassFake", xtitle=
"mass of fake (GeV)", **_common),
203 legendDy=_legendDy_2rows
207 _common =
dict(drawStyle =
"HIST", stat=
True)
208 _commonXY =
dict(xmin=[x*0.1
for x
in xrange(-6, 6, 1)], xmax=[x*0.1
for x
in xrange(-5, 7, 1)])
209 _commonZ =
dict(xmin=[-60,-30], xmax=[30,60])
210 _commonXY.update(_common)
211 _commonZ.update(_common)
212 _extGenpos = PlotGroup(
"genpos", [
213 Plot(
"GenAllV_X", xtitle=
"Gen AllV pos x (cm)", ytitle=
"N", **_commonXY),
214 Plot(
"GenPV_X", xtitle=
"Gen PV pos x (cm)", ytitle=
"N", **_commonXY),
215 Plot(
"GenAllV_Y", xtitle=
"Gen AllV pos y (cm)", ytitle=
"N", **_commonXY),
216 Plot(
"GenPV_Y", xtitle=
"Gen PV pos y (cm)", ytitle=
"N", **_commonXY),
217 Plot(
"GenAllV_Z", xtitle=
"Gen AllV pos z (cm)", ytitle=
"N", **_commonZ),
218 Plot(
"GenPV_Z", xtitle=
"Gen PV pos z (cm)", ytitle=
"N", **_commonZ),
220 _extDist = PlotGroup(
"dist", [
221 Plot(
"RecoAllAssoc2Gen_X", xtitle=
"Reco vertex pos x (cm)", ytitle=
"N", **_commonXY),
222 Plot(
"RecoAllAssoc2Gen_Y", xtitle=
"Reco vertex pos y (cm)", ytitle=
"N", **_commonXY),
223 Plot(
"RecoAllAssoc2Gen_R", xtitle=
"Reco vertex pos r (cm)", ytitle=
"N", **_commonXY),
224 Plot(
"RecoAllAssoc2Gen_Z", xtitle=
"Reco vertex pos z (cm)", ytitle=
"N", **_commonZ),
225 Plot(
"RecoAllAssoc2Gen_NumVertices", xtitle=
"Number of reco vertices", ytitle=
"A.u.", normalizeToUnitArea=
True, stat=
True, drawStyle=
"hist", min=_minVtx, xmax=_maxVtx),
226 Plot(
"RecoAllAssoc2Gen_NumTracks", xtitle=
"Number of tracks in vertex fit", ytitle=
"N", stat=
True, drawStyle=
"hist"),
228 _commonZ =
dict(title=
"", xtitle=
"Vertex z (cm)", scale=1e4, ylog=
True, ymin=_minMaxRes , ymax=_minMaxRes, xmin=_minVertexZ, xmax=_maxVertexZ)
229 _extResolutionZ = PlotGroup(
"resolutionZ", [
230 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Z_Sigma", ytitle=
"#sigma(#delta x) (#mum) for PV", **_commonZ),
231 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Z_Sigma", ytitle=
"#sigma(#delta x) (#mum)", **_commonZ),
232 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Z_Sigma", ytitle=
"#sigma(#delta x) for merged vertices (#mum)", **_commonZ),
234 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Z_Sigma", ytitle=
"#sigma(#delta y) (#mum) for PV", **_commonZ),
235 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Z_Sigma", ytitle=
"#sigma(#delta y) (#mum)", **_commonZ),
236 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Z_Sigma", ytitle=
"#sigma(#delta y) for merged vertices (#mum)", **_commonZ),
238 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Z_Sigma", ytitle=
"#sigma(#delta z) (#mum) for PV", **_commonZ),
239 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Z_Sigma", ytitle=
"#sigma(#delta z) (#mum)", **_commonZ),
240 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Z_Sigma", ytitle=
"#sigma(#delta z) for merged vertices (#mum)", **_commonZ),
242 _commonPU = copy.copy(_commonZ)
243 _commonPU.update(
dict(xtitle=
"Simulated interactions", xmin=_minPU, xmax=_maxPU))
244 _extResolutionPU = PlotGroup(
"resolutionPU", [
245 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x (#mum) for PV", **_commonPU),
246 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x (#mum)", **_commonPU),
247 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x for merged vertices (#mum)", **_commonPU),
249 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y (#mum) for PV", **_commonPU),
250 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y (#mum)", **_commonPU),
251 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y for merged vertices (#mum)", **_commonPU),
253 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z (#mum) for PV", **_commonPU),
254 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z (#mum)", **_commonPU),
255 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z for merged vertices (#mum)", **_commonPU),
257 _commonZ.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
258 _extPullZ = PlotGroup(
"pullZ", [
259 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_Z_Sigma", ytitle=
"Pull of x for PV", **_commonZ),
260 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_Z_Sigma", ytitle=
"Pull of x", **_commonZ),
261 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_Z_Sigma", ytitle=
"Pull of x for merged vertices", **_commonZ),
263 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_Z_Sigma", ytitle=
"Pull of y for PV", **_commonZ),
264 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_Z_Sigma", ytitle=
"Pull of y", **_commonZ),
265 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_Z_Sigma", ytitle=
"Pull of y for merged vertices", **_commonZ),
267 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_Z_Sigma", ytitle=
"Pull of z for PV", **_commonZ),
268 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_Z_Sigma", ytitle=
"Pull of z", **_commonZ),
269 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_Z_Sigma", ytitle=
"Pull of z for merged vertices", **_commonZ),
271 _commonPU.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
272 _extPullPU = PlotGroup(
"pullPU", [
273 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_PU_Sigma", ytitle=
"Pull of x for PV", **_commonPU),
274 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_PU_Sigma", ytitle=
"Pull of x", **_commonPU),
275 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_PU_Sigma", ytitle=
"Pull of x for merged vertices", **_commonPU),
277 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_PU_Sigma", ytitle=
"Pull of y for PV", **_commonPU),
278 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_PU_Sigma", ytitle=
"Pull of y", **_commonPU),
279 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_PU_Sigma", ytitle=
"Pull of y for merged vertices", **_commonPU),
281 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_PU_Sigma", ytitle=
"Pull of z for PV", **_commonPU),
282 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_PU_Sigma", ytitle=
"Pull of z", **_commonPU),
283 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_PU_Sigma", ytitle=
"Pull of z for merged vertices", **_commonPU),
285 _commonNumTracks.update(
dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
286 _extResidualNumTracks = PlotGroup(
"residualNumTracks", [
287 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_NumTracks_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonNumTracks),
288 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_NumTracks_Mean", ytitle=
"< #delta x > (#mum)", **_commonNumTracks),
289 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_NumTracks_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonNumTracks),
291 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_NumTracks_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonNumTracks),
292 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_NumTracks_Mean", ytitle=
"< #delta y > (#mum)", **_commonNumTracks),
293 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_NumTracks_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonNumTracks),
295 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_NumTracks_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonNumTracks),
296 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_NumTracks_Mean", ytitle=
"< #delta z > (#mum)", **_commonNumTracks),
297 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_NumTracks_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonNumTracks),
299 _commonPt.update(
dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
300 _extResidualPt = PlotGroup(
"residualPt", [
301 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Pt_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonPt),
302 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Pt_Mean", ytitle=
"< #delta x > (#mum)", **_commonPt),
303 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Pt_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonPt),
305 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Pt_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonPt),
306 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Pt_Mean", ytitle=
"< #delta y > (#mum)", **_commonPt),
307 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Pt_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonPt),
309 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Pt_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonPt),
310 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Pt_Mean", ytitle=
"< #delta z > (#mum)", **_commonPt),
311 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Pt_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonPt),
313 _commonZ.update(
dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
314 _extResidualZ = PlotGroup(
"residualZ", [
315 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Z_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonZ),
316 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Z_Mean", ytitle=
"< #delta x > (#mum)", **_commonZ),
317 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Z_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonZ),
319 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Z_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonZ),
320 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Z_Mean", ytitle=
"< #delta y > (#mum)", **_commonZ),
321 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Z_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonZ),
323 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Z_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonZ),
324 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Z_Mean", ytitle=
"< #delta z > (#mum)", **_commonZ),
325 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Z_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonZ),
327 _commonPU.update(
dict(scale=1e4, ymin=_minResidual, ymax=_maxResidual))
328 _extResidualPU = PlotGroup(
"residualPU", [
329 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_PU_Mean", ytitle=
"< #delta x > (#mum) for PV", **_commonPU),
330 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_PU_Mean", ytitle=
"< #delta x > (#mum)", **_commonPU),
331 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_PU_Mean", ytitle=
"< #delta x > for merged vertices (#mum)", **_commonPU),
333 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_PU_Mean", ytitle=
"< #delta y > (#mum) for PV", **_commonPU),
334 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_PU_Mean", ytitle=
"< #delta y > (#mum)", **_commonPU),
335 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_PU_Mean", ytitle=
"< #delta y > for merged vertices (#mum)", **_commonPU),
337 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_PU_Mean", ytitle=
"< #delta z > (#mum) for PV", **_commonPU),
338 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_PU_Mean", ytitle=
"< #delta z > (#mum)", **_commonPU),
339 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_PU_Mean", ytitle=
"< #delta z > for merged vertices (#mum)", **_commonPU),
341 _extDqm = PlotGroup(
"dqm", [
342 Plot(
"tagVtxTrksVsZ", xtitle=
"z_{vertex} - z_{beamspot} (cm)", ytitle=
"Tracks / selected PV"),
343 Plot(
"otherVtxTrksVsZ", xtitle=
"z_{vertex} - z_{beamspot} (cm)", ytitle=
"Tracks / pileup vertex"),
344 Plot(
"vtxNbr", xtitle=
"Reconstructed vertices", ytitle=
"Events", stat=
True, drawStyle=
"hist", xmin=_minVtx, xmax=_maxVtx),
346 _common =
dict(ytitle=
"Vertices", stat=
True)
347 _extDqmDiff = PlotGroup(
"dqmDiff", [
348 Plot(
"tagDiffX", xtitle=
"PV x_{vertex} - x_{beamspot} (#mum)", **_common),
349 Plot(
"otherDiffX", xtitle=
"Pileup vertex x_{vertex} - x_{beamspot} (#mum)", **_common),
351 Plot(
"tagDiffY", xtitle=
"PV y_{vertex} - y_{beamspot} (#mum)", **_common),
352 Plot(
"otherDiffY", xtitle=
"Pileup vertex y_{vertex} - y_{beamspot} (#mum)", **_common),
354 _extDqmErr = PlotGroup(
"dqmErr", [
355 Plot(
"tagErrX", xtitle=
"PV uncertainty in x (um)", **_common),
356 Plot(
"otherErrX", xtitle=
"Pileup vertex uncertainty in x (um)", **_common),
358 Plot(
"otherErrY", xtitle=
"Pileup vertex uncertainty in y (um)", **_common),
359 Plot(
"tagErrY", xtitle=
"PV uncertainty in y (um)", **_common),
361 Plot(
"otherErrZ", xtitle=
"Pileup vertex uncertainty in z (um)", **_common),
362 Plot(
"tagErrZ", xtitle=
"PV uncertainty in z (um)", **_common),
380 def _formatOrNone(num, func):
386 h = tdirectory.Get(
"TruePVLocationIndexCumulative")
388 n_events = h.GetEntries()
389 n_pvtagged = h.GetBinContent(2)
390 ret.extend([
int(n_events),
"%.4f"%(
float(n_pvtagged)/
float(n_events))])
392 ret.extend([
None,
None])
394 h = tdirectory.Get(
"globalEfficiencies")
397 for i
in xrange(1, h.GetNbinsX()+1):
398 d[h.GetXaxis().GetBinLabel(i)] = h.GetBinContent(i)
400 _formatOrNone(d.get(
"effic_vs_Z",
None),
lambda n:
"%.4f"%n),
401 _formatOrNone(d.get(
"fakerate_vs_Z",
None),
lambda n:
"%.4f"%n),
402 _formatOrNone(d.get(
"merged_vs_Z",
None),
lambda n:
"%.4f"%n),
403 _formatOrNone(d.get(
"duplicate_vs_Z",
None),
lambda n:
"%.4f"%n),
408 if ret.count(
None) == len(ret):
416 "PV reco+tag efficiency",
424 "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
425 "DQMData/Vertexing/PrimaryVertex",
426 "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
427 "DQMData/Vertexing/PrimaryVertexV",
429 _vertexDqmFolders = [
430 "DQMData/Run 1/OfflinePV/Run summary/offlinePrimaryVertices",
431 "DQMData/OffinePV/offlinePrimaryVertices",
434 "DQMData/Run 1/Vertexing/Run summary/V0",
435 "DQMData/Vertexing/V0",
436 "DQMData/Run 1/Vertexing/Run summary/V0V",
437 "DQMData/Vertexing/V0V",
440 plotterExt = Plotter()
441 plotter.append(
"", _vertexFolders, PlotFolder(
446 _resolutionNumTracks,
453 purpose=PlotPurpose.Vertexing,
457 plotter.append(
"K0", [x+
"/K0" for x
in _v0Folders], PlotFolder(
461 loopSubFolders=
False,
462 purpose=PlotPurpose.Vertexing,
463 page=
"v0", section=
"k0" 465 plotter.append(
"Lambda", [x+
"/Lambda" for x
in _v0Folders], PlotFolder(
467 _lambda_effandfakeTk,
469 loopSubFolders=
False,
470 purpose=PlotPurpose.Vertexing,
471 page=
"v0", section=
"lambda" 473 plotterExt.append(
"", _vertexFolders, PlotFolder(
479 _extResidualNumTracks,
483 purpose=PlotPurpose.Vertexing,
486 numberOfEventsHistogram=_vertexNumberOfEventsHistogram
488 plotterExt.append(
"dqm", _vertexDqmFolders, PlotFolder(
492 loopSubFolders=
False,
493 purpose=PlotPurpose.Vertexing,
495 section=
"offlinePrimaryVertices",
498 plotterExt.append(
"gen", _vertexFolders, PlotFolder(
500 loopSubFolders=
False,
501 purpose=PlotPurpose.Vertexing,
509 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)