KLFitter  v1.3.2
Documentation of the KLFitter library -- The Kinematic Likelihood Fitter
Public Member Functions | Static Public Member Functions | List of all members
KLFitter::ResCrystalBallBase Class Referenceabstract

This class offers a simple parameterisation of a resolution. More...

#include <ResCrystalBallBase.h>

Inheritance diagram for KLFitter::ResCrystalBallBase:
KLFitter::ResolutionBase KLFitter::ResCrystalBallJets

Public Member Functions

 ResCrystalBallBase (const char *filename)
 The default constructor.
 
 ResCrystalBallBase (std::vector< double > const &parameters)
 A constructor that takes parameters directly, unlike the default constructor that takes a path to the file with TFs. More...
 
virtual ~ResCrystalBallBase ()
 The (defaulted) destructor.
 
virtual double GetAlpha (double x)=0
 Calculate the alpha parameter from the TF parameters and the value of x. More...
 
virtual double GetN (double x)=0
 Calculate the n parameter from the TF parameters and the value of x. More...
 
virtual double GetMean (double x)=0
 Calculate the mean from the TF parameters and the value of x. More...
 
double logp (double x, double xmeas, bool *good, double=0) override
 Return the probability of the true value of x given the measured value, xmeas. More...
 
double LogCrystalBallFunction (double x, double alpha, double n, double sigma, double mean)
 A function that calculates CrystalBall See twiki: https://en.wikipedia.org/wiki/Crystal_Ball_function. More...
 
double ApproxError (double x)
 An approximation of the error function needed to calculate crystal ball normalization with precision < 1e-4. More...
 
- Public Member Functions inherited from KLFitter::ResolutionBase
 ResolutionBase (int npar)
 The default constructor. More...
 
 ResolutionBase (std::vector< double > parameters)
 A constructor. More...
 
virtual ~ResolutionBase ()
 The (defaulted) destructor.
 
virtual double GetSigma (double par)=0
 Return the (approximate) width of the TF depending on the relevant parameter (mostly xmeas, but sumET in case of ResGauss_MET). More...
 
int Par (int index, double *par)
 Return a parameter of the parameterization. More...
 
int SetPar (int index, double value)
 Set a parameter value. More...
 
int SetPar (std::vector< double > parameters)
 Set all parameter values. More...
 
int ReadParameters (const char *filename, std::size_t nparameters)
 Read parameter values from ASCII file. More...
 
int Status ()
 Return a status code. More...
 

Static Public Member Functions

static bool CheckCrystalBallSanity (double *sigma, double *n)
 Sanity check for the crystal ball parameters sigma, and n (1st sigma, scale and 2nd sigma). More...
 

Additional Inherited Members

- Protected Attributes inherited from KLFitter::ResolutionBase
int fNParameters
 The number of parameters.
 
std::vector< double > fParameters
 The parameter values.
 
int fStatus
 The status of this class (1: ok, 0: error).
 

Detailed Description

This class offers a simple parameterisation of a resolution.

The parametrisation is a CrystalBall function with energy dependent parameters.

Constructor & Destructor Documentation

KLFitter::ResCrystalBallBase::ResCrystalBallBase ( std::vector< double > const &  parameters)
explicit

A constructor that takes parameters directly, unlike the default constructor that takes a path to the file with TFs.

Parameters
parametersThe parameters of the parameterization.

Member Function Documentation

double KLFitter::ResCrystalBallBase::ApproxError ( double  x)

An approximation of the error function needed to calculate crystal ball normalization with precision < 1e-4.

Decreases computation time by about 10%.

Parameters
x
Returns
Approximate value of the error function for x
static bool KLFitter::ResCrystalBallBase::CheckCrystalBallSanity ( double *  sigma,
double *  n 
)
inlinestatic

Sanity check for the crystal ball parameters sigma, and n (1st sigma, scale and 2nd sigma).

Parameters
sigma.
n.
Returns
False if problem with TF.
virtual double KLFitter::ResCrystalBallBase::GetAlpha ( double  x)
pure virtual

Calculate the alpha parameter from the TF parameters and the value of x.

Parameters
xThe value of x.
Returns
The alpha.

Implemented in KLFitter::ResCrystalBallJets.

virtual double KLFitter::ResCrystalBallBase::GetMean ( double  x)
pure virtual

Calculate the mean from the TF parameters and the value of x.

Parameters
xThe value of x.
Returns
The mean.

Implemented in KLFitter::ResCrystalBallJets.

virtual double KLFitter::ResCrystalBallBase::GetN ( double  x)
pure virtual

Calculate the n parameter from the TF parameters and the value of x.

Parameters
xThe value of x.
Returns
The parameter n.

Implemented in KLFitter::ResCrystalBallJets.

double KLFitter::ResCrystalBallBase::LogCrystalBallFunction ( double  x,
double  alpha,
double  n,
double  sigma,
double  mean 
)

A function that calculates CrystalBall See twiki: https://en.wikipedia.org/wiki/Crystal_Ball_function.

Parameters
x
Alphaparameter
nparameter
sigmaparameter
meanparameter
Returns
Logarithm of CrystalBall value for X
double KLFitter::ResCrystalBallBase::logp ( double  x,
double  xmeas,
bool *  good,
double  = 0 
)
overridevirtual

Return the probability of the true value of x given the measured value, xmeas.

Parameters
xThe true value of x.
xmeasThe measured value of x.
goodFalse if problem with TF.
parOptional additional parameter (not used here).
Returns
Logarithm of the probability.

Reimplemented from KLFitter::ResolutionBase.


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