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
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 = [5, 10, 50, 100, 200, 500, 1000, 2000, 5000]
15 _minMaxPt = [5e-1, 1, 5, 1e1, 5e1, 1e2, 5e2, 1e3, 5e3, 1e4]
16 _minPull = [0, 0.5, 0.8, 0.9]
17 _maxPull = [1.1, 1.2, 1.5, 2]
19 _vertexNumberOfEventsHistogram =
"DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV/GenPV_Z" 21 _common = {
"xtitle":
"Simulated interactions",
"xmin": _minPU,
"xmax": _maxPU,
"ymin": _minVtx,
"ymax": _maxVtx}
22 _recovsgen = PlotGroup(
"recovsgen", [
23 Plot(
"RecoVtx_vs_GenVtx", ytitle=
"Reco vertices", **_common),
24 Plot(
"MatchedRecoVtx_vs_GenVtx", ytitle=
"Matched reco vertices", **_common),
25 Plot(
"merged_vs_ClosestVertexInZ", xtitle=
"Closest distance in Z (cm)", ytitle=
"Merge rate", xlog=
True, xmin=1e-3, ymax=_maxFake),
26 Plot(
"merged_vs_Z", xtitle=
"Z (cm)", ytitle=
"Merge rate", xmin=-20, xmax=20, ymax=_maxFake),
28 legendDy=_legendDy_2rows
30 _pvtagging = PlotGroup(
"pvtagging", [
31 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]),
32 Plot(
"TruePVLocationIndex", xtitle=
"Index of signal PV in reco collection", ytitle=
"Fraction of events", drawStyle=
"hist", normalizeToUnitArea=
True, ylog=
True, ymin=1e-5),
33 Plot(
"MisTagRate_vs_PU", xtitle=
"PU", ytitle=
"Mistag rate vs. PU", title=
"", xmax=_maxPU, ymax=_maxFake),
34 Plot(
"MisTagRate_vs_sum-pt2", xtitle=
"#Sigmap_{T}^{2}", ytitle=
"Mistag rate vs. #Sigmap_{T}^{2}", title=
"", xlog=
True, ymax=_maxFake),
36 legendDy=_legendDy_2rows
38 _effandfake = PlotGroup(
"effandfake", [
39 Plot(
"effic_vs_NumVertices", xtitle=
"Simulated interactions", ytitle=
"Efficiency vs. N sim vertices", xmin=_minPU, xmax=_maxPU, ymax=_maxEff),
40 Plot(
"fakerate_vs_PU", xtitle=
"Simulated interactions", ytitle=
"Fake rate vs. N sim vertices", xmin=_minPU, xmax=_maxPU, ymax=_maxFake),
41 Plot(
"effic_vs_NumTracks", xtitle=
"Tracks", ytitle=
"Efficiency vs. N tracks", title=
"", ymax=_maxEff),
42 Plot(
"fakerate_vs_NumTracks", xtitle=
"Tracks", ytitle=
"Fake rate vs. N tracks", title=
"", ymax=_maxFake),
43 Plot(
"effic_vs_Pt2", xtitle=
"Sum p_{T}^{2} ", ytitle=
"Efficiency vs. sum p_{T}^{2}", xlog=
True, ymax=_maxEff),
44 Plot(
"fakerate_vs_Pt2", xtitle=
"Sum p_{T}^{2} ", ytitle=
"Fake rate vs. sum p_{T}^{2}", xlog=
True, ymax=_maxFake),
46 _common = {
"title":
"",
"stat":
True,
"fit":
True,
"normalizeToUnitArea":
True,
"drawStyle":
"hist",
"drawCommand":
"",
"ylog":
True,
"ymin": [5e-7, 5e-6, 5e-5, 5e-4]}
47 _resolution = PlotGroup(
"resolution", [
48 Plot(
"RecoPVAssoc2GenPVMatched_ResolX", xtitle=
"Resolution in x (#mum) for PV", **_common),
49 Plot(
"RecoAllAssoc2GenMatched_ResolX", xtitle=
"Resolution in x (#mum)", **_common),
50 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX", xtitle=
"Resolution in x for merged vertices (#mum)", **_common),
52 Plot(
"RecoPVAssoc2GenPVMatched_ResolY", xtitle=
"Resolution in y (#mum)", **_common),
53 Plot(
"RecoAllAssoc2GenMatched_ResolY", xtitle=
"Resolution in y (#mum)", **_common),
54 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY", xtitle=
"Resolution in y for merged vertices (#mum)", **_common),
56 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ", xtitle=
"Resolution in z (#mum)", **_common),
57 Plot(
"RecoAllAssoc2GenMatched_ResolZ", xtitle=
"Resolution in z (#mum)", **_common),
58 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ", xtitle=
"Resolution in z for merged vertices (#mum)", **_common),
60 _commonNumTracks =
dict(title=
"", xtitle=
"Number of tracks", scale=1e4, ylog=
True, ymin=_minMaxRes , ymax=_minMaxRes)
61 _resolutionNumTracks = PlotGroup(
"resolutionNumTracks", [
62 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_NumTracks_Sigma", ytitle=
"Resolution in x (#mum) for PV", **_commonNumTracks),
63 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_NumTracks_Sigma", ytitle=
"Resolution in x (#mum)", **_commonNumTracks),
64 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_NumTracks_Sigma", ytitle=
"Resolution in x for merged vertices (#mum)", **_commonNumTracks),
66 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_NumTracks_Sigma", ytitle=
"Resolution in y (#mum) for PV", **_commonNumTracks),
67 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_NumTracks_Sigma", ytitle=
"Resolution in y (#mum)", **_commonNumTracks),
68 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_NumTracks_Sigma", ytitle=
"Resolution in y for merged vertices (#mum)", **_commonNumTracks),
70 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_NumTracks_Sigma", ytitle=
"Resolution in z (#mum) for PV", **_commonNumTracks),
71 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_NumTracks_Sigma", ytitle=
"Resolution in z (#mum)", **_commonNumTracks),
72 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_NumTracks_Sigma", ytitle=
"Resolution in z for merged vertices (#mum)", **_commonNumTracks),
74 _commonPt = copy.copy(_commonNumTracks)
75 _commonPt.update(
dict(xtitle=
"Sum of track p_{T} (GeV)", xlog=
True, xmin=_minMaxPt, xmax=_minMaxPt))
76 _resolutionPt = PlotGroup(
"resolutionPt", [
77 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Pt_Sigma", ytitle=
"Resolution in x (#mum) for PV", **_commonPt),
78 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Pt_Sigma", ytitle=
"Resolution in x (#mum)", **_commonPt),
79 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Pt_Sigma", ytitle=
"Resolution in x for merged vertices (#mum)", **_commonPt),
81 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Pt_Sigma", ytitle=
"Resolution in y (#mum) for PV", **_commonPt),
82 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Pt_Sigma", ytitle=
"Resolution in y (#mum)", **_commonPt),
83 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Pt_Sigma", ytitle=
"Resolution in y for merged vertices (#mum)", **_commonPt),
85 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Pt_Sigma", ytitle=
"Resolution in z (#mum) for PV", **_commonPt),
86 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Pt_Sigma", ytitle=
"Resolution in z (#mum)", **_commonPt),
87 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Pt_Sigma", ytitle=
"Resolution in z for merged vertices (#mum)", **_commonPt),
89 _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]}
90 _pull = PlotGroup(
"pull", [
91 Plot(
"RecoPVAssoc2GenPVMatched_PullX", xtitle=
"x", ytitle=
"Pull of x for PV", **_common),
92 Plot(
"RecoAllAssoc2GenMatched_PullX", xtitle=
"x", ytitle=
"Pull of x", **_common),
93 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX", xtitle=
"x", ytitle=
"Pull of x for merged vertices", **_common),
95 Plot(
"RecoPVAssoc2GenPVMatched_PullY", xtitle=
"y", ytitle=
"Pull of y for PV", **_common),
96 Plot(
"RecoAllAssoc2GenMatched_PullY", xtitle=
"y", ytitle=
"Pull of y", **_common),
97 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY", xtitle=
"y", ytitle=
"Pull of y for merged vertices", **_common),
99 Plot(
"RecoPVAssoc2GenPVMatched_PullZ", xtitle=
"z", ytitle=
"Pull of z for PV", **_common),
100 Plot(
"RecoAllAssoc2GenMatched_PullZ", xtitle=
"z", ytitle=
"Pull of z", **_common),
101 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ", xtitle=
"z", ytitle=
"Pull of z for merged vertices", **_common),
103 _commonNumTracks.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
104 _pullNumTracks = PlotGroup(
"pullNumTracks", [
105 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x for PV", **_commonNumTracks),
106 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x", **_commonNumTracks),
107 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_NumTracks_Sigma", ytitle=
"Pull of x for merged vertices", **_commonNumTracks),
109 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y for PV", **_commonNumTracks),
110 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y", **_commonNumTracks),
111 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_NumTracks_Sigma", ytitle=
"Pull of y for merged vertices", **_commonNumTracks),
113 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z for PV", **_commonNumTracks),
114 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z", **_commonNumTracks),
115 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_NumTracks_Sigma", ytitle=
"Pull of z for merged vertices", **_commonNumTracks),
117 _commonPt.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
118 _pullPt = PlotGroup(
"pullPt", [
119 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_Pt_Sigma", ytitle=
"Pull of x for PV", **_commonPt),
120 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_Pt_Sigma", ytitle=
"Pull of x", **_commonPt),
121 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_Pt_Sigma", ytitle=
"Pull of x for merged vertices", **_commonPt),
123 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_Pt_Sigma", ytitle=
"Pull of y for PV", **_commonPt),
124 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_Pt_Sigma", ytitle=
"Pull of y", **_commonPt),
125 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_Pt_Sigma", ytitle=
"Pull of y for merged vertices", **_commonPt),
127 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z for PV", **_commonPt),
128 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z", **_commonPt),
129 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_Pt_Sigma", ytitle=
"Pull of z for merged vertices", **_commonPt),
132 _common={
"drawStyle":
"HIST",
"normalizeToUnitArea":
True}
133 _puritymissing = PlotGroup(
"puritymissing", [
134 Plot(
"RecoPVAssoc2GenPVMatched_Purity", xtitle=
"Purity", ytitle=
"Number of reco PVs matched to gen PVs", ylog=
True, ymin=1e-4, **_common),
135 Plot(
"RecoPVAssoc2GenPVNotMatched_Purity", xtitle=
"Purity", ytitle=
"Number of reco PVs not matcched to gen PVs", ylog=
True, ymin=1e-3, **_common),
136 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),
137 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),
141 _common={
"drawStyle":
"HIST",
"xlog":
True,
"ylog":
True,
"ymin": 0.5}
142 _sumpt2 = PlotGroup(
"sumpt2", [
143 Plot(
"RecoAssoc2GenPVMatched_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Reco vertices matched to gen PV", **_common),
144 Plot(
"RecoAssoc2GenPVMatchedNotHighest_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Reco non-PV-vertices matched to gen PV", **_common),
145 Plot(
"RecoAssoc2GenPVNotMatched_Pt2", xtitle=
"#sum^{}p_{T}^{2}", ytitle=
"Reco vertices not matched to gen PV", **_common),
146 Plot(
"RecoAssoc2GenPVNotMatched_GenPVTracksRemoved_Pt2", xtitle=
"#sum^{}p_{T}^{2}, gen PV tracks removed", ytitle=
"Reco vertices not matched to gen PV", **_common),
148 legendDy=_legendDy_2rows
151 _k0_effandfake = PlotGroup(
"effandfake", [
152 Plot(
"K0sEffVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Efficiency vs. p_{T}"),
153 Plot(
"K0sFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
154 Plot(
"K0sEffVsEta", xtitle=
"#eta", ytitle=
"Efficiency vs. #eta"),
155 Plot(
"K0sFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
156 Plot(
"K0sEffVsR", xtitle=
"R (cm)", ytitle=
"Efficiency vs. R"),
157 Plot(
"K0sFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
159 _k0_effandfakeTk = PlotGroup(
"effandfakeTk", [
161 Plot(
"K0sTkFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
163 Plot(
"K0sTkFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
165 Plot(
"K0sTkFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
167 legendDy=_legendDy_2rows
169 _common =
dict(normalizeToUnitArea=
True, drawStyle=
"HIST", stat=
True)
170 _k0_mass = PlotGroup(
"mass", [
171 Plot(
"ksMassAll", xtitle=
"mass of all (GeV)", **_common),
172 Plot(
"ksMassGood", xtitle=
"mass of good (GeV)", **_common),
173 Plot(
"ksMassFake", xtitle=
"mass of fake (GeV)", **_common),
175 legendDy=_legendDy_2rows
177 _lambda_effandfake = PlotGroup(
"effandfake", [
178 Plot(
"LamEffVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Efficiency vs. p_{T}"),
179 Plot(
"LamFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
180 Plot(
"LamEffVsEta", xtitle=
"#eta", ytitle=
"Efficiency vs. #eta"),
181 Plot(
"LamFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
182 Plot(
"LamEffVsR", xtitle=
"R (cm)", ytitle=
"Efficiency vs. R"),
183 Plot(
"LamFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
185 _lambda_effandfakeTk = PlotGroup(
"effandfakeTk", [
187 Plot(
"LamTkFakeVsPt", xtitle=
"p_{T} (GeV)", ytitle=
"Fake rate vs. p_{T}"),
189 Plot(
"LamTkFakeVsEta", xtitle=
"#eta", ytitle=
"Fake rate vs. #eta"),
191 Plot(
"LamTkFakeVsR", xtitle=
"R (cm)", ytitle=
"Fake rate vs. R"),
193 legendDy=_legendDy_2rows
195 _lambda_mass = PlotGroup(
"mass", [
196 Plot(
"lamMassAll", xtitle=
"mass of all (GeV)", **_common),
197 Plot(
"lamMassGood", xtitle=
"mass of good (GeV)", **_common),
198 Plot(
"lamMassFake", xtitle=
"mass of fake (GeV)", **_common),
200 legendDy=_legendDy_2rows
204 _common =
dict(drawStyle =
"HIST", stat=
True)
205 _commonXY =
dict(xmin=[x*0.1
for x
in xrange(-6, 6, 1)], xmax=[x*0.1
for x
in xrange(-5, 7, 1)])
206 _commonZ =
dict(xmin=[-60,-30], xmax=[30,60])
207 _commonXY.update(_common)
208 _commonZ.update(_common)
209 _extGenpos = PlotGroup(
"genpos", [
210 Plot(
"GenAllV_X", xtitle=
"Gen AllV pos x (cm)", ytitle=
"N", **_commonXY),
211 Plot(
"GenPV_X", xtitle=
"Gen PV pos x (cm)", ytitle=
"N", **_commonXY),
212 Plot(
"GenAllV_Y", xtitle=
"Gen AllV pos y (cm)", ytitle=
"N", **_commonXY),
213 Plot(
"GenPV_Y", xtitle=
"Gen PV pos y (cm)", ytitle=
"N", **_commonXY),
214 Plot(
"GenAllV_Z", xtitle=
"Gen AllV pos z (cm)", ytitle=
"N", **_commonZ),
215 Plot(
"GenPV_Z", xtitle=
"Gen PV pos z (cm)", ytitle=
"N", **_commonZ),
217 _extDist = PlotGroup(
"dist", [
218 Plot(
"RecoAllAssoc2Gen_X", xtitle=
"Reco vertex pos x (cm)", ytitle=
"N", **_commonXY),
219 Plot(
"RecoAllAssoc2Gen_Y", xtitle=
"Reco vertex pos y (cm)", ytitle=
"N", **_commonXY),
220 Plot(
"RecoAllAssoc2Gen_R", xtitle=
"Reco vertex pos r (cm)", ytitle=
"N", **_commonXY),
221 Plot(
"RecoAllAssoc2Gen_Z", xtitle=
"Reco vertex pos z (cm)", ytitle=
"N", **_commonZ),
222 Plot(
"RecoAllAssoc2Gen_NumVertices", xtitle=
"Number of reco vertices", ytitle=
"A.u.", normalizeToUnitArea=
True, stat=
True, drawStyle=
"hist", min=_minVtx, xmax=_maxVtx),
223 Plot(
"RecoAllAssoc2Gen_NumTracks", xtitle=
"Number of tracks in vertex fit", ytitle=
"N", stat=
True, drawStyle=
"hist"),
225 _commonZ =
dict(title=
"", xtitle=
"Vertex z (cm)", scale=1e4, ylog=
True, ymin=_minMaxRes , ymax=_minMaxRes, xmin=range(-60,-10,10), xmax=range(20,70,10))
226 _extResolutionZ = PlotGroup(
"resolutionZ", [
227 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_Z_Sigma", ytitle=
"Resolution in x (#mum) for PV", **_commonZ),
228 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_Z_Sigma", ytitle=
"Resolution in x (#mum)", **_commonZ),
229 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_Z_Sigma", ytitle=
"Resolution in x for merged vertices (#mum)", **_commonZ),
231 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_Z_Sigma", ytitle=
"Resolution in y (#mum) for PV", **_commonZ),
232 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_Z_Sigma", ytitle=
"Resolution in y (#mum)", **_commonZ),
233 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_Z_Sigma", ytitle=
"Resolution in y for merged vertices (#mum)", **_commonZ),
235 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_Z_Sigma", ytitle=
"Resolution in z (#mum) for PV", **_commonZ),
236 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_Z_Sigma", ytitle=
"Resolution in z (#mum)", **_commonZ),
237 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_Z_Sigma", ytitle=
"Resolution in z for merged vertices (#mum)", **_commonZ),
239 _commonPU = copy.copy(_commonZ)
240 _commonPU.update(
dict(xtitle=
"Simulated interactions", xmin=_minPU, xmax=_maxPU))
241 _extResolutionPU = PlotGroup(
"resolutionPU", [
242 Plot(
"RecoPVAssoc2GenPVMatched_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x (#mum) for PV", **_commonPU),
243 Plot(
"RecoAllAssoc2GenMatched_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x (#mum)", **_commonPU),
244 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolX_vs_PU_Sigma", ytitle=
"Resolution in x for merged vertices (#mum)", **_commonPU),
246 Plot(
"RecoPVAssoc2GenPVMatched_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y (#mum) for PV", **_commonPU),
247 Plot(
"RecoAllAssoc2GenMatched_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y (#mum)", **_commonPU),
248 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolY_vs_PU_Sigma", ytitle=
"Resolution in y for merged vertices (#mum)", **_commonPU),
250 Plot(
"RecoPVAssoc2GenPVMatched_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z (#mum) for PV", **_commonPU),
251 Plot(
"RecoAllAssoc2GenMatched_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z (#mum)", **_commonPU),
252 Plot(
"RecoAllAssoc2GenMatchedMerged_ResolZ_vs_PU_Sigma", ytitle=
"Resolution in z for merged vertices (#mum)", **_commonPU),
254 _commonZ.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
255 _extPullZ = PlotGroup(
"pullZ", [
256 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_Z_Sigma", ytitle=
"Pull of x for PV", **_commonZ),
257 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_Z_Sigma", ytitle=
"Pull of x", **_commonZ),
258 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_Z_Sigma", ytitle=
"Pull of x for merged vertices", **_commonZ),
260 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_Z_Sigma", ytitle=
"Pull of y for PV", **_commonZ),
261 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_Z_Sigma", ytitle=
"Pull of y", **_commonZ),
262 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_Z_Sigma", ytitle=
"Pull of y for merged vertices", **_commonZ),
264 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_Z_Sigma", ytitle=
"Pull of z for PV", **_commonZ),
265 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_Z_Sigma", ytitle=
"Pull of z", **_commonZ),
266 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_Z_Sigma", ytitle=
"Pull of z for merged vertices", **_commonZ),
268 _commonPU.update(
dict(scale=1, ylog=
False, ymin=_minPull, ymax=_maxPull))
269 _extPullPU = PlotGroup(
"pullPU", [
270 Plot(
"RecoPVAssoc2GenPVMatched_PullX_vs_PU_Sigma", ytitle=
"Pull of x for PV", **_commonPU),
271 Plot(
"RecoAllAssoc2GenMatched_PullX_vs_PU_Sigma", ytitle=
"Pull of x", **_commonPU),
272 Plot(
"RecoAllAssoc2GenMatchedMerged_PullX_vs_PU_Sigma", ytitle=
"Pull of x for merged vertices", **_commonPU),
274 Plot(
"RecoPVAssoc2GenPVMatched_PullY_vs_PU_Sigma", ytitle=
"Pull of y for PV", **_commonPU),
275 Plot(
"RecoAllAssoc2GenMatched_PullY_vs_PU_Sigma", ytitle=
"Pull of y", **_commonPU),
276 Plot(
"RecoAllAssoc2GenMatchedMerged_PullY_vs_PU_Sigma", ytitle=
"Pull of y for merged vertices", **_commonPU),
278 Plot(
"RecoPVAssoc2GenPVMatched_PullZ_vs_PU_Sigma", ytitle=
"Pull of z for PV", **_commonPU),
279 Plot(
"RecoAllAssoc2GenMatched_PullZ_vs_PU_Sigma", ytitle=
"Pull of z", **_commonPU),
280 Plot(
"RecoAllAssoc2GenMatchedMerged_PullZ_vs_PU_Sigma", ytitle=
"Pull of z for merged vertices", **_commonPU),
283 _extDqm = PlotGroup(
"dqm", [
284 Plot(
"tagVtxTrksVsZ", xtitle=
"z_{vertex} - z_{beamspot} (cm)", ytitle=
"Tracks / selected PV"),
285 Plot(
"otherVtxTrksVsZ", xtitle=
"z_{vertex} - z_{beamspot} (cm)", ytitle=
"Tracks / pileup vertex"),
286 Plot(
"vtxNbr", xtitle=
"Reconstructed vertices", ytitle=
"Events", stat=
True, drawStyle=
"hist", xmin=_minVtx, xmax=_maxVtx),
304 def _formatOrNone(num, func):
310 h = tdirectory.Get(
"TruePVLocationIndexCumulative")
312 n_events = h.GetEntries()
313 n_pvtagged = h.GetBinContent(2)
314 ret.extend([
int(n_events),
"%.4f"%(
float(n_pvtagged)/
float(n_events))])
316 ret.extend([
None,
None])
318 h = tdirectory.Get(
"globalEfficiencies")
321 for i
in xrange(1, h.GetNbinsX()+1):
322 d[h.GetXaxis().GetBinLabel(i)] = h.GetBinContent(i)
324 _formatOrNone(d.get(
"effic_vs_Z",
None),
lambda n:
"%.4f"%n),
325 _formatOrNone(d.get(
"fakerate_vs_Z",
None),
lambda n:
"%.4f"%n),
326 _formatOrNone(d.get(
"merged_vs_Z",
None),
lambda n:
"%.4f"%n),
327 _formatOrNone(d.get(
"duplicate_vs_Z",
None),
lambda n:
"%.4f"%n),
332 if ret.count(
None) == len(ret):
340 "PV reco+tag efficiency",
348 "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
349 "DQMData/Vertexing/PrimaryVertex",
350 "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
351 "DQMData/Vertexing/PrimaryVertexV",
353 _vertexDqmFolders = [
354 "DQMData/Run 1/OfflinePV/Run summary/offlinePrimaryVertices",
355 "DQMData/OffinePV/offlinePrimaryVertices",
358 "DQMData/Run 1/Vertexing/Run summary/V0",
359 "DQMData/Vertexing/V0",
360 "DQMData/Run 1/Vertexing/Run summary/V0V",
361 "DQMData/Vertexing/V0V",
364 plotterExt = Plotter()
365 plotter.append(
"", _vertexFolders, PlotFolder(
370 _resolutionNumTracks,
377 purpose=PlotPurpose.Vertexing,
382 plotter.append(
"K0", [x+
"/K0" for x
in _v0Folders], PlotFolder(
386 loopSubFolders=
False,
387 purpose=PlotPurpose.Vertexing,
388 page=
"v0", section=
"k0" 390 plotter.append(
"Lambda", [x+
"/Lambda" for x
in _v0Folders], PlotFolder(
392 _lambda_effandfakeTk,
394 loopSubFolders=
False,
395 purpose=PlotPurpose.Vertexing,
396 page=
"v0", section=
"lambda" 398 plotterExt.append(
"", _vertexFolders, PlotFolder(
404 purpose=PlotPurpose.Vertexing,
407 numberOfEventsHistogram=_vertexNumberOfEventsHistogram
409 plotterExt.append(
"dqm", _vertexDqmFolders, PlotFolder(
411 loopSubFolders=
False,
412 purpose=PlotPurpose.Vertexing,
414 section=
"offlinePrimaryVertices",
417 plotterExt.append(
"gen", _vertexFolders, PlotFolder(
419 loopSubFolders=
False,
420 purpose=PlotPurpose.Vertexing,
428 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)