112 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
139 std::unordered_map<uint32_t, MTDHit> m_btlSimHits;
140 for (
auto const&
simHit : btlSimHits) {
147 auto simHitIt = m_btlSimHits.emplace(
id.rawId(),
MTDHit()).first;
153 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
156 auto hit_pos =
simHit.entryPoint();
157 (simHitIt->second).x_local = hit_pos.x();
158 (simHitIt->second).y_local = hit_pos.y();
159 (simHitIt->second).z_local = hit_pos.z();
165 unsigned int n_reco_btl = 0;
167 for (
const auto&
recHit : *btlRecHitsHandle) {
171 if (thedet ==
nullptr)
172 throw cms::Exception(
"BtlLocalRecoValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" ("
173 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
178 local_point = topo.pixelToModuleLocalPoint(local_point, detId.
row(topo.nrows()), detId.
column(topo.nrows()));
179 const auto& global_point = thedet->
toGlobal(local_point);
202 float time_res =
recHit.time() - m_btlSimHits[detId.
rawId()].time;
203 float energy_res =
recHit.energy() - m_btlSimHits[detId.
rawId()].energy;
220 for (
const auto& DetSetClu : *btlRecCluHandle) {
221 for (
const auto& cluster : DetSetClu) {
225 DetId detIdObject(cluId);
226 const auto& genericDet =
geom->idToDetUnit(detIdObject);
227 if (genericDet ==
nullptr) {
229 <<
"GeographicalID: " << std::hex << cluId <<
" is invalid!" <<
std::dec << std::endl;
232 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(genericDet->topology());
235 Local3DPoint local_point(cluster.x() * 5.7, cluster.y() * 0.3, 0.);
236 local_point = topo.pixelToModuleLocalPoint(local_point, cluId.
row(topo.nrows()), cluId.
column(topo.ncolumns()));
237 const auto& global_point = genericDet->toGlobal(local_point);
257 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL RECO hits;log_{10}(N_{RECO})", 100, 0., 5.25);
259 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL RECO hits energy;E_{RECO} [MeV]", 100, 0., 20.);
260 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL RECO hits ToA;ToA_{RECO} [ns]", 100, 0., 25.);
263 "BtlOccupancy",
"BTL RECO hits occupancy;Z_{RECO} [cm]; #phi_{RECO} [rad]", 65, -260., 260., 126, -3.2, 3.2);
265 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL RECO hits X;X_{RECO} [cm]", 60, -120., 120.);
266 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL RECO hits Y;Y_{RECO} [cm]", 60, -120., 120.);
267 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL RECO hits Z;Z_{RECO} [cm]", 100, -260., 260.);
268 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL RECO hits #phi;#phi_{RECO} [rad]", 126, -3.2, 3.2);
269 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL RECO hits #eta;#eta_{RECO}", 100, -1.55, 1.55);
272 ibook.
bookProfile(
"BtlHitTvsE",
"BTL RECO ToA vs energy;E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 20., 0., 100.);
274 "BtlHitEvsPhi",
"BTL RECO energy vs #phi;#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.2, 3.2, 0., 100.);
276 "BtlHitEvsEta",
"BTL RECO energy vs #eta;#eta_{RECO};E_{RECO} [MeV]", 50, -1.55, 1.55, 0., 100.);
278 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL RECO energy vs Z;Z_{RECO} [cm];E_{RECO} [MeV]", 50, -260., 260., 0., 100.);
280 "BtlHitTvsPhi",
"BTL RECO ToA vs #phi;#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.2, 3.2, 0., 100.);
282 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL RECO ToA vs #eta;#eta_{RECO};ToA_{RECO} [ns]", 50, -1.6, 1.6, 0., 100.);
284 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL RECO ToA vs Z;Z_{RECO} [cm];ToA_{RECO} [ns]", 50, -260., 260., 0., 100.);
286 meTimeRes_ = ibook.
book1D(
"BtlTimeRes",
"BTL time resolution;T_{RECO} - T_{SIM} [ns]", 100, -0.5, 0.5);
287 meEnergyRes_ = ibook.
book1D(
"BtlEnergyRes",
"BTL energy resolution;E_{RECO} - E_{SIM} [MeV]", 100, -0.5, 0.5);
290 "BtlTresvsE",
"BTL time resolution vs E;E_{SIM} [MeV];T_{RECO}-T_{SIM} [ns]", 50, 0., 20., 0., 100.);
292 "BtlEresvsE",
"BTL energy resolution vs E;E_{SIM} [MeV];E_{RECO}-E_{SIM} [MeV]", 50, 0., 20., 0., 100.);
293 meCluTime_ = ibook.
book1D(
"BtlCluTime",
"BTL cluster time ToA;ToA [ns]", 250, 0, 25);
294 meCluEnergy_ = ibook.
book1D(
"BtlCluEnergy",
"BTL cluster energy;E_{RECO} [MeV]", 100, 0, 20);
295 meCluPhi_ = ibook.
book1D(
"BtlCluPhi",
"BTL cluster #phi;#phi_{RECO} [rad]", 144, -3.2, 3.2);
296 meCluEta_ = ibook.
book1D(
"BtlCluEta",
"BTL cluster #eta;#eta_{RECO}", 100, -1.6, 1.6);
297 meCluHits_ = ibook.
book1D(
"BtlCluHitNumber",
"BTL hits per cluster; Cluster size", 10, 0, 10);
299 "BtlOccupancy",
"BTL cluster Z vs #phi;Z_{RECO} [cm]; #phi_{RECO} [rad]", 144, -260., 260., 50, -3.2, 3.2);
310 desc.
add<
double>(
"hitMinimumEnergy", 1.);
312 descriptions.
add(
"btlLocalReco", desc);