Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

TGo4FitModelPolynom Class Reference

#include <TGo4FitModelPolynom.h>

Inheritance diagram for TGo4FitModelPolynom:
TGo4FitModel TGo4FitComponent TGo4FitParsList TGo4FitSlotList TGo4FitNamed

List of all members.

Public Member Functions

 TGo4FitModelPolynom ()
 TGo4FitModelPolynom (const char *iName, Double_t iOrderX=0.)
 TGo4FitModelPolynom (const char *iName, Double_t iOrderX, Double_t iOrderY)
 TGo4FitModelPolynom (const char *iName, Double_t iOrderX, Double_t iOrderY, Double_t iOrderZ)
 TGo4FitModelPolynom (const char *iName, const TArrayD &iPolynomOrders)
virtual ~TGo4FitModelPolynom ()
Double_t GetPolynomOrder (Int_t naxis)
Int_t GetMaxNumAxis ()
Bool_t SetMaxNumAxis (Int_t numaxis)
virtual void Print (Option_t *option) const
virtual Bool_t BeforeEval (Int_t NDimension)
virtual Double_t EvalN (const Double_t *v)
virtual void AfterEval ()

Protected Member Functions

TString GetOrderParName (Int_t naxis)

Private Member Functions

void CreateOrdersPars (const Double_t *orders, Int_t startaxis, Int_t maxaxis, Int_t AtIndx=-1)

Private Attributes

Int_t Par_ndim
TArrayD * fxAllOrders
Double_t * Par_orders

Detailed Description

Model objects, which reproduce component of polynomial function.

Expession can be written like:

Ampl * x^nx * y^ny * z^nz * ...

The order of polynomial function should be sets up in constructor like:

TGo4FitModelPolynom *p1 = new TGo4FitModelPolynom("Pol1",orderx,ordery,orderz); or TArrayD orders(5); Orders[0] = 1.; Orders[1] = 0.; ... TGo4FitModelPolynom *p2 = new TGo4FitModelPolynom("Pol2",Orders);

According to number of parameters in constructor TGo4FitModelPolynom has set of parameters "Order0", "Order1" and so on, representing polynom orders for axis x, y and so on correspondently. By default, these parameters are fixed and not fitted in optimizations. To change this default behavior, use:

p1->FindPar("Order0")->SetFixed(kFALSE);

TGo4FitModelPolynom class always has amplitude parameter, named "Ampl". It can be accessed by its name, for instance:

p1->FindPar("Ampl")->SetValue(1000.);

or

p1->GetAmplitudePar("Ampl")->SetValue(1000.);

GetAmplitudePar() method can be used in other models classes only if they create amplitude parameters, otherwise method returns 0.

Definition at line 50 of file TGo4FitModelPolynom.h.


Constructor & Destructor Documentation

TGo4FitModelPolynom::TGo4FitModelPolynom (  ) 

Default constructor.

Definition at line 21 of file TGo4FitModelPolynom.cxx.

TGo4FitModelPolynom::TGo4FitModelPolynom ( const char *  iName,
Double_t  iOrderX = 0. 
)

Creates TGo4FitModelPolynom object with given name for 1-dim case. The order of polynom for x axis can be specified (0 by default).

Definition at line 24 of file TGo4FitModelPolynom.cxx.

References CreateOrdersPars(), and TGo4FitModel::SetBackgroundGroupIndex().

TGo4FitModelPolynom::TGo4FitModelPolynom ( const char *  iName,
Double_t  iOrderX,
Double_t  iOrderY 
)

Creates TGo4FitModelPolynom object with given name for 2-dim case. The order of polynom for x and y axises should be specified.

Definition at line 30 of file TGo4FitModelPolynom.cxx.

References CreateOrdersPars(), and TGo4FitModel::SetBackgroundGroupIndex().

TGo4FitModelPolynom::TGo4FitModelPolynom ( const char *  iName,
Double_t  iOrderX,
Double_t  iOrderY,
Double_t  iOrderZ 
)

