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
EcalHitResponse.h
EBHitResponse::run
void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *) override
Definition: EBHitResponse.cc:197
EcalIntercalibConstantsMC.h
EBHitResponse::pelo
const double pelo
Definition: EBHitResponse.h:92
EBHitResponse::EBSamples
CaloTSamples< float, 10 > EBSamples
Definition: EBHitResponse.h:16
EBHitResponse::m_apdNpeVec
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:89
EBHitResponse::m_isInitialized
bool m_isInitialized
Definition: EBHitResponse.h:96
mps_fire.i
i
Definition: mps_fire.py:355
EBHitResponse::pcon
const double pcon
Definition: EBHitResponse.h:92
EBHitResponse
Definition: EBHitResponse.h:14
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
EBHitResponse::add
void add(const PCaloHit &hit, CLHEP::HepRandomEngine *) override
Definition: EBHitResponse.cc:178
EBHitResponse::pqua
const double pqua
Definition: EBHitResponse.h:92
EBHitResponse::m_timeOffVec
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:87
CaloVSimParameterMap
Definition: CaloVSimParameterMap.h:7
EBHitResponse::keepBlank
virtual bool keepBlank() const
Definition: EBHitResponse.h:32
EBHitResponse::apdSignalAmplitude
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
Definition: EBHitResponse.cc:103
EBHitResponse::initializeHits
void initializeHits() override
Definition: EBHitResponse.cc:151
EcalHitResponse::EcalSamples
CaloTSamplesBase< float > EcalSamples
Definition: EcalHitResponse.h:30
EBHitResponse::apdShape
const CaloVShape * apdShape() const
Definition: EBHitResponse.cc:68
EBHitResponse::nonlFunc1
const double nonlFunc1(double energy) const
Definition: EBHitResponse.h:68
APDSimParameters
Definition: APDSimParameters.h:8
EcalCondObjectContainer< float >
EBHitResponse::m_intercal
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:85
EBHitResponse::m_apdShape
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:84
EBHitResponse::setIntercal
void setIntercal(const EcalIntercalibConstantsMC *ical)
Definition: EBHitResponse.cc:129
DetId
Definition: DetId.h:17
EBHitResponse::putAPDSignal
void putAPDSignal(const DetId &detId, double npe, double time)
Definition: EBHitResponse.cc:73
EBHitResponse::kNOffsets
Definition: EBHitResponse.h:20
EBHitResponse::nonlFunc
const double nonlFunc(double enr) const
Definition: EBHitResponse.h:64
EBHitResponse::EBHitResponse
EBHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
Definition: EBHitResponse.cc:15
EBHitResponse::VecD
std::vector< double > VecD
Definition: EBHitResponse.h:18
CaloTSamples
Definition: CaloTSamples.h:14
EBHitResponse::poff
const double poff
Definition: EBHitResponse.h:92
MixCollection
Definition: MixCollection.h:11
EBHitResponse::m_apdPars
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:83
EBHitResponse::samplesSize
unsigned int samplesSize() const override
Definition: EBHitResponse.cc:243
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
EBHitResponse::plin
const double plin
Definition: EBHitResponse.h:92
EBHitResponse::pasy
const double pasy
Definition: EBHitResponse.h:92
CLHEP
Definition: CocoaGlobals.h:27
CaloTSamples.h
EBHitResponse::pfac
const double pfac
Definition: EBHitResponse.h:92
EcalHitResponse
Definition: EcalHitResponse.h:28
EBHitResponse::vSamAll
EcalSamples * vSamAll(unsigned int i) override
Definition: EBHitResponse.cc:253
PCaloHit
Definition: PCaloHit.h:8
CaloVShape
Electronic response of the preamp.
Definition: CaloVShape.h:11
EBHitResponse::m_vSam
std::vector< EBSamples > m_vSam
Definition: EBHitResponse.h:94
EBHitResponse::offsets
const VecD & offsets() const
Definition: EBHitResponse.h:62
EBHitResponse::finalizeHits
void finalizeHits() override
Definition: EBHitResponse.cc:163
EcalHitResponse::shape
const CaloVShape * shape() const
Definition: EcalHitResponse.cc:41
EBHitResponse::pehi
const double pehi
Definition: EBHitResponse.h:92
EBHitResponse::pcub
const double pcub
Definition: EBHitResponse.h:92
EBHitResponse::apdParameters
const APDSimParameters * apdParameters() const
Definition: EBHitResponse.cc:63
EBHitResponse::m_apdOnly
const bool m_apdOnly
Definition: EBHitResponse.h:82
EBHitResponse::findIntercalibConstant
void findIntercalibConstant(const DetId &detId, double &icalconst) const
Definition: EBHitResponse.cc:131
EBHitResponse::pext
const double pext
Definition: EBHitResponse.h:92
EBHitResponse::m_apdTimeVec
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:90
EBHitResponse::operator[]
EcalSamples * operator[](unsigned int i) override
Definition: EBHitResponse.cc:249
EBHitResponse::~EBHitResponse
~EBHitResponse() override
Definition: EBHitResponse.cc:54
ntuplemaker.time
time
Definition: ntuplemaker.py:310
EBHitResponse::initialize
void initialize(CLHEP::HepRandomEngine *)
Definition: EBHitResponse.cc:56
EBHitResponse::vSam
EcalSamples * vSam(unsigned int i) override
Definition: EBHitResponse.cc:251
EBHitResponse::samplesSizeAll
unsigned int samplesSizeAll() const override
Definition: EBHitResponse.cc:245
hit
Definition: SiStripHitEffFromCalibTree.cc:88