CMS 3D CMS Logo

HGCFEElectronics.h
Go to the documentation of this file.
1 #ifndef _hgcfeelectronics_h_
2 #define _hgcfeelectronics_h_
3 
6 
7 #include "CLHEP/Random/RandGauss.h"
8 #include "CLHEP/Random/RandGaussQ.h"
9 
11 
17 namespace hgc = hgc_digi;
18 
19 template <class DFr>
21 {
22  public:
23 
26 
31 
35  inline void runShaper(DFr &dataFrame, hgc::HGCSimHitData& chargeColl,
36  hgc::HGCSimHitData& toa, int thickness, CLHEP::HepRandomEngine* engine)
37  {
38  switch(fwVersion_)
39  {
40  case SIMPLE : { runSimpleShaper(dataFrame,chargeColl, thickness); break; }
41  case WITHTOT : { runShaperWithToT(dataFrame,chargeColl,toa, thickness, engine); break; }
42  default : { runTrivialShaper(dataFrame,chargeColl, thickness); break; }
43  }
44  }
45 
49  float getADClsb() { return adcLSB_fC_; }
50  float getTDClsb() { return tdcLSB_fC_; }
51  float getADCThreshold() { return adcThreshold_fC_; }
52  float getTDCOnset() { return tdcOnset_fC_; }
53  void setADClsb(float newLSB) { adcLSB_fC_=newLSB; }
54 
58  void runTrivialShaper(DFr &dataFrame, hgc::HGCSimHitData& chargeColl, int thickness);
59 
63  void runSimpleShaper(DFr &dataFrame, hgc::HGCSimHitData& chargeColl, int thickness);
64 
68  void runShaperWithToT(DFr &dataFrame, hgc::HGCSimHitData& chargeColl,
69  hgc::HGCSimHitData& toa, int thickness, CLHEP::HepRandomEngine* engine);
70 
74  uint32_t toaMode() const { return toaMode_; }
75 
80 
81  private:
82 
83  //private members
84  uint32_t fwVersion_;
85  std::array<float,6> adcPulse_, pulseAvgT_;
86  std::vector<float> tdcChargeDrainParameterisation_;
89  uint32_t toaMode_;
90  //caches
91  std::array<bool,hgc::nSamples> busyFlags, totFlags;
93 };
94 
95 #endif
void runShaper(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, int thickness, CLHEP::HepRandomEngine *engine)
switches according to the firmware version
void runSimpleShaper(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, int thickness)
applies a shape to each time sample and propagates the tails to the subsequent time samples ...
hgc::HGCSimHitData toaFromToT
std::array< bool, hgc::nSamples > totFlags
std::array< HGCSimData_t, nSamples > HGCSimHitData
HGCFEElectronics(const edm::ParameterSet &ps)
CTOR.
std::array< bool, hgc::nSamples > busyFlags
float getADClsb()
returns the LSB in MIP currently configured
uint32_t toaMode() const
returns how ToT will be computed
void setADClsb(float newLSB)
std::array< float, 6 > adcPulse_
void runTrivialShaper(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, int thickness)
converts charge to digis without pulse shape
std::vector< float > tdcChargeDrainParameterisation_
models the behavior of the front-end electronics
std::array< float, 6 > pulseAvgT_
hgc::HGCSimHitData newCharge
void runShaperWithToT(DFr &dataFrame, hgc::HGCSimHitData &chargeColl, hgc::HGCSimHitData &toa, int thickness, CLHEP::HepRandomEngine *engine)
implements pulse shape and switch to time over threshold including deadtime