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]);
34 if (detId.det() !=
DetId::Forward || detId.mtdSubDetector() != 2) {
36 <<
"got a DetId that was not ETL: Det = " << detId.det() <<
" subDet = " << detId.mtdSubDetector();
45 if (thedet ==
nullptr) {
46 throw cms::Exception(
"ETLDeviceSim") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" << detId.rawId()
47 <<
") is invalid!" <<
std::dec << std::endl;
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;
const MTDGeometry * geom_
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
constexpr uint32_t rawId() const
get the raw id
std::unordered_map< MTDCellId, MTDCellInfo > MTDSimHitDataAccumulator
void getEventSetup(const edm::EventSetup &evt)
Detector identifier base class for the MIP Timing Layer.
const MTDGeomDet * idToDet(DetId) const override
void getHitsResponse(const std::vector< std::tuple< int, uint32_t, float > > &hitRefs, const edm::Handle< edm::PSimHitContainer > &hits, mtd_digitizer::MTDSimHitDataAccumulator *simHitAccumulator, CLHEP::HepRandomEngine *hre)
Detector identifier class for the Endcap Timing Layer.
T const * product() const
ETLDeviceSim(const edm::ParameterSet &pset)