Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType > Class Template Reference

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
class ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >

Chi2FCN class for binned fits using the least square methods.

Definition at line 46 of file Chi2FCN.h.

Public Types

typedef BasicFCN< DerivFunType, ModelFunType, BinDataBaseFCN
 
typedef BaseObjFunction::BaseFunction BaseFunction
 
typedef ::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
 
typedef ::ROOT::Math::IParamMultiFunctionTempl< TIModelFunction
 
typedef ModelFunType::BackendType T
 
typedef BaseObjFunction::Type_t Type_t
 
- Public Types inherited from ROOT::Math::BasicFitMethodFunction< DerivFunType >
typedef FunctionType::BaseFunc BaseFunction
 
enum  Type_t
 enumeration specifying the possible fit method types More...
 

Public Member Functions

 Chi2FCN (const BinData &data, const IModelFunction &func, const ::ROOT::EExecutionPolicy &executionPolicy=::ROOT::EExecutionPolicy::kSequential)
 Same Constructor from data set (binned ) and model function cloning the function and the data.
 
 Chi2FCN (const Chi2FCN &f)
 Copy constructor.
 
 Chi2FCN (const std::shared_ptr< BinData > &data, const std::shared_ptr< IModelFunction > &func, const ::ROOT::EExecutionPolicy &executionPolicy=::ROOT::EExecutionPolicy::kSequential)
 Constructor from data set (binned ) and model function.
 
virtual ~Chi2FCN ()
 Destructor (no operations)
 
virtual BaseFunctionClone () const
 
virtual double DataElement (const double *x, unsigned int i, double *g, double *h=nullptr, bool fullHessian=false) const
 i-th chi-square residual
 
virtual void Gradient (const double *x, double *g) const
 
Chi2FCNoperator= (const Chi2FCN &rhs)
 Assignment operator.
 
virtual BaseObjFunction::Type_t Type () const
 get type of fit method function
 
- Public Member Functions inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
virtual const DataType & Data () const
 access to const reference to the data
 
std::shared_ptr< DataType > DataPtr () const
 access to data pointer
 
virtual bool HasHessian () const
 flag to indicate if can compute Hessian
 
virtual const IModelFunctionModelFunction () const
 access to const reference to the model function
 
std::shared_ptr< IModelFunctionModelFunctionPtr () const
 access to function pointer
 
- Public Member Functions inherited from ROOT::Math::BasicFitMethodFunction< DerivFunType >
 BasicFitMethodFunction (int dim, int npoint)
 
 ~BasicFitMethodFunction () override
 Virtual Destructor (no operations)
 
virtual bool G2 (const double *, double *) const
 Computes the Second derivatives.
 
virtual bool Hessian (const double *x, double *hess) const
 Computes the full Hessian.
 
bool IsAGradFCN ()
 
virtual unsigned int NCalls () const
 return the total number of function calls (override if needed)
 
unsigned int NDim () const override
 Number of dimension (parameters) .
 
virtual unsigned int NPoints () const
 return the number of data points used in evaluating the function
 
virtual void ResetNCalls ()
 reset number of function calls
 
virtual void UpdateNCalls () const
 update number of calls
 

Protected Member Functions

virtual void SetNFitPoints (unsigned int n) const
 set number of fit points (need to be called in const methods, make it const)
 
- Protected Member Functions inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
 BasicFCN (const std::shared_ptr< DataType > &data, const std::shared_ptr< IModelFunction > &func)
 Constructor from data set and model function.
 
virtual ~BasicFCN ()
 Destructor (no operations)
 
void SetData (const std::shared_ptr< DataType > &data)
 Set the data pointer.
 
void SetModelFunction (const std::shared_ptr< IModelFunction > &func)
 Set the function pointer.
 

Private Member Functions

virtual double DoDerivative (const double *x, unsigned int icoord) const
 
virtual double DoEval (const double *x) const
 Evaluation of the function (required by interface)
 

Private Attributes

::ROOT::EExecutionPolicy fExecutionPolicy
 
std::vector< doublefGrad
 for derivatives
 
unsigned int fNEffPoints
 number of effective points used in the fit
 

Additional Inherited Members

- Static Public Member Functions inherited from ROOT::Math::BasicFitMethodFunction< DerivFunType >
static bool IsAGradFCN ()
 Static function to indicate if a function is supporting gradient.
 
- Protected Types inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
typedef BaseObjFunction::BaseFunction BaseFunction
 
typedef ::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
 
typedef ::ROOT::Math::IParametricGradFunctionMultiDimTempl< TIGradModelFunction
 
typedef ::ROOT::Math::IParamMultiFunctionTempl< TIModelFunction
 
typedef ModelFunType::BackendType T
 
