A derived class for FCNBase class. More...
#include <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. More... | |
| virtual void | copyFrom (const StatedFCN *other) |
| Makes a copy of the relevant attributes from other object. More... | |
| virtual int | degreesOfFreedom () const =0 |
| Returns the number of degrees of freedom. More... | |
| 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. More... | |
| void | fillFreeParameters (std::vector< double > &free_parms) const |
| Fills the vector with the values of the free parameters. More... | |
| const std::vector< int > & | getFixedFlags () const |
| Returns a vector of flags for parameters which are held fixed by the function. More... | |
| unsigned int | getNumberFreeParms () const |
| Returns the number of free parameters. More... | |
| const std::vector< double > & | getParameters () const |
| Returns the current state of the model function's parameters. More... | |
| const std::vector< std::string > & | getParmNames () const |
| Returns the names of the model function's parameters. More... | |
| virtual bool | getUseErrors () const =0 |
| Returns true if error data from the DataSource is to be used. More... | |
| bool | hasFunction () const |
Returns true if model function has been set, otherwise returns false. More... | |
| bool | isCompatible (const FunctionBase *) const |
Returns true if function is compatible this objective function. More... | |
| virtual bool | needsIntegrated () const =0 |
Returns true if data points were integrated. More... | |
| virtual double | objectiveValue () const =0 |
| Returns the value of the objective function. More... | |
| virtual double | operator() (const std::vector< double > &parms) const |
| Sets the model function parameters to parms and returns the objective value. More... | |
| virtual void | setDataSource (const DataSource *source)=0 |
| Sets the data source. More... | |
| virtual void | setDataSource (const DataSource *source, int dimension, const std::vector< int > &)=0 |
| Sets the data source, dimension, and indices into the columns. More... | |
| virtual void | setFitCut (TupleCut *cut)=0 |
| Sets the cut to limit range of fitting. More... | |
| virtual void | setFitRange (bool yes=true)=0 |
| Sets use of a fitting range on or off. More... | |
| virtual void | setFixedFlags (const std::vector< int > &flags) |
| 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. More... | |
| virtual void | setFreeParameters (const std::vector< double > &parms) |
| Sets the free parameters from the vector parms. More... | |
| void | setFunction (FunctionBase *function) |
| Sets the model function. More... | |
| void | setNeedsDerivatives (bool yes) |
| Sets the needs derivatives flag. More... | |
| void | setParameters (const std::vector< double > &parms) |
| Sets the values of the model function's parameters. More... | |
| virtual bool | setUseErrors (bool yes=true)=0 |
| Sets the FCN to use errors from the DataSource if they are available on all data points. More... | |
| virtual double | up () const =0 |
Protected Member Functions | |
| StatedFCN () | |
| The default constructor. More... | |
| StatedFCN (const StatedFCN &) | |
| The copy constructor. More... | |
Protected Attributes | |
| FunctionBase * | m_function |
The flags to indicated which parameters are to be held fixed during minimization of this objective function. More... | |
| bool | m_needs_derivs |
| Needs derivatives flag. More... | |
A derived class for FCNBase class.
This class uses a stated function derived from FunctionBase. That is, it assumes the function maintains the state of all its parameters.
Definition at line 70 of file StatedFCN.h.
|
protected |
The default constructor.
The default constructor initializes the pointer to the model function to the null pointer.
Definition at line 28 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 35 of file StatedFCN.cxx.
|
pure virtual |
Implemented in NTupleFCN.
|
pure virtual |
Makes a copy of the derived class object.
Implemented in NTuplePearsonFCN, NTupleLikeliHoodFCN, and NTupleChiSqFCN.
|
virtual |
Makes a copy of the relevant attributes from other object.
Reimplemented in NTupleFCN.
Definition at line 44 of file StatedFCN.cxx.
References StatedFCN::m_function.
Referenced by NTupleFCN::copyFrom().
|
pure virtual |
Returns the number of degrees of freedom.
Implemented in NTupleFCN.
| void fillFreeDerivatives | ( | std::vector< double > & | derives, |
| double | x | ||
| ) |
Clears and fills the vector with the derivatives of the function a coordinate value x.
Definition at line 167 of file StatedFCN.cxx.
References StatedFCN::getFixedFlags(), StatedFCN::getParameters(), i, StatedFCN::m_function, and num_util::size().
Referenced by NTupleFCN::calcAlphaBeta().
| void fillFreeParameters | ( | std::vector< double > & | free_parms | ) | const |
Fills the vector with the values of the free parameters.
Definition at line 100 of file StatedFCN.cxx.
References StatedFCN::getFixedFlags(), StatedFCN::getParameters(), i, StatedFCN::m_function, and num_util::size().
| const vector< int > & getFixedFlags | ( | ) | const |
Returns a vector of flags for parameters which are held fixed by the function.
Definition at line 131 of file StatedFCN.cxx.
References StatedFCN::m_function.
Referenced by StatedFCN::fillFreeDerivatives(), StatedFCN::fillFreeParameters(), StatedFCN::getNumberFreeParms(), and StatedFCN::setFreeParameters().
| unsigned int getNumberFreeParms | ( | ) | const |
Returns the number of free parameters.
Definition at line 115 of file StatedFCN.cxx.
References StatedFCN::getFixedFlags(), i, StatedFCN::m_function, and num_util::size().
Referenced by NTupleFCN::calcAlphaBeta(), and NTupleFCN::degreesOfFreedom().
| const vector< double > & getParameters | ( | ) | const |
Returns the current state of the model function's parameters.
Definition at line 86 of file StatedFCN.cxx.
References StatedFCN::m_function.
Referenced by StatedFCN::fillFreeDerivatives(), StatedFCN::fillFreeParameters(), and StatedFCN::setFreeParameters().
| const vector< string > & getParmNames | ( | ) | const |
Returns the names of the model function's parameters.
Definition at line 79 of file StatedFCN.cxx.
References StatedFCN::m_function.
|
pure virtual |
Returns true if error data from the DataSource is to be used.
Implemented in NTupleFCN.
| bool hasFunction | ( | ) | const |
Returns true if model function has been set, otherwise returns false.
Definition at line 53 of file StatedFCN.cxx.
References StatedFCN::m_function.
| bool isCompatible | ( | const FunctionBase * | function | ) | const |
Returns true if function is compatible this objective function.
Return false if the function is incompatible with this objective function. For example, if the fitter indicated it needs partial derivatives and the function can not provide them.
Definition at line 201 of file StatedFCN.cxx.
References StatedFCN::m_needs_derivs, and yes.
Referenced by StatedFCN::setFunction().
|
pure virtual |
Returns true if data points were integrated.
Return true if the FCN function needs data points were integrated over a range. An example would be a histogram. Returns false if the integrated data points are not needed.
Implemented in NTupleLikeliHoodFCN, NTuplePearsonFCN, and NTupleChiSqFCN.
|
pure virtual |
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 NTuplePearsonFCN, NTupleChiSqFCN, and NTupleLikeliHoodFCN.
Referenced by StatedFCN::operator()().
|
virtual |
Sets the model function parameters to parms and returns the objective value.
Implements FCNBase.
Definition at line 185 of file StatedFCN.cxx.
References StatedFCN::m_function, StatedFCN::objectiveValue(), and StatedFCN::setParameters().
Referenced by NTupleFCN::calcAlphaBeta(), NTupleChiSqFCN::objectiveValue(), and NTuplePearsonFCN::objectiveValue().
|
pure virtual |
Sets the data source.
Sets the data source and uses indices from hippodraw::DataPoint2DTuple.
Implemented in NTupleFCN.
|
pure virtual |
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.
|
pure virtual |
Sets the cut to limit range of fitting.
Implemented in NTupleFCN.
|
pure virtual |
Sets use of a fitting range on or off.
Implemented in NTupleFCN.
|
virtual |
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.
Sets the parameters that are to be held fixed during minimization of this objective function.
Definition at line 139 of file StatedFCN.cxx.
References StatedFCN::m_function.
|
virtual |
Sets the free parameters from the vector parms.
Definition at line 147 of file StatedFCN.cxx.
References StatedFCN::getFixedFlags(), StatedFCN::getParameters(), i, StatedFCN::m_function, StatedFCN::setParameters(), and num_util::size().
| void setFunction | ( | FunctionBase * | function | ) |
Sets the model function.
Sets the model function object to function.
Definition at line 63 of file StatedFCN.cxx.
References StatedFCN::isCompatible(), StatedFCN::m_function, and yes.
| void setNeedsDerivatives | ( | bool | yes | ) |
Sets the needs derivatives flag.
Sets the needs derivatives flag to true if the Fitter needs partial derivatives from the FunctionBase object.
Definition at line 194 of file StatedFCN.cxx.
References StatedFCN::m_needs_derivs, and yes.
| void setParameters | ( | const std::vector< double > & | parms | ) |
Sets the values of the model function's parameters.
Definition at line 93 of file StatedFCN.cxx.
References StatedFCN::m_function.
Referenced by StatedFCN::operator()(), and StatedFCN::setFreeParameters().
Sets the FCN to use errors from the DataSource if they are available on all data points.
Implemented in NTupleFCN.
|
protected |
The flags to indicated which parameters are to be held fixed
during minimization of this objective function.
Definition at line 90 of file StatedFCN.h.
Referenced by NTupleFCN::calcAlphaBeta(), StatedFCN::copyFrom(), StatedFCN::fillFreeDerivatives(), StatedFCN::fillFreeParameters(), StatedFCN::getFixedFlags(), StatedFCN::getNumberFreeParms(), StatedFCN::getParameters(), StatedFCN::getParmNames(), StatedFCN::hasFunction(), NTupleLikeliHoodFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), NTuplePearsonFCN::objectiveValue(), StatedFCN::operator()(), StatedFCN::setFixedFlags(), StatedFCN::setFreeParameters(), StatedFCN::setFunction(), and StatedFCN::setParameters().
|
protected |
Needs derivatives flag.
A flag set to true, if the Fitter needs partial derivatives from the FunctionBase.
Definition at line 95 of file StatedFCN.h.
Referenced by StatedFCN::isCompatible(), and StatedFCN::setNeedsDerivatives().