1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtGen/EvtRandom.hh
13 // Description:Class to generate random numbers. Single member
14 // function random is expected to return a random
15 // number in the range ]0..1[.
17 // Modification history:
19 // RYD December 25, 1999 Module created
20 // RYD October 2, 2006 Converted to a pure interface class
22 //------------------------------------------------------------------------
24 #ifndef EVTRANDOMENGINE_HH
25 #define EVTRANDOMENGINE_HH
29 class EvtRandomEngine{
33 virtual ~EvtRandomEngine() {};
35 virtual double random()=0;
41 //define class for generating random numbers (I put this in place of the commented part)
42 class EvtNUMRandomEngine:public EvtRandomEngine{
44 double random(){return gRandom->Rndm();}
48 //old lines: those are in the macro testEvtGen.cc
50 //define class for generating random numbers
51 class EvtCLHEPRandomEngine:public EvtRandomEngine{
56 #ifdef NOCLHEPNAMESPACE
58 typedef HepJamesRandom HepJamesRandom ;
62 double EvtCLHEPRandomEngine::random(){
63 static CLHEP::HepJamesRandom randengine;
64 return randengine.flat();