CMS 3D CMS Logo

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

#include <BTLDeviceSim.h>

Public Member Functions

 BTLDeviceSim (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

const float bxTime_
 
const float LightCollEff_
 
const float LightCollTime_
 
const float LightYield_
 
const float PDE_
 
const float refSpeed_
 
const float smearLightCollTime_
 

Detailed Description

Definition at line 18 of file BTLDeviceSim.h.

Constructor & Destructor Documentation

BTLDeviceSim::BTLDeviceSim ( const edm::ParameterSet pset)

Definition at line 11 of file BTLDeviceSim.cc.

11  :
12  refSpeed_( 0.1*CLHEP::c_light ),
13  bxTime_(pset.getParameter<double>("bxTime") ),
14  LightYield_(pset.getParameter<double>("LightYield")),
15  LightCollEff_(pset.getParameter<double>("LightCollectionEff")),
16  LightCollTime_(pset.getParameter<double>("LightCollectionTime")),
17  smearLightCollTime_(pset.getParameter<double>("smearLightCollectionTime")),
18  PDE_(pset.getParameter<double>("PhotonDetectionEff")) { }
T getParameter(std::string const &) const
const float LightYield_
Definition: BTLDeviceSim.h:37
const float refSpeed_
Definition: BTLDeviceSim.h:35
const float smearLightCollTime_
Definition: BTLDeviceSim.h:40
const float bxTime_
Definition: BTLDeviceSim.h:36
const float LightCollTime_
Definition: BTLDeviceSim.h:39
const float PDE_
Definition: BTLDeviceSim.h:41
const float LightCollEff_
Definition: BTLDeviceSim.h:38

Member Function Documentation

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

Definition at line 24 of file BTLDeviceSim.h.

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

Definition at line 26 of file BTLDeviceSim.h.

References hfClusterShapes_cfi::hits.

26 { }
void BTLDeviceSim::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 21 of file BTLDeviceSim.cc.

References bxTime_, PSimHit::energyLoss(), PSimHit::entryPoint(), DetId::Forward, LightCollEff_, LightCollTime_, LightYield_, PV3DBase< T, PVType, FrameType >::mag(), PDE_, refSpeed_, and smearLightCollTime_.

24  {
25 
26  //loop over sorted simHits
27  const int nchits = hitRefs.size();
28  for(int ihit=0; ihit<nchits; ++ihit) {
29 
30  const int hitidx = std::get<0>(hitRefs[ihit]);
31  const uint32_t id = std::get<1>(hitRefs[ihit]);
32  const MTDDetId detId(id);
33  const PSimHit &hit = hits->at( hitidx );
34 
35  // --- Safety check on the detector ID
36  if ( detId.det()!=DetId::Forward || detId.mtdSubDetector()!=1 ) continue;
37 
38  // --- Store the detector element ID as a key of the MTDSimHitDataAccumulator map
39  auto simHitIt = simHitAccumulator->emplace(id,mtd_digitizer::MTDCellInfo()).first;
40 
41  // --- Get the simHit energy and convert it from MeV to photo-electrons
42  float Npe = 1000.*hit.energyLoss()*LightYield_*LightCollEff_*PDE_;
43 
44  // --- Get the distance to the center of the detector
45  const float dist2center = 0.1f*hit.entryPoint().mag();
46 
47  // --- Get the simHit time of arrival and correct for the nominal time of flight
48  float toa = std::get<2>(hitRefs[ihit]) - dist2center/refSpeed_ + LightCollTime_;
49 
50  if ( smearLightCollTime_ > 0. )
51  toa += CLHEP::RandGaussQ::shoot(hre, 0., smearLightCollTime_);
52 
53  // --- Accumulate in 15 buckets of 25 ns (9 pre-samples, 1 in-time, 5 post-samples)
54  const int itime = std::floor( toa/bxTime_ ) + 9;
55 
56  if(itime<0 || itime>14) continue;
57 
58  // --- Check if the time index is ok and accumulate the energy
59  if(itime >= (int)simHitIt->second.hit_info[0].size() ) continue;
60  (simHitIt->second).hit_info[0][itime] += Npe;
61 
62 
63  // --- Store the time of the first SimHit
64  if( (simHitIt->second).hit_info[1][itime] == 0 )
65  (simHitIt->second).hit_info[1][itime] = toa;
66 
67  } // ihit loop
68 
69 }
const float LightYield_
Definition: BTLDeviceSim.h:37
const float refSpeed_
Definition: BTLDeviceSim.h:35
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
T mag() const
Definition: PV3DBase.h:67
const float smearLightCollTime_
Definition: BTLDeviceSim.h:40
const float bxTime_
Definition: BTLDeviceSim.h:36
const float LightCollTime_
Definition: BTLDeviceSim.h:39
const float PDE_
Definition: BTLDeviceSim.h:41
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
const float LightCollEff_
Definition: BTLDeviceSim.h:38
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35

Member Data Documentation

const float BTLDeviceSim::bxTime_
private

Definition at line 36 of file BTLDeviceSim.h.

Referenced by getHitsResponse().

const float BTLDeviceSim::LightCollEff_
private

Definition at line 38 of file BTLDeviceSim.h.

Referenced by getHitsResponse().

const float BTLDeviceSim::LightCollTime_
private

Definition at line 39 of file BTLDeviceSim.h.

Referenced by getHitsResponse().

const float BTLDeviceSim::LightYield_
private

Definition at line 37 of file BTLDeviceSim.h.

Referenced by getHitsResponse().

const float BTLDeviceSim::PDE_
private

Definition at line 41 of file BTLDeviceSim.h.

Referenced by getHitsResponse().

const float BTLDeviceSim::refSpeed_
private

Definition at line 35 of file BTLDeviceSim.h.

Referenced by getHitsResponse().

const float BTLDeviceSim::smearLightCollTime_
private

Definition at line 40 of file BTLDeviceSim.h.

Referenced by getHitsResponse().