]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtStdlibRandomEngine.hh
New plots for trending injector efficiencies (Melinda)
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtStdlibRandomEngine.hh
1 /*******************************************************************************
2  * Project: BaBar detector at the SLAC PEP-II B-factory
3  * Package: EvtGenBase
4  *    File: $Id: EvtStdlibRandomEngine.hh,v 1.1 2003/06/29 06:01:29 dvoretsk Exp $
5  *  Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
6  *
7  * Copyright (C) 2002 Caltech
8  *******************************************************************************/
9
10 /*
11  * Interface to stdlib's random number generator
12  */
13                       
14 #ifndef EVT_STDLIB_RANDOM_ENGINE_HH
15 #define EVT_STDLIB_RANDOM_ENGINE_HH
16
17 #include <stdlib.h>
18 #include "EvtGenBase/EvtRandomEngine.hh"
19
20 class EvtStdlibRandomEngine : public EvtRandomEngine {
21 public:
22   
23   void setSeed(unsigned int seed)
24   {
25     srand(seed);
26   }
27   
28   virtual double random()
29   {
30     double x = rand();
31     double y = RAND_MAX;
32     return x/y;
33   }
34 };
35
36 #endif
37
38