- Protected Attributes inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
std::shared_ptr< DataType > fData
 
std::shared_ptr< IModelFunctionfFunc
 

#include <Fit/Chi2FCN.h>

Inheritance diagram for ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >:
[legend]

Member Typedef Documentation

◆ BaseFCN

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef BasicFCN<DerivFunType, ModelFunType, BinData> ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::BaseFCN

Definition at line 51 of file Chi2FCN.h.

◆ BaseFunction

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef BaseObjFunction::BaseFunction ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::BaseFunction

Definition at line 54 of file Chi2FCN.h.

◆ BaseObjFunction

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef ::ROOT::Math::BasicFitMethodFunction<DerivFunType> ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::BaseObjFunction

Definition at line 53 of file Chi2FCN.h.

◆ IModelFunction

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef ::ROOT::Math::IParamMultiFunctionTempl<T> ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::IModelFunction

Definition at line 57 of file Chi2FCN.h.

◆ T

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef ModelFunType::BackendType ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::T

Definition at line 50 of file Chi2FCN.h.

◆ Type_t

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef BaseObjFunction::Type_t ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Type_t

Definition at line 58 of file Chi2FCN.h.

Constructor & Destructor Documentation

◆ Chi2FCN() [1/3]

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Chi2FCN ( const std::shared_ptr< BinData > &  data,
const std::shared_ptr< IModelFunction > &  func,
const ::ROOT::EExecutionPolicy executionPolicy = ::ROOT::EExecutionPolicy::kSequential 
)
inline

Constructor from data set (binned ) and model function.

Definition at line 63 of file Chi2FCN.h.

◆ Chi2FCN() [2/3]

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Chi2FCN ( const BinData data,
const IModelFunction func,
const ::ROOT::EExecutionPolicy executionPolicy = ::ROOT::EExecutionPolicy::kSequential 
)
inline

Same Constructor from data set (binned ) and model function cloning the function and the data.

Definition at line 73 of file Chi2FCN.h.

◆ ~Chi2FCN()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::~Chi2FCN ( )
inlinevirtual

Destructor (no operations)

Definition at line 83 of file Chi2FCN.h.

◆ Chi2FCN() [3/3]

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Chi2FCN ( const Chi2FCN< DerivFunType, ModelFunType > &  f)
inline

Copy constructor.

Definition at line 87 of file Chi2FCN.h.

Member Function Documentation

◆ Clone()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual BaseFunction * ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Clone ( ) const
inlinevirtual

Definition at line 107 of file Chi2FCN.h.

◆ DataElement()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual double ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::DataElement ( const double x,
unsigned int  i,
double g,
double h = nullptr,
bool  fullHessian = false 
) const
inlinevirtual

i-th chi-square residual

Implements ROOT::Math::BasicFitMethodFunction< DerivFunType >.

Definition at line 117 of file Chi2FCN.h.

◆ DoDerivative()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual double ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::DoDerivative ( const double x,
unsigned int  icoord 
) const
inlineprivatevirtual

Definition at line 153 of file Chi2FCN.h.

◆ DoEval()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual double ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::DoEval ( const double x) const
inlineprivatevirtual

Evaluation of the function (required by interface)

Definition at line 144 of file Chi2FCN.h.

◆ Gradient()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual void ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Gradient ( const double x,
double g 
) const
inlinevirtual

Definition at line 123 of file Chi2FCN.h.

◆ operator=()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
Chi2FCN & ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::operator= ( const Chi2FCN< DerivFunType, ModelFunType > &  rhs)
inline

Assignment operator.

Definition at line 97 of file Chi2FCN.h.

◆ SetNFitPoints()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual void ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::SetNFitPoints ( unsigned int  n) const
inlineprotectedvirtual

set number of fit points (need to be called in const methods, make it const)

Definition at line 137 of file Chi2FCN.h.

◆ Type()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual BaseObjFunction::Type_t ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::Type ( ) const
inlinevirtual

get type of fit method function

Reimplemented from ROOT::Math::BasicFitMethodFunction< DerivFunType >.

Definition at line 131 of file Chi2FCN.h.

Member Data Documentation

◆ fExecutionPolicy

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
::ROOT::EExecutionPolicy ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::fExecutionPolicy
private

Definition at line 162 of file Chi2FCN.h.

◆ fGrad

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
std::vector<double> ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::fGrad
mutableprivate

for derivatives

Definition at line 161 of file Chi2FCN.h.

◆ fNEffPoints

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
unsigned int ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType >::fNEffPoints
mutableprivate

number of effective points used in the fit

Definition at line 159 of file Chi2FCN.h.

  • math/mathcore/inc/Fit/Chi2FCN.h