Logo ROOT   6.10/09
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ROOT::Math::VavilovAccurate Class Reference

Class describing a Vavilov distribution.

The probability density function of the Vavilov distribution as function of Landau's parameter is given by:

\[ p(\lambda_L; \kappa, \beta^2) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \phi(s) e^{\lambda_L s} ds\]

where \(\phi(s) = e^{C} e^{\psi(s)}\) with \( C = \kappa (1+\beta^2 \gamma )\) and \(\psi(s)= s \ln \kappa + (s+\beta^2 \kappa) \cdot \left ( \int \limits_{0}^{1} \frac{1 - e^{\frac{-st}{\kappa}}}{t} \,d t- \gamma \right ) - \kappa \, e^{\frac{-s}{\kappa}}\). \( \gamma = 0.5772156649\dots\) is Euler's constant.

For the class VavilovAccurate, Pdf returns the Vavilov distribution as function of Landau's parameter \(\lambda_L = \lambda_V/\kappa - \ln \kappa\), which is the convention used in the CERNLIB routines, and in the tables by S.M. Seltzer and M.J. Berger: Energy loss stragglin of protons and mesons: Tabulation of the Vavilov distribution, pp 187-203 in: National Research Council (U.S.), Committee on Nuclear Science: Studies in penetration of charged particles in matter, Nat. Akad. Sci. Publication 1133, Nucl. Sci. Series Report No. 39, Washington (Nat. Akad. Sci.) 1964, 388 pp. Available from Google books

Therefore, for small values of \(\kappa < 0.01\), pdf approaches the Landau distribution.

