CMS 3D CMS Logo

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

#include <PrimaryVertexMonitor.h>

Inheritance diagram for PrimaryVertexMonitor:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 PrimaryVertexMonitor (const edm::ParameterSet &pSet)
 
 ~PrimaryVertexMonitor () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Types

using VertexScore = edm::ValueMap< float >
 

Private Member Functions

void pvTracksPlots (const reco::Vertex &v)
 
void vertexPlots (const reco::Vertex &v, const reco::BeamSpot &beamSpot, int i)
 

Private Attributes

std::string AlignmentLabel_
 
edm::InputTag beamSpotInputTag_
 
edm::EDGetTokenT< reco::BeamSpotbeamspotToken_
 
MonitorElementbsBeamWidthX
 
MonitorElementbsBeamWidthY
 
MonitorElementbsDxdz
 
MonitorElementbsDydz
 
MonitorElementbsSigmaZ
 
MonitorElementbsType
 
MonitorElementbsX
 
MonitorElementbsY
 
MonitorElementbsZ
 
MonitorElementchi2ndf
 
MonitorElementchi2prob
 
edm::ParameterSet conf_
 
std::string dqmLabel
 
MonitorElementdxy
 
MonitorElementdxy2
 
MonitorElementdxyErr
 
MonitorElementdxyVsEta_pt1
 
MonitorElementdxyVsEta_pt10
 
MonitorElementdxyVsEtaVsPhi_pt1
 
MonitorElementdxyVsEtaVsPhi_pt10
 
MonitorElementdxyVsPhi_pt1
 
MonitorElementdxyVsPhi_pt10
 
MonitorElementdz
 
MonitorElementdzErr
 
MonitorElementdzVsEta_pt1
 
MonitorElementdzVsEta_pt10
 
MonitorElementdzVsEtaVsPhi_pt1
 
MonitorElementdzVsEtaVsPhi_pt10
 
MonitorElementdzVsPhi_pt1
 
MonitorElementdzVsPhi_pt10
 
bool errorPrinted_
 
MonitorElementnans [2]
 
MonitorElementnbgvtx
 
MonitorElementnbtksinvtx [2]
 
MonitorElementnbvtx
 
int ndof_
 
MonitorElementntracks
 
MonitorElementntracksVsZ [2]
 
MonitorElementscore [2]
 
edm::EDGetTokenT< VertexScorescoreToken_
 
MonitorElementsumpt
 
std::string TopFolderName_
 
MonitorElementtrksWeight [2]
 
MonitorElementtt [2]
 
MonitorElementtype [2]
 
bool useHPfoAlignmentPlots_
 
edm::InputTag vertexInputTag_
 
edm::EDGetTokenT
< reco::VertexCollection
vertexToken_
 
MonitorElementvtxchi2 [2]
 
MonitorElementvtxndf [2]
 
MonitorElementvtxprob [2]
 
MonitorElementweight
 
MonitorElementxDiff [2]
 
MonitorElementxerr [2]
 
MonitorElementxerrVsTrks [2]
 
MonitorElementxrec [2]
 
MonitorElementyDiff [2]
 
MonitorElementyerr [2]
 
MonitorElementyerrVsTrks [2]
 
MonitorElementyrec [2]
 
MonitorElementzerr [2]
 
MonitorElementzerrVsTrks [2]
 
MonitorElementzrec [2]
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 26 of file PrimaryVertexMonitor.h.

Member Typedef Documentation

Definition at line 41 of file PrimaryVertexMonitor.h.

Constructor & Destructor Documentation

PrimaryVertexMonitor::PrimaryVertexMonitor ( const edm::ParameterSet pSet)
explicit

Definition at line 15 of file PrimaryVertexMonitor.cc.

References beamSpotInputTag_, beamspotToken_, edm::ParameterSet::getParameter(), scoreToken_, vertexInputTag_, and vertexToken_.

16  : conf_(pSet),
17  TopFolderName_(pSet.getParameter<std::string>("TopFolderName")),
18  AlignmentLabel_(pSet.getParameter<std::string>("AlignmentLabel")),
19  ndof_(pSet.getParameter<int>("ndof")),
20  useHPfoAlignmentPlots_(pSet.getParameter<bool>("useHPforAlignmentPlots")),
21  errorPrinted_(false),
22  nbvtx(nullptr),
23  bsX(nullptr),
24  bsY(nullptr),
25  bsZ(nullptr),
26  bsSigmaZ(nullptr),
27  bsDxdz(nullptr),
28  bsDydz(nullptr),
29  bsBeamWidthX(nullptr),
30  bsBeamWidthY(nullptr),
31  bsType(nullptr),
32  sumpt(nullptr),
33  ntracks(nullptr),
34  weight(nullptr),
35  chi2ndf(nullptr),
36  chi2prob(nullptr),
37  dxy(nullptr),
38  dxy2(nullptr),
39  dz(nullptr),
40  dxyErr(nullptr),
41  dzErr(nullptr),
42  dxyVsPhi_pt1(nullptr),
43  dzVsPhi_pt1(nullptr),
44  dxyVsEta_pt1(nullptr),
45  dzVsEta_pt1(nullptr),
46  dxyVsEtaVsPhi_pt1(nullptr),
47  dzVsEtaVsPhi_pt1(nullptr),
48  dxyVsPhi_pt10(nullptr),
49  dzVsPhi_pt10(nullptr),
50  dxyVsEta_pt10(nullptr),
51  dzVsEta_pt10(nullptr),
52  dxyVsEtaVsPhi_pt10(nullptr),
53  dzVsEtaVsPhi_pt10(nullptr) {
54  // dqmStore_ = edm::Service<DQMStore>().operator->();
55 
56  vertexInputTag_ = pSet.getParameter<InputTag>("vertexLabel");
57  beamSpotInputTag_ = pSet.getParameter<InputTag>("beamSpotLabel");
58  vertexToken_ = consumes<reco::VertexCollection>(vertexInputTag_);
59  scoreToken_ = consumes<VertexScore>(vertexInputTag_);
60  beamspotToken_ = consumes<reco::BeamSpot>(beamSpotInputTag_);
61 }
MonitorElement * dxyVsEta_pt1
MonitorElement * dzVsPhi_pt10
MonitorElement * dzVsPhi_pt1
MonitorElement * bsSigmaZ
edm::InputTag beamSpotInputTag_
edm::EDGetTokenT< VertexScore > scoreToken_
MonitorElement * dxyVsEtaVsPhi_pt10
MonitorElement * dzVsEtaVsPhi_pt1
MonitorElement * chi2ndf
MonitorElement * dxyVsPhi_pt10
MonitorElement * dzVsEta_pt1
edm::ParameterSet conf_
MonitorElement * dxyVsEta_pt10
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
MonitorElement * dzVsEta_pt10
MonitorElement * dxyVsEtaVsPhi_pt1
MonitorElement * chi2prob
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * ntracks
MonitorElement * bsBeamWidthY
MonitorElement * dzVsEtaVsPhi_pt10
MonitorElement * bsBeamWidthX
MonitorElement * dxyVsPhi_pt1
PrimaryVertexMonitor::~PrimaryVertexMonitor ( )
override

