00001 #ifndef HcalSimAlgos_HcalElectronicsSim_h 00002 #define HcalSimAlgos_HcalElectronicsSim_h 00003 00008 #include "CalibFormats/CaloObjects/interface/CaloSamples.h" 00009 #include "CLHEP/Random/RandFlat.h" 00010 00011 class HBHEDataFrame; 00012 class HODataFrame; 00013 class HFDataFrame; 00014 class ZDCDataFrame; 00015 00016 class HcalAmplifier; 00017 class HcalCoderFactory; 00018 00019 class HcalElectronicsSim { 00020 public: 00021 HcalElectronicsSim(HcalAmplifier * amplifier, 00022 const HcalCoderFactory * coderFactory); 00023 ~HcalElectronicsSim(); 00024 00025 void setRandomEngine(CLHEP::HepRandomEngine & engine); 00026 00027 void analogToDigital(CaloSamples & linearFrame, HBHEDataFrame & result); 00028 void analogToDigital(CaloSamples & linearFrame, HODataFrame & result); 00029 void analogToDigital(CaloSamples & linearFrame, HFDataFrame & result); 00030 void analogToDigital(CaloSamples & linearFrame, ZDCDataFrame & result); 00031 00034 void newEvent(); 00035 void setStartingCapId(int startingCapId); 00036 00037 private: 00038 template<class Digi> void convert(CaloSamples & frame, Digi & result); 00039 00040 HcalAmplifier * theAmplifier; 00041 const HcalCoderFactory * theCoderFactory; 00042 CLHEP::RandFlat * theRandFlat; 00043 00044 int theStartingCapId; 00045 bool theStartingCapIdIsRandom; 00046 }; 00047 00048 00049 #endif 00050