Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::VavilovFast 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 VavilovFast, 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).

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 A. Rotondi and P. Montagna, Fast calculation of Vavilov distribution, Nucl. Instr. and Meth. B47 (1990) 215-224, which has been implemented in CERNLIB (G115).

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\) must be in the range \(0.01 \le \kappa \le 12\).

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

Average times on a Pentium Core2 Duo P8400 2.26GHz:

  • 9.9us per call to SetKappaBeta2 or constructor
  • 0.095us per call to Pdf, Cdf
  • 3.7us per first call to Quantile after SetKappaBeta2 or constructor
  • 0.137us per subsequent call to Quantile

Benno List, June 2010

Definition at line 116 of file VavilovFast.h.

Public Member Functions

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

Static Public Member Functions

static VavilovFastGetInstance ()
 Returns a static instance of class VavilovFast.
 
static VavilovFastGetInstance (double kappa, double beta2)
 Returns a static instance of class VavilovFast, and sets the values of kappa and beta2.
 
- 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}\).
 
static double Mean (double kappa, double beta2)
 Return the theoretical Mean \(\mu = \gamma-1- \ln \kappa - \beta^2\).
 
static double Skewness (double kappa, double beta2)
 Return the theoretical skewness \(\gamma_1 = \frac{1/2 - \beta^2/3}{\kappa^2 \sigma^3} \).
 
static double Variance (double kappa, double beta2)
 Return the theoretical Variance \(\sigma^2 = \frac{1 - \beta^2/2}{\kappa}\).
 

Private Attributes

double fAC [14]
 
double fBeta2
 
double fHC [9]
 
int fItype
 
double fKappa
 
int fNpt
 
double fWCM [201]
 

Static Private Attributes

static VavilovFastfgInstance = nullptr
 

#include <Math/VavilovFast.h>

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

Constructor & Destructor Documentation

◆ VavilovFast()

ROOT::Math::VavilovFast::VavilovFast ( double  kappa = 1,
double  beta2 = 1 
)

Initialize an object to calculate the Vavilov distribution.

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

Definition at line 51 of file VavilovFast.cxx.

◆ ~VavilovFast()

ROOT::Math::VavilovFast::~VavilovFast ( )
override

Destructor.

Definition at line 57 of file VavilovFast.cxx.

Member Function Documentation

◆ Cdf() [1/2]

double ROOT::Math::VavilovFast::Cdf ( double  x) const
overridevirtual

Evaluate the Vavilov cumulative probability density function.

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

Implements ROOT::Math::Vavilov.

Definition at line 425 of file VavilovFast.cxx.

◆ Cdf() [2/2]

double ROOT::Math::VavilovFast::Cdf ( double  x,
double  kappa,
double  beta2 
)
overridevirtual

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 \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 443 of file VavilovFast.cxx.

◆ Cdf_c() [1/2]

double ROOT::Math::VavilovFast::Cdf_c ( double  x) const
overridevirtual

Evaluate the Vavilov complementary cumulative probability density function.

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

Implements ROOT::Math::Vavilov.

Definition at line 439 of file VavilovFast.cxx.

◆ Cdf_c() [2/2]

double ROOT::Math::VavilovFast::Cdf_c ( double  x,
double  kappa,
double  beta2 
)
overridevirtual

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 \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 461 of file VavilovFast.cxx.

◆ GetBeta2()

double ROOT::Math::VavilovFast::GetBeta2 ( ) const
overridevirtual

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

Implements ROOT::Math::Vavilov.

Definition at line 562 of file VavilovFast.cxx.

◆ GetInstance() [1/2]

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

Returns a static instance of class VavilovFast.

Definition at line 566 of file VavilovFast.cxx.

◆ GetInstance() [2/2]

VavilovFast * ROOT::Math::VavilovFast::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 \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Definition at line 571 of file VavilovFast.cxx.

◆ GetKappa()

double ROOT::Math::VavilovFast::GetKappa ( ) const
overridevirtual

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

Implements ROOT::Math::Vavilov.

Definition at line 558 of file VavilovFast.cxx.

◆ GetLambdaMax()

double ROOT::Math::VavilovFast::GetLambdaMax ( ) const
overridevirtual

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 554 of file VavilovFast.cxx.

◆ GetLambdaMin()

double ROOT::Math::VavilovFast::GetLambdaMin ( ) const
overridevirtual

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 550 of file VavilovFast.cxx.

◆ Pdf() [1/2]

double ROOT::Math::VavilovFast::Pdf ( double  x) const
overridevirtual

Evaluate the Vavilov probability density function.

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

Implements ROOT::Math::Vavilov.

Definition at line 363 of file VavilovFast.cxx.

◆ Pdf() [2/2]

double ROOT::Math::VavilovFast::Pdf ( double  x,
double  kappa,
double  beta2 
)
overridevirtual

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 \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 407 of file VavilovFast.cxx.

◆ Quantile() [1/2]

double ROOT::Math::VavilovFast::Quantile ( double  z) const
overridevirtual

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 479 of file VavilovFast.cxx.

◆ Quantile() [2/2]

double ROOT::Math::VavilovFast::Quantile ( double  z,
double  kappa,
double  beta2 
)
overridevirtual

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 \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 535 of file VavilovFast.cxx.

◆ Quantile_c() [1/2]

double ROOT::Math::VavilovFast::Quantile_c ( double  z) const
overridevirtual

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 540 of file VavilovFast.cxx.

◆ Quantile_c() [2/2]

double ROOT::Math::VavilovFast::Quantile_c ( double  z,
double  kappa,
double  beta2 
)
overridevirtual

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 \(0.01 \le \kappa \le 12 \)
beta2The parameter \(\beta^2\), which must be in the range \(0 \le \beta^2 \le 1 \)

Implements ROOT::Math::Vavilov.

Definition at line 545 of file VavilovFast.cxx.

◆ SetKappaBeta2()

void ROOT::Math::VavilovFast::SetKappaBeta2 ( double  kappa,
double  beta2 
)
overridevirtual

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

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

Implements ROOT::Math::Vavilov.

Definition at line 62 of file VavilovFast.cxx.

Member Data Documentation

◆ fAC

double ROOT::Math::VavilovFast::fAC[14]
private

Definition at line 273 of file VavilovFast.h.

◆ fBeta2

double ROOT::Math::VavilovFast::fBeta2
private

Definition at line 271 of file VavilovFast.h.

◆ fgInstance

VavilovFast * ROOT::Math::VavilovFast::fgInstance = nullptr
staticprivate

Definition at line 279 of file VavilovFast.h.

◆ fHC

double ROOT::Math::VavilovFast::fHC[9]
private

Definition at line 274 of file VavilovFast.h.

◆ fItype

int ROOT::Math::VavilovFast::fItype
private

Definition at line 276 of file VavilovFast.h.

◆ fKappa

double ROOT::Math::VavilovFast::fKappa
private

Definition at line 270 of file VavilovFast.h.

◆ fNpt

int ROOT::Math::VavilovFast::fNpt
private

Definition at line 277 of file VavilovFast.h.

◆ fWCM

double ROOT::Math::VavilovFast::fWCM[201]
private

Definition at line 275 of file VavilovFast.h.

Libraries for ROOT::Math::VavilovFast:

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