17#ifndef ROOT_Math_RandomFunctions
18#define ROOT_Math_RandomFunctions
57 template <
class EngineBaseType>
84 int Binomial(
int ntot,
double prob);
87 double BreitWigner(
double mean,
double gamma);
92 void Circle(
double &
x,
double &
y,
double r);
96 double Exp(
double tau);
99 double GausBM(
double mean,
double sigma);
102 double GausACR(
double mean,
double sigma);
107 double Landau(
double mu,
double sigma);
111 int Poisson(
double mean);
112 double PoissonD(
double mean);
116 void Rannor(
double &
a,
double &
b);
120 void Sphere(
double &
x,
double &
y,
double &z,
double r);
123 double Uniform(
double a,
double b);
124 double Uniform(
double a);
139 template <
class Engine,
class EngineBaseType>
148 fImpl.SetEngine(&rng);
161 return fImpl.Binomial(ntot,prob);
166 return fImpl.BreitWigner(mean,gamma);
179 return fImpl.Exp(tau);
212 void Sphere(
double &
x,
double &
y,
double &z,
double r) {
250 static_assert(std::is_fundamental<Engine>::value,
"Error: Gamma() requires a GSL Engine type");
253 double Beta(
double ,
double ) {
254 static_assert(std::is_fundamental<Engine>::value,
"Error: Beta() requires a GSL Engine type");
258 static_assert(std::is_fundamental<Engine>::value,
"Error: LogNormal() requires a GSL Engine type");
262 static_assert(std::is_fundamental<Engine>::value,
"Error: ChiSquare() requires a GSL Engine type");
266 static_assert(std::is_fundamental<Engine>::value,
"Error: Rayleigh() requires a GSL Engine type");
270 static_assert(std::is_fundamental<Engine>::value,
"Error: Logistic() requires a GSL Engine type");
274 static_assert(std::is_fundamental<Engine>::value,
"Error: Pareto() requires a GSL Engine type");
278 static_assert(std::is_fundamental<Engine>::value,
"Error: FDist() requires a GSL Engine type");
282 static_assert(std::is_fundamental<Engine>::value,
"Error: tDist() requires a GSL Engine type");
286 static_assert(std::is_fundamental<Engine>::value,
"Error: NegativeBinomial() requires a GSL Engine type");
289 std::vector<unsigned int>
MultiNomial(
unsigned int,
const std::vector<double> &){
290 static_assert(std::is_fundamental<Engine>::value,
"Error: MultiNomial() requires a GSL Engine type");
291 return std::vector<unsigned int>();
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
RandomFunctionsImpl()
class constructor
double Gaus(double mean, double sigma)
TRandomEngine * fBaseEngine
Definition of the generic implementation 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 Acceptance-Complement-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 implementation 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 maintain 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 default 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.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...