CMS 3D CMS Logo

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::VertexCollectionpvToken_
 
edm::InputTag selectedPrimaryVertexInputTag_
 
edm::EDGetTokenT< reco::VertexCollectionselpvToken_
 

Detailed Description

Monitoring source for general quantities related to vertex

Definition at line 31 of file VertexMonitor.h.

Member Typedef Documentation

Definition at line 33 of file VertexMonitor.h.

Definition at line 34 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 18 of file VertexMonitor.cc.

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

22  : conf_(iConfig),
23  primaryVertexInputTag_(primaryVertexInputTag),
24  selectedPrimaryVertexInputTag_(selectedPrimaryVertexInputTag),
25  label_(pvLabel),
26  NumberOfPVtx(nullptr),
27  NumberOfPVtxVsBXlumi(nullptr),
28  NumberOfPVtxVsGoodPVtx(nullptr),
29  NumberOfGoodPVtx(nullptr),
30  NumberOfGoodPVtxVsBXlumi(nullptr),
31  FractionOfGoodPVtx(nullptr),
34  FractionOfGoodPVtxVsPVtx(nullptr),
35  NumberOfBADndofPVtx(nullptr),
38  GoodPVtxSumPt(nullptr),
39  GoodPVtxSumPtVsBXlumi(nullptr),
40  GoodPVtxSumPtVsGoodPVtx(nullptr),
41  GoodPVtxNumberOfTracks(nullptr),
46  GoodPVtxChi2oNDFVsBXlumi(nullptr),
48  GoodPVtxChi2ProbVsBXlumi(nullptr),
49  doAllPlots_(conf_.getParameter<bool>("doAllPlots")),
50  doPlotsVsBXlumi_(conf_.getParameter<bool>("doPlotsVsBXlumi")),
51  doPlotsVsGoodPVtx_(conf_.getParameter<bool>("doPlotsVsGoodPVtx"))
52 
53 {
54  //now do what ever initialization is needed
55  if (doPlotsVsBXlumi_)
56  lumiDetails_ = new GetLumi(iConfig.getParameter<edm::ParameterSet>("BXlumiSetup"));
57 }
T getParameter(std::string const &) const
bool doPlotsVsGoodPVtx_
Definition: VertexMonitor.h:99
MonitorElement * GoodPVtxNumberOfTracks
Definition: VertexMonitor.h:87
std::string label_
Definition: VertexMonitor.h:55
MonitorElement * GoodPVtxChi2oNDFVsBXlumi
Definition: VertexMonitor.h:93
edm::ParameterSet conf_
Definition: VertexMonitor.h:51
MonitorElement * GoodPVtxSumPtVsBXlumi
Definition: VertexMonitor.h:84
MonitorElement * GoodPVtxNumberOfTracksVsBXlumi
Definition: VertexMonitor.h:88
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:98
MonitorElement * NumberOfBADndofPVtxVsGoodPVtx
Definition: VertexMonitor.h:76
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtx
Definition: VertexMonitor.h:89
MonitorElement * GoodPVtxChi2oNDFVsGoodPVtx
Definition: VertexMonitor.h:92
MonitorElement * FractionOfGoodPVtxVsPVtx
Definition: VertexMonitor.h:70
edm::InputTag primaryVertexInputTag_
Definition: VertexMonitor.h:53
MonitorElement * FractionOfGoodPVtx
Definition: VertexMonitor.h:67
MonitorElement * FractionOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:68
MonitorElement * GoodPVtxSumPtVsGoodPVtx
Definition: VertexMonitor.h:85
MonitorElement * NumberOfPVtxVsBXlumi
Definition: VertexMonitor.h:63
MonitorElement * NumberOfPVtxVsGoodPVtx
Definition: VertexMonitor.h:64
MonitorElement * FractionOfGoodPVtxVsGoodPVtx
Definition: VertexMonitor.h:69
MonitorElement * NumberOfBADndofPVtx
Definition: VertexMonitor.h:74
MonitorElement * GoodPVtxSumPt
Definition: VertexMonitor.h:83
MonitorElement * GoodPVtxChi2ProbVsGoodPVtx
Definition: VertexMonitor.h:94
edm::InputTag selectedPrimaryVertexInputTag_
Definition: VertexMonitor.h:54
MonitorElement * NumberOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:66
MonitorElement * GoodPVtxChi2ProbVsBXlumi
Definition: VertexMonitor.h:95
MonitorElement * NumberOfBADndofPVtxVsBXlumi
Definition: VertexMonitor.h:75
MonitorElement * NumberOfPVtx
Definition: VertexMonitor.h:62
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtxNdof
Definition: VertexMonitor.h:90
GetLumi * lumiDetails_
Definition: VertexMonitor.h:60
MonitorElement * NumberOfGoodPVtx
Definition: VertexMonitor.h:65
VertexMonitor::VertexMonitor ( const edm::ParameterSet iConfig,
const edm::InputTag primaryVertexInputTag,
const edm::InputTag selectedPrimaryVertexInputTag,
std::string  pvLabel,
edm::ConsumesCollector iC 
)

