13 #ifndef ROOT_Fit_Chi2FCN 14 #define ROOT_Fit_Chi2FCN 48 template<
class DerivFunType,
class ModelFunType = ROOT::Math::IParamMultiFunction>
53 typedef typename ModelFunType::BackendType
T;
69 fGrad (
std::vector<double> ( func->NPar() ) ),
80 fGrad (
std::vector<double> ( func.NPar() ) ),
111 virtual BaseFunction *
Clone()
const {
117 using BaseObjFunction::operator();
121 virtual double DataElement(
const double *
x,
unsigned int i,
double *g)
const {
127 virtual void Gradient(
const double *
x,
double *g)
const {
147 virtual double DoEval (
const double *
x)
const {
158 return fGrad[icoord];
static double EvalChi2Residual(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int i, double *g=0)
virtual void Gradient(const double *x, double *g) const
ModelFunType::BackendType T
virtual void UpdateNCalls() const
update number of calls
Type_t
enumeration specyfing the possible fit method types
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
void SetData(const std::shared_ptr< BinData > &data)
Set the data pointer.
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
Namespace for new ROOT classes and functions.
std::shared_ptr< BinData > DataPtr() const
access to data pointer
BaseObjFunction::BaseFunction BaseFunction
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
static void EvalChi2Gradient(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, double *g, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy=ROOT::Fit::ExecutionPolicy::kSerial, unsigned nChunks=0)
Chi2FCN & operator=(const Chi2FCN &rhs)
Assignment operator.
Chi2FCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunction > Chi2Function
virtual const BinData & Data() const
access to const reference to the data
virtual void SetNFitPoints(unsigned int n) const
set number of fit points (need to be called in const methods, make it const)
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th chi-square residual
Chi2FCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunction > Chi2GradFunction
Chi2FCN(const std::shared_ptr< BinData > &data, const std::shared_ptr< IModelFunction > &func, const ROOT::Fit::ExecutionPolicy &executionPolicy=ROOT::Fit::ExecutionPolicy::kSerial)
Constructor from data set (binned ) and model function.
static double EvalChi2(const IModelFunction &func, const BinData &data, const double *p, unsigned int &nPoints, ROOT::Fit::ExecutionPolicy executionPolicy, unsigned nChunks=0)
ROOT::Fit::ExecutionPolicy fExecutionPolicy
Chi2FCN(const BinData &data, const IModelFunction &func, const ROOT::Fit::ExecutionPolicy &executionPolicy=ROOT::Fit::ExecutionPolicy::kSerial)
Same Constructor from data set (binned ) and model function but now managed by the user we clone the ...
BaseObjFunction::Type_t Type_t
Chi2FCN class for binnned fits using the least square methods.
::ROOT::Math::IParamMultiFunctionTempl< T > IModelFunction
virtual ~Chi2FCN()
Destructor (no operations)
BasicFCN< DerivFunType, ModelFunType, BinData > BaseFCN
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
DerivFunType ::BaseFunc BaseFunction
* x
Deprecated and error prone model selection interface.
static double EvalChi2Effective(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int &nPoints)
virtual BaseFunction * Clone() const
::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
std::vector< double > fGrad
virtual double DoDerivative(const double *x, unsigned int icoord) const
Chi2FCN(const Chi2FCN &f)
Copy constructor.