CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
16  public:
17 
19 
20  typedef std::vector<double> VecD ;
21 
22  enum { kNOffsets = 2000 } ;
23 
24  EBHitResponse( const CaloVSimParameterMap* parameterMap ,
25  const CaloVShape* shape ,
26  bool apdOnly ,
27  const APDSimParameters* apdPars ,
28  const CaloVShape* apdShape ) ;
29 
30  virtual ~EBHitResponse() ;
31 
32  void initialize(CLHEP::HepRandomEngine*);
33 
34  virtual bool keepBlank() const { return false ; }
35 
36  void setIntercal( const EcalIntercalibConstantsMC* ical ) ;
37 
38 
39  virtual void add( const PCaloHit& hit, CLHEP::HepRandomEngine* ) override;
40 
41  virtual void initializeHits() override;
42 
43  virtual void finalizeHits() override;
44 
45  virtual void run( MixCollection<PCaloHit>& hits, CLHEP::HepRandomEngine* ) override;
46 
47  virtual unsigned int samplesSize() const override;
48 
49  virtual EcalSamples* operator[]( unsigned int i ) override;
50 
51  virtual const EcalSamples* operator[]( unsigned int i ) const override;
52 
53  protected:
54 
55  virtual unsigned int samplesSizeAll() const override;
56 
57  virtual EcalSamples* vSamAll( unsigned int i ) override;
58 
59  virtual const EcalSamples* vSamAll( unsigned int i ) const override;
60 
61  virtual EcalSamples* vSam( unsigned int i ) override ;
62 
63  void putAPDSignal( const DetId& detId, double npe, double time ) ;
64 
65  private:
66 
67  const VecD& offsets() const { return m_timeOffVec ; }
68 
69  const double nonlFunc( double enr ) const {
70  return ( pelo > enr ? pext :
71  ( pehi > enr ? nonlFunc1( enr ) :
72  pfac*atan( log10( enr - pehi + 0.00001 ) ) + poff ) ) ; }
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  const APDSimParameters* apdParameters() const ;
81  const CaloVShape* apdShape() const ;
82 
83  double apdSignalAmplitude( const PCaloHit& hit, CLHEP::HepRandomEngine* ) const ;
84 
85  void findIntercalibConstant( const DetId& detId,
86  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 #endif
105 
106 
int i
Definition: DBlmapReader.cc:9
const double pfac
Definition: EBHitResponse.h:98
const CaloVShape * shape() const
std::vector< EBSamples > m_vSam
virtual EcalSamples * operator[](unsigned int i) override
const CaloVShape * m_apdShape
Definition: EBHitResponse.h:90
void putAPDSignal(const DetId &detId, double npe, double time)
Electronic response of the preamp.
Definition: CaloVShape.h:11
std::vector< double > VecD
Definition: EBHitResponse.h:20
const APDSimParameters * apdParameters() const
const APDSimParameters * m_apdPars
Definition: EBHitResponse.h:89
void findIntercalibConstant(const DetId &detId, double &icalconst) const
CaloTSamples< float, 10 > EBSamples
Definition: EBHitResponse.h:18
void setIntercal(const EcalIntercalibConstantsMC *ical)
const VecD & offsets() const
Definition: EBHitResponse.h:67
virtual void initializeHits() override
double apdSignalAmplitude(const PCaloHit &hit, CLHEP::HepRandomEngine *) const
const double pelo
Definition: EBHitResponse.h:98
const double plin
Definition: EBHitResponse.h:98
virtual unsigned int samplesSize() const override
const EcalIntercalibConstantsMC * m_intercal
Definition: EBHitResponse.h:91
std::vector< double > m_timeOffVec
Definition: EBHitResponse.h:93
const double nonlFunc1(double energy) const
Definition: EBHitResponse.h:74
virtual EcalSamples * vSamAll(unsigned int i) override
const double pasy
Definition: EBHitResponse.h:98
CaloTSamplesBase< float > EcalSamples
EBHitResponse(const CaloVSimParameterMap *parameterMap, const CaloVShape *shape, bool apdOnly, const APDSimParameters *apdPars, const CaloVShape *apdShape)
Definition: DetId.h:18
virtual ~EBHitResponse()
const double pehi
Definition: EBHitResponse.h:98
const double poff
Definition: EBHitResponse.h:98
virtual EcalSamples * vSam(unsigned int i) override
const double pcub
Definition: EBHitResponse.h:98
const double nonlFunc(double enr) const
Definition: EBHitResponse.h:69
const double pcon
Definition: EBHitResponse.h:98
void initialize(CLHEP::HepRandomEngine *)
virtual unsigned int samplesSizeAll() const override
virtual bool keepBlank() const
Definition: EBHitResponse.h:34
volatile std::atomic< bool > shutdown_flag false
const bool m_apdOnly
Definition: EBHitResponse.h:88
virtual void run(MixCollection< PCaloHit > &hits, CLHEP::HepRandomEngine *) override
virtual void finalizeHits() override
std::vector< double > m_apdTimeVec
Definition: EBHitResponse.h:96
std::vector< double > m_apdNpeVec
Definition: EBHitResponse.h:95
const double pext
Definition: EBHitResponse.h:98
const double pqua
Definition: EBHitResponse.h:98
const CaloVShape * apdShape() const
virtual void add(const PCaloHit &hit, CLHEP::HepRandomEngine *) override