1 #include "CLHEP/Units/GlobalPhysicalConstants.h"
12 MIPPerMeV_(1.0 /
pset.getParameter<double>(
"meVPerMIP")),
13 bxTime_(
pset.getParameter<double>(
"bxTime")),
14 tofDelay_(
pset.getParameter<double>(
"tofDelay")) {}
25 CLHEP::HepRandomEngine* hre) {
27 const int nchits = hitRefs.size();
28 for (
int i = 0;
i < nchits; ++
i) {
29 const int hitidx = std::get<0>(hitRefs[
i]);
30 const uint32_t
id = std::get<1>(hitRefs[
i]);
36 <<
"got a DetId that was not ETL: Det = " << detId.
det() <<
" subDet = " << detId.
mtdSubDetector();
45 if (thedet ==
nullptr) {
47 <<
") is invalid!" <<
std::dec << std::endl;
49 const PixelTopology& topo = static_cast<const PixelTopology&>(thedet->topology());
51 const float toa = std::get<2>(hitRefs[
i]) +
tofDelay_;
56 const auto& pentry =
hit.entryPoint();
58 Local3DPoint simscaled(0.1 * pentry.x(), 0.1 * pentry.y(), 0.1 * pentry.z());
59 const auto& thepixel = topo.
pixel(simscaled);
60 const uint8_t row(thepixel.first),
col(thepixel.second);
66 const int itime = std::floor(toa /
bxTime_) + 9;
67 if (itime < 0 || itime > 14)
71 if (itime >= (
int)simHitIt->second.hit_info[0].size())
74 (simHitIt->second).hit_info[0][itime] +=
charge;
77 const float tof = toa - (itime - 9) *
bxTime_;
79 if ((simHitIt->second).hit_info[1][itime] == 0. || tof < (simHitIt->second).hit_info[1][itime]) {
80 (simHitIt->second).hit_info[1][itime] = tof;