74 tokenSoAHitsHost_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pixelHitsSrcHost"))),
75 tokenSoAHitsDevice_(consumes(iConfig.getParameter<
edm::
InputTag>(
"pixelHitsSrcDevice"))),
76 topFolderName_(iConfig.getParameter<
std::
string>(
"topFolderName")),
77 mind2cut_(iConfig.getParameter<double>(
"minD2cut")) {}
84 tkGeom_ = &iSetup.
getData(geomToken_);
85 tTopo_ = &iSetup.
getData(topoToken_);
93 const auto& rhsoaHandleHost =
iEvent.getHandle(tokenSoAHitsHost_);
94 const auto& rhsoaHandleDevice =
iEvent.getHandle(tokenSoAHitsDevice_);
95 if (not rhsoaHandleHost
or not rhsoaHandleDevice) {
97 if (not rhsoaHandleHost) {
98 out <<
"reference (Host) rechits not found; ";
100 if (not rhsoaHandleDevice) {
101 out <<
"target (Device) rechits not found; ";
103 out <<
"the comparison will not run.";
107 auto const& rhsoaHost = *rhsoaHandleHost;
108 auto const& rhsoaDevice = *rhsoaHandleDevice;
110 auto const& soa2dHost = rhsoaHost.const_view();
111 auto const& soa2dDevice = rhsoaDevice.const_view();
113 uint32_t nHitsHost = soa2dHost.metadata().size();
114 uint32_t nHitsDevice = soa2dDevice.metadata().size();
116 hnHits_->Fill(nHitsHost, nHitsDevice);
117 auto detIds = tkGeom_->detUnitIds();
118 for (uint32_t
i = 0;
i < nHitsHost;
i++) {
119 float minD = mind2cut_;
120 uint32_t matchedHit = invalidHit_;
121 uint16_t indHost = soa2dHost[
i].detectorIndex();
122 float xLocalHost = soa2dHost[
i].xLocal();
123 float yLocalHost = soa2dHost[
i].yLocal();
124 for (uint32_t
j = 0;
j < nHitsDevice;
j++) {
125 if (soa2dDevice.detectorIndex(
j) == indHost) {
126 float dx = xLocalHost - soa2dDevice[
j].xLocal();
127 float dy = yLocalHost - soa2dDevice[
j].yLocal();
135 DetId id = detIds[indHost];
136 uint32_t chargeHost = soa2dHost[
i].chargeAndStatus().charge;
139 uint32_t chargeDevice = 0;
140 int16_t sizeXDevice = -99;
141 int16_t sizeYDevice = -99;
142 float xLocalDevice = -999.;
143 float yLocalDevice = -999.;
144 if (matchedHit != invalidHit_) {
145 chargeDevice = soa2dDevice[matchedHit].chargeAndStatus().charge;
146 sizeXDevice =
std::ceil(
float(
std::abs(soa2dDevice[matchedHit].clusterSizeX()) / 8.));
147 sizeYDevice =
std::ceil(
float(
std::abs(soa2dDevice[matchedHit].clusterSizeY()) / 8.));
148 xLocalDevice = soa2dDevice[matchedHit].xLocal();
149 yLocalDevice = soa2dDevice[matchedHit].yLocal();
151 switch (
id.subdetId()) {
153 hBchargeL_[tTopo_->pxbLayer(
id) - 1]->Fill(chargeHost, chargeDevice);
154 hBsizexL_[tTopo_->pxbLayer(
id) - 1]->Fill(sizeXHost, sizeXDevice);
155 hBsizeyL_[tTopo_->pxbLayer(
id) - 1]->Fill(sizeYHost, sizeYDevice);
156 hBposxL_[tTopo_->pxbLayer(
id) - 1]->Fill(xLocalHost, xLocalDevice);
157 hBposyL_[tTopo_->pxbLayer(
id) - 1]->Fill(yLocalHost, yLocalDevice);
158 hBchargeDiff_->Fill(chargeHost - chargeDevice);
159 hBsizeXDiff_->Fill(sizeXHost - sizeXDevice);
160 hBsizeYDiff_->Fill(sizeYHost - sizeYDevice);
161 hBposXDiff_->Fill(micron_ * (xLocalHost - xLocalDevice));
162 hBposYDiff_->Fill(micron_ * (yLocalHost - yLocalDevice));
165 hFchargeD_[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(chargeHost, chargeDevice);
166 hFsizexD_[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(sizeXHost, sizeXDevice);
167 hFsizeyD_[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(sizeYHost, sizeYDevice);
168 hFposxD_[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(xLocalHost, xLocalDevice);
169 hFposyD_[tTopo_->pxfSide(
id) - 1][tTopo_->pxfDisk(
id) - 1]->Fill(yLocalHost, yLocalDevice);
170 hFchargeDiff_->Fill(chargeHost - chargeDevice);
171 hFsizeXDiff_->Fill(sizeXHost - sizeXDevice);
172 hFsizeYDiff_->Fill(sizeYHost - sizeYDevice);
173 hFposXDiff_->Fill(micron_ * (xLocalHost - xLocalDevice));
174 hFposYDiff_->Fill(micron_ * (yLocalHost - yLocalDevice));
183 template <
typename T>
192 hnHits_ = iBook.
book2I(
"nHits",
"HostvsDevice RecHits per event;#Host RecHits;#Device RecHits", 200, 0, 5000,200, 0, 5000);
195 hBchargeL_[il] = iBook.
book2I(Form(
"recHitsBLay%dCharge",il+1), Form(
"HostvsDevice RecHits Charge Barrel Layer%d;Host Charge;Device Charge",il+1), 250, 0, 100000, 250, 0, 100000);
196 hBsizexL_[il] = iBook.
book2I(Form(
"recHitsBLay%dSizex",il+1), Form(
"HostvsDevice RecHits SizeX Barrel Layer%d;Host SizeX;Device SizeX",il+1), 30, 0, 30, 30, 0, 30);
197 hBsizeyL_[il] = iBook.
book2I(Form(
"recHitsBLay%dSizey",il+1), Form(
"HostvsDevice RecHits SizeY Barrel Layer%d;Host SizeY;Device SizeY",il+1), 30, 0, 30, 30, 0, 30);
198 hBposxL_[il] = iBook.
book2D(Form(
"recHitsBLay%dPosx",il+1), Form(
"HostvsDevice RecHits x-pos in Barrel Layer%d;Host pos x;Device pos x",il+1), 200, -5, 5, 200,-5,5);
199 hBposyL_[il] = iBook.
book2D(Form(
"recHitsBLay%dPosy",il+1), Form(
"HostvsDevice RecHits y-pos in Barrel Layer%d;Host pos y;Device pos y",il+1), 200, -5, 5, 200,-5,5);
203 for(
int is=0;is<2;is++){
204 int sign=is==0? -1:1;
206 hFchargeD_[is][
id] = iBook.
book2I(Form(
"recHitsFDisk%+dCharge",
id*
sign+
sign), Form(
"HostvsDevice RecHits Charge Endcaps Disk%+d;Host Charge;Device Charge",
id*
sign+
sign), 250, 0, 100000, 250, 0, 100000);
207 hFsizexD_[is][
id] = iBook.
book2I(Form(
"recHitsFDisk%+dSizex",
id*
sign+
sign), Form(
"HostvsDevice RecHits SizeX Endcaps Disk%+d;Host SizeX;Device SizeX",
id*
sign+
sign), 30, 0, 30, 30, 0, 30);
208 hFsizeyD_[is][
id] = iBook.
book2I(Form(
"recHitsFDisk%+dSizey",
id*
sign+
sign), Form(
"HostvsDevice RecHits SizeY Endcaps Disk%+d;Host SizeY;Device SizeY",
id*
sign+
sign), 30, 0, 30, 30, 0, 30);
209 hFposxD_[is][
id] = iBook.
book2D(Form(
"recHitsFDisk%+dPosx",
id*
sign+
sign), Form(
"HostvsDevice RecHits x-pos Endcaps Disk%+d;Host pos x;Device pos x",
id*
sign+
sign), 200, -5, 5, 200, -5, 5);
210 hFposyD_[is][
id] = iBook.
book2D(Form(
"recHitsFDisk%+dPosy",
id*
sign+
sign), Form(
"HostvsDevice RecHits y-pos Endcaps Disk%+d;Host pos y;Device pos y",
id*
sign+
sign), 200, -5, 5, 200, -5, 5);
214 hBchargeDiff_ = iBook.
book1D(
"rechitChargeDiffBpix",
"Charge differnce of rechits in BPix; rechit charge difference (Host - Device)", 101, -50.5, 50.5);
215 hFchargeDiff_ = iBook.
book1D(
"rechitChargeDiffFpix",
"Charge differnce of rechits in FPix; rechit charge difference (Host - Device)", 101, -50.5, 50.5);
216 hBsizeXDiff_ = iBook.
book1D(
"rechitsizeXDiffBpix",
"SizeX difference of rechits in BPix; rechit sizex difference (Host - Device)", 21, -10.5, 10.5);
217 hFsizeXDiff_ = iBook.
book1D(
"rechitsizeXDiffFpix",
"SizeX difference of rechits in FPix; rechit sizex difference (Host - Device)", 21, -10.5, 10.5);
218 hBsizeYDiff_ = iBook.
book1D(
"rechitsizeYDiffBpix",
"SizeY difference of rechits in BPix; rechit sizey difference (Host - Device)", 21, -10.5, 10.5);
219 hFsizeYDiff_ = iBook.
book1D(
"rechitsizeYDiffFpix",
"SizeY difference of rechits in FPix; rechit sizey difference (Host - Device)", 21, -10.5, 10.5);
220 hBposXDiff_ = iBook.
book1D(
"rechitsposXDiffBpix",
"x-position difference of rechits in BPix; rechit x-pos difference (Host - Device)", 1000, -10, 10);
221 hFposXDiff_ = iBook.
book1D(
"rechitsposXDiffFpix",
"x-position difference of rechits in FPix; rechit x-pos difference (Host - Device)", 1000, -10, 10);
222 hBposYDiff_ = iBook.
book1D(
"rechitsposYDiffBpix",
"y-position difference of rechits in BPix; rechit y-pos difference (Host - Device)", 1000, -10, 10);
223 hFposYDiff_ = iBook.
book1D(
"rechitsposYDiffFpix",
"y-position difference of rechits in FPix; rechit y-pos difference (Host - Device)", 1000, -10, 10);
232 desc.add<
std::string>(
"topFolderName",
"SiPixelHeterogeneous/PixelRecHitsCompareDeviceVSHost");
233 desc.add<
double>(
"minD2cut", 0.0001);
constexpr int32_t ceil(float num)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
MonitorElement * hFposYDiff_
static constexpr float micron_
MonitorElement * hBsizeXDiff_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
SiPixelCompareRecHitsSoAAlpaka(const edm::ParameterSet &)
virtual void setCurrentFolder(std::string const &fullpath)
const std::string topFolderName_
MonitorElement * hFsizeXDiff_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
MonitorElement * hBposXDiff_
MonitorElement * hBsizeyL_[4]
MonitorElement * hBposYDiff_
const edm::EDGetTokenT< HitsOnHost > tokenSoAHitsHost_
~SiPixelCompareRecHitsSoAAlpaka() override=default
MonitorElement * hFchargeDiff_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
MonitorElement * hBsizeYDiff_
MonitorElement * hBposxL_[4]
MonitorElement * hBsizexL_[4]
#define DEFINE_FWK_MODULE(type)
MonitorElement * hFsizeyD_[2][12]
const edm::EDGetTokenT< HitsOnHost > tokenSoAHitsDevice_
static constexpr uint32_t invalidHit_
MonitorElement * hFposXDiff_
MonitorElement * hFposxD_[2][12]
MonitorElement * hFsizexD_[2][12]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
const TrackerGeometry * tkGeom_
MonitorElement * hFchargeD_[2][12]
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
MonitorElement * hFsizeYDiff_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * hFposyD_[2][12]
const TrackerTopology * tTopo_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * book2I(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * hBposyL_[4]
MonitorElement * hBchargeDiff_
MonitorElement * hBchargeL_[4]
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_