Go to the documentation of this file.00001 #ifndef EcalSimAlgos_EBHitResponse_h
00002 #define EcalSimAlgos_EBHitResponse_h
00003
00004 #include "CalibFormats/CaloObjects/interface/CaloTSamples.h"
00005 #include "SimCalorimetry/EcalSimAlgos/interface/EcalHitResponse.h"
00006 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h"
00007
00008 class APDSimParameters ;
00009
00010 class EBHitResponse : public EcalHitResponse
00011 {
00012 public:
00013
00014 typedef CaloTSamples<float,10> EBSamples ;
00015
00016 typedef std::vector<double> VecD ;
00017
00018 enum { kNOffsets = 2000 } ;
00019
00020 EBHitResponse( const CaloVSimParameterMap* parameterMap ,
00021 const CaloVShape* shape ,
00022 bool apdOnly ,
00023 const APDSimParameters* apdPars ,
00024 const CaloVShape* apdShape ) ;
00025
00026 virtual ~EBHitResponse() ;
00027
00028 virtual bool keepBlank() const { return false ; }
00029
00030 void setIntercal( const EcalIntercalibConstantsMC* ical ) ;
00031
00032 const VecD& offsets() const { return m_timeOffVec ; }
00033
00034 virtual void run( MixCollection<PCaloHit>& hits ) ;
00035
00036 virtual unsigned int samplesSize() const ;
00037
00038 virtual EcalSamples* operator[]( unsigned int i ) ;
00039
00040 virtual const EcalSamples* operator[]( unsigned int i ) const ;
00041
00042 protected:
00043
00044 virtual unsigned int samplesSizeAll() const ;
00045
00046 virtual EcalSamples* vSamAll( unsigned int i ) ;
00047
00048 virtual const EcalSamples* vSamAll( unsigned int i ) const ;
00049
00050 virtual EcalSamples* vSam( unsigned int i ) ;
00051
00052 void putAPDSignal( const DetId& detId, double npe, double time ) ;
00053
00054 private:
00055
00056 const double nonlFunc( double enr ) const {
00057 return ( pelo > enr ? pext :
00058 ( pehi > enr ? nonlFunc1( enr ) :
00059 pfac*atan( log10( enr - pehi + 0.00001 ) ) + poff ) ) ; }
00060
00061 const double nonlFunc1( double energy ) const {
00062 const double enr ( log10(energy) ) ;
00063 const double enr2 ( enr*enr ) ;
00064 const double enr3 ( enr2*enr ) ;
00065 return ( pcub*enr3 + pqua*enr2 + plin*enr + pcon ) ; }
00066
00067 const APDSimParameters* apdParameters() const ;
00068 const CaloVShape* apdShape() const ;
00069
00070 double apdSignalAmplitude( const PCaloHit& hit ) const ;
00071
00072 void findIntercalibConstant( const DetId& detId,
00073 double& icalconst ) const ;
00074
00075 const bool m_apdOnly ;
00076 const APDSimParameters* m_apdPars ;
00077 const CaloVShape* m_apdShape ;
00078 const EcalIntercalibConstantsMC* m_intercal ;
00079
00080 std::vector<double> m_timeOffVec ;
00081
00082 std::vector<double> m_apdNpeVec ;
00083 std::vector<double> m_apdTimeVec ;
00084
00085 const double pcub, pqua, plin, pcon, pelo, pehi, pasy, pext, poff, pfac ;
00086
00087 std::vector<EBSamples> m_vSam ;
00088 };
00089 #endif
00090
00091