#include <TGo4FitModelFormula.h>
Inheritance diagram for TGo4FitModelFormula:
Public Member Functions | |
TGo4FitModelFormula () | |
Default constructor. | |
TGo4FitModelFormula (const char *iName, const char *iExpressionStr="", Int_t iNPars=0, Bool_t AddAmplitude=kFALSE) | |
Create TGo4FitModelFormula object with given names. | |
virtual | ~TGo4FitModelFormula () |
Destroys TGo4FitModelFormula object. | |
virtual Bool_t | CanAmplTouch () |
Signals that ampltide parameter can be removed from or introdeced to object. | |
const char * | GetExpression () |
Return formula expression. | |
void | SetExpression (const char *expr) |
Sets formula expression. | |
Int_t | GetNumberOfExprPar () |
Get number of parameters, which can be used in exprssion. | |
Bool_t | SetNumberOfExprPar (Int_t num) |
Sets number of parameters, which can be used in expression. | |
void | SetPosParIndex (Int_t naxis, Int_t indx=-1) |
void | SetWidthParIndex (Int_t naxis, Int_t indx=-1) |
virtual Bool_t | BeforeEval (Int_t ndim) |
Prepares (if necesary) some intermediate variables to be able calculate values of model via EvalN() function. | |
virtual Double_t | EvalN (const Double_t *v) |
Calculates value of model according current parameters values and provided axes values. | |
virtual void | AfterEval () |
Clear buffers, which were created by BeforeEval() method. | |
virtual void | Print (Option_t *option) const |
Print information on standard output. | |
Protected Member Functions | |
virtual Bool_t | Initialize (Int_t UseBuffers=-1) |
Initialize model object. | |
virtual void | Finalize () |
Deletes all buffers, created during initialization. | |
TGo4FitParameter * | GetExprPar (Int_t n) |
TString | GetExprParName (Int_t n) |
Bool_t | CompileFormula () |
void | CloseFormula () |
virtual Int_t | GetPosParIndex (Int_t naxis) |
Return index of parameter (if exist), which represent position of model for given axis. | |
virtual Int_t | GetWidthParIndex (Int_t naxis) |
Return index of parameter (if exist), which represent width of model component for given axis. | |
Protected Attributes | |
TString | fxExpression |
String, containig formula expression. | |
TArrayI | fxPosIndex |
TArrayI | fxWidthIndex |
TFormula * | fxFormula |
formula for evaluation expression in EvalN() method. | |
Private Attributes | |
Int_t | Par_ndim |
temporary variable for formula calculation in EvalN() method. |
Any kind of one-line expression can be analyzed by TFormula object and evaluated for given set of axis values and set of parameters. TGo4FitModelFormula in constructor creates additional parameters with names "Par0", "Par1" and so on, which can be used in equation and can be optimized. Optionally amplitude parameters with name "Ampl" can be created. In constructor expression, number of additional parameters and using of amplitude parameter should be specified. Fort instance, equation with 3 parameters and amplitude:
TGo4FitModelFormula *f = new TGo4FitModelFormula("Form","(x-Par0)*(y-Par1)*(z-Par2)", 3, kTRUE);
Definition at line 30 of file TGo4FitModelFormula.h.
|
Default constructor.
Definition at line 23 of file TGo4FitModelFormula.cxx. |
|
Create TGo4FitModelFormula object with given names. Formula expression and number of parameters can be sets up. All using of amplitude parameter can be invoked. Definition at line 27 of file TGo4FitModelFormula.cxx. References GetExprParName(), and TGo4FitComponent::NewParameter(). |
|
Destroys TGo4FitModelFormula object.
Definition at line 36 of file TGo4FitModelFormula.cxx. References CloseFormula(). |
|
Signals that ampltide parameter can be removed from or introdeced to object.
Reimplemented from TGo4FitComponent. Definition at line 52 of file TGo4FitModelFormula.h. |
|
Return formula expression.
Definition at line 57 of file TGo4FitModelFormula.h. References fxExpression. |
|
Sets formula expression.
Definition at line 62 of file TGo4FitModelFormula.h. References fxExpression. |
|
Get number of parameters, which can be used in exprssion.
Definition at line 40 of file TGo4FitModelFormula.cxx. References TGo4FitComponent::GetAmplPar(), and TGo4FitParsList::NumPars(). Referenced by GetExprPar(), and SetNumberOfExprPar(). |
|
Sets number of parameters, which can be used in expression.
Definition at line 52 of file TGo4FitModelFormula.cxx. References GetExprPar(), GetExprParName(), GetNumberOfExprPar(), TGo4FitComponent::NewParameter(), and TGo4FitParsList::RemovePar(). |
|
Definition at line 65 of file TGo4FitModelFormula.cxx. References fxPosIndex. |
|
Definition at line 75 of file TGo4FitModelFormula.cxx. References fxWidthIndex. |
|
Prepares (if necesary) some intermediate variables to be able calculate values of model via EvalN() function. Number of axis, which will be used in evaluations, should be specified. Reimplemented from TGo4FitModel. Definition at line 108 of file TGo4FitModelFormula.cxx. References CompileFormula(), fxFormula, TGo4FitParsList::GetPar(), TGo4FitModel::NumPars(), and Par_ndim. |
|
Calculates value of model according current parameters values and provided axes values. BeforeEval(), EvalN() & AfterEval() virtual methods provides general interface, where user-specific code should be situated. Reimplemented from TGo4FitModel. Definition at line 116 of file TGo4FitModelFormula.cxx. |
|
Clear buffers, which were created by BeforeEval() method.
Reimplemented from TGo4FitModel. Definition at line 126 of file TGo4FitModelFormula.cxx. References CloseFormula(). |
|
Print information on standard output.
Reimplemented from TGo4FitModel. Definition at line 135 of file TGo4FitModelFormula.cxx. References fxExpression, fxPosIndex, fxWidthIndex, and TGo4FitModel::Print(). |
|
Initialize model object. If usage of buffers is specified (UseBuffers>0), method creates a number of buffers for representing model bins for each data, to which model was assign to. Reimplemented from TGo4FitModel. Definition at line 102 of file TGo4FitModelFormula.cxx. References CloseFormula(), CompileFormula(), and TGo4FitModel::Initialize(). |
|
Deletes all buffers, created during initialization.
Reimplemented from TGo4FitModel. Definition at line 130 of file TGo4FitModelFormula.cxx. References CloseFormula(), and TGo4FitModel::Finalize(). |
|
Definition at line 46 of file TGo4FitModelFormula.cxx. References TGo4FitComponent::GetAmplIndex(), GetNumberOfExprPar(), and TGo4FitParsList::GetPar(). Referenced by GetPosParIndex(), GetWidthParIndex(), and SetNumberOfExprPar(). |
|
Definition at line 95 of file TGo4FitModelFormula.cxx. Referenced by SetNumberOfExprPar(), and TGo4FitModelFormula(). |
|
Definition at line 150 of file TGo4FitModelFormula.cxx. References CloseFormula(), fxExpression, fxFormula, TGo4FitParsList::GetParName(), and TGo4FitModel::NumPars(). Referenced by BeforeEval(), and Initialize(). |
|
Definition at line 171 of file TGo4FitModelFormula.cxx. References fxFormula. Referenced by AfterEval(), CompileFormula(), Finalize(), Initialize(), and ~TGo4FitModelFormula(). |
|
Return index of parameter (if exist), which represent position of model for given axis.
Reimplemented from TGo4FitModel. Definition at line 85 of file TGo4FitModelFormula.cxx. References fxPosIndex, GetExprPar(), and TGo4FitParsList::GetParIndex(). |
|
Return index of parameter (if exist), which represent width of model component for given axis.
Reimplemented from TGo4FitModel. Definition at line 90 of file TGo4FitModelFormula.cxx. References fxWidthIndex, GetExprPar(), and TGo4FitParsList::GetParIndex(). |
|
String, containig formula expression.
Definition at line 103 of file TGo4FitModelFormula.h. Referenced by CompileFormula(), GetExpression(), Print(), and SetExpression(). |
|
Definition at line 105 of file TGo4FitModelFormula.h. Referenced by GetPosParIndex(), Print(), and SetPosParIndex(). |
|
Definition at line 107 of file TGo4FitModelFormula.h. Referenced by GetWidthParIndex(), Print(), and SetWidthParIndex(). |
|
formula for evaluation expression in EvalN() method.
Definition at line 112 of file TGo4FitModelFormula.h. Referenced by BeforeEval(), CloseFormula(), CompileFormula(), and EvalN(). |
|
temporary variable for formula calculation in EvalN() method.
Definition at line 118 of file TGo4FitModelFormula.h. Referenced by BeforeEval(), and EvalN(). |