23 primaryVertexInputTag_(primaryVertexInputTag),
24 selectedPrimaryVertexInputTag_(selectedPrimaryVertexInputTag),
26 NumberOfPVtx(nullptr),
27 NumberOfPVtxVsBXlumi(nullptr),
28 NumberOfPVtxVsGoodPVtx(nullptr),
29 NumberOfGoodPVtx(nullptr),
30 NumberOfGoodPVtxVsBXlumi(nullptr),
31 FractionOfGoodPVtx(nullptr),
32 FractionOfGoodPVtxVsBXlumi(nullptr),
33 FractionOfGoodPVtxVsGoodPVtx(nullptr),
34 FractionOfGoodPVtxVsPVtx(nullptr),
35 NumberOfBADndofPVtx(nullptr),
36 NumberOfBADndofPVtxVsBXlumi(nullptr),
37 NumberOfBADndofPVtxVsGoodPVtx(nullptr),
38 GoodPVtxSumPt(nullptr),
39 GoodPVtxSumPtVsBXlumi(nullptr),
40 GoodPVtxSumPtVsGoodPVtx(nullptr),
41 GoodPVtxNumberOfTracks(nullptr),
42 GoodPVtxNumberOfTracksVsBXlumi(nullptr),
43 GoodPVtxNumberOfTracksVsGoodPVtx(nullptr),
44 GoodPVtxNumberOfTracksVsGoodPVtxNdof(nullptr),
45 GoodPVtxChi2oNDFVsGoodPVtx(nullptr),
46 GoodPVtxChi2oNDFVsBXlumi(nullptr),
47 GoodPVtxChi2ProbVsGoodPVtx(nullptr),
48 GoodPVtxChi2ProbVsBXlumi(nullptr),
49 doAllPlots_(conf_.getParameter<bool>(
"doAllPlots")),
50 doPlotsVsBXlumi_(conf_.getParameter<bool>(
"doPlotsVsBXlumi")),
51 doPlotsVsGoodPVtx_(conf_.getParameter<bool>(
"doPlotsVsGoodPVtx"))
64 :
VertexMonitor(iConfig, primaryVertexInputTag, selectedPrimaryVertexInputTag, pvLabel) {
91 size_t totalNumPV = 0;
92 size_t totalNumBADndofPV = 0;
95 totalNumPV = pvHandle->size();
97 for (reco::VertexCollection::const_iterator
pv = pvHandle->begin();
pv != pvHandle->end(); ++
pv) {
111 size_t totalNumGoodPV = 0;
114 totalNumGoodPV = selpvHandle->size();
123 double fracGoodPV = double(totalNumGoodPV) / double(totalNumPV);
137 if (!selpvHandle->empty()) {
141 double chi2prob = 0.;
143 if (!selpvHandle->at(0).isFake()) {
148 chi2prob = TMath::Prob(pv.
chi2(), (int)pv.
ndof());
151 double pt = (**itrk).pt();
180 int GoodPVtxBin = ParametersGoodPVtx.
getParameter<
int>(
"GoodPVtxBin");
181 double GoodPVtxMin = ParametersGoodPVtx.getParameter<
double>(
"GoodPVtxMin");
182 double GoodPVtxMax = ParametersGoodPVtx.getParameter<
double>(
"GoodPVtxMax");
185 int NTrkPVtxBin = ParametersNTrkPVtx.
getParameter<
int>(
"NTrkPVtxBin");
186 double NTrkPVtxMin = ParametersNTrkPVtx.getParameter<
double>(
"NTrkPVtxMin");
187 double NTrkPVtxMax = ParametersNTrkPVtx.getParameter<
double>(
"NTrkPVtxMax");
190 int SumPtPVtxBin = ParametersSumPtPVtx.
getParameter<
int>(
"SumPtPVtxBin");
191 double SumPtPVtxMin = ParametersSumPtPVtx.getParameter<
double>(
"SumPtPVtxMin");
192 double SumPtPVtxMax = ParametersSumPtPVtx.getParameter<
double>(
"SumPtPVtxMax");
231 int BXlumiBin = BXlumiParameters.
getParameter<
int>(
"BXlumiBin");
232 double BXlumiMin = BXlumiParameters.
getParameter<
double>(
"BXlumiMin");
233 double BXlumiMax = BXlumiParameters.
getParameter<
double>(
"BXlumiMax");
287 ibooker.
bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2NDFMin, Chi2NDFMax * 3,
"");
292 histname =
"Chi2ProbVsBXlumi_" +
label_;
294 ibooker.
bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2ProbMin, Chi2ProbMax * 3,
"");
299 histname =
"GoodPVtxChi2oNDFVsBXlumi_" +
label_;
301 ibooker.
bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2NDFMin, Chi2NDFMax,
"");
306 histname =
"GoodPVtxChi2ProbVsBXlumi_" +
label_;
308 ibooker.
bookProfile(histname, histname, BXlumiBin, BXlumiMin, BXlumiMax, Chi2ProbMin, Chi2ProbMax * 3,
"");
319 histname,
histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3,
"");
326 histname,
histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3,
"");
333 histname,
histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3,
"");
340 histname,
histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, GoodPVtxMin, GoodPVtxMax * 3,
"");
347 histname,
histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, SumPtPVtxMin, SumPtPVtxMax * 3,
"");
354 histname,
histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, NTrkPVtxMin, NTrkPVtxMax * 3,
"");
368 ibooker.
bookProfile(histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, Chi2NDFMin, Chi2NDFMax * 3,
"");
373 histname =
"GoodPVtxChi2ProbVsGoodPVtx_" +
label_;
375 histname, histname, GoodPVtxBin, GoodPVtxMin, GoodPVtxMax, Chi2ProbMin, Chi2ProbMax * 3,
"");
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::VertexCollection > pvToken_
MonitorElement * GoodPVtxNumberOfTracks
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * GoodPVtxChi2oNDFVsBXlumi
MonitorElement * GoodPVtxSumPtVsBXlumi
MonitorElement * GoodPVtxNumberOfTracksVsBXlumi
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual void initHisto(DQMStore::IBooker &ibooker)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * NumberOfBADndofPVtxVsGoodPVtx
MonitorElement * GoodPVtxNumberOfTracksVsGoodPVtx
MonitorElement * GoodPVtxChi2oNDFVsGoodPVtx
MonitorElement * FractionOfGoodPVtxVsPVtx
double getValue(const edm::Event &)
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
void addDefault(ParameterSetDescription const &psetDescription)
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())
edm::InputTag primaryVertexInputTag_
MonitorElement * Chi2oNDFVsBXlumi
double chi2() const
chi-squares
trackRef_iterator tracks_end() const
last iterator over tracks
MonitorElement * FractionOfGoodPVtx
MonitorElement * FractionOfGoodPVtxVsBXlumi
MonitorElement * GoodPVtxSumPtVsGoodPVtx
MonitorElement * NumberOfPVtxVsBXlumi
MonitorElement * NumberOfPVtxVsGoodPVtx
trackRef_iterator tracks_begin() const
first iterator over tracks
edm::EDGetTokenT< reco::VertexCollection > selpvToken_
size_t tracksSize() const
number of tracks
MonitorElement * FractionOfGoodPVtxVsGoodPVtx
MonitorElement * NumberOfBADndofPVtx
VertexMonitor(const edm::ParameterSet &, const edm::InputTag &, const edm::InputTag &, std::string pvLabel)
T getParameter(std::string const &) const
MonitorElement * GoodPVtxSumPt
MonitorElement * Chi2ProbVsBXlumi
MonitorElement * GoodPVtxChi2ProbVsGoodPVtx
edm::InputTag selectedPrimaryVertexInputTag_
MonitorElement * NumberOfGoodPVtxVsBXlumi
MonitorElement * GoodPVtxChi2ProbVsBXlumi
double normalizedChi2() const
chi-squared divided by n.d.o.f.
MonitorElement * NumberOfBADndofPVtxVsBXlumi
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * NumberOfPVtx
virtual TH1 * getTH1() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
MonitorElement * NumberOfGoodPVtx
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)