7 #include "CLHEP/Random/RandGaussQ.h"
12 addNoise_(addNoise), peds_(0), mips_(0)
26 std::vector<ESSample> essamples =
encode(cs);
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 CLHEP::RandGaussQ gaussQDistribution(rng->
getEngine(), 0., sigma_);
75 noi = gaussQDistribution.fire();
78 signal = timeframe[
i]*ADCGeV + noi + baseline_;
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
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
virtual ~ESElectronicsSim()
DetId id() const
get the (generic) id
const ESPedestals * peds_