Definition at line 372 of file PrimaryVertexMonitor.cc.

372 {}

Member Function Documentation

void PrimaryVertexMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 374 of file PrimaryVertexMonitor.cc.

References beam_dqm_sourceclient-live_cfg::beamSpot, beamSpotInputTag_, beamspotToken_, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), bsBeamWidthX, bsBeamWidthY, bsDxdz, bsDydz, bsSigmaZ, bsX, bsY, bsZ, reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), errorPrinted_, dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), nbgvtx, nbvtx, ndof_, convertSQLiteXML::ok, pvTracksPlots(), score, scoreToken_, reco::BeamSpot::sigmaZ(), mathSSE::sqrt(), findQualityFiles::v, vertexInputTag_, vertexPlots(), vertexToken_, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

374  {
376  iEvent.getByToken(vertexToken_, recVtxs);
377 
378  Handle<VertexScore> scores;
379  iEvent.getByToken(scoreToken_, scores);
380 
381  edm::Handle<reco::BeamSpot> beamSpotHandle;
382  iEvent.getByToken(beamspotToken_, beamSpotHandle);
383 
384  //
385  // check for absent products and simply "return" in that case
386  //
387  if (recVtxs.isValid() == false || beamSpotHandle.isValid() == false) {
388  edm::LogWarning("PrimaryVertexMonitor")
389  << " Some products not available in the event: VertexCollection " << vertexInputTag_ << " " << recVtxs.isValid()
390  << " BeamSpot " << beamSpotInputTag_ << " " << beamSpotHandle.isValid() << ". Skipping plots for this event";
391  return;
392  }
393 
394  // check upfront that refs to track are (likely) to be valid
395  {
396  bool ok = true;
397  for (const auto& v : *recVtxs) {
398  if (v.tracksSize() > 0) {
399  const auto& ref = v.trackRefAt(0);
400  if (ref.isNull() || !ref.isAvailable()) {
401  if (!errorPrinted_)
402  edm::LogWarning("PrimaryVertexMonitor")
403  << "Skipping vertex collection: " << vertexInputTag_
404  << " since likely the track collection the vertex has refs pointing to is missing (at least the first "
405  "TrackBaseRef is null or not available)";
406  else
407  errorPrinted_ = true;
408  ok = false;
409  }
410  }
411  }
412  if (!ok)
413  return;
414  }
415 
416  BeamSpot beamSpot = *beamSpotHandle;
417 
418  nbvtx->Fill(recVtxs->size() * 1.);
419  int ng = 0;
420  for (auto const& vx : (*recVtxs))
421  if (vx.isValid() && !vx.isFake() && vx.ndof() >= ndof_)
422  ++ng;
423  nbgvtx->Fill(ng * 1.);
424 
425  if (scores.isValid() && !(*scores).empty()) {
426  auto pvScore = (*scores).get(0);
427  score[1]->Fill(std::sqrt(pvScore));
428  for (unsigned int i = 1; i < (*scores).size(); ++i)
429  score[0]->Fill(std::sqrt((*scores).get(i)));
430  }
431 
432  // fill PV tracks MEs (as now, for alignment)
433  if (!recVtxs->empty()) {
434  vertexPlots(recVtxs->front(), beamSpot, 1);
435  pvTracksPlots(recVtxs->front());
436 
437  for (reco::VertexCollection::const_iterator v = recVtxs->begin() + 1; v != recVtxs->end(); ++v)
438  vertexPlots(*v, beamSpot, 0);
439  }
440 
441  // Beamline plots:
442  bsX->Fill(beamSpot.x0());
443  bsY->Fill(beamSpot.y0());
444  bsZ->Fill(beamSpot.z0());
445  bsSigmaZ->Fill(beamSpot.sigmaZ());
446  bsDxdz->Fill(beamSpot.dxdz());
447  bsDydz->Fill(beamSpot.dydz());
448  bsBeamWidthX->Fill(beamSpot.BeamWidthX() * 10000);
449  bsBeamWidthY->Fill(beamSpot.BeamWidthY() * 10000);
450  // bsType->Fill(beamSpot.type());
451 }
double z0() const
z coordinate
Definition: BeamSpot.h:65
void pvTracksPlots(const reco::Vertex &v)
void vertexPlots(const reco::Vertex &v, const reco::BeamSpot &beamSpot, int i)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * bsSigmaZ
edm::InputTag beamSpotInputTag_
edm::EDGetTokenT< VertexScore > scoreToken_
void Fill(long long x)
double dydz() const
dydz slope
Definition: BeamSpot.h:80
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:19
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:82
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
bool isValid() const
Definition: HandleBase.h:70
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
double sigmaZ() const
sigma z
Definition: BeamSpot.h:76
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:84
double y0() const
y coordinate
Definition: BeamSpot.h:63
Log< level::Warning, false > LogWarning
MonitorElement * bsBeamWidthY
MonitorElement * score[2]
MonitorElement * bsBeamWidthX
double x0() const
x coordinate
Definition: BeamSpot.h:61
void PrimaryVertexMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 65 of file PrimaryVertexMonitor.cc.

