82 topFolderName_(iConfig.getParameter<
std::
string>(
"topFolderName")),
83 mind2cut_(iConfig.getParameter<double>(
"minD2cut")) {}
98 if (not rhsoaHandleCPU
or not rhsoaHandleGPU) {
100 if (not rhsoaHandleCPU) {
101 out <<
"reference (cpu) rechits not found; ";
103 if (not rhsoaHandleGPU) {
104 out <<
"target (gpu) rechits not found; ";
106 out <<
"the comparison will not run.";
109 auto const& rhsoaCPU = *rhsoaHandleCPU;
111 auto const& rhsoaGPU = *rhsoaHandleGPU;
114 uint32_t nHitsCPU = soa2dCPU->nHits();
115 uint32_t nHitsGPU = soa2dGPU->nHits();
118 for (uint32_t
i = 0;
i < nHitsCPU;
i++) {
121 uint16_t indCPU = soa2dCPU->detectorIndex(
i);
122 float xLocalCPU = soa2dCPU->xLocal(
i);
123 float yLocalCPU = soa2dCPU->yLocal(
i);
124 for (uint32_t
j = 0;
j < nHitsGPU;
j++) {
125 if (soa2dGPU->detectorIndex(
j) == indCPU) {
126 float dx = xLocalCPU - soa2dGPU->xLocal(
j);
127 float dy = yLocalCPU - soa2dGPU->yLocal(
j);
135 DetId id = detIds[indCPU];
136 uint32_t chargeCPU = soa2dCPU->charge(
i);
139 uint32_t chargeGPU = 0;
140 int16_t sizeXGPU = -99;
141 int16_t sizeYGPU = -99;
142 float xLocalGPU = -999.;
143 float yLocalGPU = -999.;
145 chargeGPU = soa2dGPU->charge(matchedHit);
148 xLocalGPU = soa2dGPU->xLocal(matchedHit);
149 yLocalGPU = soa2dGPU->yLocal(matchedHit);
151 switch (
id.subdetId()) {
191 hnHits_ = iBook.
book2I(
"nHits",
"CPUvsGPU RecHits per event;#CPU RecHits;#GPU RecHits", 200, 0, 5000,200, 0, 5000);
194 hBchargeL_[il] = iBook.
book2I(Form(
"recHitsBLay%dCharge",il+1), Form(
"CPUvsGPU RecHits Charge Barrel Layer%d;CPU Charge;GPU Charge",il+1), 250, 0, 100000, 250, 0, 100000);
195 hBsizexL_[il] = iBook.
book2I(Form(
"recHitsBLay%dSizex",il+1), Form(
"CPUvsGPU RecHits SizeX Barrel Layer%d;CPU SizeX;GPU SizeX",il+1), 30, 0, 30, 30, 0, 30);
196 hBsizeyL_[il] = iBook.
book2I(Form(
"recHitsBLay%dSizey",il+1), Form(
"CPUvsGPU RecHits SizeY Barrel Layer%d;CPU SizeY;GPU SizeY",il+1), 30, 0, 30, 30, 0, 30);
197 hBposxL_[il] = iBook.
book2D(Form(
"recHitsBLay%dPosx",il+1), Form(
"CPUvsGPU RecHits x-pos in Barrel Layer%d;CPU pos x;GPU pos x",il+1), 200, -5, 5, 200,-5,5);
198 hBposyL_[il] = iBook.
book2D(Form(
"recHitsBLay%dPosy",il+1), Form(
"CPUvsGPU RecHits y-pos in Barrel Layer%d;CPU pos y;GPU pos y",il+1), 200, -5, 5, 200,-5,5);
202 for(
int is=0;is<2;is++){
203 int sign=is==0? -1:1;
205 hFchargeD_[is][
id] = iBook.
book2I(Form(
"recHitsFDisk%+dCharge",
id*
sign+
sign), Form(
"CPUvsGPU RecHits Charge Endcaps Disk%+d;CPU Charge;GPU Charge",
id*
sign+
sign), 250, 0, 100000, 250, 0, 100000);
206 hFsizexD_[is][
id] = iBook.
book2I(Form(
"recHitsFDisk%+dSizex",
id*
sign+
sign), Form(
"CPUvsGPU RecHits SizeX Endcaps Disk%+d;CPU SizeX;GPU SizeX",
id*
sign+
sign), 30, 0, 30, 30, 0, 30);
207 hFsizeyD_[is][
id] = iBook.
book2I(Form(
"recHitsFDisk%+dSizey",
id*
sign+
sign), Form(
"CPUvsGPU RecHits SizeY Endcaps Disk%+d;CPU SizeY;GPU SizeY",
id*
sign+
sign), 30, 0, 30, 30, 0, 30);
208 hFposxD_[is][
id] = iBook.
book2D(Form(
"recHitsFDisk%+dPosx",
id*
sign+
sign), Form(
"CPUvsGPU RecHits x-pos Endcaps Disk%+d;CPU pos x;GPU pos x",
id*
sign+
sign), 200, -5, 5, 200, -5, 5);
209 hFposyD_[is][
id] = iBook.
book2D(Form(
"recHitsFDisk%+dPosy",
id*
sign+
sign), Form(
"CPUvsGPU RecHits y-pos Endcaps Disk%+d;CPU pos y;GPU pos y",
id*
sign+
sign), 200, -5, 5, 200, -5, 5);
213 hBchargeDiff_ = iBook.
book1D(
"rechitChargeDiffBpix",
"Charge differnce of rechits in BPix; rechit charge difference (CPU - GPU)", 101, -50.5, 50.5);
214 hFchargeDiff_ = iBook.
book1D(
"rechitChargeDiffFpix",
"Charge differnce of rechits in FPix; rechit charge difference (CPU - GPU)", 101, -50.5, 50.5);
215 hBsizeXDiff_ = iBook.
book1D(
"rechitsizeXDiffBpix",
"SizeX difference of rechits in BPix; rechit sizex difference (CPU - GPU)", 21, -10.5, 10.5);
216 hFsizeXDiff_ = iBook.
book1D(
"rechitsizeXDiffFpix",
"SizeX difference of rechits in FPix; rechit sizex difference (CPU - GPU)", 21, -10.5, 10.5);
217 hBsizeYDiff_ = iBook.
book1D(
"rechitsizeYDiffBpix",
"SizeY difference of rechits in BPix; rechit sizey difference (CPU - GPU)", 21, -10.5, 10.5);
218 hFsizeYDiff_ = iBook.
book1D(
"rechitsizeYDiffFpix",
"SizeY difference of rechits in FPix; rechit sizey difference (CPU - GPU)", 21, -10.5, 10.5);
219 hBposXDiff_ = iBook.
book1D(
"rechitsposXDiffBpix",
"x-position difference of rechits in BPix; rechit x-pos difference (CPU - GPU)", 1000, -10, 10);
220 hFposXDiff_ = iBook.
book1D(
"rechitsposXDiffFpix",
"x-position difference of rechits in FPix; rechit x-pos difference (CPU - GPU)", 1000, -10, 10);
221 hBposYDiff_ = iBook.
book1D(
"rechitsposYDiffBpix",
"y-position difference of rechits in BPix; rechit y-pos difference (CPU - GPU)", 1000, -10, 10);
222 hFposYDiff_ = iBook.
book1D(
"rechitsposYDiffFpix",
"y-position difference of rechits in FPix; rechit y-pos difference (CPU - GPU)", 1000, -10, 10);
230 desc.add<
std::string>(
"topFolderName",
"SiPixelHeterogeneous/PixelRecHitsCompareGPUvsCPU");
231 desc.add<
double>(
"minD2cut", 0.0001);
const TrackerTopology * tTopo_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr int32_t ceil(float num)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
unsigned int pxbLayer(const DetId &id) const
MonitorElement * hBsizeXDiff_
MonitorElement * hBposyL_[4]
virtual void setCurrentFolder(std::string const &fullpath)
unsigned int numberOfLayers(int subdet) const
#define DEFINE_FWK_MODULE(type)
MonitorElement * hFsizeyD_[2][3]
MonitorElement * hBsizexL_[4]
MonitorElement * hFposyD_[2][3]
const edm::EDGetTokenT< TrackingRecHit2DCPU > tokenSoAHitsGPU_
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
MonitorElement * hFposXDiff_
MonitorElement * hFchargeDiff_
MonitorElement * hBsizeYDiff_
const std::string topFolderName_
static constexpr float micron_
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
MonitorElement * hFsizexD_[2][3]
MonitorElement * hBposXDiff_
MonitorElement * hFsizeXDiff_
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
unsigned int pxfDisk(const DetId &id) const
Abs< T >::type abs(const T &t)
bool getData(T &iHolder) const
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
MonitorElement * hFposYDiff_
MonitorElement * hBsizeyL_[4]
unsigned int pxfSide(const DetId &id) const
const TrackerGeometry * tkGeom_
const edm::EDGetTokenT< TrackingRecHit2DCPU > tokenSoAHitsCPU_
SiPixelPhase1CompareRecHitsSoA(const edm::ParameterSet &)
MonitorElement * hFposxD_[2][3]
~SiPixelPhase1CompareRecHitsSoA() override=default
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * hBposxL_[4]
MonitorElement * hBchargeDiff_
MonitorElement * hFsizeYDiff_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
static constexpr uint32_t invalidHit_
MonitorElement * hFchargeD_[2][3]
MonitorElement * book2I(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
MonitorElement * hBposYDiff_
MonitorElement * hBchargeL_[4]