13#ifndef ROOT_Fit_Chi2FCN
14#define ROOT_Fit_Chi2FCN
45template<
class DerivFunType,
class ModelFunType = ROOT::Math::IParamMultiFunction>
50 typedef typename ModelFunType::BackendType
T;
113 using BaseObjFunction::operator();
117 double DataElement(
const double *
x,
unsigned int i,
double *
g,
double *
h =
nullptr,
bool fullHessian =
false)
const override {
164 return fGrad[icoord];
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
void SetData(const std::shared_ptr< DataType > &data)
Set the data pointer.
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
virtual const DataType & Data() const
access to const reference to the data
std::shared_ptr< DataType > DataPtr() const
access to data pointer
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
bool HasHessian() const override
flag to indicate if can compute Hessian
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
Chi2FCN class for binned fits using the least square methods.
BaseObjFunction::BaseFunction BaseFunction
BaseObjFunction::Type_t Type() const override
get type of fit method function
unsigned int fNEffPoints
number of effective points used in the fit
::ROOT::EExecutionPolicy fExecutionPolicy
BaseFunction * Clone() const override
double DoEval(const double *x) const override
Evaluation of the function (required by interface)
std::vector< double > fGrad
for derivatives
::ROOT::Math::IParamMultiFunctionTempl< T > IModelFunction
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.
BasicFCN< DerivFunType, ModelFunType, BinData > BaseFCN
ModelFunType::BackendType T
bool HasHessian() const override
flag to indicate if can compute Hessian (not when the model is integrated over the bins)
virtual void SetNFitPoints(unsigned int n) const
set number of fit points (need to be called in const methods, make it const)
Chi2FCN(const Chi2FCN &f)
Copy constructor.
::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
BaseObjFunction::Type_t Type_t
void Gradient(const double *x, double *g) const override
Chi2FCN & operator=(const Chi2FCN &rhs)
Assignment operator.
double DoDerivative(const double *x, unsigned int icoord) const override
double DataElement(const double *x, unsigned int i, double *g, double *h=nullptr, bool fullHessian=false) const override
i-th chi-square residual
virtual ~Chi2FCN()
Destructor (no operations)
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.
Type_t
enumeration specifying the possible fit method types
static bool IsAGradFCN()
Static function to indicate if a function is supporting gradient.
FunctionType::BaseFunc BaseFunction
virtual void UpdateNCalls() const
update number of calls
IParamFunction interface (abstract class) describing multi-dimensional parametric functions It is a d...
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Chi2FCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunction > Chi2Function
Chi2FCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunction > Chi2GradFunction