7 #include "CLHEP/Random/RandGaussQ.h" 21 std::vector<ESSample> essamples =
encode(
cs, engine);
23 df.setSize(
cs.size());
24 for (
int i = 0;
i <
df.size();
i++) {
25 df.setSample(
i, essamples[
i]);
30 for (
int i = 0;
i <
df.size();
i++) {
39 <<
"ESElectroncSim requires the RandomNumberGeneratorService\n" 40 "which is not present in the configuration file. You must add the service\n" 41 "in the configuration file or remove the modules that require it.";
49 int baseline_ = (
int)it_ped->getMean();
50 double sigma_ = (double)it_ped->getRms();
51 double MIPADC_ = (double)(*it_mip);
56 for (
int i = 0;
i < timeframe.
size();
i++) {
61 noi = CLHEP::RandGaussQ::shoot(engine, 0., sigma_);
64 signal = timeframe[
i] * ADCGeV + noi + baseline_;
double decode(const ESSample &sample, const DetId &detId) const
int size() const
get the size
const ESIntercalibConstants * mips_
virtual void digitalToAnalog(const ESDataFrame &df, CaloSamples &cs) const
const_iterator find(uint32_t rawId) const
ESElectronicsSim(bool addNoise)
DetId id() const
get the (generic) id
virtual void analogToDigital(CLHEP::HepRandomEngine *, const CaloSamples &cs, ESDataFrame &df) const
std::vector< Item >::const_iterator const_iterator
std::vector< ESSample > encode(const CaloSamples &timeframe, CLHEP::HepRandomEngine *) const
virtual ~ESElectronicsSim()
const self & getMap() const
const ESPedestals * peds_
uint16_t *__restrict__ uint16_t const *__restrict__ adc