68 tokenSoAHits_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pixelHitsSrc"))),
69 topFolderName_(iConfig.getParameter<
std::
string>(
"TopFolderName")) {}
76 tkGeom_ = &iSetup.
getData(geomToken_);
77 tTopo_ = &iSetup.
getData(topoToken_);
85 const auto& rhsoaHandle =
iEvent.getHandle(tokenSoAHits_);
86 if (!rhsoaHandle.isValid()) {
87 edm::LogWarning(
"SiPixelMonitorRecHitsSoAAlpaka") <<
"No RecHits SoA found \n returning!";
90 auto const& rhsoa = *rhsoaHandle;
91 auto const& soa2d = rhsoa.const_view();
93 uint32_t nHits_ = soa2d.metadata().size();
95 auto detIds = tkGeom_->detUnitIds();
96 for (uint32_t
i = 0;
i < nHits_;
i++) {
97 DetId id = detIds[soa2d[
i].detectorIndex()];
98 float xG = soa2d[
i].xGlobal();
99 float yG = soa2d[
i].yGlobal();
100 float zG = soa2d[
i].zGlobal();
101 float rG = soa2d[
i].rGlobal();
103 uint32_t
charge = soa2d[
i].chargeAndStatus().charge;
106 hBFposZP->Fill(zG, fphi);
107 int16_t ysign = yG >= 0 ? 1 : -1;
108 hBFposZR->Fill(zG, rG * ysign);
109 switch (
id.subdetId()) {
111 hBposXY->Fill(xG, yG);
112 hBposZP->Fill(zG, fphi);
114 hBsizex->Fill(
sizeX);
115 hBsizey->Fill(
sizeY);
116 hBposZPL[tTopo_->pxbLayer(
id) - 1]->Fill(zG, fphi);
117 hBchargeL[tTopo_->pxbLayer(
id) - 1]->Fill(
charge);
118 hBsizexL[tTopo_->pxbLayer(
id) - 1]->Fill(
sizeX);
119 hBsizeyL[tTopo_->pxbLayer(
id) - 1]->Fill(
sizeY);
122 hFposXY->Fill(xG, yG);
123 hFposZP->Fill(zG, fphi);
125 hFsizex->Fill(
sizeX);
126 hFsizey->Fill(
sizeY);
127 hFposXYD[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(xG, yG);
128 hFchargeD[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(
charge);
129 hFsizexD[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(
sizeX);
130 hFsizeyD[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(
sizeY);
139 template <
typename T>
148 hnHits = iBook.
book1D(
"nHits",
"RecHits per event;RecHits;#events", 200, 0, 5000);
149 hBFposZP = iBook.
book2D(
"recHitsGlobalPosZP",
"RecHits position Global;Z;#phi", 1000, -60, 60, 200,-3.2,3.2);
150 hBFposZR = iBook.
book2D(
"recHitsGlobalPosZR",
"RecHits position Global;Z;R", 1000, -60, 60, 200,-20,20);
152 hBposXY = iBook.
book2D(
"recHitsBarrelPosXY",
"RecHits position Barrel;X;Y", 200, -20, 20, 200,-20,20);
153 hBposZP = iBook.
book2D(
"recHitsBarrelPosZP",
"RecHits position Barrel;Z;#phi", 300, -30, 30, 200,-3.2,3.2);
154 hBcharge = iBook.
book1D(
"recHitsBarrelCharge",
"RecHits Charge Barrel;Charge;#events", 250, 0, 100000);
155 hBsizex = iBook.
book1D(
"recHitsBarrelSizex",
"RecHits SizeX Barrel;SizeX;#events", 50, 0, 50);
156 hBsizey = iBook.
book1D(
"recHitsBarrelSizey",
"RecHits SizeY Barrel;SizeY;#events", 50, 0, 50);
159 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);
160 hBchargeL[il] = iBook.
book1D(Form(
"recHitsBLay%dCharge",il+1), Form(
"RecHits Charge Barrel Layer%d;Charge;#events",il+1), 250, 0, 100000);
161 hBsizexL[il] = iBook.
book1D(Form(
"recHitsBLay%dSizex",il+1), Form(
"RecHits SizeX Barrel Layer%d;SizeX;#events",il+1), 50, 0, 50);
162 hBsizeyL[il] = iBook.
book1D(Form(
"recHitsBLay%dSizey",il+1), Form(
"RecHits SizeY Barrel Layer%d;SizeY;#events",il+1), 50, 0, 50);
165 hFposXY = iBook.
book2D(
"recHitsEndcapsPosXY",
"RecHits position Endcaps;X;Y", 200, -20, 20, 200,-20, 20);
166 hFposZP = iBook.
book2D(
"recHitsEndcapsPosZP",
"RecHits position Endcaps;Z;#phi", 600, -60, 60, 200,-3.2,3.2);
167 hFcharge = iBook.
book1D(
"recHitsEndcapsCharge",
"RecHits Charge Endcaps;Charge;#events", 250, 0, 100000);
168 hFsizex = iBook.
book1D(
"recHitsEndcapsSizex",
"RecHits SizeX Endcaps;SizeX;#events", 50, 0, 50);
169 hFsizey = iBook.
book1D(
"recHitsEndcapsSizey",
"RecHits SizeY Endcaps;SizeY;#events", 50, 0, 50);
171 for(
int is=0;is<2;is++){
172 int sign=is==0? -1:1;
174 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);
175 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);
176 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);
177 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);
187 desc.add<
std::string>(
"TopFolderName",
"SiPixelHeterogeneous/PixelRecHitsAlpaka");
MonitorElement * hBsizexL[4]
constexpr int32_t ceil(float num)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
SiPixelMonitorRecHitsSoAAlpaka(const edm::ParameterSet &)
MonitorElement * hBFposZR
MonitorElement * hBposZPL[4]
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
virtual void setCurrentFolder(std::string const &fullpath)
~SiPixelMonitorRecHitsSoAAlpaka() override=default
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
MonitorElement * hFsizeyD[2][12]
const std::string topFolderName_
MonitorElement * hFcharge
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * hBchargeL[4]
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
MonitorElement * hFposXYD[2][12]
MonitorElement * hFsizexD[2][12]
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * hBcharge
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
constexpr float short2phi(short x)
const TrackerGeometry * tkGeom_
MonitorElement * hFchargeD[2][12]
const TrackerTopology * tTopo_
MonitorElement * hBsizeyL[4]
const edm::EDGetTokenT< HitsOnHost > tokenSoAHits_
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * hBFposZP
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_