CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static 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=default
 
- 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_
 
MonitorElementeta_pt1
 
MonitorElementeta_pt10
 
MonitorElementnans [2]
 
MonitorElementnbgvtx
 
MonitorElementnbtksinvtx [2]
 
MonitorElementnbvtx
 
int ndof_
 
MonitorElementntracks
 
MonitorElementntracksVsZ [2]
 
MonitorElementphi_pt1
 
MonitorElementphi_pt10
 
MonitorElementscore [2]
 
edm::EDGetTokenT< VertexScorescoreToken_
 
MonitorElementsumpt
 
std::string TopFolderName_
 
MonitorElementtrksWeight [2]
 
MonitorElementtt [2]
 
MonitorElementtype [2]
 
bool useHPfoAlignmentPlots_
 
edm::InputTag vertexInputTag_
 
edm::EDGetTokenT< reco::VertexCollectionvertexToken_
 
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]
 

Static Private Attributes

static constexpr int cmToUm = 10000
 

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< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (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

◆ VertexScore

Definition at line 41 of file PrimaryVertexMonitor.h.

Constructor & Destructor Documentation

◆ PrimaryVertexMonitor()

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  phi_pt1(nullptr),
43  eta_pt1(nullptr),
44  phi_pt10(nullptr),
45  eta_pt10(nullptr),
46  dxyVsPhi_pt1(nullptr),
47  dzVsPhi_pt1(nullptr),
48  dxyVsEta_pt1(nullptr),
49  dzVsEta_pt1(nullptr),
50  dxyVsEtaVsPhi_pt1(nullptr),
51  dzVsEtaVsPhi_pt1(nullptr),
52  dxyVsPhi_pt10(nullptr),
53  dzVsPhi_pt10(nullptr),
54  dxyVsEta_pt10(nullptr),
55  dzVsEta_pt10(nullptr),
56  dxyVsEtaVsPhi_pt10(nullptr),
57  dzVsEtaVsPhi_pt10(nullptr) {
58  vertexInputTag_ = pSet.getParameter<InputTag>("vertexLabel");
59  beamSpotInputTag_ = pSet.getParameter<InputTag>("beamSpotLabel");
60  vertexToken_ = consumes<reco::VertexCollection>(vertexInputTag_);
61  scoreToken_ = consumes<VertexScore>(vertexInputTag_);
62  beamspotToken_ = consumes<reco::BeamSpot>(beamSpotInputTag_);
63 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * dxyVsEta_pt1
MonitorElement * dzVsPhi_pt10
MonitorElement * dzVsPhi_pt1
MonitorElement * bsSigmaZ
edm::InputTag beamSpotInputTag_
MonitorElement * eta_pt1
edm::EDGetTokenT< VertexScore > scoreToken_
MonitorElement * dxyVsEtaVsPhi_pt10
MonitorElement * dzVsEtaVsPhi_pt1
MonitorElement * chi2ndf
MonitorElement * dxyVsPhi_pt10
MonitorElement * dzVsEta_pt1
edm::ParameterSet conf_
MonitorElement * phi_pt10
MonitorElement * dxyVsEta_pt10
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
MonitorElement * eta_pt10
MonitorElement * dzVsEta_pt10
MonitorElement * dxyVsEtaVsPhi_pt1
MonitorElement * chi2prob
MonitorElement * phi_pt1
MonitorElement * ntracks
MonitorElement * bsBeamWidthY
MonitorElement * dzVsEtaVsPhi_pt10
MonitorElement * bsBeamWidthX
MonitorElement * dxyVsPhi_pt1

◆ ~PrimaryVertexMonitor()

PrimaryVertexMonitor::~PrimaryVertexMonitor ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 381 of file PrimaryVertexMonitor.cc.

References pwdgSkimBPark_cfi::beamSpot, beamSpotInputTag_, beamspotToken_, bsBeamWidthX, bsBeamWidthY, bsDxdz, bsDydz, bsSigmaZ, bsType, bsX, bsY, bsZ, cmToUm, errorPrinted_, dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), mps_fire::i, iEvent, edm::HandleBase::isValid(), nbgvtx, nbvtx, ndof_, convertSQLiteXML::ok, pvTracksPlots(), score, scoreToken_, mathSSE::sqrt(), findQualityFiles::v, vertexInputTag_, vertexPlots(), and vertexToken_.

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

◆ bookHistograms()

void PrimaryVertexMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 67 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, PrimaryVertexMonitor_cff::DzBin, dzErr, PrimaryVertexMonitor_cff::DzMax, PrimaryVertexMonitor_cff::DzMin, dzVsEta_pt1, dzVsEta_pt10, dzVsEtaVsPhi_pt1, dzVsEtaVsPhi_pt10, dzVsPhi_pt1, dzVsPhi_pt10, eta_pt1, eta_pt10, MonitorTrackInnerTrackMuons_cff::EtaBin, PrimaryVertexMonitor_cff::EtaBin2D, MonitorTrackInnerTrackMuons_cff::EtaMax, MonitorTrackInnerTrackMuons_cff::EtaMin, edm::ParameterSet::getParameter(), mps_fire::i, edm::InputTag::label(), nans, nbgvtx, nbtksinvtx, nbvtx, ntracks, ntracksVsZ, phi_pt1, phi_pt10, MonitorTrackSTAMuons_cfi::PhiBin, PrimaryVertexMonitor_cff::PhiBin2D, MonitorTrackSTAMuons_cfi::PhiMax, MonitorTrackSTAMuons_cfi::PhiMin, score, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, sumpt, TopFolderName_, trksWeight, vertexInputTag_, vtxchi2, vtxndf, vtxprob, xDiff, xerr, xerrVsTrks, xrec, yDiff, yerr, yerrVsTrks, yrec, zerr, zerrVsTrks, and zrec.

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

◆ pvTracksPlots()

void PrimaryVertexMonitor::pvTracksPlots ( const reco::Vertex v)
private

Definition at line 460 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, eta_pt1, eta_pt10, dqm::impl::MonitorElement::Fill(), reco::TrackBase::highPurity, createfilelist::int, beamSpotPI::nTracks, ntracks, phi, phi_pt1, phi_pt10, DiDispStaMuonMonitor_cfi::pt, sumpt, submitPVValidationJobs::t, useHPfoAlignmentPlots_, findQualityFiles::v, and w().

Referenced by analyze().

460  {
461  if (!v.isValid())
462  return;
463  if (v.isFake())
464  return;
465 
466  if (v.tracksSize() == 0) {
467  ntracks->Fill(0);
468  return;
469  }
470 
471  const math::XYZPoint myVertex(v.position().x(), v.position().y(), v.position().z());
472 
473  size_t nTracks = 0;
474  float sumPT = 0.;
475 
476  for (reco::Vertex::trackRef_iterator t = v.tracks_begin(); t != v.tracks_end(); t++) {
477  bool isHighPurity = (**t).quality(reco::TrackBase::highPurity);
478  if (!isHighPurity && useHPfoAlignmentPlots_)
479  continue;
480 
481  float pt = (**t).pt();
482  if (pt < 1.)
483  continue;
484 
485  nTracks++;
486 
487  float eta = (**t).eta();
488  float phi = (**t).phi();
489 
490  float w = v.trackWeight(*t);
491  float chi2NDF = (**t).normalizedChi2();
492  float chi2Prob = TMath::Prob((**t).chi2(), (int)(**t).ndof());
493  float Dxy = (**t).dxy(myVertex) * cmToUm;
494  float Dz = (**t).dz(myVertex) * cmToUm;
495  float DxyErr = (**t).dxyError() * cmToUm;
496  float DzErr = (**t).dzError() * cmToUm;
497 
498  sumPT += pt * pt;
499 
500  // fill MEs
501  weight->Fill(w);
502  chi2ndf->Fill(chi2NDF);
503  chi2prob->Fill(chi2Prob);
504  dxy->Fill(Dxy);
505  dxy2->Fill(Dxy);
506  dz->Fill(Dz);
507  dxyErr->Fill(DxyErr);
508  dzErr->Fill(DzErr);
509  phi_pt1->Fill(phi);
510  eta_pt1->Fill(eta);
511 
512  dxyVsPhi_pt1->Fill(phi, Dxy);
513  dzVsPhi_pt1->Fill(phi, Dz);
514  dxyVsEta_pt1->Fill(eta, Dxy);
515  dzVsEta_pt1->Fill(eta, Dz);
516  dxyVsEtaVsPhi_pt1->Fill(eta, phi, Dxy);
517  dzVsEtaVsPhi_pt1->Fill(eta, phi, Dz);
518 
519  if (pt < 10.)
520  continue;
521 
522  phi_pt10->Fill(phi);
523  eta_pt10->Fill(eta);
524  dxyVsPhi_pt10->Fill(phi, Dxy);
525  dzVsPhi_pt10->Fill(phi, Dz);
526  dxyVsEta_pt10->Fill(eta, Dxy);
527  dzVsEta_pt10->Fill(eta, Dz);
528  dxyVsEtaVsPhi_pt10->Fill(eta, phi, Dxy);
529  dzVsEtaVsPhi_pt10->Fill(eta, phi, Dz);
530  }
531  ntracks->Fill(float(nTracks));
532  sumpt->Fill(sumPT);
533 }
MonitorElement * dxyVsEta_pt1
MonitorElement * dzVsPhi_pt10
MonitorElement * dzVsPhi_pt1
T w() const
MonitorElement * eta_pt1
Definition: weight.py:1
MonitorElement * dxyVsEtaVsPhi_pt10
MonitorElement * dzVsEtaVsPhi_pt1
MonitorElement * chi2ndf
MonitorElement * dxyVsPhi_pt10
MonitorElement * dzVsEta_pt1
void Fill(long long x)
MonitorElement * phi_pt10
MonitorElement * dxyVsEta_pt10
MonitorElement * eta_pt10
MonitorElement * dzVsEta_pt10
MonitorElement * dxyVsEtaVsPhi_pt1
MonitorElement * chi2prob
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
MonitorElement * phi_pt1
static constexpr int cmToUm
MonitorElement * ntracks
MonitorElement * dzVsEtaVsPhi_pt10
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
MonitorElement * dxyVsPhi_pt1

◆ vertexPlots()

void PrimaryVertexMonitor::vertexPlots ( const reco::Vertex v,
const reco::BeamSpot beamSpot,
int  i 
)
private

Definition at line 535 of file PrimaryVertexMonitor.cc.

References pwdgSkimBPark_cfi::beamSpot, ChiSquaredProbability(), cmToUm, dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), mps_fire::i, edm::isNotFinite(), dqmiolumiharvest::j, dqmdumpme::k, nans, nbtksinvtx, ntracksVsZ, submitPVValidationJobs::t, trksWeight, findQualityFiles::v, vtxchi2, vtxndf, vtxprob, xDiff, xerr, xerrVsTrks, xrec, yDiff, yerr, yerrVsTrks, yrec, zerr, zerrVsTrks, and zrec.

