CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
CLHEP::HepRandom Class Reference

#include <Random.h>

+ Inheritance diagram for CLHEP::HepRandom:

Public Member Functions

 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)
 
virtual double operator() ()
 
virtual std::string name () const
 
virtual HepRandomEngineengine ()
 
virtual std::ostream & put (std::ostream &os) const
 
virtual std::istream & get (std::istream &is)
 

Static Public Member Functions

static void setTheSeed (long seed, int lxr=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 HepRandomgetTheGenerator ()
 
static void setTheEngine (HepRandomEngine *theNewEngine)
 
static HepRandomEnginegetTheEngine ()
 
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 ()
 

Static Protected Attributes

static const long seedTable [215][2]
 

Detailed Description

Constructor & Destructor Documentation

◆ HepRandom() [1/4]

CLHEP::HepRandom::HepRandom ( )

Definition at line 180 of file Random.cc.

181{ }

◆ HepRandom() [2/4]

CLHEP::HepRandom::HepRandom ( long  seed)

Definition at line 183 of file Random.cc.

184{
185 setTheSeed(seed);
186}
static void setTheSeed(long seed, int lxr=3)
Definition: Random.cc:236

◆ HepRandom() [3/4]

CLHEP::HepRandom::HepRandom ( HepRandomEngine algorithm)

Definition at line 188 of file Random.cc.

189{
190 theDefaults().resetEngine( algorithm );
191}

◆ HepRandom() [4/4]

CLHEP::HepRandom::HepRandom ( HepRandomEngine algorithm)

Definition at line 193 of file Random.cc.

194{
195 theDefaults().resetEngine( algorithm );
196}

◆ ~HepRandom()

CLHEP::HepRandom::~HepRandom ( )
virtual

Definition at line 198 of file Random.cc.

199{ }

Member Function Documentation

◆ createInstance()

int CLHEP::HepRandom::createInstance ( )
static

Definition at line 313 of file Random.cc.

314{
315 return static_cast<int>( theDefaults().ensureInitialized() );
316}

◆ distributionName()

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

Definition at line 153 of file Random.h.

153{return "HepRandomEngine";}

◆ engine()

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

◆ flat() [1/2]

double CLHEP::HepRandom::flat ( )

Definition at line 201 of file Random.cc.

202{
203 return theDefaults().theEngine->flat();
204}

Referenced by CLHEP::RandExponential::shoot().

◆ flat() [2/2]

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

◆ flatArray() [1/2]

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

Definition at line 206 of file Random.cc.

207{
208 theDefaults().theEngine->flatArray(size,vect);
209}

◆ flatArray() [2/2]

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

◆ get()

◆ getTheEngine()

◆ getTheGenerator()

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

Definition at line 265 of file Random.cc.

266{
267 return theDefaults().theGenerator.get();
268}

Referenced by main().

◆ getTheSeed()

long CLHEP::HepRandom::getTheSeed ( )
static

Definition at line 241 of file Random.cc.

242{
243 return theDefaults().theEngine->getSeed();
244}

◆ getTheSeeds()

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

Definition at line 251 of file Random.cc.

252{
253 return theDefaults().theEngine->getSeeds();
254}

◆ getTheTableSeeds()

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

◆ name()

◆ operator()()

◆ put()

◆ restoreDistState()

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

Definition at line 138 of file Random.h.

138{return is;}

◆ restoreEngineStatus()

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

Definition at line 285 of file Random.cc.

286{
287 theDefaults().theEngine->restoreStatus( filename );
288}

Referenced by BrestoreStepX(), and restoreStepX().

◆ restoreFullState()

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

Definition at line 295 of file Random.cc.

295 {
296 is >> *getTheEngine();
297 return is;
298}
static HepRandomEngine * getTheEngine()
Definition: Random.cc:270

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

◆ restoreStaticRandomStates()

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

Definition at line 304 of file Random.cc.

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

◆ saveDistState()

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

Definition at line 135 of file Random.h.

135{return os;}

◆ saveEngineStatus()

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

Definition at line 280 of file Random.cc.

281{
282 theDefaults().theEngine->saveStatus( filename );
283}

Referenced by BsaveStepX(), and saveStepX().

◆ saveFullState()

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

Definition at line 290 of file Random.cc.

290 {
291 os << *getTheEngine();
292 return os;
293}

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

◆ saveStaticRandomStates()

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

Definition at line 300 of file Random.cc.

300 {
301 return StaticRandomStates::save(os);
302}
static std::ostream & save(std::ostream &os)

◆ setTheEngine()

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

Definition at line 275 of file Random.cc.

276{
277 theDefaults().theEngine.reset( theNewEngine, do_nothing_deleter() );
278}

Referenced by anonymousRestoreStatics(), anonymousRestoreStatics1(), main(), CLHEP::StaticRandomStates::restore(), start_test(), and testRandGauss().

◆ setTheSeed()

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

Definition at line 236 of file Random.cc.

237{
238 theDefaults().theEngine->setSeed(seed,lux);
239}

Referenced by diagmatrix_test(), main(), matrix_test(), symmatrix_test(), useSeed(), and vector_test().

◆ setTheSeeds()

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

Definition at line 246 of file Random.cc.

247{
248 theDefaults().theEngine->setSeeds(seeds,aux);
249}

◆ showEngineStatus()

void CLHEP::HepRandom::showEngineStatus ( )
static

Definition at line 308 of file Random.cc.

309{
310 theDefaults().theEngine->showStatus();
311}

Member Data Documentation

◆ seedTable

const long CLHEP::HepRandom::seedTable
staticprotected

Definition at line 158 of file Random.h.


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