Definition at line 59 of file VertexMonitor.cc.

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

64  : VertexMonitor(iConfig, primaryVertexInputTag, selectedPrimaryVertexInputTag, pvLabel) {
65  if (doPlotsVsBXlumi_)
66  lumiDetails_ = new GetLumi(iConfig.getParameter<edm::ParameterSet>("BXlumiSetup"), iC);
67 
70 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: VertexMonitor.h:57
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:98
edm::InputTag primaryVertexInputTag_
Definition: VertexMonitor.h:53
edm::EDGetTokenT< reco::VertexCollection > selpvToken_
Definition: VertexMonitor.h:58
VertexMonitor(const edm::ParameterSet &, const edm::InputTag &, const edm::InputTag &, std::string pvLabel)
edm::InputTag selectedPrimaryVertexInputTag_
Definition: VertexMonitor.h:54
GetLumi * lumiDetails_
Definition: VertexMonitor.h:60
VertexMonitor::~VertexMonitor ( )
virtual

Definition at line 72 of file VertexMonitor.cc.

72  {
73  // do anything here that needs to be done at desctruction time
74  // (e.g. close files, deallocate resources etc.)
75  // if (lumiDetails_) delete lumiDetails_;
76 }

Member Function Documentation

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

Definition at line 85 of file VertexMonitor.cc.

References reco::Vertex::chi2(), doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, dqm::impl::MonitorElement::Fill(), FractionOfGoodPVtx, FractionOfGoodPVtxVsBXlumi, FractionOfGoodPVtxVsGoodPVtx, FractionOfGoodPVtxVsPVtx, edm::Event::getByToken(), GetLumi::getValue(), GoodPVtxChi2oNDFVsBXlumi, GoodPVtxChi2oNDFVsGoodPVtx, GoodPVtxChi2ProbVsBXlumi, GoodPVtxChi2ProbVsGoodPVtx, GoodPVtxNumberOfTracks, GoodPVtxNumberOfTracksVsBXlumi, GoodPVtxNumberOfTracksVsGoodPVtx, GoodPVtxSumPt, GoodPVtxSumPtVsBXlumi, GoodPVtxSumPtVsGoodPVtx, createfilelist::int, edm::HandleBase::isValid(), lumiDetails_, reco::Vertex::ndof(), reco::Vertex::normalizedChi2(), 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().

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

Definition at line 370 of file VertexMonitor.cc.

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

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

Definition at line 176 of file VertexMonitor.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), BXlumiParameters_cfi::BXlumiBin, BXlumiParameters_cfi::BXlumiMax, BXlumiParameters_cfi::BXlumiMin, beam_dqm_sourceclient-live_cfg::Chi2NDFMax, beam_dqm_sourceclient-live_cfg::Chi2NDFMin, Chi2oNDFVsBXlumi, MonitorTrackSTAMuons_cfi::Chi2ProbMax, MonitorTrackSTAMuons_cfi::Chi2ProbMin, Chi2ProbVsBXlumi, conf_, doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, FractionOfGoodPVtx, FractionOfGoodPVtxVsBXlumi, FractionOfGoodPVtxVsGoodPVtx, FractionOfGoodPVtxVsPVtx, edm::ParameterSet::getParameter(), dqm::legacy::MonitorElement::getTH1(), TrackerCollisionTrackingMonitor_cfi::GoodPVtxBin, GoodPVtxChi2oNDFVsBXlumi, GoodPVtxChi2oNDFVsGoodPVtx, GoodPVtxChi2ProbVsBXlumi, GoodPVtxChi2ProbVsGoodPVtx, TrackerCollisionTrackingMonitor_cfi::GoodPVtxMax, TrackerCollisionTrackingMonitor_cfi::GoodPVtxMin, GoodPVtxNumberOfTracks, GoodPVtxNumberOfTracksVsBXlumi, GoodPVtxNumberOfTracksVsGoodPVtx, GoodPVtxSumPt, GoodPVtxSumPtVsBXlumi, GoodPVtxSumPtVsGoodPVtx, histname, label_, NumberOfBADndofPVtx, NumberOfBADndofPVtxVsBXlumi, NumberOfBADndofPVtxVsGoodPVtx, NumberOfGoodPVtx, NumberOfGoodPVtxVsBXlumi, NumberOfPVtx, NumberOfPVtxVsBXlumi, NumberOfPVtxVsGoodPVtx, dqm::impl::MonitorElement::setAxisTitle(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

176  {
177  // parameters from the configuration
178  std::string MEFolderName = conf_.getParameter<std::string>("PVFolderName");
179 
180  // get binning from the configuration
181  int GoodPVtxBin = conf_.getParameter<int>("GoodPVtxBin");
182  double GoodPVtxMin = conf_.getParameter<double>("GoodPVtxMin");
183  double GoodPVtxMax = conf_.getParameter<double>("GoodPVtxMax");
184 
185  // book histo
186  // ----------------------//
187  ibooker.setCurrentFolder(MEFolderName + "/" + label_);
188 
189  histname = "NumberOfPVtx_" + label_;
190  NumberOfPVtx = ibooker.book1D(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax);
191  NumberOfPVtx->setAxisTitle("Number of PV", 1);
192  NumberOfPVtx->setAxisTitle("Number of Events", 2);
193 
194  histname = "NumberOfGoodPVtx_" + label_;
195  NumberOfGoodPVtx = ibooker.book1D(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax);
196  NumberOfGoodPVtx->setAxisTitle("Number of Good PV", 1);
197  NumberOfGoodPVtx->setAxisTitle("Number of Events", 2);
198 
199  histname = "FractionOfGoodPVtx_" + label_;
200  FractionOfGoodPVtx = ibooker.book1D(histname, histname, 100, 0., 1.);
201  FractionOfGoodPVtx->setAxisTitle("fraction of Good PV", 1);
202  FractionOfGoodPVtx->setAxisTitle("Number of Events", 2);
203 
204  histname = "NumberOfBADndofPVtx_" + label_;
205  NumberOfBADndofPVtx = ibooker.book1D(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax);
206  NumberOfBADndofPVtx->setAxisTitle("Number of BADndof #PV", 1);
207  NumberOfBADndofPVtx->setAxisTitle("Number of Events", 2);
208 
209  histname = "GoodPVtxSumPt_" + label_;
210  GoodPVtxSumPt = ibooker.book1D(histname, histname, 100, 0., 500.);
211  GoodPVtxSumPt->setAxisTitle("primary vertex #Sum p_{T}^{2} [GeV^{2}/c^{2}]", 1);
212  GoodPVtxSumPt->setAxisTitle("Number of events", 2);
213 
214  histname = "GoodPVtxNumberOfTracks_" + label_;
215  GoodPVtxNumberOfTracks = ibooker.book1D(histname, histname, 100, 0., 100.);
216  GoodPVtxNumberOfTracks->setAxisTitle("primary vertex number of tracks", 1);
217  GoodPVtxNumberOfTracks->setAxisTitle("Number of events", 2);
218 
219  if (doPlotsVsBXlumi_) {
220  // get binning from the configuration
221  edm::ParameterSet BXlumiParameters = conf_.getParameter<edm::ParameterSet>("BXlumiSetup");
222  int BXlumiBin = BXlumiParameters.getParameter<int>("BXlumiBin");
223  double BXlumiMin = BXlumiParameters.getParameter<double>("BXlumiMin");
224  double BXlumiMax = BXlumiParameters.getParameter<double>("BXlumiMax");
225 
226  ibooker.setCurrentFolder(MEFolderName + "/" + label_ + "/PUmonitoring/");
227 
228  histname = "NumberOfPVtxVsBXlumi_" + label_;
229  NumberOfPVtxVsBXlumi = ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 60., "");
230  NumberOfPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
231  NumberOfPVtxVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
232  NumberOfPVtxVsBXlumi->setAxisTitle("Mean number of PV", 2);
233 
234  histname = "NumberOfGoodPVtxVsBXlumi_" + label_;
235  NumberOfGoodPVtxVsBXlumi = ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 60., "");
236  NumberOfGoodPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
237  NumberOfGoodPVtxVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
238  NumberOfGoodPVtxVsBXlumi->setAxisTitle("Mean number of PV", 2);
239 
240  histname = "FractionOfGoodPVtxVsBXlumi_" + label_;
241  FractionOfGoodPVtxVsBXlumi = ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 1.5, "");
242  FractionOfGoodPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
243  FractionOfGoodPVtxVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
244  FractionOfGoodPVtxVsBXlumi->setAxisTitle("Mean number of PV", 2);
245 
246  histname = "NumberOfBADndofPVtxVsBXlumi_" + label_;
247  NumberOfBADndofPVtxVsBXlumi = ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 60., "");
248  NumberOfBADndofPVtxVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
249  NumberOfBADndofPVtxVsBXlumi->setAxisTitle("BADndof #PV", 1);
250  NumberOfBADndofPVtxVsBXlumi->setAxisTitle("Number of Events", 2);
251 
252  histname = "GoodPVtxSumPtVsBXlumi_" + label_;
253  GoodPVtxSumPtVsBXlumi = ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 500., "");
254  GoodPVtxSumPtVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
255  GoodPVtxSumPtVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
256  GoodPVtxSumPtVsBXlumi->setAxisTitle("Mean pv #Sum p_{T}^{2} [GeV^{2}/c]^{2}", 2);
257 
258  histname = "GoodPVtxNumberOfTracksVsBXlumi_" + label_;
260  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, 0., 100., "");
261  GoodPVtxNumberOfTracksVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
262  GoodPVtxNumberOfTracksVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
263  GoodPVtxNumberOfTracksVsBXlumi->setAxisTitle("Mean pv number of tracks", 2);
264 
265  // get binning from the configuration
266  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
267  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
268 
269  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
270  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
271 
272  histname = "Chi2oNDFVsBXlumi_" + label_;
274  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2NDFMin, Chi2NDFMax, "");
275  Chi2oNDFVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
276  Chi2oNDFVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
277  Chi2oNDFVsBXlumi->setAxisTitle("Mean #chi^{2}/ndof", 2);
278 
279  histname = "Chi2ProbVsBXlumi_" + label_;
281  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2ProbMin, Chi2ProbMax, "");
282  Chi2ProbVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
283  Chi2ProbVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
284  Chi2ProbVsBXlumi->setAxisTitle("Mean #chi^{2}/prob", 2);
285 
286  histname = "GoodPVtxChi2oNDFVsBXlumi_" + label_;
288  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2NDFMin, Chi2NDFMax, "");
289  GoodPVtxChi2oNDFVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
290  GoodPVtxChi2oNDFVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
291  GoodPVtxChi2oNDFVsBXlumi->setAxisTitle("Mean PV #chi^{2}/ndof", 2);
292 
293  histname = "GoodPVtxChi2ProbVsBXlumi_" + label_;
295  ibooker.bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2ProbMin, Chi2ProbMax, "");
296  GoodPVtxChi2ProbVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
297  GoodPVtxChi2ProbVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]", 1);
298  GoodPVtxChi2ProbVsBXlumi->setAxisTitle("Mean PV #chi^{2}/prob", 2);
299  }
300 
301  if (doPlotsVsGoodPVtx_) {
302  ibooker.setCurrentFolder(MEFolderName + "/" + label_ + "/PUmonitoring/VsGoodPVtx");
303 
304  histname = "NumberOfPVtxVsGoodPVtx_" + label_;
306  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, 0., 60., "");
307  NumberOfPVtxVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
308  NumberOfPVtxVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
309  NumberOfPVtxVsGoodPVtx->setAxisTitle("Mean number of PV", 2);
310 
311  histname = "FractionOfGoodPVtxVsGoodPVtx_" + label_;
313  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, 0., 60., "");
314  FractionOfGoodPVtxVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
315  FractionOfGoodPVtxVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
316  FractionOfGoodPVtxVsGoodPVtx->setAxisTitle("Mean fraction of Good PV", 2);
317 
318  histname = "FractionOfGoodPVtxVsPVtx_" + label_;
320  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, 0., 60., "");
321  FractionOfGoodPVtxVsPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
322  FractionOfGoodPVtxVsPVtx->setAxisTitle("Number of Good PV", 1);
323  FractionOfGoodPVtxVsPVtx->setAxisTitle("Mean number of Good PV", 2);
324 
325  histname = "NumberOfBADndofPVtxVsGoodPVtx_" + label_;
327  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, 0., 60., "");
328  NumberOfBADndofPVtxVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
329  NumberOfBADndofPVtxVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
330  NumberOfBADndofPVtxVsGoodPVtx->setAxisTitle("Mean Number of BAD PV", 2);
331 
332  histname = "GoodPVtxSumPtVsGoodPVtx_" + label_;
334  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, 0., 500., "");
335  GoodPVtxSumPtVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
336  GoodPVtxSumPtVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
337  GoodPVtxSumPtVsGoodPVtx->setAxisTitle("Mean pv #Sum p_{T}^{2} [GeV^{2}/c]^{2}", 2);
338 
339  histname = "GoodPVtxNumberOfTracksVsGoodPVtx_" + label_;
341  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, 0., 100., "");
342  GoodPVtxNumberOfTracksVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
343  GoodPVtxNumberOfTracksVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
344  GoodPVtxNumberOfTracksVsGoodPVtx->setAxisTitle("Mean pv number of tracks", 2);
345 
346  // get binning from the configuration
347  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
348  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
349 
350  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
351  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
352 
353  histname = "GoodPVtxChi2oNDFVsGoodPVtx_" + label_;
355  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, Chi2NDFMin, Chi2NDFMax, "");
356  GoodPVtxChi2oNDFVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
357  GoodPVtxChi2oNDFVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
358  GoodPVtxChi2oNDFVsGoodPVtx->setAxisTitle("Mean PV #chi^{2}/ndof", 2);
359 
360  histname = "GoodPVtxChi2ProbVsGoodPVtx_" + label_;
362  ibooker.bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, Chi2ProbMin, Chi2ProbMax, "");
363  GoodPVtxChi2ProbVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
364  GoodPVtxChi2ProbVsGoodPVtx->setAxisTitle("Number of Good PV", 1);
365  GoodPVtxChi2ProbVsGoodPVtx->setAxisTitle("Mean PV #chi^{2}/prob", 2);
366  }
367 }
T getParameter(std::string const &) const
bool doPlotsVsGoodPVtx_
Definition: VertexMonitor.h:99
MonitorElement * GoodPVtxNumberOfTracks
Definition: VertexMonitor.h:87
std::string label_
Definition: VertexMonitor.h:55
MonitorElement * GoodPVtxChi2oNDFVsBXlumi
Definition: VertexMonitor.h:93
edm::ParameterSet conf_
Definition: VertexMonitor.h:51
std::string histname
MonitorElement * GoodPVtxSumPtVsBXlumi
Definition: VertexMonitor.h:84
MonitorElement * GoodPVtxNumberOfTracksVsBXlumi
Definition: VertexMonitor.h:88
bool doPlotsVsBXlumi_
Definition: VertexMonitor.h:98
MonitorElement * NumberOfBADndofPVtxVsGoodPVtx
Definition: VertexMonitor.h:76
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtx
Definition: VertexMonitor.h:89
MonitorElement * GoodPVtxChi2oNDFVsGoodPVtx
Definition: VertexMonitor.h:92
MonitorElement * FractionOfGoodPVtxVsPVtx
Definition: VertexMonitor.h:70
MonitorElement * Chi2oNDFVsBXlumi
Definition: VertexMonitor.h:79
MonitorElement * FractionOfGoodPVtx
Definition: VertexMonitor.h:67
MonitorElement * FractionOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:68
MonitorElement * GoodPVtxSumPtVsGoodPVtx
Definition: VertexMonitor.h:85
MonitorElement * NumberOfPVtxVsBXlumi
Definition: VertexMonitor.h:63
MonitorElement * NumberOfPVtxVsGoodPVtx
Definition: VertexMonitor.h:64
MonitorElement * FractionOfGoodPVtxVsGoodPVtx
Definition: VertexMonitor.h:69
MonitorElement * NumberOfBADndofPVtx
Definition: VertexMonitor.h:74
MonitorElement * GoodPVtxSumPt
Definition: VertexMonitor.h:83
MonitorElement * Chi2ProbVsBXlumi
Definition: VertexMonitor.h:81
MonitorElement * GoodPVtxChi2ProbVsGoodPVtx
Definition: VertexMonitor.h:94
MonitorElement * NumberOfGoodPVtxVsBXlumi
Definition: VertexMonitor.h:66
MonitorElement * GoodPVtxChi2ProbVsBXlumi
Definition: VertexMonitor.h:95
MonitorElement * NumberOfBADndofPVtxVsBXlumi
Definition: VertexMonitor.h:75
MonitorElement * NumberOfPVtx
Definition: VertexMonitor.h:62
virtual TH1 * getTH1() const
MonitorElement * NumberOfGoodPVtx
Definition: VertexMonitor.h:65
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 79 of file VertexMonitor.h.

