ComPWA
Common Partial-Wave-Analysis Framework
|
#include <FitParameter.hpp>
Public Member Functions | |
FitParameter (std::string inName="") | |
Standard constructor with no information provided. More... | |
FitParameter (const boost::property_tree::ptree &pt) | |
Construct parameter from a property tree. More... | |
FitParameter (std::string inName, const double value) | |
Standard constructor with just a value provided. More... | |
FitParameter (std::string inName, const double value, const double error) | |
Standard constructor with value and error provided. More... | |
FitParameter (std::string inName, const double value, const double min, const double max) | |
Standard constructor with value and bounds provided. More... | |
FitParameter (std::string inName, const double value, const double min, const double max, const double error) | |
Standard constructor with value, bounds and error provided. More... | |
FitParameter (ComPWA::FitParameter< double > par) | |
virtual bool | isParameter () const |
operator double () const | |
virtual bool | hasBounds () const |
virtual bool | isFixed () const |
virtual void | fixParameter (const bool fixed) |
virtual void | updateParameter (std::shared_ptr< FitParameter > newPar) |
Update member variables from other FitParameter. More... | |
virtual double | value () const |
Getter for value of parameter. More... | |
virtual void | setValue (const double inVal) |
Setter for value of parameter. More... | |
virtual std::pair< double, double > | bounds () const |
Bounds of parameter. More... | |
virtual void | setBounds (const double min, const double max) |
Bounds of parameter. More... | |
virtual void | setBounds (const std::pair< double, double > r) |
Bounds of parameter. More... | |
virtual bool | hasError () const |
Is an error set? More... | |
virtual ErrorType | errorType () const |
virtual std::pair< double, double > | error () const |
Parameter error. More... | |
virtual double | avgError () const |
Average parameter error (in case of asymmetric errors) or simply parameter error. More... | |
virtual void | setError (double errLow, double errHigh) |
Set parameter error and assume that this parameter has asymmetric errors. More... | |
virtual void | setError (std::pair< double, double > err) |
Set parameter error and assume that this parameter has asymmetric errors. More... | |
virtual void | setError (double err) |
Setter parameter error and assume that this parameter has symmetric errors. More... | |
bool | operator== (const FitParameter otherPar) const |
void | load (const boost::property_tree::ptree &pt) |
Load parameters from a ptree. More... | |
boost::property_tree::ptree | save () const |
Save parameter to a ptree. More... | |
virtual std::string | to_str () const |
String with detailed information about the parameter. More... | |
virtual std::string | val_to_str () const |
String with detailed information about the parameter. More... | |
Public Member Functions inherited from ComPWA::FunctionTree::Parameter | |
Parameter (std::string name, ParType type=ParType::UNDEFINED) | |
Constructor with name of parameter and optional type. More... | |
virtual | ~Parameter ()=default |
virtual std::string | name () const |
Getter for name of object. More... | |
virtual void | setName (std::string n) |
Getter for name of object. More... | |
virtual ParType | type () const |
Getter for type of object. More... | |
void | attach (std::weak_ptr< ParObserver > newObserver) |
Attaches a new TreeNode as Observer. More... | |
void | detachExpired () |
Removes TreeNodes not needed as Observer anymore. More... | |
void | notify () |
Notify all observing TreeNodes that parameter changed. More... | |
Protected Member Functions | |
virtual std::string | className () const |
Getter for typename of object, to be defined by the actual implementation. More... | |
virtual void | SetErrorType (ErrorType t) |
bool | check_bounds (const std::pair< double, double > bounds) const |
Check if min and max are valid bounds. More... | |
Protected Attributes | |
bool | HasBounds |
Are valid bounds defined for this parameter? More... | |
bool | IsFixed |
Do you want to keep parameter fixed? More... | |
double | Value |
Parameter value. More... | |
std::pair< double, double > | Bounds |
Parameter bounds. More... | |
ErrorType | ErrType |
No error / symmetric error / asymmetric error. More... | |
std::pair< double, double > | Error |
Lower parameter error. More... | |
Protected Attributes inherited from ComPWA::FunctionTree::Parameter | |
std::string | Name |
Name of parameter. More... | |
ParType | Type |
Type of parameter (e.g. Double, Integer, ...) More... | |
std::vector< std::weak_ptr< ParObserver > > | ObservingNodes |
List of observers, e.g. TreeNodes. More... | |
Private Member Functions | |
template<class archive > | |
void | serialize (archive &ar, const unsigned int version) |
Definition at line 34 of file FitParameter.hpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | std::string | inName = "" | ) |
Standard constructor with no information provided.
Creates parameter with value 0 but without bounds or an error.
inName | internal string identifier of this parameter |
Definition at line 14 of file FitParameter.cpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | const boost::property_tree::ptree & | pt | ) |
Construct parameter from a property tree.
The expected tree layout is described in load().
Definition at line 19 of file FitParameter.cpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | std::string | inName, |
const double | value | ||
) |
Standard constructor with just a value provided.
Creates parameter with given value but without bounds or an error.
Definition at line 26 of file FitParameter.cpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | std::string | inName, |
const double | value, | ||
const double | error | ||
) |
Standard constructor with value and error provided.
Creates parameter with given value and error but without bounds.
Definition at line 31 of file FitParameter.cpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | std::string | inName, |
const double | value, | ||
const double | min, | ||
const double | max | ||
) |
Standard constructor with value and bounds provided.
Creates parameter with given value and bounds but without error. If a check for valid bounds fails, just the value is used.
Definition at line 37 of file FitParameter.cpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | std::string | inName, |
const double | value, | ||
const double | min, | ||
const double | max, | ||
const double | error | ||
) |
Standard constructor with value, bounds and error provided.
Creates parameter with the given information. If a check for valid bounds fails, just value and error are used.
Definition at line 45 of file FitParameter.cpp.
ComPWA::FunctionTree::FitParameter::FitParameter | ( | ComPWA::FitParameter< double > | par | ) |
Definition at line 55 of file FitParameter.cpp.
|
inlinevirtual |
Average parameter error (in case of asymmetric errors) or simply parameter error.
Definition at line 111 of file FitParameter.hpp.
|
virtual |
Bounds of parameter.
Definition at line 113 of file FitParameter.cpp.
|
protected |
Check if min
and max
are valid bounds.
Definition at line 213 of file FitParameter.cpp.
|
inlineprotectedvirtual |
Getter for typename of object, to be defined by the actual implementation.
Implements ComPWA::FunctionTree::Parameter.
Definition at line 144 of file FitParameter.hpp.
|
virtual |
Parameter error.
Definition at line 139 of file FitParameter.cpp.
|
inlinevirtual |
Definition at line 104 of file FitParameter.hpp.
|
inlinevirtual |
Definition at line 76 of file FitParameter.hpp.
|
inlinevirtual |
Definition at line 72 of file FitParameter.hpp.
|
virtual |
Is an error set?
Definition at line 133 of file FitParameter.cpp.
|
inlinevirtual |
Definition at line 74 of file FitParameter.hpp.
|
inlinevirtual |
Reimplemented from ComPWA::FunctionTree::Parameter.
Definition at line 68 of file FitParameter.hpp.
void ComPWA::FunctionTree::FitParameter::load | ( | const boost::property_tree::ptree & | pt | ) |
Load parameters from a ptree.
This approach is more or less equivalent to the serialization of a parameter but provides a better readable format.
Definition at line 243 of file FitParameter.cpp.
|
inline |
Definition at line 70 of file FitParameter.hpp.
bool ComPWA::FunctionTree::FitParameter::operator== | ( | const FitParameter | otherPar | ) | const |
Definition at line 173 of file FitParameter.cpp.
boost::property_tree::ptree ComPWA::FunctionTree::FitParameter::save | ( | ) | const |
Save parameter to a ptree.
This approach is more or less equivalent to the serialization of a parameter but provides a better readable format.
Definition at line 290 of file FitParameter.cpp.
|
inlineprivate |
Definition at line 172 of file FitParameter.hpp.
|
virtual |
Bounds of parameter.
Definition at line 115 of file FitParameter.cpp.
|
virtual |
Bounds of parameter.
Definition at line 124 of file FitParameter.cpp.
|
virtual |
Set parameter error and assume that this parameter has asymmetric errors.
Definition at line 147 of file FitParameter.cpp.
|
virtual |
Set parameter error and assume that this parameter has asymmetric errors.
Definition at line 156 of file FitParameter.cpp.
|
virtual |
Setter parameter error and assume that this parameter has symmetric errors.
Definition at line 164 of file FitParameter.cpp.
|
inlineprotectedvirtual |
Definition at line 164 of file FitParameter.hpp.
|
virtual |
Setter for value of parameter.
Definition at line 93 of file FitParameter.cpp.
|
virtual |
String with detailed information about the parameter.
Used in operator<<().
Implements ComPWA::FunctionTree::Parameter.
Definition at line 220 of file FitParameter.cpp.
|
virtual |
Update member variables from other FitParameter.
Do to the Observer pattern we can't use a copy constructor. Therefore we use this workaround. The function ignores if parameter is fixed!
Definition at line 65 of file FitParameter.cpp.
|
virtual |
String with detailed information about the parameter.
Used in operator<<().
Implements ComPWA::FunctionTree::Parameter.
Definition at line 237 of file FitParameter.cpp.
|
inlinevirtual |
Getter for value of parameter.
Definition at line 86 of file FitParameter.hpp.
|
protected |
Parameter bounds.
Definition at line 156 of file FitParameter.hpp.
|
protected |
Lower parameter error.
Definition at line 162 of file FitParameter.hpp.
|
protected |
No error / symmetric error / asymmetric error.
Definition at line 159 of file FitParameter.hpp.
|
protected |
Are valid bounds defined for this parameter?
Definition at line 147 of file FitParameter.hpp.
|
protected |
Do you want to keep parameter fixed?
Definition at line 150 of file FitParameter.hpp.
|
protected |
Parameter value.
Definition at line 153 of file FitParameter.hpp.