]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TEvtGen/EvtGenBase/EvtStdlibRandomEngine.hh
Updates EvtGen Code
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtStdlibRandomEngine.hh
index b9c69a3d7c75d0e308fd83e222df1f644229e091..e42f3f66b0c4a1085598a0f26f990963bd4c7827 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
  * Project: BaBar detector at the SLAC PEP-II B-factory
  * Package: EvtGenBase
- *    File: $Id: EvtStdlibRandomEngine.hh,v 1.1 2003/06/29 06:01:29 dvoretsk Exp $
+ *    File: $Id: EvtStdlibRandomEngine.hh,v 1.2 2009-03-16 16:39:15 robbep Exp $
  *  Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
  *
  * Copyright (C) 2002 Caltech
@@ -15,6 +15,7 @@
 #define EVT_STDLIB_RANDOM_ENGINE_HH
 
 #include <stdlib.h>
+#include <TRandom.h>
 #include "EvtGenBase/EvtRandomEngine.hh"
 
 class EvtStdlibRandomEngine : public EvtRandomEngine {
@@ -22,14 +23,16 @@ public:
   
   void setSeed(unsigned int seed)
   {
-    srand(seed);
+    //srand(seed);
+    gRandom->SetSeed(seed);
   }
   
   virtual double random()
   {
-    double x = rand();
+    /*double x = rand();
     double y = RAND_MAX;
-    return x/y;
+    return x/y;*/
+    return gRandom->Rndm();
   }
 };