6 #include "CLHEP/Random/RandGaussQ.h"
12 m_addNoise ( addNoise ) ,
13 m_PreMix1 ( PreMix1 ) ,
30 <<
"ESElectroncSimFast requires the RandomNumberGeneratorService\n"
31 "which is not present in the configuration file. You must add the service\n"
32 "in the configuration file or remove the modules that require it.";
80 const double baseline ( (
double) it_ped->getMean() ) ;
81 const double sigma ( isNoise ? 0. : (
double) it_ped->getRms() ) ;
82 const double MIPADC ( isNoise ? 0. : (
double) (*it_mip) ) ;
83 const double ADCGeV ( isNoise ? 1. : MIPADC/
m_MIPToGeV ) ;
87 for(
unsigned int i ( 0 ) ;
i != cs.
size(); ++
i )
89 const double noi ( isNoise || (!
m_addNoise) ? 0 :
93 if(!
m_PreMix1) signal = cs[
i]*ADCGeV + noi + baseline ;
94 else signal = cs[
i]*ADCGeV ;
105 adc = int( signal ) ;
109 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
ESElectronicsSimFast(bool addNoise, bool PreMix1)
const ESPedestals * m_peds
std::vector< Item >::const_iterator const_iterator
void setMIPs(const ESIntercalibConstants *mips)