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
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:131
mps_fire.i
i
Definition: mps_fire.py:428
ecalPh1::Samp_Period
static constexpr double Samp_Period
Definition: EcalConstants.h:25
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:35
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:31
EcalHitResponse::phaseShift
double phaseShift() const
Definition: EcalHitResponse.cc:60
EcalHitResponse::m_minBunch
int m_minBunch
Definition: EcalHitResponse.h:129
TimeValue_t
unsigned long long TimeValue_t
Definition: EcalHitResponse.h:16
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:133
EcalHitResponse::operator[]
virtual EcalSamples * operator[](unsigned int i)=0
MixCollection.h
EcalLaserDbService
Definition: EcalLaserDbService.h:25
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:130
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:137
EcalConstants.h
EcalHitResponse::EcalHitResponse
EcalHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape)
Definition: EcalHitResponse.cc:20
EcalHitResponse
Definition: EcalHitResponse.h:29
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:33
EcalHitResponse::m_useLCcorrection
bool m_useLCcorrection
Definition: EcalHitResponse.h:134
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::kSamplePeriod
const float kSamplePeriod
Definition: EcalHitResponse.h:41
EcalHitResponse::m_laserCalibCache
CalibCache m_laserCalibCache
Definition: EcalHitResponse.h:135
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