Referenced by analyze().

535  {
536  if (i < 0 || i > 1)
537  return;
538  if (!v.isValid())
539  type[i]->Fill(2.);
540  else if (v.isFake())
541  type[i]->Fill(1.);
542  else
543  type[i]->Fill(0.);
544 
545  if (v.isValid() && !v.isFake()) {
546  float weight = 0;
547  for (reco::Vertex::trackRef_iterator t = v.tracks_begin(); t != v.tracks_end(); t++)
548  weight += v.trackWeight(*t);
549  trksWeight[i]->Fill(weight);
550  nbtksinvtx[i]->Fill(v.tracksSize());
551  ntracksVsZ[i]->Fill(v.position().z() - beamSpot.z0(), v.tracksSize());
552 
553  vtxchi2[i]->Fill(v.chi2());
554  vtxndf[i]->Fill(v.ndof());
555  vtxprob[i]->Fill(ChiSquaredProbability(v.chi2(), v.ndof()));
556 
557  xrec[i]->Fill(v.position().x());
558  yrec[i]->Fill(v.position().y());
559  zrec[i]->Fill(v.position().z());
560 
561  float xb = beamSpot.x0() + beamSpot.dxdz() * (v.position().z() - beamSpot.z0());
562  float yb = beamSpot.y0() + beamSpot.dydz() * (v.position().z() - beamSpot.z0());
563  xDiff[i]->Fill((v.position().x() - xb) * cmToUm);
564  yDiff[i]->Fill((v.position().y() - yb) * cmToUm);
565 
566  xerr[i]->Fill(v.xError() * cmToUm);
567  yerr[i]->Fill(v.yError() * cmToUm);
568  zerr[i]->Fill(v.zError() * cmToUm);
569  xerrVsTrks[i]->Fill(weight, v.xError() * cmToUm);
570  yerrVsTrks[i]->Fill(weight, v.yError() * cmToUm);
571  zerrVsTrks[i]->Fill(weight, v.zError() * cmToUm);
572 
573  nans[i]->Fill(1., edm::isNotFinite(v.position().x()) * 1.);
574  nans[i]->Fill(2., edm::isNotFinite(v.position().y()) * 1.);
575  nans[i]->Fill(3., edm::isNotFinite(v.position().z()) * 1.);
576 
577  int index = 3;
578  for (int k = 0; k != 3; k++) {
579  for (int j = k; j != 3; j++) {
580  index++;
581  nans[i]->Fill(index * 1., edm::isNotFinite(v.covariance(k, j)) * 1.);
582  // in addition, diagonal element must be positive
583  if (j == k && v.covariance(k, j) < 0) {
584  nans[i]->Fill(index * 1., 1.);
585  }
586  }
587  }
588  }
589 }
MonitorElement * xerrVsTrks[2]
MonitorElement * xerr[2]
MonitorElement * vtxndf[2]
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
Definition: weight.py:1
MonitorElement * xDiff[2]
MonitorElement * ntracksVsZ[2]
MonitorElement * zerrVsTrks[2]
MonitorElement * nans[2]
void Fill(long long x)
MonitorElement * yerrVsTrks[2]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * zerr[2]
MonitorElement * yrec[2]
float ChiSquaredProbability(double chiSquared, double nrDOF)
MonitorElement * zrec[2]
MonitorElement * vtxchi2[2]
MonitorElement * nbtksinvtx[2]
static constexpr int cmToUm
MonitorElement * yerr[2]
MonitorElement * xrec[2]
MonitorElement * vtxprob[2]
MonitorElement * yDiff[2]
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
MonitorElement * trksWeight[2]

