12 #include "CLHEP/Random/RandGaussQ.h"
18 : theDbService(nullptr), theParameterMap(parameters), theStartingCapId(0), addNoise_(addNoise) {}
26 if (!peds || !pwidths) {
27 edm::LogError(
"CastorAmplifier") <<
"Could not fetch HCAL/CASTOR conditions for channel " << hcalGenDetId;
34 for (
int i = 0;
i < frame.
size();
i++) {
35 gauss[
i] = CLHEP::RandGaussQ::shoot(engine, 0., 1.);
40 for (
int tbin = 0; tbin < frame.
size(); ++tbin) {
42 double pedestal = peds->getValue(capId);
44 pedestal += noise[tbin] * (fCperPE / nominalfCperPE);
46 frame[tbin] *= fCperPE;
50 LogDebug(
"CastorAmplifier") << frame;
unsigned theStartingCapId
double getNominalfCperPE() const
const CastorPedestal * getPedestal(const HcalGenericDetId &fId) const
CastorAmplifier(const CastorSimParameterMap *parameters, bool addNoise)
const CastorSimParameterMap * theParameterMap
const CastorDbService * theDbService
Log< level::Error, false > LogError
void makeNoise(unsigned fFrames, const double *fGauss, double *fNoise) const
CastorSimParameters castorParameters() const
accessors
double photoelectronsToAnalog(const DetId &detId) const override
virtual void amplify(CaloSamples &linearFrame, CLHEP::HepRandomEngine *) const
int size() const
get the size
const CastorPedestalWidth * getPedestalWidth(const HcalGenericDetId &fId) const
DetId id() const
get the (generic) id