114 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
142 std::unordered_map<uint32_t, MTDHit> m_btlSimHits;
143 for (
auto const&
simHit : btlSimHits) {
150 auto simHitIt = m_btlSimHits.emplace(
id.rawId(),
MTDHit()).first;
156 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
159 auto hit_pos =
simHit.entryPoint();
160 (simHitIt->second).x_local = hit_pos.x();
161 (simHitIt->second).y_local = hit_pos.y();
162 (simHitIt->second).z_local = hit_pos.z();
168 unsigned int n_reco_btl = 0;
170 for (
const auto&
recHit : *btlRecHitsHandle) {
174 if (thedet ==
nullptr)
175 throw cms::Exception(
"BtlLocalRecoValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" ("
176 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
181 local_point = topo.pixelToModuleLocalPoint(local_point, detId.
row(topo.nrows()), detId.
column(topo.nrows()));
182 const auto& global_point = thedet->
toGlobal(local_point);
207 float time_res =
recHit.time() - m_btlSimHits[detId.
rawId()].time;
208 float energy_res =
recHit.energy() - m_btlSimHits[detId.
rawId()].energy;
225 for (
const auto& DetSetClu : *btlRecCluHandle) {
226 for (
const auto& cluster : DetSetClu) {
230 DetId detIdObject(cluId);
231 const auto& genericDet =
geom->idToDetUnit(detIdObject);
232 if (genericDet ==
nullptr) {
234 <<
"GeographicalID: " << std::hex << cluId <<
" is invalid!" <<
std::dec << std::endl;
237 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(genericDet->topology());
240 Local3DPoint local_point(cluster.x() * 5.7, cluster.y() * 0.3, 0.);
241 local_point = topo.pixelToModuleLocalPoint(local_point, cluId.
row(topo.nrows()), cluId.
column(topo.ncolumns()));
242 const auto& global_point = genericDet->toGlobal(local_point);
262 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL RECO hits;log_{10}(N_{RECO})", 100, 0., 5.25);
264 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL RECO hits energy;E_{RECO} [MeV]", 100, 0., 20.);
265 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL RECO hits ToA;ToA_{RECO} [ns]", 100, 0., 25.);
268 "BtlOccupancy",
"BTL RECO hits occupancy;Z_{RECO} [cm]; #phi_{RECO} [rad]", 65, -260., 260., 126, -3.2, 3.2);
270 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL RECO hits X;X_{RECO} [cm]", 60, -120., 120.);
271 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL RECO hits Y;Y_{RECO} [cm]", 60, -120., 120.);
272 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL RECO hits Z;Z_{RECO} [cm]", 100, -260., 260.);
273 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL RECO hits #phi;#phi_{RECO} [rad]", 126, -3.2, 3.2);
274 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL RECO hits #eta;#eta_{RECO}", 100, -1.55, 1.55);
277 ibook.
bookProfile(
"BtlHitTvsE",
"BTL RECO ToA vs energy;E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 20., 0., 100.);
279 "BtlHitEvsPhi",
"BTL RECO energy vs #phi;#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.);
281 "BtlHitEvsEta",
"BTL RECO energy vs #eta;#eta_{RECO};E_{RECO} [MeV]", 50, -1.55, 1.55, 0., 100.);
283 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL RECO energy vs Z;Z_{RECO} [cm];E_{RECO} [MeV]", 50, -260., 260., 0., 100.);
285 "BtlHitTvsPhi",
"BTL RECO ToA vs #phi;#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.);
287 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL RECO ToA vs #eta;#eta_{RECO};ToA_{RECO} [ns]", 50, -1.6, 1.6, 0., 100.);
289 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL RECO ToA vs Z;Z_{RECO} [cm];ToA_{RECO} [ns]", 50, -260., 260., 0., 100.);
290 meHitLongPos_ = ibook.
book1D(
"BtlLongPos",
"BTL RECO hits longitudinal position;long. pos._{RECO}", 100, -10, 10);
292 ibook.
book1D(
"BtlLongPosErr",
"BTL RECO hits longitudinal position error; long. pos. error_{RECO}", 100, -1, 1);
294 meTimeRes_ = ibook.
book1D(
"BtlTimeRes",
"BTL time resolution;T_{RECO} - T_{SIM} [ns]", 100, -0.5, 0.5);
295 meEnergyRes_ = ibook.
book1D(
"BtlEnergyRes",
"BTL energy resolution;E_{RECO} - E_{SIM} [MeV]", 100, -0.5, 0.5);
298 "BtlTresvsE",
"BTL time resolution vs E;E_{SIM} [MeV];T_{RECO}-T_{SIM} [ns]", 50, 0., 20., 0., 100.);
300 "BtlEresvsE",
"BTL energy resolution vs E;E_{SIM} [MeV];E_{RECO}-E_{SIM} [MeV]", 50, 0., 20., 0., 100.);
301 meCluTime_ = ibook.
book1D(
"BtlCluTime",
"BTL cluster time ToA;ToA [ns]", 250, 0, 25);
302 meCluEnergy_ = ibook.
book1D(
"BtlCluEnergy",
"BTL cluster energy;E_{RECO} [MeV]", 100, 0, 20);
303 meCluPhi_ = ibook.
book1D(
"BtlCluPhi",
"BTL cluster #phi;#phi_{RECO} [rad]", 144, -3.2, 3.2);
304 meCluEta_ = ibook.
book1D(
"BtlCluEta",
"BTL cluster #eta;#eta_{RECO}", 100, -1.6, 1.6);
305 meCluHits_ = ibook.
book1D(
"BtlCluHitNumber",
"BTL hits per cluster; Cluster size", 10, 0, 10);
307 "BtlOccupancy",
"BTL cluster Z vs #phi;Z_{RECO} [cm]; #phi_{RECO} [rad]", 144, -260., 260., 50, -3.2, 3.2);
318 desc.add<
double>(
"hitMinimumEnergy", 1.);
320 descriptions.
add(
"btlLocalReco",
desc);