CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
VertexMonitor Class Reference

#include <VertexMonitor.h>

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void initHisto (DQMStore::IBooker &ibooker)
 
 VertexMonitor (const edm::ParameterSet &, const edm::InputTag &, const edm::InputTag &, std::string pvLabel)
 
 VertexMonitor (const edm::ParameterSet &, const edm::InputTag &, const edm::InputTag &, std::string pvLabel, edm::ConsumesCollector &iC)
 
virtual ~VertexMonitor ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Public Attributes

MonitorElementChi2oNDFVsBXlumi
 
MonitorElementChi2oNDFVsGoodPVtx
 
MonitorElementChi2ProbVsBXlumi
 
MonitorElementChi2ProbVsGoodPVtx
 
edm::ParameterSet conf_
 
bool doAllPlots_
 
bool doPlotsVsBXlumi_
 
bool doPlotsVsGoodPVtx_
 
MonitorElementFractionOfGoodPVtx
 
MonitorElementFractionOfGoodPVtxVsBXlumi
 
MonitorElementFractionOfGoodPVtxVsGoodPVtx
 
MonitorElementFractionOfGoodPVtxVsPVtx
 
MonitorElementGoodPVtxChi2oNDFVsBXlumi
 
MonitorElementGoodPVtxChi2oNDFVsGoodPVtx
 
MonitorElementGoodPVtxChi2ProbVsBXlumi
 
MonitorElementGoodPVtxChi2ProbVsGoodPVtx
 
MonitorElementGoodPVtxNumberOfTracks
 
MonitorElementGoodPVtxNumberOfTracksVsBXlumi
 
MonitorElementGoodPVtxNumberOfTracksVsGoodPVtx
 
MonitorElementGoodPVtxNumberOfTracksVsGoodPVtxNdof
 
MonitorElementGoodPVtxSumPt
 
MonitorElementGoodPVtxSumPtVsBXlumi
 
MonitorElementGoodPVtxSumPtVsGoodPVtx
 
std::string histname
 
std::string label_
 
GetLumilumiDetails_
 
MonitorElementNumberOfBADndofPVtx
 
MonitorElementNumberOfBADndofPVtxVsBXlumi
 
MonitorElementNumberOfBADndofPVtxVsGoodPVtx
 
MonitorElementNumberOfFakePVtx
 
MonitorElementNumberOfFakePVtxVsBXlumi
 
MonitorElementNumberOfFakePVtxVsGoodPVtx
 
MonitorElementNumberOfGoodPVtx
 
MonitorElementNumberOfGoodPVtxVsBXlumi
 
MonitorElementNumberOfPVtx
 
MonitorElementNumberOfPVtxVsBXlumi
 
MonitorElementNumberOfPVtxVsGoodPVtx
 
edm::InputTag primaryVertexInputTag_
 
edm::EDGetTokenT
< reco::VertexCollection
pvToken_
 
edm::InputTag selectedPrimaryVertexInputTag_
 
edm::EDGetTokenT
< reco::VertexCollection
selpvToken_
 

Detailed Description

Monitoring source for general quantities related to vertex

Definition at line 26 of file VertexMonitor.h.

Member Typedef Documentation

Definition at line 28 of file VertexMonitor.h.

Definition at line 29 of file VertexMonitor.h.

Constructor & Destructor Documentation

VertexMonitor::VertexMonitor ( const edm::ParameterSet iConfig,
const edm::InputTag primaryVertexInputTag,
const edm::InputTag selectedPrimaryVertexInputTag,
std::string  pvLabel 
)

Definition at line 15 of file VertexMonitor.cc.

References doPlotsVsBXlumi_, edm::ParameterSet::getParameter(), and lumiDetails_.

