Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::RandomFunctions< Engine, EngineBaseType > Class Template Reference

template<class Engine, class EngineBaseType>
class ROOT::Math::RandomFunctions< Engine, EngineBaseType >

Definition at line 140 of file RandomFunctions.h.

Public Member Functions

 RandomFunctions (Engine &rng)
 
 ~RandomFunctions ()
 destructor (no op) we do not mantain the engine)
 
double Beta (double, double)
 
int Binomial (int ntot, double prob)
 Generate binomial numbers.
 
double BreitWigner (double mean, double gamma)
 Return a number distributed following a BreitWigner function with mean and gamma.
 
double ChiSquare (double)
 
void Circle (double &x, double &y, double r)
 Generates random vectors, uniformly distributed over a circle of given radius.
 
double Exp (double tau)
 Returns an exponential deviate.
 
double FDist (double, double)
 
double Gamma (double, double)
 methods which are only for GSL random generators
 
double Gaus (double mean, double sigma)
 generate Gaussian number using defqault method
 
double GausACR (double mean, double sigma)
 generate random numbers according to the Accemptance-Complemet-Ratio method
 
double GausBM (double mean, double sigma)
 generate Gaussian number using Box-Muller method
 
double Landau (double mu, double sigma)
 Generate a random number following a Landau distribution with location parameter mu and scale parameter sigma: Landau( (x-mu)/sigma )
 
double Logistic (double)
 
double LogNormal (double, double)
 
std::vector< unsigned intMultiNomial (unsigned int, const std::vector< double > &)
 
unsigned int NegativeBinomial (double, double)
 
double operator() ()
 non-virtual method
 
double Pareto (double, double)
 
int Poisson (double mean)
 Generates a random integer N according to a Poisson law.
 
double PoissonD (double mean)
 
void Rannor (double &a, double &b)
 Generate numbers distributed following a gaussian with mean=0 and sigma=1.
 
double Rayleigh (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.
 
double tDist (double)
 
double Uniform (double a)
 generate random numbers following a Uniform distribution in the [0,a] interval
 
double Uniform (double a, double b)
 generate random numbers following a Uniform distribution in the [a,b] interval
 

Protected Member Functions

double Rndm_impl ()
 Internal impelmentation to return random number Since this one is not a virtual function is faster than Rndm.
 
Engine & Rng ()
 

Private Attributes

Engine * fEngine
 
RandomFunctionsImpl< EngineBaseType > fImpl
 random number generator engine
 

#include <Math/RandomFunctions.h>

Constructor & Destructor Documentation

◆ RandomFunctions()

template<class Engine , class EngineBaseType >
ROOT::Math::RandomFunctions< Engine, EngineBaseType >::RandomFunctions ( Engine &  rng)
inline

Definition at line 147 of file RandomFunctions.h.

◆ ~RandomFunctions()

template<class Engine , class EngineBaseType >
ROOT::Math::RandomFunctions< Engine, EngineBaseType >::~RandomFunctions ( )
inline

destructor (no op) we do not mantain the engine)

Definition at line 152 of file RandomFunctions.h.

Member Function Documentation

◆ Beta()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Beta ( double  ,
double   
)
inline

Definition at line 253 of file RandomFunctions.h.

◆ Binomial()

template<class Engine , class EngineBaseType >
int ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Binomial ( int  ntot,
double  prob 
)
inline

Generate binomial numbers.

Definition at line 160 of file RandomFunctions.h.

◆ BreitWigner()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::BreitWigner ( double  mean,
double  gamma 
)
inline

Return a number distributed following a BreitWigner function with mean and gamma.

Definition at line 165 of file RandomFunctions.h.

◆ ChiSquare()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::ChiSquare ( double  )
inline

Definition at line 261 of file RandomFunctions.h.

◆ Circle()

template<class Engine , class EngineBaseType >
void ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Circle ( double x,
double y,
double  r 
)
inline

Generates random vectors, uniformly distributed over a circle of given radius.

Input : r = circle radius Output: x,y a random 2-d vector of length r

Definition at line 172 of file RandomFunctions.h.

◆ Exp()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Exp ( double  tau)
inline

Returns an exponential deviate.

exp( -t/tau )

Definition at line 178 of file RandomFunctions.h.

◆ FDist()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::FDist ( double  ,
double   
)
inline

Definition at line 277 of file RandomFunctions.h.

◆ Gamma()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Gamma ( double  ,
double   
)
inline

methods which are only for GSL random generators

Gamma functions (not implemented here, requires a GSL random engine)

