12 #include "CLHEP/Random/RandGaussQ.h" 18 theParameterMap(parameters),
30 if (!peds || !pwidths )
33 <<
"Could not fetch HCAL/CASTOR conditions for channel " << hcalGenDetId;
42 for (
int i = 0;
i < frame.
size();
i++) { gauss[
i] = CLHEP::RandGaussQ::shoot(engine, 0., 1.); }
46 for(
int tbin = 0; tbin < frame.
size(); ++tbin) {
48 double pedestal = peds->getValue(capId);
50 pedestal += noise [tbin]*(fCperPE/nominalfCperPE);
52 frame[tbin] *= fCperPE;
56 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
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