ROOT logo
ROOT » MATH » MATHCORE » TRandom3

class TRandom3: public TRandom


 TRandom3

 Random number generator class based on
   M. Matsumoto and T. Nishimura,
   Mersenne Twistor: A 623-diminsionally equidistributed
   uniform pseudorandom number generator
   ACM Transactions on Modeling and Computer Simulation,
   Vol. 8, No. 1, January 1998, pp 3--30.

 For more information see the Mersenne Twistor homepage
   http://www.math.keio.ac.jp/~matumoto/emt.html

 Advantage: large period 2**19937-1
            relativly fast
              (only two times slower than TRandom, but
               two times faster than TRandom2)
 Drawback:  a relative large internal state of 624 integers


 Aug.99 ROOT implementation based on CLHEP by P.Malzacher

 the original code contains the following copyright notice:
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General
Public License along with this library; if not, write to the
Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307  USA
Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura.
When you use this, send an email to: matumoto@math.keio.ac.jp
with an appropriate reference to your work.

Function Members (Methods)

public:
TRandom3(UInt_t seed = 4357)
TRandom3(const TRandom3&)
virtual~TRandom3()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual Int_tTRandom::Binomial(Int_t ntot, Double_t prob)
virtual Double_tTRandom::BreitWigner(Double_t mean = 0, Double_t gamma = 1)
virtual voidTObject::Browse(TBrowser* b)
virtual voidTRandom::Circle(Double_t& x, Double_t& y, Double_t r)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual Double_tTRandom::Exp(Double_t tau)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Double_tTRandom::Gaus(Double_t mean = 0, Double_t sigma = 1)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual UInt_tTRandom::GetSeed() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
virtual UInt_tTRandom::Integer(UInt_t imax)
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual Double_tTRandom::Landau(Double_t mean = 0, Double_t sigma = 1)
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TRandom3&operator=(const TRandom3&)
virtual voidTObject::Paint(Option_t* option = "")
virtual Int_tTRandom::Poisson(Double_t mean)
virtual Double_tTRandom::PoissonD(Double_t mean)
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual voidTRandom::Rannor(Float_t& a, Float_t& b)
virtual voidTRandom::Rannor(Double_t& a, Double_t& b)
virtual Int_tTObject::Read(const char* name)
virtual voidTRandom::ReadRandom(const char* filename)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual Double_tRndm(Int_t i = 0)
virtual voidRndmArray(Int_t n, Float_t* array)
virtual voidRndmArray(Int_t n, Double_t* array)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetSeed(UInt_t seed = 0)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidTRandom::Sphere(Double_t& x, Double_t& y, Double_t& z, Double_t r)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual Double_tTRandom::Uniform(Double_t x1 = 1)
virtual Double_tTRandom::Uniform(Double_t x1, Double_t x2)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual voidTRandom::WriteRandom(const char* filename)
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

protected:
TStringTNamed::fNameobject identifier
UInt_tTRandom::fSeedRandom number generator seed
TStringTNamed::fTitleobject title
private:
Int_tfCount624
UInt_tfMt[624]

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TRandom3(UInt_t seed)
default constructor*-*-*-*-
 If seed is 0, the seed is automatically computed via a TUUID object.
 In this case the seed is guaranteed to be unique in space and time.
~TRandom3()
default destructor*-*-*-*-
*-*                  ==================
Double_t Rndm(Int_t i = 0)
  Machine independent random number generator.
  Produces uniformly-distributed floating points in ]0,1]
  Method: Mersenne Twistor
void RndmArray(Int_t n, Float_t *array)
 Return an array of n random numbers uniformly distributed in ]0,1]
void RndmArray(Int_t n, Double_t *array)
 Return an array of n random numbers uniformly distributed in ]0,1]
void SetSeed(UInt_t seed = 0)
  Set the random generator sequence
 if seed is 0 (default value) a TUUID is generated and used to fill
 the first 8 integers of the seed array.
 In this case the seed is guaranteed to be unique in space and time.
 Use upgraded seeding procedure to fix a known problem when seeding with values
 with many zero in the bit pattern (like 2**28).
 see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
void Streamer(TBuffer& b)
 Stream an object of class TRandom3.
TRandom3(UInt_t seed=4357)