For values \(\kappa > 10\), the Gauss approximation should be used with \(\mu\) and \(\sigma\) given by Vavilov::mean(kappa, beta2) and sqrt(Vavilov::variance(kappa, beta2).

The original Vavilov pdf is obtained by v.Pdf(lambdaV/kappa-log(kappa))/kappa.

For detailed description see B. Schorr, Programs for the Landau and the Vavilov distributions and the corresponding random numbers, Computer Phys. Comm. 7 (1974) 215-224, which has been implemented in CERNLIB (G116).

The class stores coefficients needed to calculate \(p(\lambda; \kappa, \beta^2)\) for fixed values of \(\kappa\) and \(\beta^2\). Changing these values is computationally expensive.

The parameter \(\kappa\) should be in the range \(0.01 \le \kappa \le 10\). In contrast to the CERNLIB implementation, all values of \(\kappa \ge 0.001\) may be used, but may result in slower running and/or inaccurate results.

The parameter \(\beta^2\) must be in the range \(0 \le \beta^2 \le 1\).

Two parameters which are fixed in the CERNLIB implementation may be set by the user:

For the quantile calculation, the algorithm given by Schorr is not used, because it turns out to be very slow and still inaccurate. Instead, an initial estimate is calculated based on a pre-calculated table, which is subsequently improved by Newton iterations.

While the CERNLIB implementation calculates at most 156 terms in the series expansion for the pdf and cdf calculation, this class calculates up to 500 terms, depending on the values of epsilonPM and epsilon.

Average times on a Pentium Core2 Duo P8400 2.26GHz:

Benno List, June 2010

Definition at line 131 of file VavilovAccurate.h.

Public Member Functions

 VavilovAccurate (double kappa=1, double beta2=1, double epsilonPM=5E-4, double epsilon=1E-5)
 Initialize an object to calculate the Vavilov distribution. More...
 
virtual ~VavilovAccurate ()
 Destructor. More...
 
double Cdf (double x) const
 Evaluate the Vavilov cumulative probability density function. More...
 
double Cdf (double x, double kappa, double beta2)
 Evaluate the Vavilov cumulative probability density function, and set kappa and beta2, if necessary. More...
 
double Cdf_c (double x) const
 Evaluate the Vavilov complementary cumulative probability density function. More...
 
double Cdf_c (double x, double kappa, double beta2)
 Evaluate the Vavilov complementary cumulative probability density function, and set kappa and beta2, if necessary. More...
 
virtual double GetBeta2 () const
 Return the current value of \(\beta^2\). More...
 
double GetEpsilon () const
 Return the current value of \(\epsilon\). More...
 
double GetEpsilonPM () const
 Return the current value of \(\epsilon^+ = \epsilon^-\). More...
 
virtual double GetKappa () const
 Return the current value of \(\kappa\). More...
 
virtual double GetLambdaMax () const
 Return the maximum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation. More...
 
virtual double GetLambdaMin () const
 Return the minimum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation. More...
 
double GetNTerms () const
 Return the number of terms used in the series expansion. More...
 
virtual double Mode () const
 Return the value of \(\lambda\) where the pdf is maximal. More...
 
virtual double Mode (double kappa, double beta2)
 Return the value of \(\lambda\) where the pdf is maximal function, and set kappa and beta2, if necessary. More...
 
double Pdf (double x) const
 Evaluate the Vavilov probability density function. More...
 
double Pdf (double x, double kappa, double beta2)
 Evaluate the Vavilov probability density function, and set kappa and beta2, if necessary. More...
 
double Quantile (double z) const
 Evaluate the inverse of the Vavilov cumulative probability density function. More...
 
double Quantile (double z, double kappa, double beta2)
 Evaluate the inverse of the Vavilov cumulative probability density function, and set kappa and beta2, if necessary. More...
 
double Quantile_c (double z) const
 Evaluate the inverse of the complementary Vavilov cumulative probability density function. More...
 
double Quantile_c (double z, double kappa, double beta2)
 Evaluate the inverse of the complementary Vavilov cumulative probability density function, and set kappa and beta2, if necessary. More...
 
void Set (double kappa, double beta2, double epsilonPM=5E-4, double epsilon=1E-5)
 (Re)Initialize the object More...
 
virtual void SetKappaBeta2 (double kappa, double beta2)
 Change \(\kappa\) and \(\beta^2\) and recalculate coefficients if necessary. More...
 
- Public Member Functions inherited from ROOT::Math::Vavilov
 Vavilov ()
 Default constructor. More...
 
virtual ~Vavilov ()
 Destructor. More...
 
virtual double Kurtosis () const
 Return the theoretical kurtosis \(\gamma_2 = \frac{1/3 - \beta^2/4}{\kappa^3 \sigma^4}\). More...
 
virtual double Mean () const
 Return the theoretical mean \(\mu = \gamma-1- \ln \kappa - \beta^2\), where \(\gamma = 0.5772\dots\) is Euler's constant. More...
 
virtual double Skewness () const
 Return the theoretical skewness \(\gamma_1 = \frac{1/2 - \beta^2/3}{\kappa^2 \sigma^3} \). More...
 
virtual double Variance () const
 Return the theoretical variance \(\sigma^2 = \frac{1 - \beta^2/2}{\kappa}\). More...
 

Static Public Member Functions

static VavilovAccurateGetInstance ()
 Returns a static instance of class VavilovFast. More...
 
static VavilovAccurateGetInstance (double kappa, double beta2)
 Returns a static instance of class VavilovFast, and sets the values of kappa and beta2. More...
 
- Static Public Member Functions inherited from ROOT::Math::Vavilov
static double Kurtosis (double kappa, double beta2)
 Return the theoretical kurtosis \(\gamma_2 = \frac{1/3 - \beta^2/4}{\kappa^3 \sigma^4}\). More...
 
static double Mean (double kappa, double beta2)
 Return the theoretical Mean \(\mu = \gamma-1- \ln \kappa - \beta^2\). More...
 
static double Skewness (double kappa, double beta2)
 Return the theoretical skewness \(\gamma_1 = \frac{1/2 - \beta^2/3}{\kappa^2 \sigma^3} \). More...
 
static double Variance (double kappa, double beta2)
 Return the theoretical Variance \(\sigma^2 = \frac{1 - \beta^2/2}{\kappa}\). More...
 

Private Types

enum  { MAXTERMS =500 }
 
enum  { kNquantMax =32 }
 

Private Member Functions

double G116f1 (double x) const
 
double G116f2 (double x) const
 
void InitQuantile () const
 
int Rzero (double a, double b, double &x0, double eps, int mxf, double(VavilovAccurate::*f)(double) const) const
 

Static Private Member Functions

static double E1plLog (double x)
 

Private Attributes

double fA_cdf [MAXTERMS+1]
 
double fA_pdf [MAXTERMS+1]
 
double fB_cdf [MAXTERMS+1]
 
double fB_pdf [MAXTERMS+1]
 
double fBeta2
 
double fEpsilon
 
double fEpsilonPM
 
double fH [8]
 
double fKappa
 
double fLambda [kNquantMax]
 
int fNQuant
 
double fOmega
 
double fQuant [kNquantMax]
 
bool fQuantileInit
 
double fT
 
double fT0
 
double fT1
 
double fX0
 

Static Private Attributes

static VavilovAccuratefgInstance = 0
 

#include <Math/VavilovAccurate.h>

Inheritance diagram for ROOT::Math::VavilovAccurate:
[legend]

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
MAXTERMS 

Definition at line 332 of file VavilovAccurate.h.

◆ anonymous enum

anonymous enum
private
Enumerator
kNquantMax 

Definition at line 339 of file VavilovAccurate.h.

Constructor & Destructor Documentation

◆ VavilovAccurate()

ROOT::Math::VavilovAccurate::VavilovAccurate ( double  kappa = 1,
double  beta2 = 1,
double  epsilonPM = 5E-4,
double  epsilon = 1E-5 
)

Initialize an object to calculate the Vavilov distribution.

Parameters
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)
epsilonPM\(\epsilon^+ = \epsilon^-\) in Eqs. (2.1) and (2.2) of Schorr's paper; gives an estimate on the integral of the cumulative distribution function outside the range \(\lambda_{min} \le \lambda \le \lambda_{max}\) where the approximation is valid.
epsilon\(\epsilon\) in Eq. (4.10) of Schorr's paper; determines the accuracy of the series expansion.

