CMS 3D CMS Logo

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