17 #ifndef ROOT_Math_RandomFunctions
18 #define ROOT_Math_RandomFunctions
21 #include <type_traits>
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);
130 double Rndm() {
return fBaseEngine->Rndm(); }
132 double Gaus(
double mean,
double sigma) {
return GausACR(mean,sigma); }
138 template <
class Engine,
class EngineBaseType>
147 fImpl.SetEngine(&rng);
160 return fImpl.Binomial(ntot,prob);
165 return fImpl.BreitWigner(mean,gamma);
172 return fImpl.Circle(x,y,r);
178 return fImpl.Exp(tau);
183 return fImpl.GausBM(mean,sigma);
188 return fImpl.GausACR(mean, sigma);
195 return fImpl.Landau(mu,sigma);
206 return fImpl.Rannor(a,b);
212 return fImpl.Sphere(x,y,z,r);
228 return fImpl.GausACR(mean,sigma);
272 std::vector<unsigned int>
MultiNomial(
unsigned int,
const std::vector<double> &){
274 return std::vector<unsigned int>();
int Poisson(double mean)
Generates a random integer N according to a Poisson law.
Double_t Landau(Double_t x, Double_t mpv=0, Double_t sigma=1, Bool_t norm=kFALSE)
The LANDAU function.
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculate a Breit Wigner function with mean and gamma.
double LogNormal(double, double)
RandomFunctionsImpl< EngineBaseType > fImpl
random number generator engine
double Exp(double tau)
Returns an exponential deviate.
double Gamma(double, double)
methods which are only for GSL random generators
RandomFunctionsImpl()
class constructor
void Circle(double &x, double &y, double r)
Generates random vectors, uniformly distributed over a circle of given radius.
double Landau(double mu, double sigma)
Generate a random number following a Landau distribution with location parameter mu and scale paramet...
void Sphere(double &x, double &y, double &z, double r)
Generates random vectors, uniformly distributed over the surface of a sphere of given radius...
double Uniform(double a, double b)
generate random numbers following a Uniform distribution in the [a,b] interval
TRandomEngine * fBaseEngine
double FDist(double, double)
~RandomFunctions()
destructor (no op) we do not mantain the engine)
double Uniform(double a)
generate random numbers following a Uniform distribution in the [0,a] interval
void Rannor(double &a, double &b)
Generate numbers distributed following a gaussian with mean=0 and sigma=1.
double operator()()
non-virtual method
Double_t Binomial(Int_t n, Int_t k)
Calculate the binomial coefficient n over k.
double Rndm_impl()
Internal impelmentation to return random number Since this one is not a virtual function is faster th...
double Gaus(double mean, double sigma)
TRandomEngine DefaultEngineType
Documentation for the RandomFunction class.
double Gaus(double mean, double sigma)
generate Gaussian number using defqault method
int Binomial(int ntot, double prob)
Generate binomial numbers.
Definition of the generic impelmentation class for the RandomFunctions.
unsigned int NegativeBinomial(double, double)
RandomFunctions(Engine &rng)
double GausBM(double mean, double sigma)
generate Gaussian number using Box-Muller method
double PoissonD(double mean)
double BreitWigner(double mean, double gamma)
Return a number distributed following a BreitWigner function with mean and gamma. ...
std::vector< unsigned int > MultiNomial(unsigned int, const std::vector< double > &)
double GausACR(double mean, double sigma)
generate random numbers according to the Accemptance-Complemet-Ratio method