57 topFolderName_(iConfig.getParameter<std::
string>(
"topFolderName")),
58 dzCut_(iConfig.getParameter<double>(
"dzCut")) {}
66 if (not vsoaHandleCPU
or not vsoaHandleGPU) {
68 if (not vsoaHandleCPU) {
69 out <<
"reference (cpu) tracks not found; ";
71 if (not vsoaHandleGPU) {
72 out <<
"target (gpu) tracks not found; ";
74 out <<
"the comparison will not run.";
78 auto const& vsoaCPU = *vsoaHandleCPU->get();
79 int nVerticesCPU = vsoaCPU.nvFinal;
80 auto const& vsoaGPU = *vsoaHandleGPU->get();
81 int nVerticesGPU = vsoaGPU.nvFinal;
84 float x0 = 0., y0 = 0., z0 = 0.,
dxdz = 0.,
dydz = 0.;
85 if (!bsHandle.isValid()) {
86 edm::LogWarning(
"PixelVertexProducer") <<
"No beamspot found. returning vertexes with (0,0,Z) ";
96 for (
int ivc = 0; ivc < nVerticesCPU; ivc++) {
97 auto sic = vsoaCPU.sortInd[ivc];
98 auto zc = vsoaCPU.zv[sic];
99 auto xc = x0 +
dxdz * zc;
100 auto yc = y0 +
dydz * zc;
103 auto ndofCPU = vsoaCPU.ndof[sic];
104 auto chi2CPU = vsoaCPU.chi2[sic];
110 for (
int ivg = 0; ivg < nVerticesGPU; ivg++) {
111 auto sig = vsoaGPU.sortInd[ivg];
112 auto zgc = vsoaGPU.zv[sig] + z0;
122 if (closestVtxidx == notFound)
125 auto zg = vsoaGPU.zv[closestVtxidx];
126 auto xg = x0 +
dxdz * zg;
127 auto yg = y0 +
dydz * zg;
129 auto ndofGPU = vsoaGPU.ndof[closestVtxidx];
130 auto chi2GPU = vsoaGPU.chi2[closestVtxidx];
137 hptv2_->
Fill(vsoaCPU.ptv2[sic], vsoaGPU.ptv2[closestVtxidx]);
155 hnVertex_ = ibooker.
book2D(
"nVertex",
"# of Vertex;CPU;GPU", 101, -0.5, 100.5, 101, -0.5, 100.5);
156 hx_ = ibooker.
book2D(
"vx",
"Vertez x;CPU;GPU", 20, -0.1, 0.1, 20, -0.1, 0.1);
157 hy_ = ibooker.
book2D(
"vy",
"Vertez y;CPU;GPU", 20, -0.1, 0.1, 20, -0.1, 0.1);
158 hz_ = ibooker.
book2D(
"vz",
"Vertez z;CPU;GPU", 30, -30., 30., 30, -30., 30.);
159 hchi2_ = ibooker.
book2D(
"chi2",
"Vertex chi-squared;CPU;GPU", 40, 0., 20., 40, 0., 20.);
160 hchi2oNdof_ = ibooker.
book2D(
"chi2oNdof",
"Vertex chi-squared/Ndof;CPU;GPU", 40, 0., 20., 40, 0., 20.);
161 hptv2_ = ibooker.
book2D(
"ptsq",
"Vertex p_T squared;CPU;GPU", 200, 0., 200., 200, 0., 200.);
162 hntrks_ = ibooker.
book2D(
"ntrk",
"#tracks associated;CPU;GPU", 100, -0.5, 99.5, 100, -0.5, 99.5);
163 hntrks_ = ibooker.
book2D(
"ntrk",
"#tracks associated;CPU;GPU", 100, -0.5, 99.5, 100, -0.5, 99.5);
172 desc.
add<
std::string>(
"topFolderName",
"SiPixelHeterogeneous/PixelVertexCompareSoAGPUvsCPU");
173 desc.
add<
double>(
"dzCut", 1.);
double z0() const
z coordinate
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertexGPU_
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
~SiPixelPhase1CompareVertexSoA() override=default
MonitorElement * hnVertex_
double dydz() const
dydz slope
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Abs< T >::type abs(const T &t)
const std::string topFolderName_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double dxdz() const
dxdz slope
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * hchi2oNdof_
static const GlobalPoint notFound(0, 0, 0)
const edm::EDGetTokenT< ZVertexHeterogeneous > tokenSoAVertexCPU_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double y0() const
y coordinate
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
SiPixelPhase1CompareVertexSoA(const edm::ParameterSet &)
Log< level::Warning, false > LogWarning
const edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
std::vector< uint16_t > IndToEdm
double x0() const
x coordinate