131 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")),
132 LocalPosDebug_(iConfig.getParameter<
bool>(
"LocalPositionDebug")) {
136 mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
152 const MTDTopology* topology = topologyHandle.product();
160 std::unordered_map<uint32_t, MTDHit> m_btlSimHits;
161 for (
auto const&
simHit : btlSimHits) {
168 auto simHitIt = m_btlSimHits.emplace(
id.rawId(),
MTDHit()).first;
174 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
177 auto hit_pos =
simHit.entryPoint();
178 (simHitIt->second).x_local = hit_pos.x();
179 (simHitIt->second).y_local = hit_pos.y();
180 (simHitIt->second).z_local = hit_pos.z();
186 unsigned int n_reco_btl = 0;
188 for (
const auto&
recHit : *btlRecHitsHandle) {
192 if (thedet ==
nullptr)
193 throw cms::Exception(
"BtlLocalRecoValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" ("
194 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
199 local_point = topo.pixelToModuleLocalPoint(local_point, detId.
row(topo.nrows()), detId.
column(topo.nrows()));
200 const auto& global_point = thedet->
toGlobal(local_point);
233 float time_res =
recHit.time() - m_btlSimHits[detId.
rawId()].time;
234 float energy_res =
recHit.energy() - m_btlSimHits[detId.
rawId()].energy;
237 m_btlSimHits[detId.
rawId()].y_local,
238 m_btlSimHits[detId.
rawId()].z_local);
240 topo.pixelToModuleLocalPoint(local_point_sim, detId.
row(topo.nrows()), detId.
column(topo.nrows()));
241 const auto& global_point_sim = thedet->
toGlobal(local_point_sim);
262 for (
const auto& DetSetClu : *btlRecCluHandle) {
263 for (
const auto& cluster : DetSetClu) {
267 DetId detIdObject(cluId);
268 const auto& genericDet =
geom->idToDetUnit(detIdObject);
269 if (genericDet ==
nullptr) {
271 <<
"GeographicalID: " << std::hex << cluId <<
" is invalid!" <<
std::dec << std::endl;
274 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(genericDet->topology());
277 Local3DPoint local_point(cluster.x() * topo.pitch().first, cluster.y() * topo.pitch().second, 0.);
278 local_point = topo.pixelToModuleLocalPoint(local_point, cluId.
row(topo.nrows()), cluId.
column(topo.ncolumns()));
279 const auto& global_point = genericDet->toGlobal(local_point);
300 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL RECO hits;log_{10}(N_{RECO})", 100, 0., 5.25);
302 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL RECO hits energy;E_{RECO} [MeV]", 100, 0., 20.);
303 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL RECO hits ToA;ToA_{RECO} [ns]", 100, 0., 25.);
304 meHitTimeError_ = ibook.
book1D(
"BtlHitTimeError",
"BTL RECO hits ToA error;#sigma^{ToA}_{RECO} [ns]", 50, 0., 0.1);
306 "BtlOccupancy",
"BTL RECO hits occupancy;Z_{RECO} [cm]; #phi_{RECO} [rad]", 65, -260., 260., 126, -3.2, 3.2);
309 "BtlLocalOccupancy",
"BTL RECO hits local occupancy;X_{RECO} [cm]; Y_{RECO} [cm]", 100, 10., 10., 60, -3., 3.);
310 meHitXlocal_ = ibook.
book1D(
"BtlHitXlocal",
"BTL RECO local X;X_{RECO}^{LOC} [cm]", 100, -10., 10.);
311 meHitYlocal_ = ibook.
book1D(
"BtlHitYlocal",
"BTL RECO local Y;Y_{RECO}^{LOC} [cm]", 60, -3, 3);
312 meHitZlocal_ = ibook.
book1D(
"BtlHitZlocal",
"BTL RECO local z;z_{RECO}^{LOC} [cm]", 10, -1, 1);
314 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL RECO hits X;X_{RECO} [cm]", 60, -120., 120.);
315 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL RECO hits Y;Y_{RECO} [cm]", 60, -120., 120.);
316 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL RECO hits Z;Z_{RECO} [cm]", 100, -260., 260.);
317 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL RECO hits #phi;#phi_{RECO} [rad]", 126, -3.2, 3.2);
318 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL RECO hits #eta;#eta_{RECO}", 100, -1.55, 1.55);
320 ibook.
bookProfile(
"BtlHitTvsE",
"BTL RECO ToA vs energy;E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 20., 0., 100.);
322 "BtlHitEvsPhi",
"BTL RECO energy vs #phi;#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.);
324 "BtlHitEvsEta",
"BTL RECO energy vs #eta;#eta_{RECO};E_{RECO} [MeV]", 50, -1.55, 1.55, 0., 100.);
326 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL RECO energy vs Z;Z_{RECO} [cm];E_{RECO} [MeV]", 50, -260., 260., 0., 100.);
328 "BtlHitTvsPhi",
"BTL RECO ToA vs #phi;#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.);
330 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL RECO ToA vs #eta;#eta_{RECO};ToA_{RECO} [ns]", 50, -1.6, 1.6, 0., 100.);
332 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL RECO ToA vs Z;Z_{RECO} [cm];ToA_{RECO} [ns]", 50, -260., 260., 0., 100.);
333 meHitLongPos_ = ibook.
book1D(
"BtlLongPos",
"BTL RECO hits longitudinal position;long. pos._{RECO}", 100, -10, 10);
335 ibook.
book1D(
"BtlLongPosErr",
"BTL RECO hits longitudinal position error; long. pos. error_{RECO}", 100, -1, 1);
336 meTimeRes_ = ibook.
book1D(
"BtlTimeRes",
"BTL time resolution;T_{RECO}-T_{SIM}", 100, -0.5, 0.5);
337 meEnergyRes_ = ibook.
book1D(
"BtlEnergyRes",
"BTL energy resolution;E_{RECO}-E_{SIM}", 100, -0.5, 0.5);
339 "BTL longitudinal position pull;X^{loc}_{RECO}-X^{loc}_{SIM}/#sigma_{xloc_{RECO}}",
345 "BTL longitudinal position pull vs E;E_{SIM} [MeV];X^{loc}_{RECO}-X^{loc}_{SIM}/#sigma_{xloc_{RECO}}",
353 "BtlLongposPullvsEta",
354 "BTL longitudinal position pull vs #eta;|#eta_{RECO}|;X^{loc}_{RECO}-X^{loc}_{SIM}/#sigma_{xloc_{RECO}}",
362 "BtlTPullvsE",
"BTL time pull vs E;E_{SIM} [MeV];T_{RECO}-T_{SIM}/#sigma_{T_{RECO}}", 20, 0., 20., -5., 5.,
"S");
364 "BTL time pull vs #eta;|#eta_{RECO}|;T_{RECO}-T_{SIM}/#sigma_{T_{RECO}}",
371 meCluTime_ = ibook.
book1D(
"BtlCluTime",
"BTL cluster time ToA;ToA [ns]", 250, 0, 25);
372 meCluTimeError_ = ibook.
book1D(
"BtlCluTimeError",
"BTL cluster time error;#sigma_{t} [ns]", 100, 0, 0.1);
373 meCluEnergy_ = ibook.
book1D(
"BtlCluEnergy",
"BTL cluster energy;E_{RECO} [MeV]", 100, 0, 20);
374 meCluPhi_ = ibook.
book1D(
"BtlCluPhi",
"BTL cluster #phi;#phi_{RECO} [rad]", 144, -3.2, 3.2);
375 meCluEta_ = ibook.
book1D(
"BtlCluEta",
"BTL cluster #eta;#eta_{RECO}", 100, -1.55, 1.55);
376 meCluHits_ = ibook.
book1D(
"BtlCluHitNumber",
"BTL hits per cluster; Cluster size", 10, 0, 10);
378 "BtlOccupancy",
"BTL cluster Z vs #phi;Z_{RECO} [cm]; #phi_{RECO} [rad]", 144, -260., 260., 50, -3.2, 3.2);
389 desc.add<
double>(
"hitMinimumEnergy", 1.);
390 desc.add<
bool>(
"LocalPositionDebug",
false);
392 descriptions.
add(
"btlLocalReco",
desc);