CMS 3D CMS Logo

EcalHitResponse.h
Go to the documentation of this file.
1 #ifndef EcalSimAlgos_EcalHitResponse_h
2 #define EcalSimAlgos_EcalHitResponse_h
3 
13 
14 #include <unordered_map>
15 #include <vector>
16 
17 typedef unsigned long long TimeValue_t;
18 
19 class CaloVShape;
21 class CaloVHitCorrection;
22 class CaloVHitFilter;
23 class CaloSimParameters;
25 class CaloVPECorrection;
26 namespace CLHEP {
27  class HepRandomEngine;
28 }
29 
31 public:
33 
34  typedef std::vector<unsigned int> VecInd;
35 
36  typedef std::unordered_map<uint32_t, double> CalibCache;
37 
38  EcalHitResponse(const CaloVSimParameterMap* parameterMap, const CaloVShape* shape);
39 
40  virtual ~EcalHitResponse();
41 
43 
44  void setBunchRange(int minBunch, int maxBunch);
45 
47 
48  void setPhaseShift(double phaseShift);
49 
50  void setHitFilter(const CaloVHitFilter* filter);
51 
52  void setHitCorrection(const CaloVHitCorrection* hitCorrection);
53 
54  void setPECorrection(const CaloVPECorrection* peCorrection);
55 
56  void setEventTime(const edm::TimeValue_t& iTime);
57 
58  void setLaserConstants(const EcalLaserDbService* laser, bool& useLCcorrection);
59 
60  void add(const EcalSamples* pSam);
61 
62  virtual void add(const PCaloHit& hit, CLHEP::HepRandomEngine*);
63 
64  virtual void add(const CaloSamples& hit);
65 
66  virtual void initializeHits();
67 
68  virtual void finalizeHits();
69 
70  virtual void run(MixCollection<PCaloHit>& hits, CLHEP::HepRandomEngine*);
71 
72  virtual unsigned int samplesSize() const = 0;
73 
74  virtual EcalSamples* operator[](unsigned int i) = 0;
75 
76  virtual const EcalSamples* operator[](unsigned int i) const = 0;
77 
78  const EcalSamples* findDetId(const DetId& detId) const;
79 
80  bool withinBunchRange(int bunchCrossing) const;
81 
82 protected:
83  virtual unsigned int samplesSizeAll() const = 0;
84 
85  virtual EcalSamples* vSam(unsigned int i) = 0;
86 
87  virtual EcalSamples* vSamAll(unsigned int i) = 0;
88 
89  virtual const EcalSamples* vSamAll(unsigned int i) const = 0;
90 
91  virtual void putAnalogSignal(const PCaloHit& inputHit, CLHEP::HepRandomEngine*);
92 
93  double findLaserConstant(const DetId& detId) const;
94 
96 
97  double analogSignalAmplitude(const DetId& id, double energy, CLHEP::HepRandomEngine*);
98 
99  double timeOfFlight(const DetId& detId) const;
100 
101  double phaseShift() const;
102 
103  void blankOutUsedSamples();
104 
105  const CaloSimParameters* params(const DetId& detId) const;
106 
107  const CaloVShape* shape() const;
108 
109  const CaloSubdetectorGeometry* geometry() const;
110 
111  int minBunch() const;
112 
113  int maxBunch() const;
114 
115  VecInd& index();
116 
117  const VecInd& index() const;
118 
119  const CaloVHitFilter* hitFilter() const;
120 
128 
129 private:
132  double m_phaseShift;
133 
137 
139 };
140 
141 #endif
const CaloVShape * m_shape
const CaloSubdetectorGeometry * geometry() const
double findLaserConstant(const DetId &detId) const
virtual void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
double analogSignalAmplitude(const DetId &id, double energy, CLHEP::HepRandomEngine *)
const CaloSimParameters * params(const DetId &detId) const
void setEventTime(const edm::TimeValue_t &iTime)
virtual ~EcalHitResponse()
edm::TimeValue_t m_iTime
virtual void initializeHits()
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
Electronic response of the preamp.
Definition: CaloVShape.h:11
virtual EcalSamples * operator[](unsigned int i)=0
bool withinBunchRange(int bunchCrossing) const
Main class for Parameters in different subdetectors.
virtual unsigned int samplesSize() const =0
void setHitFilter(const CaloVHitFilter *filter)
virtual EcalSamples * vSam(unsigned int i)=0
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
void setBunchRange(int minBunch, int maxBunch)
double timeOfFlight(const DetId &detId) const
void setLaserConstants(const EcalLaserDbService *laser, bool &useLCcorrection)
std::unordered_map< uint32_t, double > CalibCache
EcalHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
std::vector< unsigned int > VecInd
void setPhaseShift(double phaseShift)
void blankOutUsedSamples()
const CaloVHitCorrection * m_hitCorrection
static constexpr double Samp_Period
Definition: EcalConstants.h:50
const EcalLaserDbService * m_lasercals
unsigned long long TimeValue_t
Definition: Timestamp.h:21
CaloTSamplesBase< float > EcalSamples
void setGeometry(const CaloSubdetectorGeometry *geometry)
Definition: DetId.h:17
const CaloSubdetectorGeometry * m_geometry
double phaseShift() const
const CaloVSimParameterMap * m_parameterMap
virtual unsigned int samplesSizeAll() const =0
void setPECorrection(const CaloVPECorrection *peCorrection)
const CaloVPECorrection * m_PECorrection
CalibCache m_laserCalibCache
const CaloVHitFilter * hitFilter() const
EcalSamples * findSignal(const DetId &detId)
int maxBunch() const
const EcalSamples * findDetId(const DetId &detId) const
int minBunch() const
virtual EcalSamples * vSamAll(unsigned int i)=0
void add(const EcalSamples *pSam)
const CaloVHitFilter * m_hitFilter
virtual void finalizeHits()
unsigned long long TimeValue_t
const float kSamplePeriod
const CaloVShape * shape() const