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

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 //
00003 // Environment:
00004 //      This software is part of the EvtGen package developed jointly
00005 //      for the BaBar and CLEO collaborations.  If you use all or part
00006 //      of it, please give an appropriate acknowledgement.
00007 //
00008 // Copyright Information: See EvtGen/COPYRIGHT
00009 //      Copyright (C) 1998      Caltech, UCSB
00010 //
00011 // Module: EvtRandomEngine.cc
00012 //
00013 // Description: routines to generate random numbers
00014 //              really trivial random number 
00015 //              implementation.
00016 //
00017 // Modification history:
00018 //
00019 //    RYD      December 25, 1999           Module created
00020 //
00021 //------------------------------------------------------------------------
00022 //
00023 #include "EvtGenBase/EvtPatches.hh"
00024 
00025 
00026 #include <stdio.h>
00027 #include <math.h>
00028 #include <iostream>
00029 #include "EvtGenBase/EvtRandomEngine.hh"
00030 
00031 double EvtRandomEngine::random(){
00032   
00033   static unsigned long int next = 1;
00034 
00035   next=next*1103515245+123345;
00036   unsigned temp=(unsigned)(next/65536) % 32768;
00037   
00038   return ( temp + 1.0 ) / 32769.0;
00039 
00040 }
00041 
00042 
00043 

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