CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< ZVertexHeterogeneous
tokenSoAVertex_
 
std::string topFolderName_
 

Detailed Description

bookLayer

Definition at line 27 of file SiPixelPhase1MonitorVertexSoA.cc.

Member Typedef Documentation

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

Definition at line 29 of file SiPixelPhase1MonitorVertexSoA.cc.

Constructor & Destructor Documentation

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 }
edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertex_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelPhase1MonitorVertexSoA::~SiPixelPhase1MonitorVertexSoA ( )
overridedefault

Member Function Documentation

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

Definition at line 63 of file SiPixelPhase1MonitorVertexSoA.cc.

References cms::cuda::bs, BeamSpotPI::dxdz, reco::BeamSpot::dxdz(), BeamSpotPI::dydz, reco::BeamSpot::dydz(), dqm::impl::MonitorElement::Fill(), edm::Event::getHandle(), hchi2, hchi2oNdof, hntrks, hnVertex, hptv2, hx, hy, hz, gpuVertexFinder::iv, ndof, HLT_FULL_cff::nVertices, tokenBeamSpot_, tokenSoAVertex_, x, reco::BeamSpot::x0(), y, reco::BeamSpot::y0(), z, and reco::BeamSpot::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  }
99  hnVertex->Fill(nVertices);
100 }
double z0() const
z coordinate
Definition: BeamSpot.h:65
int32_t *__restrict__ iv
edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
void Fill(long long x)
double dydz() const
dydz slope
Definition: BeamSpot.h:80
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertex_
double y0() const
y coordinate
Definition: BeamSpot.h:63
Log< level::Warning, false > LogWarning
double x0() const
x coordinate
Definition: BeamSpot.h:61
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", ";Vertez x;#entries", 10, -5., 5.);
113  hy = ibooker.book1D("vy", ";Vertez y;#entries", 10, -5., 5.);
114  hz = ibooker.book1D("vz", ";Vertez 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
void SiPixelPhase1MonitorVertexSoA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 121 of file SiPixelPhase1MonitorVertexSoA.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_FULL_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)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

Member Data Documentation

MonitorElement* SiPixelPhase1MonitorVertexSoA::hchi2
private

Definition at line 44 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hchi2oNdof
private

Definition at line 45 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hntrks
private

Definition at line 47 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hnVertex
private

Definition at line 40 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hptv2
private

Definition at line 46 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hx
private

Definition at line 41 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hy
private

Definition at line 42 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiPixelPhase1MonitorVertexSoA::hz
private

Definition at line 43 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 38 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and SiPixelPhase1MonitorVertexSoA().

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

Definition at line 37 of file SiPixelPhase1MonitorVertexSoA.cc.

Referenced by analyze(), and SiPixelPhase1MonitorVertexSoA().

std::string SiPixelPhase1MonitorVertexSoA::topFolderName_
private