13 #ifndef ROOT_Fit_Chi2FCN
14 #define ROOT_Fit_Chi2FCN
16 #ifndef ROOT_Fit_BasicFCN
20 #ifndef ROOT_Math_IParamFunction
25 #ifndef ROOT_Fit_BinData
30 #ifndef ROOT_Fit_FitUtil
36 #ifdef ROOT_FIT_PARALLEL
37 #ifndef ROOT_Fit_FitUtilParallel
65 template<
class FunType>
82 Chi2FCN (
const std::shared_ptr<BinData> & data,
const std::shared_ptr<IModelFunction> &
func) :
124 virtual BaseFunction *
Clone()
const {
130 using BaseObjFunction::operator();
134 virtual double DataElement(
const double *
x,
unsigned int i,
double *
g)
const {
160 virtual double DoEval (
const double *
x)
const {
162 #ifdef ROOT_FIT_PARALLEL
175 return fGrad[icoord];
BaseObjFunction::Type_t Type_t
void EvaluateChi2Gradient(const IModelFunction &func, const BinData &data, const double *x, double *grad, unsigned int &nPoints)
evaluate the Chi2 gradient given a model function and the data at the point x.
Namespace for new ROOT classes and functions.
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
BasicFCN< FunType, BinData > BaseFCN
virtual ~Chi2FCN()
Destructor (no operations)
Chi2FCN & operator=(const Chi2FCN &rhs)
Assignment operator.
virtual const BinData & Data() const
access to const reference to the data
::ROOT::Math::IParamMultiFunction IModelFunction
BaseObjFunction::BaseFunction BaseFunction
Chi2FCN(const Chi2FCN &f)
Copy constructor.
::ROOT::Math::BasicFitMethodFunction< FunType > BaseObjFunction
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th chi-square residual
Chi2FCN class for binnned fits using the least square methods.
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
void SetData(const std::shared_ptr< BinData > &data)
Set the data pointer.
double EvaluateChi2Effective(const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints)
evaluate the effective Chi2 given a model function and the data at the point x.
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
double EvaluateChi2Residual(const IModelFunction &func, const BinData &data, const double *x, unsigned int ipoint, double *g=0)
Parallel evaluate the Chi2 given a model function and the data at the point x.
virtual void SetNFitPoints(unsigned int n) const
set number of fit points (need to be called in const methods, make it const)
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
FunType::BaseFunc BaseFunction
virtual double DoDerivative(const double *x, unsigned int icoord) const
double EvaluateChi2(const IModelFunction &func, const BinData &data, const double *x, unsigned int &nPoints)
Chi2 Functions.
Chi2FCN< ROOT::Math::IMultiGenFunction > Chi2Function
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Chi2FCN< ROOT::Math::IMultiGradFunction > Chi2GradFunction
virtual void Gradient(const double *x, double *g) const
double func(double *x, double *p)
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
virtual BaseFunction * Clone() const
IParametricFunctionMultiDim IParamMultiFunction
std::vector< double > fGrad
virtual void UpdateNCalls() const
update number of calls
Chi2FCN(const BinData &data, const IModelFunction &func)
Same Constructor from data set (binned ) and model function but now managed by the user we clone the ...
Type_t
enumeration specyfing the possible fit method types
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
std::shared_ptr< BinData > DataPtr() const
access to data pointer
Chi2FCN(const std::shared_ptr< BinData > &data, const std::shared_ptr< IModelFunction > &func)
Constructor from data set (binned ) and model function.