1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.3 2000/12/21 15:30:18 fca
19 Correcting coding convention violations
21 Revision 1.2 2000/12/01 08:40:48 alibrary
22 Correction of a small bug - sRandom can be used now
24 Revision 1.1 2000/11/30 07:12:48 alibrary
25 Introducing new Rndm and QA classes
29 ///////////////////////////////////////////////////////////////////////////////
32 ///////////////////////////////////////////////////////////////////////////////
43 //_______________________________________________________________________
53 //_______________________________________________________________________
54 AliRndm::AliRndm(const AliRndm& rn):
63 //_______________________________________________________________________
64 void AliRndm::Copy(AliRndm&) const
66 ::Fatal("Copy","Not implemented\n");
70 //_____________________________________________________________________________
71 void AliRndm::Rndm(Float_t* array, const Int_t size) const
74 // Return an array of n random numbers uniformly distributed
75 // between 0 and 1 not included
77 for(Int_t i=0; i<size; i++)
79 array[i]=fRandom->Rndm();
81 do array[i]=fRandom->Rndm(); while(0>=array[i] || array[i]>=1);
85 //_____________________________________________________________________________
86 void AliRndm::ReadRandom(const char *filename)
89 // Reads saved random generator status from filename
91 char *fntmp = gSystem->ExpandPathName(filename);
92 TFile *file = new TFile(fntmp,"r");
95 printf("AliRndm:: Could not open file %s\n",filename);
97 if(!fRandom) fRandom = new TRandom();
98 fRandom->Read("Random");
104 //_____________________________________________________________________________
105 void AliRndm::WriteRandom(const char *filename) const
108 // Writes random generator status to filename
110 char *fntmp = gSystem->ExpandPathName(filename);
111 TFile *file = new TFile(fntmp,"new");
114 printf("AliRndm:: Could not open file %s\n",filename);