#include <RandPoisson.h>
- Author
Definition at line 42 of file RandPoisson.h.
◆ RandPoisson() [1/2]
CLHEP::RandPoisson::RandPoisson |
( |
HepRandomEngine & |
anEngine, |
|
|
double |
a1 = 1.0 |
|
) |
| |
|
inline |
◆ RandPoisson() [2/2]
CLHEP::RandPoisson::RandPoisson |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
a1 = 1.0 |
|
) |
| |
|
inline |
◆ ~RandPoisson()
CLHEP::RandPoisson::~RandPoisson |
( |
| ) |
|
|
virtual |
◆ distributionName()
static std::string CLHEP::RandPoisson::distributionName |
( |
| ) |
|
|
inlinestatic |
◆ engine()
◆ fire() [1/2]
long CLHEP::RandPoisson::fire |
( |
| ) |
|
◆ fire() [2/2]
long CLHEP::RandPoisson::fire |
( |
double |
m | ) |
|
Definition at line 217 of file RandPoisson.cc.
231 if( xm == -1 )
return 0;
247 sq = std::sqrt(2.0*xm);
249 g1 = xm*alxm -
gammln(xm + 1.0);
257 t = 0.9*(1.0 + y*
y)* std::exp(em*alxm -
gammln(em + 1.0) - g1);
262 if ( static_cast<long>(em) < 0 )
263 em = static_cast<long>(xm) >= 0 ? xm :
getMaxMean();
std::shared_ptr< HepRandomEngine > localEngine
static double normal(HepRandomEngine *eptr)
static double getMaxMean()
◆ fireArray() [1/2]
void CLHEP::RandPoisson::fireArray |
( |
const int |
size, |
|
|
long * |
vect |
|
) |
| |
◆ fireArray() [2/2]
void CLHEP::RandPoisson::fireArray |
( |
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m |
|
) |
| |
◆ get()
std::istream & CLHEP::RandPoisson::get |
( |
std::istream & |
is | ) |
|
|
virtual |
Reimplemented from CLHEP::HepRandom.
Reimplemented in CLHEP::RandPoissonQ.
Definition at line 302 of file RandPoisson.cc.
305 if (inName !=
name()) {
306 is.clear(std::ios::badbit | is.rdstate());
307 std::cerr <<
"Mismatch when expecting to read state of a " 308 <<
name() <<
" distribution\n" 309 <<
"Name found was " << inName
310 <<
"\nistream is left in the badbit state\n";
314 std::vector<unsigned long> t(2);
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
static double longs2double(const std::vector< unsigned long > &v)
◆ getLocalEngine()
◆ getMaxMean()
static double CLHEP::RandPoisson::getMaxMean |
( |
| ) |
|
|
inlinestaticprotected |
◆ getOldMean()
static double CLHEP::RandPoisson::getOldMean |
( |
| ) |
|
|
inlinestaticprotected |
Definition at line 102 of file RandPoisson.h.
static CLHEP_THREAD_LOCAL double oldm_st
◆ getPStatus()
static double* CLHEP::RandPoisson::getPStatus |
( |
| ) |
|
|
inlinestaticprotected |
Definition at line 108 of file RandPoisson.h.
static CLHEP_THREAD_LOCAL double status_st[3]
◆ name()
std::string CLHEP::RandPoisson::name |
( |
| ) |
const |
|
virtual |
◆ operator()() [1/2]
double CLHEP::RandPoisson::operator() |
( |
| ) |
|
|
virtual |
◆ operator()() [2/2]
double CLHEP::RandPoisson::operator() |
( |
double |
m | ) |
|
◆ put()
std::ostream & CLHEP::RandPoisson::put |
( |
std::ostream & |
os | ) |
const |
|
virtual |
Reimplemented from CLHEP::HepRandom.
Reimplemented in CLHEP::RandPoissonQ.
Definition at line 281 of file RandPoisson.cc.
282 int pr=os.precision(20);
283 std::vector<unsigned long> t(2);
284 os <<
" " <<
name() <<
"\n";
285 os <<
"Uvec" <<
"\n";
287 os <<
meanMax <<
" " << t[0] <<
" " << t[1] <<
"\n";
289 os <<
defaultMean <<
" " << t[0] <<
" " << t[1] <<
"\n";
291 os <<
status[0] <<
" " << t[0] <<
" " << t[1] <<
"\n";
293 os <<
status[1] <<
" " << t[0] <<
" " << t[1] <<
"\n";
295 os <<
status[2] <<
" " << t[0] <<
" " << t[1] <<
"\n";
297 os <<
oldm <<
" " << t[0] <<
" " << t[1] <<
"\n";
static std::vector< unsigned long > dto2longs(double d)
◆ setOldMean()
static void CLHEP::RandPoisson::setOldMean |
( |
double |
val | ) |
|
|
inlinestaticprotected |
Definition at line 106 of file RandPoisson.h.
static CLHEP_THREAD_LOCAL double oldm_st
◆ setPStatus()
static void CLHEP::RandPoisson::setPStatus |
( |
double |
sq, |
|
|
double |
alxm, |
|
|
double |
g1 |
|
) |
| |
|
inlinestaticprotected |
Definition at line 110 of file RandPoisson.h.
static CLHEP_THREAD_LOCAL double status_st[3]
◆ shoot() [1/2]
long CLHEP::RandPoisson::shoot |
( |
double |
m = 1.0 | ) |
|
|
static |
Definition at line 91 of file RandPoisson.cc.
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 normal(HepRandomEngine *eptr)
static double getMaxMean()
static double getOldMean()
◆ shoot() [2/2]
long CLHEP::RandPoisson::shoot |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
Definition at line 152 of file RandPoisson.cc.
168 if( xm == -1 )
return 0;
178 t *= anEngine->flat();
184 sq = std::sqrt(2.0*xm);
186 g1 = xm*alxm -
gammln(xm + 1.0);
190 y = std::tan(
CLHEP::pi*anEngine->flat());
194 t = 0.9*(1.0 + y*
y)* std::exp(em*alxm -
gammln(em + 1.0) - g1);
195 }
while( anEngine->flat() > t );
198 em = xm + std::sqrt(xm) *
normal (anEngine);
199 if ( static_cast<long>(em) < 0 )
200 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 double normal(HepRandomEngine *eptr)
static double getMaxMean()
static double getOldMean()
◆ shootArray() [1/2]
void CLHEP::RandPoisson::shootArray |
( |
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
Definition at line 146 of file RandPoisson.cc.
148 for(
long*
v = vect;
v != vect + size; ++
v )
static long shoot(double m=1.0)
◆ shootArray() [2/2]
void CLHEP::RandPoisson::shootArray |
( |
HepRandomEngine * |
anEngine, |
|
|
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
Definition at line 206 of file RandPoisson.cc.
209 for(
long*
v = vect;
v != vect + size; ++
v )
static long shoot(double m=1.0)
◆ defaultMean
double CLHEP::RandPoisson::defaultMean |
|
protected |
◆ localEngine
◆ meanMax
double CLHEP::RandPoisson::meanMax |
|
protected |
◆ meanMax_st
const double CLHEP::RandPoisson::meanMax_st = 2.0E9 |
|
staticprivate |
◆ oldm
double CLHEP::RandPoisson::oldm |
|
private |
◆ oldm_st
◆ status
double CLHEP::RandPoisson::status[3] |
|
private |
◆ status_st
The documentation for this class was generated from the following files: