class ROOT::Fit::Fitter


   Fitter class, entry point for performing all type of fits.
   Fits are performed using the generic ROOT::Fit::Fitter::Fit method.
   The inputs are the data points and a model function (using a ROOT::Math::IParamFunction)
   The result of the fit is returned and kept internally in the  ROOT::Fit::FitResult class.
   The configuration of the fit (parameters, options, etc...) are specified in the
   ROOT::Math::FitConfig class.

   @ingroup FitMain

Function Members (Methods)

public:
~Fitter()
const ROOT::Fit::FitConfig&Config() const
ROOT::Fit::FitConfig&Config()
boolFit(const ROOT::Fit::BinData& data)
boolFit(const ROOT::Fit::UnBinData& data)
boolFit(const ROOT::Fit::BinData& data, const ROOT::Math::IParametricFunctionMultiDim& func)
boolFit(const ROOT::Fit::UnBinData& data, const ROOT::Math::IParametricFunctionMultiDim& func)
boolFitFCN(ROOT::Fit::Fitter::MinuitFCN_t fcn)
boolFitFCN(const ROOT::Math::IMultiGenFunction& fcn, const double* params = 0, unsigned int dataSize = 0)
boolFitFCN(const ROOT::Math::IMultiGradFunction& fcn, const double* params = 0, unsigned int dataSize = 0)
ROOT::Fit::FitterFitter()
ROOT::Math::IMultiGenFunction*GetFCN()
ROOT::Math::Minimizer*GetMinimizer()
boolIsBinFit() const
boolLikelihoodFit(const ROOT::Fit::BinData& data)
boolLikelihoodFit(const ROOT::Fit::UnBinData& data)
boolLikelihoodFit(const ROOT::Fit::BinData& data, const ROOT::Math::IParametricFunctionMultiDim& func)
boolLikelihoodFit(const ROOT::Fit::UnBinData& data, const ROOT::Math::IParametricFunctionMultiDim& func)
boolLinearFit(const ROOT::Fit::BinData& data)
const ROOT::Fit::FitResult&Result() const
voidSetFunction(const ROOT::Fit::Fitter::IModelFunction& func)
voidSetFunction(const ROOT::Fit::Fitter::IModel1DFunction& func)
voidSetFunction(const ROOT::Fit::Fitter::IGradModelFunction& func)
voidSetFunction(const ROOT::Fit::Fitter::IGradModel1DFunction& func)
protected:
boolDoLeastSquareFit(const ROOT::Fit::BinData& data)
boolDoLikelihoodFit(const ROOT::Fit::BinData& data)
boolDoLikelihoodFit(const ROOT::Fit::UnBinData& data)
boolDoLinearFit(const ROOT::Fit::BinData& data)
private:
ROOT::Fit::FitterFitter(const ROOT::Fit::Fitter&)
ROOT::Fit::Fitter&operator=(const ROOT::Fit::Fitter& rhs)

Data Members

private:
boolfBinFitflag to indicate if fit is binned (in case of false the fit is unbinned or undefined)
ROOT::Fit::FitConfigfConfigfitter configuration (options and parameter settings)
ROOT::Fit::Fitter::IModelFunction*fFunccopy of the fitted function containing on output the fit result (managed by FitResult)
auto_ptr<ROOT::Math::Minimizer>fMinimizer! pointer to used minimizer
auto_ptr<ROOT::Math::IMultiGenFunction>fObjFunction! pointer to used objective function
auto_ptr<ROOT::Fit::FitResult>fResult! pointer to the object containing the result of the fit
boolfUseGradientflag to indicate if using gradient or not

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

bool FitFCN(unsigned int npar, Function f, const double * par, unsigned int datasize)
Fitter()
      Default constructor

~Fitter()
      Destructor

Fitter(const ROOT::Fit::Fitter& )
      Copy constructor (disabled, class is not copyable)

bool Fit( const Data & data, const Function & func)
       fit a data set using any  generic model  function
       Pre-requisite on the function:

SetFunction(func)
return Fit(data)
bool Fit(const BinData & data)
       fit a binned data set (default method: use chi2)
       To be implemented option to do likelihood bin fit

return DoLeastSquareFit(const ROOT::Fit::BinData& data)
bool Fit(const UnBinData & data)
       fit an binned data set using loglikelihood method

return DoLikelihoodFit(data)
bool LikelihoodFit(const Data & data)
      Likelihood fit

return DoLikelihoodFit(data)
bool LikelihoodFit( const Data & data, const Function & func)
       fit a data set using any  generic model  function
       Pre-requisite on the function:

SetFunction(func)
bool FitFCN(const ROOT::Math::IMultiGenFunction & fcn, const double * params = 0, unsigned int dataSize = 0 )
      fit using the given FCN function represented by a multi-dimensional function interface
      (ROOT::Math::IMultiGenFunction).
      Give optionally initial the parameter values and data size to have the fit Ndf correctly
      set in the FitResult.
      If the parameters values are not given (parameter pointers=0) the
      current parameter settings are used. The parameter settings can be created before
      by using the FitConfig::SetParamsSetting. If they have not been created they are created
      automatically when the params pointer is not zero

bool FitFCN(const ROOT::Math::IMultiGradFunction & fcn, const double * params = 0, unsigned int dataSize = 0)
      Fit using the given FCN function representing a multi-dimensional gradient function
      interface (ROOT::Math::IMultiGradFunction). In this case the minimizer will use the
      gradient information provided by the function.
      For the other arguments same consideration as in the previous method

bool LinearFit(const ROOT::Fit::BinData& data)
      do a linear fit on a set of bin-data

{ return DoLinearFit(data); }
void SetFunction(const IModelFunction & func)
       Set the fitted function (model function) from a parametric function interface

void SetFunction(const IModel1DFunction & func)
bool IsBinFit() const
      query if fit is binned. In cse of false teh fit can be unbinned
      or is not defined (like in case of fitting through a ::FitFCN)

{ return fBinFit; }
ROOT::Math::Minimizer * GetMinimizer()
      return pointer to last used minimizer
      (is NULL in case fit is not yet done)
      This pointer will be valid as far as the data, the objective function
      and the fitter class  have not been deleted.
      To be used only after fitting.


{ return fMinimizer.get(); }
ROOT::Math::IMultiGenFunction * GetFCN()
      return pointer to last used objective function
      (is NULL in case fit is not yet done)
      This pointer will be valid as far as the data and the fitter class
      have not been deleted. To be used after the fitting

{ return fObjFunction.get(); }
bool DoLinearFit(const ROOT::Fit::BinData& data)
 linear least square fit

Author: L. Moneta Wed Aug 30 11:05:19 2006
Last change: root/mathcore:$Id: Fitter.h 26866 2008-12-12 10:50:07Z moneta $
Last generated: 2008-12-12 12:11
Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.