CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
SiPixelPhase1MonitorVertexSoA Class Reference

bookLayer More...

#include <SiPixelPhase1MonitorVertexSoA.cc>

Inheritance diagram for SiPixelPhase1MonitorVertexSoA:

Public Types

using IndToEdm = std::vector< uint16_t >
 

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
 SiPixelPhase1MonitorVertexSoA (const edm::ParameterSet &)
 
 ~SiPixelPhase1MonitorVertexSoA () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

MonitorElementhchi2
 
MonitorElementhchi2oNdof
 
MonitorElementhntrks
 
MonitorElementhnVertex
 
MonitorElementhptv2
 
MonitorElementhx
 
MonitorElementhy
 
MonitorElementhz
 
edm::EDGetTokenT< reco::BeamSpottokenBeamSpot_
 
edm::EDGetTokenT< ZVertexHeterogeneoustokenSoAVertex_
 
std::string topFolderName_
 

Detailed Description

bookLayer

Definition at line 27 of file SiPixelPhase1MonitorVertexSoA.cc.

Member Typedef Documentation

◆ IndToEdm

using SiPixelPhase1MonitorVertexSoA::IndToEdm = std::vector<uint16_t>

Definition at line 29 of file SiPixelPhase1MonitorVertexSoA.cc.

Constructor & Destructor Documentation

◆ SiPixelPhase1MonitorVertexSoA()

SiPixelPhase1MonitorVertexSoA::SiPixelPhase1MonitorVertexSoA ( const edm::ParameterSet iConfig)
explicit

Definition at line 54 of file SiPixelPhase1MonitorVertexSoA.cc.

References edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, tokenBeamSpot_, tokenSoAVertex_, and topFolderName_.

54  {
55  tokenSoAVertex_ = consumes<ZVertexHeterogeneous>(iConfig.getParameter<edm::InputTag>("pixelVertexSrc"));
56  tokenBeamSpot_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotSrc"));
57  topFolderName_ = iConfig.getParameter<std::string>("topFolderName");
58 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertex_

◆ ~SiPixelPhase1MonitorVertexSoA()

SiPixelPhase1MonitorVertexSoA::~SiPixelPhase1MonitorVertexSoA ( )
overridedefault

Member Function Documentation

◆ analyze()

void SiPixelPhase1MonitorVertexSoA::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 63 of file SiPixelPhase1MonitorVertexSoA.cc.

References cms::cuda::bs, dxdz, dydz, dqm::impl::MonitorElement::Fill(), hchi2, hchi2oNdof, hntrks, hnVertex, hptv2, hx, hy, hz, iEvent, gpuVertexFinder::iv, ndof, TrackCollections2monitor_cff::nVertices, tokenBeamSpot_, tokenSoAVertex_, x, y, z, and HLTMuonOfflineAnalyzer_cfi::z0.

63  {
64  const auto& vsoaHandle = iEvent.getHandle(tokenSoAVertex_);
65  if (!vsoaHandle.isValid()) {
66  edm::LogWarning("SiPixelPhase1MonitorTrackSoA") << "No Vertex SoA found \n returning!" << std::endl;
67  return;
68  }
69 
70  auto const& vsoa = *((vsoaHandle.product())->get());
71  int nVertices = vsoa.nvFinal;
72  auto bsHandle = iEvent.getHandle(tokenBeamSpot_);
73  float x0 = 0., y0 = 0., z0 = 0., dxdz = 0., dydz = 0.;
74  if (!bsHandle.isValid()) {
75  edm::LogWarning("PixelVertexProducer") << "No beamspot found. returning vertexes with (0,0,Z) ";
76  } else {
77  const reco::BeamSpot& bs = *bsHandle;
78  x0 = bs.x0();
79  y0 = bs.y0();
80  z0 = bs.z0();
81  dxdz = bs.dxdz();
82  dydz = bs.dydz();
83  }
84  for (int iv = 0; iv < nVertices; iv++) {
85  auto si = vsoa.sortInd[iv];
86  auto z = vsoa.zv[si];
87  auto x = x0 + dxdz * z;
88  auto y = y0 + dydz * z;
89  z += z0;
90  hx->Fill(x);
91  hy->Fill(y);
92  hz->Fill(z);
93  auto ndof = vsoa.ndof[si];
94  hchi2->Fill(vsoa.chi2[si]);
95  hchi2oNdof->Fill(vsoa.chi2[si] / ndof);
96  hptv2->Fill(vsoa.ptv2[si]);
97  hntrks->Fill(ndof + 1);
98  }
100 }
float dydz
int32_t *__restrict__ iv
float dxdz
edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertex_
Log< level::Warning, false > LogWarning

◆ bookHistograms()

void SiPixelPhase1MonitorVertexSoA::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
override

Definition at line 105 of file SiPixelPhase1MonitorVertexSoA.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), hchi2, hchi2oNdof, hntrks, hnVertex, hptv2, hx, hy, hz, dqm::implementation::NavigatorBase::setCurrentFolder(), and topFolderName_.

