13 #ifndef ROOT_Fit_Chi2FCN 14 #define ROOT_Fit_Chi2FCN 16 #ifndef ROOT_Fit_BasicFCN 20 #ifndef ROOT_Math_IParamFunction 27 #ifndef ROOT_Fit_BinData 32 #ifndef ROOT_Fit_FitUtil 38 #ifdef ROOT_FIT_PARALLEL 39 #ifndef ROOT_Fit_FitUtilParallel 67 template<
class FunType>
84 Chi2FCN (
const std::shared_ptr<BinData> & data,
const std::shared_ptr<IModelFunction> &
func) :
126 virtual BaseFunction *
Clone()
const {
132 using BaseObjFunction::operator();
136 virtual double DataElement(
const double *
x,
unsigned int i,
double * g)
const {
142 virtual void Gradient(
const double *
x,
double *g)
const {
162 virtual double DoEval (
const double *
x)
const {
164 #ifdef ROOT_FIT_PARALLEL 177 return fGrad[icoord];
BaseObjFunction::Type_t Type_t
Type_t
enumeration specyfing the possible fit method types
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.
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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 ...
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.