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 Random * | Instance () |
to access the unique instance More... | |
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:
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.