File indexing completed on 2025-01-18 09:54:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef RandGamma_h
0026 #define RandGamma_h 1
0027
0028 #include "CLHEP/Random/defs.h"
0029 #include "CLHEP/Random/Random.h"
0030 #include "CLHEP/Utility/memory.h"
0031
0032 namespace CLHEP {
0033
0034
0035
0036
0037
0038 class RandGamma : public HepRandom {
0039
0040 public:
0041
0042 inline RandGamma ( HepRandomEngine& anEngine, double k=1.0,
0043 double lambda=1.0 );
0044 inline RandGamma ( HepRandomEngine* anEngine, double k=1.0,
0045 double lambda=1.0 );
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 virtual ~RandGamma();
0056
0057
0058
0059
0060 static inline double shoot();
0061
0062 static double shoot( double k, double lambda );
0063
0064 static void shootArray ( const int size, double* vect,
0065 double k=1.0, double lambda=1.0 );
0066
0067
0068
0069
0070 static inline double shoot( HepRandomEngine* anEngine );
0071
0072 static double shoot( HepRandomEngine* anEngine,
0073 double k, double lambda );
0074
0075 static void shootArray ( HepRandomEngine* anEngine, const int size,
0076 double* vect, double k=1.0,
0077 double lambda=1.0 );
0078
0079
0080
0081
0082 inline double fire();
0083
0084 double fire( double k, double lambda );
0085
0086 void fireArray ( const int size, double* vect);
0087 void fireArray ( const int size, double* vect,
0088 double k, double lambda );
0089 inline double operator()();
0090 inline double operator()( double k, double lambda );
0091
0092
0093
0094 std::ostream & put ( std::ostream & os ) const;
0095 std::istream & get ( std::istream & is );
0096
0097 std::string name() const;
0098 HepRandomEngine & engine();
0099
0100 static std::string distributionName() {return "RandGamma";}
0101
0102
0103
0104 private:
0105
0106 static double genGamma( HepRandomEngine *anEngine, double k,
0107 double lambda );
0108
0109 std::shared_ptr<HepRandomEngine> localEngine;
0110 double defaultK;
0111 double defaultLambda;
0112
0113 };
0114
0115 }
0116
0117 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
0118
0119 using namespace CLHEP;
0120 #endif
0121
0122 #include "CLHEP/Random/RandGamma.icc"
0123
0124 #endif