Definition at line 248 of file RandomFunctions.h.

◆ Gaus()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Gaus ( double  mean,
double  sigma 
)
inline

generate Gaussian number using defqault method

Definition at line 228 of file RandomFunctions.h.

◆ GausACR()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::GausACR ( double  mean,
double  sigma 
)
inline

generate random numbers according to the Accemptance-Complemet-Ratio method

Definition at line 188 of file RandomFunctions.h.

◆ GausBM()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::GausBM ( double  mean,
double  sigma 
)
inline

generate Gaussian number using Box-Muller method

Definition at line 183 of file RandomFunctions.h.

◆ Landau()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Landau ( double  mu,
double  sigma 
)
inline

Generate a random number following a Landau distribution with location parameter mu and scale parameter sigma: Landau( (x-mu)/sigma )

Definition at line 195 of file RandomFunctions.h.

◆ Logistic()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Logistic ( double  )
inline

Definition at line 269 of file RandomFunctions.h.

◆ LogNormal()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::LogNormal ( double  ,
double   
)
inline

Definition at line 257 of file RandomFunctions.h.

◆ MultiNomial()

template<class Engine , class EngineBaseType >
std::vector< unsigned int > ROOT::Math::RandomFunctions< Engine, EngineBaseType >::MultiNomial ( unsigned int  ,
const std::vector< double > &   
)
inline

Definition at line 289 of file RandomFunctions.h.

◆ NegativeBinomial()

template<class Engine , class EngineBaseType >
unsigned int ROOT::Math::RandomFunctions< Engine, EngineBaseType >::NegativeBinomial ( double  ,
double   
)
inline

Definition at line 285 of file RandomFunctions.h.

◆ operator()()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::operator() ( )
inline

non-virtual method

Definition at line 156 of file RandomFunctions.h.

◆ Pareto()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Pareto ( double  ,
double   
)
inline

Definition at line 273 of file RandomFunctions.h.

◆ Poisson()

template<class Engine , class EngineBaseType >
int ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Poisson ( double  mean)
inline

Generates a random integer N according to a Poisson law.

Prob(N) = exp(-mean)*mean^N/Factorial(N)

Definition at line 201 of file RandomFunctions.h.

◆ PoissonD()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::PoissonD ( double  mean)
inline

Definition at line 202 of file RandomFunctions.h.

◆ Rannor()

template<class Engine , class EngineBaseType >
void ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Rannor ( double a,
double b 
)
inline

Generate numbers distributed following a gaussian with mean=0 and sigma=1.

Using the Box-Muller method

Definition at line 206 of file RandomFunctions.h.

◆ Rayleigh()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Rayleigh ( double  )
inline

Definition at line 265 of file RandomFunctions.h.

◆ Rndm_impl()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Rndm_impl ( )
inlineprotected

Internal impelmentation to return random number Since this one is not a virtual function is faster than Rndm.

Definition at line 301 of file RandomFunctions.h.

◆ Rng()

template<class Engine , class EngineBaseType >
Engine & ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Rng ( )
inlineprotected

Definition at line 297 of file RandomFunctions.h.

◆ Sphere()

template<class Engine , class EngineBaseType >
void ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Sphere ( double x,
double y,
double z,
double  r 
)
inline

Generates random vectors, uniformly distributed over the surface of a sphere of given radius.

Definition at line 212 of file RandomFunctions.h.

◆ tDist()

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::tDist ( double  )
inline

Definition at line 281 of file RandomFunctions.h.

◆ Uniform() [1/2]

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Uniform ( double  a)
inline

generate random numbers following a Uniform distribution in the [0,a] interval

Definition at line 222 of file RandomFunctions.h.

◆ Uniform() [2/2]

template<class Engine , class EngineBaseType >
double ROOT::Math::RandomFunctions< Engine, EngineBaseType >::Uniform ( double  a,
double  b 
)
inline

generate random numbers following a Uniform distribution in the [a,b] interval

Definition at line 217 of file RandomFunctions.h.

Member Data Documentation

◆ fEngine

template<class Engine , class EngineBaseType >
Engine* ROOT::Math::RandomFunctions< Engine, EngineBaseType >::fEngine
private

Definition at line 306 of file RandomFunctions.h.

◆ fImpl

template<class Engine , class EngineBaseType >
RandomFunctionsImpl<EngineBaseType> ROOT::Math::RandomFunctions< Engine, EngineBaseType >::fImpl
private

random number generator engine

Definition at line 307 of file RandomFunctions.h.

  • math/mathcore/inc/Math/RandomFunctions.h