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 LogTrace(
"ETLDeviceSim") <<
"Processing " << nchits <<
" SIM hits";
33 for (
int i = 0;
i < nchits; ++
i) {
34 const int hitidx = std::get<0>(hitRefs[
i]);
35 const uint32_t
id = std::get<1>(hitRefs[
i]);
41 <<
"got a DetId that was not ETL: Det = " <<
detId.det() <<
" subDet = " <<
detId.mtdSubDetector();
50 if (thedet ==
nullptr) {
52 <<
") is invalid!" <<
std::dec << std::endl;
57 const float toa = std::get<2>(hitRefs[
i]) +
tofDelay_;
68 LogDebug(
"ETLDeviceSim") <<
"Skipping hit ouf of pixel # " << hitidx <<
" DetId " << etlid.
rawId() <<
" tof " 72 const auto& thepixel = topo.
pixel(simscaled);
73 const uint8_t row(thepixel.first),
col(thepixel.second);
75 LogDebug(
"ETLDeviceSim") <<
"Processing hit in pixel # " << hitidx <<
" DetId " << etlid.
rawId() <<
" row/col " 76 << (uint32_t)row <<
" " << (uint32_t)
col <<
" tof " << toa;
82 const int itime = std::floor(toa /
bxTime_) + 9;
83 if (itime < 0 || itime > 14)
87 if (itime >= (
int)simHitIt->second.hit_info[0].size())
90 (simHitIt->second).hit_info[0][itime] +=
charge;
93 const float tof = toa - (itime - 9) *
bxTime_;
95 if ((simHitIt->second).hit_info[1][itime] == 0. || tof < (simHitIt->second).hit_info[1][itime]) {
96 (simHitIt->second).hit_info[1][itime] = tof;
const MTDGeometry * geom_
bool isInPixel(const LocalPoint &p) const
const edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > geomToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
virtual const PixelTopology & specificTopology() const
std::unordered_map< MTDCellId, MTDCellInfo > MTDSimHitDataAccumulator
ETLDeviceSim(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
void getEventSetup(const edm::EventSetup &evt)
Detector identifier base class for the MIP Timing Layer.
std::pair< float, float > pixel(const LocalPoint &p) const override
constexpr NumType convertGeVToMeV(NumType gev)
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)
constexpr NumType convertMmToCm(NumType millimeters)
constexpr uint32_t rawId() const
get the raw id
Detector identifier class for the Endcap Timing Layer.
static int position[264][3]