ROOT logo
ROOT » MATH » MINUIT2 » ROOT::Minuit2::Minuit2Minimizer

class ROOT::Minuit2::Minuit2Minimizer: public ROOT::Math::Minimizer


   Minuit2Minimizer class implementing the ROOT::Math::Minimizer interface for
   Minuit2 minimization algorithm.
   In ROOT it can be instantiated using the plug-in manager (plug-in "Minuit2")
   Using a string  (used by the plugin manager) or via an enumeration
   an one can set all the possible minimization algorithms (Migrad, Simplex, Combined, Scan and Fumili).

Function Members (Methods)

public:
virtual~Minuit2Minimizer()
virtual voidClear()
virtual boolContour(unsigned int i, unsigned int j, unsigned int& npoints, double* xi, double* xj)
virtual doubleCorrelation(unsigned int i, unsigned int j) const
virtual doubleCovMatrix(unsigned int i, unsigned int j) const
virtual intCovMatrixStatus() const
virtual doubleEdm() const
doubleROOT::Math::Minimizer::ErrorDef() const
virtual const double*Errors() const
virtual boolGetCovMatrix(double* cov) const
virtual boolGetHessianMatrix(double* h) const
virtual boolGetMinosError(unsigned int i, double& errLow, double& errUp, int = 0)
virtual doubleGlobalCC(unsigned int i) const
virtual boolHesse()
boolROOT::Math::Minimizer::IsValidError() const
unsigned intROOT::Math::Minimizer::MaxFunctionCalls() const
unsigned intROOT::Math::Minimizer::MaxIterations() const
virtual const double*MinGradient() const
virtual boolMinimize()
ROOT::Minuit2::Minuit2MinimizerMinuit2Minimizer(ROOT::Minuit2::EMinimizerType type = ROOT::Minuit2::kMigrad)
ROOT::Minuit2::Minuit2MinimizerMinuit2Minimizer(const char* type)
virtual doubleMinValue() const
virtual unsigned intNCalls() const
virtual unsigned intNDim() const
virtual unsigned intNFree() const
virtual ROOT::Math::MinimizerOptionsROOT::Math::Minimizer::Options() const
doubleROOT::Math::Minimizer::Precision() const
intROOT::Math::Minimizer::PrintLevel() const
virtual voidPrintResults()
virtual boolProvidesError() const
virtual boolScan(unsigned int i, unsigned int& nstep, double* x, double* y, double xmin = 0, double xmax = 0)
voidROOT::Math::Minimizer::SetDefaultOptions()
voidROOT::Math::Minimizer::SetErrorDef(double up)
virtual boolSetFixedVariable(unsigned int, const string&, double)
virtual voidSetFunction(const ROOT::Math::IMultiGenFunction& func)
virtual voidSetFunction(const ROOT::Math::IMultiGradFunction& func)
virtual boolSetLimitedVariable(unsigned int ivar, const string& name, double val, double step, double, double)
virtual boolSetLowerLimitedVariable(unsigned int ivar, const string& name, double val, double step, double lower)
voidROOT::Math::Minimizer::SetMaxFunctionCalls(unsigned int maxfcn)
voidROOT::Math::Minimizer::SetMaxIterations(unsigned int maxiter)
voidROOT::Math::Minimizer::SetOptions(const ROOT::Math::MinimizerOptions& opt)
voidROOT::Math::Minimizer::SetPrecision(double prec)
voidROOT::Math::Minimizer::SetPrintLevel(int level)
voidROOT::Math::Minimizer::SetStrategy(int strategyLevel)
voidROOT::Math::Minimizer::SetTolerance(double tol)
virtual boolSetUpperLimitedVariable(unsigned int ivar, const string& name, double val, double step, double upper)
voidROOT::Math::Minimizer::SetValidError(bool on)
virtual boolSetVariable(unsigned int ivar, const string& name, double val, double step)
virtual boolSetVariableValue(unsigned int ivar, double val)
virtual boolSetVariableValues(const double* val)
intROOT::Math::Minimizer::Status() const
intROOT::Math::Minimizer::Strategy() const
doubleROOT::Math::Minimizer::Tolerance() const
virtual intVariableIndex(const string& name) const
virtual stringVariableName(unsigned int ivar) const
virtual const double*X() const
protected:
boolExamineMinimum(const ROOT::Minuit2::FunctionMinimum& min)
virtual const ROOT::Minuit2::FCNBase*GetFCN() const
virtual const ROOT::Minuit2::ModularFunctionMinimizer*GetMinimizer() const
virtual voidSetMinimizer(ROOT::Minuit2::ModularFunctionMinimizer* m)
voidSetMinimizerType(ROOT::Minuit2::EMinimizerType type)
private:
ROOT::Minuit2::Minuit2MinimizerMinuit2Minimizer(const ROOT::Minuit2::Minuit2Minimizer&)
ROOT::Minuit2::Minuit2Minimizer&operator=(const ROOT::Minuit2::Minuit2Minimizer& rhs)

