CMS 3D CMS Logo

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

bookLayer More...

#include <SiPixelMonitorVertexSoA.cc>

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

Public Types

using IndToEdm = std::vector< uint16_t >
 
- 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
 

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
 
 SiPixelMonitorVertexSoA (const edm::ParameterSet &)
 
 ~SiPixelMonitorVertexSoA () 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 &)
 

Private Attributes

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

Additional Inherited Members

- 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

bookLayer

Definition at line 27 of file SiPixelMonitorVertexSoA.cc.

Member Typedef Documentation

◆ IndToEdm

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

Definition at line 29 of file SiPixelMonitorVertexSoA.cc.

Constructor & Destructor Documentation

◆ SiPixelMonitorVertexSoA()

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

Definition at line 54 of file SiPixelMonitorVertexSoA.cc.

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

54  {
55  tokenSoAVertex_ = consumes(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< ZVertexSoAHost > tokenSoAVertex_

◆ ~SiPixelMonitorVertexSoA()

SiPixelMonitorVertexSoA::~SiPixelMonitorVertexSoA ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 63 of file SiPixelMonitorVertexSoA.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("SiPixelMonitorVertexSoA") << "No Vertex SoA found \n returning!" << std::endl;
67  return;
68  }
69 
70  auto const& vsoa = *vsoaHandle;
71  int nVertices = vsoa.view().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("SiPixelMonitorVertexSoA") << "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 
85  for (int iv = 0; iv < nVertices; iv++) {
86  auto si = vsoa.view()[iv].sortInd();
87  auto z = vsoa.view()[si].zv();
88  auto x = x0 + dxdz * z;
89  auto y = y0 + dydz * z;
90 
91  z += z0;
92  hx->Fill(x);
93  hy->Fill(y);
94  hz->Fill(z);
95  auto ndof = vsoa.view()[si].ndof();
96  hchi2->Fill(vsoa.view()[si].chi2());
97  hchi2oNdof->Fill(vsoa.view()[si].chi2() / ndof);
98  hptv2->Fill(vsoa.view()[si].ptv2());
99  hntrks->Fill(ndof + 1);
100  }
102 }
float dydz
int32_t *__restrict__ iv
float dxdz
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
edm::EDGetTokenT< ZVertexSoAHost > tokenSoAVertex_
Log< level::Warning, false > LogWarning

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 107 of file SiPixelMonitorVertexSoA.cc.

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

109  {
110  //std::string top_folder = ""//
111  ibooker.cd();
113  hnVertex = ibooker.book1D("nVertex", ";# of Vertices;#entries", 101, -0.5, 100.5);
114  hx = ibooker.book1D("vx", ";Vertex x;#entries", 10, -5., 5.);
115  hy = ibooker.book1D("vy", ";Vertex y;#entries", 10, -5., 5.);
116  hz = ibooker.book1D("vz", ";Vertex z;#entries", 30, -30., 30);
117  hchi2 = ibooker.book1D("chi2", ";Vertex chi-squared;#entries", 40, 0., 20.);
118  hchi2oNdof = ibooker.book1D("chi2oNdof", ";Vertex chi-squared/Ndof;#entries", 40, 0., 20.);
119  hptv2 = ibooker.book1D("ptsq", ";Vertex #sum (p_{T})^{2};#entries", 200, 0., 200.);
120  hntrks = ibooker.book1D("ntrk", ";#tracks associated;#entries", 100, -0.5, 99.5);
121 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
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 SiPixelMonitorVertexSoA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 123 of file SiPixelMonitorVertexSoA.cc.

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

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

Member Data Documentation

◆ hchi2

MonitorElement* SiPixelMonitorVertexSoA::hchi2
private

Definition at line 44 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hchi2oNdof

MonitorElement* SiPixelMonitorVertexSoA::hchi2oNdof
private

Definition at line 45 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hntrks

MonitorElement* SiPixelMonitorVertexSoA::hntrks
private

Definition at line 47 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hnVertex

MonitorElement* SiPixelMonitorVertexSoA::hnVertex
private

Definition at line 40 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hptv2

MonitorElement* SiPixelMonitorVertexSoA::hptv2
private

Definition at line 46 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hx

MonitorElement* SiPixelMonitorVertexSoA::hx
private

Definition at line 41 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hy

MonitorElement* SiPixelMonitorVertexSoA::hy
private

Definition at line 42 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ hz

MonitorElement* SiPixelMonitorVertexSoA::hz
private

Definition at line 43 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and bookHistograms().

◆ tokenBeamSpot_

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

Definition at line 38 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and SiPixelMonitorVertexSoA().

◆ tokenSoAVertex_

edm::EDGetTokenT<ZVertexSoAHost> SiPixelMonitorVertexSoA::tokenSoAVertex_
private

Definition at line 37 of file SiPixelMonitorVertexSoA.cc.

Referenced by analyze(), and SiPixelMonitorVertexSoA().

◆ topFolderName_

std::string SiPixelMonitorVertexSoA::topFolderName_
private

Definition at line 39 of file SiPixelMonitorVertexSoA.cc.

Referenced by bookHistograms(), and SiPixelMonitorVertexSoA().