References AlignmentLabel_, beamSpotInputTag_, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile(), dqm::implementation::IBooker::bookProfile2D(), bsBeamWidthX, bsBeamWidthY, bsDxdz, bsDydz, bsSigmaZ, bsType, bsX, bsY, bsZ, chi2ndf, chi2prob, conf_, dqmLabel, dxy, dxy2, beam_dqm_sourceclient-live_cfg::DxyBin, dxyErr, beam_dqm_sourceclient-live_cfg::DxyMax, beam_dqm_sourceclient-live_cfg::DxyMin, dxyVsEta_pt1, dxyVsEta_pt10, dxyVsEtaVsPhi_pt1, dxyVsEtaVsPhi_pt10, dxyVsPhi_pt1, dxyVsPhi_pt10, dz, dzErr, dzVsEta_pt1, dzVsEta_pt10, dzVsEtaVsPhi_pt1, dzVsEtaVsPhi_pt10, dzVsPhi_pt1, dzVsPhi_pt10, HLT_FULL_cff::EtaMax, Gflash::EtaMin, edm::ParameterSet::getParameter(), mps_fire::i, edm::InputTag::label(), nans, nbgvtx, nbtksinvtx, nbvtx, ntracks, ntracksVsZ, score, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, sumpt, TopFolderName_, trksWeight, vertexInputTag_, vtxchi2, vtxndf, vtxprob, weight, xDiff, xerr, xerrVsTrks, xrec, yDiff, yerr, yerrVsTrks, yrec, zerr, zerrVsTrks, and zrec.

