ComPWA
Common Partial-Wave-Analysis Framework
MinuitResult.hpp
Go to the documentation of this file.
1 // Copyright (c) 2014, 2017 The ComPWA Team.
2 // This file is part of the ComPWA framework, check
3 // https://github.com/ComPWA/ComPWA/license.txt for details.
4 
5 #ifndef OPTIMIZER_MINUIT2_MINUITRESULT_HPP_
6 #define OPTIMIZER_MINUIT2_MINUITRESULT_HPP_
7 
8 #include "Core/FitResult.hpp"
9 
10 #include "boost/serialization/base_object.hpp"
11 
12 namespace ROOT {
13 namespace Minuit2 {
14 class FunctionMinimum;
15 } // namespace Minuit2
16 } // namespace ROOT
17 
18 namespace ComPWA {
19 namespace Optimizer {
20 namespace Minuit2 {
21 
22 struct MinuitResult : public FitResult {
23  MinuitResult() = default;
24  MinuitResult(const FitResult &Result,
25  const ROOT::Minuit2::FunctionMinimum &FMin);
26  bool CovPosDef = false; // covariance matrix pos.-def.
27  bool HasValidParameters = false; // valid parameters
28  bool HasValidCov = false; // valid covariance
29  bool HasAccCov = false; // accurate covariance
30  bool HasReachedCallLimit = false; // call limit reached
31  bool EdmAboveMax = false;
32  bool HesseFailed = false;
33  double ErrorDef = false;
34  unsigned int NFcn = 0;
35  double Edm = 0.0; // estimated distance to minimum
36  std::vector<double> GlobalCC;
37 
38  void write(std::string filename) const;
39 
40  friend std::ostream &operator<<(std::ostream &os, const MinuitResult &Result);
41 
42 private:
43  friend class boost::serialization::access;
44  template <class archive>
45  void serialize(archive &ar, const unsigned int version) {
46  using namespace boost::serialization;
47  ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(FitResult);
48  ar &BOOST_SERIALIZATION_NVP(CovPosDef);
49  ar &BOOST_SERIALIZATION_NVP(HasValidParameters);
50  ar &BOOST_SERIALIZATION_NVP(HasValidCov);
51  ar &BOOST_SERIALIZATION_NVP(HasAccCov);
52  ar &BOOST_SERIALIZATION_NVP(HasReachedCallLimit);
53  ar &BOOST_SERIALIZATION_NVP(EdmAboveMax);
54  ar &BOOST_SERIALIZATION_NVP(HesseFailed);
55  ar &BOOST_SERIALIZATION_NVP(ErrorDef);
56  ar &BOOST_SERIALIZATION_NVP(NFcn);
57  ar &BOOST_SERIALIZATION_NVP(Edm);
58  ar &BOOST_SERIALIZATION_NVP(GlobalCC);
59  }
60 };
61 
62 MinuitResult load(std::string filename);
63 
64 } // namespace Minuit2
65 } // namespace Optimizer
66 } // namespace ComPWA
67 
68 #endif
std::ostream & operator<<(std::ostream &os, const Event &ev)
Definition: Event.cpp:11
Data structure which resembles a general fit result.
Definition: FitResult.hpp:19
FitResult load(std::string filename)
Definition: FitResult.cpp:157
void serialize(archive &ar, const unsigned int version)