12 #include "CLHEP/Random/RandGaussQ.h" 17 : theDbService(
nullptr), theParameterMap(parameters), theStartingCapId(0), addNoise_(addNoise) {}
25 if (!peds || !pwidths) {
26 edm::LogError(
"CastorAmplifier") <<
"Could not fetch HCAL/CASTOR conditions for channel " << hcalGenDetId;
33 for (
int i = 0;
i < frame.
size();
i++) {
34 gauss[
i] = CLHEP::RandGaussQ::shoot(engine, 0., 1.);
39 for (
int tbin = 0; tbin < frame.
size(); ++tbin) {
41 double pedestal = peds->getValue(capId);
43 pedestal += noise[tbin] * (fCperPE / nominalfCperPE);
45 frame[tbin] *= fCperPE;
unsigned theStartingCapId
double getNominalfCperPE() const
const CastorPedestal * getPedestal(const HcalGenericDetId &fId) const
CastorAmplifier(const CastorSimParameterMap *parameters, bool addNoise)
const CastorSimParameterMap * theParameterMap
const CastorDbService * theDbService
double photoelectronsToAnalog(const DetId &detId) const override
void makeNoise(unsigned fFrames, const double *fGauss, double *fNoise) const
CastorSimParameters castorParameters() const
accessors
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