CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
SiPixelMonitorRecHitsSoA< T > Class Template Reference

bookLayer More...

#include <SiPixelMonitorRecHitsSoA.cc>

Inheritance diagram for SiPixelMonitorRecHitsSoA< T >:

Public Types

using HitSoA = TrackingRecHitSoAView< T >
 
using HitsOnHost = TrackingRecHitSoAHost< 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
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 SiPixelMonitorRecHitsSoA (const edm::ParameterSet &)
 
 ~SiPixelMonitorRecHitsSoA () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
MonitorElementhBcharge
 
MonitorElementhBchargeL [4]
 
MonitorElementhBFposZP
 
MonitorElementhBFposZR
 
MonitorElementhBposXY
 
MonitorElementhBposZP
 
MonitorElementhBposZPL [4]
 
MonitorElementhBsizex
 
MonitorElementhBsizexL [4]
 
MonitorElementhBsizey
 
MonitorElementhBsizeyL [4]
 
MonitorElementhFcharge
 
MonitorElementhFchargeD [2][12]
 
MonitorElementhFposXY
 
MonitorElementhFposXYD [2][12]
 
MonitorElementhFposZP
 
MonitorElementhFsizex
 
MonitorElementhFsizexD [2][12]
 
MonitorElementhFsizey
 
MonitorElementhFsizeyD [2][12]
 
MonitorElementhnHits
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::EDGetTokenT< HitsOnHosttokenSoAHitsCPU_
 
const std::string topFolderName_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
const TrackerTopologytTopo_ = nullptr
 

Detailed Description

template<typename T>
class SiPixelMonitorRecHitsSoA< T >

bookLayer

Definition at line 33 of file SiPixelMonitorRecHitsSoA.cc.

Member Typedef Documentation

◆ HitSoA

template<typename T >
using SiPixelMonitorRecHitsSoA< T >::HitSoA = TrackingRecHitSoAView<T>

Definition at line 35 of file SiPixelMonitorRecHitsSoA.cc.

◆ HitsOnHost

template<typename T >
using SiPixelMonitorRecHitsSoA< T >::HitsOnHost = TrackingRecHitSoAHost<T>

Definition at line 36 of file SiPixelMonitorRecHitsSoA.cc.

Constructor & Destructor Documentation

◆ SiPixelMonitorRecHitsSoA()

template<typename T >
SiPixelMonitorRecHitsSoA< T >::SiPixelMonitorRecHitsSoA ( const edm::ParameterSet iConfig)
explicit

Definition at line 80 of file SiPixelMonitorRecHitsSoA.cc.

