ROOT  6.06/09
Reference Guide
RooMathCoreReg.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
5  * Authors: *
6  * WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl *
7  * *
8  * Copyright (c) 2000-2008, NIKHEF, Regents of the University of California *
9  * and Stanford University. All rights reserved. *
10  * *
11  *****************************************************************************/
12 
13 //////////////////////////////////////////////////////////////////////////////
14 //
15 // BEGIN_HTML
16 // END_HTML
17 //
18 
19 #include "Riostream.h"
20 #include "RooMathCoreReg.h"
21 #include "RooCFunction1Binding.h"
22 #include "RooCFunction2Binding.h"
23 #include "RooCFunction3Binding.h"
24 #include "RooCFunction4Binding.h"
25 #include "Math/SpecFunc.h"
26 #include "Math/DistFunc.h"
27 
29 
31 {
32  // Import MathCore 'special' functions from ROOT::Math namespace
33  RooCFunction1Ref<double,double>::fmap().add("ROOT::Math::erf",ROOT::Math::erf,"x") ;
34  RooCFunction1Ref<double,double>::fmap().add("ROOT::Math::erfc",ROOT::Math::erfc,"x") ;
35  RooCFunction1Ref<double,double>::fmap().add("ROOT::Math::tgamma",ROOT::Math::tgamma,"x") ;
36  RooCFunction1Ref<double,double>::fmap().add("ROOT::Math::lgamma",ROOT::Math::lgamma,"x") ;
37  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::inc_gamma",ROOT::Math::inc_gamma,"a","x") ;
38  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::inc_gamma_c",ROOT::Math::inc_gamma_c,"a","x") ;
39  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::beta",ROOT::Math::beta,"x","y") ;
40  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::inc_beta",ROOT::Math::inc_beta,"x","a","b") ;
41 
42  // MathCore pdf functions from ROOT::Math namespace
43  RooCFunction2Ref<double,unsigned int,double>::fmap().add("ROOT::Math::poisson_pdf",ROOT::Math::poisson_pdf, "n","mu") ;
44  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::beta_pdf",ROOT::Math::beta_pdf,"x","a","b") ;
45  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::breitwigner_pdf",ROOT::Math::breitwigner_pdf,"x","gamma","x0") ;
46  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::cauchy_pdf",ROOT::Math::cauchy_pdf,"x","b","x0") ;
47  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::chisquared_pdf",ROOT::Math::chisquared_pdf,"x","r","x0") ;
48  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::exponential_pdf",ROOT::Math::exponential_pdf,"x","lambda","x0") ;
49  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::gaussian_pdf",ROOT::Math::gaussian_pdf,"x","sigma","x0") ;
50  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::landau_pdf",ROOT::Math::landau_pdf,"x","sigma","x0.") ;
51  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::normal_pdf",ROOT::Math::normal_pdf,"x","sigma","x0") ;
52  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::tdistribution_pdf",ROOT::Math::tdistribution_pdf,"x","r","x0") ;
53  RooCFunction3Ref<double,unsigned int,double,unsigned int>::fmap().add("ROOT::Math::binomial_pdf",ROOT::Math::binomial_pdf,"int","double","unsigned") ;
54  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::fdistribution_pdf",ROOT::Math::fdistribution_pdf,"x","n","m","x0") ;
55  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::gamma_pdf",ROOT::Math::gamma_pdf,"x","alpha","theta","x0") ;
56  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::lognormal_pdf",ROOT::Math::lognormal_pdf,"x","m","s","x0") ;
57  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::uniform_pdf",ROOT::Math::uniform_pdf,"x","a","b","x0") ;
58 
59  // MathCore cdf functions from ROOT::Math namespace uint
60  RooCFunction2Ref<double,unsigned int,double>::fmap().add("ROOT::Math::poisson_cdf_c",ROOT::Math::poisson_cdf_c, "n","mu") ;
61  RooCFunction2Ref<double,unsigned int,double>::fmap().add("ROOT::Math::poisson_cdf",ROOT::Math::poisson_cdf, "n","mu") ;
62  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::beta_cdf_c",ROOT::Math::beta_cdf_c,"x","a","b") ;
63  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::beta_cdf",ROOT::Math::beta_cdf,"x","a","b") ;
64  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::breitwigner_cdf_c",ROOT::Math::breitwigner_cdf_c,"x","gamma","x0") ;
65  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::breitwigner_cdf",ROOT::Math::breitwigner_cdf,"x","gamma","x0") ;
66  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::cauchy_cdf_c",ROOT::Math::cauchy_cdf_c,"x","b","x0") ;
67  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::cauchy_cdf",ROOT::Math::cauchy_cdf,"x","b","x0") ;
68  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::chisquared_cdf_c",ROOT::Math::chisquared_cdf_c,"x","r","x0") ;
69  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::chisquared_cdf",ROOT::Math::chisquared_cdf,"x","r","x0") ;
70  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::exponential_cdf_c",ROOT::Math::exponential_cdf_c,"x","lambda","x0") ;
71  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::exponential_cdf",ROOT::Math::exponential_cdf,"x","lambda","x0") ;
72  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::landau_cdf",ROOT::Math::landau_cdf,"x","sigma","x0") ;
73  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::normal_cdf_c",ROOT::Math::normal_cdf_c,"x","sigma","x0") ;
74  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::normal_cdf",ROOT::Math::normal_cdf,"x","sigma","x0") ;
75  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::tdistribution_cdf_c",ROOT::Math::tdistribution_cdf_c,"x","r","x0") ;
76  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::tdistribution_cdf",ROOT::Math::tdistribution_cdf,"x","r","x0") ;
77  RooCFunction3Ref<double,unsigned int,double,unsigned int>::fmap().add("ROOT::Math::binomial_cdf_c",ROOT::Math::binomial_cdf_c,"int","double","unsigned") ;
78  RooCFunction3Ref<double,unsigned int,double,unsigned int>::fmap().add("ROOT::Math::binomial_cdf",ROOT::Math::binomial_cdf,"int","double","unsigned") ;
79  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::fdistribution_cdf_c",ROOT::Math::fdistribution_cdf_c,"x","n","m","x0") ;
80  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::fdistribution_cdf",ROOT::Math::fdistribution_cdf,"x","n","m","x0") ;
81  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::gamma_cdf_c",ROOT::Math::gamma_cdf_c,"x","alpha","theta","x0") ;
82  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::gamma_cdf",ROOT::Math::gamma_cdf,"x","alpha","theta","x0") ;
83  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::lognormal_cdf_c",ROOT::Math::lognormal_cdf_c,"x","m","s","x0") ;
84  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::lognormal_cdf",ROOT::Math::lognormal_cdf,"x","m","s","x0") ;
85  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::uniform_cdf_c",ROOT::Math::uniform_cdf_c,"x","a","b","x0") ;
86  RooCFunction4Ref<double,double,double,double,double>::fmap().add("ROOT::Math::uniform_cdf",ROOT::Math::uniform_cdf,"x","a","b","x0") ;
87 
88  // MathCore quantile functions from ROOT::Math namespace
89  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::cauchy_quantile_c",ROOT::Math::cauchy_quantile_c, "z", "b") ;
90  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::cauchy_quantile",ROOT::Math::cauchy_quantile, "z", "b") ;
91  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::breitwigner_quantile_c",ROOT::Math::breitwigner_quantile_c, "z", "gamma") ;
92  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::breitwigner_quantile",ROOT::Math::breitwigner_quantile, "z", "gamma") ;
93  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::chisquared_quantile_c",ROOT::Math::chisquared_quantile_c, "z", "r") ;
94  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::exponential_quantile_c",ROOT::Math::exponential_quantile_c, "z", "lambda") ;
95  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::exponential_quantile",ROOT::Math::exponential_quantile, "z", "lambda") ;
96  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::gaussian_quantile_c",ROOT::Math::gaussian_quantile_c, "z", "sigma") ;
97  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::gaussian_quantile",ROOT::Math::gaussian_quantile, "z", "sigma") ;
98  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::normal_quantile_c",ROOT::Math::normal_quantile_c, "z", "sigma") ;
99  RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::normal_quantile",ROOT::Math::normal_quantile, "z", "sigma") ;
100  //RooCFunction2Ref<double,double,double>::fmap().add("ROOT::Math::chisquared_quantile",ROOT::Math::chisquared_quantile, "z", "r") ;
101  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::beta_quantile",ROOT::Math::beta_quantile,"x","a","b") ;
102  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::beta_quantile_c",ROOT::Math::beta_quantile_c,"x","a","b") ;
103  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::fdistribution_quantile",ROOT::Math::fdistribution_quantile,"z","n","m") ;
104  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::fdistribution_quantile_c",ROOT::Math::fdistribution_quantile_c,"z","n","m") ;
105  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::gamma_quantile_c",ROOT::Math::gamma_quantile_c,"z","alpha","theta") ;
106  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::lognormal_quantile_c",ROOT::Math::lognormal_quantile_c,"x","m","s") ;
107  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::lognormal_quantile",ROOT::Math::lognormal_quantile,"x","m","s") ;
108  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::uniform_quantile_c",ROOT::Math::uniform_quantile_c,"z","a","b") ;
109  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::uniform_quantile",ROOT::Math::uniform_quantile,"z","a","b") ;
110  //RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::gamma_quantile",ROOT::Math::gamma_quantile,"z","alpha","theta") ;
111  RooCFunction3Ref<double,double,double,double>::fmap().add("ROOT::Math::gamma_quantile_c",ROOT::Math::gamma_quantile_c,"z","alpha","theta") ;
112 
113 }
double lognormal_pdf(double x, double m, double s, double x0=0)
Probability density function of the lognormal distribution.
double normal_quantile(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the lower tail of the normal (Gaussian) distri...
double erf(double x)
Error function encountered in integrating the normal distribution.
double tdistribution_cdf(double x, double r, double x0=0)
Cumulative distribution function of Student's t-distribution (lower tail).
double binomial_cdf(unsigned int k, double p, unsigned int n)
Cumulative distribution function of the Binomial distribution Lower tail of the integral of the binom...
double tdistribution_pdf(double x, double r, double x0=0)
Probability density function of Student's t-distribution.
double chisquared_pdf(double x, double r, double x0=0)
Probability density function of the distribution with degrees of freedom.
double normal_quantile_c(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the upper tail of the normal (Gaussian) distri...
double cauchy_quantile(double z, double b)
Inverse ( ) of the cumulative distribution function of the lower tail of the Cauchy distribution (cau...
double beta_pdf(double x, double a, double b)
Probability density function of the beta distribution.
double uniform_quantile(double z, double a, double b)
Inverse ( ) of the cumulative distribution function of the lower tail of the uniform (flat) distribut...
double inc_beta(double x, double a, double b)
Calculates the normalized (regularized) incomplete beta function.
double gamma_quantile_c(double z, double alpha, double theta)
Inverse ( ) of the cumulative distribution function of the upper tail of the gamma distribution (gamm...
double poisson_cdf(unsigned int n, double mu)
Cumulative distribution function of the Poisson distribution Lower tail of the integral of the poisso...
double poisson_cdf_c(unsigned int n, double mu)
Complement of the cumulative distribution function of the Poisson distribution.
double binomial_cdf_c(unsigned int k, double p, unsigned int n)
Complement of the cumulative distribution function of the Binomial distribution.
double gamma_cdf_c(double x, double alpha, double theta, double x0=0)
Complement of the cumulative distribution function of the gamma distribution (upper tail)...
double exponential_pdf(double x, double lambda, double x0=0)
Probability density function of the exponential distribution.
double uniform_cdf_c(double x, double a, double b, double x0=0)
Complement of the cumulative distribution function of the uniform (flat) distribution (upper tail)...
double tgamma(double x)
The gamma function is defined to be the extension of the factorial to real numbers.
static RooCFunction1Map< VO, VI > & fmap()
double lognormal_cdf(double x, double m, double s, double x0=0)
Cumulative distribution function of the lognormal distribution (lower tail).
double beta(double x, double y)
Calculates the beta function.
double erfc(double x)
Complementary error function.
double inc_gamma_c(double a, double x)
Calculates the normalized (regularized) upper incomplete gamma function (upper integral) ...
double normal_pdf(double x, double sigma=1, double x0=0)
Probability density function of the normal (Gaussian) distribution.
double breitwigner_quantile_c(double z, double gamma)
Inverse ( ) of the cumulative distribution function of the upper tail of the Breit-Wigner distributio...
double fdistribution_cdf_c(double x, double n, double m, double x0=0)
Complement of the cumulative distribution function of the F-distribution (upper tail).
double landau_pdf(double x, double xi=1, double x0=0)
Probability density function of the Landau distribution: with where .
double chisquared_quantile_c(double z, double r)
Inverse ( ) of the cumulative distribution function of the upper tail of the distribution with degr...
double exponential_quantile_c(double z, double lambda)
Inverse ( ) of the cumulative distribution function of the upper tail of the exponential distribution...
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
double breitwigner_quantile(double z, double gamma)
Inverse ( ) of the cumulative distribution function of the lower tail of the Breit_Wigner distributio...
double cauchy_cdf_c(double x, double b, double x0=0)
Complement of the cumulative distribution function (upper tail) of the Cauchy distribution which is a...
double gaussian_pdf(double x, double sigma=1, double x0=0)
Probability density function of the normal (Gaussian) distribution.
double fdistribution_cdf(double x, double n, double m, double x0=0)
Cumulative distribution function of the F-distribution (lower tail).
double gamma_pdf(double x, double alpha, double theta, double x0=0)
Probability density function of the gamma distribution.
double breitwigner_pdf(double x, double gamma, double x0=0)
Probability density function of Breit-Wigner distribution, which is similar, just a different definit...
double uniform_cdf(double x, double a, double b, double x0=0)
Cumulative distribution function of the uniform (flat) distribution (lower tail). ...
double beta_cdf(double x, double a, double b)
Cumulative distribution function of the beta distribution Upper tail of the integral of the beta_pdf...
double breitwigner_cdf(double x, double gamma, double x0=0)
Cumulative distribution function (lower tail) of the Breit_Wigner distribution and it is similar (jus...
double cauchy_quantile_c(double z, double b)
Inverse ( ) of the cumulative distribution function of the upper tail of the Cauchy distribution (cau...
double uniform_quantile_c(double z, double a, double b)
Inverse ( ) of the cumulative distribution function of the upper tail of the uniform (flat) distribut...
static RooCFunction2Map< VO, VI1, VI2 > & fmap()
double landau_cdf(double x, double xi=1, double x0=0)
Cumulative distribution function of the Landau distribution (lower tail).
double exponential_cdf_c(double x, double lambda, double x0=0)
Complement of the cumulative distribution function of the exponential distribution (upper tail)...
double binomial_pdf(unsigned int k, double p, unsigned int n)
Probability density function of the binomial distribution.
double cauchy_cdf(double x, double b, double x0=0)
Cumulative distribution function (lower tail) of the Cauchy distribution which is also Lorentzian dis...
double fdistribution_pdf(double x, double n, double m, double x0=0)
Probability density function of the F-distribution.
static RooCFunction4Map< VO, VI1, VI2, VI3, VI4 > & fmap()
double normal_cdf_c(double x, double sigma=1, double x0=0)
Complement of the cumulative distribution function of the normal (Gaussian) distribution (upper tail)...
double tdistribution_cdf_c(double x, double r, double x0=0)
Complement of the cumulative distribution function of Student's t-distribution (upper tail)...
double beta_quantile_c(double x, double a, double b)
Inverse ( ) of the cumulative distribution function of the lower tail of the beta distribution (beta_...
static RooCFunction3Map< VO, VI1, VI2, VI3 > & fmap()
double cauchy_pdf(double x, double b=1, double x0=0)
Probability density function of the Cauchy distribution which is also called Lorentzian distribution...
static RooMathCoreReg dummy
double poisson_pdf(unsigned int n, double mu)
Probability density function of the Poisson distribution.
double fdistribution_quantile(double z, double n, double m)
Inverse ( ) of the cumulative distribution function of the lower tail of the f distribution (fdistrib...
double fdistribution_quantile_c(double z, double n, double m)
Inverse ( ) of the cumulative distribution function of the upper tail of the f distribution (fdistrib...
double beta_cdf_c(double x, double a, double b)
Complement of the cumulative distribution function of the beta distribution.
double gamma_cdf(double x, double alpha, double theta, double x0=0)
Cumulative distribution function of the gamma distribution (lower tail).
double lognormal_quantile_c(double x, double m, double s)
Inverse ( ) of the cumulative distribution function of the upper tail of the lognormal distribution (...
double uniform_pdf(double x, double a, double b, double x0=0)
Probability density function of the uniform (flat) distribution.
double gaussian_quantile(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the lower tail of the normal (Gaussian) distri...
double chisquared_cdf_c(double x, double r, double x0=0)
Complement of the cumulative distribution function of the distribution with degrees of freedom (upp...
double gaussian_quantile_c(double z, double sigma)
Inverse ( ) of the cumulative distribution function of the upper tail of the normal (Gaussian) distri...
double lognormal_quantile(double x, double m, double s)
Inverse ( ) of the cumulative distribution function of the lower tail of the lognormal distribution (...
double chisquared_cdf(double x, double r, double x0=0)
Cumulative distribution function of the distribution with degrees of freedom (lower tail)...
double lgamma(double x)
Calculates the logarithm of the gamma function.
double breitwigner_cdf_c(double x, double gamma, double x0=0)
Complement of the cumulative distribution function (upper tail) of the Breit_Wigner distribution and ...
double inc_gamma(double a, double x)
Calculates the normalized (regularized) lower incomplete gamma function (lower integral) ...
double exponential_quantile(double z, double lambda)
Inverse ( ) of the cumulative distribution function of the lower tail of the exponential distribution...
double lognormal_cdf_c(double x, double m, double s, double x0=0)
Complement of the cumulative distribution function of the lognormal distribution (upper tail)...
double exponential_cdf(double x, double lambda, double x0=0)
Cumulative distribution function of the exponential distribution (lower tail).
double beta_quantile(double x, double a, double b)
Inverse ( ) of the cumulative distribution function of the upper tail of the beta distribution (beta_...