1 #ifndef CORE_FITPARAMETER_HPP_ 2 #define CORE_FITPARAMETER_HPP_ 11 #include <boost/serialization/nvp.hpp> 12 #include <boost/serialization/utility.hpp> 21 FitParameter(std::string name, T val, T min, T max,
bool isfixed =
true)
34 if (x.
Error.first != 0.0 || x.
Error.second != 0.0) {
36 os <<
" +- " << x.
Error.second;
38 os <<
" + " << x.
Error.second <<
" - " << x.
Error.first;
41 os <<
" Bounds: [" << x.
Bounds.first <<
", " << x.
Bounds.second <<
"]";
53 const std::vector<ComPWA::Parameter> &EstimatorParameters) {
55 auto ActualParametersIt = EstimatorParameters.begin();
56 for (
auto const &Par : FitParameters) {
57 if (ActualParametersIt == EstimatorParameters.end()) {
58 LOG(ERROR) <<
"Less fit parameters given then actual parameters in the " 63 if (Par.Name != ActualParametersIt->Name) {
64 LOG(ERROR) <<
"Wrong ordering of fit parameters!";
75 namespace serialization {
77 template <
class Archive>
79 const unsigned int version) {
80 ar &BOOST_SERIALIZATION_NVP(FitParameter.
Name);
81 ar &BOOST_SERIALIZATION_NVP(FitParameter.
Value);
82 ar &BOOST_SERIALIZATION_NVP(FitParameter.
Error);
83 ar &BOOST_SERIALIZATION_NVP(FitParameter.
Bounds);
84 ar &BOOST_SERIALIZATION_NVP(FitParameter.
HasBounds);
85 ar &BOOST_SERIALIZATION_NVP(FitParameter.
IsFixed);
friend std::ostream & operator<<(std::ostream &os, const FitParameter< double > &x)
Support for serialization of std::shared_ptr (and other types) is added in boost 1.56 .
bool isValid(const FitParameterList &FitParameters, const std::vector< ComPWA::Parameter > &EstimatorParameters)
std::vector< FitParameter< double > > FitParameterList
FitParameter(std::string name, T val, T min, T max, bool isfixed=true)
FitParameter(std::string name, T val, bool isfixed=true)