Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TGo4FitModelFormula Class Reference

Model object, which uses ROOT TFormula class facility. More...

#include <TGo4FitModelFormula.h>

Inheritance diagram for TGo4FitModelFormula:

TGo4FitModel TGo4FitComponent TGo4FitParsList TGo4FitSlotList TGo4FitNamed List of all members.

Public Methods

 TGo4FitModelFormula ()
 Default constructor. More...

 TGo4FitModelFormula (const char *iName, const char *iExpressionStr="", Int_t iNPars=0, Bool_t AddAmplitude=kFALSE)
 Create TGo4FitModelFormula object with given names. More...

virtual ~TGo4FitModelFormula ()
 Destroys TGo4FitModelFormula object. More...

virtual Bool_t CanAmplTouch ()
 Signals that ampltide parameter can be removed from or introdeced to object. More...

const char * GetExpression ()
 Return formula expression. More...

void SetExpression (const char *expr)
 Sets formula expression. More...

Int_t GetNumberOfExprPar ()
 Get number of parameters, which can be used in exprssion. More...

Bool_t SetNumberOfExprPar (Int_t num)
 Sets number of parameters, which can be used in expression. More...

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. More...

virtual Double_t EvalN (const Double_t *v)
 Calculates value of model according current parameters values and provided axes values. More...

virtual void AfterEval ()
 Clear buffers, which were created by BeforeEval() method. More...

virtual void Print (Option_t *option) const
 Print information on standard output. More...


Protected Methods

virtual Bool_t Initialize (Int_t UseBuffers=-1)
 Initialize model object. More...

virtual void Finalize ()
 Deletes all buffers, created during initialization. More...

