/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/BesEvtGen/BesEvtGen-00-03-58/src/EvtGen/EvtGenBase/EvtStdlibRandomEngine.hh

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Project: BaBar detector at the SLAC PEP-II B-factory
00003  * Package: EvtGenBase
00004  *    File: $Id: EvtStdlibRandomEngine.hh,v 1.1.1.2 2007/10/26 05:03:14 pingrg Exp $
00005  *  Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
00006  *
00007  * Copyright (C) 2002 Caltech
00008  *******************************************************************************/
00009 
00010 /*
00011  * Interface to stdlib's random number generator
00012  */
00013                       
00014 #ifndef EVT_STDLIB_RANDOM_ENGINE_HH
00015 #define EVT_STDLIB_RANDOM_ENGINE_HH
00016 
00017 #include <stdlib.h>
00018 #include "EvtGenBase/EvtRandomEngine.hh"
00019 
00020 class EvtStdlibRandomEngine : public EvtRandomEngine {
00021 public:
00022   
00023   void setSeed(unsigned int seed)
00024   {
00025     srand(seed);
00026   }
00027   
00028   virtual double random()
00029   {
00030     double x = rand();
00031     double y = RAND_MAX;
00032     return x/y;
00033   }
00034 };
00035 
00036 #endif
00037 
00038 

Generated on Tue Nov 29 23:12:15 2016 for BOSS_7.0.2 by  doxygen 1.4.7