5 #include <Minuit2/FunctionMinimum.h> 6 #include <Minuit2/MnMigrad.h> 7 #include <Minuit2/MnPrint.h> 8 #include <Minuit2/MnUserParameterState.h> 9 #include <Minuit2/MnUserParameters.h> 11 #include <CLI/Timer.hpp> 20 auto val = Minuit2::MnPrint::Level();
21 Minuit2::MnPrint::SetLevel(verbosity);
26 CLI::Timer timer{
"The minimization took"};
28 Minuit2::MnMigrad migrad{fcn_, upar_};
34 CLI::Timer avetimer{
"Average time per call"};
35 Minuit2::FunctionMinimum min = migrad(maxfcn_);
41 std::cout <<
GooFit::magenta << timer.to_string() << GooFit::reset << std::endl;
42 std::cout << (avetimer / min.NFcn()).to_string() << std::endl;
50 std::cout <<
"HesseFailed: " << min.HesseFailed() << std::endl;
51 std::cout <<
"HasCovariance: " << min.HasCovariance() << std::endl;
52 std::cout <<
"HasValidCovariance: " << min.HasValidCovariance() << std::endl;
53 std::cout <<
"HasValidParameters: " << min.HasValidParameters() << std::endl;
54 std::cout <<
"IsAboveMaxEdm: " << min.IsAboveMaxEdm() << std::endl;
55 std::cout <<
"HasReachedCallLimit: " << min.HasReachedCallLimit() << std::endl;
56 std::cout <<
"HasAccurateCovar: " << min.HasAccurateCovar() << std::endl;
57 std::cout <<
"HasPosDefCovar : " << min.HasPosDefCovar() << std::endl;
58 std::cout <<
"HasMadePosDefCovar : " << min.HasMadePosDefCovar() << std::endl;
66 upar_.SetGooFitParams(min.UserState());
68 Minuit2::MnPrint::SetLevel(val);
FitManagerMinuit2(PdfBase *dat)
constexpr rang::style const bold
constexpr rang::fg const red
constexpr rang::style const reset
constexpr rang::fg const gray
constexpr rang::fg const magenta
ROOT::Minuit2::FunctionMinimum fit()
This runs the fit.
constexpr rang::fg const green