TGo4FitParameterGetExprPar (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. More...

virtual Int_t GetWidthParIndex (Int_t naxis)
 Return index of parameter (if exist), which represent width of model component for given axis. More...


Protected Attributes

TString fxExpression
 String, containig formula expression. More...

TArrayI fxPosIndex
TArrayI fxWidthIndex
TFormula * fxFormula
 formula for evaluation expression in EvalN() method. More...


Private Attributes

Int_t fiNDimension
 temporary variable for formula calculation in EvalN() method. More...


Detailed Description

Model object, which uses ROOT TFormula class facility.

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 29 of file TGo4FitModelFormula.h.


Constructor & Destructor Documentation

TGo4FitModelFormula::TGo4FitModelFormula  
 

Default constructor.

Definition at line 22 of file TGo4FitModelFormula.cxx.

TGo4FitModelFormula::TGo4FitModelFormula const char *    iName,
const char *    iExpressionStr = "",
Int_t    iNPars = 0,
Bool_t    AddAmplitude = kFALSE
 

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 26 of file TGo4FitModelFormula.cxx.

References GetExprParName(), n, and TGo4FitComponent::NewParameter().

TGo4FitModelFormula::~TGo4FitModelFormula   [virtual]
 

Destroys TGo4FitModelFormula object.

Definition at line 35 of file TGo4FitModelFormula.cxx.

References CloseFormula().


Member Function Documentation

virtual Bool_t TGo4FitModelFormula::CanAmplTouch   [inline, virtual]
 

Signals that ampltide parameter can be removed from or introdeced to object.

Reimplemented from TGo4FitComponent.

Definition at line 51 of file TGo4FitModelFormula.h.

const char* TGo4FitModelFormula::GetExpression   [inline]
 

Return formula expression.

Definition at line 56 of file TGo4FitModelFormula.h.

References fxExpression.

Referenced by TGo4FitPanelSlots::Wiz_GetModelInfo().

void TGo4FitModelFormula::SetExpression const char *    expr [inline]
 

Sets formula expression.

Definition at line 61 of file TGo4FitModelFormula.h.

References fxExpression.

Int_t TGo4FitModelFormula::GetNumberOfExprPar  
 

Get number of parameters, which can be used in exprssion.

Definition at line 39 of file TGo4FitModelFormula.cxx.

References TGo4FitComponent::GetAmplPar(), and TGo4FitParsList::NumPars().

Referenced by GetExprPar(), and SetNumberOfExprPar().

Bool_t TGo4FitModelFormula::SetNumberOfExprPar Int_t    num
 

Sets number of parameters, which can be used in expression.

Definition at line 51 of file TGo4FitModelFormula.cxx.

References GetExprPar(), GetExprParName(), GetNumberOfExprPar(), n, TGo4FitComponent::NewParameter(), and TGo4FitParsList::RemovePar().

void TGo4FitModelFormula::SetPosParIndex Int_t    naxis,
Int_t    indx = -1
 

Definition at line 64 of file TGo4FitModelFormula.cxx.

References fxPosIndex, and n.

Referenced by TGo4FitPanelSlots::CreateModel().

void TGo4FitModelFormula::SetWidthParIndex Int_t    naxis,
Int_t    indx = -1
 

Definition at line 74 of file TGo4FitModelFormula.cxx.

References fxWidthIndex, and n.

Referenced by TGo4FitPanelSlots::CreateModel().

Bool_t TGo4FitModelFormula::BeforeEval Int_t    ndim [virtual]
 

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 106 of file TGo4FitModelFormula.cxx.

References CompileFormula(), fiNDimension, fxFormula, TGo4FitParsList::GetPar(), n, and TGo4FitModel::NumPars().

Double_t TGo4FitModelFormula::EvalN const Double_t *    v [virtual]
 

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 114 of file TGo4FitModelFormula.cxx.

References fxFormula.

void TGo4FitModelFormula::AfterEval   [virtual]
 

Clear buffers, which were created by BeforeEval() method.

Reimplemented from TGo4FitModel.

Definition at line 124 of file TGo4FitModelFormula.cxx.

References CloseFormula().

void TGo4FitModelFormula::Print Option_t *    option const [virtual]
 

Print information on standard output.

Reimplemented from TGo4FitModel.

Definition at line 133 of file TGo4FitModelFormula.cxx.

References fxExpression, fxPosIndex, fxWidthIndex, and TGo4FitModel::Print().

Bool_t TGo4FitModelFormula::Initialize Int_t    UseBuffers = -1 [protected, virtual]
 

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 100 of file TGo4FitModelFormula.cxx.

References CloseFormula(), CompileFormula(), and TGo4FitModel::Initialize().

void TGo4FitModelFormula::Finalize   [protected, virtual]
 

Deletes all buffers, created during initialization.

Reimplemented from TGo4FitModel.

Definition at line 128 of file TGo4FitModelFormula.cxx.

References CloseFormula(), and TGo4FitModel::Finalize().

TGo4FitParameter * TGo4FitModelFormula::GetExprPar Int_t    n [protected]
 

Definition at line 45 of file TGo4FitModelFormula.cxx.

References TGo4FitComponent::GetAmplIndex(), GetNumberOfExprPar(), TGo4FitParsList::GetPar(), and n.

Referenced by GetPosParIndex(), GetWidthParIndex(), and SetNumberOfExprPar().

TString TGo4FitModelFormula::GetExprParName Int_t    n [protected]
 

Definition at line 94 of file TGo4FitModelFormula.cxx.

References n.

Referenced by SetNumberOfExprPar(), and TGo4FitModelFormula().

Bool_t TGo4FitModelFormula::CompileFormula   [protected]
 

Definition at line 148 of file TGo4FitModelFormula.cxx.

References CloseFormula(), fxExpression, fxFormula, TGo4FitParsList::GetParName(), n, and TGo4FitModel::NumPars().

Referenced by BeforeEval(), and Initialize().

void TGo4FitModelFormula::CloseFormula   [protected]
 

Definition at line 169 of file TGo4FitModelFormula.cxx.

References fxFormula.

Referenced by AfterEval(), CompileFormula(), Finalize(), Initialize(), and ~TGo4FitModelFormula().

Int_t TGo4FitModelFormula::GetPosParIndex Int_t    naxis [protected, virtual]
 

Return index of parameter (if exist), which represent position of model for given axis.

Reimplemented from TGo4FitModel.

Definition at line 84 of file TGo4FitModelFormula.cxx.

References fxPosIndex, GetExprPar(), and TGo4FitParsList::GetParIndex().

Int_t TGo4FitModelFormula::GetWidthParIndex Int_t    naxis [protected, virtual]
 

Return index of parameter (if exist), which represent width of model component for given axis.

Reimplemented from TGo4FitModel.

Definition at line 89 of file TGo4FitModelFormula.cxx.

References fxWidthIndex, GetExprPar(), and TGo4FitParsList::GetParIndex().


Member Data Documentation

TString TGo4FitModelFormula::fxExpression [protected]
 

String, containig formula expression.

Definition at line 102 of file TGo4FitModelFormula.h.

Referenced by CompileFormula(), GetExpression(), Print(), and SetExpression().

TArrayI TGo4FitModelFormula::fxPosIndex [protected]
 

Definition at line 104 of file TGo4FitModelFormula.h.

Referenced by GetPosParIndex(), Print(), and SetPosParIndex().

TArrayI TGo4FitModelFormula::fxWidthIndex [protected]
 

Definition at line 106 of file TGo4FitModelFormula.h.

Referenced by GetWidthParIndex(), Print(), and SetWidthParIndex().

TFormula* TGo4FitModelFormula::fxFormula [protected]
 

formula for evaluation expression in EvalN() method.

Definition at line 111 of file TGo4FitModelFormula.h.

Referenced by BeforeEval(), CloseFormula(), CompileFormula(), and EvalN().

Int_t TGo4FitModelFormula::fiNDimension [private]
 

temporary variable for formula calculation in EvalN() method.

Definition at line 117 of file TGo4FitModelFormula.h.

Referenced by BeforeEval().


The documentation for this class was generated from the following files:
Generated on Tue Nov 8 10:56:41 2005 for Go4-v2.10-5 by doxygen1.2.15