#include <RandPoisson.h>
- Author
Definition at line 41 of file RandPoisson.h.
CLHEP::RandPoisson::RandPoisson |
( |
HepRandomEngine & |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
inline |
CLHEP::RandPoisson::RandPoisson |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
inline |
CLHEP::RandPoisson::~RandPoisson |
( |
| ) |
|
|
virtual |
static std::string CLHEP::RandPoisson::distributionName |
( |
| ) |
|
|
inlinestatic |
long CLHEP::RandPoisson::fire |
( |
| ) |
|
long CLHEP::RandPoisson::fire |
( |
double |
m | ) |
|
Definition at line 217 of file RandPoisson.cc.
References CLHEP::gammln(), getMaxMean(), and meanMax.
231 if( xm == -1 )
return 0;
241 t *= localEngine->flat();
247 sq = std::sqrt(2.0*xm);
249 g1 = xm*alxm -
gammln(xm + 1.0);
253 y = std::tan(CLHEP::pi*localEngine->flat());
257 t = 0.9*(1.0 + y*y)* std::exp(em*alxm -
gammln(em + 1.0) - g1);
258 }
while( localEngine->flat() > t );
261 em = xm + std::sqrt(xm) * normal (localEngine.get());
262 if ( static_cast<long>(em) < 0 )
263 em = static_cast<long>(xm) >= 0 ? xm :
getMaxMean();
265 status[0] = sq; status[1] = alxm; status[2] = g1;
static double getMaxMean()
void CLHEP::RandPoisson::fireArray |
( |
const int |
size, |
|
|
long * |
vect |
|
) |
| |
void CLHEP::RandPoisson::fireArray |
( |
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m |
|
) |
| |
std::istream & CLHEP::RandPoisson::get |
( |
std::istream & |
is | ) |
|
|
virtual |
static double CLHEP::RandPoisson::getMaxMean |
( |
| ) |
|
|
inlinestaticprotected |
static double CLHEP::RandPoisson::getOldMean |
( |
| ) |
|
|
inlinestaticprotected |
static double* CLHEP::RandPoisson::getPStatus |
( |
| ) |
|
|
inlinestaticprotected |
std::string CLHEP::RandPoisson::name |
( |
| ) |
const |
|
virtual |
double CLHEP::RandPoisson::operator() |
( |
| ) |
|
|
virtual |
double CLHEP::RandPoisson::operator() |
( |
double |
m | ) |
|
std::ostream & CLHEP::RandPoisson::put |
( |
std::ostream & |
os | ) |
const |
|
virtual |
static void CLHEP::RandPoisson::setOldMean |
( |
double |
val | ) |
|
|
inlinestaticprotected |
static void CLHEP::RandPoisson::setPStatus |
( |
double |
sq, |
|
|
double |
alxm, |
|
|
double |
g1 |
|
) |
| |
|
inlinestaticprotected |
Definition at line 109 of file RandPoisson.h.
Referenced by shoot().
110 status_st[0] = sq; status_st[1] = alxm; status_st[2] = g1;
long CLHEP::RandPoisson::shoot |
( |
double |
m = 1.0 | ) |
|
|
static |
Definition at line 91 of file RandPoisson.cc.
References CLHEP::HepRandomEngine::flat(), CLHEP::gammln(), getMaxMean(), getOldMean(), getPStatus(), CLHEP::HepRandom::getTheEngine(), G4InuclParticleNames::om, setOldMean(), and setPStatus().
Referenced by shootArray().
108 if( xm == -1 )
return 0;
118 t *= anEngine->flat();
124 sq = std::sqrt(2.0*xm);
126 g1 = xm*alxm -
gammln(xm + 1.0);
130 y = std::tan(CLHEP::pi*anEngine->flat());
134 t = 0.9*(1.0 + y*y)* std::exp(em*alxm -
gammln(em + 1.0) - g1);
135 }
while( anEngine->flat() > t );
138 em = xm + std::sqrt(xm) * normal (anEngine);
139 if ( static_cast<long>(em) < 0 )
140 em =
static_cast<long>(xm) >= 0 ? xm :
getMaxMean();
static double * getPStatus()
static void setOldMean(double val)
static void setPStatus(double sq, double alxm, double g1)
static HepRandomEngine * getTheEngine()
static double getMaxMean()
static double getOldMean()
long CLHEP::RandPoisson::shoot |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
void CLHEP::RandPoisson::shootArray |
( |
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
void CLHEP::RandPoisson::shootArray |
( |
HepRandomEngine * |
anEngine, |
|
|
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
double CLHEP::RandPoisson::defaultMean |
|
protected |
double CLHEP::RandPoisson::meanMax |
|
protected |
The documentation for this class was generated from the following files: