41 BasisFunction(
const Func &
f,
int k) :
47 return fFunc->ParameterDerivative(
x,fKPar);
94 std::string algoname(
type);
95 std::transform(algoname.begin(), algoname.end(), algoname.begin(), (
int(*)(
int)) tolower );
97 if (algoname.find(
"robust") != std::string::npos)
fRobust =
true;
116 if (
this == &rhs)
return *
this;
124 Error(
"TLinearMinimizer::SetFunction(IMultiGenFunction)",
"Wrong type of function used for Linear fitter");
133 const Chi2Func * chi2func =
dynamic_cast<const Chi2Func *
>(&objfunc);
135 Error(
"TLinearMinimizer::SetFunction(IMultiGradFunction)",
"Wrong type of function used for Linear fitter");
142 const ModelFunc * modfunc =
dynamic_cast<const ModelFunc*
>( &(chi2func->ModelFunction()) );
143 assert(modfunc != 0);
145 fDim = chi2func->NDim();
150 for (
unsigned int i = 0; i <
fDim; ++i) {
155 BasisFunction<ModelFunc > bf(*modfunc,i);
157 std::string fname =
"_LinearMinimimizer_BasisFunction_" +
174 for (
unsigned int i = 0; i < data.
Size(); ++i) {
207 std::cout <<
"TLinearMinimizer: Robust fitting with h = " <<
h << std::endl;
213 Warning(
"Minimize",
"TLinearFitter failed in finding the solution");
222 for (
unsigned int i = 0; i <
fDim; ++i) {
void Error(const char *location, const char *msgfmt,...)
void Warning(const char *location, const char *msgfmt,...)
TRObject operator()(const T1 &t1) const
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
const double * GetPoint(unsigned int ipoint, double &value) const
retrieve at the same time a pointer to the coordinate data and the fit value More efficient than call...
double Error(unsigned int ipoint) const
Chi2FCN class for binnned fits using the least square methods.
unsigned int Size() const
return number of fit points
const DataOptions & Opt() const
access to options
Documentation for the abstract class IBaseFunctionMultiDim.
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition ...
double Tolerance() const
absolute tolerance
int PrintLevel() const
minimizer configuration parameters
Param Functor class for Multidimensional functions.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
The Linear Fitter - For fitting functions that are LINEAR IN PARAMETERS.
virtual Double_t * GetCovarianceMatrix() const
Returns covariance matrix.
virtual Double_t GetParError(Int_t ipar) const
Returns the error of parameter #ipar.
virtual Int_t Eval()
Perform the fit and evaluate the parameters Returns 0 if the fit is ok, 1 if there are errors.
virtual Double_t GetParameter(Int_t ipar) const
virtual void SetBasisFunctions(TObjArray *functions)
set the basis functions in case the fitting function is not set directly The TLinearFitter will manag...
virtual void FixParameter(Int_t ipar)
Fixes paramter #ipar at its current value.
virtual Int_t EvalRobust(Double_t h=-1)
Finds the parameters of the fitted function in case data contains outliers.
virtual void AddPoint(Double_t *x, Double_t y, Double_t e=1)
Adds 1 point to the fitter.
virtual void StoreData(Bool_t store)
TLinearMinimizer class: minimizer implementation based on TMinuit.
virtual ~TLinearMinimizer()
Destructor (no operations)
virtual bool SetFixedVariable(unsigned int, const std::string &, double)
set fixed variable (override if minimizer supports them )
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the fit model function
TLinearMinimizer & operator=(const TLinearMinimizer &rhs)
Assignment operator.
bool fRobust
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const;
virtual bool Minimize()
method to perform the minimization
const ROOT::Math::IMultiGradFunction * fObjFunc
std::vector< double > fParams
TLinearMinimizer(int type=0)
Default constructor.
std::vector< double > fCovar
std::vector< double > fErrors
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
RooCmdArg Minimizer(const char *type, const char *alg=0)