/////////////////////////////////////////////////////////////////////// // // Provides a ROOT random number generator replacement. Only the geant4 // (read CLHEP) random number generator should be used in RAT, this // subclasses the root TRandom class and replacing it with calls to the // geant4 RNG. // // Author: P G Jones // Author: S D Biller -- contact person // // REVISION HISTORY: // 05/03/2013 : P G Jones - New File. // /////////////////////////////////////////////////////////////////////// #ifndef __RAT_Random__ #define __RAT_Random__ #include #include namespace RAT { class Random : public TRandom { public: // Override the random number generator virtual Double_t Rndm(Int_t) { return G4UniformRand(); } inline virtual void RndmArray(Int_t n, Float_t *array); inline virtual void RndmArray(Int_t n, Double_t *array); }; void Random::RndmArray(Int_t n, Float_t *array) { for( int i = 0; i < n; i++ ) array[i] = Rndm(i); } void Random::RndmArray(Int_t n, Double_t *array) { for( int i = 0; i < n; i++ ) array[i] = Rndm(i); } } // namespace RAT #endif