36 template <
typename U,
typename V>
65 : tokenSoAVertexReferenceSoA_(
67 tokenSoAVertexTargetSoA_(consumes<
ZVertexHost>(iConfig.getParameter<
edm::
InputTag>(
"pixelVertexTargetSoA"))),
69 topFolderName_(iConfig.getParameter<
std::
string>(
"topFolderName")),
70 dzCut_(iConfig.getParameter<double>(
"dzCut")) {}
72 template <
typename U,
typename V>
74 const auto& vsoaHandleRef =
iEvent.getHandle(tokenRef);
75 const auto& vsoaHandleTar =
iEvent.getHandle(tokenTar);
77 if (not vsoaHandleRef
or not vsoaHandleTar) {
79 if (not vsoaHandleRef) {
80 out <<
"reference vertices not found; ";
82 if (not vsoaHandleTar) {
83 out <<
"target vertices not found; ";
85 out <<
"the comparison will not run.";
89 auto const& vsoaRef = *vsoaHandleRef;
90 int nVerticesRef = vsoaRef.view().nvFinal();
91 auto const& vsoaTar = *vsoaHandleTar;
92 int nVerticesTar = vsoaTar.view().nvFinal();
95 float x0 = 0., y0 = 0.,
z0 = 0.,
dxdz = 0.,
dydz = 0.;
96 if (not bsHandle.isValid()) {
97 edm::LogWarning(
"SiPixelCompareVertices") <<
"No beamspot found, returning vertexes with (0,0,Z).";
107 for (
int ivc = 0; ivc < nVerticesRef; ivc++) {
108 auto sic = vsoaRef.view()[ivc].sortInd();
109 auto zc = vsoaRef.view()[sic].zv();
110 auto xc = x0 +
dxdz * zc;
111 auto yc = y0 +
dydz * zc;
114 auto ndofRef = vsoaRef.template view<reco::ZVertexTracksSoA>()[sic].
ndof();
115 auto chi2Ref = vsoaRef.view()[sic].chi2();
121 for (
int ivg = 0; ivg < nVerticesTar; ivg++) {
122 auto sig = vsoaTar.view()[ivg].sortInd();
123 auto zgc = vsoaTar.view()[sig].zv() +
z0;
136 auto zg = vsoaTar.view()[closestVtxidx].zv();
137 auto xg = x0 +
dxdz * zg;
138 auto yg = y0 +
dydz * zg;
140 auto ndofTar = vsoaTar.template view<reco::ZVertexTracksSoA>()[closestVtxidx].
ndof();
141 auto chi2Tar = vsoaTar.view()[closestVtxidx].chi2();
151 hptv2_->
Fill(vsoaRef.view()[sic].ptv2(), vsoaTar.view()[closestVtxidx].ptv2());
177 hnVertex_ = ibooker.
book2I(
"nVertex",
"# of Vertices;Reference;Target", 101, -0.5, 100.5, 101, -0.5, 100.5);
178 hx_ = ibooker.
book2I(
"vx",
"Vertez x - Beamspot x;Reference;Target", 50, -0.1, 0.1, 50, -0.1, 0.1);
179 hy_ = ibooker.
book2I(
"vy",
"Vertez y - Beamspot y;Reference;Target", 50, -0.1, 0.1, 50, -0.1, 0.1);
180 hz_ = ibooker.
book2I(
"vz",
"Vertez z;Reference;Target", 30, -30., 30., 30, -30., 30.);
181 hchi2_ = ibooker.
book2I(
"chi2",
"Vertex chi-squared;Reference;Target", 40, 0., 20., 40, 0., 20.);
182 hchi2oNdof_ = ibooker.
book2I(
"chi2oNdof",
"Vertex chi-squared/Ndof;Reference;Target", 40, 0., 20., 40, 0., 20.);
183 hptv2_ = ibooker.
book2I(
"ptsq",
"Vertex #sum (p_{T})^{2};Reference;Target", 200, 0., 200., 200, 0., 200.);
184 hntrks_ = ibooker.
book2I(
"ntrk",
"#tracks associated;Reference;Target", 100, -0.5, 99.5, 100, -0.5, 99.5);
185 hntrks_ = ibooker.
book2I(
"ntrk",
"#tracks associated;Reference;Target", 100, -0.5, 99.5, 100, -0.5, 99.5);
186 hxdiff_ = ibooker.
book1D(
"vxdiff",
";Vertex x difference (Reference - Target);#entries", 100, -0.001, 0.001);
187 hydiff_ = ibooker.
book1D(
"vydiff",
";Vertex y difference (Reference - Target);#entries", 100, -0.001, 0.001);
188 hzdiff_ = ibooker.
book1D(
"vzdiff",
";Vertex z difference (Reference - Target);#entries", 100, -2.5, 2.5);
197 desc.add<
std::string>(
"topFolderName",
"SiPixelHeterogeneous/PixelVertexCompareSoADeviceVSHost");
198 desc.add<
double>(
"dzCut", 1.);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const std::string topFolderName_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * hnVertex_
virtual void setCurrentFolder(std::string const &fullpath)
SiPixelCompareVertices(const edm::ParameterSet &)
const edm::EDGetTokenT< reco::BeamSpot > tokenBeamSpot_
std::vector< uint16_t > IndToEdm
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
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
const edm::EDGetTokenT< ZVertexHost > tokenSoAVertexTargetSoA_
Abs< T >::type abs(const T &t)
void analyzeSeparate(U tokenRef, V tokenTar, const edm::Event &iEvent)
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< ZVertexHost > tokenSoAVertexReferenceSoA_
static const GlobalPoint notFound(0, 0, 0)
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
Log< level::Warning, false > LogWarning
~SiPixelCompareVertices() override=default
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())
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
MonitorElement * hchi2oNdof_