17#ifndef ROOT_Math_GSLRandomFunctions
18#define ROOT_Math_GSLRandomFunctions
40 template <
class EngineType >
56 return Engine().GaussianZig(
sigma) + mean;
67 return mean + Engine().GaussianZig(
sigma);
74 return mean + Engine().Gaussian(
sigma);
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 );
115 return mean +
sigma*Engine().Landau();
122 return Engine().Gamma(
a,
b);
129 return Engine().Beta(
a,
b);
136 return Engine().LogNormal(zeta,
sigma);
143 return Engine().ChiSquare(nu);
149 double FDist(
double nu1,
double nu2) {
150 return Engine().FDist(nu1,nu2);
157 return Engine().tDist(nu);
163 return Engine().Rayleigh(
sigma);
170 return Engine().Logistic(
a);
177 return Engine().Pareto(
a,
b);
192 void Sphere(
double &
x,
double &
y,
double &z,
double r = 1) {
193 Engine().Dir3D(
x,
y,z);
203 return Engine().Poisson(mu);
209 unsigned int Binomial(
unsigned int ntot,
double prob) {
210 return Engine().Binomial(prob,ntot);
219 return Engine().NegativeBinomial(prob,
n);
225 std::vector<unsigned int>
Multinomial(
unsigned int ntot,
const std::vector<double> & p ) {
226 return Engine().Multinomial(ntot,p);
GSLRandomEngine Base class for all GSL random engines, normally user instantiate the derived classes ...
double Landau(double mean=0, double sigma=1)
Landau distribution.
double Gamma(double a, double b)
Gamma distribution.
RandomFunctions(EngineType &rng)
double Exp(double tau)
Exponential distribution.
void Sphere(double &x, double &y, double &z, double r=1)
generate random numbers in a 3D sphere of radious 1
double Pareto(double a, double b)
Pareto distribution.
double Logistic(double a)
Logistic distribution.
void Gaussian2D(double sigmaX, double sigmaY, double rho, double &x, double &y)
Bivariate Gaussian distribution with correlation.
unsigned int NegativeBinomial(double n, double prob)
Negative Binomial distribution First parameter is n, second is probability To be consistent with Rand...
double BreitWigner(double mean=0., double gamma=1)
Breit Wigner distribution.
double GausZig(double mean, double sigma)
unsigned int Binomial(unsigned int ntot, double prob)
Binomial distribution.
double LogNormal(double zeta, double sigma)
Log Normal distribution.
double tDist(double nu)
t student distribution
double GaussianTail(double a, double sigma=1)
Gaussian Tail distribution.
double Beta(double a, double b)
Beta distribution.
void Circle(double &x, double &y, double r=1)
generate random numbers in a 2D circle of radious 1
double GausBM(double mean=0, double sigma=1)
Gaussian distribution (Box-Muller method)
double Gaus(double mean=0, double sigma=1)
Gaussian distribution.
double Rayleigh(double sigma)
Rayleigh distribution.
double FDist(double nu1, double nu2)
F distrbution.
double GausR(double mean=0, double sigma=1)
Gaussian distribution (Ratio Method)
std::vector< unsigned int > Multinomial(unsigned int ntot, const std::vector< double > &p)
Multinomial distribution.
unsigned int Poisson(double mu)
Poisson distribution.
double ChiSquare(double nu)
Chi square distribution.
Namespace for new Math classes and functions.