65  {
66  std::string dqmLabel = "";
67 
68  //
69  // Book all histograms.
70  //
71 
72  // get the store
73  dqmLabel = TopFolderName_ + "/" + vertexInputTag_.label();
74  iBooker.setCurrentFolder(dqmLabel);
75 
76  // xPos = iBooker.book1D ("xPos","x Coordinate" ,100, -0.1, 0.1);
77 
78  nbvtx = iBooker.book1D("vtxNbr", "Reconstructed Vertices in Event", 80, -0.5, 79.5);
79  nbgvtx = iBooker.book1D("goodvtxNbr", "Reconstructed Good Vertices in Event", 80, -0.5, 79.5);
80 
81  // to be configured each year...
82  auto vposx = conf_.getParameter<double>("Xpos");
83  auto vposy = conf_.getParameter<double>("Ypos");
84 
85  nbtksinvtx[0] = iBooker.book1D("otherVtxTrksNbr", "Reconstructed Tracks in Vertex (other Vtx)", 40, -0.5, 99.5);
86  ntracksVsZ[0] = iBooker.bookProfile(
87  "otherVtxTrksVsZ", "Reconstructed Tracks in Vertex (other Vtx) vs Z", 80, -20., 20., 50, 0, 100, "");
88  ntracksVsZ[0]->setAxisTitle("z-bs", 1);
89  ntracksVsZ[0]->setAxisTitle("#tracks", 2);
90 
91  score[0] = iBooker.book1D("otherVtxScore", "sqrt(score) (other Vtx)", 100, 0., 400.);
92  trksWeight[0] = iBooker.book1D("otherVtxTrksWeight", "Total weight of Tracks in Vertex (other Vtx)", 40, 0, 100.);
93  vtxchi2[0] = iBooker.book1D("otherVtxChi2", "#chi^{2} (other Vtx)", 100, 0., 200.);
94  vtxndf[0] = iBooker.book1D("otherVtxNdf", "ndof (other Vtx)", 100, 0., 200.);
95  vtxprob[0] = iBooker.book1D("otherVtxProb", "#chi^{2} probability (other Vtx)", 100, 0., 1.);
96  nans[0] = iBooker.book1D("otherVtxNans", "Illegal values for x,y,z,xx,xy,xz,yy,yz,zz (other Vtx)", 9, 0.5, 9.5);
97 
98  nbtksinvtx[1] = iBooker.book1D("tagVtxTrksNbr", "Reconstructed Tracks in Vertex (tagged Vtx)", 100, -0.5, 99.5);
99  ntracksVsZ[1] = iBooker.bookProfile(
100  "tagVtxTrksVsZ", "Reconstructed Tracks in Vertex (tagged Vtx) vs Z", 80, -20., 20., 50, 0, 100, "");
101  ntracksVsZ[1]->setAxisTitle("z-bs", 1);
102  ntracksVsZ[1]->setAxisTitle("#tracks", 2);
103 
104  score[1] = iBooker.book1D("tagVtxScore", "sqrt(score) (tagged Vtx)", 100, 0., 400.);
105  trksWeight[1] = iBooker.book1D("tagVtxTrksWeight", "Total weight of Tracks in Vertex (tagged Vtx)", 100, 0, 100.);
106  vtxchi2[1] = iBooker.book1D("tagVtxChi2", "#chi^{2} (tagged Vtx)", 100, 0., 200.);
107  vtxndf[1] = iBooker.book1D("tagVtxNdf", "ndof (tagged Vtx)", 100, 0., 200.);
108  vtxprob[1] = iBooker.book1D("tagVtxProb", "#chi^{2} probability (tagged Vtx)", 100, 0., 1.);
109  nans[1] = iBooker.book1D("tagVtxNans", "Illegal values for x,y,z,xx,xy,xz,yy,yz,zz (tagged Vtx)", 9, 0.5, 9.5);
110 
111  xrec[0] = iBooker.book1D("otherPosX", "Position x Coordinate (other Vtx)", 100, vposx - 0.1, vposx + 0.1);
112  yrec[0] = iBooker.book1D("otherPosY", "Position y Coordinate (other Vtx)", 100, vposy - 0.1, vposy + 0.1);
113  zrec[0] = iBooker.book1D("otherPosZ", "Position z Coordinate (other Vtx)", 100, -20., 20.);
114  xDiff[0] = iBooker.book1D("otherDiffX", "X distance from BeamSpot (other Vtx)", 100, -500, 500);
115  yDiff[0] = iBooker.book1D("otherDiffY", "Y distance from BeamSpot (other Vtx)", 100, -500, 500);
116  xerr[0] = iBooker.book1D("otherErrX", "Uncertainty x Coordinate (other Vtx)", 100, 0., 100);
117  yerr[0] = iBooker.book1D("otherErrY", "Uncertainty y Coordinate (other Vtx)", 100, 0., 100);
118  zerr[0] = iBooker.book1D("otherErrZ", "Uncertainty z Coordinate (other Vtx)", 100, 0., 100);
119  xerrVsTrks[0] = iBooker.book2D(
120  "otherErrVsWeightX", "Uncertainty x Coordinate vs. track weight (other Vtx)", 100, 0, 100., 100, 0., 100);
121  yerrVsTrks[0] = iBooker.book2D(
122  "otherErrVsWeightY", "Uncertainty y Coordinate vs. track weight (other Vtx)", 100, 0, 100., 100, 0., 100);
123  zerrVsTrks[0] = iBooker.book2D(
124  "otherErrVsWeightZ", "Uncertainty z Coordinate vs. track weight (other Vtx)", 100, 0, 100., 100, 0., 100);
125 
126  xrec[1] = iBooker.book1D("tagPosX", "Position x Coordinate (tagged Vtx)", 100, vposx - 0.1, vposx + 0.1);
127  yrec[1] = iBooker.book1D("tagPosY", "Position y Coordinate (tagged Vtx)", 100, vposy - 0.1, vposy + 0.1);
128  zrec[1] = iBooker.book1D("tagPosZ", "Position z Coordinate (tagged Vtx)", 100, -20., 20.);
129  xDiff[1] = iBooker.book1D("tagDiffX", "X distance from BeamSpot (tagged Vtx)", 100, -500, 500);
130  yDiff[1] = iBooker.book1D("tagDiffY", "Y distance from BeamSpot (tagged Vtx)", 100, -500, 500);
131  xerr[1] = iBooker.book1D("tagErrX", "Uncertainty x Coordinate (tagged Vtx)", 100, 0., 100);
132  yerr[1] = iBooker.book1D("tagErrY", "Uncertainty y Coordinate (tagged Vtx)", 100, 0., 100);
133  zerr[1] = iBooker.book1D("tagErrZ", "Uncertainty z Coordinate (tagged Vtx)", 100, 0., 100);
134  xerrVsTrks[1] = iBooker.book2D(
135  "tagErrVsWeightX", "Uncertainty x Coordinate vs. track weight (tagged Vtx)", 100, 0, 100., 100, 0., 100);
136  yerrVsTrks[1] = iBooker.book2D(
137  "tagErrVsWeightY", "Uncertainty y Coordinate vs. track weight (tagged Vtx)", 100, 0, 100., 100, 0., 100);
138  zerrVsTrks[1] = iBooker.book2D(
139  "tagErrVsWeightZ", "Uncertainty z Coordinate vs. track weight (tagged Vtx)", 100, 0, 100., 100, 0., 100);
140 
141  type[0] = iBooker.book1D("otherType", "Vertex type (other Vtx)", 3, -0.5, 2.5);
142  type[1] = iBooker.book1D("tagType", "Vertex type (tagged Vtx)", 3, -0.5, 2.5);
143  for (int i = 0; i < 2; ++i) {
144  type[i]->setBinLabel(1, "Valid, real");
145  type[i]->setBinLabel(2, "Valid, fake");
146  type[i]->setBinLabel(3, "Invalid");
147  }
148 
149  // get the store
150  dqmLabel = TopFolderName_ + "/" + beamSpotInputTag_.label();
151  iBooker.setCurrentFolder(dqmLabel);
152 
153  bsX = iBooker.book1D("bsX", "BeamSpot x0", 100, -0.1, 0.1);
154  bsY = iBooker.book1D("bsY", "BeamSpot y0", 100, -0.1, 0.1);
155  bsZ = iBooker.book1D("bsZ", "BeamSpot z0", 100, -2., 2.);
156  bsSigmaZ = iBooker.book1D("bsSigmaZ", "BeamSpot sigmaZ", 100, 0., 10.);
157  bsDxdz = iBooker.book1D("bsDxdz", "BeamSpot dxdz", 100, -0.0003, 0.0003);
158  bsDydz = iBooker.book1D("bsDydz", "BeamSpot dydz", 100, -0.0003, 0.0003);
159  bsBeamWidthX = iBooker.book1D("bsBeamWidthX", "BeamSpot BeamWidthX", 100, 0., 100.);
160  bsBeamWidthY = iBooker.book1D("bsBeamWidthY", "BeamSpot BeamWidthY", 100, 0., 100.);
161  bsType = iBooker.book1D("bsType", "BeamSpot type", 4, -1.5, 2.5);
162  bsType->setBinLabel(1, "Unknown");
163  bsType->setBinLabel(2, "Fake");
164  bsType->setBinLabel(3, "LHC");
165  bsType->setBinLabel(4, "Tracker");
166 
167  // get the store
168  dqmLabel = TopFolderName_ + "/" + AlignmentLabel_;
169  iBooker.setCurrentFolder(dqmLabel);
170 
171  int TKNoBin = conf_.getParameter<int>("TkSizeBin");
172  double TKNoMin = conf_.getParameter<double>("TkSizeMin");
173  double TKNoMax = conf_.getParameter<double>("TkSizeMax");
174 
175  int DxyBin = conf_.getParameter<int>("DxyBin");
176  double DxyMin = conf_.getParameter<double>("DxyMin");
177  double DxyMax = conf_.getParameter<double>("DxyMax");
178 
179  int DzBin = conf_.getParameter<int>("DzBin");
180  double DzMin = conf_.getParameter<double>("DzMin");
181  double DzMax = conf_.getParameter<double>("DzMax");
182 
183  int PhiBin = conf_.getParameter<int>("PhiBin");
184  int PhiBin2D = conf_.getParameter<int>("PhiBin2D");
185  double PhiMin = conf_.getParameter<double>("PhiMin");
186  double PhiMax = conf_.getParameter<double>("PhiMax");
187 
188  int EtaBin = conf_.getParameter<int>("EtaBin");
189  int EtaBin2D = conf_.getParameter<int>("EtaBin2D");
190  double EtaMin = conf_.getParameter<double>("EtaMin");
191  double EtaMax = conf_.getParameter<double>("EtaMax");
192 
193  ntracks = iBooker.book1D("ntracks", "number of PV tracks (p_{T} > 1 GeV)", TKNoBin, TKNoMin, TKNoMax);
194  ntracks->setAxisTitle("Number of PV Tracks (p_{T} > 1 GeV) per Event", 1);
195  ntracks->setAxisTitle("Number of Event", 2);
196 
197  weight = iBooker.book1D("weight", "weight of PV tracks (p_{T} > 1 GeV)", 100, 0., 1.);
198  weight->setAxisTitle("weight of PV Tracks (p_{T} > 1 GeV) per Event", 1);
199  weight->setAxisTitle("Number of Event", 2);
200 
201  sumpt = iBooker.book1D("sumpt", "#Sum p_{T} of PV tracks (p_{T} > 1 GeV)", 100, -0.5, 249.5);
202  chi2ndf = iBooker.book1D("chi2ndf", "PV tracks (p_{T} > 1 GeV) #chi^{2}/ndof", 100, 0., 20.);
203  chi2prob = iBooker.book1D("chi2prob", "PV tracks (p_{T} > 1 GeV) #chi^{2} probability", 100, 0., 1.);
204 
205  dxy = iBooker.book1D("dxy", "PV tracks (p_{T} > 1 GeV) d_{xy} (#mum)", DxyBin, DxyMin, DxyMax);
206  dxy2 = iBooker.book1D("dxyzoom", "PV tracks (p_{T} > 1 GeV) d_{xy} (#mum)", DxyBin, DxyMin / 5., DxyMax / 5.);
207  dxyErr = iBooker.book1D("dxyErr", "PV tracks (p_{T} > 1 GeV) d_{xy} error (#mum)", 100, 0., 2000.);
208  dz = iBooker.book1D("dz", "PV tracks (p_{T} > 1 GeV) d_{z} (#mum)", DzBin, DzMin, DzMax);
209  dzErr = iBooker.book1D("dzErr", "PV tracks (p_{T} > 1 GeV) d_{z} error(#mum)", 100, 0., 10000.);
210 
211  dxyVsPhi_pt1 = iBooker.bookProfile("dxyVsPhi_pt1",
212  "PV tracks (p_{T} > 1 GeV) d_{xy} (#mum) VS track #phi",
213  PhiBin,
214  PhiMin,
215  PhiMax,
216  DxyBin,
217  DxyMin,
218  DxyMax,
219  "");
220  dxyVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #phi", 1);
221  dxyVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) d_{xy} (#mum)", 2);
222 
223  dzVsPhi_pt1 = iBooker.bookProfile("dzVsPhi_pt1",
224  "PV tracks (p_{T} > 1 GeV) d_{z} (#mum) VS track #phi",
225  PhiBin,
226  PhiMin,
227  PhiMax,
228  DzBin,
229  DzMin,
230  DzMax,
231  "");
232  dzVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #phi", 1);
233  dzVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) d_{z} (#mum)", 2);
234 
235  dxyVsEta_pt1 = iBooker.bookProfile("dxyVsEta_pt1",
236  "PV tracks (p_{T} > 1 GeV) d_{xy} (#mum) VS track #eta",
237  EtaBin,
238  EtaMin,
239  EtaMax,
240  DxyBin,
241  DxyMin,
242  DxyMax,
243  "");
244  dxyVsEta_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #eta", 1);
245  dxyVsEta_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) d_{xy} (#mum)", 2);
246 
247  dzVsEta_pt1 = iBooker.bookProfile("dzVsEta_pt1",
248  "PV tracks (p_{T} > 1 GeV) d_{z} (#mum) VS track #eta",
249  EtaBin,
250  EtaMin,
251  EtaMax,
252  DzBin,
253  DzMin,
254  DzMax,
255  "");
256  dzVsEta_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #eta", 1);
257  dzVsEta_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) d_{z} (#mum)", 2);
258 
259  dxyVsEtaVsPhi_pt1 = iBooker.bookProfile2D("dxyVsEtaVsPhi_pt1",
260  "PV tracks (p_{T} > 1 GeV) d_{xy} (#mum) VS track #eta VS track #phi",
261  EtaBin2D,
262  EtaMin,
263  EtaMax,
264  PhiBin2D,
265  PhiMin,
266  PhiMax,
267  DxyBin,
268  DxyMin,
269  DxyMax,
270  "");
271  dxyVsEtaVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #eta", 1);
272  dxyVsEtaVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #phi", 2);
273  dxyVsEtaVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) d_{xy} (#mum)", 3);
274 
275  dzVsEtaVsPhi_pt1 = iBooker.bookProfile2D("dzVsEtaVsPhi_pt1",
276  "PV tracks (p_{T} > 1 GeV) d_{z} (#mum) VS track #eta VS track #phi",
277  EtaBin2D,
278  EtaMin,
279  EtaMax,
280  PhiBin2D,
281  PhiMin,
282  PhiMax,
283  DzBin,
284  DzMin,
285  DzMax,
286  "");
287  dzVsEtaVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #eta", 1);
288  dzVsEtaVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) #phi", 2);
289  dzVsEtaVsPhi_pt1->setAxisTitle("PV track (p_{T} > 1 GeV) d_{z} (#mum)", 3);
290 
291  dxyVsPhi_pt10 = iBooker.bookProfile("dxyVsPhi_pt10",
292  "PV tracks (p_{T} > 10 GeV) d_{xy} (#mum) VS track #phi",
293  PhiBin,
294  PhiMin,
295  PhiMax,
296  DxyBin,
297  DxyMin,
298  DxyMax,
299  "");
300  dxyVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #phi", 1);
301  dxyVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) d_{xy} (#mum)", 2);
302 
303  dzVsPhi_pt10 = iBooker.bookProfile("dzVsPhi_pt10",
304  "PV tracks (p_{T} > 10 GeV) d_{z} (#mum) VS track #phi",
305  PhiBin,
306  PhiMin,
307  PhiMax,
308  DzBin,
309  DzMin,
310  DzMax,
311  "");
312  dzVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #phi", 1);
313  dzVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) d_{z} (#mum)", 2);
314 
315  dxyVsEta_pt10 = iBooker.bookProfile("dxyVsEta_pt10",
316  "PV tracks (p_{T} > 10 GeV) d_{xy} (#mum) VS track #eta",
317  EtaBin,
318  EtaMin,
319  EtaMax,
320  DxyBin,
321  DxyMin,
322  DxyMax,
323  "");
324  dxyVsEta_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #eta", 1);
325  dxyVsEta_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) d_{xy} (#mum)", 2);
326 
327  dzVsEta_pt10 = iBooker.bookProfile("dzVsEta_pt10",
328  "PV tracks (p_{T} > 10 GeV) d_{z} (#mum) VS track #eta",
329  EtaBin,
330  EtaMin,
331  EtaMax,
332  DzBin,
333  DzMin,
334  DzMax,
335  "");
336  dzVsEta_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #eta", 1);
337  dzVsEta_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) d_{z} (#mum)", 2);
338 
339  dxyVsEtaVsPhi_pt10 = iBooker.bookProfile2D("dxyVsEtaVsPhi_pt10",
340  "PV tracks (p_{T} > 10 GeV) d_{xy} (#mum) VS track #eta VS track #phi",
341  EtaBin2D,
342  EtaMin,
343  EtaMax,
344  PhiBin2D,
345  PhiMin,
346  PhiMax,
347  DxyBin,
348  DxyMin,
349  DxyMax,
350  "");
351  dxyVsEtaVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #eta", 1);
352  dxyVsEtaVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #phi", 2);
353  dxyVsEtaVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) d_{xy} (#mum)", 3);
354 
355  dzVsEtaVsPhi_pt10 = iBooker.bookProfile2D("dzVsEtaVsPhi_pt10",
356  "PV tracks (p_{T} > 10 GeV) d_{z} (#mum) VS track #eta VS track #phi",
357  EtaBin2D,
358  EtaMin,
359  EtaMax,
360  PhiBin2D,
361  PhiMin,
362  PhiMax,
363  DzBin,
364  DzMin,
365  DzMax,
366  "");
367  dzVsEtaVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #eta", 1);
368  dzVsEtaVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) #phi", 2);
369  dzVsEtaVsPhi_pt10->setAxisTitle("PV track (p_{T} > 10 GeV) d_{z} (#mum)", 3);
370 }
MonitorElement * xerrVsTrks[2]
MonitorElement * xerr[2]
MonitorElement * vtxndf[2]
MonitorElement * dxyVsEta_pt1
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())
Definition: DQMStore.h:476
MonitorElement * dzVsPhi_pt10
MonitorElement * dzVsPhi_pt1
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * bsSigmaZ
edm::InputTag beamSpotInputTag_
MonitorElement * dxyVsEtaVsPhi_pt10
MonitorElement * dzVsEtaVsPhi_pt1
MonitorElement * chi2ndf
MonitorElement * dxyVsPhi_pt10
MonitorElement * xDiff[2]
MonitorElement * dzVsEta_pt1
MonitorElement * ntracksVsZ[2]
edm::ParameterSet conf_
MonitorElement * zerrVsTrks[2]
MonitorElement * nans[2]
MonitorElement * yerrVsTrks[2]
MonitorElement * dxyVsEta_pt10
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:399
MonitorElement * zerr[2]
MonitorElement * yrec[2]
MonitorElement * zrec[2]
const double EtaMin[kNumberCalorimeter]
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 * dzVsEta_pt10
MonitorElement * dxyVsEtaVsPhi_pt1
MonitorElement * chi2prob
MonitorElement * nbtksinvtx[2]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * yerr[2]
MonitorElement * xrec[2]
MonitorElement * vtxprob[2]
MonitorElement * ntracks
MonitorElement * bsBeamWidthY
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 * score[2]
MonitorElement * dzVsEtaVsPhi_pt10
MonitorElement * yDiff[2]
MonitorElement * trksWeight[2]
MonitorElement * bsBeamWidthX
MonitorElement * dxyVsPhi_pt1
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void PrimaryVertexMonitor::pvTracksPlots ( const reco::Vertex v)
private

