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