00001 #ifndef CaloSimAlgos_CaloHitRespoNew_h 00002 #define CaloSimAlgos_CaloHitRespoNew_h 00003 00004 #include "CalibFormats/CaloObjects/interface/CaloSamples.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 00020 class CaloVShape ; 00021 class CaloVSimParameterMap ; 00022 class CaloVHitCorrection ; 00023 class CaloVHitFilter ; 00024 class CaloSimParameters ; 00025 class CaloSubdetectorGeometry ; 00026 class CaloVPECorrection ; 00027 namespace CLHEP 00028 { 00029 class RandPoissonQ ; 00030 class RandGaussQ ; 00031 class HepRandomEngine ; 00032 } 00033 00034 class CaloHitRespoNew 00035 { 00036 public: 00037 00038 typedef std::vector< CaloSamples > VecSam ; 00039 typedef std::vector< unsigned int > VecInd ; 00040 00041 enum {BUNCHSPACE=25}; 00042 00043 CaloHitRespoNew( const CaloVSimParameterMap* parameterMap , 00044 const CaloVShape* shape ) ; 00045 00046 virtual ~CaloHitRespoNew() ; 00047 00048 void setBunchRange( int minBunch , 00049 int maxBunch ) ; 00050 00051 void setGeometry( const CaloSubdetectorGeometry* geometry ) ; 00052 00053 void setPhaseShift( double phaseShift ) ; 00054 00055 void setHitFilter( const CaloVHitFilter* filter) ; 00056 00057 void setHitCorrection( const CaloVHitCorrection* hitCorrection) ; 00058 00059 void setPECorrection( const CaloVPECorrection* peCorrection ) ; 00060 00061 virtual void setRandomEngine( CLHEP::HepRandomEngine& engine ) const ; 00062 00063 virtual void run( MixCollection<PCaloHit>& hits ) ; 00064 00065 unsigned int samplesSize() const ; 00066 00067 const CaloSamples& operator[]( unsigned int i ) const ; 00068 00069 protected: 00070 00071 CaloSamples* findSignal( const DetId& detId ) ; 00072 00073 virtual void putAnalogSignal( const PCaloHit& inputHit) ; 00074 00075 double analogSignalAmplitude( const PCaloHit& hit ) const; 00076 00077 double timeOfFlight( const DetId& detId ) const ; 00078 00079 double phaseShift() const ; 00080 00081 CLHEP::RandPoissonQ* ranPois() const ; 00082 00083 CLHEP::RandGaussQ* ranGauss() const ; 00084 00085 void setupSamples( const DetId& detId ) ; 00086 00087 void blankOutUsedSamples() ; 00088 00089 const CaloSimParameters* params( const DetId& detId ) const ; 00090 00091 const CaloVShape* shape() const ; 00092 00093 const CaloSubdetectorGeometry* geometry() const ; 00094 00095 private: 00096 00097 const CaloVSimParameterMap* m_parameterMap ; 00098 const CaloVShape* m_shape ; 00099 const CaloVHitCorrection* m_hitCorrection ; 00100 const CaloVPECorrection* m_PECorrection ; 00101 const CaloVHitFilter* m_hitFilter ; 00102 const CaloSubdetectorGeometry* m_geometry ; 00103 00104 mutable CLHEP::RandPoissonQ* m_RandPoisson ; 00105 00106 mutable CLHEP::RandGaussQ* m_RandGauss ; 00107 00108 int m_minBunch ; 00109 int m_maxBunch ; 00110 double m_phaseShift ; 00111 bool m_setup ; 00112 00113 VecSam m_vSamp ; 00114 VecInd m_index ; 00115 }; 00116 00117 #endif