19  : conf_(iConfig),
20  primaryVertexInputTag_(primaryVertexInputTag),
21  selectedPrimaryVertexInputTag_(selectedPrimaryVertexInputTag),
22  label_(pvLabel),
23  NumberOfPVtx(nullptr),
24  NumberOfPVtxVsBXlumi(nullptr),
25  NumberOfPVtxVsGoodPVtx(nullptr),
26  NumberOfGoodPVtx(nullptr),
27  NumberOfGoodPVtxVsBXlumi(nullptr),
28  FractionOfGoodPVtx(nullptr),
31  FractionOfGoodPVtxVsPVtx(nullptr),
32  NumberOfBADndofPVtx(nullptr),
35  GoodPVtxSumPt(nullptr),
36  GoodPVtxSumPtVsBXlumi(nullptr),
37  GoodPVtxSumPtVsGoodPVtx(nullptr),
38  GoodPVtxNumberOfTracks(nullptr),
43  GoodPVtxChi2oNDFVsBXlumi(nullptr),
45  GoodPVtxChi2ProbVsBXlumi(nullptr),
46  doAllPlots_(conf_.getParameter<bool>("doAllPlots")),
47  doPlotsVsBXlumi_(conf_.getParameter<bool>("doPlotsVsBXlumi")),
48  doPlotsVsGoodPVtx_(conf_.getParameter<bool>("doPlotsVsGoodPVtx"))
49 
50 {
51  //now do what ever initialization is needed
52  if (doPlotsVsBXlumi_)
53  lumiDetails_ = new GetLumi(iConfig.getParameter<edm::ParameterSet>("BXlumiSetup"));
54 }
bool doPlotsVsGoodPVtx_
Definition: VertexMonitor.h:94
MonitorElement * GoodPVtxNumberOfTracks
Definition: VertexMonitor.h:82
std::string label_
Definition: VertexMonitor.h:50
MonitorElement * GoodPVtxChi2oNDFVsBXlumi
Definition: VertexMonitor.h:88
edm::ParameterSet conf_
Definition: VertexMonitor.h:46
MonitorElement * GoodPVtxSumPtVsBXlumi
Definition: VertexMonitor.h:79
MonitorElement * GoodPVtxNumberOfTracksVsBXlumi
Definition: VertexMonitor.h:83
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:93
MonitorElement * NumberOfBADndofPVtxVsGoodPVtx
Definition: VertexMonitor.h:71
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtx
Definition: VertexMonitor.h:84
MonitorElement * GoodPVtxChi2oNDFVsGoodPVtx
Definition: VertexMonitor.h:87
MonitorElement * FractionOfGoodPVtxVsPVtx
Definition: VertexMonitor.h:65
edm::InputTag primaryVertexInputTag_
Definition: VertexMonitor.h:48
MonitorElement * FractionOfGoodPVtx
Definition: VertexMonitor.h:62
MonitorElement * FractionOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:63
MonitorElement * GoodPVtxSumPtVsGoodPVtx
Definition: VertexMonitor.h:80
MonitorElement * NumberOfPVtxVsBXlumi
Definition: VertexMonitor.h:58
MonitorElement * NumberOfPVtxVsGoodPVtx
Definition: VertexMonitor.h:59
MonitorElement * FractionOfGoodPVtxVsGoodPVtx
Definition: VertexMonitor.h:64
MonitorElement * NumberOfBADndofPVtx
Definition: VertexMonitor.h:69
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * GoodPVtxSumPt
Definition: VertexMonitor.h:78
MonitorElement * GoodPVtxChi2ProbVsGoodPVtx
Definition: VertexMonitor.h:89
edm::InputTag selectedPrimaryVertexInputTag_
Definition: VertexMonitor.h:49
MonitorElement * NumberOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:61
MonitorElement * GoodPVtxChi2ProbVsBXlumi
Definition: VertexMonitor.h:90
MonitorElement * NumberOfBADndofPVtxVsBXlumi
Definition: VertexMonitor.h:70
MonitorElement * NumberOfPVtx
Definition: VertexMonitor.h:57
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtxNdof
Definition: VertexMonitor.h:85
GetLumi * lumiDetails_
Definition: VertexMonitor.h:55
MonitorElement * NumberOfGoodPVtx
Definition: VertexMonitor.h:60
VertexMonitor::VertexMonitor ( const edm::ParameterSet iConfig,
const edm::InputTag primaryVertexInputTag,
const edm::InputTag selectedPrimaryVertexInputTag,
std::string  pvLabel,
edm::ConsumesCollector iC 
)

Definition at line 56 of file VertexMonitor.cc.

References edm::ConsumesCollector::consumes(), doPlotsVsBXlumi_, edm::ParameterSet::getParameter(), lumiDetails_, primaryVertexInputTag_, pvToken_, selectedPrimaryVertexInputTag_, and selpvToken_.

