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 00009 #include<vector> 00010 00011 class CaloVShape ; 00012 class CaloVSimParameterMap ; 00013 class CaloVHitCorrection ; 00014 class CaloVHitFilter ; 00015 class CaloSimParameters ; 00016 class CaloSubdetectorGeometry ; 00017 class CaloVPECorrection ; 00018 namespace CLHEP 00019 { 00020 class RandPoissonQ ; 00021 class RandGaussQ ; 00022 class HepRandomEngine ; 00023 } 00024 00025 class EcalHitResponse 00026 { 00027 public: 00028 00029 typedef CaloTSamplesBase<float> EcalSamples ; 00030 00031 typedef std::vector< unsigned int > VecInd ; 00032 00033 enum { BUNCHSPACE = 25 } ; 00034 00035 EcalHitResponse( const CaloVSimParameterMap* parameterMap , 00036 const CaloVShape* shape ) ; 00037 00038 virtual ~EcalHitResponse() ; 00039 00040 void setBunchRange( int minBunch , 00041 int maxBunch ) ; 00042 00043 void setGeometry( const CaloSubdetectorGeometry* geometry ) ; 00044 00045 void setPhaseShift( double phaseShift ) ; 00046 00047 void setHitFilter( const CaloVHitFilter* filter) ; 00048 00049 void setHitCorrection( const CaloVHitCorrection* hitCorrection) ; 00050 00051 void setPECorrection( const CaloVPECorrection* peCorrection ) ; 00052 00053 void add( const EcalSamples* pSam ) ; 00054 00055 virtual void run( MixCollection<PCaloHit>& hits ) ; 00056 00057 virtual unsigned int samplesSize() const = 0 ; 00058 00059 virtual EcalSamples* operator[]( unsigned int i ) = 0; 00060 00061 virtual const EcalSamples* operator[]( unsigned int i ) const = 0; 00062 00063 const EcalSamples* findDetId( const DetId& detId ) const ; 00064 00065 protected: 00066 00067 virtual unsigned int samplesSizeAll() const = 0 ; 00068 00069 virtual EcalSamples* vSam( unsigned int i ) = 0 ; 00070 00071 virtual EcalSamples* vSamAll( unsigned int i ) = 0 ; 00072 00073 virtual const EcalSamples* vSamAll( unsigned int i ) const = 0 ; 00074 00075 virtual void putAnalogSignal( const PCaloHit& inputHit) ; 00076 00077 EcalSamples* findSignal( const DetId& detId ) ; 00078 00079 double analogSignalAmplitude( const PCaloHit& hit ) const; 00080 00081 double timeOfFlight( const DetId& detId ) const ; 00082 00083 double phaseShift() const ; 00084 00085 CLHEP::RandPoissonQ* ranPois() const ; 00086 00087 CLHEP::RandGaussQ* ranGauss() const ; 00088 00089 void blankOutUsedSamples() ; 00090 00091 const CaloSimParameters* params( const DetId& detId ) const ; 00092 00093 const CaloVShape* shape() const ; 00094 00095 const CaloSubdetectorGeometry* geometry() const ; 00096 00097 int minBunch() const ; 00098 00099 int maxBunch() const ; 00100 00101 VecInd& index() ; 00102 00103 const VecInd& index() const ; 00104 00105 const CaloVHitFilter* hitFilter() const ; 00106 00107 private: 00108 00109 const CaloVSimParameterMap* m_parameterMap ; 00110 const CaloVShape* m_shape ; 00111 const CaloVHitCorrection* m_hitCorrection ; 00112 const CaloVPECorrection* m_PECorrection ; 00113 const CaloVHitFilter* m_hitFilter ; 00114 const CaloSubdetectorGeometry* m_geometry ; 00115 00116 mutable CLHEP::RandPoissonQ* m_RandPoisson ; 00117 mutable CLHEP::RandGaussQ* m_RandGauss ; 00118 00119 int m_minBunch ; 00120 int m_maxBunch ; 00121 double m_phaseShift ; 00122 00123 VecInd m_index ; 00124 }; 00125 00126 #endif