81  : geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
82  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()),
83  tokenSoAHitsCPU_(consumes(iConfig.getParameter<edm::InputTag>("pixelHitsSrc"))),
84  topFolderName_(iConfig.getParameter<std::string>("TopFolderName")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const edm::EDGetTokenT< HitsOnHost > tokenSoAHitsCPU_

◆ ~SiPixelMonitorRecHitsSoA()

template<typename T >
SiPixelMonitorRecHitsSoA< T >::~SiPixelMonitorRecHitsSoA ( )
overridedefault

Member Function Documentation

◆ analyze()

template<typename T >
void SiPixelMonitorRecHitsSoA< T >::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 98 of file SiPixelMonitorRecHitsSoA.cc.

References funct::abs(), reco::ceil(), ALCARECOTkAlJpsiMuMu_cff::charge, mps_fire::i, iEvent, hcalRecHitTable_cff::iphi, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, short2phi(), RecoTauValidation_cfi::sizeX, and RecoTauValidation_cfi::sizeY.

98  {
99  const auto& rhsoaHandle = iEvent.getHandle(tokenSoAHitsCPU_);
100  if (!rhsoaHandle.isValid()) {
101  edm::LogWarning("SiPixelMonitorRecHitsSoA") << "No RecHits SoA found \n returning!" << std::endl;
102  return;
103  }
104  auto const& rhsoa = *rhsoaHandle;
105  auto const& soa2d = rhsoa.const_view();
106 
107  uint32_t nHits_ = soa2d.nHits();
108  hnHits->Fill(nHits_);
109  auto detIds = tkGeom_->detUnitIds();
110  for (uint32_t i = 0; i < nHits_; i++) {
111  DetId id = detIds[soa2d[i].detectorIndex()];
112  float xG = soa2d[i].xGlobal();
113  float yG = soa2d[i].yGlobal();
114  float zG = soa2d[i].zGlobal();
115  float rG = soa2d[i].rGlobal();
116  float fphi = short2phi(soa2d[i].iphi());
117  uint32_t charge = soa2d[i].chargeAndStatus().charge;
118  int16_t sizeX = std::ceil(float(std::abs(soa2d[i].clusterSizeX()) / 8.));
119  int16_t sizeY = std::ceil(float(std::abs(soa2d[i].clusterSizeY()) / 8.));
120  hBFposZP->Fill(zG, fphi);
121  int16_t ysign = yG >= 0 ? 1 : -1;
122  hBFposZR->Fill(zG, rG * ysign);
123  switch (id.subdetId()) {
125  hBposXY->Fill(xG, yG);
126  hBposZP->Fill(zG, fphi);
127  hBcharge->Fill(charge);
128  hBsizex->Fill(sizeX);
129  hBsizey->Fill(sizeY);
130  hBposZPL[tTopo_->pxbLayer(id) - 1]->Fill(zG, fphi);
131  hBchargeL[tTopo_->pxbLayer(id) - 1]->Fill(charge);
132  hBsizexL[tTopo_->pxbLayer(id) - 1]->Fill(sizeX);
133  hBsizeyL[tTopo_->pxbLayer(id) - 1]->Fill(sizeY);
134  break;
136  hFposXY->Fill(xG, yG);
137  hFposZP->Fill(zG, fphi);
138  hFcharge->Fill(charge);
139  hFsizex->Fill(sizeX);
140  hFsizey->Fill(sizeY);
141  hFposXYD[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(xG, yG);
142  hFchargeD[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(charge);
143  hFsizexD[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(sizeX);
144  hFsizeyD[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(sizeY);
145  break;
146  }
147  }
148 }
constexpr int32_t ceil(float num)
MonitorElement * hFposXYD[2][12]
unsigned int pxbLayer(const DetId &id) const
MonitorElement * hFsizeyD[2][12]
MonitorElement * hFchargeD[2][12]
MonitorElement * hFsizexD[2][12]
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
unsigned int pxfDisk(const DetId &id) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
const TrackerTopology * tTopo_
constexpr float short2phi(short x)
Definition: approx_atan2.h:285
const edm::EDGetTokenT< HitsOnHost > tokenSoAHitsCPU_
Log< level::Warning, false > LogWarning
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
const TrackerGeometry * tkGeom_

◆ bookHistograms()

template<typename T >
void SiPixelMonitorRecHitsSoA< T >::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
override

Definition at line 154 of file SiPixelMonitorRecHitsSoA.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), l1ctLayer2EG_cff::id, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, dqm::implementation::NavigatorBase::setCurrentFolder(), and Validation_hcalonly_cfi::sign.

156  {
157  iBook.cd();
158  iBook.setCurrentFolder(topFolderName_);
159 
160  // clang-format off
161  //Global
162  hnHits = iBook.book1D("nHits", "RecHits per event;RecHits;#events", 200, 0, 5000);
163  hBFposZP = iBook.book2D("recHitsGlobalPosZP", "RecHits position Global;Z;#phi", 1000, -60, 60, 200,-3.2,3.2);
164  hBFposZR = iBook.book2D("recHitsGlobalPosZR", "RecHits position Global;Z;R", 1000, -60, 60, 200,-20,20);
165  //Barrel
166  hBposXY = iBook.book2D("recHitsBarrelPosXY", "RecHits position Barrel;X;Y", 200, -20, 20, 200,-20,20);
167  hBposZP = iBook.book2D("recHitsBarrelPosZP", "RecHits position Barrel;Z;#phi", 300, -30, 30, 200,-3.2,3.2);
168  hBcharge = iBook.book1D("recHitsBarrelCharge", "RecHits Charge Barrel;Charge;#events", 250, 0, 100000);
169  hBsizex = iBook.book1D("recHitsBarrelSizex", "RecHits SizeX Barrel;SizeX;#events", 50, 0, 50);
170  hBsizey = iBook.book1D("recHitsBarrelSizey", "RecHits SizeY Barrel;SizeY;#events", 50, 0, 50);
171  //Barrel Layer
172  for(unsigned int il=0;il<tkGeom_->numberOfLayers(PixelSubdetector::PixelBarrel);il++){
173  hBposZPL[il] = iBook.book2D(Form("recHitsBLay%dPosZP",il+1), Form("RecHits position Barrel Layer%d;Z;#phi",il+1), 300, -30, 30, 200,-3.2,3.2);
174  hBchargeL[il] = iBook.book1D(Form("recHitsBLay%dCharge",il+1), Form("RecHits Charge Barrel Layer%d;Charge;#events",il+1), 250, 0, 100000);
175  hBsizexL[il] = iBook.book1D(Form("recHitsBLay%dSizex",il+1), Form("RecHits SizeX Barrel Layer%d;SizeX;#events",il+1), 50, 0, 50);
176  hBsizeyL[il] = iBook.book1D(Form("recHitsBLay%dSizey",il+1), Form("RecHits SizeY Barrel Layer%d;SizeY;#events",il+1), 50, 0, 50);
177  }
178  //Endcaps
179  hFposXY = iBook.book2D("recHitsEndcapsPosXY", "RecHits position Endcaps;X;Y", 200, -20, 20, 200,-20, 20);
180  hFposZP = iBook.book2D("recHitsEndcapsPosZP", "RecHits position Endcaps;Z;#phi", 600, -60, 60, 200,-3.2,3.2);
181  hFcharge = iBook.book1D("recHitsEndcapsCharge", "RecHits Charge Endcaps;Charge;#events", 250, 0, 100000);
182  hFsizex = iBook.book1D("recHitsEndcapsSizex", "RecHits SizeX Endcaps;SizeX;#events", 50, 0, 50);
183  hFsizey = iBook.book1D("recHitsEndcapsSizey", "RecHits SizeY Endcaps;SizeY;#events", 50, 0, 50);
184  //Endcaps Disk
185  for(int is=0;is<2;is++){
186  int sign=is==0? -1:1;
187  for(unsigned int id=0;id<tkGeom_->numberOfLayers(PixelSubdetector::PixelEndcap);id++){
188  hFposXYD[is][id] = iBook.book2D(Form("recHitsFDisk%+dPosXY",id*sign+sign), Form("RecHits position Endcaps Disk%+d;X;Y",id*sign+sign), 200, -20, 20, 200,-20,20);
189  hFchargeD[is][id] = iBook.book1D(Form("recHitsFDisk%+dCharge",id*sign+sign), Form("RecHits Charge Endcaps Disk%+d;Charge;#events",id*sign+sign), 250, 0, 100000);
190  hFsizexD[is][id] = iBook.book1D(Form("recHitsFDisk%+dSizex",id*sign+sign), Form("RecHits SizeX Endcaps Disk%+d;SizeX;#events",id*sign+sign), 50, 0, 50);
191  hFsizeyD[is][id] = iBook.book1D(Form("recHitsFDisk%+dSizey",id*sign+sign), Form("RecHits SizeY Endcaps Disk%+d;SizeY;#events",id*sign+sign), 50, 0, 50);
192  }
193  }
194 }
MonitorElement * hFposXYD[2][12]
MonitorElement * hFsizeyD[2][12]
MonitorElement * hFchargeD[2][12]
unsigned int numberOfLayers(int subdet) const
MonitorElement * hFsizexD[2][12]
const TrackerGeometry * tkGeom_

◆ dqmBeginRun()

template<typename T >
void SiPixelMonitorRecHitsSoA< T >::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 89 of file SiPixelMonitorRecHitsSoA.cc.

References edm::EventSetup::getData().

89  {
90  tkGeom_ = &iSetup.getData(geomToken_);
91  tTopo_ = &iSetup.getData(topoToken_);
92 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const TrackerTopology * tTopo_
const TrackerGeometry * tkGeom_

◆ fillDescriptions()

template<typename T >
void SiPixelMonitorRecHitsSoA< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 197 of file SiPixelMonitorRecHitsSoA.cc.

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

197  {
198  // monitorpixelRecHitsSoA
200  desc.add<edm::InputTag>("pixelHitsSrc", edm::InputTag("siPixelRecHitsPreSplittingSoA"));
201  desc.add<std::string>("TopFolderName", "SiPixelHeterogeneous/PixelRecHitsSoA");
202  descriptions.addWithDefaultLabel(desc);
203 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ geomToken_

template<typename T >
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelMonitorRecHitsSoA< T >::geomToken_
private

Definition at line 46 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBcharge

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBcharge
private

Definition at line 57 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBchargeL

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBchargeL[4]
private

Definition at line 61 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBFposZP

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBFposZP
private

Definition at line 53 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBFposZR

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBFposZR
private

Definition at line 54 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBposXY

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBposXY
private

Definition at line 55 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBposZP

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBposZP
private

Definition at line 56 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBposZPL

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBposZPL[4]
private

Definition at line 60 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBsizex

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBsizex
private

Definition at line 58 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBsizexL

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBsizexL[4]
private

Definition at line 62 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBsizey

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBsizey
private

Definition at line 59 of file SiPixelMonitorRecHitsSoA.cc.

◆ hBsizeyL

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hBsizeyL[4]
private

Definition at line 63 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFcharge

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFcharge
private

Definition at line 66 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFchargeD

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFchargeD[2][12]
private

Definition at line 70 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFposXY

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFposXY
private

Definition at line 64 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFposXYD

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFposXYD[2][12]
private

Definition at line 69 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFposZP

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFposZP
private

Definition at line 65 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFsizex

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFsizex
private

Definition at line 67 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFsizexD

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFsizexD[2][12]
private

Definition at line 71 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFsizey

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFsizey
private

Definition at line 68 of file SiPixelMonitorRecHitsSoA.cc.

◆ hFsizeyD

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hFsizeyD[2][12]
private

Definition at line 72 of file SiPixelMonitorRecHitsSoA.cc.

◆ hnHits

template<typename T >
MonitorElement* SiPixelMonitorRecHitsSoA< T >::hnHits
private

Definition at line 52 of file SiPixelMonitorRecHitsSoA.cc.

◆ tkGeom_

template<typename T >
const TrackerGeometry* SiPixelMonitorRecHitsSoA< T >::tkGeom_ = nullptr
private

Definition at line 50 of file SiPixelMonitorRecHitsSoA.cc.

◆ tokenSoAHitsCPU_

template<typename T >
const edm::EDGetTokenT<HitsOnHost> SiPixelMonitorRecHitsSoA< T >::tokenSoAHitsCPU_
private

Definition at line 48 of file SiPixelMonitorRecHitsSoA.cc.

◆ topFolderName_

template<typename T >
const std::string SiPixelMonitorRecHitsSoA< T >::topFolderName_
private

Definition at line 49 of file SiPixelMonitorRecHitsSoA.cc.

◆ topoToken_

template<typename T >
const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiPixelMonitorRecHitsSoA< T >::topoToken_
private

Definition at line 47 of file SiPixelMonitorRecHitsSoA.cc.

◆ tTopo_

template<typename T >
const TrackerTopology* SiPixelMonitorRecHitsSoA< T >::tTopo_ = nullptr
private

Definition at line 51 of file SiPixelMonitorRecHitsSoA.cc.