00001 #ifndef EcalSimAlgos_ESDigitizer_h 00002 #define EcalSimAlgos_ESDigitizer_h 00003 00004 #include "SimCalorimetry/EcalSimAlgos/interface/EcalTDigitizer.h" 00005 #include "SimCalorimetry/EcalSimAlgos/interface/EcalDigitizerTraits.h" 00006 00007 namespace CLHEP { 00008 class RandGeneral ; 00009 class RandPoissonQ ; 00010 class RandFlat ; 00011 class HepRandomEngine ; } 00012 00013 #include <vector> 00014 00015 class ESDigitizer : public EcalTDigitizer< ESDigitizerTraits > 00016 { 00017 public: 00018 00019 typedef ESDigitizerTraits::ElectronicsSim ElectronicsSim ; 00020 00021 ESDigitizer( EcalHitResponse* hitResponse , 00022 ElectronicsSim* electronicsSim , 00023 bool addNoise ) ; 00024 00025 virtual ~ESDigitizer() ; 00026 00027 virtual void run( MixCollection<PCaloHit>& input , 00028 DigiCollection& output ) ; 00029 00030 void setDetIds( const std::vector<DetId>& detIds ) ; 00031 00032 void setGain( const int gain ) ; 00033 00034 private: 00035 00036 void createNoisyList( std::vector<DetId>& abThreshCh ) ; 00037 00038 const std::vector<DetId>* m_detIds ; 00039 CLHEP::HepRandomEngine* m_engine ; 00040 CLHEP::RandGeneral* m_ranGeneral ; 00041 CLHEP::RandPoissonQ* m_ranPois ; 00042 CLHEP::RandFlat* m_ranFlat ; 00043 int m_ESGain ; 00044 double m_histoBin ; 00045 double m_histoInf ; 00046 double m_histoWid ; 00047 double m_meanNoisy ; 00048 00049 class Triplet 00050 { 00051 public: 00052 Triplet() : first ( 0 ), second ( 0 ), third ( 0 ) {} 00053 Triplet( uint32_t a0 , 00054 uint32_t a1 , 00055 uint32_t a2 ) : 00056 first ( a0 ), second ( a1 ), third ( a2 ) {} 00057 ~Triplet() {} ; 00058 uint32_t first ; 00059 uint32_t second ; 00060 uint32_t third ; 00061 }; 00062 00063 std::vector<Triplet> m_trip ; 00064 }; 00065 00066 #endif 00067