CMS 3D CMS Logo

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

bookLayer More...

#include <SiPixelMonitorVertexSoAAlpaka.cc>

Inheritance diagram for SiPixelMonitorVertexSoAAlpaka:
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
 
 SiPixelMonitorVertexSoAAlpaka (const edm::ParameterSet &)
 
 ~SiPixelMonitorVertexSoAAlpaka () 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
 
const edm::EDGetTokenT< reco::BeamSpottokenBeamSpot_
 
const edm::EDGetTokenT< ZVertexHosttokenSoAVertex_
 
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 SiPixelMonitorVertexSoAAlpaka.cc.

Member Typedef Documentation

◆ IndToEdm

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

Definition at line 29 of file SiPixelMonitorVertexSoAAlpaka.cc.

Constructor & Destructor Documentation

◆ SiPixelMonitorVertexSoAAlpaka()

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

Definition at line 54 of file SiPixelMonitorVertexSoAAlpaka.cc.

55  : tokenSoAVertex_(consumes<ZVertexHost>(iConfig.getParameter<edm::InputTag>("pixelVertexSrc"))),
56  tokenBeamSpot_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpotSrc"))),
57  topFolderName_(iConfig.getParameter<std::string>("topFolderName")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
const edm::EDGetTokenT< ZVertexHost > tokenSoAVertex_

◆ ~SiPixelMonitorVertexSoAAlpaka()

SiPixelMonitorVertexSoAAlpaka::~SiPixelMonitorVertexSoAAlpaka ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 62 of file SiPixelMonitorVertexSoAAlpaka.cc.

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

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

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 108 of file SiPixelMonitorVertexSoAAlpaka.cc.

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

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

Definition at line 124 of file SiPixelMonitorVertexSoAAlpaka.cc.

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

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

Member Data Documentation

◆ hchi2

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hchi2
private

Definition at line 44 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hchi2oNdof

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hchi2oNdof
private

Definition at line 45 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hntrks

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hntrks
private

Definition at line 47 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hnVertex

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hnVertex
private

Definition at line 40 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hptv2

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hptv2
private

Definition at line 46 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hx

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hx
private

Definition at line 41 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hy

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hy
private

Definition at line 42 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ hz

MonitorElement* SiPixelMonitorVertexSoAAlpaka::hz
private

Definition at line 43 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze(), and bookHistograms().

◆ tokenBeamSpot_

const edm::EDGetTokenT<reco::BeamSpot> SiPixelMonitorVertexSoAAlpaka::tokenBeamSpot_
private

Definition at line 38 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze().

◆ tokenSoAVertex_

const edm::EDGetTokenT<ZVertexHost> SiPixelMonitorVertexSoAAlpaka::tokenSoAVertex_
private

Definition at line 37 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by analyze().

◆ topFolderName_

std::string SiPixelMonitorVertexSoAAlpaka::topFolderName_
private

Definition at line 39 of file SiPixelMonitorVertexSoAAlpaka.cc.

Referenced by bookHistograms().