diff --git a/math/minuit2/inc/Minuit2/MnStrategy.h b/math/minuit2/inc/Minuit2/MnStrategy.h index 519bf832dfaef..dafa4d108e619 100644 --- a/math/minuit2/inc/Minuit2/MnStrategy.h +++ b/math/minuit2/inc/Minuit2/MnStrategy.h @@ -131,6 +131,14 @@ namespace Minuit2 { the case of high stats) and the forward finite difference (default) behaviour leads incorrectly to a non-positive-definite covariance matrix. + + The strategy level only sets the defaults: when Minuit2 is used through + ROOT::Minuit2::Minuit2Minimizer, the tunables listed below can also be overridden + individually, by name, through the "Minuit2" extra options of + ROOT::Math::MinimizerOptions. That is the way to pick up a single behaviour of a + higher strategy (most usefully **HessianCentralFDMixedDerivatives**) without + paying for all the others. + diff --git a/math/minuit2/src/Minuit2Minimizer.cxx b/math/minuit2/src/Minuit2Minimizer.cxx index 748869c8f53d8..9788394f02d09 100644 --- a/math/minuit2/src/Minuit2Minimizer.cxx +++ b/math/minuit2/src/Minuit2Minimizer.cxx @@ -443,6 +443,11 @@ ROOT::Minuit2::MnStrategy customizedStrategy(unsigned int strategyLevel, ROOT::M st.SetHessianStepTolerance(customize("HessianStepTolerance", st.HessianStepTolerance())); st.SetHessianG2Tolerance(customize("HessianG2Tolerance", st.HessianG2Tolerance())); + // These two are the parts of strategy 3 that matter most for ill-conditioned problems + st.SetHessianCentralFDMixedDerivatives( + customize("HessianCentralFDMixedDerivatives", int(st.HessianCentralFDMixedDerivatives()))); + st.SetHessianForcePosDef(customize("HessianForcePosDef", int(st.HessianForcePosDef()))); + return st; }