GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Gw::Random Class Reference

To change the internal GammaWare random generator. More...

#include <Random.h>

Public Member Functions

void Add (const char *, TRandom *)
 Add a new TRandomom object to the list. More...
 
 ClassDef (Random, 0)
 rootcint dictionary More...
 
TRandom * Current () const
 to get the current TRandomom object More...
 
void SetCurrent (const char *name="basic")
 to set the current TRandomom object More...
 
virtual ~Random ()
 

Static Public Member Functions

static RandomInstance ()
 to access the unique instance More...
 

Detailed Description

To change the internal GammaWare random generator.

Any classes of the GammaWare that relies on random numbers use the Random object. It is a unique object (singleton) and was introduced because gRandomom (the ROOT global pointer to a TRandomom object) is not protected and might be NULL. To get the single instance, see Random::Instance()
Random is in fact a collection of TRandomom objects. It proposes the Current() method that returns a global TRandomom object that always exists.
Several different TRandomom objects are available through this class and the current one can be changed by using the SetCurrent method. Each random generator has a unique name and six are defined by default:

  • basic
    corresponds to a TRandomom object with a seed = 65539 Periodicity = 10**8
  • basic_clock
    corresponds to a TRandomom object with a seed based on the clock Periodicity = 10**8
  • medium
    corresponds to a TRandomom2 object with a seed = 65539 Periodicity > 10**14
  • medium_clock
    corresponds to a TRandomom2 object with a seed based on the clock Periodicity > 10**14
  • large
    corresponds to a TRandomom3 object with a seed = 65539 Periodicity = 2**19937-1
  • large_clock
    corresponds to a TRandomom3 object with a seed based on the clock Periodicity = 2**19937-1

See ROOT documentation for more explanations about the different TRandomom implementations.

It is also possible to add new random generator (see Random::Add()). It also synchronize gRandomom with the current generator. gRandomom is restored once this is deleted.

Author
Olivier Stezowski

Definition at line 64 of file Random.h.


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