CMS 3D CMS Logo

EBHitResponse.h
Go to the documentation of this file.
1 #ifndef EcalSimAlgos_EBHitResponse_h
2 #define EcalSimAlgos_EBHitResponse_h
3 
7 
8 class APDSimParameters;
9 
10 namespace CLHEP {
11  class HepRandomEngine;
12 }
13 
15 public:
17 
18  typedef std::vector<double> VecD;
19 
20  enum { kNOffsets = 2000 };
21 
22  EBHitResponse(const CaloVSimParameterMap* parameterMap,
23  const CaloVShape* shape,
24  bool apdOnly,
25  const APDSimParameters* apdPars,
26  const CaloVShape* apdShape);
27 
28  ~EBHitResponse() override;
29 
30  void initialize(CLHEP::HepRandomEngine*);
31 
32  virtual bool keepBlank() const { return false; }
33 
34  void setIntercal(const EcalIntercalibConstantsMC* ical);
35 
36  void add(const PCaloHit& hit, CLHEP::HepRandomEngine*) override;
37 
38  void initializeHits() override;
39 
40  void finalizeHits() override;
41 
42  void run(MixCollection<PCaloHit>& hits, CLHEP::HepRandomEngine*) override;
43 
44  unsigned int samplesSize() const override;
45 
46  EcalSamples* operator[](unsigned int i) override;
47 
48  const EcalSamples* operator[](unsigned int i) const override;
49 
50 protected:
51  unsigned int samplesSizeAll() const override;
52 
53  EcalSamples* vSamAll(unsigned int i) override;
54 
55  const EcalSamples* vSamAll(unsigned int i) const override;
56 
57  EcalSamples* vSam(unsigned int i) override;
58 
59  void putAPDSignal(const DetId& detId, double npe, double time);
60 
61 private:
62  const VecD& offsets() const { return m_timeOffVec; }
63 
64  const double nonlFunc(double enr) const {
65  return (pelo > enr ? pext : (pehi > enr ? nonlFunc1(enr) : pfac * atan(log10(enr - pehi + 0.00001)) + poff));
66  }
67 
68  const double nonlFunc1(double energy) const {
69  const double enr(log10(energy));
70  const double enr2(enr * enr);
71  const double enr3(enr2 * enr);
72  return (pcub * enr3 + pqua * enr2 + plin * enr + pcon);
73  }
74 
75  const APDSimParameters* apdParameters() const;
76  const CaloVShape* apdShape() const;
77 
78  double apdSignalAmplitude(const PCaloHit& hit, CLHEP::HepRandomEngine*) const;
79 
80  void findIntercalibConstant(const DetId& detId, double& icalconst) const;
81 
82  const bool m_apdOnly;
86 
87  std::vector<double> m_timeOffVec;
88 
89  std::vector<double> m_apdNpeVec;
90  std::vector<double> m_apdTimeVec;
91 
92  const double pcub, pqua, plin, pcon, pelo, pehi, pasy, pext, poff, pfac;
93 
94  std::vector<EBSamples> m_vSam;
95 
97 };
98 #endif
static AlgebraicMatrix initialize()
CaloTSamples< float, 10 > EBSamples
Definition: EBHitResponse.h:16
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:84
Electronic response of the preamp.
Definition: CaloVShape.h:11
std::vector< double > VecD
Definition: EBHitResponse.h:18
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:83
const VecD & offsets() const
Definition: EBHitResponse.h:62
T operator[](int i) const
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:85
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:87
const double nonlFunc1(double energy) const
Definition: EBHitResponse.h:68
Definition: DetId.h:18
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
bool m_isInitialized
Definition: EBHitResponse.h:96
const double nonlFunc(double enr) const
Definition: EBHitResponse.h:64
virtual bool keepBlank() const
Definition: EBHitResponse.h:32
const bool m_apdOnly
Definition: EBHitResponse.h:82
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:90
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:89
const double pqua
Definition: EBHitResponse.h:92