Logo ROOT  
Reference Guide
TRandom1.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: Rene Brun 04/03/99
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TRandom1
13 #define ROOT_TRandom1
14 
15 
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TRandom1 //
20 // //
21 // Ranlux random number generator class (periodicity > 10**14) //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TRandom.h"
26 
27 class TRandom1 : public TRandom {
28 
29 protected:
39  static Int_t fgMaxIndex;
40  const UInt_t *fTheSeeds;
43 
44 public:
45  TRandom1();
46  TRandom1(UInt_t seed, Int_t lux = 3 );
47  TRandom1(Int_t rowIndex, Int_t colIndex, Int_t lux );
48  virtual ~TRandom1();
49  virtual Int_t GetLuxury() const {return fLuxury;}
50  // Get the current seed (first element of the table)
51  virtual UInt_t GetSeed() const { return UInt_t ( fFloatSeedTable[0] / fMantissaBit24 ) ; }
52  // Gets the current seed.
53  const UInt_t *GetTheSeeds() const {return fTheSeeds;}
54  // Gets the current array of seeds.
55  static void GetTableSeeds(UInt_t* seeds, Int_t index);
56  // Gets back seed values stored in the table, given the index.
57  using TRandom::Rndm;
58  virtual Double_t Rndm( );
59  virtual void RndmArray(Int_t size, Float_t *vect);
60  virtual void RndmArray(Int_t size, Double_t *vect);
61  virtual void SetSeed2(UInt_t seed, Int_t lux=3);
62  // Sets the state of the algorithm according to seed.
63  virtual void SetSeeds(const UInt_t * seeds, Int_t lux=3);
64  // Sets the state of the algorithm according to the zero terminated
65  // array of seeds. Only the first seed is used.
66  virtual void SetSeed(ULong_t seed);
67 
68  ClassDef(TRandom1,1) //Ranlux Random number generators with periodicity > 10**14
69 };
70 
72 
73 #endif
TRandom1::fNskip
Int_t fNskip
Definition: TRandom1.h:30
TRandom1::RndmArray
virtual void RndmArray(Int_t size, Float_t *vect)
return an array of random numbers in ]0,1]
Definition: TRandom1.cxx:413
TRandom1::fCarry
Float_t fCarry
Definition: TRandom1.h:36
TRandom1::fLuxury
Int_t fLuxury
Definition: TRandom1.h:31
TRandom1::Rndm
virtual Double_t Rndm()
return a random number in ]0,1]
Definition: TRandom1.cxx:360
TRandom1::SetSeeds
virtual void SetSeeds(const UInt_t *seeds, Int_t lux=3)
Set the state of the generator providing an array of seeds The array of seeds can be of size 24 or le...
Definition: TRandom1.cxx:487
TRandom1::~TRandom1
virtual ~TRandom1()
destructor
Definition: TRandom1.cxx:341
TGeant4Unit::lux
static constexpr double lux
Definition: TGeant4SystemOfUnits.h:320
TRandom.h
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
TRandom1::fMantissaBit12
const Double_t fMantissaBit12
Definition: TRandom1.h:42
TRandom1::fMantissaBit24
const Double_t fMantissaBit24
Definition: TRandom1.h:41
TRandom1::fTheSeeds
const UInt_t * fTheSeeds
Definition: TRandom1.h:40
TRandom1::TRandom1
TRandom1()
default constructor
Definition: TRandom1.cxx:287
TRandom
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
TRandom1::fCount24
Int_t fCount24
Definition: TRandom1.h:34
gRandom
R__EXTERN TRandom * gRandom
Definition: TRandom1.h:71
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TRandom1::fgNumEngines
static Int_t fgNumEngines
Definition: TRandom1.h:38
TRandom::Rndm
virtual Double_t Rndm()
Machine independent random number generator.
Definition: TRandom.cxx:541
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TRandom1::fFloatSeedTable
Float_t fFloatSeedTable[24]
Definition: TRandom1.h:35
TRandom1::GetSeed
virtual UInt_t GetSeed() const
Definition: TRandom1.h:51
unsigned int
Double_t
double Double_t
Definition: RtypesCore.h:59
TRandom1::fIlag
Int_t fIlag
Definition: TRandom1.h:32
TRandom1::fJlag
Int_t fJlag
Definition: TRandom1.h:33
TRandom1::GetLuxury
virtual Int_t GetLuxury() const
Definition: TRandom1.h:49
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TRandom1
The Ranlux Random number generator class.
Definition: TRandom1.h:27
TRandom1::GetTableSeeds
static void GetTableSeeds(UInt_t *seeds, Int_t index)
static function returning the table of seeds
Definition: TRandom1.cxx:348
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
TRandom1::SetSeed
virtual void SetSeed(ULong_t seed)
Set the state of the generator providing a single seed value and using the luxury level defined when ...
Definition: TRandom1.cxx:598
TRandom1::GetTheSeeds
const UInt_t * GetTheSeeds() const
Definition: TRandom1.h:53
TRandom1::fgMaxIndex
static Int_t fgMaxIndex
Definition: TRandom1.h:39
TRandom1::fIntModulus
const Int_t fIntModulus
Definition: TRandom1.h:37
TRandom1::SetSeed2
virtual void SetSeed2(UInt_t seed, Int_t lux=3)
Set the state of the generator providing a single seed value and a luxury level.
Definition: TRandom1.cxx:568
int