Data Members

protected:
intROOT::Math::Minimizer::fDebugprint level
unsigned intROOT::Math::Minimizer::fMaxCallsmax number of function calls
unsigned intROOT::Math::Minimizer::fMaxItermax number or iterations used to find the minimum
doubleROOT::Math::Minimizer::fPrecprecision
intROOT::Math::Minimizer::fStatusstatus of minimizer
intROOT::Math::Minimizer::fStrategyminimizer strategy
doubleROOT::Math::Minimizer::fToltolerance (absolute)
doubleROOT::Math::Minimizer::fUperror scale
boolROOT::Math::Minimizer::fValidErrorflag to control if errors have been validated (Hesse has been run in case of Minuit)
private:
unsigned intfDimdimension of the function to be minimized
vector<double>fErrors
ROOT::Minuit2::ModularFunctionMinimizer*fMinimizer
ROOT::Minuit2::FunctionMinimum*fMinimum
ROOT::Minuit2::FCNBase*fMinuitFCN
ROOT::Minuit2::MnUserParameterStatefState
boolfUseFumili
vector<double>fValues

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Minuit2Minimizer(ROOT::Minuit2::EMinimizerType type = ROOT::Minuit2::kMigrad)
      Default constructor

Minuit2Minimizer(const char* type)
      Constructor with a char (used by PM)

virtual ~Minuit2Minimizer()
      Destructor (no operations)

Minuit2Minimizer(const ROOT::Minuit2::Minuit2Minimizer& )
 usually copying is non trivial, so we make this unaccessible

      Copy constructor

void Clear()
 clear resources (parameters) for consecutives minimizations
void SetFunction(const ROOT::Math::IMultiGenFunction& func)
 set the function to minimize
void SetFunction(const ROOT::Math::IMultiGradFunction& func)
 set gradient the function to minimize
bool SetVariable(unsigned int ivar, const string& name, double val, double step)
 set free variable
bool SetLowerLimitedVariable(unsigned int ivar, const string& name, double val, double step, double lower)
 set lower limit variable  (override if minimizer supports them )
bool SetUpperLimitedVariable(unsigned int ivar, const string& name, double val, double step, double upper)
 set upper limit variable (override if minimizer supports them )
bool SetLimitedVariable(unsigned int ivar, const string& name, double val, double step, double , double )
 set upper/lower limited variable (override if minimizer supports them )
bool SetFixedVariable(unsigned int , const string& , double )
 set fixed variable (override if minimizer supports them )
bool SetVariableValue(unsigned int ivar, double val)
 set variable
bool SetVariableValues(const double* val)
std::string VariableName(unsigned int ivar) const
 get name of variables (override if minimizer support storing of variable names)
int VariableIndex(const string& name) const
 get index of variable given a variable given a name
 return -1 if variable is not found
bool Minimize()
       method to perform the minimization.
       Return false in case the minimization did not converge. In this case a
       status code different than zero is set
       (retrieved by the derived method Minimizer::Status() )" 

       status = 1    : Covariance was made pos defined
       status = 2    : Hesse is invalid
       status = 3    : Edm is above max
       status = 4    : Reached call limit
       status = 5    : Any other failure

