60 topFolderName_(iConfig.getParameter<
std::
string>(
"topFolderName")),
61 dzCut_(iConfig.getParameter<double>(
"dzCut")) {}
69 if (not vsoaHandleCPU
or not vsoaHandleGPU) {
71 if (not vsoaHandleCPU) {
72 out <<
"reference (cpu) tracks not found; ";
74 if (not vsoaHandleGPU) {
75 out <<
"target (gpu) tracks not found; ";
77 out <<
"the comparison will not run.";
81 auto const& vsoaCPU = *vsoaHandleCPU->get();
82 int nVerticesCPU = vsoaCPU.nvFinal;
83 auto const& vsoaGPU = *vsoaHandleGPU->get();
84 int nVerticesGPU = vsoaGPU.nvFinal;
87 float x0 = 0., y0 = 0.,
z0 = 0.,
dxdz = 0.,
dydz = 0.;
88 if (!bsHandle.isValid()) {
89 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot found. returning vertexes with (0,0,Z) ";
99 for (
int ivc = 0; ivc < nVerticesCPU; ivc++) {
100 auto sic = vsoaCPU.sortInd[ivc];
101 auto zc = vsoaCPU.zv[sic];
102 auto xc = x0 +
dxdz * zc;
103 auto yc = y0 +
dydz * zc;
106 auto ndofCPU = vsoaCPU.ndof[sic];
107 auto chi2CPU = vsoaCPU.chi2[sic];
113 for (
int ivg = 0; ivg < nVerticesGPU; ivg++) {
114 auto sig = vsoaGPU.sortInd[ivg];
115 auto zgc = vsoaGPU.zv[sig] +
z0;
128 auto zg = vsoaGPU.zv[closestVtxidx];
129 auto xg = x0 +
dxdz * zg;
130 auto yg = y0 +
dydz * zg;
132 auto ndofGPU = vsoaGPU.ndof[closestVtxidx];
133 auto chi2GPU = vsoaGPU.chi2[closestVtxidx];
143 hptv2_->
Fill(vsoaCPU.ptv2[sic], vsoaGPU.ptv2[closestVtxidx]);
160 hnVertex_ = ibooker.
book2I(
"nVertex",
"# of Vertex;CPU;GPU", 101, -0.5, 100.5, 101, -0.5, 100.5);
161 hx_ = ibooker.
book2I(
"vx",
"Vertez x - Beamspot x;CPU;GPU", 50, -0.1, 0.1, 50, -0.1, 0.1);
162 hy_ = ibooker.
book2I(
"vy",
"Vertez y - Beamspot y;CPU;GPU", 50, -0.1, 0.1, 50, -0.1, 0.1);
163 hz_ = ibooker.
book2I(
"vz",
"Vertez z;CPU;GPU", 30, -30., 30., 30, -30., 30.);
164 hchi2_ = ibooker.
book2I(
"chi2",
"Vertex chi-squared;CPU;GPU", 40, 0., 20., 40, 0., 20.);
165 hchi2oNdof_ = ibooker.
book2I(
"chi2oNdof",
"Vertex chi-squared/Ndof;CPU;GPU", 40, 0., 20., 40, 0., 20.);
166 hptv2_ = ibooker.
book2I(
"ptsq",
"Vertex p_T squared;CPU;GPU", 200, 0., 200., 200, 0., 200.);
167 hntrks_ = ibooker.
book2I(
"ntrk",
"#tracks associated;CPU;GPU", 100, -0.5, 99.5, 100, -0.5, 99.5);
168 hntrks_ = ibooker.
book2I(
"ntrk",
"#tracks associated;CPU;GPU", 100, -0.5, 99.5, 100, -0.5, 99.5);
169 hxdiff_ = ibooker.
book1D(
"vxdiff",
";Vertex x difference (CPU - GPU);#entries", 100, -0.001, 0.001);
170 hydiff_ = ibooker.
book1D(
"vydiff",
";Vertex y difference (CPU - GPU);#entries", 100, -0.001, 0.001);
171 hzdiff_ = ibooker.
book1D(
"vzdiff",
";Vertex z difference (CPU - GPU);#entries", 100, -2.5, 2.5);
180 desc.add<
std::string>(
"topFolderName",
"SiPixelHeterogeneous/PixelVertexCompareSoAGPUvsCPU");
181 desc.add<
double>(
"dzCut", 1.);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertexGPU_
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
~SiPixelPhase1CompareVertexSoA() override=default
MonitorElement * hnVertex_
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
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)
const std::string topFolderName_
MonitorElement * hchi2oNdof_
static const GlobalPoint notFound(0, 0, 0)
const edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertexCPU_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
SiPixelPhase1CompareVertexSoA(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 edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
MonitorElement * book2I(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
std::vector< uint16_t > IndToEdm