]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TEvtGen/EvtGen/EvtGenBase/EvtSimpleRandomEngine.cpp
Converting TEvtGen to native cmake
[u/mrichter/AliRoot.git] / TEvtGen / EvtGen / EvtGenBase / EvtSimpleRandomEngine.cpp
diff --git a/TEvtGen/EvtGen/EvtGenBase/EvtSimpleRandomEngine.cpp b/TEvtGen/EvtGen/EvtGenBase/EvtSimpleRandomEngine.cpp
new file mode 100644 (file)
index 0000000..2c3a6ac
--- /dev/null
@@ -0,0 +1,41 @@
+//--------------------------------------------------------------------------
+//
+// Environment:
+//      This software is part of the EvtGen package developed jointly
+//      for the BaBar and CLEO collaborations.  If you use all or part
+//      of it, please give an appropriate acknowledgement.
+//
+// Copyright Information: See EvtGen/COPYRIGHT
+//      Copyright (C) 1998      Caltech, UCSB
+//
+// Module: EvtRandomEngine.cc
+//
+// Description: routines to generate random numbers
+//              really trivial random number 
+//              implementation.
+//
+// Modification history:
+//
+//    RYD      December 25, 1999           Module created
+//
+//------------------------------------------------------------------------
+//
+#include "EvtGenBase/EvtPatches.hh"
+
+
+#include <stdio.h>
+#include <math.h>
+#include <iostream>
+#include "EvtGenBase/EvtSimpleRandomEngine.hh"
+
+double EvtSimpleRandomEngine::random(){
+  
+  _next=_next*1103515245+123345;
+  unsigned temp=(unsigned)(_next/65536) % 32768;
+  
+  return ( temp + 1.0 ) / 32769.0;
+
+}
+
+
+