Geant4-11
Public Member Functions | Static Public Member Functions | Static Protected Attributes
CLHEP::HepRandom Class Reference

#include <Random.h>

Inheritance diagram for CLHEP::HepRandom:
CLHEP::RandBinomial CLHEP::RandBreitWigner CLHEP::RandChiSquare CLHEP::RandExpZiggurat CLHEP::RandExponential CLHEP::RandFlat CLHEP::RandGamma CLHEP::RandGauss CLHEP::RandGeneral CLHEP::RandLandau CLHEP::RandPoisson CLHEP::RandStudentT

Public Member Functions

virtual HepRandomEngineengine ()
 
double flat ()
 
double flat (HepRandomEngine *theNewEngine)
 
void flatArray (const int size, double *vect)
 
void flatArray (HepRandomEngine *theNewEngine, const int size, double *vect)
 
virtual std::istream & get (std::istream &is)
 
 HepRandom ()
 
 HepRandom (HepRandomEngine &algorithm)
 
 HepRandom (HepRandomEngine *algorithm)
 
 HepRandom (long seed)
 
virtual std::string name () const
 
virtual double operator() ()
 
virtual std::ostream & put (std::ostream &os) const
 
virtual ~HepRandom ()
 

Static Public Member Functions

static int createInstance ()
 
static std::string distributionName ()
 
static HepRandomEnginegetTheEngine ()
 
static HepRandomgetTheGenerator ()
 
static long getTheSeed ()
 
static const long * getTheSeeds ()
 
static void getTheTableSeeds (long *seeds, int index)
 
static std::istream & restoreDistState (std::istream &is)
 
static void restoreEngineStatus (const char filename[]="Config.conf")
 
static std::istream & restoreFullState (std::istream &is)
 
static std::istream & restoreStaticRandomStates (std::istream &is)
 
static std::ostream & saveDistState (std::ostream &os)
 
static void saveEngineStatus (const char filename[]="Config.conf")
 
static std::ostream & saveFullState (std::ostream &os)
 
static std::ostream & saveStaticRandomStates (std::ostream &os)
 
static void setTheEngine (HepRandomEngine *theNewEngine)
 
static void setTheSeed (long seed, int lxr=3)
 
static void setTheSeeds (const long *seeds, int aux=-1)
 
static void showEngineStatus ()
 

Static Protected Attributes

static const long seedTable [215][2]
 

Detailed Description

Author
Gabri.nosp@m.ele..nosp@m.Cosmo.nosp@m.@cer.nosp@m.n.ch

Definition at line 48 of file Random.h.

Constructor & Destructor Documentation

◆ HepRandom() [1/4]

CLHEP::HepRandom::HepRandom ( )

Definition at line 178 of file Random.cc.

179{ }

◆ HepRandom() [2/4]

CLHEP::HepRandom::HepRandom ( long  seed)

Definition at line 181 of file Random.cc.

182{
183 setTheSeed(seed);
184}
static void setTheSeed(long seed, int lxr=3)
Definition: Random.cc:234

◆ HepRandom() [3/4]

CLHEP::HepRandom::HepRandom ( HepRandomEngine algorithm)

◆ HepRandom() [4/4]

CLHEP::HepRandom::HepRandom ( HepRandomEngine algorithm)

◆ ~HepRandom()

CLHEP::HepRandom::~HepRandom ( )
virtual

Definition at line 196 of file Random.cc.

197{ }

Member Function Documentation

◆ createInstance()

int CLHEP::HepRandom::createInstance ( )
static

◆ distributionName()

static std::string CLHEP::HepRandom::distributionName ( )
inlinestatic

Definition at line 151 of file Random.h.

151{return "HepRandomEngine";}

◆ engine()

HepRandomEngine & CLHEP::HepRandom::engine ( )
virtual

◆ flat() [1/2]

double CLHEP::HepRandom::flat ( )

◆ flat() [2/2]

double CLHEP::HepRandom::flat ( HepRandomEngine theNewEngine)
inline

◆ flatArray() [1/2]

void CLHEP::HepRandom::flatArray ( const int  size,
double *  vect 
)

◆ flatArray() [2/2]

void CLHEP::HepRandom::flatArray ( HepRandomEngine theNewEngine,
const int  size,
double *  vect 
)
inline

◆ get()

std::istream & CLHEP::HepRandom::get ( std::istream &  is)
virtual

◆ getTheEngine()

HepRandomEngine * CLHEP::HepRandom::getTheEngine ( )
static

◆ getTheGenerator()

HepRandom * CLHEP::HepRandom::getTheGenerator ( )
static

◆ getTheSeed()

long CLHEP::HepRandom::getTheSeed ( )
static

