CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ETLDeviceSim Class Reference

#include <ETLDeviceSim.h>

Public Member Functions

 ETLDeviceSim (const edm::ParameterSet &pset)
 
void getEvent (const edm::Event &evt)
 
void getEventSetup (const edm::EventSetup &evt)
 
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)
 

Private Attributes

float bxTime_
 
float MIPPerMeV_
 
float tofDelay_
 

Detailed Description

Definition at line 18 of file ETLDeviceSim.h.

Constructor & Destructor Documentation

ETLDeviceSim::ETLDeviceSim ( const edm::ParameterSet pset)

Definition at line 6 of file ETLDeviceSim.cc.

6  :
7  MIPPerMeV_( 1.0/pset.getParameter<double>("meVPerMIP") ),
8  bxTime_(pset.getParameter<double>("bxTime") ),
9  tofDelay_(pset.getParameter<double>("tofDelay") ) {}
T getParameter(std::string const &) const
float tofDelay_
Definition: ETLDeviceSim.h:37
float MIPPerMeV_
Definition: ETLDeviceSim.h:35

Member Function Documentation

void ETLDeviceSim::getEvent ( const edm::Event evt)
inline

Definition at line 24 of file ETLDeviceSim.h.

24 { }
void ETLDeviceSim::getEventSetup ( const edm::EventSetup evt)
inline

Definition at line 26 of file ETLDeviceSim.h.

References hfClusterShapes_cfi::hits.

26 { }
void ETLDeviceSim::getHitsResponse ( const std::vector< std::tuple< int, uint32_t, float > > &  hitRefs,
const edm::Handle< edm::PSimHitContainer > &  hits,
mtd_digitizer::MTDSimHitDataAccumulator simHitAccumulator,
CLHEP::HepRandomEngine *  hre 
)

Definition at line 12 of file ETLDeviceSim.cc.

References bxTime_, ALCARECOTkAlJpsiMuMu_cff::charge, DetId::Forward, mps_fire::i, MIPPerMeV_, and tofDelay_.

15  {
16 
17  //loop over sorted hits
18  const int nchits = hitRefs.size();
19  for(int i=0; i<nchits; ++i) {
20  const int hitidx = std::get<0>(hitRefs[i]);
21  const uint32_t id = std::get<1>(hitRefs[i]);
22  const MTDDetId detId(id);
23 
24  // Safety check
25  if ( detId.det()!=DetId::Forward || detId.mtdSubDetector()!=2 ) continue;
26 
27  auto simHitIt = simHitAccumulator->emplace(id,mtd_digitizer::MTDCellInfo()).first;
28 
29  if(id==0) continue; // to be ignored at RECO level
30 
31  const float toa = std::get<2>(hitRefs[i]) + tofDelay_;
32  const PSimHit &hit = hits->at( hitidx );
33  const float charge = 1000.f*hit.energyLoss()*MIPPerMeV_;
34 
35  // Accumulate in 15 buckets of 25ns (9 pre-samples, 1 in-time, 5 post-samples)
36  const int itime = std::floor( toa/bxTime_ ) + 9;
37  if(itime<0 || itime>14) continue;
38 
39  // Check if time index is ok and store energy
40  if(itime >= (int)simHitIt->second.hit_info[0].size() ) continue;
41 
42  (simHitIt->second).hit_info[0][itime] += charge;
43 
44  // Store the time of the first SimHit in the right DataFrame bucket
45  const float tof = toa - (itime-9)*bxTime_;
46 
47  if( (simHitIt->second).hit_info[1][itime] == 0. ||
48  tof < (simHitIt->second).hit_info[1][itime] ) {
49  (simHitIt->second).hit_info[1][itime] = tof;
50 
51  }
52 
53  }
54 
55 }
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
float tofDelay_
Definition: ETLDeviceSim.h:37
float MIPPerMeV_
Definition: ETLDeviceSim.h:35

Member Data Documentation

float ETLDeviceSim::bxTime_
private

Definition at line 36 of file ETLDeviceSim.h.

Referenced by getHitsResponse().

float ETLDeviceSim::MIPPerMeV_
private

Definition at line 35 of file ETLDeviceSim.h.

Referenced by getHitsResponse().

float ETLDeviceSim::tofDelay_
private

Definition at line 37 of file ETLDeviceSim.h.

Referenced by getHitsResponse().