A bug concerning the calculation of the track length and time-of-flight hypotheses...
[u/mrichter/AliRoot.git] / STEER / AliRndm.h
CommitLineData
65fb704d 1#ifndef ALIRNDM_H
2#define ALIRNDM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8///////////////////////////////////////////////////////////////////////////////
9// //
10// Random Number Interface //
11// //
12///////////////////////////////////////////////////////////////////////////////
13
14#include <TRandom.h>
15
16static TRandom *sRandom;
17
18class AliRndm
19{
20public:
e2afb3b6 21 AliRndm();
116cbefd 22 AliRndm(const AliRndm &rnd);
65fb704d 23 virtual ~AliRndm() {fRandom=sRandom=0;}
e2afb3b6 24 AliRndm & operator=(const AliRndm& rn)
25 {rn.Copy(*this); return (*this);}
65fb704d 26
27 // Random number generator bit
3e54283a 28 virtual void SetRandom(TRandom *ran=0)
ea5c7dc0 29 {if(ran) fRandom=sRandom=ran;
3e54283a 30 else fRandom=sRandom=gRandom;}
31
65fb704d 32 virtual TRandom* GetRandom() const {return fRandom;}
33 virtual void Rndm(Float_t* array, const Int_t size) const;
34#ifdef CKNONE
35 virtual Float_t Rndm() const {return fRandom->Rndm();}
36#else
37 virtual Float_t Rndm() const {
38 Float_t r;
39 do r=fRandom->Rndm(); while(0>=r || r>=1); return r;}
40#endif
41 virtual void WriteRandom(const char *filename) const;
42 virtual void ReadRandom(const char *filename);
43
e2afb3b6 44protected:
65fb704d 45 TRandom *fRandom; // Pointer to the random number generator
46
e2afb3b6 47private:
48 void Copy(AliRndm &rn) const;
65fb704d 49
50 ClassDef(AliRndm,1) //Random Number generator wrapper
51};
52
53#endif
54