CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
vertexPlots.py
Go to the documentation of this file.
1 from Validation.RecoTrack.plotting.plotting import Plot, PlotGroup, Plotter, AlgoOpt
2 import Validation.RecoTrack.plotting.validation as validation
3 
4 _maxPU = 80
5 _maxVtx = 60
6 _maxEff = 1.025
7 _maxFake = [0.05, 0.1, 0.2, 0.5, 1.025]
8 
9 _common = {"xlabel": "Pileup interactions", "xmax": _maxPU, "ymax": _maxVtx}
10 _recovsgen = PlotGroup("recovsgen", [
11  Plot("RecoVtx_vs_GenVtx", ytitle="Reco vertices", **_common),
12  Plot("MatchedRecoVtx_vs_GenVtx", ytitle="Matched reco vertices", **_common),
13  Plot("merged_vs_ClosestVertexInZ", xtitle="Closest distance in Z (cm)", ytitle="Merge rate", xlog=True),
14  Plot("TruePVLocationIndexCumulative", xtitle="Signal PV status in Reco collection", ytitle="Fraction of events", title="", drawStyle="hist", normalizeToUnitArea=True, xbinlabels=["Not reconstructed", "Reco and identified", "Reco, not identified"], xbinlabelsize=0.045, xbinlabeloption="h", xgrid=False, ylog=True, ymin=1e-3),
15  Plot("MisTagRate_vs_PU", xtitle="PU", ytitle="Mistag rate vs. PU", xmax=_maxPU, ymax=_maxFake),
16  Plot("MisTagRate_vs_sum-pt2", xtitle="#Sigmap_{T}^{2}", ytitle="Mistag rate vs. #Sigmap_{T}^{2}", xlog=True, ymax=_maxFake)
17 ])
18 _effandfake = PlotGroup("effandfake", [
19  Plot("effic_vs_NumVertices", xtitle="Reco vertices", ytitle="Efficiency vs. N vertices", xmax=_maxVtx, ymax=_maxEff),
20  Plot("fakerate_vs_PU", xtitle="Pileup interactions", ytitle="Fake rate vs. PU", xmax=_maxPU, ymax=_maxFake),
21  Plot("effic_vs_NumTracks", xtitle="Tracks", ytitle="Efficiency vs. N tracks", title="", ymax=_maxEff),
22  Plot("fakerate_vs_NumTracks", xtitle="Tracks", ytitle="Fake rate vs. N tracks", title="", ymax=_maxFake),
23  Plot("effic_vs_Pt2", xtitle="Sum p_{T}^{2} ", ytitle="Efficiency vs. sum p_{T}^{2}", xlog=True, ymax=_maxEff),
24  Plot("fakerate_vs_Pt2", xtitle="Sum p_{T}^{2} ", ytitle="Fake rate vs. sum p_{T}^{2}", xlog=True, ymax=_maxFake),
25 ])
26 _common = {"drawStyle": "HIST"}
27 _genpos = PlotGroup("genpos", [
28  Plot("GenAllV_X", xtitle="Gen AllV pos x", ytitle="N", **_common),
29  Plot("GenPV_X", xtitle="Gen PV pos x", ytitle="N", **_common),
30  Plot("GenAllV_Y", xtitle="Gen AllV pos y", ytitle="N", **_common),
31  Plot("GenPV_Y", xtitle="Gen PV pos y", ytitle="N", **_common),
32  Plot("GenAllV_Z", xtitle="Gen AllV pos z", ytitle="N", **_common),
33  Plot("GenPV_Z", xtitle="Gen PV pos z", ytitle="N", **_common),
34 ])
35 
36 plotter = Plotter([
37  "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
38  "DQMData/Vertexing/PrimaryVertex",
39  "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
40  "DQMData/Vertexing/PrimaryVertexV",
41 ],[
42  _recovsgen,
43  _effandfake,
44 ])
45 plotterGen = Plotter([
46  "DQMData/Run 1/Vertexing/Run summary/PrimaryVertex",
47  "DQMData/Vertexing/PrimaryVertex",
48  "DQMData/Run 1/Vertexing/Run summary/PrimaryVertexV",
49  "DQMData/Vertexing/PrimaryVertexV",
50 ],[
51  _genpos
52 ])
53 
55  def _init__(self, *args, **kwargs):
56  super(TrackingValidation, self).__init__(*args, **kwargs)
57 
58  def _getDirectoryName(self, quality, algo):
59  return algo
60 
61  def _getSelectionName(self, quality, algo):
62  if algo is None:
63  return ""
64  return "_"+algo