Logo ROOT   6.14/05
Reference Guide
Classes | Typedefs | Functions
ROOT::Fit::FitUtil Namespace Reference

namespace defining utility free functions using in Fit for evaluating the various fit method functions (chi2, likelihood, etc..) given the data and the model function More...

Classes

struct  Evaluate
 
class  IntegralEvaluator
 
class  LikelihoodAux
 
class  LikelihoodAux< double >
 

Typedefs

typedef ROOT::Math::IParamMultiGradFunction IGradModelFunction
 
template<class T >
using IGradModelFunctionTempl = ROOT::Math::IParamMultiGradFunctionTempl< T >
 
typedef ROOT::Math::IParamMultiFunction IModelFunction
 
template<class T >
using IModelFunctionTempl = ROOT::Math::IParamMultiFunctionTempl< T >
 

Functions

template<class GFunc >
void CalculateGradientIntegral (const GFunc &gfunc, const double *x1, const double *x2, const double *p, double *g)
 
bool CheckInfNaNValue (double &rval)
 
double CorrectValue (double rval)
 
double EvaluateChi2 (const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy, unsigned nChunks=0)
 Chi2 Functions. More...
 
double EvaluateChi2Effective (const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints)
 evaluate the effective Chi2 given a model function and the data at the point x. More...
 
void EvaluateChi2Gradient (const IModelFunction &func, const BinData &data, const double *x, double *grad, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy=ROOT::Fit::ExecutionPolicy::kSerial, unsigned nChunks=0)
 evaluate the Chi2 gradient given a model function and the data at the point x. More...
 
double EvaluateChi2Residual (const IModelFunction &func, const BinData &data, const double *x, unsigned int ipoint, double *g=0)
 evaluate the residual contribution to the Chi2 given a model function and the BinPoint data and if the pointer g is not null evaluate also the gradient of the residual. More...
 
double EvaluateLogL (const IModelFunction &func, const UnBinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy, unsigned nChunks=0)
 evaluate the LogL given a model function and the data at the point x. More...
 
void EvaluateLogLGradient (const IModelFunction &func, const UnBinData &data, const double *x, double *grad, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy=ROOT::Fit::ExecutionPolicy::kSerial, unsigned nChunks=0)
 evaluate the LogL gradient given a model function and the data at the point x. More...
 
double EvaluatePdf (const IModelFunction &func, const UnBinData &data, const double *x, unsigned int ipoint, double *g=0)
 evaluate the pdf contribution to the LogL given a model function and the BinPoint data. More...
 
double EvaluatePoissonBinPdf (const IModelFunction &func, const BinData &data, const double *x, unsigned int ipoint, double *g=0)
 evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data. More...
 
double EvaluatePoissonLogL (const IModelFunction &func, const BinData &data, const double *x, int iWeight, bool extended, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy, unsigned nChunks=0)
 evaluate the Poisson LogL given a model function and the data at the point x. More...
 
void EvaluatePoissonLogLGradient (const IModelFunction &func, const BinData &data, const double *x, double *grad, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy=ROOT::Fit::ExecutionPolicy::kSerial, unsigned nChunks=0)
 evaluate the Poisson LogL given a model function and the data at the point x. More...
 
unsigned setAutomaticChunking (unsigned nEvents)
 

Detailed Description

namespace defining utility free functions using in Fit for evaluating the various fit method functions (chi2, likelihood, etc..) given the data and the model function

Typedef Documentation

◆ IGradModelFunction

Definition at line 65 of file FitUtil.h.

◆ IGradModelFunctionTempl

Definition at line 68 of file FitUtil.h.

◆ IModelFunction

Definition at line 64 of file FitUtil.h.

◆ IModelFunctionTempl

Definition at line 71 of file FitUtil.h.

Function Documentation

◆ CalculateGradientIntegral()

template<class GFunc >
void ROOT::Fit::FitUtil::CalculateGradientIntegral ( const GFunc &  gfunc,
const double *  x1,
const double *  x2,
const double *  p,
double *  g 
)

Definition at line 202 of file FitUtil.cxx.

◆ CheckInfNaNValue()

bool ROOT::Fit::FitUtil::CheckInfNaNValue ( double &  rval)

Definition at line 181 of file FitUtil.cxx.

◆ CorrectValue()

double ROOT::Fit::FitUtil::CorrectValue ( double  rval)

Definition at line 167 of file FitUtil.cxx.

◆ EvaluateChi2()

double ROOT::Fit::FitUtil::EvaluateChi2 ( const IModelFunction func,
const BinData data,
const double *  x,
unsigned int &  nPoints,
ROOT::Fit::ExecutionPolicy  executionPolicy,
unsigned  nChunks = 0 
)

Chi2 Functions.

evaluate the Chi2 given a model function and the data at the point x. return also nPoints as the effective number of used points in the Chi2 evaluation

Definition at line 226 of file FitUtil.cxx.

◆ EvaluateChi2Effective()

double ROOT::Fit::FitUtil::EvaluateChi2Effective ( const IModelFunction func,
const BinData data,
const double *  x,
unsigned int &  nPoints 
)