107  {
108  //std::string top_folder = ""//
109  ibooker.cd();
111  hnVertex = ibooker.book1D("nVertex", ";# of Vertex;#entries", 101, -0.5, 100.5);
112  hx = ibooker.book1D("vx", ";Vertex x;#entries", 10, -5., 5.);
113  hy = ibooker.book1D("vy", ";Vertex y;#entries", 10, -5., 5.);
114  hz = ibooker.book1D("vz", ";Vertex z;#entries", 30, -30., 30);
115  hchi2 = ibooker.book1D("chi2", ";Vertex chi-squared;#entries", 40, 0., 20.);
116  hchi2oNdof = ibooker.book1D("chi2oNdof", ";Vertex chi-squared/Ndof;#entries", 40, 0., 20.);
117  hptv2 = ibooker.book1D("ptsq", ";Vertex p_T squared;#entries", 200, 0., 200.);
118  hntrks = ibooker.book1D("ntrk", ";#tracks associated;#entries", 100, -0.5, 99.5);
119 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ fillDescriptions()

void SiPixelPhase1MonitorVertexSoA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 121 of file SiPixelPhase1MonitorVertexSoA.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

121  {
122  // monitorpixelVertexSoA
124  desc.add<edm::InputTag>("pixelVertexSrc", edm::InputTag("pixelVerticesSoA"));
125  desc.add<edm::InputTag>("beamSpotSrc", edm::InputTag("offlineBeamSpot"));
126  desc.add<std::string>("topFolderName", "SiPixelHeterogeneous/PixelVertexSoA");
127  descriptions.addWithDefaultLabel(desc);
128 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ hchi2

MonitorElement* SiPixelPhase1MonitorVertexSoA::hchi2
private

Definition at line 44 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hchi2oNdof

MonitorElement* SiPixelPhase1MonitorVertexSoA::hchi2oNdof
private

Definition at line 45 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hntrks

MonitorElement* SiPixelPhase1MonitorVertexSoA::hntrks
private

Definition at line 47 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hnVertex

MonitorElement* SiPixelPhase1MonitorVertexSoA::hnVertex
private

Definition at line 40 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hptv2

MonitorElement* SiPixelPhase1MonitorVertexSoA::hptv2
private

Definition at line 46 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hx

MonitorElement* SiPixelPhase1MonitorVertexSoA::hx
private

Definition at line 41 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hy

MonitorElement* SiPixelPhase1MonitorVertexSoA::hy
private

Definition at line 42 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hz

MonitorElement* SiPixelPhase1MonitorVertexSoA::hz
private

Definition at line 43 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ tokenBeamSpot_

edm::EDGetTokenT<reco::BeamSpot> SiPixelPhase1MonitorVertexSoA::tokenBeamSpot_
private

Definition at line 38 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and SiPixelPhase1MonitorVertexSoA().

◆ tokenSoAVertex_

edm::EDGetTokenT<ZVertexHeterogeneous> SiPixelPhase1MonitorVertexSoA::tokenSoAVertex_
private

Definition at line 37 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and SiPixelPhase1MonitorVertexSoA().

◆ topFolderName_

std::string SiPixelPhase1MonitorVertexSoA::topFolderName_
private