Referenced by initHisto().

MonitorElement* VertexMonitor::Chi2oNDFVsGoodPVtx

Definition at line 78 of file VertexMonitor.h.

MonitorElement* VertexMonitor::Chi2ProbVsBXlumi

Definition at line 81 of file VertexMonitor.h.

Referenced by initHisto().

MonitorElement* VertexMonitor::Chi2ProbVsGoodPVtx

Definition at line 80 of file VertexMonitor.h.

edm::ParameterSet VertexMonitor::conf_

Definition at line 51 of file VertexMonitor.h.

Referenced by initHisto().

bool VertexMonitor::doAllPlots_

Definition at line 97 of file VertexMonitor.h.

bool VertexMonitor::doPlotsVsBXlumi_

Definition at line 98 of file VertexMonitor.h.

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

bool VertexMonitor::doPlotsVsGoodPVtx_

Definition at line 99 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtx

Definition at line 67 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtxVsBXlumi

Definition at line 68 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtxVsGoodPVtx

Definition at line 69 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::FractionOfGoodPVtxVsPVtx

Definition at line 70 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2oNDFVsBXlumi

Definition at line 93 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2oNDFVsGoodPVtx

Definition at line 92 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2ProbVsBXlumi

Definition at line 95 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxChi2ProbVsGoodPVtx