◆ getTheSeeds()

const long * CLHEP::HepRandom::getTheSeeds ( )
static

◆ getTheTableSeeds()

void CLHEP::HepRandom::getTheTableSeeds ( long *  seeds,
int  index 
)
static

Definition at line 254 of file Random.cc.

255{
256 if ((index >= 0) && (index < 215)) {
257 seeds[0] = seedTable[index][0];
258 seeds[1] = seedTable[index][1];
259 }
260 else seeds = NULL;
261}
static const long seedTable[215][2]
Definition: Random.h:156

Referenced by CLHEP::HepJamesRandom::HepJamesRandom(), CLHEP::MTwistEngine::MTwistEngine(), CLHEP::RanecuEngine::RanecuEngine(), CLHEP::Ranlux64Engine::Ranlux64Engine(), CLHEP::RanluxEngine::RanluxEngine(), and CLHEP::RanecuEngine::setSeed().

◆ name()

std::string CLHEP::HepRandom::name ( ) const
virtual

◆ operator()()

double CLHEP::HepRandom::operator() ( )
virtual

◆ put()

std::ostream & CLHEP::HepRandom::put ( std::ostream &  os) const
virtual

◆ restoreDistState()

static std::istream & CLHEP::HepRandom::restoreDistState ( std::istream &  is)
inlinestatic

Definition at line 136 of file Random.h.

136{return is;}

◆ restoreEngineStatus()

void CLHEP::HepRandom::restoreEngineStatus ( const char  filename[] = "Config.conf")
static

Definition at line 283 of file Random.cc.

284{
285 theDefaults().theEngine->restoreStatus( filename );
286}

References CLHEP::anonymous_namespace{Random.cc}::theDefaults(), and CLHEP::anonymous_namespace{Random.cc}::defaults::theEngine.

◆ restoreFullState()

std::istream & CLHEP::HepRandom::restoreFullState ( std::istream &  is)
static

Definition at line 293 of file Random.cc.

293 {
294 is >> *getTheEngine();
295 return is;
296}
static HepRandomEngine * getTheEngine()
Definition: Random.cc:268

Referenced by CLHEP::RandFlat::restoreFullState(), and CLHEP::RandGauss::restoreFullState().

◆ restoreStaticRandomStates()

std::istream & CLHEP::HepRandom::restoreStaticRandomStates ( std::istream &  is)
static

Definition at line 302 of file Random.cc.

302 {
304}
static std::istream & restore(std::istream &is)

References CLHEP::StaticRandomStates::restore().

◆ saveDistState()

static std::ostream & CLHEP::HepRandom::saveDistState ( std::ostream &  os)
inlinestatic

Definition at line 133 of file Random.h.

133{return os;}

◆ saveEngineStatus()

void CLHEP::HepRandom::saveEngineStatus ( const char  filename[] = "Config.conf")
static

◆ saveFullState()

std::ostream & CLHEP::HepRandom::saveFullState ( std::ostream &  os)
static

◆ saveStaticRandomStates()

std::ostream & CLHEP::HepRandom::saveStaticRandomStates ( std::ostream &  os)
static

Definition at line 298 of file Random.cc.

298 {
299 return StaticRandomStates::save(os);
300}
static std::ostream & save(std::ostream &os)

References CLHEP::StaticRandomStates::save().

◆ setTheEngine()

void CLHEP::HepRandom::setTheEngine ( HepRandomEngine theNewEngine)
static

Definition at line 273 of file Random.cc.

274{
275 theDefaults().theEngine.reset( theNewEngine, do_nothing_deleter() );
276}

References CLHEP::anonymous_namespace{Random.cc}::theDefaults(), and CLHEP::anonymous_namespace{Random.cc}::defaults::theEngine.

Referenced by CLHEP::StaticRandomStates::restore().

◆ setTheSeed()

void CLHEP::HepRandom::setTheSeed ( long  seed,
int  lxr = 3 
)
static

Definition at line 234 of file Random.cc.

235{
236 theDefaults().theEngine->setSeed(seed,lux);
237}
static constexpr double lux

References CLHEP::lux, CLHEP::anonymous_namespace{Random.cc}::theDefaults(), and CLHEP::anonymous_namespace{Random.cc}::defaults::theEngine.

◆ setTheSeeds()

void CLHEP::HepRandom::setTheSeeds ( const long *  seeds,
int  aux = -1 
)
static

◆ showEngineStatus()

void CLHEP::HepRandom::showEngineStatus ( )
static

Field Documentation

◆ seedTable

const long CLHEP::HepRandom::seedTable
staticprotected

Definition at line 156 of file Random.h.


The documentation for this class was generated from the following files: