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 RandPoisson_h
00029 #define RandPoisson_h 1
00030
00031 #include "CLHEP/Random/Random.h"
00032
00037 class RandPoisson : public HepRandom {
00038
00039 public:
00040
00041 inline RandPoisson ( HepRandomEngine& anEngine, double m=1.0 );
00042 inline RandPoisson ( HepRandomEngine* anEngine, double m=1.0 );
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 virtual ~RandPoisson();
00053
00054
00055
00056
00057 static long shoot( double m=1.0 );
00058
00059 static void shootArray ( const int size, long* vect, double m=1.0 );
00060
00061
00062
00063
00064 static long shoot( HepRandomEngine* anEngine, double m=1.0 );
00065
00066 static void shootArray ( HepRandomEngine* anEngine,
00067 const int size, long* vect, double m=1.0 );
00068
00069
00070
00071
00072 long fire();
00073 long fire( double m );
00074
00075 void fireArray ( const int size, long* vect );
00076 void fireArray ( const int size, long* vect, double m);
00077
00078 double operator()();
00079 double operator()( double m );
00080
00081
00082 protected:
00083
00084
00085 RandPoisson(const RandPoisson& d);
00086
00087 const double meanMax;
00088 const double defaultMean;
00089
00090 static double getOldMean() {return oldm_st;}
00091
00092 static double getMaxMean() {return meanMax_st;}
00093
00094 static void setOldMean( double val ){oldm_st = val;}
00095
00096 static double* getPStatus() {return status_st;}
00097
00098 static void setPStatus(double sq, double alxm, double g) {
00099 status_st[0] = sq; status_st[1] = alxm; status_st[2] = g;
00100 }
00101
00102 inline HepRandomEngine* getLocalEngine();
00103
00104 private:
00105
00106 HepRandomEngine* localEngine;
00107 bool deleteEngine;
00108 double status[3], oldm;
00109
00110
00111 static double status_st[3];
00112 static double oldm_st;
00113 static const double meanMax_st;
00114
00115 };
00116
00117 #include "CLHEP/Random/RandPoisson.icc"
00118
00119 #endif