4 #include "CLHEP/Random/RandGaussQ.h"
5 #include "CLHEP/Random/RandPoissonQ.h"
6 #include "CLHEP/Random/RandFlat.h"
15 : theCellCount(
nCells), theSiPM(
nCells, 1.), theCrossTalk(0.), theTempDep(0.), theLastHitTime(-1.), nonlin(nullptr) {
31 double dn = double(
n);
32 double dk = double(
k);
34 double ldn = lambda * dn;
35 double logb = -ldn + dnk *
log(ldn) - TMath::LnGamma(dnk + 1);
40 b *= (
exp(-ldn) *
pow(ldn, dnk)) / TMath::Factorial(
n -
k);
51 typename cdfmap::const_iterator it;
58 double b = 0., sumb = 0.;
67 unsigned int borelstartn =
i;
87 double U = CLHEP::RandFlat::shoot(engine);
88 std::vector<double>::const_iterator
up;
91 LogDebug(
"HcalSiPM") <<
"cdf size = " << cdf.second.size() <<
", U = " <<
U <<
", in_pes = " << in_pes
92 <<
", 2ndary_pes = " << (
up - cdf.second.cbegin() + cdf.first);
95 return (
up - cdf.second.cbegin() + cdf.first);
100 double HcalSiPM::hitCells(CLHEP::HepRandomEngine* engine,
unsigned int pes,
double tempDiff,
double photonTime) {
119 double sum(0.),
hit(0.);
120 for (
unsigned int pe(0); pe < pes; ++pe) {
135 double tot(0.),
hit(0.);
173 for (
int k = 1;
k <= 100;
k++)