#include <RandPoissonQ.h>
|
| RandPoissonQ (HepRandomEngine &anEngine, double m=1.0) |
|
| RandPoissonQ (HepRandomEngine *anEngine, double m=1.0) |
|
virtual | ~RandPoissonQ () |
|
std::ostream & | put (std::ostream &os) const |
|
std::istream & | get (std::istream &is) |
|
long | fire () |
|
long | fire (double m) |
|
void | fireArray (const int size, long *vect) |
|
void | fireArray (const int size, long *vect, double m) |
|
double | operator() () |
|
double | operator() (double m) |
|
std::string | name () const |
|
HepRandomEngine & | engine () |
|
Public Member Functions inherited from CLHEP::RandPoisson |
| RandPoisson (HepRandomEngine &anEngine, double m=1.0) |
|
| RandPoisson (HepRandomEngine *anEngine, double m=1.0) |
|
virtual | ~RandPoisson () |
|
long | fire () |
|
long | fire (double m) |
|
void | fireArray (const int size, long *vect) |
|
void | fireArray (const int size, long *vect, double m) |
|
double | operator() (double m) |
|
Public Member Functions inherited from CLHEP::HepRandom |
| HepRandom () |
|
| HepRandom (long seed) |
|
| HepRandom (HepRandomEngine &algorithm) |
|
| HepRandom (HepRandomEngine *algorithm) |
|
virtual | ~HepRandom () |
|
double | flat () |
|
void | flatArray (const int size, double *vect) |
|
double | flat (HepRandomEngine *theNewEngine) |
|
void | flatArray (HepRandomEngine *theNewEngine, const int size, double *vect) |
|
|
static long | shoot (double m=1.0) |
|
static void | shootArray (const int size, long *vect, double m=1.0) |
|
static long | shoot (HepRandomEngine *anEngine, double m=1.0) |
|
static void | shootArray (HepRandomEngine *anEngine, const int size, long *vect, double m=1.0) |
|
static std::string | distributionName () |
|
static int | tableBoundary () |
|
Static Public Member Functions inherited from CLHEP::RandPoisson |
static long | shoot (double m=1.0) |
|
static void | shootArray (const int size, long *vect, double m=1.0) |
|
static long | shoot (HepRandomEngine *anEngine, double m=1.0) |
|
static void | shootArray (HepRandomEngine *anEngine, const int size, long *vect, double m=1.0) |
|
static std::string | distributionName () |
|
Static Public Member Functions inherited from CLHEP::HepRandom |
static void | setTheSeed (long seed, int lux=3) |
|
static long | getTheSeed () |
|
static void | setTheSeeds (const long *seeds, int aux=-1) |
|
static const long * | getTheSeeds () |
|
static void | getTheTableSeeds (long *seeds, int index) |
|
static HepRandom * | getTheGenerator () |
|
static void | setTheEngine (HepRandomEngine *theNewEngine) |
|
static HepRandomEngine * | getTheEngine () |
|
static void | saveEngineStatus (const char filename[]="Config.conf") |
|
static void | restoreEngineStatus (const char filename[]="Config.conf") |
|
static std::ostream & | saveFullState (std::ostream &os) |
|
static std::istream & | restoreFullState (std::istream &is) |
|
static std::ostream & | saveDistState (std::ostream &os) |
|
static std::istream & | restoreDistState (std::istream &is) |
|
static std::ostream & | saveStaticRandomStates (std::ostream &os) |
|
static std::istream & | restoreStaticRandomStates (std::istream &is) |
|
static void | showEngineStatus () |
|
static int | createInstance () |
|
static std::string | distributionName () |
|
- Author
Definition at line 32 of file RandPoissonQ.h.
CLHEP::RandPoissonQ::RandPoissonQ |
( |
HepRandomEngine & |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
inline |
CLHEP::RandPoissonQ::RandPoissonQ |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
inline |
CLHEP::RandPoissonQ::~RandPoissonQ |
( |
| ) |
|
|
virtual |
static std::string CLHEP::RandPoissonQ::distributionName |
( |
| ) |
|
|
inlinestatic |
long CLHEP::RandPoissonQ::fire |
( |
| ) |
|
long CLHEP::RandPoissonQ::fire |
( |
double |
m | ) |
|
void CLHEP::RandPoissonQ::fireArray |
( |
const int |
size, |
|
|
long * |
vect |
|
) |
| |
void CLHEP::RandPoissonQ::fireArray |
( |
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m |
|
) |
| |
std::istream & CLHEP::RandPoissonQ::get |
( |
std::istream & |
is | ) |
|
|
virtual |
Reimplemented from CLHEP::RandPoisson.
Definition at line 571 of file RandPoissonQ.cc.
References CLHEP::RandPoisson::get(), CLHEP::DoubConv::longs2double(), name(), and CLHEP::possibleKeywordInput().
574 if (inName !=
name()) {
575 is.clear(std::ios::badbit | is.rdstate());
576 std::cerr <<
"Mismatch when expecting to read state of a "
577 <<
name() <<
" distribution\n"
578 <<
"Name found was " << inName
579 <<
"\nistream is left in the badbit state\n";
583 std::vector<unsigned long> t(2);
592 is >> a1 >> a2 >> sigma;
std::istream & get(std::istream &is)
bool possibleKeywordInput(IS &is, const std::string &key, T &t)
static double longs2double(const std::vector< unsigned long > &v)
std::string CLHEP::RandPoissonQ::name |
( |
| ) |
const |
|
virtual |
double CLHEP::RandPoissonQ::operator() |
( |
| ) |
|
|
virtual |
double CLHEP::RandPoissonQ::operator() |
( |
double |
m | ) |
|
std::ostream & CLHEP::RandPoissonQ::put |
( |
std::ostream & |
os | ) |
const |
|
virtual |
Reimplemented from CLHEP::RandPoisson.
Definition at line 544 of file RandPoissonQ.cc.
References CLHEP::DoubConv::dto2longs(), name(), gammaraytel::pr, and CLHEP::RandPoisson::put().
545 int pr=os.precision(20);
546 std::vector<unsigned long> t(2);
547 os <<
" " <<
name() <<
"\n";
548 os <<
"Uvec" <<
"\n";
550 os << a0 <<
" " << t[0] <<
" " << t[1] <<
"\n";
552 os << a1 <<
" " << t[0] <<
" " << t[1] <<
"\n";
554 os << a2 <<
" " << t[0] <<
" " << t[1] <<
"\n";
556 os << sigma <<
" " << t[0] <<
" " << t[1] <<
"\n";
561 int pr=os.precision(20);
562 os <<
" " <<
name() <<
"\n";
563 os << a0 <<
" " << a1 <<
" " << a2 <<
"\n";
std::ostream & put(std::ostream &os) const
static std::vector< unsigned long > dto2longs(double d)
long CLHEP::RandPoissonQ::shoot |
( |
double |
m = 1.0 | ) |
|
|
static |
long CLHEP::RandPoissonQ::shoot |
( |
HepRandomEngine * |
anEngine, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
Definition at line 140 of file RandPoissonQ.cc.
146 static double lastLargeMean = -1.;
148 static double lastA0;
149 static double lastA1;
150 static double lastA2;
151 static double lastSigma;
153 if ( mean < LAST_MU + S ) {
154 return poissonDeviateSmall ( anEngine, mean );
156 if ( mean != lastLargeMean ) {
159 double sig2 = mean * (.9998654 - .08346/mean);
160 lastSigma = std::sqrt(sig2);
162 lastA2 = t*(1./6.) + t*t*(1./324.);
163 lastA1 = std::sqrt (1-2*lastA2*lastA2*sig2);
164 lastA0 = mean + .5 - sig2 * lastA2;
166 return poissonDeviateQuick ( anEngine, lastA0, lastA1, lastA2, lastSigma );
void CLHEP::RandPoissonQ::shootArray |
( |
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
static void CLHEP::RandPoissonQ::shootArray |
( |
HepRandomEngine * |
anEngine, |
|
|
const int |
size, |
|
|
long * |
vect, |
|
|
double |
m = 1.0 |
|
) |
| |
|
static |
static int CLHEP::RandPoissonQ::tableBoundary |
( |
| ) |
|
|
inlinestatic |
const double CLHEP::RandPoissonQ::MAXIMUM_POISSON_DEVIATE = 2.0E9 |
|
static |
The documentation for this class was generated from the following files: