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") ) {}
27 CLHEP::HepRandomEngine *hre){
30 const int nchits = hitRefs.size();
31 for(
int i=0;
i<nchits; ++
i) {
32 const int hitidx = std::get<0>(hitRefs[
i]);
33 const uint32_t
id = std::get<1>(hitRefs[
i]);
38 throw cms::Exception(
"ETLDeviceSim") <<
"got a DetId that was not ETL: Det = " << detId.det()
39 <<
" subDet = " << detId.mtdSubDetector();
47 if( thedet ==
nullptr ) {
48 throw cms::Exception(
"ETLDeviceSim") <<
"GeographicalID: " << std::hex
50 <<
" (" << detId.rawId()<<
") is invalid!" <<
std::dec 55 const float toa = std::get<2>(hitRefs[
i]) +
tofDelay_;
60 const auto& pentry = hit.entryPoint();
62 Local3DPoint simscaled(0.1*pentry.x(),0.1*pentry.y(),0.1*pentry.z());
63 const auto& thepixel = topo.
pixel(simscaled);
64 const uint8_t row(thepixel.first),
col(thepixel.second);
70 const int itime = std::floor( toa/
bxTime_ ) + 9;
71 if(itime<0 || itime>14)
continue;
74 if(itime >= (
int)simHitIt->second.hit_info[0].size() )
continue;
76 (simHitIt->second).hit_info[0][itime] += charge;
79 const float tof = toa - (itime-9)*
bxTime_;
81 if( (simHitIt->second).hit_info[1][itime] == 0. ||
82 tof < (simHitIt->second).hit_info[1][itime] ) {
83 (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)