Definition at line 453 of file PrimaryVertexMonitor.cc.

References chi2ndf, chi2prob, cmToUm, dxy, dxy2, dxyErr, dxyVsEta_pt1, dxyVsEta_pt10, dxyVsEtaVsPhi_pt1, dxyVsEtaVsPhi_pt10, dxyVsPhi_pt1, dxyVsPhi_pt10, dz, dzErr, dzVsEta_pt1, dzVsEta_pt10, dzVsEtaVsPhi_pt1, dzVsEtaVsPhi_pt10, dzVsPhi_pt1, dzVsPhi_pt10, PVValHelper::eta, dqm::impl::MonitorElement::Fill(), reco::TrackBase::highPurity, reco::Vertex::isFake(), reco::Vertex::isValid(), BeamSpotPI::nTracks, ntracks, phi, reco::Vertex::position(), DiDispStaMuonMonitor_cfi::pt, sumpt, submitPVValidationJobs::t, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), useHPfoAlignmentPlots_, w(), and weight.

Referenced by analyze().

453  {
454  if (!v.isValid())
455  return;
456  if (v.isFake())
457  return;
458 
459  if (v.tracksSize() == 0) {
460  ntracks->Fill(0);
461  return;
462  }
463 
464  const math::XYZPoint myVertex(v.position().x(), v.position().y(), v.position().z());
465 
466  size_t nTracks = 0;
467  float sumPT = 0.;
468  const int cmToUm = 10000;
469 
471  bool isHighPurity = (**t).quality(reco::TrackBase::highPurity);
472  if (!isHighPurity && useHPfoAlignmentPlots_)
473  continue;
474 
475  float pt = (**t).pt();
476  if (pt < 1.)
477  continue;
478 
479  nTracks++;
480 
481  float eta = (**t).eta();
482  float phi = (**t).phi();
483 
484  float w = v.trackWeight(*t);
485  float chi2NDF = (**t).normalizedChi2();
486  float chi2Prob = TMath::Prob((**t).chi2(), (int)(**t).ndof());
487  float Dxy = (**t).dxy(myVertex) * cmToUm; // is it needed ?
488  float Dz = (**t).dz(myVertex) * cmToUm; // is it needed ?
489  float DxyErr = (**t).dxyError() * cmToUm;
490  float DzErr = (**t).dzError() * cmToUm;
491 
492  sumPT += pt * pt;
493 
494  // fill MEs
495  weight->Fill(w);
496  chi2ndf->Fill(chi2NDF);
497  chi2prob->Fill(chi2Prob);
498  dxy->Fill(Dxy);
499  dxy2->Fill(Dxy);
500  dz->Fill(Dz);
501  dxyErr->Fill(DxyErr);
502  dzErr->Fill(DzErr);
503 
504  dxyVsPhi_pt1->Fill(phi, Dxy);
505  dzVsPhi_pt1->Fill(phi, Dz);
506  dxyVsEta_pt1->Fill(eta, Dxy);
507  dzVsEta_pt1->Fill(eta, Dz);
508  dxyVsEtaVsPhi_pt1->Fill(eta, phi, Dxy);
509  dzVsEtaVsPhi_pt1->Fill(eta, phi, Dz);
510 
511  if (pt < 10.)
512  continue;
513  dxyVsPhi_pt10->Fill(phi, Dxy);
514  dzVsPhi_pt10->Fill(phi, Dz);
515  dxyVsEta_pt10->Fill(eta, Dxy);
516  dzVsEta_pt10->Fill(eta, Dz);
517  dxyVsEtaVsPhi_pt10->Fill(eta, phi, Dxy);
518  dzVsEtaVsPhi_pt10->Fill(eta, phi, Dz);
519  }
520  ntracks->Fill(float(nTracks));
521  sumpt->Fill(sumPT);
522 }
MonitorElement * dxyVsEta_pt1
MonitorElement * dzVsPhi_pt10
MonitorElement * dzVsPhi_pt1
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:72
MonitorElement * dxyVsEtaVsPhi_pt10
MonitorElement * dzVsEtaVsPhi_pt1
MonitorElement * chi2ndf
MonitorElement * dxyVsPhi_pt10
const Point & position() const
position
Definition: Vertex.h:127
MonitorElement * dzVsEta_pt1
void Fill(long long x)
MonitorElement * dxyVsEta_pt10
constexpr float cmToUm
Definition: DMRChecker.cc:127
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.h:110
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:96
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.h:108
size_t tracksSize() const
number of tracks
Definition: Vertex.h:112
MonitorElement * dzVsEta_pt10
MonitorElement * dxyVsEtaVsPhi_pt1
bool isFake() const
Definition: Vertex.h:76
MonitorElement * chi2prob
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
T w() const
MonitorElement * ntracks
MonitorElement * dzVsEtaVsPhi_pt10
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
MonitorElement * dxyVsPhi_pt1
void PrimaryVertexMonitor::vertexPlots ( const reco::Vertex v,
const reco::BeamSpot beamSpot,
int  i 
)
private

Definition at line 524 of file PrimaryVertexMonitor.cc.

References reco::Vertex::chi2(), ChiSquaredProbability(), reco::Vertex::covariance(), reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), mps_fire::i, reco::Vertex::isFake(), edm::isNotFinite(), reco::Vertex::isValid(), dqmiolumiharvest::j, isotrackApplyRegressor::k, nans, nbtksinvtx, reco::Vertex::ndof(), ntracksVsZ, reco::Vertex::position(), submitPVValidationJobs::t, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), trksWeight, vtxchi2, vtxndf, vtxprob, weight, reco::BeamSpot::x0(), xDiff, xerr, reco::Vertex::xError(), xerrVsTrks, xrec, reco::BeamSpot::y0(), yDiff, yerr, reco::Vertex::yError(), yerrVsTrks, yrec, reco::BeamSpot::z0(), zerr, reco::Vertex::zError(), zerrVsTrks, and zrec.

Referenced by analyze().

524  {
525  if (i < 0 || i > 1)
526  return;
527  if (!v.isValid())
528  type[i]->Fill(2.);
529  else if (v.isFake())
530  type[i]->Fill(1.);
531  else
532  type[i]->Fill(0.);
533 
534  if (v.isValid() && !v.isFake()) {
535  float weight = 0;
537  weight += v.trackWeight(*t);
538  trksWeight[i]->Fill(weight);
539  nbtksinvtx[i]->Fill(v.tracksSize());
540  ntracksVsZ[i]->Fill(v.position().z() - beamSpot.z0(), v.tracksSize());
541 
542  vtxchi2[i]->Fill(v.chi2());
543  vtxndf[i]->Fill(v.ndof());
545 
546  xrec[i]->Fill(v.position().x());
547  yrec[i]->Fill(v.position().y());
548  zrec[i]->Fill(v.position().z());
549 
550  float xb = beamSpot.x0() + beamSpot.dxdz() * (v.position().z() - beamSpot.z0());
551  float yb = beamSpot.y0() + beamSpot.dydz() * (v.position().z() - beamSpot.z0());
552  xDiff[i]->Fill((v.position().x() - xb) * 10000);
553  yDiff[i]->Fill((v.position().y() - yb) * 10000);
554 
555  xerr[i]->Fill(v.xError() * 10000);
556  yerr[i]->Fill(v.yError() * 10000);
557  zerr[i]->Fill(v.zError() * 10000);
558  xerrVsTrks[i]->Fill(weight, v.xError() * 10000);
559  yerrVsTrks[i]->Fill(weight, v.yError() * 10000);
560  zerrVsTrks[i]->Fill(weight, v.zError() * 10000);
561 
562  nans[i]->Fill(1., edm::isNotFinite(v.position().x()) * 1.);
563  nans[i]->Fill(2., edm::isNotFinite(v.position().y()) * 1.);
564  nans[i]->Fill(3., edm::isNotFinite(v.position().z()) * 1.);
565 
566  int index = 3;
567  for (int k = 0; k != 3; k++) {
568  for (int j = k; j != 3; j++) {
569  index++;
570  nans[i]->Fill(index * 1., edm::isNotFinite(v.covariance(k, j)) * 1.);
571  // in addition, diagonal element must be positive
572  if (j == k && v.covariance(k, j) < 0) {
573  nans[i]->Fill(index * 1., 1.);
574  }
575  }
576  }
577  }
578 }
MonitorElement * xerrVsTrks[2]
double z0() const
z coordinate
Definition: BeamSpot.h:65
MonitorElement * xerr[2]
MonitorElement * vtxndf[2]
double zError() const
error on z
Definition: Vertex.h:141
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:72
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:148
MonitorElement * xDiff[2]
const Point & position() const
position
Definition: Vertex.h:127
MonitorElement * ntracksVsZ[2]
MonitorElement * zerrVsTrks[2]
MonitorElement * nans[2]
void Fill(long long x)
double dydz() const
dydz slope
Definition: BeamSpot.h:80
MonitorElement * yerrVsTrks[2]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * zerr[2]
MonitorElement * yrec[2]
double chi2() const
chi-squares
Definition: Vertex.h:116
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.h:110
float ChiSquaredProbability(double chiSquared, double nrDOF)
MonitorElement * zrec[2]
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:96
MonitorElement * vtxchi2[2]
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.h:108
size_t tracksSize() const
number of tracks
Definition: Vertex.h:112
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
double ndof() const
Definition: Vertex.h:123
double xError() const
error on x
Definition: Vertex.h:137
bool isFake() const
Definition: Vertex.h:76
MonitorElement * nbtksinvtx[2]
MonitorElement * yerr[2]
double y0() const
y coordinate
Definition: BeamSpot.h:63
MonitorElement * xrec[2]
MonitorElement * vtxprob[2]
MonitorElement * yDiff[2]
double yError() const
error on y
Definition: Vertex.h:139
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
MonitorElement * trksWeight[2]
double x0() const
x coordinate
Definition: BeamSpot.h:61

Member Data Documentation

std::string PrimaryVertexMonitor::AlignmentLabel_
private

Definition at line 51 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

edm::InputTag PrimaryVertexMonitor::beamSpotInputTag_
private

Definition at line 44 of file PrimaryVertexMonitor.h.

Referenced by analyze(), bookHistograms(), and PrimaryVertexMonitor().

edm::EDGetTokenT<reco::BeamSpot> PrimaryVertexMonitor::beamspotToken_
private

Definition at line 40 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and PrimaryVertexMonitor().

MonitorElement * PrimaryVertexMonitor::bsBeamWidthX
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsBeamWidthY
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsDxdz
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsDydz
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsSigmaZ
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsType
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

MonitorElement* PrimaryVertexMonitor::bsX
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsY
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::bsZ
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::chi2ndf
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::chi2prob
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

edm::ParameterSet PrimaryVertexMonitor::conf_
private

Definition at line 46 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

std::string PrimaryVertexMonitor::dqmLabel
private

Definition at line 48 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

MonitorElement* PrimaryVertexMonitor::dxy
private
MonitorElement * PrimaryVertexMonitor::dxy2
private

Definition at line 67 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dxyErr
private
MonitorElement* PrimaryVertexMonitor::dxyVsEta_pt1
private

Definition at line 69 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement* PrimaryVertexMonitor::dxyVsEta_pt10
private

Definition at line 72 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement* PrimaryVertexMonitor::dxyVsEtaVsPhi_pt1
private

Definition at line 70 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement* PrimaryVertexMonitor::dxyVsEtaVsPhi_pt10
private

Definition at line 73 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement* PrimaryVertexMonitor::dxyVsPhi_pt1
private

Definition at line 68 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement* PrimaryVertexMonitor::dxyVsPhi_pt10
private

Definition at line 71 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dz
private
MonitorElement * PrimaryVertexMonitor::dzErr
private
MonitorElement * PrimaryVertexMonitor::dzVsEta_pt1
private

Definition at line 69 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dzVsEta_pt10
private

Definition at line 72 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dzVsEtaVsPhi_pt1
private

Definition at line 70 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dzVsEtaVsPhi_pt10
private

Definition at line 73 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dzVsPhi_pt1
private

Definition at line 68 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement * PrimaryVertexMonitor::dzVsPhi_pt10
private

Definition at line 71 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

bool PrimaryVertexMonitor::errorPrinted_
private

Definition at line 54 of file PrimaryVertexMonitor.h.

Referenced by analyze().

MonitorElement * PrimaryVertexMonitor::nans[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::nbgvtx
private

Definition at line 57 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * PrimaryVertexMonitor::nbtksinvtx[2]
private

Definition at line 57 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement* PrimaryVertexMonitor::nbvtx
private

Definition at line 57 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

int PrimaryVertexMonitor::ndof_
private

Definition at line 52 of file PrimaryVertexMonitor.h.

Referenced by analyze().

MonitorElement * PrimaryVertexMonitor::ntracks
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

MonitorElement* PrimaryVertexMonitor::ntracksVsZ[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::score[2]
private

Definition at line 57 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<VertexScore> PrimaryVertexMonitor::scoreToken_
private

Definition at line 42 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and PrimaryVertexMonitor().

MonitorElement* PrimaryVertexMonitor::sumpt
private
std::string PrimaryVertexMonitor::TopFolderName_
private

Definition at line 50 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

MonitorElement * PrimaryVertexMonitor::trksWeight[2]
private

Definition at line 57 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement* PrimaryVertexMonitor::tt[2]
private

Definition at line 58 of file PrimaryVertexMonitor.h.

MonitorElement* PrimaryVertexMonitor::type[2]
private
bool PrimaryVertexMonitor::useHPfoAlignmentPlots_
private

Definition at line 53 of file PrimaryVertexMonitor.h.

Referenced by pvTracksPlots().

edm::InputTag PrimaryVertexMonitor::vertexInputTag_
private

Definition at line 44 of file PrimaryVertexMonitor.h.

Referenced by analyze(), bookHistograms(), and PrimaryVertexMonitor().

edm::EDGetTokenT<reco::VertexCollection> PrimaryVertexMonitor::vertexToken_
private

Definition at line 39 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and PrimaryVertexMonitor().

MonitorElement* PrimaryVertexMonitor::vtxchi2[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::vtxndf[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::vtxprob[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::weight
private
MonitorElement * PrimaryVertexMonitor::xDiff[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::xerr[2]
private
MonitorElement* PrimaryVertexMonitor::xerrVsTrks[2]
private

Definition at line 60 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement* PrimaryVertexMonitor::xrec[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::yDiff[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::yerr[2]
private
MonitorElement * PrimaryVertexMonitor::yerrVsTrks[2]
private

Definition at line 60 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::yrec[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::zerr[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::zerrVsTrks[2]
private

Definition at line 60 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

MonitorElement * PrimaryVertexMonitor::zrec[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().