13 #ifndef ROOT_TMinuitMinimizer
14 #define ROOT_TMinuitMinimizer
16 #ifndef ROOT_Math_Minimizer
95 virtual bool SetVariable(
unsigned int ivar,
const std::string &
name,
double val,
double step);
98 virtual bool SetLimitedVariable(
unsigned int ivar ,
const std::string & name ,
double val ,
double step ,
double ,
double );
107 virtual bool SetFixedVariable(
unsigned int ,
const std::string & ,
double );
138 virtual double Edm()
const;
141 virtual const double *
X()
const {
return &
fParams.front(); }
147 virtual unsigned int NCalls()
const;
155 virtual unsigned int NFree()
const;
167 virtual double CovMatrix(
unsigned int i,
unsigned int j)
const {
194 virtual double GlobalCC(
unsigned int )
const;
197 virtual bool GetMinosError(
unsigned int i,
double & errLow,
double & errUp,
int = 0);
202 virtual bool Hesse();
208 virtual bool Scan(
unsigned int i,
unsigned int &nstep,
double *
x,
double *
y,
double xmin = 0,
double xmax = 0);
214 virtual bool Contour(
unsigned int i,
unsigned int j,
unsigned int & npoints,
double *xi,
double *xj);
223 virtual std::string
VariableName(
unsigned int ivar)
const;
240 static void Fcn(
int &,
double * ,
double &
f,
double * ,
int);
242 static void FcnGrad(
int &,
double *
g,
double &
f,
double * ,
int);
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 )
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
virtual bool SetVariableStepSize(unsigned int, double)
set the step size of an existing variable
virtual bool Minimize()
method to perform the minimization
virtual std::string VariableName(unsigned int ivar) const
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const;...
bool CheckMinuitInstance() const
check TMinuit instance
static TMinuit * fgMinuit
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 )
Implementation in C++ of the Minuit package written by F.
Namespace for new ROOT classes and functions.
virtual double Edm() const
return expected distance reached from the minimum
std::vector< double > fParams
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
void RetrieveParams()
retrieve minimum parameters and errors from TMinuit
TMinuitMinimizer & operator=(const TMinuitMinimizer &rhs)
Assignment operator.
static void FcnGrad(int &, double *g, double &f, double *, int)
implementation of FCN for Minuit when user provided gradient is used
bool CheckVarIndex(unsigned int ivar) const
check parameter
virtual bool SetVariableUpperLimit(unsigned int, double)
set the upper-limit of an existing variable
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 )
virtual bool SetFixedVariable(unsigned int, const std::string &, double)
set fixed variable (override if minimizer supports them )
virtual double MinValue() const
return minimum function value
virtual const double * MinGradient() const
return pointer to gradient values at the minimum
virtual const double * Errors() const
return errors at the minimum
void SuppressMinuitWarnings(bool nowarn=true)
suppress the minuit warnings (if called with false will enable them) By default they are suppressed o...
void InitTMinuit(int ndim)
initialize the TMinuit instance
#define ClassDef(name, id)
virtual double GlobalCC(unsigned int) const
global correlation coefficient for variable i
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2, Minuit, GSL, etc..) Plug-in's exist in ROOT to be able to instantiate the derived classes like ROOT::Math::GSLMinimizer or ROOT::Math::Minuit2Minimizer via the plug-in manager.
virtual bool Hesse()
perform a full calculation of the Hessian matrix for error calculation
virtual bool ReleaseVariable(unsigned int)
release an existing variable
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.
virtual bool FixVariable(unsigned int)
fix an existing variable
static bool fgUseStaticMinuit
void DoReleaseFixParameter(int ivar)
release a parameter that is fixed when it is redefined
virtual bool SetVariableValue(unsigned int, double)
set the value of an existing variable
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...
static void Fcn(int &, double *, double &f, double *, int)
implementation of FCN for Minuit
virtual bool SetVariableLowerLimit(unsigned int, double)
set the lower-limit of an existing variable
void RetrieveErrorMatrix()
retrieve error matrix from TMinuit
virtual unsigned int NDim() const
this is <= Function().NDim() which is the total number of variables (free+ constrained ones) ...
virtual unsigned int NFree() const
number of free variables (real dimension of the problem) this is <= Function().NDim() which is the to...
virtual bool GetHessianMatrix(double *h) const
Fill the passed array with the Hessian matrix elements The Hessian matrix is the matrix of the second...
virtual bool ProvidesError() const
minimizer provides error and error matrix
virtual void SetFunction(const ROOT::Math::IMultiGenFunction &func)
set the function to minimize
virtual bool GetCovMatrix(double *cov) const
Fill the passed array with the covariance matrix elements if the variable is fixed or const the value...
ROOT::Minuit::EMinimizerType fType
virtual bool SetVariableLimits(unsigned int ivar, double lower, double upper)
set the limits of an existing variable
~TMinuitMinimizer()
Destructor (no operations)
TMinuitMinimizer(ROOT::Minuit::EMinimizerType type=ROOT::Minuit::kMigrad, unsigned int ndim=0)
Default constructor.
virtual bool IsFixedVariable(unsigned int) const
query if an existing variable is fixed (i.e.
double func(double *x, double *p)
virtual int CovMatrixStatus() const
return status of covariance matrix
virtual const double * X() const
return pointer to X values at the minimum
virtual int VariableIndex(const std::string &name) const
get index of variable given a variable given a name return always -1 .
TMinuitMinimizer class: ROOT::Math::Minimizer implementation based on TMinuit.
virtual void PrintResults()
return reference to the objective function virtual const ROOT::Math::IGenFunction & Function() const ...
virtual unsigned int NCalls() const
number of function calls to reach the minimum
std::vector< double > fCovar
virtual bool GetVariableSettings(unsigned int, ROOT::Fit::ParameterSettings &) const
get variable settings in a variable object (like ROOT::Fit::ParamsSettings)
static bool UseStaticMinuit(bool on=true)
static function to switch on/off usage of static global TMinuit instance (gMinuit) By default it is u...
Documentation for the abstract class IBaseFunctionMultiDim.
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 ...
std::vector< double > fErrors
virtual bool SetVariable(unsigned int ivar, const std::string &name, double val, double step)
set free variable
virtual bool GetMinosError(unsigned int i, double &errLow, double &errUp, int=0)
minos error for variable i, return false if Minos failed