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, 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, tokenBeamSpot_, tokenSoAVertex_, x, y, z, and HLTMuonOfflineAnalyzer_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  int nVertices = vsoa.view().nvFinal();
71  auto bsHandle = iEvent.getHandle(tokenBeamSpot_);
72  float x0 = 0., y0 = 0., z0 = 0., dxdz = 0., dydz = 0.;
73  if (!bsHandle.isValid()) {
74  edm::LogWarning("SiPixelMonitorVertexSoAAlpaka") << "No beamspot found. returning vertexes with (0,0,Z) ";
75  } else {
76  const reco::BeamSpot& bs = *bsHandle;
77  x0 = bs.x0();
78  y0 = bs.y0();
79  z0 = bs.z0();
80  dxdz = bs.dxdz();
81  dydz = bs.dydz();
82  }
83 
84  for (int iv = 0; iv < nVertices; iv++) {
85  auto si = vsoa.view()[iv].sortInd();
86  auto z = vsoa.view()[si].zv();
87  auto x = x0 + dxdz * z;
88  auto y = y0 + dydz * z;
89 
90  z += z0;
91  hx->Fill(x);
92  hy->Fill(y);
93  hz->Fill(z);
94  auto ndof = vsoa.view()[si].ndof();
95  hchi2->Fill(vsoa.view()[si].chi2());
96  hchi2oNdof->Fill(vsoa.view()[si].chi2() / ndof);
97  hptv2->Fill(vsoa.view()[si].ptv2());
98  hntrks->Fill(ndof + 1);
99  }
101 }
float dydz
const edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
float dxdz
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 106 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_.

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

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

122  {
123  // monitorpixelVertexSoA
125  desc.add<edm::InputTag>("pixelVertexSrc", edm::InputTag("pixelVerticesAlpaka"));
126  desc.add<edm::InputTag>("beamSpotSrc", edm::InputTag("offlineBeamSpot"));
127  desc.add<std::string>("topFolderName", "SiPixelHeterogeneous/PixelVertexAlpaka");
128  descriptions.addWithDefaultLabel(desc);
129 }
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().