RandGauss


Class defining methods for shooting gaussian distributed random values, given a mean (deafult=0) or specifying also a deviation (default=1).
Gaussian random numbers are generated two at the time, so every other time shoot is called the number returned is the one generated the time before.
Default values are used for operator()().

Author

Gabriele Cosmo

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, RandGaussQ, RandGaussT, RandGeneral, RandLandau, RandPoisson, RandPoissonQ, RandPoissonT, RandStudentT

Functions: HepStat

Declaration

#include "CLHEP/Random/RandGauss.h"

class RandGauss : public HepRandom

Public Member Functions

Constructors
inline RandGauss(HepRandomEngine& anEngine, HepDouble mean=0.0, HepDouble stdDev=1.0)
inline RandGauss(HepRandomEngine* anEngine, HepDouble mean=0.0, HepDouble stdDev=1.0)
These constructors should be used to instantiate a RandGauss distribution object defining a local engine for it.
The static generator will be skeeped using the non-static methods defined below.
If the engine is passed by pointer the corresponding engine object will be deleted by the RandGauss destructor.
If the engine is passed by reference the corresponding engine object will not be deleted by the RandGauss destructor.
Destructor
virtual ~RandGauss()
()
HepDouble operator()()
HepDouble operator()(HepDouble mean, HepDouble stdDev)
Methods using the localEngine to shoot random values, by-passing the static generator.
fire
HepDouble fire()
inline HepDouble fire(HepDouble mean, HepDouble stdDev)
Methods using the localEngine to shoot random values, by-passing the static generator.
fireArray
void fireArray(const HepInt size, HepDouble* vect)
void fireArray(const HepInt size, HepDouble* vect, HepDouble mean, HepDouble stdDev)
Methods using the localEngine to shoot random values, by-passing the static generator.
getF
HepBoolean getF() const
getFlag
static HepBoolean getFlag()
restoreEngineStatus
static void restoreEngineStatus(const char filename[] = "Config.conf")
Restores a saved status (if any) for the current engine.
saveEngineStatus
static void saveEngineStatus(const char filename[] = "Config.conf")
Saves to file the current status of the current engine.
Methods overriding the base class static saveEngineStatus ones, by adding extra data so that save in one program, then further shootBit()s will produce the identical sequence to restore in another program, then generating shootBit() randoms there.
setF
void setF(HepBoolean val)
setFlag
static void setFlag(HepBoolean val)
Methods setFlag(false) and setF(false) if invoked in the client code before shoot/fire will force generation of a new couple of values.
shoot
static HepDouble shoot()
static inline HepDouble shoot(HepDouble mean, HepDouble stdDev)
Static methods to shoot random values using the static generator.

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

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

Example

CLHEP/test/testRandom.cc


17 May 2000
EVC