61  : VertexMonitor(iConfig, primaryVertexInputTag, selectedPrimaryVertexInputTag, pvLabel) {
62  if (doPlotsVsBXlumi_)
63  lumiDetails_ = new GetLumi(iConfig.getParameter<edm::ParameterSet>("BXlumiSetup"), iC);
64 
67 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: VertexMonitor.h:52
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:93
edm::InputTag primaryVertexInputTag_
Definition: VertexMonitor.h:48
edm::EDGetTokenT< reco::VertexCollection > selpvToken_
Definition: VertexMonitor.h:53
VertexMonitor(const edm::ParameterSet &, const edm::InputTag &, const edm::InputTag &, std::string pvLabel)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag selectedPrimaryVertexInputTag_
Definition: VertexMonitor.h:49
GetLumi * lumiDetails_
Definition: VertexMonitor.h:55
VertexMonitor::~VertexMonitor ( )
virtualdefault

Member Function Documentation

void VertexMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Definition at line 78 of file VertexMonitor.cc.

References reco::Vertex::chi2(), doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, dqm::impl::MonitorElement::Fill(), FractionOfGoodPVtx, FractionOfGoodPVtxVsBXlumi, FractionOfGoodPVtxVsGoodPVtx, FractionOfGoodPVtxVsPVtx, edm::Event::getHandle(), GetLumi::getValue(), GoodPVtxChi2oNDFVsBXlumi, GoodPVtxChi2oNDFVsGoodPVtx, GoodPVtxChi2ProbVsBXlumi, GoodPVtxChi2ProbVsGoodPVtx, GoodPVtxNumberOfTracks, GoodPVtxNumberOfTracksVsBXlumi, GoodPVtxNumberOfTracksVsGoodPVtx, GoodPVtxSumPt, GoodPVtxSumPtVsBXlumi, GoodPVtxSumPtVsGoodPVtx, edm::HandleBase::isValid(), lumiDetails_, reco::Vertex::ndof(), reco::Vertex::normalizedChi2(), ntracks, NumberOfBADndofPVtx, NumberOfBADndofPVtxVsBXlumi, NumberOfBADndofPVtxVsGoodPVtx, NumberOfGoodPVtx, NumberOfGoodPVtxVsBXlumi, NumberOfPVtx, NumberOfPVtxVsBXlumi, NumberOfPVtxVsGoodPVtx, DiDispStaMuonMonitor_cfi::pt, MetAnalyzer::pv(), pvToken_, selpvToken_, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::tracksSize().

78  {
79  double bxlumi = 0.;
80  if (doPlotsVsBXlumi_)
81  bxlumi = lumiDetails_->getValue(iEvent);
82  // std::cout << "bxlumi : " << bxlumi << std::endl;
83 
84  size_t totalNumPV = 0;
85  size_t totalNumBADndofPV = 0;
87  if (pvHandle.isValid()) {
88  totalNumPV = pvHandle->size();
89  // std::cout << "totalNumPV : " << totalNumPV << std::endl;
90  for (reco::VertexCollection::const_iterator pv = pvHandle->begin(); pv != pvHandle->end(); ++pv) {
91  //--- count pv w/ ndof < 4
92  if (pv->ndof() < 4.)
93  totalNumBADndofPV++;
94  }
95  } else
96  return;
97  NumberOfPVtx->Fill(totalNumPV);
98  NumberOfBADndofPVtx->Fill(totalNumBADndofPV);
99  if (doPlotsVsBXlumi_) {
100  NumberOfPVtxVsBXlumi->Fill(bxlumi, totalNumPV);
101  NumberOfBADndofPVtxVsBXlumi->Fill(bxlumi, totalNumBADndofPV);
102  }
103 
104  size_t totalNumGoodPV = 0;
106  if (selpvHandle.isValid())
107  totalNumGoodPV = selpvHandle->size();
108  else
109  return;
110  // std::cout << "totalNumGoodPV: " << totalNumGoodPV << std::endl;
111  if (doPlotsVsGoodPVtx_) {
112  NumberOfPVtxVsGoodPVtx->Fill(totalNumGoodPV, totalNumPV);
113  NumberOfBADndofPVtxVsGoodPVtx->Fill(totalNumGoodPV, totalNumBADndofPV);
114  }
115 
116  double fracGoodPV = double(totalNumGoodPV) / double(totalNumPV);
117  // std::cout << "fracGoodPV: " << fracGoodPV << std::endl;
118 
119  NumberOfGoodPVtx->Fill(totalNumGoodPV);
120  FractionOfGoodPVtx->Fill(fracGoodPV);
121  if (doPlotsVsBXlumi_) {
122  NumberOfGoodPVtxVsBXlumi->Fill(bxlumi, totalNumGoodPV);
123  FractionOfGoodPVtxVsBXlumi->Fill(bxlumi, fracGoodPV);
124  }
125  if (doPlotsVsGoodPVtx_) {
126  FractionOfGoodPVtxVsGoodPVtx->Fill(totalNumGoodPV, fracGoodPV);
127  FractionOfGoodPVtxVsPVtx->Fill(totalNumPV, fracGoodPV);
128  }
129 
130  if (!selpvHandle->empty()) {
131  double sumpt = 0;
132  size_t ntracks = 0;
133  double chi2ndf = 0.;
134  double chi2prob = 0.;
135 
136  if (!selpvHandle->at(0).isFake()) {
137  reco::Vertex pv = selpvHandle->at(0);
138 
139  ntracks = pv.tracksSize();
140  chi2ndf = pv.normalizedChi2();
141  chi2prob = TMath::Prob(pv.chi2(), (int)pv.ndof());
142 
143  for (reco::Vertex::trackRef_iterator itrk = pv.tracks_begin(); itrk != pv.tracks_end(); ++itrk) {
144  double pt = (**itrk).pt();
145  sumpt += pt * pt;
146  }
147  GoodPVtxSumPt->Fill(sumpt);
148  GoodPVtxNumberOfTracks->Fill(ntracks);
149 
150  if (doPlotsVsBXlumi_) {
151  GoodPVtxSumPtVsBXlumi->Fill(bxlumi, sumpt);
152  GoodPVtxNumberOfTracksVsBXlumi->Fill(bxlumi, ntracks);
153  GoodPVtxChi2oNDFVsBXlumi->Fill(bxlumi, chi2ndf);
154  GoodPVtxChi2ProbVsBXlumi->Fill(bxlumi, chi2prob);
155  }
156  if (doPlotsVsGoodPVtx_) {
157  GoodPVtxSumPtVsGoodPVtx->Fill(totalNumGoodPV, sumpt);
158  GoodPVtxNumberOfTracksVsGoodPVtx->Fill(totalNumGoodPV, ntracks);
159  GoodPVtxChi2oNDFVsGoodPVtx->Fill(totalNumGoodPV, chi2ndf);
160  GoodPVtxChi2ProbVsGoodPVtx->Fill(totalNumGoodPV, chi2prob);
161  }
162  }
163  }
164 }
bool doPlotsVsGoodPVtx_
Definition: VertexMonitor.h:94
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: VertexMonitor.h:52
MonitorElement * GoodPVtxNumberOfTracks
Definition: VertexMonitor.h:82
MonitorElement * GoodPVtxChi2oNDFVsBXlumi
Definition: VertexMonitor.h:88
MonitorElement * GoodPVtxSumPtVsBXlumi
Definition: VertexMonitor.h:79
MonitorElement * GoodPVtxNumberOfTracksVsBXlumi
Definition: VertexMonitor.h:83
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:93
MonitorElement * NumberOfBADndofPVtxVsGoodPVtx
Definition: VertexMonitor.h:71
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtx
Definition: VertexMonitor.h:84
MonitorElement * GoodPVtxChi2oNDFVsGoodPVtx
Definition: VertexMonitor.h:87
void Fill(long long x)
MonitorElement * FractionOfGoodPVtxVsPVtx
Definition: VertexMonitor.h:65
double getValue(const edm::Event &)
Definition: GetLumi.cc:48
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
double chi2() const
chi-squares
Definition: Vertex.h:116
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.h:110
MonitorElement * FractionOfGoodPVtx
Definition: VertexMonitor.h:62
MonitorElement * FractionOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:63
MonitorElement * GoodPVtxSumPtVsGoodPVtx
Definition: VertexMonitor.h:80
MonitorElement * NumberOfPVtxVsBXlumi
Definition: VertexMonitor.h:58
MonitorElement * NumberOfPVtxVsGoodPVtx
Definition: VertexMonitor.h:59
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.h:108
edm::EDGetTokenT< reco::VertexCollection > selpvToken_
Definition: VertexMonitor.h:53
bool isValid() const
Definition: HandleBase.h:70
size_t tracksSize() const
number of tracks
Definition: Vertex.h:112
MonitorElement * FractionOfGoodPVtxVsGoodPVtx
Definition: VertexMonitor.h:64
double ndof() const
Definition: Vertex.h:123
MonitorElement * NumberOfBADndofPVtx
Definition: VertexMonitor.h:69
MonitorElement * GoodPVtxSumPt
Definition: VertexMonitor.h:78
MonitorElement * GoodPVtxChi2ProbVsGoodPVtx
Definition: VertexMonitor.h:89
MonitorElement * NumberOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:61
MonitorElement * GoodPVtxChi2ProbVsBXlumi
Definition: VertexMonitor.h:90
double normalizedChi2() const
chi-squared divided by n.d.o.f.
Definition: Vertex.h:125
MonitorElement * NumberOfBADndofPVtxVsBXlumi
Definition: VertexMonitor.h:70
MonitorElement * NumberOfPVtx
Definition: VertexMonitor.h:57
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
GetLumi * lumiDetails_
Definition: VertexMonitor.h:55
MonitorElement * NumberOfGoodPVtx
Definition: VertexMonitor.h:60
void VertexMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 376 of file VertexMonitor.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and edm::ParameterSetDescription::setUnknown().

376  {
377  //The following says we do not know what parameters are allowed so do no validation
378  // Please change this to state exactly what you do use, even if it is no parameters
380  desc.setUnknown();
381  descriptions.addDefault(desc);
382 }
void addDefault(ParameterSetDescription const &psetDescription)
void VertexMonitor::initHisto ( DQMStore::IBooker ibooker)
virtual

Definition at line 167 of file VertexMonitor.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), beam_dqm_sourceclient-live_cfg::Chi2NDFMax, beam_dqm_sourceclient-live_cfg::Chi2NDFMin, Chi2oNDFVsBXlumi, Chi2ProbVsBXlumi, conf_, doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, FractionOfGoodPVtx, FractionOfGoodPVtxVsBXlumi, FractionOfGoodPVtxVsGoodPVtx, FractionOfGoodPVtxVsPVtx, edm::ParameterSet::getParameter(), dqm::legacy::MonitorElement::getTH1(), GoodPVtxChi2oNDFVsBXlumi, GoodPVtxChi2oNDFVsGoodPVtx, GoodPVtxChi2ProbVsBXlumi, GoodPVtxChi2ProbVsGoodPVtx, GoodPVtxNumberOfTracks, GoodPVtxNumberOfTracksVsBXlumi, GoodPVtxNumberOfTracksVsGoodPVtx, GoodPVtxSumPt, GoodPVtxSumPtVsBXlumi, GoodPVtxSumPtVsGoodPVtx, histname, label_, NumberOfBADndofPVtx, NumberOfBADndofPVtxVsBXlumi, NumberOfBADndofPVtxVsGoodPVtx, NumberOfGoodPVtx, NumberOfGoodPVtxVsBXlumi, NumberOfPVtx, NumberOfPVtxVsBXlumi, NumberOfPVtxVsGoodPVtx, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

167  {
168  // parameters from the configuration
169  std::string MEFolderName = conf_.getParameter<std::string>("PVFolderName");
170 
171  // get binning from the configuration
172  edm::ParameterSet ParametersGoodPVtx = conf_.getParameter<edm::ParameterSet>("GoodPVtx");
173  int GoodPVtxBin = ParametersGoodPVtx.getParameter<int>("GoodPVtxBin");
174  double GoodPVtxMin = ParametersGoodPVtx.getParameter<double>("GoodPVtxMin");
175  double GoodPVtxMax = ParametersGoodPVtx.getParameter<double>("GoodPVtxMax");
176 
177  edm::ParameterSet ParametersNTrkPVtx = conf_.getParameter<edm::ParameterSet>("NTrkPVtx");
178  int NTrkPVtxBin = ParametersNTrkPVtx.getParameter<int>("NTrkPVtxBin");
179  double NTrkPVtxMin = ParametersNTrkPVtx.getParameter<double>("NTrkPVtxMin");
180  double NTrkPVtxMax = ParametersNTrkPVtx.getParameter<double>("NTrkPVtxMax");
181 
182  edm::ParameterSet ParametersSumPtPVtx = conf_.getParameter<edm::ParameterSet>("SumPtPVtx");
183  int SumPtPVtxBin = ParametersSumPtPVtx.getParameter<int>("SumPtPVtxBin");
184  double SumPtPVtxMin = ParametersSumPtPVtx.getParameter<double>("SumPtPVtxMin");
185  double SumPtPVtxMax = ParametersSumPtPVtx.getParameter<double>("SumPtPVtxMax");
186 
187  // book histo
188  // ----------------------//
189  ibooker.setCurrentFolder(MEFolderName + "/" + label_);
190 
191  histname = "NumberOfPVtx_" + label_;
192  NumberOfPVtx = ibooker.book1D(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax);
193  NumberOfPVtx->setAxisTitle("Number of PV", 1);
194  NumberOfPVtx->setAxisTitle("Number of Events", 2);
195 
196  histname = "NumberOfGoodPVtx_" + label_;
197  NumberOfGoodPVtx = ibooker.book1D(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax);
198  NumberOfGoodPVtx->setAxisTitle("Number of Good PV", 1);
199  NumberOfGoodPVtx->setAxisTitle("Number of Events", 2);
200 
201  histname = "FractionOfGoodPVtx_" + label_;
202  FractionOfGoodPVtx = ibooker.book1D(histname, histname, 100, 0., 1.);
203  FractionOfGoodPVtx->setAxisTitle("fraction of Good PV", 1);
204  FractionOfGoodPVtx->setAxisTitle("Number of Events", 2);
205 
206  histname = "NumberOfBADndofPVtx_" + label_;
207  NumberOfBADndofPVtx = ibooker.book1D(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax);
208  NumberOfBADndofPVtx->setAxisTitle("Number of BADndof #PV", 1);
209  NumberOfBADndofPVtx->setAxisTitle("Number of Events", 2);
210 
211  histname = "GoodPVtxSumPt_" + label_;
212  GoodPVtxSumPt = ibooker.book1D(histname, histname, SumPtPVtxBin, SumPtPVtxMin, SumPtPVtxMax);
213  GoodPVtxSumPt->setAxisTitle("primary vertex #Sum p_{T}^{2} [GeV^{2}/c^{2}]", 1);
214  GoodPVtxSumPt->setAxisTitle("Number of events", 2);
215 
216  histname = "GoodPVtxNumberOfTracks_" + label_;
217  GoodPVtxNumberOfTracks = ibooker.book1D(histname, histname, NTrkPVtxBin, NTrkPVtxMin, NTrkPVtxMax);
218  GoodPVtxNumberOfTracks->setAxisTitle("primary vertex number of tracks", 1);
219  GoodPVtxNumberOfTracks->setAxisTitle("Number of events", 2);
220 
221  if (doPlotsVsBXlumi_) {
222  // get binning from the configuration
223  edm::ParameterSet BXlumiParameters = conf_.getParameter<edm::ParameterSet>("BXlumiSetup");
224  int BXlumiBin = BXlumiParameters.getParameter<int>("BXlumiBin");
225  double BXlumiMin = BXlumiParameters.getParameter<double>("BXlumiMin");
226  double BXlumiMax = BXlumiParameters.getParameter<double>("BXlumiMax");
227 
228  ibooker.setCurrentFolder(MEFolderName + "/" + label_ + "/PUmonitoring/");
229 
230  histname = "NumberOfPVtxVsBXlumi_" + label_;
232  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, GoodPVtxMin, GoodPVtxMax * 3, "");
233  NumberOfPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
234  NumberOfPVtxVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
235  NumberOfPVtxVsBXlumi->setAxisTitle("Mean number of PV", 2);
236 
237  histname = "NumberOfGoodPVtxVsBXlumi_" + label_;
239  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, GoodPVtxMin, GoodPVtxMax * 3, "");
240  NumberOfGoodPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
241  NumberOfGoodPVtxVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
242  NumberOfGoodPVtxVsBXlumi->setAxisTitle("Mean number of PV", 2);
243 
244  histname = "FractionOfGoodPVtxVsBXlumi_" + label_;
245  FractionOfGoodPVtxVsBXlumi = ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 1.5, "");
246  FractionOfGoodPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
247  FractionOfGoodPVtxVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
248  FractionOfGoodPVtxVsBXlumi->setAxisTitle("Mean number of PV", 2);
249 
250  histname = "NumberOfBADndofPVtxVsBXlumi_" + label_;
252  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, GoodPVtxMin, GoodPVtxMax * 3, "");
253  NumberOfBADndofPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
254  NumberOfBADndofPVtxVsBXlumi->setAxisTitle("BADndof #PV", 1);
255  NumberOfBADndofPVtxVsBXlumi->setAxisTitle("Number of Events", 2);
256 
257  histname = "GoodPVtxSumPtVsBXlumi_" + label_;
259  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, SumPtPVtxMin, SumPtPVtxMax * 3, "");
260  GoodPVtxSumPtVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
261  GoodPVtxSumPtVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
262  GoodPVtxSumPtVsBXlumi->setAxisTitle("Mean pv #Sum p_{T}^{2} [GeV^{2}/c]^{2}", 2);
263 
264  histname = "GoodPVtxNumberOfTracksVsBXlumi_" + label_;
266  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, NTrkPVtxMin, NTrkPVtxMax * 3, "");
267  GoodPVtxNumberOfTracksVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
268  GoodPVtxNumberOfTracksVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
269  GoodPVtxNumberOfTracksVsBXlumi->setAxisTitle("Mean pv number of tracks", 2);
270 
271  // get binning from the configuration
272  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
273  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
274 
275  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
276  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
277 
278  histname = "Chi2oNDFVsBXlumi_" + label_;
280  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2NDFMin, Chi2NDFMax * 3, "");
281  Chi2oNDFVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
282  Chi2oNDFVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
283  Chi2oNDFVsBXlumi->setAxisTitle("Mean #chi^{2}/ndof", 2);
284 
285  histname = "Chi2ProbVsBXlumi_" + label_;
287  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2ProbMin, Chi2ProbMax * 3, "");
288  Chi2ProbVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
289  Chi2ProbVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
290  Chi2ProbVsBXlumi->setAxisTitle("Mean #chi^{2}/prob", 2);
291 
292  histname = "GoodPVtxChi2oNDFVsBXlumi_" + label_;
294  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2NDFMin, Chi2NDFMax, "");
295  GoodPVtxChi2oNDFVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
296  GoodPVtxChi2oNDFVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
297  GoodPVtxChi2oNDFVsBXlumi->setAxisTitle("Mean PV #chi^{2}/ndof", 2);
298 
299  histname = "GoodPVtxChi2ProbVsBXlumi_" + label_;
301  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2ProbMin, Chi2ProbMax * 3, "");
302  GoodPVtxChi2ProbVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
303  GoodPVtxChi2ProbVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
304  GoodPVtxChi2ProbVsBXlumi->setAxisTitle("Mean PV #chi^{2}/prob", 2);
305  }
306 
307  if (doPlotsVsGoodPVtx_) {
308  ibooker.setCurrentFolder(MEFolderName + "/" + label_ + "/PUmonitoring/VsGoodPVtx");
309 
310  histname = "NumberOfPVtxVsGoodPVtx_" + label_;
312  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3, "");
313  NumberOfPVtxVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
314  NumberOfPVtxVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
315  NumberOfPVtxVsGoodPVtx->setAxisTitle("Mean number of PV", 2);
316 
317  histname = "FractionOfGoodPVtxVsGoodPVtx_" + label_;
319  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3, "");
320  FractionOfGoodPVtxVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
321  FractionOfGoodPVtxVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
322  FractionOfGoodPVtxVsGoodPVtx->setAxisTitle("Mean fraction of Good PV", 2);
323 
324  histname = "FractionOfGoodPVtxVsPVtx_" + label_;
326  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3, "");
327  FractionOfGoodPVtxVsPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
328  FractionOfGoodPVtxVsPVtx->setAxisTitle("Number of Good PV", 1);
329  FractionOfGoodPVtxVsPVtx->setAxisTitle("Mean number of Good PV", 2);
330 
331  histname = "NumberOfBADndofPVtxVsGoodPVtx_" + label_;
333  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3, "");
334  NumberOfBADndofPVtxVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
335  NumberOfBADndofPVtxVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
336  NumberOfBADndofPVtxVsGoodPVtx->setAxisTitle("Mean Number of BAD PV", 2);
337 
338  histname = "GoodPVtxSumPtVsGoodPVtx_" + label_;
340  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, SumPtPVtxMin, SumPtPVtxMax * 3, "");
341  GoodPVtxSumPtVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
342  GoodPVtxSumPtVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
343  GoodPVtxSumPtVsGoodPVtx->setAxisTitle("Mean pv #Sum p_{T}^{2} [GeV^{2}/c]^{2}", 2);
344 
345  histname = "GoodPVtxNumberOfTracksVsGoodPVtx_" + label_;
347  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, NTrkPVtxMin, NTrkPVtxMax * 3, "");
348  GoodPVtxNumberOfTracksVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
349  GoodPVtxNumberOfTracksVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
350  GoodPVtxNumberOfTracksVsGoodPVtx->setAxisTitle("Mean pv number of tracks", 2);
351 
352  // get binning from the configuration
353  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
354  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
355 
356  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
357  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
358 
359  histname = "GoodPVtxChi2oNDFVsGoodPVtx_" + label_;
361  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, Chi2NDFMin, Chi2NDFMax * 3, "");
362  GoodPVtxChi2oNDFVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
363  GoodPVtxChi2oNDFVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
364  GoodPVtxChi2oNDFVsGoodPVtx->setAxisTitle("Mean PV #chi^{2}/ndof", 2);
365 
366  histname = "GoodPVtxChi2ProbVsGoodPVtx_" + label_;
368  histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, Chi2ProbMin, Chi2ProbMax * 3, "");
369  GoodPVtxChi2ProbVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
370  GoodPVtxChi2ProbVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
371  GoodPVtxChi2ProbVsGoodPVtx->setAxisTitle("Mean PV #chi^{2}/prob", 2);
372  }
373 }
bool doPlotsVsGoodPVtx_
Definition: VertexMonitor.h:94
MonitorElement * GoodPVtxNumberOfTracks
Definition: VertexMonitor.h:82
std::string label_
Definition: VertexMonitor.h:50
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * GoodPVtxChi2oNDFVsBXlumi
Definition: VertexMonitor.h:88
edm::ParameterSet conf_
Definition: VertexMonitor.h:46
std::string histname
Definition: VertexMonitor.h:96
MonitorElement * GoodPVtxSumPtVsBXlumi
Definition: VertexMonitor.h:79
MonitorElement * GoodPVtxNumberOfTracksVsBXlumi
Definition: VertexMonitor.h:83
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:93
MonitorElement * NumberOfBADndofPVtxVsGoodPVtx
Definition: VertexMonitor.h:71
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtx
Definition: VertexMonitor.h:84
MonitorElement * GoodPVtxChi2oNDFVsGoodPVtx
Definition: VertexMonitor.h:87
MonitorElement * FractionOfGoodPVtxVsPVtx
Definition: VertexMonitor.h:65
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
MonitorElement * Chi2oNDFVsBXlumi
Definition: VertexMonitor.h:74
MonitorElement * FractionOfGoodPVtx
Definition: VertexMonitor.h:62
MonitorElement * FractionOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:63
MonitorElement * GoodPVtxSumPtVsGoodPVtx
Definition: VertexMonitor.h:80
MonitorElement * NumberOfPVtxVsBXlumi
Definition: VertexMonitor.h:58
MonitorElement * NumberOfPVtxVsGoodPVtx
Definition: VertexMonitor.h:59
MonitorElement * FractionOfGoodPVtxVsGoodPVtx
Definition: VertexMonitor.h:64
MonitorElement * NumberOfBADndofPVtx
Definition: VertexMonitor.h:69
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * GoodPVtxSumPt
Definition: VertexMonitor.h:78
MonitorElement * Chi2ProbVsBXlumi
Definition: VertexMonitor.h:76
MonitorElement * GoodPVtxChi2ProbVsGoodPVtx
Definition: VertexMonitor.h:89
MonitorElement * NumberOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:61
MonitorElement * GoodPVtxChi2ProbVsBXlumi
Definition: VertexMonitor.h:90
MonitorElement * NumberOfBADndofPVtxVsBXlumi
Definition: VertexMonitor.h:70
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * NumberOfPVtx
Definition: VertexMonitor.h:57
virtual TH1 * getTH1() const
MonitorElement * NumberOfGoodPVtx
Definition: VertexMonitor.h:60
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

MonitorElement* VertexMonitor::Chi2oNDFVsBXlumi

Definition at line 74 of file VertexMonitor.h.

Referenced by initHisto().

MonitorElement* VertexMonitor::Chi2oNDFVsGoodPVtx

Definition at line 73 of file VertexMonitor.h.

MonitorElement* VertexMonitor::Chi2ProbVsBXlumi

Definition at line 76 of file VertexMonitor.h.

Referenced by initHisto().

MonitorElement* VertexMonitor::Chi2ProbVsGoodPVtx

Definition at line 75 of file VertexMonitor.h.

edm::ParameterSet VertexMonitor::conf_

Definition at line 46 of file VertexMonitor.h.

Referenced by initHisto().

bool VertexMonitor::doAllPlots_

Definition at line 92 of file VertexMonitor.h.

bool VertexMonitor::doPlotsVsBXlumi_

Definition at line 93 of file VertexMonitor.h.

Referenced by analyze(), initHisto(), and VertexMonitor().

bool VertexMonitor::doPlotsVsGoodPVtx_

Definition at line 94 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtx

Definition at line 62 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtxVsBXlumi

Definition at line 63 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtxVsGoodPVtx

Definition at line 64 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtxVsPVtx

Definition at line 65 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2oNDFVsBXlumi

Definition at line 88 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2oNDFVsGoodPVtx

