3 #include "CLHEP/Random/RandGaussQ.h"
4 #include "CLHEP/Random/RandPoissonQ.h"
5 #include "CLHEP/Random/RandFlat.h"
12 theCellCount(nCells), theSiPM(nCells,1.), theTauInv(1.0/tau),
13 theCrossTalk(0.), theTempDep(0.), theLastHitTime(-1.) {
24 if (photons < 1)
return 0;
29 CLHEP::RandPoissonQ randPoissonQ(*engine, photons/(1.-
theCrossTalk)-photons);
30 photons += randPoissonQ.fire();
40 if (mean > 1.) mean = 1.;
48 npe = CLHEP::RandGaussQ::shoot(engine, mean,
std::sqrt(width2 + (mean*prehit)));
50 return int(npe + 0.5);
64 CLHEP::RandPoissonQ randPoissonQ(*engine, pes/(1. -
theCrossTalk) - pes);
65 pes += randPoissonQ.fire();
69 double sum(0.),
hit(0.);
70 for (
unsigned int pe(0); pe < pes; ++pe) {
72 hit = (
theSiPM[pixel] < 0.) ? 1.0 :
86 double tot(0.),
hit(0.);
114 if((xTalk < 0) || (xTalk >= 1)) {
140 if (deltaTime <= 0.)
return 0.;
141 if (deltaTime > 10./
theTauInv)
return 1.;
143 return (result > 0.99) ? 1.0 :
result;
double cellCharge(double deltaTime) const
virtual double totalCharge() const
std::vector< double > theSiPM
void setNCells(int nCells)
void setCrossTalk(double xtalk)
Integral< F, X >::type integral(const F &f)
virtual int hitCells(CLHEP::HepRandomEngine *, unsigned int photons, unsigned int integral=0) const
unsigned int theCellCount
HcalSiPM(int nCells=1, double tau=15.)
void setTemperatureDependence(double tempDep)