17 #ifndef ROOT_Math_GSLRandomFunctions
18 #define ROOT_Math_GSLRandomFunctions
40 template <
class EngineType >
55 double GausZig(
double mean,
double sigma) {
56 return Engine().GaussianZig(sigma) + mean;
66 double Gaus(
double mean = 0,
double sigma = 1) {
67 return mean + Engine().GaussianZig(sigma);
73 double GausBM(
double mean = 0,
double sigma = 1) {
74 return mean + Engine().Gaussian(sigma);
80 double GausR(
double mean = 0,
double sigma = 1) {
81 return mean + Engine().GaussianRatio(sigma);
88 return Engine().GaussianTail(a,sigma);
94 void Gaussian2D(
double sigmaX,
double sigmaY,
double rho,
double &
x,
double &
y) {
95 Engine().Gaussian2D(sigmaX, sigmaY, rho, x, y);
102 return Engine().Exponential(tau);
108 return mean + Engine().Cauchy(
gamma/2.0 );
114 double Landau(
double mean = 0,
double sigma = 1) {
115 return mean + sigma*Engine().Landau();
122 return Engine().Gamma(a,b);
129 return Engine().LogNormal(zeta,sigma);
136 return Engine().ChiSquare(nu);
142 double FDist(
double nu1,
double nu2) {
143 return Engine().FDist(nu1,nu2);
150 return Engine().tDist(nu);
165 void Sphere(
double &
x,
double &
y,
double &z,
double r = 1) {
166 Engine().Dir3D(x,y,z);
176 return Engine().Poisson(mu);
182 unsigned int Binomial(
unsigned int ntot,
double prob) {
183 return Engine().Binomial(prob,ntot);
192 return Engine().NegativeBinomial(prob,n);
198 std::vector<unsigned int>
Multinomial(
unsigned int ntot,
const std::vector<double> & p ) {
199 return Engine().Multinomial(ntot,p);
unsigned int NegativeBinomial(double n, double prob)
Negative Binomial distribution First parameter is n, second is probability To be consistent with Rand...
double LogNormal(double zeta, double sigma)
Log Normal distribution.
double BreitWigner(double mean=0., double gamma=1)
Breit Wigner distribution.
double Exp(double tau)
Exponential distribution.
Namespace for new ROOT classes and functions.
double GausZig(double mean, double sigma)
double Gaus(double mean=0, double sigma=1)
Gaussian distribution.
void Gaussian2D(double sigmaX, double sigmaY, double rho, double &x, double &y)
Bivariate Gaussian distribution with correlation.
double ChiSquare(double nu)
Chi square distribution.
GSLRandomEngine Base class for all GSL random engines, normally user instantiate the derived classes ...
double GausBM(double mean=0, double sigma=1)
Gaussian distribution (Box-Muller method)
double Gamma(double a, double b)
Gamma distribution.
double Landau(double mean=0, double sigma=1)
Landau distribution.
double tDist(double nu)
t student distribution
void Sphere(double &x, double &y, double &z, double r=1)
generate random numbers in a 3D sphere of radious 1
void Circle(double &x, double &y, double r=1)
generate random numbers in a 2D circle of radious 1
double FDist(double nu1, double nu2)
F distrbution.
double GausR(double mean=0, double sigma=1)
Gaussian distribution (Ratio Method)
unsigned int Binomial(unsigned int ntot, double prob)
Binomial distribution.
std::vector< unsigned int > Multinomial(unsigned int ntot, const std::vector< double > &p)
Multinomial distribution.
unsigned int Poisson(double mu)
Poisson distribution.
Namespace for new Math classes and functions.
double GaussianTail(double a, double sigma=1)
Gaussian Tail distribution.
RandomFunctions(EngineType &rng)