#include <StatedFCN.h>
Inheritance diagram for StatedFCN:
This class uses a stated function derived from FunctionBase. That is, it assumes the function maintains the state of all its parameters and maintains which parameters are free for minimization.
If HippoDraw is built with Minuit, then this class is derived from the Minuit's FCNBase class, otherwise it derives from HippoDraw's FCNBase.
Definition at line 46 of file StatedFCN.h.
Public Member Functions | |
virtual void | calcAlphaBeta (std::vector< std::vector< double > > &alpha, std::vector< double > &beta)=0 |
virtual StatedFCN * | clone () const =0 |
Makes a copy of the derived class object. | |
virtual int | degreesOfFreedom () const =0 |
Returns the number of degrees of freedom. | |
virtual double | errorDef () const |
void | fillFreeDerivatives (std::vector< double > &, double x) |
Clears and fills the vector with the derivatives of the function a coordinate value x. | |
void | fillFreeParameters (std::vector< double > &free_parms) const |
Fills the vector with the values of the free parameters. | |
const std::vector< int > & | getFixedFlags () const |
Returns the vector of which of the model function's parameters are considered fixed and not to be changed during minimization of this objective function. | |
unsigned int | getNumberFreeParms () const |
Returns the number of free parameters. | |
const std::vector< double > & | getParameters () const |
Returns the current state of the model function's parameters. | |
const std::vector< std::string > & | getParmNames () const |
Returns the names of the model function's parameters. | |
bool | hasFunction () const |
Returns true if model function has been set, otherwise returns false . | |
virtual bool | needsIntegrated () const =0 |
Returns true if data points were integrated. | |
virtual double | objectiveValue () const =0 |
Returns the value of the objective function. | |
virtual double | operator() (const std::vector< double > &parms) const |
Sets the model function parameters to parms and returns the objective value. | |
virtual void | setDataSource (const DataSource *source, int dimension, const std::vector< int > &)=0 |
Sets the data source, dimension, and indices into the columns. | |
virtual void | setDataSource (const DataSource *source)=0 |
Sets the data source. | |
virtual void | setFitCut (TupleCut *cut)=0 |
Sets the cut to limit range of fitting. | |
virtual void | setFitRange (bool yes=true)=0 |
Sets use of a fitting range on or off. | |
virtual void | setFixedFlags (const std::vector< int > &flags) |
Sets the parameters that are to be held fixed during minimization of this objective function. | |
virtual void | setFreeParameters (const std::vector< double > &parms) |
Sets the free parameters from the vector parms. | |
void | setFunction (FunctionBase *function) |
Sets the model function. | |
void | setParameters (const std::vector< double > &parms) |
Sets the values of the model function's parameters. | |
virtual bool | setUseErrors (bool yes=true)=0 |
Sets the FCN to use errors on the data source values if it can. | |
StatedFCN (FunctionBase *function) | |
The constructor taking FunctionBase object as argument. | |
virtual double | up () const =0 |
Protected Member Functions | |
StatedFCN (const StatedFCN &) | |
The copy constructor. | |
StatedFCN () | |
The default constructor. | |
Protected Attributes | |
FunctionBase * | m_function |
A pointer to the model function to be used in fitting. | |
bool | m_has_errors |
Error use flag. | |
Private Attributes | |
std::vector< int > | m_fixed_flags |
The flags to indicated which parameters are to be held fixed during minimization of this objective function. |
|
The default constructor. The default constructor initializes the pointer to the model function to the null pointer. Definition at line 24 of file StatedFCN.cxx. |
|
The copy constructor. The copy constructor makes a copy of the pointer to the FunctionBase object it uses. Definition at line 31 of file StatedFCN.cxx. |
|
The constructor taking FunctionBase object as argument.
Definition at line 39 of file StatedFCN.cxx. References setFunction(). |
|
Implemented in NTupleFCN. |
|
Makes a copy of the derived class object.
Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN. |
|
Returns the number of degrees of freedom.
Implemented in NTupleFCN. |
|
Clears and fills the vector with the derivatives of the function a coordinate value x.
Definition at line 149 of file StatedFCN.cxx. References getParameters(), m_fixed_flags, m_function, and num_util::size(). Referenced by NTupleFCN::calcAlphaBeta(). |
|
Fills the vector with the values of the free parameters.
Definition at line 89 of file StatedFCN.cxx. References getParameters(), m_fixed_flags, m_function, and num_util::size(). |
|
Returns the vector of which of the model function's parameters are considered fixed and not to be changed during minimization of this objective function.
Definition at line 116 of file StatedFCN.cxx. References m_fixed_flags. |
|
Returns the number of free parameters.
Definition at line 103 of file StatedFCN.cxx. References m_fixed_flags, and num_util::size(). Referenced by NTupleFCN::calcAlphaBeta(), and NTupleFCN::degreesOfFreedom(). |
|
Returns the current state of the model function's parameters.
Definition at line 75 of file StatedFCN.cxx. References m_function. Referenced by fillFreeDerivatives(), fillFreeParameters(), and setFreeParameters(). |
|
Returns the names of the model function's parameters.
Definition at line 68 of file StatedFCN.cxx. References m_function. |
|
Returns
Definition at line 48 of file StatedFCN.cxx. References m_function. |
|
Returns
Return Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN. |
|
Returns the value of the objective function. Returns the value of the objective function for the current state of the function. The state of the function's parameters is set by operator(). Other states the function may have is set by calling member functions of the function directly. Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN. Referenced by hippodraw::Python::export_StatedFCN(), and operator()(). |
|
Sets the model function parameters to parms and returns the objective value.
Implements FCNBase. Definition at line 165 of file StatedFCN.cxx. References m_function, objectiveValue(), and setParameters(). Referenced by NTupleFCN::calcAlphaBeta(), NTuplePearsonFCN::objectiveValue(), and NTupleChiSqFCN::objectiveValue(). |
|
Sets the data source, dimension, and indices into the columns. Sets the data source, dimension and indices into the column. For one dimensional data source, the order of the indices are as in The hippodraw::DataPoint2DTuple enumeration. For two dimensional data source as with hippodraw::DataPoint3DTuple enumeration. For higher dimensions, the pattern should repeat. A negative index value indicates that the variable is not used. Implemented in NTupleFCN. |
|
Sets the data source. Sets the data source and uses indices from hippodraw::DataPoint2DTuple. Implemented in NTupleFCN. Referenced by hippodraw::Python::export_StatedFCN(). |
|
Sets the cut to limit range of fitting.
Implemented in NTupleFCN. |
|
Sets use of a fitting range on or off.
Implemented in NTupleFCN. |
|
Sets the parameters that are to be held fixed during minimization of this objective function.
Definition at line 124 of file StatedFCN.cxx. References m_fixed_flags. |
|
Sets the free parameters from the vector parms.
Definition at line 131 of file StatedFCN.cxx. References getParameters(), m_fixed_flags, m_function, setParameters(), and num_util::size(). |
|
Sets the model function. Sets the model function object to function. Definition at line 55 of file StatedFCN.cxx. References m_fixed_flags, m_function, and num_util::size(). Referenced by hippodraw::Python::export_StatedFCN(), and StatedFCN(). |
|
Sets the values of the model function's parameters.
Definition at line 82 of file StatedFCN.cxx. References m_function. Referenced by operator()(), and setFreeParameters(). |
|
Sets the FCN to use errors on the data source values if it can.
Implemented in NTupleFCN. Referenced by hippodraw::Python::export_StatedFCN(). |
|
The flags to indicated which parameters are to be held fixed during minimization of this objective function.
Definition at line 57 of file StatedFCN.h. Referenced by fillFreeDerivatives(), fillFreeParameters(), getFixedFlags(), getNumberFreeParms(), setFixedFlags(), setFreeParameters(), and setFunction(). |
|
A pointer to the model function to be used in fitting. This object does not own the function. Definition at line 64 of file StatedFCN.h. Referenced by NTupleFCN::calcAlphaBeta(), fillFreeDerivatives(), fillFreeParameters(), getParameters(), getParmNames(), hasFunction(), NTuplePearsonFCN::objectiveValue(), NTupleLikeliHoodFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), operator()(), setFreeParameters(), setFunction(), and setParameters(). |
|
Error use flag.
A flag set to Definition at line 71 of file StatedFCN.h. Referenced by NTupleFCN::calcAlphaBeta(), NTupleFCN::degreesOfFreedom(), NTuplePearsonFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), and NTupleFCN::setUseErrors(). |