6 #include "CLHEP/Random/RandGaussQ.h"
12 m_addNoise ( addNoise ) ,
29 <<
"ESElectroncSimFast requires the RandomNumberGeneratorService\n"
30 "which is not present in the configuration file. You must add the service\n"
31 "in the configuration file or remove the modules that require it.";
79 const double baseline ( (
double) it_ped->getMean() ) ;
80 const double sigma ( isNoise ? 0. : (
double) it_ped->getRms() ) ;
81 const double MIPADC ( isNoise ? 0. : (
double) (*it_mip) ) ;
82 const double ADCGeV ( isNoise ? 1. : MIPADC/
m_MIPToGeV ) ;
86 for(
unsigned int i ( 0 ) ;
i != cs.
size(); ++
i )
88 const double noi ( isNoise || (!
m_addNoise) ? 0 :
91 double signal = cs[
i]*ADCGeV + noi + baseline ;
102 adc = int( signal ) ;
105 if( 0.5 < signal - adc ) ++
adc ;
int adc(sample_type sample)
get the ADC sample (12 bits)
void setMIPToGeV(double MIPToGeV)
auto_ptr< ClusterSequence > cs
const ESIntercalibConstants * m_mips
const_iterator end() const
const self & getMap() const
void setPedestals(const ESPedestals *peds)
CLHEP::RandGaussQ * m_ranGau
const_iterator find(uint32_t rawId) const
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
void setSample(int i, const ESSample &sam)
void analogToDigital(ESSamples &cs, ESDataFrame &df, bool isNoise=false) const
const ESPedestals * m_peds
std::vector< Item >::const_iterator const_iterator
ESElectronicsSimFast(bool addNoise)
void setMIPs(const ESIntercalibConstants *mips)