Definition at line 94 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracks

Definition at line 87 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracksVsBXlumi

Definition at line 88 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracksVsGoodPVtx

Definition at line 89 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxNumberOfTracksVsGoodPVtxNdof

Definition at line 90 of file VertexMonitor.h.

MonitorElement* VertexMonitor::GoodPVtxSumPt

Definition at line 83 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxSumPtVsBXlumi

Definition at line 84 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::GoodPVtxSumPtVsGoodPVtx

Definition at line 85 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

std::string VertexMonitor::histname

Definition at line 101 of file VertexMonitor.h.

Referenced by initHisto().

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

Definition at line 60 of file VertexMonitor.h.

Referenced by analyze(), and VertexMonitor().

MonitorElement* VertexMonitor::NumberOfBADndofPVtx

Definition at line 74 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfBADndofPVtxVsBXlumi

Definition at line 75 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfBADndofPVtxVsGoodPVtx

Definition at line 76 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfFakePVtx

Definition at line 71 of file VertexMonitor.h.

MonitorElement* VertexMonitor::NumberOfFakePVtxVsBXlumi

Definition at line 72 of file VertexMonitor.h.

MonitorElement* VertexMonitor::NumberOfFakePVtxVsGoodPVtx

Definition at line 73 of file VertexMonitor.h.

MonitorElement* VertexMonitor::NumberOfGoodPVtx

Definition at line 65 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfGoodPVtxVsBXlumi

Definition at line 66 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfPVtx

Definition at line 62 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfPVtxVsBXlumi

Definition at line 63 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

MonitorElement* VertexMonitor::NumberOfPVtxVsGoodPVtx

Definition at line 64 of file VertexMonitor.h.

Referenced by analyze(), and initHisto().

edm::InputTag VertexMonitor::primaryVertexInputTag_

Definition at line 53 of file VertexMonitor.h.

Referenced by VertexMonitor().

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

Definition at line 57 of file VertexMonitor.h.

Referenced by analyze(), and VertexMonitor().

edm::InputTag VertexMonitor::selectedPrimaryVertexInputTag_

Definition at line 54 of file VertexMonitor.h.

Referenced by VertexMonitor().

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

Definition at line 58 of file VertexMonitor.h.

Referenced by analyze(), and VertexMonitor().