13 #include <fmt/format.h> 19 : vertexInputTag_(pSet.getParameter<
InputTag>(
"vertexLabel")),
20 beamSpotInputTag_(pSet.getParameter<
InputTag>(
"beamSpotLabel")),
22 scoreToken_(consumes<
VertexScore>(vertexInputTag_)),
23 beamspotToken_(consumes<
reco::
BeamSpot>(beamSpotInputTag_)),
25 TopFolderName_(pSet.getParameter<
std::
string>(
"TopFolderName")),
26 AlignmentLabel_(pSet.getParameter<
std::
string>(
"AlignmentLabel")),
27 ndof_(pSet.getParameter<
int>(
"ndof")),
28 useHPfoAlignmentPlots_(pSet.getParameter<
bool>(
"useHPforAlignmentPlots")),
37 bsBeamWidthX(nullptr),
38 bsBeamWidthY(nullptr),
73 nbtksinvtx[0] = iBooker.
book1D(
"otherVtxTrksNbr",
"Reconstructed Tracks in Vertex (other Vtx)", 40, -0.5, 99.5);
75 "otherVtxTrksVsZ",
"Reconstructed Tracks in Vertex (other Vtx) vs Z", 80, -20., 20., 50, 0, 100,
"");
79 score[0] = iBooker.
book1D(
"otherVtxScore",
"sqrt(score) (other Vtx)", 100, 0., 400.);
80 trksWeight[0] = iBooker.
book1D(
"otherVtxTrksWeight",
"Total weight of Tracks in Vertex (other Vtx)", 40, 0, 100.);
81 vtxchi2[0] = iBooker.
book1D(
"otherVtxChi2",
"#chi^{2} (other Vtx)", 100, 0., 200.);
82 vtxndf[0] = iBooker.
book1D(
"otherVtxNdf",
"ndof (other Vtx)", 100, 0., 200.);
83 vtxprob[0] = iBooker.
book1D(
"otherVtxProb",
"#chi^{2} probability (other Vtx)", 100, 0., 1.);
84 nans[0] = iBooker.
book1D(
"otherVtxNans",
"Illegal values for x,y,z,xx,xy,xz,yy,yz,zz (other Vtx)", 9, 0.5, 9.5);
86 nbtksinvtx[1] = iBooker.
book1D(
"tagVtxTrksNbr",
"Reconstructed Tracks in Vertex (tagged Vtx)", 100, -0.5, 99.5);
88 "tagVtxTrksVsZ",
"Reconstructed Tracks in Vertex (tagged Vtx) vs Z", 80, -20., 20., 50, 0, 100,
"");
92 score[1] = iBooker.
book1D(
"tagVtxScore",
"sqrt(score) (tagged Vtx)", 100, 0., 400.);
93 trksWeight[1] = iBooker.
book1D(
"tagVtxTrksWeight",
"Total weight of Tracks in Vertex (tagged Vtx)", 100, 0, 100.);
94 vtxchi2[1] = iBooker.
book1D(
"tagVtxChi2",
"#chi^{2} (tagged Vtx)", 100, 0., 200.);
95 vtxndf[1] = iBooker.
book1D(
"tagVtxNdf",
"ndof (tagged Vtx)", 100, 0., 200.);
96 vtxprob[1] = iBooker.
book1D(
"tagVtxProb",
"#chi^{2} probability (tagged Vtx)", 100, 0., 1.);
97 nans[1] = iBooker.
book1D(
"tagVtxNans",
"Illegal values for x,y,z,xx,xy,xz,yy,yz,zz (tagged Vtx)", 9, 0.5, 9.5);
99 xrec[0] = iBooker.
book1D(
"otherPosX",
"Position x Coordinate (other Vtx)", 100, vposx - 0.1, vposx + 0.1);
100 yrec[0] = iBooker.
book1D(
"otherPosY",
"Position y Coordinate (other Vtx)", 100, vposy - 0.1, vposy + 0.1);
101 zrec[0] = iBooker.
book1D(
"otherPosZ",
"Position z Coordinate (other Vtx)", 100, -20., 20.);
102 xDiff[0] = iBooker.
book1D(
"otherDiffX",
"X distance from BeamSpot (other Vtx)", 100, -500, 500);
103 yDiff[0] = iBooker.
book1D(
"otherDiffY",
"Y distance from BeamSpot (other Vtx)", 100, -500, 500);
104 xerr[0] = iBooker.
book1D(
"otherErrX",
"Uncertainty x Coordinate (other Vtx)", 100, 0., 100);
105 yerr[0] = iBooker.
book1D(
"otherErrY",
"Uncertainty y Coordinate (other Vtx)", 100, 0., 100);
106 zerr[0] = iBooker.
book1D(
"otherErrZ",
"Uncertainty z Coordinate (other Vtx)", 100, 0., 100);
108 "otherErrVsWeightX",
"Uncertainty x Coordinate vs. track weight (other Vtx)", 100, 0, 100., 100, 0., 100);
110 "otherErrVsWeightY",
"Uncertainty y Coordinate vs. track weight (other Vtx)", 100, 0, 100., 100, 0., 100);
112 "otherErrVsWeightZ",
"Uncertainty z Coordinate vs. track weight (other Vtx)", 100, 0, 100., 100, 0., 100);
114 xrec[1] = iBooker.
book1D(
"tagPosX",
"Position x Coordinate (tagged Vtx)", 100, vposx - 0.1, vposx + 0.1);
115 yrec[1] = iBooker.
book1D(
"tagPosY",
"Position y Coordinate (tagged Vtx)", 100, vposy - 0.1, vposy + 0.1);
116 zrec[1] = iBooker.
book1D(
"tagPosZ",
"Position z Coordinate (tagged Vtx)", 100, -20., 20.);
117 xDiff[1] = iBooker.
book1D(
"tagDiffX",
"X distance from BeamSpot (tagged Vtx)", 100, -500, 500);
118 yDiff[1] = iBooker.
book1D(
"tagDiffY",
"Y distance from BeamSpot (tagged Vtx)", 100, -500, 500);
119 xerr[1] = iBooker.
book1D(
"tagErrX",
"Uncertainty x Coordinate (tagged Vtx)", 100, 0., 100);
120 yerr[1] = iBooker.
book1D(
"tagErrY",
"Uncertainty y Coordinate (tagged Vtx)", 100, 0., 100);
121 zerr[1] = iBooker.
book1D(
"tagErrZ",
"Uncertainty z Coordinate (tagged Vtx)", 100, 0., 100);
123 "tagErrVsWeightX",
"Uncertainty x Coordinate vs. track weight (tagged Vtx)", 100, 0, 100., 100, 0., 100);
125 "tagErrVsWeightY",
"Uncertainty y Coordinate vs. track weight (tagged Vtx)", 100, 0, 100., 100, 0., 100);
127 "tagErrVsWeightZ",
"Uncertainty z Coordinate vs. track weight (tagged Vtx)", 100, 0, 100., 100, 0., 100);
129 type[0] = iBooker.
book1D(
"otherType",
"Vertex type (other Vtx)", 3, -0.5, 2.5);
130 type[1] = iBooker.
book1D(
"tagType",
"Vertex type (tagged Vtx)", 3, -0.5, 2.5);
131 for (
int i = 0;
i < 2; ++
i) {
133 type[
i]->setBinLabel(2,
"Valid, fake");
134 type[
i]->setBinLabel(3,
"Invalid");
141 bsX = iBooker.
book1D(
"bsX",
"BeamSpot x0", 100, vposx - 0.1, vposx + 0.1);
142 bsY = iBooker.
book1D(
"bsY",
"BeamSpot y0", 100, vposy - 0.1, vposy + 0.1);
143 bsZ = iBooker.
book1D(
"bsZ",
"BeamSpot z0", 100, -2., 2.);
144 bsSigmaZ = iBooker.
book1D(
"bsSigmaZ",
"BeamSpot sigmaZ", 100, 0., 10.);
145 bsDxdz = iBooker.
book1D(
"bsDxdz",
"BeamSpot dxdz", 100, -0.0003, 0.0003);
146 bsDydz = iBooker.
book1D(
"bsDydz",
"BeamSpot dydz", 100, -0.0003, 0.0003);
149 bsType = iBooker.
book1D(
"bsType",
"BeamSpot type", 4, -1.5, 2.5);
175 ntracks = iBooker.
book1D(
"ntracks",
"number of PV tracks (p_{T} > 1 GeV)", TKNoBin, TKNoMin, TKNoMax);
179 weight = iBooker.
book1D(
"weight",
"weight of PV tracks (p_{T} > 1 GeV)", 100, 0., 1.);
180 weight->setAxisTitle(
"weight of PV Tracks (p_{T} > 1 GeV) per Event", 1);
181 weight->setAxisTitle(
"Number of Event", 2);
183 sumpt = iBooker.
book1D(
"sumpt",
"#Sum p_{T} of PV tracks (p_{T} > 1 GeV)", 100, -0.5, 249.5);
184 chi2ndf = iBooker.
book1D(
"chi2ndf",
"PV tracks (p_{T} > 1 GeV) #chi^{2}/ndof", 100, 0., 20.);
185 chi2prob = iBooker.
book1D(
"chi2prob",
"PV tracks (p_{T} > 1 GeV) #chi^{2} probability", 100, 0., 1.);
241 (
varname_.find(
"xy") != std::string::npos) ? 2000. : 10000.);
284 (
varname_.find(
"xy") != std::string::npos) ? 100. : 200.,
297 (
varname_.find(
"xy") != std::string::npos) ? 100. : 200.,
332 (
varname_.find(
"xy") != std::string::npos) ? 100. : 200.,
353 if (recVtxs.
isValid() ==
false || beamSpotHandle.
isValid() ==
false) {
355 <<
" Some products not available in the event: VertexCollection " <<
vertexInputTag_ <<
" " << recVtxs.
isValid()
363 for (
const auto&
v : *recVtxs) {
364 if (
v.tracksSize() > 0) {
365 const auto& ref =
v.trackRefAt(0);
366 if (ref.isNull() || !ref.isAvailable()) {
370 <<
" since likely the track collection the vertex has refs pointing to is missing (at least the first " 371 "TrackBaseRef is null or not available)";
386 for (
auto const&
vx : (*recVtxs))
387 if (
vx.isValid() && !
vx.isFake() &&
vx.ndof() >=
ndof_)
391 if (scores.
isValid() && !(*scores).empty()) {
392 auto pvScore = (*scores).get(0);
394 for (
unsigned int i = 1;
i < (*scores).size(); ++
i)
399 if (!recVtxs->empty()) {
403 for (reco::VertexCollection::const_iterator
v = recVtxs->begin() + 1;
v != recVtxs->end(); ++
v)
425 if (
v.tracksSize() == 0) {
430 const math::XYZPoint myVertex(
v.position().x(),
v.position().y(),
v.position().z());
440 float pt = (**t).pt();
446 float eta = (**t).eta();
447 float phi = (**t).phi();
449 float w =
v.trackWeight(*
t);
450 float chi2NDF = (**t).normalizedChi2();
451 float chi2Prob = TMath::Prob((**t).chi2(), (
int)(**t).ndof());
452 float Dxy = (**t).dxy(myVertex) *
cmToUm;
453 float Dz = (**t).dz(myVertex) *
cmToUm;
454 float DxyErr = (**t).dxyError() *
cmToUm;
455 float DzErr = (**t).dzError() *
cmToUm;
540 if (
v.isValid() && !
v.isFake()) {
573 for (
int k = 0;
k != 3;
k++) {
574 for (
int j =
k;
j != 3;
j++) {
578 if (
j ==
k &&
v.covariance(
k,
j) < 0) {
590 desc.add<
int>(
"ndof", 4);
591 desc.add<
bool>(
"useHPforAlignmentPlots",
true);
594 desc.add<
double>(
"PUMax", 80.0);
595 desc.add<
double>(
"Xpos", 0.1);
596 desc.add<
double>(
"Ypos", 0.0);
597 desc.add<
int>(
"TkSizeBin", 100);
598 desc.add<
double>(
"TkSizeMin", -0.5);
599 desc.add<
double>(
"TkSizeMax", 499.5);
600 desc.add<
int>(
"DxyBin", 100);
601 desc.add<
double>(
"DxyMin", -5000.0);
602 desc.add<
double>(
"DxyMax", 5000.0);
603 desc.add<
int>(
"DzBin", 100);
604 desc.add<
double>(
"DzMin", -2000.0);
605 desc.add<
double>(
"DzMax", 2000.0);
606 desc.add<
int>(
"PhiBin", 32);
609 desc.add<
int>(
"EtaBin", 26);
610 desc.add<
double>(
"EtaMin", 2.5);
611 desc.add<
double>(
"EtaMax", -2.5);
612 desc.add<
int>(
"PhiBin2D", 12);
613 desc.add<
int>(
"EtaBin2D", 8);
MonitorElement * xerrVsTrks[2]
const std::string AlignmentLabel_
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
MonitorElement * vtxndf[2]
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
void pvTracksPlots(const reco::Vertex &v)
virtual void setCurrentFolder(std::string const &fullpath)
const bool useHPfoAlignmentPlots_
dqm::reco::MonitorElement * IPErrVsEta_
void vertexPlots(const reco::Vertex &v, const reco::BeamSpot &beamSpot, int i)
constexpr bool isNotFinite(T x)
MonitorElement * bsSigmaZ
const edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
const std::string dqmLabel
dqm::reco::MonitorElement * IPPull_
std::vector< Vertex > VertexCollection
collection of Vertex objects
dqm::reco::MonitorElement * IPVsEtaVsPhi_
void bookIPMonitor(DQMStore::IBooker &, const edm::ParameterSet &)
MonitorElement * xDiff[2]
const edm::InputTag vertexInputTag_
dqm::reco::MonitorElement * IP_
MonitorElement * ntracksVsZ[2]
const edm::EDGetTokenT< VertexScore > scoreToken_
MonitorElement * zerrVsTrks[2]
MonitorElement * phi_pt10
dqm::reco::MonitorElement * IPVsEta_
dqm::reco::MonitorElement * IPErrVsPhi_
MonitorElement * yerrVsTrks[2]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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())
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
dqm::reco::MonitorElement * IPErr_
float ChiSquaredProbability(double chiSquared, double nrDOF)
#define DEFINE_FWK_MODULE(type)
MonitorElement * vtxchi2[2]
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * eta_pt10
dqm::reco::MonitorElement * IPErrVsEtaVsPhi_
MonitorElement * chi2prob
const edm::ParameterSet conf_
const std::string TopFolderName_
XYZPointD XYZPoint
point in space with cartesian internal representation
MonitorElement * nbtksinvtx[2]
dqm::reco::MonitorElement * IPVsPhi_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
static constexpr int cmToUm
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * vtxprob[2]
const edm::EDGetTokenT< reco::VertexCollection > vertexToken_
Log< level::Warning, false > LogWarning
MonitorElement * bsBeamWidthY
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * score[2]
MonitorElement * yDiff[2]
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
MonitorElement * trksWeight[2]
PrimaryVertexMonitor(const edm::ParameterSet &pSet)
MonitorElement * bsBeamWidthX
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const edm::InputTag beamSpotInputTag_