17#ifndef ROOT_Math_RandomFunctions
18#define ROOT_Math_RandomFunctions
56 template <
class EngineBaseType>
91 void Circle(
double &
x,
double &
y,
double r);
95 double Exp(
double tau);
98 double GausBM(
double mean,
double sigma);
101 double GausACR(
double mean,
double sigma);
111 double PoissonD(
double mean);
115 void Rannor(
double &
a,
double &
b);
119 void Sphere(
double &
x,
double &
y,
double &z,
double r);
122 double Uniform(
double a,
double b);
123 double Uniform(
double a);
138 template <
class Engine,
class EngineBaseType>
147 fImpl.SetEngine(&rng);
160 return fImpl.Binomial(ntot,prob);
178 return fImpl.Exp(tau);
211 void Sphere(
double &
x,
double &
y,
double &z,
double r) {
249 static_assert(std::is_fundamental<Engine>::value,
"Error: Gamma() requires a GSL Engine type");
252 double Beta(
double ,
double ) {
253 static_assert(std::is_fundamental<Engine>::value,
"Error: Beta() requires a GSL Engine type");
257 static_assert(std::is_fundamental<Engine>::value,
"Error: LogNormal() requires a GSL Engine type");
261 static_assert(std::is_fundamental<Engine>::value,
"Error: ChiSquare() requires a GSL Engine type");
265 static_assert(std::is_fundamental<Engine>::value,
"Error: Rayleigh() requires a GSL Engine type");
269 static_assert(std::is_fundamental<Engine>::value,
"Error: Logistic() requires a GSL Engine type");
273 static_assert(std::is_fundamental<Engine>::value,
"Error: Pareto() requires a GSL Engine type");
277 static_assert(std::is_fundamental<Engine>::value,
"Error: FDist() requires a GSL Engine type");
281 static_assert(std::is_fundamental<Engine>::value,
"Error: tDist() requires a GSL Engine type");
285 static_assert(std::is_fundamental<Engine>::value,
"Error: NegativeBinomial() requires a GSL Engine type");
288 std::vector<unsigned int>
MultiNomial(
unsigned int,
const std::vector<double> &){
289 static_assert(std::is_fundamental<Engine>::value,
"Error: MultiNomial() requires a GSL Engine type");
290 return std::vector<unsigned int>();
RandomFunctionsImpl()
class constructor
double Gaus(double mean, double sigma)
TRandomEngine * fBaseEngine
Definition of the generic impelmentation class for the RandomFunctions.
double Exp(double tau)
Returns an exponential deviate.
RandomFunctions(Engine &rng)
double Landau(double mu, double sigma)
Generate a random number following a Landau distribution with location parameter mu and scale paramet...
double BreitWigner(double mean, double gamma)
Return a number distributed following a BreitWigner function with mean and gamma.
double FDist(double, double)
void Circle(double &x, double &y, double r)
Generates random vectors, uniformly distributed over a circle of given radius.
double PoissonD(double mean)
double Uniform(double a, double b)
generate random numbers following a Uniform distribution in the [a,b] interval
double GausACR(double mean, double sigma)
generate random numbers according to the Accemptance-Complemet-Ratio method
double Pareto(double, double)
unsigned int NegativeBinomial(double, double)
double LogNormal(double, double)
void Sphere(double &x, double &y, double &z, double r)
Generates random vectors, uniformly distributed over the surface of a sphere of given radius.
RandomFunctionsImpl< EngineBaseType > fImpl
random number generator engine
double Rndm_impl()
Internal impelmentation to return random number Since this one is not a virtual function is faster th...
double operator()()
non-virtual method
int Binomial(int ntot, double prob)
Generate binomial numbers.
double Uniform(double a)
generate random numbers following a Uniform distribution in the [0,a] interval
std::vector< unsigned int > MultiNomial(unsigned int, const std::vector< double > &)
double Beta(double, double)
double Gamma(double, double)
methods which are only for GSL random generators
~RandomFunctions()
destructor (no op) we do not mantain the engine)
double GausBM(double mean, double sigma)
generate Gaussian number using Box-Muller method
int Poisson(double mean)
Generates a random integer N according to a Poisson law.
double Gaus(double mean, double sigma)
generate Gaussian number using defqault method
void Rannor(double &a, double &b)
Generate numbers distributed following a gaussian with mean=0 and sigma=1.
TRandomEngine DefaultEngineType
Documentation for the RandomFunction class.
Namespace for new Math classes and functions.
Double_t Landau(Double_t x, Double_t mean, Double_t sigma)
Double_t Binomial(Int_t n, Int_t k)
Calculate the binomial coefficient n over k.
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculate a Breit Wigner function with mean and gamma.