18 #include <boost/format.hpp>
29 template <
typename T> std::string
reportValue(
const std::string& name, T value)
31 std::ostringstream result;
32 result << std::setw(
column_width) << std::left << name <<
": " << value << std::endl;
44 std::ostringstream result;
56 std::ostringstream result;
60 result <<
"Name StartValue Limits FitValue"
61 <<
" Error" << std::endl;
63 for (
const auto& par : parameters) {
64 result << boost::format(
"%-26.26s %-8.3e %-28s %-8.3e %8.3e \n") % par.name()
65 % par.startValue() % par.limits().toString() % par.value() % par.error();
69 if (!matrix.empty()) {
71 for (
size_t i = 0; i < matrix.size(); ++i) {
72 result << boost::format(
"#%-2d ") % i;
73 for (
size_t j = 0; j < matrix[i].size(); ++j)
74 result << boost::format(
"%_7.4f ") % matrix[i][j];
87 std::ostringstream result;
98 std::ostringstream result;
100 for (
auto option : minimizer.
options()) {
101 std::ostringstream opt;
102 opt << std::setw(5) << std::left << option->value() << option->description();
113 std::ostringstream result;
117 for (
auto it : status)
Declares MinimizerResultUtils namespace.
Declares namespace MinimizerUtils.
Declares class RootMinimizerAdapter.
A collection of fit parameters.
corr_matrix_t correlationMatrix() const
std::vector< std::vector< double > > corr_matrix_t
std::string toOptionString() const
Returns string with all options (i.e. "Strategy=1;Tolerance=0.01;")
Pure virtual interface that adapts the CERN ROOT minimizer to our IMinimizer.
std::string minimizerName() const override final
Returns name of the minimizer.
std::string algorithmName() const override final
Returns name of the minimization algorithm.
MinimizerOptions & options()
virtual std::map< std::string, std::string > statusMap() const
Returns map of string representing different minimizer statuses.
Objective function types.
std::string reportToString(const RootMinimizerAdapter &minimizer)
Reports results of minimization in the form of multi-line string.
std::string reportParameters(const Fit::Parameters ¶meters)
Reports fit parameters settings and final results.
std::string sectionString(const std::string §ionName="", size_t report_width=80)
Returns horizontal line of 80 characters length with section name in it.
std::string reportDescription(const RootMinimizerAdapter &minimizer)
std::string reportStatus(const RootMinimizerAdapter &minimizer)
std::string reportValue(const std::string &name, T value)
std::string reportOption(const RootMinimizerAdapter &minimizer)