RandPoissonT


Class defining methods for shooting numbers according to the Poisson distribution, given a mean. RandPoissonT is derived from RandPoisson and shares the identical user interface. RandPoissonT is always perfectly accurate for any value of mu.

For mu > 100 the algorithm used is taken from the base class RandPoisson (Algorithm from "W.H.Press et al., Numerical Recipes in C, Second Edition").

For mu < 100, algorithm used is a table lookup based on [mu/K] for some smallish K, followed by an explicit series-drived poisson for the small remaining part of mu. This method is exact, and is substantially faster than the method used by the base class. The implementation of this method is in the RandPoissonQ class.

Author

Mark Fischler

See also

Engines: HepRandomEngine, DRand48Engine , DualRand, HepJamesRandom, Hurd160Engine, Hurd288Engine, MTwistEngine, RandEngine, RanecuEngine, RanluxEngine, Ranlux64Engine, RanshiEngine, TripleRand

Distributions: HepRandom, RandBinomial, RandBit, RandBreitWigner, RandChiSquare, RandExponential, RandFlat, RandGamma, RandGauss, RandGaussQ, RandGaussT, RandGeneral, RandLandau, RandPoisson, RandPoissonQ, RandStudentT

Functions: HepStat

Declaration

#include "CLHEP/Random/RandPoissonT.h"

class RandPoissonT : public RandPoisson

Public Member Functions

Constructors
RandPoissonT(HepRandomEngine& anEngine, HepDouble m=1.0)
RandPoissonT(HepRandomEngine* anEngine, HepDouble m=1.0)
These constructors should be used to instantiate a RandPoissonT distribution object defining a local engine for it.
The static generator will be skipped using the non-static methods defined below.
If the engine is passed by pointer the corresponding engine object will be deleted by the RandPoissonT destructor.
If the engine is passed by reference the corresponding engine object will not be deleted by the RandPoissonT destructor.
Destructor
virtual ~RandPoissonT()
()
HepDouble operator()()
HepDouble operator()(HepDouble m)
Methods using the localEngine to shoot random values, by-passing the static generator.
fire
long fire()
long fire(HepDouble m)
Methods using the localEngine to shoot random values, by-passing the static generator.
fireArray
void fireArray(const HepInt size, long* vect)
void fireArray(const HepInt size, long* vect, HepDouble m)
Methods using the localEngine to shoot random values, by-passing the static generator.
shoot
static long shoot(HepDouble m=1.0)
Static method to shoot random values using the static generator.

static long shoot(HepRandomEngine* anEngine, HepDouble m=1.0)
Static methods to shoot random values using a given engine by-passing the static generator.
shootArray
static void shootArray(const HepInt size, long* vect, HepDouble m=1.0)
Static method to shoot random values using the static generator

static void shootArray(HepRandomEngine* anEngine, const HepInt size, long* vect, HepDouble m=1.0)
Static methods to shoot random values using a given engine by-passing the static generator.

Example

CLHEP/Random/test/testRandDists.cc


19 June 2001
EVC