7 #include "CLHEP/Random/RandGaussQ.h"
12 addNoise_(addNoise), peds_(0), mips_(0)
23 std::vector<ESSample> essamples =
encode(cs);
26 for(
int i=0;
i<df.
size();
i++) {
35 for(
int i = 0;
i < df.
size();
i++) {
47 <<
"ESElectroncSim requires the RandomNumberGeneratorService\n"
48 "which is not present in the configuration file. You must add the service\n"
49 "in the configuration file or remove the modules that require it.";
54 results.reserve(timeframe.
size());
58 int baseline_ = (int) it_ped->getMean();
59 double sigma_ = (double) it_ped->getRms();
60 double MIPADC_ = (double) (*it_mip);
65 for (
int i=0;
i<timeframe.
size();
i++) {
71 CLHEP::RandGaussQ gaussQDistribution(rng->
getEngine(), 0., sigma_);
72 noi = gaussQDistribution.fire();
75 signal = timeframe[
i]*ADCGeV + noi + baseline_;
int adc(sample_type sample)
get the ADC sample (12 bits)
const ESIntercalibConstants * mips_
virtual void digitalToAnalog(const ESDataFrame &df, CaloSamples &cs) const
const ESDetId & id() const
const self & getMap() const
std::vector< ESSample > encode(const CaloSamples &timeframe) const
ESElectronicsSim(bool addNoise)
const_iterator find(uint32_t rawId) const
double decode(const ESSample &sample, const DetId &detId) 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)
virtual void analogToDigital(const CaloSamples &cs, ESDataFrame &df) const
int size() const
get the size
std::vector< Item >::const_iterator const_iterator
DetId id() const
get the (generic) id
const ESPedestals * peds_