#include <Fitter.h>
Inheritance diagram for Fitter:
Definition at line 29 of file Fitter.h.
Public Member Functions | |
virtual bool | calcBestFit ()=0 |
Calculates the best fit. | |
virtual int | calcCovariance (std::vector< std::vector< double > > &cov) |
Calculates the covariance matrix. | |
virtual int | calcDegreesOfFreedom () const |
Returns the number of degrees of freedom in the fit. | |
virtual Fitter * | clone () const =0 |
Makes a copy of the receiving object. | |
void | fillFreeParameters (std::vector< double > &) const |
Fills the vector with the free parameters values. | |
StatedFCN * | getFCN () |
Returns the objective function object. | |
virtual const std::vector< int > & | getFixedFlags () const |
Returns a vector containing flags for which parameters are to be held fixed during objective function minimization. | |
const std::string & | name () const |
Returns the name of the fitter. | |
virtual bool | needsDerivatives () const =0 |
Returns true if the fitter needs the function to calculate its partial derivatives. | |
virtual double | objectiveValue () const |
Calculates the value of the objective function at the current set of parameters. | |
void | setFCN (StatedFCN *fcn) |
Sets the objective function object. | |
virtual void | setFitCut (TupleCut *cut) |
Sets the cut to limit range of fitting. | |
virtual void | setFitRange (bool yes=true) |
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 objective function minimization. | |
void | setLimits (const std::string &name, double lower, double upper) |
Sets the limits for the parameter of the model function with name name. | |
virtual void | setLimits (unsigned int i, double lower, double upper) |
Sets the limits for the parameter of the model function indexed by i. | |
void | setStepSize (const std::string &name, double size) |
Sets the minimization step size for model function parameter name. | |
virtual void | setStepSize (unsigned int i, double size) |
Sets the step size for parameter of the minimization. | |
virtual | ~Fitter () |
The virtual destructor. | |
Protected Member Functions | |
Fitter (const char *name) | |
The required constructor. | |
Fitter (const Fitter &) | |
The copy constructor. | |
Protected Attributes | |
StatedFCN * | m_fcn |
The objective function. | |
int | m_max_iterations |
The maximum number of iterations allowed in attempting the fit. | |
std::string | m_name |
The name of the fitter. | |
Private Member Functions | |
unsigned int | getParameterIndex (const std::string &name) |
Returns the index to the model function parameters name. |
|
The copy constructor. Makes a copy of the data members and a clone of the StatedFCN. Definition at line 30 of file Fitter.cxx. |
|
The required constructor.
Definition at line 22 of file Fitter.cxx. |
|
The virtual destructor.
Definition at line 38 of file Fitter.cxx. References m_fcn. |
|
Calculates the best fit.
Returns Implemented in BFGSFitter, LMFitter, and MinuitMigrad. Referenced by hippodraw::Python::export_Fitter(), and FunctionProjector::fitFunction(). |
|
Calculates the covariance matrix. Returns EXIT_SUCCESS if a minima of the objective functions is found, returns EXIT_FAILURE in case algorithm converges on other stationary points (i.e. on saddle points). This member function should be overridden by a derived class if supported. The implementation in this base class returns EXIT_FAILURE. Reimplemented in BFGSFitter, LMFitter, and MinuitMigrad. Definition at line 172 of file Fitter.cxx. |
|
Returns the number of degrees of freedom in the fit.
Definition at line 165 of file Fitter.cxx. References m_fcn. Referenced by FunctionProjector::degreesOfFreedom(), and hippodraw::Python::export_Fitter(). |
|
Makes a copy of the receiving object. Makes copy of receiving object by creating a new one with the only constructor.
Implemented in BFGSFitter, LMFitter, and MinuitMigrad. Referenced by Fitter(). |
|
Fills the vector with the free parameters values.
Definition at line 68 of file Fitter.cxx. References m_fcn. Referenced by LMFitter::calcBestFit(), and BFGSFitter::calcBestFit(). |
|
Returns the objective function object.
Definition at line 54 of file Fitter.cxx. References m_fcn. Referenced by hippodraw::Python::export_Fitter(). |
|
Returns a vector containing flags for which parameters are to be held fixed during objective function minimization.
Definition at line 82 of file Fitter.cxx. References m_fcn. Referenced by MinuitMigrad::calcBestFit(). |
|
Returns the index to the model function parameters name. If name is not found, throws a FitterException. Definition at line 99 of file Fitter.cxx. References m_fcn, and num_util::size(). Referenced by setLimits(), and setStepSize(). |
|
Returns the name of the fitter.
Definition at line 61 of file Fitter.cxx. References m_name. Referenced by hippodraw::Python::export_Fitter(), and MinuitMigrad::initialize(). |
|
Returns
Implemented in BFGSFitter, LMFitter, and MinuitMigrad. |
|
Calculates the value of the objective function at the current set of parameters.
Definition at line 158 of file Fitter.cxx. References m_fcn. Referenced by LMFitter::calcBestFit(), hippodraw::Python::export_Fitter(), BFGSFitter::function(), BFGSFitter::gradient(), BFGSFitter::gradp(), and FunctionProjector::objectiveValue(). |
|
Sets the objective function object. Sets the objective function object to be used and takes possession of it. That is, will delete the current object, if there is one, and will delete the object in this object's destructor. Definition at line 45 of file Fitter.cxx. References m_fcn. |
|
Sets the cut to limit range of fitting.
Definition at line 179 of file Fitter.cxx. References m_fcn. |
|
Sets use of a fitting range on or off.
Definition at line 186 of file Fitter.cxx. References m_fcn. |
|
Sets the parameters that are to be held fixed during objective function minimization.
Definition at line 75 of file Fitter.cxx. References m_fcn. Referenced by hippodraw::Python::export_Fitter(). |
|
Sets the limits for the parameter of the model function with name name.
Definition at line 123 of file Fitter.cxx. References getParameterIndex(), and setLimits(). |
|
Sets the limits for the parameter of the model function indexed by i.
Reimplemented in MinuitMigrad. Definition at line 89 of file Fitter.cxx. References m_name. Referenced by hippodraw::Python::export_Fitter(), and setLimits(). |
|
Sets the minimization step size for model function parameter name.
Definition at line 151 of file Fitter.cxx. References getParameterIndex(), and setStepSize(). |
|
Sets the step size for parameter of the minimization. This base class implementation throws FitterException. Derived classes that suport setting step size should override this member function. Reimplemented in MinuitMigrad. Definition at line 141 of file Fitter.cxx. References m_name. Referenced by hippodraw::Python::export_Fitter(), and setStepSize(). |
|
The objective function.
Definition at line 55 of file Fitter.h. Referenced by LMFitter::calcAlpha(), MinuitMigrad::calcBestFit(), LMFitter::calcBestFit(), BFGSFitter::calcBestFit(), calcDegreesOfFreedom(), MinuitMigrad::checkIndex(), fillFreeParameters(), Fitter(), BFGSFitter::function(), getFCN(), getFixedFlags(), getParameterIndex(), BFGSFitter::gradient(), BFGSFitter::gradp(), MinuitMigrad::initialize(), objectiveValue(), setFCN(), setFitCut(), setFitRange(), setFixedFlags(), and ~Fitter(). |
|
The maximum number of iterations allowed in attempting the fit.
Definition at line 58 of file Fitter.h. Referenced by LMFitter::calcBestFit(), BFGSFitter::calcBestFit(), LMFitter::iterParam(), BFGSFitter::iterParam(), LMFitter::setIterParam(), and BFGSFitter::setIterParam(). |
|
The name of the fitter.
Definition at line 47 of file Fitter.h. Referenced by MinuitMigrad::checkIndex(), name(), setLimits(), and setStepSize(). |