X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliRndm.cxx;h=302d644a1fcc4de17ea9250b78cbefa308e1fb69;hb=277cad1104095e44c585167ea7a3e5ea307725c3;hp=bb02a356fd48779d283b51b196bb6e9861045aac;hpb=65fb704d5a3c40dcad260b5c6ceb87aaa8697172;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliRndm.cxx b/STEER/AliRndm.cxx index bb02a356fd4..302d644a1fc 100644 --- a/STEER/AliRndm.cxx +++ b/STEER/AliRndm.cxx @@ -13,26 +13,53 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -*/ +/* $Id$ */ /////////////////////////////////////////////////////////////////////////////// -// // -// // +// Random number class for AliRoot +// This class allows to have different +// random number generator for different +// elements of AliRoot // +// It also allows saving and retrieving of the random number seeds /////////////////////////////////////////////////////////////////////////////// -#include "TSystem.h" #include "TFile.h" +#include "TError.h" +#include "TRandom3.h" +#include "TSystem.h" #include "AliRndm.h" -#include "TRandom3.h" ClassImp(AliRndm) +//_______________________________________________________________________ +AliRndm::AliRndm(): + fRandom(gRandom) +{ + // + // Default ctor + // +} + +//_______________________________________________________________________ +AliRndm::AliRndm(const AliRndm& rn): + fRandom(gRandom) +{ + // + // Copy constructor + // + rn.Copy(*this); +} + +//_______________________________________________________________________ +void AliRndm::Copy(AliRndm&) const +{ + ::Fatal("Copy","Not implemented\n"); +} + //_____________________________________________________________________________ -void AliRndm::Rndm(Float_t* array, const Int_t size) const +void AliRndm::Rndm(Float_t* array, Int_t size) const { // // Return an array of n random numbers uniformly distributed @@ -46,16 +73,12 @@ void AliRndm::Rndm(Float_t* array, const Int_t size) const #endif } -//_____________________________________________________________________________ -void AliRndm::SetRandom(TRandom *ran) -{ - if(ran) fRandom=ran; - else fRandom=sRandom=gRandom; -} - //_____________________________________________________________________________ void AliRndm::ReadRandom(const char *filename) { + // + // Reads saved random generator status from filename + // char *fntmp = gSystem->ExpandPathName(filename); TFile *file = new TFile(fntmp,"r"); delete [] fntmp; @@ -72,6 +95,9 @@ void AliRndm::ReadRandom(const char *filename) //_____________________________________________________________________________ void AliRndm::WriteRandom(const char *filename) const { + // + // Writes random generator status to filename + // char *fntmp = gSystem->ExpandPathName(filename); TFile *file = new TFile(fntmp,"new"); delete [] fntmp;