12 #include "CLHEP/Random/RandGaussQ.h"
18 theParameterMap(parameters),
30 if (!peds || !pwidths )
32 edm::LogError(
"CastorAmplifier") <<
"Could not fetch HCAL/CASTOR conditions for channel " << hcalGenDetId;
39 for (
int i = 0;
i < frame.
size();
i++) gauss[
i] = CLHEP::RandGaussQ::shoot(engine, 0., 1.);
41 for(
int tbin = 0; tbin < frame.
size(); ++tbin) {
43 double pedestal = peds->getValue (capId);
45 pedestal += noise [tbin];
47 frame[tbin] *= fCperPE;
50 LogDebug(
"CastorAmplifier") << frame;
unsigned theStartingCapId
const CastorPedestal * getPedestal(const HcalGenericDetId &fId) const
CastorAmplifier(const CastorSimParameterMap *parameters, bool addNoise)
const CastorSimParameterMap * theParameterMap
const CastorDbService * theDbService
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
virtual double photoelectronsToAnalog(const DetId &detId) const
DetId id() const
get the (generic) id