17 #include <Minuit2/Minuit2Minimizer.h>
24 std::map<int, std::string> result;
25 result[0] =
"OK, valid minimum";
26 result[1] =
"Didn't converge, covariance was made pos defined";
27 result[2] =
"Didn't converge, Hessian is invalid";
28 result[3] =
"Didn't converge, Edm is above max";
29 result[4] =
"Didn't converge, reached call limit";
30 result[5] =
"Didn't converge, unknown failure";
36 std::map<int, std::string> result;
37 result[-1] =
"Not available (inversion failed or Hessian failed)";
38 result[0] =
"Available but not positive defined";
39 result[1] =
"Covariance only approximate";
40 result[2] =
"Full matrix but forced pos def";
41 result[3] =
"Full accurate";
51 addOption(
"Strategy", 1,
"Minimization strategy (0-low, 1-medium, 2-high quality)");
52 addOption(
"ErrorDef", 1.0,
"Error definition factor for parameter error calculation");
53 addOption(
"Tolerance", 0.01,
"Tolerance on the function value at the minimum");
54 addOption(
"Precision", -1.0,
"Relative floating point arithmetic precision");
55 addOption(
"PrintLevel", 0,
"Minimizer internal print level");
56 addOption(
"MaxFunctionCalls", 0,
"Maximum number of function calls");
68 return optionValue<int>(
"Strategy");
78 return optionValue<double>(
"ErrorDef");
88 return optionValue<double>(
"Tolerance");
98 return optionValue<double>(
"Precision");
108 return optionValue<int>(
"PrintLevel");
118 return optionValue<int>(
"MaxFunctionCalls");
131 result[
"functionCalls"] = std::to_string(
rootMinimizer()->NCalls());
Declares class Minuit2Minimizer.
Defines a few helper functions.
Info about a minimizer, including list of defined minimization algorithms.
Wrapper for the CERN ROOT facade of the Minuit2 minimizer.
void setPrecision(double value)
Sets relative floating point arithmetic precision.
void propagateOptions() override
Propagate options down to ROOT's Minuit2Minimizer.
Minuit2Minimizer(const std::string &algorithmName="Migrad")
void setMaxFunctionCalls(int value)
Sets maximum number of objective function calls.
std::unique_ptr< ROOT::Minuit2::Minuit2Minimizer > m_minuit2_minimizer
void setPrintLevel(int value)
Sets minimizer internal print level.
void setStrategy(int value)
Sets minimization strategy (0-low, 1-medium, 2-high minimization quality).
int maxFunctionCalls() const
const root_minimizer_t * rootMinimizer() const override
std::string statusToString() const override
Returns string representation of current minimizer status.
void setTolerance(double value)
Sets tolerance on the function value at the minimum.
void setErrorDefinition(double value)
Sets error definition factor for parameter error calculation.
std::map< std::string, std::string > statusMap() const override
Returns map of string representing different minimizer statuses.
bool requiresResiduals() override
Returns true if minimizer computations are residual-based, false otherwise.
double errorDefinition() const
Pure virtual interface that adapts the CERN ROOT minimizer to our IMinimizer.
OptionContainer::option_t addOption(const std::string &optionName, T value, const std::string &description="")
void setOptionValue(const std::string &optionName, T value)
ROOT::Math::Minimizer root_minimizer_t
std::string algorithmName() const override final
Returns name of the minimization algorithm.
virtual std::map< std::string, std::string > statusMap() const
Returns map of string representing different minimizer statuses.
std::string scientific(const T value, int n=10)
Returns scientific string representing given value of any numeric type.
std::map< int, std::string > covmatrixStatusDescription()
std::map< int, std::string > statusDescription()