00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef RandGauss_h
00029 #define RandGauss_h 1
00030
00031 #include "CLHEP/Random/Random.h"
00032
00037 class RandGauss : public HepRandom {
00038
00039 public:
00040
00041 inline RandGauss ( HepRandomEngine& anEngine, double mean=0.0,
00042 double stdDev=1.0 );
00043 inline RandGauss ( HepRandomEngine* anEngine, double mean=0.0,
00044 double stdDev=1.0 );
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 virtual ~RandGauss();
00055
00056
00057
00058
00059 static double shoot();
00060
00061 static inline double shoot( double mean, double stdDev );
00062
00063 static void shootArray ( const int size, double* vect,
00064 double mean=0.0, double stdDev=1.0 );
00065
00066
00067
00068
00069 static double shoot( HepRandomEngine* anEngine );
00070
00071 static inline double shoot( HepRandomEngine* anEngine,
00072 double mean, double stdDev );
00073
00074 static void shootArray ( HepRandomEngine* anEngine, const int size,
00075 double* vect, double mean=0.0,
00076 double stdDev=1.0 );
00077
00078
00079
00080
00081 double fire();
00082
00083 inline double fire( double mean, double stdDev );
00084
00085 void fireArray ( const int size, double* vect);
00086 void fireArray ( const int size, double* vect,
00087 double mean, double stdDev );
00088
00089 virtual double operator()();
00090 virtual double operator()( double mean, double stdDev );
00091
00092
00093
00094
00095
00096 static bool getFlag() {return set_st;}
00097
00098 static void setFlag( bool val ) {set_st = val;}
00099
00100 bool getF() const {return set;}
00101
00102 void setF( bool val ) {set = val;}
00103
00104
00105
00106
00107
00108
00109 static void saveEngineStatus( const char filename[] = "Config.conf" );
00110
00111
00112 static void restoreEngineStatus( const char filename[] = "Config.conf" );
00113
00114
00115
00116 protected:
00117
00118
00119 RandGauss(const RandGauss& d);
00120
00121 static double getVal() {return nextGauss_st;}
00122
00123 static void setVal( double nextVal ) {nextGauss_st = nextVal;}
00124
00125 double normal();
00126
00127 const double defaultMean;
00128 const double defaultStdDev;
00129
00130 private:
00131
00132 HepRandomEngine* localEngine;
00133 bool deleteEngine, set;
00134 double nextGauss;
00135
00136
00137 static bool set_st;
00138 static double nextGauss_st;
00139
00140 };
00141
00142 #include "CLHEP/Random/RandGauss.icc"
00143
00144 #endif