#include <NTupleFCN.h>
Inheritance diagram for NTupleFCN:


It derives from StatedFCN to access the stated model function.
Definition at line 33 of file NTupleFCN.h.
Public Member Functions | |
| virtual StatedFCN * | clone () const =0 |
| Makes a copy of the derived class object. | |
| virtual int | degreesOfFreedom () const |
| Calculates 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. | |
| NTupleFCN (const DataSource *ntuple, FunctionBase *function) | |
| The following constructor takes a pair of iterators to the data and a pointer to the function to be fitted. | |
| 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 > &) |
| Sets the data source, dimension, and indices into the columns. | |
| void | setDataSource (const DataSource *source) |
| Sets the data source. | |
| 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 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) |
| Sets the use of errors on the data point. | |
| virtual double | up () const =0 |
Protected Member Functions | |
| bool | acceptRow (unsigned int row) const |
| Returns true if the DataSource row row is within the fit Range. | |
| virtual void | calcAlphaBeta (std::vector< std::vector< double > > &alpha, std::vector< double > &beta) |
| Calculates alpha and beta. | |
| int | getErrorColumn () const |
| Returns the index to the column containing error on the value coordinate. | |
| NTupleFCN (const NTupleFCN &) | |
| The copy constructor. | |
| NTupleFCN () | |
| The default constructor. | |
Protected Attributes | |
| unsigned int | m_dimen |
| The dimension of the coordinate. | |
| FunctionBase * | m_function |
| A pointer to the model function to be used in fitting. | |
| bool | m_has_errors |
| Error use flag. | |
| std::vector< int > | m_indices |
| The indexes into the DataSource. | |
| const DataSource * | m_ntuple |
| The ntuple containing the data points for the fitter. | |
Private Member Functions | |
| bool | hasErrors () const |
| Examines state of error bars. | |
| void | reset (std::vector< std::vector< double > > &alpha, std::vector< double > &beta, unsigned int size) |
| Resets the matrix alpha and the vector beta. | |
Private Attributes | |
| TupleCut * | m_fit_cut |
| The cut that manages the range on X to be used for fitting. | |
| bool | m_fit_range |
Set to true if the fitting range is turn on. | |
|
|
The default constructor. The default constructor which initializes points to objects it uses to the null pointer. Definition at line 36 of file NTupleFCN.cxx. |
|
|
The copy constructor. The copy constructor makes a copy of the pointer to the NTuple object containing the data. Definition at line 44 of file NTupleFCN.cxx. |
|
||||||||||||
|
The following constructor takes a pair of iterators to the data and a pointer to the function to be fitted.
Definition at line 53 of file NTupleFCN.cxx. |
|
|
Returns true if the DataSource row row is within the fit Range.
Definition at line 249 of file NTupleFCN.cxx. References m_fit_cut, m_fit_range, and m_ntuple. Referenced by calcAlphaBeta(), NTuplePearsonFCN::objectiveValue(), NTupleLikeliHoodFCN::objectiveValue(), and NTupleChiSqFCN::objectiveValue(). |
|
||||||||||||
|
Calculates alpha and beta. Calculates the matrix alpha and the vector beta based on the data and the function values and derivatives. Resizes them if required.
Implements StatedFCN. Definition at line 190 of file NTupleFCN.cxx. References acceptRow(), StatedFCN::fillFreeDerivatives(), StatedFCN::getNumberFreeParms(), StatedFCN::m_function, StatedFCN::m_has_errors, m_indices, m_ntuple, StatedFCN::operator()(), reset(), hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::DataPoint2DTuple::YERR. |
|
|
Makes a copy of the derived class object.
Implemented in NTupleChiSqFCN, NTupleLikeliHoodFCN, and NTuplePearsonFCN. |
|
|
Calculates the number of degrees of freedom. Calculates the number of degrees of freedom. If the data points have error measurements, then points with zero error are ignored.
Implements StatedFCN. Definition at line 154 of file NTupleFCN.cxx. References std::count(), getErrorColumn(), StatedFCN::getNumberFreeParms(), StatedFCN::m_has_errors, and m_ntuple. |
|
||||||||||||
|
Clears and fills the vector with the derivatives of the function a coordinate value x.
Definition at line 149 of file StatedFCN.cxx. References StatedFCN::getParameters(), StatedFCN::m_fixed_flags, StatedFCN::m_function, and num_util::size(). Referenced by calcAlphaBeta(). |
|
|
Fills the vector with the values of the free parameters.
Definition at line 89 of file StatedFCN.cxx. References StatedFCN::getParameters(), StatedFCN::m_fixed_flags, StatedFCN::m_function, and num_util::size(). |
|
|
Returns the index to the column containing error on the value coordinate.
Definition at line 105 of file NTupleFCN.cxx. References m_dimen, m_indices, hippodraw::DataPoint2DTuple::YERR, and hippodraw::DataPoint3DTuple::ZERR. Referenced by degreesOfFreedom(), and hasErrors(). |
|
|
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 StatedFCN::m_fixed_flags. |
|
|
Returns the number of free parameters.
Definition at line 103 of file StatedFCN.cxx. References StatedFCN::m_fixed_flags, and num_util::size(). Referenced by calcAlphaBeta(), and degreesOfFreedom(). |
|
|
Returns the current state of the model function's parameters.
Definition at line 75 of file StatedFCN.cxx. References StatedFCN::m_function. Referenced by StatedFCN::fillFreeDerivatives(), StatedFCN::fillFreeParameters(), and StatedFCN::setFreeParameters(). |
|
|
Returns the names of the model function's parameters.
Definition at line 68 of file StatedFCN.cxx. References StatedFCN::m_function. |
|
|
Examines state of error bars.
Returns Definition at line 119 of file NTupleFCN.cxx. References std::bind2nd(), std::find_if(), getErrorColumn(), and m_ntuple. Referenced by setUseErrors(). |
|
|
Returns
Definition at line 48 of file StatedFCN.cxx. References StatedFCN::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 StatedFCN::operator()(). |
|
|
Sets the model function parameters to parms and returns the objective value.
Implements FCNBase. Definition at line 165 of file StatedFCN.cxx. References StatedFCN::m_function, StatedFCN::objectiveValue(), and StatedFCN::setParameters(). Referenced by calcAlphaBeta(), NTuplePearsonFCN::objectiveValue(), and NTupleChiSqFCN::objectiveValue(). |
|
||||||||||||||||
|
Resets the matrix alpha and the vector beta. Resets the matrix and vector to the appropriate size, if needed, and sets the elements to zero. Definition at line 171 of file NTupleFCN.cxx. Referenced by calcAlphaBeta(). |
|
||||||||||||||||
|
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. Implements StatedFCN. Definition at line 94 of file NTupleFCN.cxx. |
|
|
Sets the data source. Sets the data source and uses indexes for one dimensional function from hippodraw::DataPoint2DTuple. Implements StatedFCN. Definition at line 66 of file NTupleFCN.cxx. References hippodraw::DataPoint2DTuple::SIZE, num_util::size(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, hippodraw::DataPoint2DTuple::YERR, hippodraw::Axes::Z, and hippodraw::DataPoint3DTuple::ZERR. Referenced by hippodraw::Python::export_NTupleFCN(). |
|
|
Sets the cut to limit range of fitting.
Implements StatedFCN. Definition at line 232 of file NTupleFCN.cxx. References m_fit_cut, m_indices, and hippodraw::Axes::X. |
|
|
Sets use of a fitting range on or off.
Implements StatedFCN. Definition at line 242 of file NTupleFCN.cxx. References m_fit_range. |
|
|
Sets the parameters that are to be held fixed during minimization of this objective function.
Definition at line 124 of file StatedFCN.cxx. References StatedFCN::m_fixed_flags. |
|
|
Sets the free parameters from the vector parms.
Definition at line 131 of file StatedFCN.cxx. References StatedFCN::getParameters(), StatedFCN::m_fixed_flags, StatedFCN::m_function, StatedFCN::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 StatedFCN::m_fixed_flags, StatedFCN::m_function, and num_util::size(). Referenced by hippodraw::Python::export_StatedFCN(), and StatedFCN::StatedFCN(). |
|
|
Sets the values of the model function's parameters.
Definition at line 82 of file StatedFCN.cxx. References StatedFCN::m_function. Referenced by StatedFCN::operator()(), and StatedFCN::setFreeParameters(). |
|
|
Sets the use of errors on the data point.
If the data points contained in the NTuple contains errors, then set the use of errors on and return Implements StatedFCN. Definition at line 135 of file NTupleFCN.cxx. References hasErrors(), and StatedFCN::m_has_errors. |
|
|
The dimension of the coordinate.
Definition at line 70 of file NTupleFCN.h. Referenced by getErrorColumn(), NTupleChiSqFCN::objectiveValue(), and setDataSource(). |
|
|
The cut that manages the range on X to be used for fitting.
Definition at line 39 of file NTupleFCN.h. Referenced by acceptRow(), and setFitCut(). |
|
|
Set to
Definition at line 43 of file NTupleFCN.h. Referenced by acceptRow(), and setFitRange(). |
|
|
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 calcAlphaBeta(), StatedFCN::fillFreeDerivatives(), StatedFCN::fillFreeParameters(), StatedFCN::getParameters(), StatedFCN::getParmNames(), StatedFCN::hasFunction(), NTuplePearsonFCN::objectiveValue(), NTupleLikeliHoodFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), StatedFCN::operator()(), StatedFCN::setFreeParameters(), StatedFCN::setFunction(), and StatedFCN::setParameters(). |
|
|
Error use flag.
A flag set to Definition at line 71 of file StatedFCN.h. Referenced by calcAlphaBeta(), degreesOfFreedom(), NTuplePearsonFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), and setUseErrors(). |
|
|
The indexes into the DataSource. The first set are the coordinate variables. The next to last is the value and the last is the error on the value, or -1 if no errors available. Thus the size of the vector should be at least 3 and can be more for multi-dimensional coordinates. Definition at line 66 of file NTupleFCN.h. Referenced by calcAlphaBeta(), getErrorColumn(), NTuplePearsonFCN::objectiveValue(), NTupleLikeliHoodFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), setDataSource(), and setFitCut(). |
|
|
The ntuple containing the data points for the fitter.
Definition at line 74 of file NTupleFCN.h. Referenced by acceptRow(), calcAlphaBeta(), degreesOfFreedom(), hasErrors(), NTuplePearsonFCN::objectiveValue(), NTupleLikeliHoodFCN::objectiveValue(), NTupleChiSqFCN::objectiveValue(), and setDataSource(). |
1.4.3