CMS 3D CMS Logo

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