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 {
26  class HepRandomEngine ;
27 }
28 
30 {
31  public:
32 
34 
35  typedef std::vector< unsigned int > VecInd ;
36 
37  typedef std::unordered_map<uint32_t,double> CalibCache;
38 
39  enum { BUNCHSPACE = 25 } ;
40 
41  EcalHitResponse( const CaloVSimParameterMap* parameterMap ,
42  const CaloVShape* shape ) ;
43 
44  virtual ~EcalHitResponse() ;
45 
46  void setBunchRange( int minBunch ,
47  int maxBunch ) ;
48 
50 
51  void setPhaseShift( double phaseShift ) ;
52 
53  void setHitFilter( const CaloVHitFilter* filter) ;
54 
55  void setHitCorrection( const CaloVHitCorrection* hitCorrection) ;
56 
57  void setPECorrection( const CaloVPECorrection* peCorrection ) ;
58 
59  void setEventTime(const edm::TimeValue_t& iTime);
60 
61  void setLaserConstants(const EcalLaserDbService* laser, bool& useLCcorrection);
62 
63  void add( const EcalSamples* pSam ) ;
64 
65  virtual void add( const PCaloHit& hit, CLHEP::HepRandomEngine* ) ;
66 
67  virtual void add( const CaloSamples& hit ) ;
68 
69  virtual void initializeHits() ;
70 
71  virtual void finalizeHits() ;
72 
73  virtual void run( MixCollection<PCaloHit>& hits, CLHEP::HepRandomEngine* ) ;
74 
75  virtual unsigned int samplesSize() const = 0 ;
76 
77  virtual EcalSamples* operator[]( unsigned int i ) = 0;
78 
79  virtual const EcalSamples* operator[]( unsigned int i ) const = 0;
80 
81  const EcalSamples* findDetId( const DetId& detId ) const ;
82 
83  bool withinBunchRange(int bunchCrossing) const ;
84 
85  protected:
86 
87  virtual unsigned int samplesSizeAll() const = 0 ;
88 
89  virtual EcalSamples* vSam( unsigned int i ) = 0 ;
90 
91  virtual EcalSamples* vSamAll( unsigned int i ) = 0 ;
92 
93  virtual const EcalSamples* vSamAll( unsigned int i ) const = 0 ;
94 
95  virtual void putAnalogSignal( const PCaloHit& inputHit, CLHEP::HepRandomEngine*) ;
96 
97  double findLaserConstant(const DetId& detId) const;
98 
99  EcalSamples* findSignal( const DetId& detId ) ;
100 
101  double analogSignalAmplitude( const DetId& id, double energy, CLHEP::HepRandomEngine* );
102 
103  double timeOfFlight( const DetId& detId ) const ;
104 
105  double phaseShift() const ;
106 
107  void blankOutUsedSamples() ;
108 
109  const CaloSimParameters* params( const DetId& detId ) const ;
110 
111  const CaloVShape* shape() const ;
112 
113  const CaloSubdetectorGeometry* geometry() const ;
114 
115  int minBunch() const ;
116 
117  int maxBunch() const ;
118 
119  VecInd& index() ;
120 
121  const VecInd& index() const ;
122 
123  const CaloVHitFilter* hitFilter() const ;
124 
125  private:
126 
134 
137  double m_phaseShift ;
138 
141  CalibCache m_laserCalibCache;
142 
143  VecInd m_index ;
144 };
145 
146 #endif
const CaloVShape * m_shape
std::vector< unsigned int > VecInd
edm::TimeValue_t m_iTime
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
Electronic response of the preamp.
Definition: CaloVShape.h:11
Main class for Parameters in different subdetectors.
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
const CaloSubdetectorGeometry * m_geometry
const CaloVSimParameterMap * m_parameterMap
const CaloVPECorrection * m_PECorrection
CalibCache m_laserCalibCache
ESHandle< TrackerGeometry > geometry
std::unordered_map< uint32_t, double > CalibCache
const CaloVHitFilter * m_hitFilter
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
Definition: CaloSimInfo.cc:15
unsigned long long TimeValue_t