Definition at line 52 of file VavilovAccurate.cxx.

◆ ~VavilovAccurate()

ROOT::Math::VavilovAccurate::~VavilovAccurate ( )
virtual

Destructor.

Definition at line 58 of file VavilovAccurate.cxx.

Member Function Documentation

◆ Cdf() [1/2]

double ROOT::Math::VavilovAccurate::Cdf ( double  x) const
virtual

Evaluate the Vavilov cumulative probability density function.

Parameters
xThe Landau parameter \(x = \lambda_L\)

Implements ROOT::Math::Vavilov.

Definition at line 257 of file VavilovAccurate.cxx.

◆ Cdf() [2/2]

double ROOT::Math::VavilovAccurate::Cdf ( double  x,
double  kappa,
double  beta2 
)
virtual

Evaluate the Vavilov cumulative probability density function, and set kappa and beta2, if necessary.

Parameters
xThe Landau parameter \(x = \lambda_L\)
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 292 of file VavilovAccurate.cxx.

◆ Cdf_c() [1/2]

double ROOT::Math::VavilovAccurate::Cdf_c ( double  x) const
virtual

Evaluate the Vavilov complementary cumulative probability density function.

Parameters
xThe Landau parameter \(x = \lambda_L\)

Implements ROOT::Math::Vavilov.

Definition at line 297 of file VavilovAccurate.cxx.

◆ Cdf_c() [2/2]

double ROOT::Math::VavilovAccurate::Cdf_c ( double  x,
double  kappa,
double  beta2 
)
virtual

Evaluate the Vavilov complementary cumulative probability density function, and set kappa and beta2, if necessary.

Parameters
xThe Landau parameter \(x = \lambda_L\)
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 332 of file VavilovAccurate.cxx.

◆ E1plLog()

double ROOT::Math::VavilovAccurate::E1plLog ( double  x)
staticprivate

Definition at line 645 of file VavilovAccurate.cxx.

◆ G116f1()

double ROOT::Math::VavilovAccurate::G116f1 ( double  x) const
private

Definition at line 487 of file VavilovAccurate.cxx.

◆ G116f2()

double ROOT::Math::VavilovAccurate::G116f2 ( double  x) const
private

Definition at line 496 of file VavilovAccurate.cxx.

◆ GetBeta2()

double ROOT::Math::VavilovAccurate::GetBeta2 ( ) const
virtual

Return the current value of \(\beta^2\).

Implements ROOT::Math::Vavilov.

Definition at line 672 of file VavilovAccurate.cxx.

◆ GetEpsilon()

double ROOT::Math::VavilovAccurate::GetEpsilon ( ) const

Return the current value of \(\epsilon\).

Definition at line 704 of file VavilovAccurate.cxx.

◆ GetEpsilonPM()

double ROOT::Math::VavilovAccurate::GetEpsilonPM ( ) const

Return the current value of \(\epsilon^+ = \epsilon^-\).

Definition at line 700 of file VavilovAccurate.cxx.

◆ GetInstance() [1/2]

VavilovAccurate * ROOT::Math::VavilovAccurate::GetInstance ( )
static

Returns a static instance of class VavilovFast.

Definition at line 451 of file VavilovAccurate.cxx.

◆ GetInstance() [2/2]

