00001 #ifndef CastorSim_CastorElectronicsSim_h 00002 #define CastorSim_CastorElectronicsSim_h 00003 00008 #include "CalibFormats/CaloObjects/interface/CaloSamples.h" 00009 #include "CLHEP/Random/RandFlat.h" 00010 00011 class CastorDataFrame; 00012 00013 class CastorAmplifier; 00014 class CastorCoderFactory; 00015 00016 class CastorElectronicsSim { 00017 public: 00018 CastorElectronicsSim(CastorAmplifier * amplifier, 00019 const CastorCoderFactory * coderFactory); 00020 ~CastorElectronicsSim(); 00021 00022 void setRandomEngine(CLHEP::HepRandomEngine & engine); 00023 00024 void analogToDigital(CaloSamples & linearFrame, CastorDataFrame & result); 00025 00027 void newEvent(); 00028 00029 private: 00030 template<class Digi> void convert(CaloSamples & frame, Digi & result); 00031 00032 CastorAmplifier * theAmplifier; 00033 const CastorCoderFactory * theCoderFactory; 00034 CLHEP::RandFlat * theRandFlat; 00035 00036 int theStartingCapId; 00037 }; 00038 00039 00040 #endif 00041