22 #include "CLHEP/Random/RandBinomial.h"
23 #include "CLHEP/Random/RandGaussQ.h"
24 #include "CLHEP/Random/RandPoissonQ.h"
33 : theDbService(nullptr), theShapes(shapes) {}
38 DetId detId,
double signal,
double pedWidth,
bool doThermal,
bool isInGeV, CLHEP::HepRandomEngine* engine) {
45 double charge = signal / GeVperfC;
48 if (
charge > 3. * pedWidth) {
51 double electronEmission = 0.08;
52 CLHEP::RandPoissonQ theRandPoissonQ(*engine, electronEmission);
53 npe += theRandPoissonQ.fire();
58 return (
noise * GeVperfC);
62 double rateInTail = 0.000211988;
63 double rateInSecondTail = 4.61579e-06;
74 double p4 = 2.06117e+01;
75 double p5 = 1.09239e+01;
79 double p7 = 5.45548e+01;
80 double p8 = 1.59696e+01;
83 int nFirst = (
int)(CLHEP::RandBinomial::shoot(engine, npe, rateInTail));
84 int nSecond = (
int)(CLHEP::RandBinomial::shoot(engine, npe, rateInSecondTail));
86 for (
int j = 0;
j < nFirst; ++
j) {
87 noise += CLHEP::RandGaussQ::shoot(engine,
p4, p5);
89 for (
int j = 0;
j < nSecond; ++
j) {
90 noise += CLHEP::RandGaussQ::shoot(engine, p7, p8);
104 CLHEP::RandPoissonQ theRandPoissonQ(*engine, meanPE);
105 double npe = theRandPoissonQ.fire();
111 double timeFromPE = (
j -
i) * 25.;
112 samples[
j] += (*shape)(timeFromPE)*npe;
124 if (!gains || !gwidths) {
125 edm::LogError(
"HcalAmplifier") <<
"Could not fetch HCAL conditions for channel " << hcalGenDetId;