#include <FitObject.h>
Inheritance diagram for SctData::FitObject:
Public Member Functions | ||||
virtual shared_ptr< FitObject > | clone () const =0 throw () | |||
Allows any sub-class of FitObject to be used as a prototype. | ||||
virtual std::auto_ptr< TF1 > | makeRootTF1 () const throw (LogicError) | |||
Conversion utility functions;. | ||||
FitObject & | operator= (const TF1 &) throw (LogicError) | |||
Set the values of this FitObject equal to those of a ROOT TF1 function to be implimented in sub-classes. | ||||
void | print () const throw (LogicError) | |||
Print this to cout. | ||||
int | getNDim () const throw () | |||
Get the dimensionality. | ||||
int | getNPar () const throw () | |||
Get the number of parameters. | ||||
char * | getParName (const int ipar) const throw (LogicError) | |||
Get name of parameter ipar. | ||||
int | getParIndex (const std::string &name) const throw (LogicError) | |||
Return the parameter index corresponding to name. | ||||
double | getParError (const std::string &name) const throw (LogicError) | |||
Get the error on parameter. | ||||
double | getChiSquared () const throw () | |||
Get the chisquared. | ||||
int | getNDF () const throw () | |||
Get the number of degrees of freedom. | ||||
double | getVarMax (const int ivar) const throw (LogicError) | |||
Get the maximum value of the variable. | ||||
double | getVarMin (const int ivar) const throw (LogicError) | |||
Get the minimum value of the variable. | ||||
void | setVarMax (const int ivar, const double value) throw (LogicError) | |||
Set the maximum value of the variable:. | ||||
void | setVarMin (const int ivar, const double value) throw (LogicError) | |||
Set the minimum value of the variable. | ||||
char * | getFormula () const throw () | |||
get the Formula from the m_type object | ||||
void | fixParameter (int ipar, bool fix) | |||
Fixes or unfixes parameter ipar
| ||||
bool | isFixed (int ipar) const | |||
Returns whether parameter ipar is fixed
| ||||
void | setParameter (const int ipar, const double value) throw (LogicError) | |||
Set the value of parameter ipar. | ||||
void | setParError (const int ipar, const double value) throw (LogicError) | |||
Set the error of parameter ipar. | ||||
void | setParName (const int ipar, const char *name) throw (LogicError) | |||
void | setChiSquared (const double c) throw () | |||
Set the chiSquared. | ||||
void | setNDF (const int d) throw () | |||
Set the number of degrees of freedom. | ||||
virtual | ~FitObject () throw () | |||
Destructor does nothing. | ||||
void | reset () throw () | |||
Sets parameters, errors, chisquared and NDF to zero. | ||||
double | getParameter (const int ipar) const throw (LogicError) | |||
Get the value of parameter. | ||||
double | getParameter (const std::string &name) const throw (LogicError) | |||
Get the value of parameter. | ||||
double | getParError (const int ipar) const throw (LogicError) | |||
Get the error on parameter. | ||||
Protected Member Functions | ||||
FitObject (std::string formula, unsigned int nPar, const std::vector< std::string > &parNames, unsigned int nDim=1) | ||||
Create a default FitObject. | ||||
FitObject (std::string formula, unsigned int nPar, const std::vector< std::string > &parNames, const TF1 &f) | ||||
Create a FitObject from a ROOT TF1 object. | ||||
virtual std::auto_ptr< TF1 > | makeBasicRootTF1 () const =0 throw (LogicError) | |||
Make a TF1 using the appropriate constructor which can then be used in makeRootTF1(). | ||||
Protected Attributes | ||||
std::vector< double > | m_parameter | |||
values of parameters | ||||
std::vector< double > | m_parError | |||
error on parameters | ||||
std::vector< std::string > | m_parName | |||
names of parameters | ||||
std::vector< bool > | m_parFixed | |||
true if parameter is fixed | ||||
std::vector< double > | m_varMax | |||
maximum value of variables | ||||
std::vector< double > | m_varMin | |||
minimum value of variables | ||||
double | m_chiSquared | |||
chisquared parameter | ||||
int | m_nDF | |||
degrees of freedom | ||||
std::string | m_formula | |||
formula of type understood by root |
It can be published to and retrieved from IS. It can generate a ROOT TF1, or be created from one. Derived classes must implement a makeBasicRootTF1() method which use a suitable TF1 constructor.
So far I can't see any sensible use for `number of dimensions' != 1 but the class could be extensible to multi-dimensional functions.
The formula provided may be in a form comprehensible to ROOT e.g. "[0]*x*sin([1]*x)" for a 1-dimensional (x), 2-parameter ([0],[1]) function.
The analytical form of the functions themselves are in `FitFunctions.cpp'.
Definition at line 38 of file FitObject.h.
|
Destructor does nothing.
Definition at line 151 of file FitObject.h. |
|
Create a default FitObject.
|
|
Create a FitObject from a ROOT TF1 object.
|
|
Allows any sub-class of FitObject to be used as a prototype.
Implemented in SctData::ErfcFitObject, SctData::ErfFitObject, SctData::GausFitObject, and SctData::TopHatFitObject. |
|
Fixes or unfixes parameter ipar
Definition at line 141 of file FitObject.cpp. References getNPar(), and m_parFixed. Here is the call graph for this function: ![]() |
|
Get the chisquared.
Definition at line 103 of file FitObject.h. References m_chiSquared. Referenced by NagRootCompare::fillData(), and SctData::IO::FitObjectStreamer_v1::write(). |
|
get the Formula from the m_type object
Definition at line 121 of file FitObject.h. References m_formula. |
|
Get the number of degrees of freedom.
Definition at line 106 of file FitObject.h. References m_nDF. Referenced by NagRootCompare::fillData(), and SctData::IO::FitObjectStreamer_v1::write(). |
|
Get the dimensionality.
Definition at line 69 of file FitObject.h. References m_varMax. |
|
Get the number of parameters.
Definition at line 72 of file FitObject.h. References m_parameter. Referenced by NagRootCompare::fillData(), FitCompare::FillTree(), fixParameter(), isFixed(), and SctData::IO::FitObjectStreamer_v1::write(). |
|
Get the value of parameter.
Definition at line 184 of file FitObject.h. References getParameter(), and getParIndex(). Here is the call graph for this function: ![]() |
|
Get the value of parameter.
Definition at line 58 of file FitObject.cpp. Referenced by SctAnalysis::StrobeDelayAlgorithm::analyze(), NagRootCompare::fillData(), FitCompare::FillTree(), getParameter(), and SctData::IO::FitObjectStreamer_v1::write(). |
|
Get the error on parameter.
Definition at line 188 of file FitObject.h. References getParError(), and getParIndex(). Here is the call graph for this function: ![]() |
|
Get the error on parameter.
Definition at line 67 of file FitObject.cpp. Referenced by getParError(), and SctData::IO::FitObjectStreamer_v1::write(). |
|
Return the parameter index corresponding to name. The index can be used in the other functions. Referenced by getParameter(), and getParError(). |
|
Get name of parameter ipar.
Definition at line 40 of file FitObject.cpp. |
|
Get the maximum value of the variable.
Definition at line 105 of file FitObject.cpp. Referenced by SctData::TopHatFitObject::makeBasicRootTF1(), SctData::ErfFitObject::makeBasicRootTF1(), and SctData::ErfcFitObject::makeBasicRootTF1(). |
|
Get the minimum value of the variable.
Definition at line 114 of file FitObject.cpp. |
|
Returns whether parameter ipar is fixed
Definition at line 150 of file FitObject.cpp. References getNPar(), and m_parFixed. Referenced by SctData::IO::FitObjectStreamer_v1::write(). Here is the call graph for this function: ![]() |
|
Make a TF1 using the appropriate constructor which can then be used in makeRootTF1(). To be implimented by derived classes. Implemented in SctData::ErfcFitObject, SctData::ErfFitObject, SctData::GausFitObject, and SctData::TopHatFitObject. |
|
Conversion utility functions;. Make a new ROOT TF1 from this object. Calls the virtual function makeBasicRootTF1() Definition at line 160 of file FitObject.cpp. |
|
Set the values of this FitObject equal to those of a ROOT TF1 function to be implimented in sub-classes.
Reimplemented in SctData::ErfcFitObject, SctData::ErfFitObject, SctData::GausFitObject, and SctData::TopHatFitObject. Definition at line 206 of file FitObject.cpp. Referenced by SctData::TopHatFitObject::operator=(), SctData::GausFitObject::operator=(), SctData::ErfFitObject::operator=(), and SctData::ErfcFitObject::operator=(). |
|
Print this to cout.
Definition at line 233 of file FitObject.cpp. Referenced by SctDataDisplay::FitDisplayer::displayChannels(), and SctDataDisplay::FitDisplayer::displayChips(). |
|
Sets parameters, errors, chisquared and NDF to zero.
Definition at line 29 of file FitObject.cpp. References m_chiSquared, m_nDF, m_parameter, m_parError, m_parFixed, m_varMax, and m_varMin. |
|
Set the chiSquared.
Definition at line 144 of file FitObject.h. References m_chiSquared. |
|
Set the number of degrees of freedom.
Definition at line 147 of file FitObject.h. References m_nDF. |
|
Set the value of parameter ipar.
Definition at line 76 of file FitObject.cpp. |
|
Set the error of parameter ipar.
Definition at line 86 of file FitObject.cpp. |
|
Set the maximum value of the variable:.
Definition at line 123 of file FitObject.cpp. |
|
Set the minimum value of the variable.
Definition at line 132 of file FitObject.cpp. |
|
chisquared parameter
Definition at line 163 of file FitObject.h. Referenced by getChiSquared(), reset(), and setChiSquared(). |
|
formula of type understood by root
Definition at line 165 of file FitObject.h. Referenced by getFormula(). |
|
degrees of freedom
Definition at line 164 of file FitObject.h. |
|
values of parameters
Definition at line 157 of file FitObject.h. |
|
error on parameters
Definition at line 158 of file FitObject.h. Referenced by reset(). |
|
true if parameter is fixed
Definition at line 160 of file FitObject.h. Referenced by fixParameter(), isFixed(), and reset(). |
|
names of parameters
Definition at line 159 of file FitObject.h. |
|
maximum value of variables
Definition at line 161 of file FitObject.h. |
|
minimum value of variables
Definition at line 162 of file FitObject.h. Referenced by reset(). |