evaluate the effective Chi2 given a model function and the data at the point x.

The effective chi2 uses the errors on the coordinates : W = 1/(sigma_y**2 + ( sigma_x_i * df/dx_i )**2 ) return also nPoints as the effective number of used points in the Chi2 evaluation

Definition at line 410 of file FitUtil.cxx.

◆ EvaluateChi2Gradient()

void ROOT::Fit::FitUtil::EvaluateChi2Gradient ( const IModelFunction func,
const BinData data,
const double *  x,
double *  grad,
unsigned int &  nPoints,
ROOT::Fit::ExecutionPolicy  executionPolicy = ROOT::Fit::ExecutionPolicy::kSerial,
unsigned  nChunks = 0 
)

evaluate the Chi2 gradient given a model function and the data at the point x.

return also nPoints as the effective number of used points in the Chi2 evaluation

Definition at line 638 of file FitUtil.cxx.

◆ EvaluateChi2Residual()

double ROOT::Fit::FitUtil::EvaluateChi2Residual ( const IModelFunction func,
const BinData data,
const double *  p,
unsigned int  i,
double *  g = 0 
)

evaluate the residual contribution to the Chi2 given a model function and the BinPoint data and if the pointer g is not null evaluate also the gradient of the residual.

evaluate the chi2 contribution (residual term) only for data with no coord-errors This function is used in the specialized least square algorithms like FUMILI or L.M.

If the function provides parameter derivatives they are used otherwise a simple derivative calculation is used

if we have error on the coordinates the method is not yet implemented integral option is also not yet implemented one can use in that case normal chi2 method

Definition at line 531 of file FitUtil.cxx.

◆ EvaluateLogL()

double ROOT::Fit::FitUtil::EvaluateLogL ( const IModelFunction func,
const UnBinData data,
const double *  p,
int  iWeight,
bool  extended,
unsigned int &  nPoints,
ROOT::Fit::ExecutionPolicy  executionPolicy,
unsigned  nChunks = 0 
)

evaluate the LogL given a model function and the data at the point x.

return also nPoints as the effective number of used points in the LogL evaluation

◆ EvaluateLogLGradient()

void ROOT::Fit::FitUtil::EvaluateLogLGradient ( const IModelFunction func,
const UnBinData data,
const double *  x,
double *  grad,
unsigned int &  nPoints,
ROOT::Fit::ExecutionPolicy  executionPolicy = ROOT::Fit::ExecutionPolicy::kSerial,
unsigned  nChunks = 0 
)

evaluate the LogL gradient given a model function and the data at the point x.

return also nPoints as the effective number of used points in the LogL evaluation

Definition at line 1126 of file FitUtil.cxx.

◆ EvaluatePdf()

double ROOT::Fit::FitUtil::EvaluatePdf ( const IModelFunction func,
const UnBinData data,
const double *  x,
unsigned int  ipoint,
double *  g = 0 
)

evaluate the pdf contribution to the LogL given a model function and the BinPoint data.

If the pointer g is not null evaluate also the gradient of the pdf. If the function provides parameter derivatives they are used otherwise a simple derivative calculation is used

Definition at line 850 of file FitUtil.cxx.

◆ EvaluatePoissonBinPdf()

double ROOT::Fit::FitUtil::EvaluatePoissonBinPdf ( const IModelFunction func,
const BinData data,
const double *  x,
unsigned int  ipoint,
double *  g = 0 
)

evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data.

evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf) and its gradient

If the pointer g is not null evaluate also the gradient of the Poisson pdf. If the function provides parameter derivatives they are used otherwise a simple derivative calculation is used

Definition at line 1268 of file FitUtil.cxx.

◆ EvaluatePoissonLogL()

double ROOT::Fit::FitUtil::EvaluatePoissonLogL ( const IModelFunction func,
const BinData data,
const double *  x,
int  iWeight,
bool  extended,
unsigned int &  nPoints,
ROOT::Fit::ExecutionPolicy  executionPolicy,
unsigned  nChunks = 0 
)

evaluate the Poisson LogL given a model function and the data at the point x.

return also nPoints as the effective number of used points in the LogL evaluation By default is extended, pass extedend to false if want to be not extended (MultiNomial)

Definition at line 1371 of file FitUtil.cxx.

◆ EvaluatePoissonLogLGradient()

void ROOT::Fit::FitUtil::EvaluatePoissonLogLGradient ( const IModelFunction func,
const BinData data,
const double *  x,
double *  grad,
unsigned int &  nPoints,
ROOT::Fit::ExecutionPolicy  executionPolicy = ROOT::Fit::ExecutionPolicy::kSerial,
unsigned  nChunks = 0 
)

evaluate the Poisson LogL given a model function and the data at the point x.

return also nPoints as the effective number of used points in the LogL evaluation

Definition at line 1572 of file FitUtil.cxx.

◆ setAutomaticChunking()

unsigned ROOT::Fit::FitUtil::setAutomaticChunking ( unsigned  nEvents)

Definition at line 1756 of file FitUtil.cxx.