00001 #ifndef EcalSimAlgos_ESElectronicsSim_h 00002 #define EcalSimAlgos_ESElectronicsSim_h 1 00003 00004 #include "CalibFormats/CaloObjects/interface/CaloSamples.h" 00005 #include "DataFormats/EcalDigi/interface/ESDataFrame.h" 00006 #include "DataFormats/EcalDigi/interface/ESSample.h" 00007 00008 #include<vector> 00009 00010 class ESElectronicsSim 00011 { 00012 public: 00013 00014 enum {MAXADC = 4095}; 00015 enum {MINADC = 0}; 00016 00017 ESElectronicsSim (bool addNoise, double sigma, int gain, int baseline, double MIPADC, double MIPkeV); 00018 00019 void setNoiseSigma (const double sigma); 00020 void setGain (const int gain); 00021 void setBaseline (const int baseline); 00022 void setMIPADC (const double MIPADC); 00023 void setMIPkeV (const double MIPkeV); 00024 00025 virtual void analogToDigital(const CaloSamples& cs, ESDataFrame& df) const; 00026 virtual void digitalToAnalog(const ESDataFrame& df, CaloSamples& cs) const; 00027 00029 void newEvent() {} 00030 00031 private : 00032 00033 bool addNoise_; 00034 double sigma_; 00035 int gain_; 00036 int baseline_; 00037 double MIPADC_; 00038 double MIPkeV_; 00039 00040 std::vector<ESSample> encode(const CaloSamples& timeframe) const; 00041 double decode(const ESSample & sample, const DetId & detId) const; 00042 00043 } ; 00044 00045 00046 #endif