7 #include "CLHEP/Random/RandGaussQ.h"
12 addNoise_(addNoise), peds_(0), mips_(0)
26 std::vector<ESSample> essamples =
encode(cs, engine);
29 for(
int i=0;
i<df.
size();
i++) {
38 for(
int i = 0;
i < df.
size();
i++) {
50 <<
"ESElectroncSim requires the RandomNumberGeneratorService\n"
51 "which is not present in the configuration file. You must add the service\n"
52 "in the configuration file or remove the modules that require it.";
57 results.reserve(timeframe.
size());
61 int baseline_ = (int) it_ped->getMean();
62 double sigma_ = (double) it_ped->getRms();
63 double MIPADC_ = (double) (*it_mip);
68 for (
int i=0;
i<timeframe.
size();
i++) {
74 noi = CLHEP::RandGaussQ::shoot(engine, 0., sigma_);
77 signal = timeframe[
i]*ADCGeV + noi + baseline_;
89 results.emplace_back(adc);
int adc(sample_type sample)
get the ADC sample (12 bits)
auto_ptr< ClusterSequence > cs
const ESIntercalibConstants * mips_
virtual void digitalToAnalog(const ESDataFrame &df, CaloSamples &cs) const
edm::Service< edm::RandomNumberGenerator > rng
const ESDetId & id() const
const self & getMap() const
std::vector< ESSample > encode(const CaloSamples &timeframe, CLHEP::HepRandomEngine *) const
virtual void analogToDigital(CLHEP::HepRandomEngine *, const CaloSamples &cs, ESDataFrame &df) const
ESElectronicsSim(bool addNoise)
const_iterator find(uint32_t rawId) const
double decode(const ESSample &sample, const DetId &detId) const
void setSample(int i, const ESSample &sam)
int size() const
get the size
std::vector< Item >::const_iterator const_iterator
virtual ~ESElectronicsSim()
DetId id() const
get the (generic) id
const ESPedestals * peds_