diff --git a/math/mathcore/inc/Math/PdfFuncMathCore.h b/math/mathcore/inc/Math/PdfFuncMathCore.h index d6249e7210357747be932b468933f64434651349..00cf35f96d96fa4d63a9e447dd6b0f98bddeb94c 100644 --- a/math/mathcore/inc/Math/PdfFuncMathCore.h +++ b/math/mathcore/inc/Math/PdfFuncMathCore.h @@ -262,7 +262,7 @@ namespace Math { */ - double landau_pdf(double x, double sigma = 1, double x0 = 0.); + double landau_pdf(double x, double s = 1, double x0 = 0.); /** @@ -274,7 +274,8 @@ namespace Math { for x>0. For detailed description see <A HREF="http://mathworld.wolfram.com/LogNormalDistribution.html"> Mathworld</A>. - + @param s scale parameter (not the sigma of the distribution which is not even defined) + @param x0 location parameter, corresponds approximatly to the most probable value. For x0 = 0, sigma = 1, the x_mpv = -0.22278 @ingroup PdfFunc diff --git a/math/mathcore/src/PdfFuncMathCore.cxx b/math/mathcore/src/PdfFuncMathCore.cxx index cf4ff6bd4374a101641c7c4859c4d10df7a74bed..96c8ca3ad57e3cf168fdb0bb2ed49058f22c2b2a 100644 --- a/math/mathcore/src/PdfFuncMathCore.cxx +++ b/math/mathcore/src/PdfFuncMathCore.cxx @@ -187,7 +187,7 @@ namespace Math { u = 1/(v-v*std::log(v)/(v+1)); denlan = u*u*(1+(a2[0]+a2[1]*u)*u); } - return denlan; + return denlan/sigma; } diff --git a/math/mathcore/src/TMath.cxx b/math/mathcore/src/TMath.cxx index 5abc8d27e2c5f79231a03e5929cf2d75dd4acb0f..bb2982140e3bf33cefb2bcde2832468ad75a2f72 100644 --- a/math/mathcore/src/TMath.cxx +++ b/math/mathcore/src/TMath.cxx @@ -498,12 +498,16 @@ Double_t TMath::Gaus(Double_t x, Double_t mean, Double_t sigma, Bool_t norm) //______________________________________________________________________________ Double_t TMath::Landau(Double_t x, Double_t mpv, Double_t sigma, Bool_t norm) { - // The LANDAU function with mpv(most probable value) and sigma. + // The LANDAU function. + // mpv is a location parameter and correspond approximatly to the most probable value + // and sigma is a scale parameter (not the sigma of the full distribution which is not defined) + // Note that for mpv=0 and sigma=1 (default values) the exact location of the maximum of the distribution (most proble value) is at + // x = -0.22278 // This function has been adapted from the CERNLIB routine G110 denlan. // If norm=kTRUE (default is kFALSE) the result is divided by sigma if (sigma <= 0) return 0; - Double_t den = ::ROOT::Math::landau_pdf(x, sigma, mpv); + Double_t den = ::ROOT::Math::landau_pdf( (x-mpv)/sigma ); if (!norm) return den; return den/sigma; }