![]() |
Diana Software
|
fitter More...
Public Member Functions | |
| QFitter (QRoutinePointer funcpointer, unsigned int NParameters, double LowBound, double UpBound) | |
| constructor More... | |
| QFitter (const QMathFunction &func) | |
| copy constructor More... | |
| ~QFitter () | |
| destructor More... | |
| void | SetParameter (unsigned int p, double val, double min, double max) |
| set parameter and its range More... | |
| void | SetParameter (unsigned int p, const char *name, double val, double min, double max) |
| set parameter, its range and name More... | |
| void | FixParameter (unsigned int p, double val) |
| fix parameter More... | |
| void | FixParameter (unsigned int p, const char *name, double val) |
| fix parameter and its name More... | |
| void | Print () |
| print parameters More... | |
| void | PrintResult () |
| print fitted parameters More... | |
| QError | Fit (const QVector &data, double minfit, double maxfit, double binsize) |
| fit QVector between minfit and max fits More... | |
| QError | Fit (const QVector &data, double error, double minfit, double maxfit, double binsize) |
| fit QVector between minfit and max fits assuming the same error for all points More... | |
| QError | Fit (const QVector &data, const QVector &errors, double minfit, double maxfit, double binsize) |
| fit QVector between minfit and max fits assuming errors on points More... | |
| QMathFunction | GetFittedFunction () |
| Get fitted function. More... | |
| QVector & | GetResiduals () |
| Get residuals. More... | |
| double | GetChiSquare () |
| Get chi square over NDOF. More... | |
| void | SetTF1 (TF1 &f1) |
| set parameters and ranges from TF1 More... | |
Public Member Functions inherited from QMathFunction | |
| QMathFunction (QRoutinePointer funcpointer, unsigned int NParameters, double LowBound, double UpBound) | |
| constructor More... | |
| QMathFunction (const QMathFunction &func) | |
| copy constructor More... | |
| virtual | ~QMathFunction () |
| destructor More... | |
| const QMathFunction & | operator= (const QMathFunction &func) |
| operator= More... | |
| void | SetParameter (unsigned int p, double val) |
| set parameter value More... | |
| void | SetParameter (unsigned int p, const char *name, double val) |
| set parameter value and name More... | |
| void | SetParameters (const double *param) |
| set all parameters from an array that has to be well sized More... | |
| double | GetParameter (unsigned int p) const |
| get parameter More... | |
| const double * | GetParameters () const |
| pointer to array of parameters More... | |
| size_t | GetNParameters () const |
| get number of parameters More... | |
| double | Eval (double x) const |
| evaluate function More... | |
| double | Eval (double x, double *params) const |
| evaluate function with external parameters More... | |
| void | SetVerbose (bool verbose=true) |
| set verbose More... | |
| QError | GetMinimum (double &min, double &minpos, double epsabs=0.001, double epsrel=0.0) |
| get function minimum More... | |
| QError | GetMaximum (double &max, double &maxpos, double epsabs=0.001, double epsrel=0.0) |
| get function maximum More... | |
Static Private Member Functions | |
| static double | RootRoutine (double *x, double *params) |
| function intercace used to fit with root More... | |
Private Attributes | |
| double * | fParMin |
| double * | fParMax |
| double * | fParErr |
| bool * | fIsFixed |
| QVector | fResiduals |
| QVector | fErrors |
| double | fChiSquare |
Static Private Attributes | |
| static const QMathFunction * | fFunctionP = NULL |
| pointer to this fitting function More... | |
Additional Inherited Members | |
Public Types inherited from QMathFunction | |
| typedef double(* | QRoutinePointer) (double, double *params) |
| pointer to function More... | |
Protected Member Functions inherited from QMathFunction | |
| gsl_function | GetGSLFunction () |
| return a gsl function More... | |
| void | SetParName (unsigned int p, const char *name) |
| set parameter name More... | |
Protected Attributes inherited from QMathFunction | |
| QRoutinePointer | fRoutine |
| pointer to the underlying static function More... | |
| size_t | fNParameters |
| number of parameters More... | |
| double * | fParameters |
| array of parameters More... | |
| std::vector< const char * > | fParNames |
| parameters names More... | |
| double | fLowBound |
| low function bound More... | |
| double | fUpBound |
| high function bound More... | |
| bool | fVerbose |
| verbose More... | |
fitter
Definition at line 18 of file QFitter.hh.
| QFitter::QFitter | ( | QRoutinePointer | funcpointer, |
| unsigned int | NParameters, | ||
| double | LowBound, | ||
| double | UpBound | ||
| ) |
constructor
Definition at line 12 of file QFitter.cc.
References fFunctionP, fIsFixed, QMathFunction::fNParameters, fParErr, fParMax, fParMin, and QMathFunction::fVerbose.
| QFitter::QFitter | ( | const QMathFunction & | func | ) |
copy constructor
Definition at line 22 of file QFitter.cc.
References fFunctionP, fIsFixed, QMathFunction::fNParameters, fParErr, fParMax, fParMin, and QMathFunction::fVerbose.
| QFitter::~QFitter | ( | ) |
| QError QFitter::Fit | ( | const QVector & | data, |
| const QVector & | errors, | ||
| double | minfit, | ||
| double | maxfit, | ||
| double | binsize | ||
| ) |
fit QVector between minfit and max fits assuming errors on points
| errors | vector of the same size of data |
| binsize |
Definition at line 118 of file QFitter.cc.
References QVector::Clear(), err, QMathFunction::Eval(), fChiSquare, fFunctionP, QMathFunction::fLowBound, QMathFunction::fNParameters, QMathFunction::fParameters, fParErr, fResiduals, QMathFunction::fUpBound, QMathFunction::fVerbose, histo(), Q_DOUBLE_DEFAULT, QERR_OUT_OF_RANGE, QERR_SUCCESS, QERR_UNKNOWN_ERR, QVector::Resize(), RootRoutine(), SetTF1(), and QVector::Size().
| QError QFitter::Fit | ( | const QVector & | data, |
| double | error, | ||
| double | minfit, | ||
| double | maxfit, | ||
| double | binsize | ||
| ) |
fit QVector between minfit and max fits assuming the same error for all points
Definition at line 110 of file QFitter.cc.
References Fit(), QVector::Initialize(), and QVector::Size().
fit QVector between minfit and max fits
Definition at line 103 of file QFitter.cc.
References QVector::Initialize(), and QVector::Size().
Referenced by Fit().
| void QFitter::FixParameter | ( | unsigned int | p, |
| const char * | name, | ||
| double | val | ||
| ) |
fix parameter and its name
Definition at line 93 of file QFitter.cc.
References FixParameter(), and QMathFunction::SetParName().
| void QFitter::FixParameter | ( | unsigned int | p, |
| double | val | ||
| ) |
fix parameter
Definition at line 85 of file QFitter.cc.
References fIsFixed, QMathFunction::fNParameters, and QMathFunction::fParameters.
Referenced by FixParameter().
|
inline |
| QMathFunction QFitter::GetFittedFunction | ( | ) |
Get fitted function.
|
inline |
|
virtual |
print parameters
Reimplemented from QMathFunction.
Definition at line 40 of file QFitter.cc.
References fIsFixed, QMathFunction::fNParameters, QMathFunction::fParameters, fParMax, fParMin, and QMathFunction::fParNames.
| void QFitter::PrintResult | ( | ) |
print fitted parameters
Definition at line 54 of file QFitter.cc.
References fIsFixed, QMathFunction::fNParameters, QMathFunction::fParameters, fParErr, and QMathFunction::fParNames.
|
staticprivate |
function intercace used to fit with root
Definition at line 98 of file QFitter.cc.
References QMathFunction::Eval(), and fFunctionP.
Referenced by Fit().
| void QFitter::SetParameter | ( | unsigned int | p, |
| const char * | name, | ||
| double | val, | ||
| double | min, | ||
| double | max | ||
| ) |
set parameter, its range and name
Definition at line 79 of file QFitter.cc.
References max, min(), SetParameter(), and QMathFunction::SetParName().
| void QFitter::SetParameter | ( | unsigned int | p, |
| double | val, | ||
| double | min, | ||
| double | max | ||
| ) |
set parameter and its range
Definition at line 68 of file QFitter.cc.
References fIsFixed, QMathFunction::fNParameters, QMathFunction::fParameters, fParMax, fParMin, max, and min().
Referenced by SetParameter().
|
virtual |
set parameters and ranges from TF1
Reimplemented from QMathFunction.
Definition at line 179 of file QFitter.cc.
References fIsFixed, QMathFunction::fNParameters, QMathFunction::fParameters, fParErr, fParMax, fParMin, and QMathFunction::SetTF1().
Referenced by Fit().
|
private |
Definition at line 92 of file QFitter.hh.
Referenced by Fit(), and GetChiSquare().
|
private |
Definition at line 91 of file QFitter.hh.
|
staticprivate |
pointer to this fitting function
Definition at line 83 of file QFitter.hh.
Referenced by Fit(), QFitter(), and RootRoutine().
|
private |
Definition at line 88 of file QFitter.hh.
Referenced by FixParameter(), Print(), PrintResult(), QFitter(), SetParameter(), SetTF1(), and ~QFitter().
|
private |
Definition at line 87 of file QFitter.hh.
Referenced by Fit(), PrintResult(), QFitter(), SetTF1(), and ~QFitter().
|
private |
Definition at line 86 of file QFitter.hh.
Referenced by Print(), QFitter(), SetParameter(), SetTF1(), and ~QFitter().
|
private |
Definition at line 85 of file QFitter.hh.
Referenced by Print(), QFitter(), SetParameter(), SetTF1(), and ~QFitter().
|
private |
Definition at line 90 of file QFitter.hh.
Referenced by Fit(), and GetResiduals().