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