Definition at line 87 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2ProbVsBXlumi

Definition at line 90 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2ProbVsGoodPVtx

Definition at line 89 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracks

Definition at line 82 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracksVsBXlumi

Definition at line 83 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracksVsGoodPVtx

Definition at line 84 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracksVsGoodPVtxNdof

Definition at line 85 of file VertexMonitor.h.

MonitorElement* VertexMonitor::GoodPVtxSumPt

Definition at line 78 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxSumPtVsBXlumi

Definition at line 79 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxSumPtVsGoodPVtx

Definition at line 80 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

std::string VertexMonitor::histname

Definition at line 96 of file VertexMonitor.h.

Referenced by initHisto().

std::string VertexMonitor::label_
GetLumi* VertexMonitor::lumiDetails_

Definition at line 55 of file VertexMonitor.h.

Referenced by analyze(), and VertexMonitor().

MonitorElement* VertexMonitor::NumberOfBADndofPVtx

Definition at line 69 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfBADndofPVtxVsBXlumi

Definition at line 70 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfBADndofPVtxVsGoodPVtx

Definition at line 71 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfFakePVtx

Definition at line 66 of file VertexMonitor.h.

MonitorElement* VertexMonitor::NumberOfFakePVtxVsBXlumi

Definition at line 67 of file VertexMonitor.h.

MonitorElement* VertexMonitor::NumberOfFakePVtxVsGoodPVtx

Definition at line 68 of file VertexMonitor.h.

MonitorElement* VertexMonitor::NumberOfGoodPVtx

Definition at line 60 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfGoodPVtxVsBXlumi

Definition at line 61 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfPVtx

Definition at line 57 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfPVtxVsBXlumi

Definition at line 58 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfPVtxVsGoodPVtx

Definition at line 59 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

edm::InputTag VertexMonitor::primaryVertexInputTag_

Definition at line 48 of file VertexMonitor.h.

Referenced by VertexMonitor().

edm::EDGetTokenT<reco::VertexCollection> VertexMonitor::pvToken_

Definition at line 52 of file VertexMonitor.h.

Referenced by analyze(), and VertexMonitor().

edm::InputTag VertexMonitor::selectedPrimaryVertexInputTag_

Definition at line 49 of file VertexMonitor.h.

Referenced by VertexMonitor().

edm::EDGetTokenT<reco::VertexCollection> VertexMonitor::selpvToken_

Definition at line 53 of file VertexMonitor.h.

Referenced by analyze(), and VertexMonitor().