double MinValue() const
 return minimum function value
{ return fState.Fval(); }
double Edm() const
 return expected distance reached from the minimum
{ return fState.Edm(); }
const double * X() const
 return  pointer to X values at the minimum
const double * MinGradient() const
 return pointer to gradient values at the minimum
{ return 0; }
unsigned int NCalls() const
 number of function calls to reach the minimum
{ return fState.NFcn(); }
unsigned int NDim() const
 this is <= Function().NDim() which is the total
 number of variables (free+ constrained ones)
{ return fDim; }
unsigned int NFree() const
 number of free variables (real dimension of the problem)
 this is <= Function().NDim() which is the total
{ return fState.VariableParameters(); }
bool ProvidesError() const
 minimizer provides error and error matrix
{ return true; }
const double * Errors() const
 return errors at the minimum
double CovMatrix(unsigned int i, unsigned int j) const
       return covariance matrix elements
       if the variable is fixed or const the value is zero
       The ordering of the variables is the same as in errors and parameter value.
       This is different from the direct interface of Minuit2 or TMinuit where the
       values were obtained only to variable parameters

bool GetCovMatrix(double* cov) const
       Fill the passed array with the  covariance matrix elements
       if the variable is fixed or const the value is zero.
       The array will be filled as cov[i *ndim + j]
       The ordering of the variables is the same as in errors and parameter value.
       This is different from the direct interface of Minuit2 or TMinuit where the
       values were obtained only to variable parameters

bool GetHessianMatrix(double* h) const
       Fill the passed array with the Hessian matrix elements
       The Hessian matrix is the matrix of the second derivatives
       and is the inverse of the covariance matrix
       If the variable is fixed or const the values for that variables are zero.
       The array will be filled as h[i *ndim + j]

int CovMatrixStatus() const
      return the status of the covariance matrix

double Correlation(unsigned int i, unsigned int j) const
      return correlation coefficient between variable i and j.
      If the variable is fixed or const the return value is zero

double GlobalCC(unsigned int i) const
      get global correlation coefficient for the variable i. This is a number between zero and one which gives
      the correlation between the i-th variable  and that linear combination of all other variables which
      is most strongly correlated with i.
      If the variable is fixed or const the return value is zero

bool GetMinosError(unsigned int i, double& errLow, double& errUp, int = 0)
      get the minos error for parameter i, return false if Minos failed
      A minimizaiton must be performed befre, return false if no minimization has been done
      In case of Minos failed the status error is updated as following
      status += 10 * minosStatus where the minos status is:
       status = 1    : maximum number of function calls exceeded when running for lower error
       status = 2    : maximum number of function calls exceeded when running for upper error
       status = 3    : new minimum found when running for lower error
       status = 4    : new minimum found when running for upper error
       status = 5    : any other failure


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. A minimization must have been done before,
      return false if it is not the case

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 will be find for value of the function = Min + ErrorUp();

bool Hesse()
      perform a full calculation of the Hessian matrix for error calculation
      If a valid minimum exists the calculation is done on the minimum point otherwise is performed
      in the current set values of parameters
      Status code of minimizer is updated according to the following convention (in case Hesse failed)
      status += 100*hesseStatus where hesse status is:
      status = 1 : hesse failed
      status = 2 : matrix inversion failed
      status = 3 : matrix is not pos defined

void PrintResults()
 return reference to the objective function
virtual const ROOT::Math::IGenFunction & Function() const;
 print result of minimization
const ROOT::Minuit2::ModularFunctionMinimizer * GetMinimizer() const
 protected function for accessing the internal Minuit2 object. Needed for derived classes
{ return fMinimizer; }
void SetMinimizer(ROOT::Minuit2::ModularFunctionMinimizer* m)
{ fMinimizer = m; }
void SetMinimizerType(ROOT::Minuit2::EMinimizerType type)
const ROOT::Minuit2::FCNBase * GetFCN() const
{ return fMinuitFCN; }
bool ExamineMinimum(const ROOT::Minuit2::FunctionMinimum& min)
 examine the minimum result