Logo ROOT   6.12/07
Reference Guide
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ROOT::Fit Namespace Reference

Namespace for the fitting classes. More...

Namespaces

 FitUtil
 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
 
 HFitInterface
 

Classes

class  BasicFCN
 BasicFCN class: base class for the objective functions used in the fits It has a reference to the data and th emodel function used in the fit. More...
 
class  BinData
 Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y values and error on coordinates The dimension of the coordinate is free There are 4 different options: More...
 
class  Chi2FCN
 Chi2FCN class for binnned fits using the least square methods. More...
 
struct  DataOptions
 DataOptions : simple structure holding the options on how the data are filled. More...
 
class  DataRange
 class describing the range in the coordinates it supports multiple range in a coordinate. More...
 
struct  DummyDeleter
 
class  FcnAdapter
 
class  FitConfig
 Class describing the configuration of the fit, options and parameter settings using the ROOT::Fit::ParameterSettings class. More...
 
class  FitData
 Base class for all the fit data types: Stores the coordinates and the DataOptions. More...
 
class  FitResult
 class containg the result of the fit and all the related information (fitted parameter values, error, covariance matrix and minimizer result information) Contains a pointer also to the fitted (model) function, modified with the fit parameter values. More...
 
class  Fitter
 Fitter class, entry point for performing all type of fits. More...
 
class  LogLikelihoodFCN
 LogLikelihoodFCN class for likelihood fits. More...
 
class  ParameterSettings
 Class, describing value, limits and step size of the parameters Provides functionality also to set/retrieve values, step sizes, limits and fix the parameters. More...
 
class  PoissonLikelihoodFCN
 class evaluating the log likelihood for binned Poisson likelihood fits it is template to distinguish gradient and non-gradient case More...
 
class  SparseData
 
class  UnBinData
 Class describing the unbinned data sets (just x coordinates values) of any dimensions. More...
 

Typedefs

typedef Chi2FCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunctionChi2Function
 
typedef Chi2FCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunctionChi2GradFunction
 
typedef LogLikelihoodFCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunctionLogLikelihoodFunction
 
typedef LogLikelihoodFCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunctionLogLikelihoodGradFunction
 
typedef PoissonLikelihoodFCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunctionPoissonLLFunction
 
typedef PoissonLikelihoodFCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunctionPoissonLLGradFunction
 

Enumerations

enum  EFitObjectType { kHistogram, kGraph }
 
enum  ExecutionPolicy { ExecutionPolicy::kSerial, ExecutionPolicy::kMultithread, ExecutionPolicy::kMultiprocess }
 

Functions

double Chisquare (const TH1 &h1, TF1 &f1, bool useRange, bool usePL=false)
 compute the chi2 value for an histogram given a function (see TH1::Chisquare for the documentation) More...
 
double Chisquare (const TGraph &h1, TF1 &f1, bool useRange)
 compute the chi2 value for a graph given a function (see TGraph::Chisquare) More...
 
void DivideBox (const vector< double > &min, const vector< double > &max, const vector< double > &bmin, const vector< double > &bmax, const unsigned int size, const unsigned int n, list< Box > &l, const double val, const double error)
 
void DoFillData (BinData &dv, const TGraph *gr, BinData::ErrorType type, TF1 *func)
 
void FillData (BinData &dv, const TH1 *hist, TF1 *func=0)
 fill the data vector from a TH1. More...
 
void FillData (SparseData &dv, const TH1 *hist, TF1 *func=0)
 fill the data vector from a TH1 with sparse data. More...
 
void FillData (SparseData &dv, const THnBase *hist, TF1 *func=0)
 fill the data vector from a THnBase. More...
 
void FillData (BinData &dv, const THnBase *hist, TF1 *func=0)
 fill the data vector from a THnBase. More...
 
void FillData (BinData &dv, const TGraph2D *gr, TF1 *func=0)
 fill the data vector from a TGraph2D. More...
 
void FillData (BinData &dv, const TGraph *gr, TF1 *func=0)
 fill the data vector from a TGraph. More...
 
void FillData (BinData &dv, const TMultiGraph *gr, TF1 *func=0)
 fill the data vector from a TMultiGraph. More...
 
TFitResultPtr FitObject (TH1 *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
 fitting function for a TH1 (called from TH1::Fit) More...
 
TFitResultPtr FitObject (TGraph *gr, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
 fitting function for a TGraph (called from TGraph::Fit) More...
 
TFitResultPtr FitObject (TMultiGraph *mg, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
 fitting function for a MultiGraph (called from TMultiGraph::Fit) More...
 
TFitResultPtr FitObject (TGraph2D *gr, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
 fitting function for a TGraph2D (called from TGraph2D::Fit) More...
 
TFitResultPtr FitObject (THnBase *s1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
 fitting function for a THn / THnSparse (called from THnBase::Fit) More...
 
void FitOptionsMake (EFitObjectType type, const char *option, Foption_t &fitOption)
 Decode list of options into fitOption. More...
 
bool GetConfidenceIntervals (const TH1 *h1, const ROOT::Fit::FitResult &r, TGraphErrors *gr, double cl=0.95)
 compute confidence intervals at level cl for a fitted histogram h1 in a TGraphErrors gr More...
 
BinData::ErrorType GetDataType (const TGraph *gr, DataOptions &fitOpt)
 
BinData::ErrorType GetDataType (const TGraph2D *gr, const DataOptions &fitOpt)
 
void Init2DGaus (const ROOT::Fit::BinData &data, TF1 *f1)
 compute initial parameter for 2D gaussian function given the fit data Set the sigma limits for zero top 10* initial rms values Set the initial parameter values in the TF1 More...
 
void InitExpo (const ROOT::Fit::BinData &data, TF1 *f1)
 compute initial parameter for an exponential function given the fit data Set the constant and slope assuming a simple exponential going through xmin and xmax of the data set More...
 
void InitGaus (const ROOT::Fit::BinData &data, TF1 *f1)
 compute initial parameter for gaussian function given the fit data Set the sigma limits for zero top 10* initial rms values Set the initial parameter values in the TF1 More...
 
bool lessRange (const std::pair< double, double > &r1, const std::pair< double, double > &r2)
 
ostream & operator<< (ostream &os, const ROOT::Fit::Box &b)
 
TFitResultPtr UnBinFit (ROOT::Fit::UnBinData *data, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption)
 fit an unbin data set (from tree or from histogram buffer) using a TF1 pointer and fit options. More...
 

Variables

double gDefaultErrorDef = ROOT::Math::MinimizerOptions::DefaultErrorDef()
 
const int gInitialResultStatus = -99
 

Detailed Description

Namespace for the fitting classes.

Typedef Documentation

◆ Chi2Function

Definition at line 170 of file Chi2FCN.h.

◆ Chi2GradFunction

Definition at line 171 of file Chi2FCN.h.

◆ LogLikelihoodFunction

Definition at line 180 of file LogLikelihoodFCN.h.

◆ LogLikelihoodGradFunction

Definition at line 181 of file LogLikelihoodFCN.h.

◆ PoissonLLFunction

Definition at line 190 of file PoissonLikelihoodFCN.h.

◆ PoissonLLGradFunction

Definition at line 191 of file PoissonLikelihoodFCN.h.

Enumeration Type Documentation

◆ EFitObjectType

Enumerator
kHistogram 
kGraph 

Definition at line 48 of file HFitInterface.h.

◆ ExecutionPolicy

Enumerator
kSerial 
kMultithread 
kMultiprocess 

Definition at line 5 of file FitExecutionPolicy.h.

Function Documentation

◆ Chisquare() [1/2]

double ROOT::Fit::Chisquare ( const TH1 h1,
TF1 f1,
bool  useRange,
bool  usePL = false 
)

compute the chi2 value for an histogram given a function (see TH1::Chisquare for the documentation)

Definition at line 1018 of file HFitImpl.cxx.

◆ Chisquare() [2/2]

double ROOT::Fit::Chisquare ( const TGraph h1,
TF1 f1,
bool  useRange 
)

compute the chi2 value for a graph given a function (see TGraph::Chisquare)

Definition at line 1022 of file HFitImpl.cxx.

◆ DivideBox()

void ROOT::Fit::DivideBox ( const vector< double > &  min,
const vector< double > &  max,
const vector< double > &  bmin,
const vector< double > &  bmax,
const unsigned int  size,
const unsigned int  n,
list< Box > &  l,
const double  val,
const double  error 
)

Definition at line 152 of file SparseData.cxx.

◆ DoFillData()

void ROOT::Fit::DoFillData ( BinData dv,
const TGraph gr,
BinData::ErrorType  type,
TF1 func 
)

Definition at line 573 of file HFitInterface.cxx.

◆ FillData() [1/7]

void ROOT::Fit::FillData ( BinData dv,
const TH1 hist,
TF1 func = 0 
)

fill the data vector from a TH1.

Pass also the TF1 function which is needed in case of integral option and to reject points rejected by the function

Definition at line 107 of file HFitInterface.cxx.

◆ FillData() [2/7]

void ROOT::Fit::FillData ( SparseData dv,
const TH1 hist,
TF1 func = 0 
)

fill the data vector from a TH1 with sparse data.

Pass also the TF1 function which is needed in case of integral option and to reject points rejected by the function

Definition at line 670 of file HFitInterface.cxx.

◆ FillData() [3/7]

void ROOT::Fit::FillData ( SparseData dv,
const THnBase hist,
TF1 func = 0 
)

fill the data vector from a THnBase.

Pass also the TF1 function which is needed in case of integral option and to reject points rejected by the function

Definition at line 714 of file HFitInterface.cxx.

◆ FillData() [4/7]

void ROOT::Fit::FillData ( BinData dv,
const THnBase hist,
TF1 func = 0 
)

fill the data vector from a THnBase.

Pass also the TF1 function which is needed in case of integral option and to reject points rejected by the function

Definition at line 757 of file HFitInterface.cxx.

◆ FillData() [5/7]

void ROOT::Fit::FillData ( BinData dv,
const TGraph2D gr,
TF1 func = 0 
)

fill the data vector from a TGraph2D.

Pass also the TF1 function which is needed in case of integral option and to reject points rejected by the function

Definition at line 874 of file HFitInterface.cxx.

◆ FillData() [6/7]

void ROOT::Fit::FillData ( BinData dv,
const TGraph gr,
TF1 func = 0 
)

fill the data vector from a TGraph.

Pass also the TF1 function which is needed in case to exclude points rejected by the function

Definition at line 789 of file HFitInterface.cxx.

◆ FillData() [7/7]

void ROOT::Fit::FillData ( BinData dv,
const TMultiGraph gr,
TF1 func = 0 
)

fill the data vector from a TMultiGraph.

Pass also the TF1 function which is needed in case to exclude points rejected by the function

Definition at line 821 of file HFitInterface.cxx.

◆ FitObject() [1/5]

TFitResultPtr ROOT::Fit::FitObject ( TH1 h1,
TF1 f1,
Foption_t option,
const ROOT::Math::MinimizerOptions moption,
const char *  goption,
ROOT::Fit::DataRange range 
)

fitting function for a TH1 (called from TH1::Fit)

Definition at line 964 of file HFitImpl.cxx.

◆ FitObject() [2/5]

TFitResultPtr ROOT::Fit::FitObject ( TGraph gr,
TF1 f1,
Foption_t option,
const ROOT::Math::MinimizerOptions moption,
const char *  goption,
ROOT::Fit::DataRange range 
)

fitting function for a TGraph (called from TGraph::Fit)

Definition at line 976 of file HFitImpl.cxx.

◆ FitObject() [3/5]

TFitResultPtr ROOT::Fit::FitObject ( TMultiGraph mg,
TF1 f1,
Foption_t option,
const ROOT::Math::MinimizerOptions moption,
const char *  goption,
ROOT::Fit::DataRange range 
)

fitting function for a MultiGraph (called from TMultiGraph::Fit)

Definition at line 983 of file HFitImpl.cxx.

◆ FitObject() [4/5]

TFitResultPtr ROOT::Fit::FitObject ( TGraph2D gr,
TF1 f1,
Foption_t option,
const ROOT::Math::MinimizerOptions moption,
const char *  goption,
ROOT::Fit::DataRange range 
)

fitting function for a TGraph2D (called from TGraph2D::Fit)

Definition at line 990 of file HFitImpl.cxx.

◆ FitObject() [5/5]

TFitResultPtr ROOT::Fit::FitObject ( THnBase s1,
TF1 f1,
Foption_t option,
const ROOT::Math::MinimizerOptions moption,
const char *  goption,
ROOT::Fit::DataRange range 
)

fitting function for a THn / THnSparse (called from THnBase::Fit)

Definition at line 997 of file HFitImpl.cxx.

◆ FitOptionsMake()

void ROOT::Fit::FitOptionsMake ( EFitObjectType  type,
const char *  option,
Foption_t fitOption 
)

Decode list of options into fitOption.

Definition at line 681 of file HFitImpl.cxx.

◆ GetConfidenceIntervals()

bool ROOT::Fit::GetConfidenceIntervals ( const TH1 h1,
const ROOT::Fit::FitResult r,
TGraphErrors gr,
double  cl = 0.95 
)

compute confidence intervals at level cl for a fitted histogram h1 in a TGraphErrors gr

Definition at line 961 of file HFitInterface.cxx.

◆ GetDataType() [1/2]

BinData::ErrorType ROOT::Fit::GetDataType ( const TGraph gr,
DataOptions fitOpt 
)

Definition at line 473 of file HFitInterface.cxx.

◆ GetDataType() [2/2]

BinData::ErrorType ROOT::Fit::GetDataType ( const TGraph2D gr,
const DataOptions fitOpt 
)

Definition at line 542 of file HFitInterface.cxx.

◆ Init2DGaus()

void ROOT::Fit::Init2DGaus ( const ROOT::Fit::BinData data,
TF1 f1 
)

compute initial parameter for 2D gaussian function given the fit data Set the sigma limits for zero top 10* initial rms values Set the initial parameter values in the TF1

Compute Initial values of parameters for a gaussian derived from function H1InitGaus defined in TH1.cxx.

Definition at line 385 of file HFitInterface.cxx.

◆ InitExpo()

void ROOT::Fit::InitExpo ( const ROOT::Fit::BinData data,
TF1 f1 
)

compute initial parameter for an exponential function given the fit data Set the constant and slope assuming a simple exponential going through xmin and xmax of the data set

Compute rough values of parameters for an exponential.

Definition at line 264 of file HFitInterface.cxx.

◆ InitGaus()

void ROOT::Fit::InitGaus ( const ROOT::Fit::BinData data,
TF1 f1 
)

compute initial parameter for gaussian function given the fit data Set the sigma limits for zero top 10* initial rms values Set the initial parameter values in the TF1

Compute Initial values of parameters for a gaussian derived from function H1InitGaus defined in TH1.cxx.

Definition at line 303 of file HFitInterface.cxx.

◆ lessRange()

bool ROOT::Fit::lessRange ( const std::pair< double, double > &  r1,
const std::pair< double, double > &  r2 
)

Definition at line 73 of file DataRange.cxx.

◆ operator<<()

ostream& ROOT::Fit::operator<< ( ostream &  os,
const ROOT::Fit::Box &  b 
)

Definition at line 364 of file SparseData.cxx.

◆ UnBinFit()

TFitResultPtr ROOT::Fit::UnBinFit ( ROOT::Fit::UnBinData data,
TF1 f1,
Foption_t option,
const ROOT::Math::MinimizerOptions moption 
)

fit an unbin data set (from tree or from histogram buffer) using a TF1 pointer and fit options.

N.B. ownership of fit data is passed to the UnBinFit function which will be responsible of deleting the data after the fit. User calling this function MUST NOT delete UnBinData after calling it.

Definition at line 809 of file HFitImpl.cxx.

Variable Documentation

◆ gDefaultErrorDef

double ROOT::Fit::gDefaultErrorDef = ROOT::Math::MinimizerOptions::DefaultErrorDef()

Definition at line 49 of file Fitter.cxx.

◆ gInitialResultStatus

const int ROOT::Fit::gInitialResultStatus = -99

Definition at line 43 of file FitResult.cxx.