9 #include "Minuit2/FunctionMinimum.h" 10 #include "Minuit2/MnUserParameters.h" 12 #include <boost/archive/xml_iarchive.hpp> 13 #include <boost/archive/xml_oarchive.hpp> 21 std::vector<double> GlobalCC;
22 if (minState.HasGlobalCC()) {
23 GlobalCC = minState.GlobalCC().GlobalCC();
25 auto NumFreeParameter = minState.Parameters().Trafo().VariableParameters();
26 GlobalCC = std::vector<double>(NumFreeParameter, 0);
28 <<
"getGlobalCorrelations() | no valid global correlation available!";
34 const ROOT::Minuit2::FunctionMinimum &FMin)
35 :
FitResult(Result), CovPosDef(FMin.HasPosDefCovar()),
36 HasValidParameters(FMin.HasValidParameters()),
37 HasValidCov(FMin.HasValidCovariance()),
38 HasAccCov(FMin.HasAccurateCovar()),
39 HasReachedCallLimit(FMin.HasReachedCallLimit()),
40 EdmAboveMax(FMin.IsAboveMaxEdm()), HesseFailed(FMin.HesseFailed()),
41 ErrorDef(FMin.Up()), NFcn(FMin.NFcn()), Edm(FMin.Edm()),
48 os <<
"--------------MINUIT2 FIT INFOS----------------\n";
50 os <<
" *** MINIMUM NOT VALID! ***\n";
51 os <<
"Estimated distance to minimum: " << Result.
Edm <<
"\n";
53 os <<
" *** EDM IS ABOVE MAXIMUM! ***\n";
54 os <<
"Error definition: " << Result.
ErrorDef <<
"\n";
55 os <<
"Number of calls: " << Result.
NFcn <<
"\n";
57 os <<
" *** LIMIT OF MAX CALLS REACHED! ***\n";
59 os <<
" *** NO VALID SET OF PARAMETERS! ***\n";
61 os <<
" *** COVARIANCE MATRIX NOT VALID! ***\n";
63 os <<
" *** COVARIANCE MATRIX NOT ACCURATE! ***\n";
65 os <<
" *** COVARIANCE MATRIX NOT POSITIVE DEFINITE! ***\n";
67 os <<
" *** HESSE FAILED! ***\n";
68 os <<
"-----------------------------------------------\n";
73 std::ofstream ofs(filename);
74 boost::archive::xml_oarchive oa(ofs);
75 oa << boost::serialization::make_nvp(
"MinuitResult", *
this);
80 std::ifstream ifs(filename);
82 boost::archive::xml_iarchive ia(ifs);
83 ia >> boost::serialization::make_nvp(
"MinuitResult", Result);
std::vector< double > getGlobalCorrelations(const ROOT::Minuit2::MnUserParameterState &minState)
friend std::ostream & operator<<(std::ostream &os, const MinuitResult &Result)
Data structure which resembles a general fit result.
void write(std::string filename) const
MinuitResult load(std::string filename)