Creates TGo4FitModelPolynom object with given name for 3-dim case. The order of polynom for x, y and z axises should be specified.

Definition at line 37 of file TGo4FitModelPolynom.cxx.

References CreateOrdersPars(), and TGo4FitModel::SetBackgroundGroupIndex().

TGo4FitModelPolynom::TGo4FitModelPolynom ( const char *  iName,
const TArrayD &  iPolynomOrders 
)

Creates TGo4FitModelPolynom object with given name for n-dim case. An array of polynoms orders for appropriate axis should be specified. The size of array will be a dimensions size of polynom. But the n-dim polynom can be used for m-dim case. If n>m, orders for missing axis will be set 0. If n<m, only necessary orders will be used.

Definition at line 44 of file TGo4FitModelPolynom.cxx.

References CreateOrdersPars(), and TGo4FitModel::SetBackgroundGroupIndex().

TGo4FitModelPolynom::~TGo4FitModelPolynom (  )  [virtual]

Destroys TGo4FitModelPolynom object.

Definition at line 50 of file TGo4FitModelPolynom.cxx.

References fxAllOrders.


Member Function Documentation

void TGo4FitModelPolynom::AfterEval (  )  [virtual]

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

Reimplemented from TGo4FitModel.

Definition at line 114 of file TGo4FitModelPolynom.cxx.

References fxAllOrders.

Bool_t TGo4FitModelPolynom::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 96 of file TGo4FitModelPolynom.cxx.

References fxAllOrders, GetPolynomOrder(), Par_ndim, and Par_orders.

void TGo4FitModelPolynom::CreateOrdersPars ( const Double_t *  orders,
Int_t  startaxis,
Int_t  maxaxis,
Int_t  AtIndx = -1 
) [private]
Double_t TGo4FitModelPolynom::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 107 of file TGo4FitModelPolynom.cxx.

References Par_ndim, and Par_orders.

Int_t TGo4FitModelPolynom::GetMaxNumAxis (  ) 

Returns maximum axis number (dimensions number) in polynom.

Definition at line 76 of file TGo4FitModelPolynom.cxx.

References TGo4FitParsList::FindPar(), and GetOrderParName().

Referenced by SetMaxNumAxis().

TString TGo4FitModelPolynom::GetOrderParName ( Int_t  naxis  )  [protected]
Double_t TGo4FitModelPolynom::GetPolynomOrder ( Int_t  naxis  ) 

Get polynom order for specified axis.

Definition at line 70 of file TGo4FitModelPolynom.cxx.

References TGo4FitParsList::FindPar(), GetOrderParName(), and TGo4FitParameter::GetValue().

Referenced by BeforeEval().

void TGo4FitModelPolynom::Print ( Option_t *  option  )  const [virtual]

Print information on standard output.

Reimplemented from TGo4FitModel.

Definition at line 118 of file TGo4FitModelPolynom.cxx.

Bool_t TGo4FitModelPolynom::SetMaxNumAxis ( Int_t  numaxis  ) 

Sets number of dimensions (maximum axis numbers) in polynom.

Definition at line 82 of file TGo4FitModelPolynom.cxx.

References CreateOrdersPars(), TGo4FitParsList::FindPar(), GetMaxNumAxis(), GetOrderParName(), TGo4FitParsList::GetParIndex(), and TGo4FitParsList::RemovePar().


Member Data Documentation

Temporary variable for EvalN() function.

Definition at line 128 of file TGo4FitModelPolynom.h.

Referenced by AfterEval(), BeforeEval(), and ~TGo4FitModelPolynom().

Temporary variable for EvalN() function.

Definition at line 122 of file TGo4FitModelPolynom.h.

Referenced by BeforeEval(), and EvalN().

Double_t* TGo4FitModelPolynom::Par_orders [private]

Temporary variable for EvalN() function.

Definition at line 134 of file TGo4FitModelPolynom.h.

Referenced by BeforeEval(), and EvalN().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines