00001 #ifndef HcalSimAlgos_HcalBaseSignalGenerator_h 00002 #define HcalSimAlgos_HcalBaseSignalGenerator_h 00003 00004 #include "SimCalorimetry/CaloSimAlgos/interface/CaloVNoiseSignalGenerator.h" 00005 #include "SimCalorimetry/HcalSimAlgos/interface/HcalSimParameterMap.h" 00006 class HcalElectronicsSim; 00007 00008 class HcalBaseSignalGenerator : public CaloVNoiseSignalGenerator 00009 { 00010 public: 00011 HcalBaseSignalGenerator() 00012 : theParameterMap(0), theElectronicsSim(0) {} 00013 00014 virtual ~HcalBaseSignalGenerator() {} 00015 00016 void setParameterMap(HcalSimParameterMap * map) {theParameterMap = map;} 00017 00018 // can be needed to set starting cap ID 00019 void setElectronicsSim(HcalElectronicsSim * electronicsSim) {theElectronicsSim = electronicsSim;} 00020 00021 protected: 00022 00023 void fC2pe(CaloSamples & samples) const 00024 { 00025 assert(theParameterMap != 0); 00026 float factor = 1./theParameterMap->simParameters(samples.id()).photoelectronsToAnalog(samples.id()); 00027 samples *= factor; 00028 } 00029 00030 HcalSimParameterMap * theParameterMap; 00031 HcalElectronicsSim * theElectronicsSim; 00032 }; 00033 00034 #endif 00035 00036 00037