Introducing new Rndm and QA classes
[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:
21 AliRndm() {SetRandom();}
22 virtual ~AliRndm() {fRandom=sRandom=0;}
23
24 // Random number generator bit
25 virtual void SetRandom(TRandom *ran=0);
26 virtual TRandom* GetRandom() const {return fRandom;}
27 virtual void Rndm(Float_t* array, const Int_t size) const;
28#ifdef CKNONE
29 virtual Float_t Rndm() const {return fRandom->Rndm();}
30#else
31 virtual Float_t Rndm() const {
32 Float_t r;
33 do r=fRandom->Rndm(); while(0>=r || r>=1); return r;}
34#endif
35 virtual void WriteRandom(const char *filename) const;
36 virtual void ReadRandom(const char *filename);
37
38 protected:
39 TRandom *fRandom; // Pointer to the random number generator
40
41 private:
42 AliRndm(const AliRndm &) {}
43 AliRndm & operator=(const AliRndm &) {return (*this);}
44
45 ClassDef(AliRndm,1) //Random Number generator wrapper
46};
47
48#endif
49