TGo4FitModelPolynom Class Reference

Model objects, which reproduce component of polynomial function. More...

#include <TGo4FitModelPolynom.h>

Inheritance diagram for TGo4FitModelPolynom:

TGo4FitModel TGo4FitComponent TGo4FitParsList TGo4FitSlotList TGo4FitNamed List of all members.

Public Member Functions

 TGo4FitModelPolynom ()
 Default constructor.
 TGo4FitModelPolynom (const char *iName, Double_t iOrderX=0.)
 Creates TGo4FitModelPolynom object with given name for 1-dim case.
 TGo4FitModelPolynom (const char *iName, Double_t iOrderX, Double_t iOrderY)
 Creates TGo4FitModelPolynom object with given name for 2-dim case.
 TGo4FitModelPolynom (const char *iName, Double_t iOrderX, Double_t iOrderY, Double_t iOrderZ)
 Creates TGo4FitModelPolynom object with given name for 3-dim case.
 TGo4FitModelPolynom (const char *iName, const TArrayD &iPolynomOrders)
 Creates TGo4FitModelPolynom object with given name for n-dim case.
virtual ~TGo4FitModelPolynom ()
 Destroys TGo4FitModelPolynom object.
Double_t GetPolynomOrder (Int_t naxis)
 Get polynom order for specified axis.
Int_t GetMaxNumAxis ()
 Returns maximum axis number (dimensions number) in polynom.
Bool_t SetMaxNumAxis (Int_t numaxis)
 Sets number of dimensions (maximum axis numbers) in polynom.
virtual void Print (Option_t *option) const
 Print information on standard output.
virtual Bool_t BeforeEval (Int_t NDimension)
 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.

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
 Temporary variable for EvalN() function.
TArrayD * fxAllOrders
 Temporary variable for EvalN() function.
Double_t * Par_orders
 Temporary variable for EvalN() function.

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 23 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 26 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 32 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 39 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 46 of file TGo4FitModelPolynom.cxx.

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

TGo4FitModelPolynom::~TGo4FitModelPolynom (  )  [virtual]

Destroys TGo4FitModelPolynom object.

Definition at line 52 of file TGo4FitModelPolynom.cxx.

References fxAllOrders.


Member Function Documentation

Double_t TGo4FitModelPolynom::GetPolynomOrder ( Int_t  naxis  ) 

Get polynom order for specified axis.

Definition at line 72 of file TGo4FitModelPolynom.cxx.

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

Referenced by BeforeEval().

Int_t TGo4FitModelPolynom::GetMaxNumAxis (  ) 

Returns maximum axis number (dimensions number) in polynom.

Definition at line 78 of file TGo4FitModelPolynom.cxx.

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

Referenced by SetMaxNumAxis().

Bool_t TGo4FitModelPolynom::SetMaxNumAxis ( Int_t  numaxis  ) 

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

Definition at line 84 of file TGo4FitModelPolynom.cxx.

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

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

Print information on standard output.

Reimplemented from TGo4FitModel.

Definition at line 120 of file TGo4FitModelPolynom.cxx.

References TGo4FitModel::Print().

Bool_t TGo4FitModelPolynom::BeforeEval ( Int_t  NDimension  )  [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 98 of file TGo4FitModelPolynom.cxx.

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

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 109 of file TGo4FitModelPolynom.cxx.

References Par_ndim, and Par_orders.

void TGo4FitModelPolynom::AfterEval (  )  [virtual]

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

Reimplemented from TGo4FitModel.

Definition at line 116 of file TGo4FitModelPolynom.cxx.

References fxAllOrders.

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

Definition at line 65 of file TGo4FitModelPolynom.cxx.

Referenced by CreateOrdersPars(), GetMaxNumAxis(), GetPolynomOrder(), and SetMaxNumAxis().

void TGo4FitModelPolynom::CreateOrdersPars ( const Double_t *  orders,
Int_t  startaxis,
Int_t  maxaxis,
Int_t  AtIndx = -1 
) [private]

Definition at line 56 of file TGo4FitModelPolynom.cxx.

References GetOrderParName(), and TGo4FitComponent::NewParameter().

Referenced by SetMaxNumAxis(), and TGo4FitModelPolynom().


Member Data Documentation

Int_t TGo4FitModelPolynom::Par_ndim [private]

Temporary variable for EvalN() function.

Definition at line 122 of file TGo4FitModelPolynom.h.

Referenced by BeforeEval(), and EvalN().

TArrayD* TGo4FitModelPolynom::fxAllOrders [private]

Temporary variable for EvalN() function.

Definition at line 128 of file TGo4FitModelPolynom.h.

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

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:
Generated on Thu Oct 28 15:54:21 2010 for Go4-Fitpackagev4.04-2 by  doxygen 1.5.1