Member Data Documentation

◆ AlignmentLabel_

std::string PrimaryVertexMonitor::AlignmentLabel_
private

Definition at line 51 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

◆ beamSpotInputTag_

edm::InputTag PrimaryVertexMonitor::beamSpotInputTag_
private

Definition at line 44 of file PrimaryVertexMonitor.h.

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

◆ beamspotToken_

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

Definition at line 40 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and PrimaryVertexMonitor().

◆ bsBeamWidthX

MonitorElement * PrimaryVertexMonitor::bsBeamWidthX
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsBeamWidthY

MonitorElement * PrimaryVertexMonitor::bsBeamWidthY
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsDxdz

MonitorElement * PrimaryVertexMonitor::bsDxdz
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsDydz

MonitorElement * PrimaryVertexMonitor::bsDydz
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsSigmaZ

MonitorElement * PrimaryVertexMonitor::bsSigmaZ
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsType

MonitorElement * PrimaryVertexMonitor::bsType
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsX

MonitorElement* PrimaryVertexMonitor::bsX
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsY

MonitorElement * PrimaryVertexMonitor::bsY
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ bsZ

MonitorElement * PrimaryVertexMonitor::bsZ
private

Definition at line 66 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ chi2ndf

MonitorElement * PrimaryVertexMonitor::chi2ndf
private

Definition at line 68 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ chi2prob

MonitorElement * PrimaryVertexMonitor::chi2prob
private

Definition at line 68 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ cmToUm

constexpr int PrimaryVertexMonitor::cmToUm = 10000
staticprivate

Definition at line 56 of file PrimaryVertexMonitor.h.

Referenced by analyze(), pvTracksPlots(), and vertexPlots().

◆ conf_

edm::ParameterSet PrimaryVertexMonitor::conf_
private

Definition at line 46 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

◆ dqmLabel

std::string PrimaryVertexMonitor::dqmLabel
private

Definition at line 48 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

◆ dxy

MonitorElement* PrimaryVertexMonitor::dxy
private

◆ dxy2

MonitorElement * PrimaryVertexMonitor::dxy2
private

Definition at line 69 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dxyErr

MonitorElement * PrimaryVertexMonitor::dxyErr
private

◆ dxyVsEta_pt1

MonitorElement* PrimaryVertexMonitor::dxyVsEta_pt1
private

Definition at line 73 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dxyVsEta_pt10

MonitorElement* PrimaryVertexMonitor::dxyVsEta_pt10
private

Definition at line 76 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dxyVsEtaVsPhi_pt1

MonitorElement* PrimaryVertexMonitor::dxyVsEtaVsPhi_pt1
private

Definition at line 74 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dxyVsEtaVsPhi_pt10

MonitorElement* PrimaryVertexMonitor::dxyVsEtaVsPhi_pt10
private

Definition at line 77 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dxyVsPhi_pt1

MonitorElement* PrimaryVertexMonitor::dxyVsPhi_pt1
private

Definition at line 72 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dxyVsPhi_pt10

MonitorElement* PrimaryVertexMonitor::dxyVsPhi_pt10
private

Definition at line 75 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dz

MonitorElement * PrimaryVertexMonitor::dz
private

◆ dzErr

MonitorElement * PrimaryVertexMonitor::dzErr
private

◆ dzVsEta_pt1

MonitorElement * PrimaryVertexMonitor::dzVsEta_pt1
private

Definition at line 73 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dzVsEta_pt10

MonitorElement * PrimaryVertexMonitor::dzVsEta_pt10
private

Definition at line 76 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dzVsEtaVsPhi_pt1

MonitorElement * PrimaryVertexMonitor::dzVsEtaVsPhi_pt1
private

Definition at line 74 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dzVsEtaVsPhi_pt10

MonitorElement * PrimaryVertexMonitor::dzVsEtaVsPhi_pt10
private

Definition at line 77 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dzVsPhi_pt1

MonitorElement * PrimaryVertexMonitor::dzVsPhi_pt1
private

Definition at line 72 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ dzVsPhi_pt10

MonitorElement * PrimaryVertexMonitor::dzVsPhi_pt10
private

Definition at line 75 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ errorPrinted_

bool PrimaryVertexMonitor::errorPrinted_
private

Definition at line 54 of file PrimaryVertexMonitor.h.

Referenced by analyze().

◆ eta_pt1

MonitorElement * PrimaryVertexMonitor::eta_pt1
private

Definition at line 70 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ eta_pt10

MonitorElement * PrimaryVertexMonitor::eta_pt10
private

Definition at line 71 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ nans

MonitorElement * PrimaryVertexMonitor::nans[2]
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ nbgvtx

MonitorElement * PrimaryVertexMonitor::nbgvtx
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ nbtksinvtx

MonitorElement * PrimaryVertexMonitor::nbtksinvtx[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ nbvtx

MonitorElement* PrimaryVertexMonitor::nbvtx
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ ndof_

int PrimaryVertexMonitor::ndof_
private

Definition at line 52 of file PrimaryVertexMonitor.h.

Referenced by analyze().

◆ ntracks

MonitorElement * PrimaryVertexMonitor::ntracks
private

Definition at line 68 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ ntracksVsZ

MonitorElement* PrimaryVertexMonitor::ntracksVsZ[2]
private

Definition at line 63 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ phi_pt1

MonitorElement* PrimaryVertexMonitor::phi_pt1
private

Definition at line 70 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ phi_pt10

MonitorElement* PrimaryVertexMonitor::phi_pt10
private

Definition at line 71 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and pvTracksPlots().

◆ score

MonitorElement * PrimaryVertexMonitor::score[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ scoreToken_

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

Definition at line 42 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and PrimaryVertexMonitor().

◆ sumpt

MonitorElement* PrimaryVertexMonitor::sumpt
private

◆ TopFolderName_

std::string PrimaryVertexMonitor::TopFolderName_
private

Definition at line 50 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms().

◆ trksWeight

MonitorElement * PrimaryVertexMonitor::trksWeight[2]
private

Definition at line 59 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ tt

MonitorElement* PrimaryVertexMonitor::tt[2]
private

Definition at line 60 of file PrimaryVertexMonitor.h.

◆ type

MonitorElement* PrimaryVertexMonitor::type[2]
private

◆ useHPfoAlignmentPlots_

bool PrimaryVertexMonitor::useHPfoAlignmentPlots_
private

Definition at line 53 of file PrimaryVertexMonitor.h.

Referenced by pvTracksPlots().

◆ vertexInputTag_

edm::InputTag PrimaryVertexMonitor::vertexInputTag_
private

Definition at line 44 of file PrimaryVertexMonitor.h.

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

◆ vertexToken_

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

Definition at line 39 of file PrimaryVertexMonitor.h.

Referenced by analyze(), and PrimaryVertexMonitor().

◆ vtxchi2

MonitorElement* PrimaryVertexMonitor::vtxchi2[2]
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ vtxndf

MonitorElement * PrimaryVertexMonitor::vtxndf[2]
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ vtxprob

MonitorElement * PrimaryVertexMonitor::vtxprob[2]
private

Definition at line 64 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ weight

MonitorElement * PrimaryVertexMonitor::weight
private

◆ xDiff

MonitorElement * PrimaryVertexMonitor::xDiff[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ xerr

MonitorElement * PrimaryVertexMonitor::xerr[2]
private

◆ xerrVsTrks

MonitorElement* PrimaryVertexMonitor::xerrVsTrks[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ xrec

MonitorElement* PrimaryVertexMonitor::xrec[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ yDiff

MonitorElement * PrimaryVertexMonitor::yDiff[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ yerr

MonitorElement * PrimaryVertexMonitor::yerr[2]
private

◆ yerrVsTrks

MonitorElement * PrimaryVertexMonitor::yerrVsTrks[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ yrec

MonitorElement * PrimaryVertexMonitor::yrec[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ zerr

MonitorElement * PrimaryVertexMonitor::zerr[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ zerrVsTrks

MonitorElement * PrimaryVertexMonitor::zerrVsTrks[2]
private

Definition at line 62 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().

◆ zrec

MonitorElement * PrimaryVertexMonitor::zrec[2]
private

Definition at line 61 of file PrimaryVertexMonitor.h.

Referenced by bookHistograms(), and vertexPlots().