CMS 3D CMS Logo

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