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 **************************************************************************/
20 #include "AliAmptRndm.h"
22 TRandom * AliAmptRndm::fgAmptRandom=0;
26 //_______________________________________________________________________
27 void AliAmptRndm::SetAmptRandom(TRandom *ran) {
29 // Sets the pointer to an existing random numbers generator
31 if(ran) fgAmptRandom=ran;
32 else fgAmptRandom=gRandom;
35 //_______________________________________________________________________
36 TRandom * AliAmptRndm::GetAmptRandom() {
38 // Retrieves the pointer to the random numbers generator
43 //_______________________________________________________________________
44 # define rluget_ampt rluget_ampt_
45 # define rluset_ampt rluset_ampt_
46 # define rlu_ampt rlu_ampt_
47 # define ranart ranart_
52 void rluget_ampt(Int_t & /*lfn*/, Int_t & /*move*/)
53 {printf("Dummy version of rluget_ampt reached\n");}
55 void rluset_ampt(Int_t & /*lfn*/, Int_t & /*move*/)
56 {printf("Dummy version of rluset_ampt reached\n");}
58 Float_t rlu_ampt(Int_t & /*idum*/)
60 // Wrapper to FINCTION RLU_AMPT from AMPT
61 // Uses static method to retrieve the pointer to the (C++) generator
63 do r=AliAmptRndm::GetAmptRandom()->Rndm();
64 while(0 >= r || r >= 1);
68 Float_t ranart(Int_t &idum)
70 return rlu_ampt(idum);
73 Float_t ran1(Int_t &idum)
75 return rlu_ampt(idum);
78 Float_t rlu(Int_t &idum)
80 return rlu_ampt(idum);