1 #include "CLHEP/Units/GlobalPhysicalConstants.h"
18 MIPPerMeV_(1.0 /
pset.getParameter<double>(
"meVPerMIP")),
19 bxTime_(
pset.getParameter<double>(
"bxTime")),
20 tofDelay_(
pset.getParameter<double>(
"tofDelay")) {}
27 CLHEP::HepRandomEngine* hre) {
31 const int nchits = hitRefs.size();
32 for (
int i = 0;
i < nchits; ++
i) {
33 const int hitidx = std::get<0>(hitRefs[
i]);
34 const uint32_t
id = std::get<1>(hitRefs[
i]);
40 <<
"got a DetId that was not ETL: Det = " << detId.
det() <<
" subDet = " << detId.
mtdSubDetector();
49 if (thedet ==
nullptr) {
51 <<
") is invalid!" <<
std::dec << std::endl;
53 const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
56 const float toa = std::get<2>(hitRefs[
i]) +
tofDelay_;
61 const auto& pentry =
hit.entryPoint();
66 if (!topo.isInPixel(simscaled)) {
69 const auto& thepixel = topo.pixel(simscaled);
70 const uint8_t row(thepixel.first),
col(thepixel.second);
76 const int itime = std::floor(toa /
bxTime_) + 9;
77 if (itime < 0 || itime > 14)
81 if (itime >= (
int)simHitIt->second.hit_info[0].size())
84 (simHitIt->second).hit_info[0][itime] +=
charge;
87 const float tof = toa - (itime - 9) *
bxTime_;
89 if ((simHitIt->second).hit_info[1][itime] == 0. || tof < (simHitIt->second).hit_info[1][itime]) {
90 (simHitIt->second).hit_info[1][itime] = tof;