VavilovAccurate * ROOT::Math::VavilovAccurate::GetInstance ( double  kappa,
double  beta2 
)
static

Returns a static instance of class VavilovFast, and sets the values of kappa and beta2.

Parameters
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Definition at line 456 of file VavilovAccurate.cxx.

◆ GetKappa()

double ROOT::Math::VavilovAccurate::GetKappa ( ) const
virtual

Return the current value of \(\kappa\).

Implements ROOT::Math::Vavilov.

Definition at line 668 of file VavilovAccurate.cxx.

◆ GetLambdaMax()

double ROOT::Math::VavilovAccurate::GetLambdaMax ( ) const
virtual

Return the maximum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation.

Implements ROOT::Math::Vavilov.

Definition at line 664 of file VavilovAccurate.cxx.

◆ GetLambdaMin()

double ROOT::Math::VavilovAccurate::GetLambdaMin ( ) const
virtual

Return the minimum value of \(\lambda\) for which \(p(\lambda; \kappa, \beta^2)\) is nonzero in the current approximation.

Implements ROOT::Math::Vavilov.

Definition at line 660 of file VavilovAccurate.cxx.

◆ GetNTerms()

double ROOT::Math::VavilovAccurate::GetNTerms ( ) const

Return the number of terms used in the series expansion.

Definition at line 708 of file VavilovAccurate.cxx.

◆ InitQuantile()

void ROOT::Math::VavilovAccurate::InitQuantile ( ) const
private

Definition at line 186 of file VavilovAccurate.cxx.

◆ Mode() [1/2]

double ROOT::Math::VavilovAccurate::Mode ( ) const
virtual

Return the value of \(\lambda\) where the pdf is maximal.

Reimplemented from ROOT::Math::Vavilov.

Definition at line 676 of file VavilovAccurate.cxx.

◆ Mode() [2/2]

double ROOT::Math::VavilovAccurate::Mode ( double  kappa,
double  beta2 
)
virtual

Return the value of \(\lambda\) where the pdf is maximal function, and set kappa and beta2, if necessary.

Parameters
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Reimplemented from ROOT::Math::Vavilov.

Definition at line 695 of file VavilovAccurate.cxx.

◆ Pdf() [1/2]

double ROOT::Math::VavilovAccurate::Pdf ( double  x) const
virtual

Evaluate the Vavilov probability density function.

Parameters
xThe Landau parameter \(x = \lambda_L\)

Implements ROOT::Math::Vavilov.

Definition at line 218 of file VavilovAccurate.cxx.

◆ Pdf() [2/2]

double ROOT::Math::VavilovAccurate::Pdf ( double  x,
double  kappa,
double  beta2 
)
virtual

Evaluate the Vavilov probability density function, and set kappa and beta2, if necessary.

Parameters
xThe Landau parameter \(x = \lambda_L\)
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 252 of file VavilovAccurate.cxx.

◆ Quantile() [1/2]

double ROOT::Math::VavilovAccurate::Quantile ( double  z) const
virtual

Evaluate the inverse of the Vavilov cumulative probability density function.

Parameters
zThe argument \(z\), which must be in the range \(0 \le z \le 1\)

Implements ROOT::Math::Vavilov.

Definition at line 337 of file VavilovAccurate.cxx.

◆ Quantile() [2/2]

double ROOT::Math::VavilovAccurate::Quantile ( double  z,
double  kappa,
double  beta2 
)
virtual

Evaluate the inverse of the Vavilov cumulative probability density function, and set kappa and beta2, if necessary.

Parameters
zThe argument \(z\), which must be in the range \(0 \le z \le 1\)
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 384 of file VavilovAccurate.cxx.

◆ Quantile_c() [1/2]

double ROOT::Math::VavilovAccurate::Quantile_c ( double  z) const
virtual

Evaluate the inverse of the complementary Vavilov cumulative probability density function.

Parameters
zThe argument \(z\), which must be in the range \(0 \le z \le 1\)

Implements ROOT::Math::Vavilov.

Definition at line 389 of file VavilovAccurate.cxx.

◆ Quantile_c() [2/2]

double ROOT::Math::VavilovAccurate::Quantile_c ( double  z,
double  kappa,
double  beta2 
)
virtual

Evaluate the inverse of the complementary Vavilov cumulative probability density function, and set kappa and beta2, if necessary.

Parameters
zThe argument \(z\), which must be in the range \(0 \le z \le 1\)
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 446 of file VavilovAccurate.cxx.

