13#ifndef ROOT_TMinuitMinimizer
14#define ROOT_TMinuitMinimizer
91 virtual bool SetVariable(
unsigned int ivar,
const std::string &
name,
double val,
double step);
94 virtual bool SetLimitedVariable(
unsigned int ivar ,
const std::string &
name ,
double val ,
double step ,
double ,
double );
103 virtual bool SetFixedVariable(
unsigned int ,
const std::string & ,
double );
134 virtual double Edm()
const;
137 virtual const double *
X()
const {
return &
fParams.front(); }
143 virtual unsigned int NCalls()
const;
151 virtual unsigned int NFree()
const;
163 virtual double CovMatrix(
unsigned int i,
unsigned int j)
const {
190 virtual double GlobalCC(
unsigned int )
const;
193 virtual bool GetMinosError(
unsigned int i,
double & errLow,
double & errUp,
int = 0);
198 virtual bool Hesse();
204 virtual bool Scan(
unsigned int i,
unsigned int &nstep,
double *
x,
double *
y,
double xmin = 0,
double xmax = 0);
210 virtual bool Contour(
unsigned int i,
unsigned int j,
unsigned int & npoints,
double *xi,
double *xj);
219 virtual std::string
VariableName(
unsigned int ivar)
const;
239 static void Fcn(
int &,
double * ,
double &
f,
double * ,
int);
241 static void FcnGrad(
int &,
double *
g,
double &
f,
double * ,
int);
#define ClassDef(name, id)
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
Documentation for the abstract class IBaseFunctionMultiDim.
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2,...
TMinuitMinimizer class: ROOT::Math::Minimizer implementation based on TMinuit.
virtual bool SetLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double, double)
set upper/lower limited variable (override if minimizer supports them )
TMinuitMinimizer(ROOT::Minuit::EMinimizerType type=ROOT::Minuit::kMigrad, unsigned int ndim=0)
Default constructor.
virtual bool GetMinosError(unsigned int i, double &errLow, double &errUp, int=0)
minos error for variable i, return false if Minos failed
virtual std::string VariableName(unsigned int ivar) const
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const;
virtual const double * X() const
return pointer to X values at the minimum
virtual const double * Errors() const
return errors at the minimum
virtual bool SetVariableStepSize(unsigned int, double)
set the step size of an existing variable
void RetrieveErrorMatrix()
retrieve error matrix from TMinuit
static TMinuit * fgMinuit
virtual bool Scan(unsigned int i, unsigned int &nstep, double *x, double *y, double xmin=0, double xmax=0)
scan a parameter i around the minimum.
static void Fcn(int &, double *, double &f, double *, int)
implementation of FCN for Minuit
static void FcnGrad(int &, double *g, double &f, double *, int)
implementation of FCN for Minuit when user provided gradient is used
ROOT::Minuit::EMinimizerType fType
virtual bool GetVariableSettings(unsigned int, ROOT::Fit::ParameterSettings &) const
get variable settings in a variable object (like ROOT::Fit::ParamsSettings)
virtual bool Minimize()
method to perform the minimization
virtual bool SetVariableLowerLimit(unsigned int, double)
set the lower-limit of an existing variable
virtual unsigned int NCalls() const
number of function calls to reach the minimum
void RetrieveParams()
retrieve minimum parameters and errors from TMinuit
virtual bool GetHessianMatrix(double *h) const
Fill the passed array with the Hessian matrix elements The Hessian matrix is the matrix of the second...
std::vector< double > fErrors
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)
set free variable
virtual bool GetCovMatrix(double *cov) const
Fill the passed array with the covariance matrix elements if the variable is fixed or const the value...
bool CheckMinuitInstance() const
check TMinuit instance
virtual bool SetLowerLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double lower)
set lower limit variable (override if minimizer supports them )
~TMinuitMinimizer()
Destructor (no operations)
static bool fgUseStaticMinuit
virtual int CovMatrixStatus() const
return status of covariance matrix
std::vector< double > fCovar
virtual bool ReleaseVariable(unsigned int)
release an existing variable
bool CheckVarIndex(unsigned int ivar) const
check parameter
virtual bool SetFixedVariable(unsigned int, const std::string &, double)
set fixed variable (override if minimizer supports them )
virtual double CovMatrix(unsigned int i, unsigned int j) const
return covariance matrices elements if the variable is fixed the matrix is zero The ordering of the v...
void SuppressMinuitWarnings(bool nowarn=true)
suppress the minuit warnings (if called with false will enable them) By default they are suppressed o...
virtual bool ProvidesError() const
minimizer provides error and error matrix
virtual void PrintResults()
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const ...
static bool UseStaticMinuit(bool on=true)
static function to switch on/off usage of static global TMinuit instance (gMinuit) By default it is u...
virtual bool IsFixedVariable(unsigned int) const
query if an existing variable is fixed (i.e.
virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper)
set the limits of an existing variable
virtual double GlobalCC(unsigned int) const
global correlation coefficient for variable i
virtual bool Contour(unsigned int i, unsigned int j, unsigned int &npoints, double *xi, double *xj)
find the contour points (xi,xj) of the function for parameter i and j around the minimum The contour ...
TMinuitMinimizer & operator=(const TMinuitMinimizer &rhs)
Assignment operator.
virtual double Edm() const
return expected distance reached from the minimum
virtual bool SetVariableValue(unsigned int, double)
set the value of an existing variable
void DoReleaseFixParameter(int ivar)
release a parameter that is fixed when it is redefined
virtual bool SetVariableUpperLimit(unsigned int, double)
set the upper-limit of an existing variable
virtual unsigned int NFree() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
virtual bool Hesse()
perform a full calculation of the Hessian matrix for error calculation
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
virtual double MinValue() const
return minimum function value
virtual bool FixVariable(unsigned int)
fix an existing variable
std::vector< double > fParams
void InitTMinuit(int ndim)
initialize the TMinuit instance
bool SetDebug(bool on=true)
set debug mode. Return true if setting was successfull
virtual bool SetUpperLimitedVariable(unsigned int ivar, const std::string &name, double val, double step, double upper)
set upper limit variable (override if minimizer supports them )
virtual int VariableIndex(const std::string &name) const
get index of variable given a variable given a name return always -1 .
virtual unsigned int NDim() const
this is <= Function().NDim() which is the total number of variables (free+ constrained ones)
Implementation in C++ of the Minuit package written by Fred James.
Namespace for new ROOT classes and functions.