CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/SimCalorimetry/EcalSimAlgos/interface/EcalHitResponse.h

Go to the documentation of this file.
00001 #ifndef EcalSimAlgos_EcalHitResponse_h
00002 #define EcalSimAlgos_EcalHitResponse_h
00003 
00004 #include "CalibFormats/CaloObjects/interface/CaloTSamplesBase.h"
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
00007 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
00008 #include "CalibCalorimetry/EcalLaserCorrection/interface/EcalLaserDbService.h"
00009 #include "DataFormats/Provenance/interface/Timestamp.h"
00010 
00011 #include<vector>
00012 
00013 typedef unsigned long long TimeValue_t;
00014 
00015 class CaloVShape              ;
00016 class CaloVSimParameterMap    ;
00017 class CaloVHitCorrection      ;
00018 class CaloVHitFilter          ;
00019 class CaloSimParameters       ;
00020 class CaloSubdetectorGeometry ;
00021 class CaloVPECorrection       ;
00022 namespace CLHEP 
00023 { 
00024    class RandPoissonQ         ; 
00025    class RandGaussQ           ; 
00026    class HepRandomEngine      ;
00027 }
00028 
00029 class EcalHitResponse 
00030 {
00031    public:
00032 
00033       typedef CaloTSamplesBase<float> EcalSamples ;
00034 
00035       typedef std::vector< unsigned int > VecInd ;
00036 
00037       enum { BUNCHSPACE = 25 } ;
00038 
00039       EcalHitResponse( const CaloVSimParameterMap* parameterMap ,
00040                        const CaloVShape*           shape          ) ;
00041 
00042       virtual ~EcalHitResponse() ;
00043 
00044       void setBunchRange( int minBunch ,
00045                           int maxBunch   ) ;
00046 
00047       void setGeometry( const CaloSubdetectorGeometry* geometry ) ;
00048 
00049       void setPhaseShift( double phaseShift ) ;
00050 
00051       void setHitFilter( const CaloVHitFilter* filter) ;
00052 
00053       void setHitCorrection( const CaloVHitCorrection* hitCorrection) ;
00054 
00055       void setPECorrection( const CaloVPECorrection* peCorrection ) ;
00056 
00057       void setEventTime(const edm::TimeValue_t& iTime);
00058 
00059       void setLaserConstants(const EcalLaserDbService* laser, bool& useLCcorrection);
00060 
00061       void add( const EcalSamples* pSam ) ;
00062 
00063       virtual void run( MixCollection<PCaloHit>& hits ) ;
00064 
00065       virtual unsigned int samplesSize() const = 0 ;
00066 
00067       virtual EcalSamples* operator[]( unsigned int i ) = 0;
00068 
00069       virtual const EcalSamples* operator[]( unsigned int i ) const = 0;
00070 
00071       const EcalSamples* findDetId( const DetId& detId ) const ;
00072 
00073    protected:
00074 
00075       virtual unsigned int samplesSizeAll() const = 0 ;
00076 
00077       virtual EcalSamples* vSam( unsigned int i ) = 0 ;
00078 
00079       virtual EcalSamples* vSamAll( unsigned int i ) = 0 ;
00080 
00081       virtual const EcalSamples* vSamAll( unsigned int i ) const = 0 ;
00082 
00083       virtual void putAnalogSignal( const PCaloHit& inputHit) ;
00084 
00085       double findLaserConstant(const DetId& detId) const;
00086 
00087       EcalSamples* findSignal( const DetId& detId ) ;
00088 
00089       double analogSignalAmplitude( const PCaloHit& hit ) const;
00090 
00091       double timeOfFlight( const DetId& detId ) const ;
00092 
00093       double phaseShift() const ;
00094 
00095       CLHEP::RandPoissonQ* ranPois() const ;
00096 
00097       CLHEP::RandGaussQ* ranGauss() const ;
00098 
00099       void blankOutUsedSamples() ;
00100 
00101       const CaloSimParameters* params( const DetId& detId ) const ;
00102 
00103       const CaloVShape* shape() const ;
00104 
00105       const CaloSubdetectorGeometry* geometry() const ;
00106 
00107       int minBunch() const ;
00108 
00109       int maxBunch() const ;
00110 
00111       VecInd& index() ;
00112 
00113       const VecInd& index() const ;
00114 
00115       const CaloVHitFilter* hitFilter() const ;
00116 
00117    private:
00118 
00119       const CaloVSimParameterMap*    m_parameterMap  ;
00120       const CaloVShape*              m_shape         ;
00121       const CaloVHitCorrection*      m_hitCorrection ;
00122       const CaloVPECorrection*       m_PECorrection  ;
00123       const CaloVHitFilter*          m_hitFilter     ;
00124       const CaloSubdetectorGeometry* m_geometry      ;
00125       const EcalLaserDbService*      m_lasercals     ;
00126 
00127       mutable CLHEP::RandPoissonQ*   m_RandPoisson   ;
00128       mutable CLHEP::RandGaussQ*     m_RandGauss     ;
00129 
00130       int    m_minBunch   ;
00131       int    m_maxBunch   ;
00132       double m_phaseShift ;
00133 
00134       edm::TimeValue_t               m_iTime          ;
00135       bool                           m_useLCcorrection;
00136 
00137       VecInd m_index ;
00138 };
00139 
00140 #endif