◆ Rzero()

int ROOT::Math::VavilovAccurate::Rzero ( double  a,
double  b,
double &  x0,
double  eps,
int  mxf,
double(VavilovAccurate::*)(double) const  f 
) const
private

Definition at line 505 of file VavilovAccurate.cxx.

◆ Set()

void ROOT::Math::VavilovAccurate::Set ( double  kappa,
double  beta2,
double  epsilonPM = 5E-4,
double  epsilon = 1E-5 
)

(Re)Initialize the object

Parameters
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)
epsilonPM\(\epsilon^+ = \epsilon^-\) in Eqs. (2.1) and (2.2) of Schorr's paper; gives an estimate on the integral of the cumulative distribution function outside the range \(\lambda_{min} \le \lambda \le \lambda_{max}\) where the approximation is valid.
epsilon\(\epsilon\) in Eq. (4.10) of Schorr's paper; determines the accuracy of the series expansion.

Definition at line 67 of file VavilovAccurate.cxx.

◆ SetKappaBeta2()

void ROOT::Math::VavilovAccurate::SetKappaBeta2 ( double  kappa,
double  beta2 
)
virtual

Change \(\kappa\) and \(\beta^2\) and recalculate coefficients if necessary.

Parameters
kappaThe parameter \(\kappa\), which must be in the range \(\kappa \ge 0.001 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 63 of file VavilovAccurate.cxx.

Member Data Documentation

◆ fA_cdf

double ROOT::Math::VavilovAccurate::fA_cdf[MAXTERMS+1]
private

Definition at line 333 of file VavilovAccurate.h.

◆ fA_pdf

double ROOT::Math::VavilovAccurate::fA_pdf[MAXTERMS+1]
private

Definition at line 333 of file VavilovAccurate.h.

◆ fB_cdf

double ROOT::Math::VavilovAccurate::fB_cdf[MAXTERMS+1]
private

Definition at line 333 of file VavilovAccurate.h.

◆ fB_pdf

double ROOT::Math::VavilovAccurate::fB_pdf[MAXTERMS+1]
private

Definition at line 333 of file VavilovAccurate.h.

◆ fBeta2

double ROOT::Math::VavilovAccurate::fBeta2
private

Definition at line 334 of file VavilovAccurate.h.

◆ fEpsilon

double ROOT::Math::VavilovAccurate::fEpsilon
private

Definition at line 335 of file VavilovAccurate.h.

◆ fEpsilonPM

double ROOT::Math::VavilovAccurate::fEpsilonPM
private

Definition at line 335 of file VavilovAccurate.h.

◆ fgInstance

VavilovAccurate * ROOT::Math::VavilovAccurate::fgInstance = 0
staticprivate

Definition at line 345 of file VavilovAccurate.h.

◆ fH

double ROOT::Math::VavilovAccurate::fH[8]
private

Definition at line 333 of file VavilovAccurate.h.

◆ fKappa

double ROOT::Math::VavilovAccurate::fKappa
private

Definition at line 334 of file VavilovAccurate.h.

◆ fLambda

double ROOT::Math::VavilovAccurate::fLambda[kNquantMax]
mutableprivate

Definition at line 341 of file VavilovAccurate.h.

◆ fNQuant

int ROOT::Math::VavilovAccurate::fNQuant
mutableprivate

Definition at line 338 of file VavilovAccurate.h.

◆ fOmega

double ROOT::Math::VavilovAccurate::fOmega
private

Definition at line 333 of file VavilovAccurate.h.

◆ fQuant

double ROOT::Math::VavilovAccurate::fQuant[kNquantMax]
mutableprivate

Definition at line 340 of file VavilovAccurate.h.

◆ fQuantileInit

bool ROOT::Math::VavilovAccurate::fQuantileInit
mutableprivate

Definition at line 337 of file VavilovAccurate.h.

◆ fT

double ROOT::Math::VavilovAccurate::fT
private

Definition at line 333 of file VavilovAccurate.h.

◆ fT0

double ROOT::Math::VavilovAccurate::fT0
private

Definition at line 333 of file VavilovAccurate.h.

◆ fT1

double ROOT::Math::VavilovAccurate::fT1
private

Definition at line 333 of file VavilovAccurate.h.

◆ fX0

double ROOT::Math::VavilovAccurate::fX0
private

Definition at line 333 of file VavilovAccurate.h.


The documentation for this class was generated from the following files: