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) {
173 for (
int k = 1;
k <= 100;
k++)
void setSaturationPars(const std::vector< float > &pars)
std::vector< double > theSiPM
const cdfpair & BorelCDF(unsigned int k)
double Borel(unsigned int n, double lambda, unsigned int k)
virtual double hitCells(CLHEP::HepRandomEngine *, unsigned int pes, double tempDiff=0., double photonTime=0.)
void setNCells(int nCells)
void setCrossTalk(double xtalk)
TupleMultiplicity< TrackerTraits > const HitToTuple< TrackerTraits > const cms::cuda::AtomicPairCounter GPUCACellT< TrackerTraits > const *__restrict__ uint32_t const *__restrict__ nCells
unsigned int addCrossTalkCells(CLHEP::HepRandomEngine *engine, unsigned int in_pes)
HcalSiPMnonlinearity * nonlin
virtual double totalCharge() const
unsigned int theCellCount
HcalSiPM(int nCells=1, double tau=15.)
void setTemperatureDependence(double tempDep)
Power< A, B >::type pow(const A &a, const B &b)
std::pair< unsigned int, std::vector< double > > cdfpair
double cellCharge(double deltaTime) const