TRandom.h

Go to the documentation of this file.
00001 // @(#)root/mathcore:$Id: TRandom.h 32526 2010-03-10 14:56:13Z moneta $
00002 // Author: Rene Brun   15/12/95
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TRandom
00013 #define ROOT_TRandom
00014 
00015 
00016 
00017 //////////////////////////////////////////////////////////////////////////
00018 //                                                                      //
00019 // TRandom                                                              //
00020 //                                                                      //
00021 // Simple prototype random number generator class (periodicity = 10**9) //
00022 //                                                                      //
00023 //////////////////////////////////////////////////////////////////////////
00024 
00025 #ifndef ROOT_TNamed
00026 #include "TNamed.h"
00027 #endif
00028 
00029 class TRandom : public TNamed {
00030 
00031 protected:
00032    UInt_t   fSeed;  //Random number generator seed
00033 
00034 public:
00035    TRandom(UInt_t seed=65539);
00036    virtual ~TRandom();
00037    virtual  Int_t    Binomial(Int_t ntot, Double_t prob);
00038    virtual  Double_t BreitWigner(Double_t mean=0, Double_t gamma=1);
00039    virtual  void     Circle(Double_t &x, Double_t &y, Double_t r);
00040    virtual  Double_t Exp(Double_t tau);
00041    virtual  Double_t Gaus(Double_t mean=0, Double_t sigma=1);
00042    virtual  UInt_t   GetSeed() const {return fSeed;}
00043    virtual  UInt_t   Integer(UInt_t imax);
00044    virtual  Double_t Landau(Double_t mean=0, Double_t sigma=1);
00045    virtual  Int_t    Poisson(Double_t mean);
00046    virtual  Double_t PoissonD(Double_t mean);
00047    virtual  void     Rannor(Float_t &a, Float_t &b);
00048    virtual  void     Rannor(Double_t &a, Double_t &b);
00049    virtual  void     ReadRandom(const char *filename);
00050    virtual  void     SetSeed(UInt_t seed=0);
00051    virtual  Double_t Rndm(Int_t i=0);
00052    virtual  void     RndmArray(Int_t n, Float_t *array);
00053    virtual  void     RndmArray(Int_t n, Double_t *array);
00054    virtual  void     Sphere(Double_t &x, Double_t &y, Double_t &z, Double_t r);
00055    virtual  Double_t Uniform(Double_t x1=1);
00056    virtual  Double_t Uniform(Double_t x1, Double_t x2);
00057    virtual  void     WriteRandom(const char *filename);
00058 
00059    ClassDef(TRandom,1)  //Simple Random number generator (periodicity = 10**9)
00060 };
00061 
00062 R__EXTERN TRandom *gRandom;
00063 
00064 #endif

Generated on Tue Jul 5 14:28:08 2011 for ROOT_528-00b_version by  doxygen 1.5.1