83 tokenSoAHitsCPU_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pixelHitsSrc"))),
84 topFolderName_(iConfig.getParameter<
std::
string>(
"TopFolderName")) {}
90 tkGeom_ = &iSetup.
getData(geomToken_);
91 tTopo_ = &iSetup.
getData(topoToken_);
99 const auto& rhsoaHandle =
iEvent.getHandle(tokenSoAHitsCPU_);
100 if (!rhsoaHandle.isValid()) {
101 edm::LogWarning(
"SiPixelMonitorRecHitsSoA") <<
"No RecHits SoA found \n returning!" << std::endl;
104 auto const& rhsoa = *rhsoaHandle;
105 auto const& soa2d = rhsoa.const_view();
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();
117 uint32_t
charge = soa2d[
i].chargeAndStatus().charge;
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);
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);
136 hFposXY->Fill(xG, yG);
137 hFposZP->Fill(zG, fphi);
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);
153 template <
typename T>
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);
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);
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);
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);
185 for(
int is=0;is<2;is++){
186 int sign=is==0? -1:1;
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);
201 desc.add<
std::string>(
"TopFolderName",
"SiPixelHeterogeneous/PixelRecHitsSoA");
constexpr int32_t ceil(float num)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
MonitorElement * hFposXYD[2][12]
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
MonitorElement * hFsizeyD[2][12]
MonitorElement * hFchargeD[2][12]
virtual void setCurrentFolder(std::string const &fullpath)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
MonitorElement * hBsizeyL[4]
MonitorElement * hBFposZR
TrackingRecHitSoAView< T > HitSoA
MonitorElement * hBFposZP
~SiPixelMonitorRecHitsSoA() override=default
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * hFsizexD[2][12]
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
MonitorElement * hFcharge
MonitorElement * hBsizexL[4]
MonitorElement * hBposZPL[4]
const TrackerTopology * tTopo_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * hBchargeL[4]
constexpr float short2phi(short x)
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
const edm::EDGetTokenT< HitsOnHost > tokenSoAHitsCPU_
typename TrackingRecHitSoA< TrackerTraits >::template TrackingRecHitSoALayout<>::View TrackingRecHitSoAView
SiPixelMonitorRecHitsSoA(const edm::ParameterSet &)
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())
const TrackerGeometry * tkGeom_
const std::string topFolderName_
MonitorElement * hBcharge