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 
135 
137 };
138 
139 #endif
EcalHitResponse::setBunchRange
void setBunchRange(int minBunch, int maxBunch)
Definition: EcalHitResponse.cc:51
EcalHitResponse::~EcalHitResponse
virtual ~EcalHitResponse()
Definition: EcalHitResponse.cc:34
EcalHitResponse::samplesSizeAll
virtual unsigned int samplesSizeAll() const =0
EcalHitResponse::m_phaseShift
double m_phaseShift
Definition: EcalHitResponse.h:130
mps_fire.i
i
Definition: mps_fire.py:355
EcalHitResponse::withinBunchRange
bool withinBunchRange(int bunchCrossing) const
Definition: EcalHitResponse.cc:112
EcalHitResponse::minBunch
int minBunch() const
Definition: EcalHitResponse.cc:214
EcalHitResponse::findDetId
const EcalSamples * findDetId(const DetId &detId) const
Definition: EcalHitResponse.cc:224
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
EcalHitResponse::CalibCache
std::unordered_map< uint32_t, double > CalibCache
Definition: EcalHitResponse.h:34
CaloVSimParameterMap
Definition: CaloVSimParameterMap.h:7
EcalHitResponse::blankOutUsedSamples
void blankOutUsedSamples()
Definition: EcalHitResponse.cc:79
EcalHitResponse::m_hitFilter
const CaloVHitFilter * m_hitFilter
Definition: EcalHitResponse.h:124
CaloTSamplesBase.h
CaloSamples.h
geometry
Definition: geometry.py:1
EcalHitResponse::timeOfFlight
double timeOfFlight(const DetId &detId) const
Definition: EcalHitResponse.cc:203
EcalHitResponse::setEventTime
void setEventTime(const edm::TimeValue_t &iTime)
Definition: EcalHitResponse.cc:68
CaloTSamplesBase
Definition: CaloTSamplesBase.h:9
EcalHitResponse::putAnalogSignal
virtual void putAnalogSignal(const PCaloHit &inputHit, CLHEP::HepRandomEngine *)
Definition: EcalHitResponse.cc:132
EcalHitResponse::EcalSamples
CaloTSamplesBase< float > EcalSamples
Definition: EcalHitResponse.h:30
EcalHitResponse::phaseShift
double phaseShift() const
Definition: EcalHitResponse.cc:60
EcalHitResponse::m_minBunch
int m_minBunch
Definition: EcalHitResponse.h:128
TimeValue_t
unsigned long long TimeValue_t
Definition: EcalHitResponse.h:15
EcalHitResponse::m_shape
const CaloVShape * m_shape
Definition: EcalHitResponse.h:121
CaloVPECorrection
Definition: CaloVPECorrection.h:14
EcalHitResponse::setPhaseShift
void setPhaseShift(double phaseShift)
Definition: EcalHitResponse.cc:58
EcalHitResponse::setLaserConstants
void setLaserConstants(const EcalLaserDbService *laser, bool &useLCcorrection)
Definition: EcalHitResponse.cc:74
DetId
Definition: DetId.h:17
EcalHitResponse::m_lasercals
const EcalLaserDbService * m_lasercals
Definition: EcalHitResponse.h:126
EcalHitResponse::m_iTime
edm::TimeValue_t m_iTime
Definition: EcalHitResponse.h:132
EcalHitResponse::operator[]
virtual EcalSamples * operator[](unsigned int i)=0
MixCollection.h
EcalLaserDbService
Definition: EcalLaserDbService.h:24
MixCollection
Definition: MixCollection.h:11
EcalHitResponse::setHitCorrection
void setHitCorrection(const CaloVHitCorrection *hitCorrection)
Definition: EcalHitResponse.cc:64
EcalLaserDbService.h
CaloSimParameters
Main class for Parameters in different subdetectors.
Definition: CaloSimParameters.h:14
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
EcalHitResponse::findLaserConstant
double findLaserConstant(const DetId &detId) const
Definition: EcalHitResponse.cc:161
CLHEP
Definition: CocoaGlobals.h:27
EcalHitResponse::vSam
virtual EcalSamples * vSam(unsigned int i)=0
EcalHitResponse::setPECorrection
void setPECorrection(const CaloVPECorrection *peCorrection)
Definition: EcalHitResponse.cc:66
EcalHitResponse::index
VecInd & index()
Definition: EcalHitResponse.cc:218
EcalHitResponse::params
const CaloSimParameters * params(const DetId &detId) const
Definition: EcalHitResponse.cc:36
EcalHitResponse::setHitFilter
void setHitFilter(const CaloVHitFilter *filter)
Definition: EcalHitResponse.cc:62
Timestamp.h
EcalHitResponse::vSamAll
virtual EcalSamples * vSamAll(unsigned int i)=0
EcalHitResponse::m_maxBunch
int m_maxBunch
Definition: EcalHitResponse.h:129
EcalHitResponse::BUNCHSPACE
Definition: EcalHitResponse.h:36
CaloVHitCorrection
Definition: CaloVHitCorrection.h:10
EcalHitResponse::samplesSize
virtual unsigned int samplesSize() const =0
PCaloHit.h
EcalHitResponse::setGeometry
void setGeometry(const CaloSubdetectorGeometry *geometry)
Definition: EcalHitResponse.cc:56
EcalHitResponse::m_index
VecInd m_index
Definition: EcalHitResponse.h:136
EcalHitResponse::EcalHitResponse
EcalHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
Definition: EcalHitResponse.cc:20
EcalHitResponse
Definition: EcalHitResponse.h:28
EcalHitResponse::m_parameterMap
const CaloVSimParameterMap * m_parameterMap
Definition: EcalHitResponse.h:120
CaloSamples
Definition: CaloSamples.h:14
EcalHitResponse::m_hitCorrection
const CaloVHitCorrection * m_hitCorrection
Definition: EcalHitResponse.h:122
PCaloHit
Definition: PCaloHit.h:8
EcalHitResponse::geometry
const CaloSubdetectorGeometry * geometry() const
Definition: EcalHitResponse.cc:46
CaloVShape
Electronic response of the preamp.
Definition: CaloVShape.h:11
EcalHitResponse::findSignal
EcalSamples * findSignal(const DetId &detId)
Definition: EcalHitResponse.cc:166
EcalHitResponse::maxBunch
int maxBunch() const
Definition: EcalHitResponse.cc:216
EcalHitResponse::initializeHits
virtual void initializeHits()
Definition: EcalHitResponse.cc:116
EcalHitResponse::add
void add(const EcalSamples *pSam)
Definition: EcalHitResponse.cc:209
EcalHitResponse::m_PECorrection
const CaloVPECorrection * m_PECorrection
Definition: EcalHitResponse.h:123
EcalHitResponse::VecInd
std::vector< unsigned int > VecInd
Definition: EcalHitResponse.h:32
EcalHitResponse::m_useLCcorrection
bool m_useLCcorrection
Definition: EcalHitResponse.h:133
EcalHitResponse::shape
const CaloVShape * shape() const
Definition: EcalHitResponse.cc:41
DetId.h
EcalHitResponse::hitFilter
const CaloVHitFilter * hitFilter() const
Definition: EcalHitResponse.cc:222
EcalHitResponse::finalizeHits
virtual void finalizeHits()
Definition: EcalHitResponse.cc:118
CaloVHitFilter
Definition: CaloVHitFilter.h:6
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EcalHitResponse::m_geometry
const CaloSubdetectorGeometry * m_geometry
Definition: EcalHitResponse.h:125
EcalHitResponse::run
virtual void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *)
Definition: EcalHitResponse.cc:120
EcalHitResponse::m_laserCalibCache
CalibCache m_laserCalibCache
Definition: EcalHitResponse.h:134
EcalHitResponse::analogSignalAmplitude
double analogSignalAmplitude(const DetId &id, double energy, CLHEP::HepRandomEngine *)
Definition: EcalHitResponse.cc:174
EcalCondDBWriter_cfi.laser
laser
Definition: EcalCondDBWriter_cfi.py:46
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::TimeValue_t
unsigned long long TimeValue_t
Definition: Timestamp.h:28