00001 /*************************************************************************** 00002 * 00003 * $Id: RanecuEngine.h,v 1.2 1999/12/07 23:43:04 ullrich Exp $ 00004 * 00005 * Author: Gabriele Cosmo - Created: 2nd February 1996 00006 * modified for SCL bl 00007 *************************************************************************** 00008 * 00009 * Description: 00010 * RanecuEngine.h,v 1.5 1997/10/16 20:40:27 00011 * ----------------------------------------------------------------------- 00012 * HEP Random 00013 * --- RanecuEngine --- 00014 * class header file 00015 * ----------------------------------------------------------------------- 00016 * This file is part of Geant4 (simulation toolkit for HEP). 00017 * 00018 * RANECU Random Engine - algorithm originally written in FORTRAN77 00019 * as part of the MATHLIB HEP library. 00020 * Seeds are taken from SeedTable given an index, the getSeed() method 00021 * returns the current index of SeedTable, while the getSeeds() method 00022 * returns a pointer to the local table of seeds at the current index. 00023 * 00024 *************************************************************************** 00025 * 00026 * $Log: RanecuEngine.h,v $ 00027 * Revision 1.2 1999/12/07 23:43:04 ullrich 00028 * Modified to get rid of warnings on Linux. 00029 * 00030 * Revision 1.1 1999/01/30 03:59:01 fisyak 00031 * Root Version of StarClassLibrary 00032 * 00033 * Revision 1.1 1999/01/23 00:27:43 ullrich 00034 * Initial Revision 00035 * 00036 **************************************************************************/ 00037 00038 #ifndef RanecuEngine_h 00039 #define RanecuEngine_h 1 00040 00041 #include "RandomEngine.h" 00042 00043 class RanecuEngine : public HepRandomEngine { 00044 00045 public: 00046 00047 RanecuEngine(HepInt index=0); 00048 ~RanecuEngine(); 00049 // Constructor and destructor. 00050 00051 RanecuEngine(const RanecuEngine &p); 00052 // Copy constructor 00053 00054 RanecuEngine & operator = (const RanecuEngine &p); 00055 // Overloaded assignment operator, to retrieve the engine status. 00056 00057 HepDouble flat(); 00058 // Returns a pseudo random number between 0 and 1 00059 // (excluding the end points) 00060 00061 void flatArray (const HepInt size, HepDouble* vect); 00062 #ifndef ST_NO_TEMPLATE_DEF_ARGS 00063 void flatArray (vector<HepDouble>&); 00064 #else 00065 void flatArray (vector<HepDouble, allocator<HepDouble> >&); 00066 #endif 00067 // Fills an array "vect" of specified size with flat random values. 00068 00069 void setSeed (long index, HepInt dum=0); 00070 // Sets the state of the algorithm according to "index", the position 00071 // in the table of seeds. 00072 00073 void setSeeds (const long* seeds, HepInt index=-1); 00074 // Sets the state of the algorithm according to the array of seeds 00075 // "seeds" containing two seed values to be stored in the table at 00076 // "index" position. 00077 00078 void saveStatus() const; 00079 // Saves on file Ranecu.conf the current engine status. 00080 00081 void restoreStatus(); 00082 // Reads from file Ranecu.conf the last saved engine status 00083 // and restores it. 00084 00085 void showStatus() const; 00086 // Dumps the engine status on the screen. 00087 00088 private: 00089 00090 // Members defining the current state of the generator. 00091 00092 long table[215][2]; 00093 HepInt seq; 00094 const HepInt ecuyer_a, ecuyer_b, ecuyer_c, ecuyer_d, ecuyer_e, ecuyer_f; 00095 const HepInt shift1, shift2; 00096 const HepInt maxSeq; 00097 const HepDouble prec; 00098 00099 }; 00100 00101 #endif
1.5.9