GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TGo4FitModelPolynom Class Reference

#include <TGo4FitModelPolynom.h>

+ Inheritance diagram for TGo4FitModelPolynom:

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 ()
 
- Public Member Functions inherited from TGo4FitModel
 TGo4FitModel ()
 
 TGo4FitModel (const char *iName, const char *iTitle, Bool_t MakeAmplitude=kFALSE)
 
virtual ~TGo4FitModel ()
 
void SetGroupIndex (Int_t index=-1)
 
void SetBackgroundGroupIndex ()
 
Int_t GetGroupIndex () const
 
Int_t NumAssigments () const
 
const char * AssignmentName (Int_t n)
 
void AssignToData (const char *DataName, Double_t RatioValue=1., Bool_t FixRatio=kFALSE)
 
Bool_t IsAssignTo (const char *DataName) const
 
void ChangeDataNameInAssignments (const char *oldname, const char *newname)
 
void ClearAssignmentTo (const char *DataName)
 
void ClearAssigmentTo (const char *DataName)
 
void ClearAssignments ()
 
void ConnectToDataIfAssigned (TGo4FitData *data)
 
Double_t GetRatioValueFor (const char *DataName)
 
virtual Double_t Evaluate (Double_t x)
 
virtual Double_t Evaluate (Double_t x, Double_t y)
 
virtual Double_t Evaluate (Double_t x, Double_t y, Double_t z)
 
virtual Double_t Evaluate (Double_t *v, Int_t ndim)
 
virtual Double_t Integral ()
 
virtual Bool_t GetPosition (Int_t naxis, Double_t &pos)
 
virtual Bool_t SetPosition (Int_t naxis, Double_t pos)
 
virtual Bool_t GetWidth (Int_t naxis, Double_t &width)
 
virtual Bool_t SetWidth (Int_t naxis, Double_t width)
 
void SetIntegrationsProperty (Int_t iMinIntegrDepth, Int_t iMaxIntegrDepth=0, Double_t iIntegrEps=0., Bool_t iAbsoluteEps=kFALSE, Bool_t iIntegrScaling=kFALSE)
 
Bool_t NeedIntegration ()
 
virtual Double_t EvaluateAtPoint (TGo4FitData *data, Int_t nbin, Bool_t UseRanges=kTRUE)
 
virtual Double_t EvaluateAtPoint (TGo4FitDataIter *iter, Bool_t UseRanges=kTRUE)
 
Bool_t AddModelToDataResult (TGo4FitData *data)
 
virtual Int_t NumPars ()
 
- Public Member Functions inherited from TGo4FitComponent
 TGo4FitComponent ()
 
 TGo4FitComponent (const char *iName, const char *iTitle)
 
virtual ~TGo4FitComponent ()
 
TGo4FitParameterGetAmplPar ()
 
const char * GetAmplName ()
 
const char * GetAmplFullName ()
 
Double_t GetAmplValue ()
 
void SetAmplValue (Double_t iAmpl)
 
Double_t GetAmplError ()
 
void SetAmplError (Double_t iError)
 
Bool_t MakeAmpl (Bool_t isFixed=kFALSE)
 
Bool_t RemoveAmpl ()
 
virtual Bool_t CanAmplTouch ()
 
void SetRange (Int_t naxis, Double_t min, Double_t max)
 
void ExcludeRange (Int_t naxis, Double_t min, Double_t max)
 
void SetRangeMin (Int_t naxis, Double_t value)
 
void SetRangeMax (Int_t naxis, Double_t value)
 
void AddRangeCut (TCutG *cut, Bool_t exclude=kFALSE)
 
void ClearRanges (Int_t naxis=-1)
 
Bool_t IsAnyRangeLimits ()
 
Bool_t GetRangeMin (Int_t naxis, Double_t &value)
 
Bool_t GetRangeMax (Int_t naxis, Double_t &value)
 
Int_t GetNumRangeCondition () const
 
void GetRangeCondition (Int_t n, Int_t &typ, Int_t &naxis, Double_t &left, Double_t &right) const
 
void SetRangeCondition (Int_t n, Int_t typ, Int_t naxis, Double_t left, Double_t right)
 
void AddRangeCondition (Int_t typ, Int_t naxis, Double_t left, Double_t right)
 
void RemoveRangeCondition (Int_t n)
 
Int_t GetNumRangeCut () const
 
TCutG * GetRangeCut (Int_t n) const
 
Bool_t IsRangeCutExcluding (Int_t n)
 
void SetRangeCutExcluding (Int_t n, Bool_t exclude=kTRUE)
 
void RemoveRangeCut (Int_t n)
 
Bool_t CheckRangeConditions (const Double_t *values, Int_t numaxis)
 
virtual void CollectParsTo (TGo4FitParsList &list)
 
void SetUseBuffers (Bool_t iUse)
 
Bool_t GetUseBuffers ()
 
- Public Member Functions inherited from TGo4FitParsList
 TGo4FitParsList ()
 
 TGo4FitParsList (Bool_t IsParsOwned)
 
 TGo4FitParsList (const char *Name, const char *Title, Bool_t IsParsOwned)
 
virtual ~TGo4FitParsList ()
 
TGo4FitParameterGetPar (Int_t n)
 
Int_t GetParIndex (const TGo4FitParameter *par)
 
TGo4FitParameterFindPar (const char *ParName)
 
TGo4FitParameterFindPar (const char *OwnerFullName, const char *ParName)
 
TGo4FitParameterFindPar (TGo4FitParameter *par)
 
Double_t GetParValue (const char *ParName)
 
Bool_t SetParValue (const char *ParName, Double_t iValue)
 
void GetParsValues (Double_t *pars)
 
void SetParsValues (Double_t *pars)
 
Double_t GetParError (const char *ParName)
 
Bool_t SetParError (const char *ParName, Double_t iError)
 
virtual Bool_t SetParFixed (const char *ParName, Bool_t iFixed=kTRUE)
 
virtual Bool_t GetParFixed (const char *ParName)
 
Int_t NumFixedPars ()
 
Int_t NumFreePars ()
 
virtual Bool_t SetParRange (const char *ParName, Double_t RangeMin, Double_t RangeMax)
 
virtual Bool_t GetParRange (const char *ParName, Double_t &RangeMin, Double_t &RangeMax)
 
virtual Bool_t SetParEpsilon (const char *ParName, Double_t Epsilon)
 
virtual Bool_t GetParEpsilon (const char *ParName, Double_t &Epsilon)
 
void SetParName (Int_t n, const char *name)
 
const char * GetParName (Int_t n)
 
const char * GetParFullName (Int_t n)
 
void SetParsNames (const char *name0="Par0", const char *name1="Par1", const char *name2="Par2", const char *name3="Par3", const char *name4="Par4", const char *name5="Par5", const char *name6="Par6", const char *name7="Par7", const char *name8="Par8", const char *name9="Par9")
 
void SetParsValues (Double_t par0=0., Double_t par1=0., Double_t par2=0., Double_t par3=0., Double_t par4=0., Double_t par5=0., Double_t par6=0., Double_t par7=0., Double_t par8=0., Double_t par9=0.)
 
virtual void MemorizePars ()
 
virtual bool CanRollbackPars ()
 
virtual void RememberPars ()
 
Bool_t IsAllParsFixed ()
 
TGo4FitParameterCreatePar (const char *ParName, const char *Title, Double_t iValue=0)
 
Bool_t RemovePar (const char *name)
 
Bool_t RemovePar (TGo4FitParameter *par)
 
void PrintPars () const
 
void ClearPars ()
 
- Public Member Functions inherited from TGo4FitNamed
 TGo4FitNamed ()
 
 TGo4FitNamed (const char *Name, const char *Title, TNamed *Owner=0)
 
virtual ~TGo4FitNamed ()
 
const char * GetFullName ()
 
const char * GetOwnerFullName ()
 
void SetOwner (TNamed *iOwner)
 
TNamed * GetOwner ()
 
void Print (Option_t *option) const
 
- Public Member Functions inherited from TGo4FitSlotList
 TGo4FitSlotList ()
 
virtual ~TGo4FitSlotList ()
 
virtual void FillSlotList (TSeqCollection *lst)
 
void SetUpdateSlotList ()
 
const TObjArray * GetSlotList (Bool_t ForceUpdate=kFALSE)
 
Int_t NumSlots ()
 
TGo4FitSlotGetSlot (Int_t nslot)
 
TGo4FitSlotFindSlot (const char *FullSlotName)
 
Bool_t ConnectSlots (TGo4FitSlot *slot1, TGo4FitSlot *slot2)
 
Bool_t ConnectSlots (const char *Slot1FullName, const char *Slot2FullName)
 
TGo4FitSlotSetObject (TObject *obj, Bool_t iOwned=kFALSE)
 
TGo4FitSlotSetObject (const char *PlaceName, TObject *obj, Bool_t iOwned=kFALSE)
 
TGo4FitSlotIsObjectInSlots (TObject *obj)
 
Bool_t CheckObjects (Bool_t MakeOut=kTRUE)
 
Bool_t IsEmptySlots ()
 
void ClearObjects (const char *PlaceName=0, Bool_t NonOwned=kTRUE)
 
void ClearSlot (TGo4FitSlot *slot, Bool_t NonOwned)
 
void SetSaveFlagForObjects (Int_t iSaveFlag, const char *PlaceName=0)
 

Protected Member Functions

TString GetOrderParName (Int_t naxis)
 
- Protected Member Functions inherited from TGo4FitModel
virtual TGo4FitParameterGet (Int_t n)
 
Double_t EvaluateAndIntegrate (Int_t NumScales, const Double_t *Scales, const Double_t *Widths)
 
virtual Bool_t Initialize (Int_t UseBuffers=-1)
 
virtual void Finalize ()
 
TGo4FitDataGetAssignedConnection (Int_t n)
 
Bool_t BuffersAllocated () const
 
void RebuildShape (Bool_t ForceBuild=kFALSE)
 
Double_t * GetModelBins (const char *DataName) const
 
void SetNeedToRebuild ()
 
virtual Double_t UserFunction (Double_t *, Double_t *)
 
virtual Int_t GetPosParIndex (Int_t)
 
virtual Int_t GetWidthParIndex (Int_t)
 
virtual TGo4FitParameterGetPosPar (Int_t naxis=0)
 
virtual TGo4FitParameterGetWidthPar (Int_t naxis=0)
 
const Int_t * GetDataFullIndex (TGo4FitData *data, Int_t nbin)
 
Int_t GetDataIndexesSize (TGo4FitData *data)
 
- Protected Member Functions inherited from TGo4FitComponent
TGo4FitParameterNewParameter (const char *Name, const char *Title, Double_t iValue=0., Bool_t Fixed=kFALSE, Int_t AtIndx=-1)
 
TGo4FitParameterNewAmplitude (const char *Name=0, Double_t iValue=0., Bool_t IsFixed=kFALSE, Int_t AtIndx=0)
 
Int_t GetAmplIndex ()
 
void SetAmplIndex (Int_t iAmplIndex=-1)
 
- Protected Member Functions inherited from TGo4FitParsList
TGo4FitParameterAddPar (TGo4FitParameter *par)
 
TGo4FitParameterInsertPar (TGo4FitParameter *par, Int_t indx)
 
void SetParsOwner (TGo4FitNamed *iOwner)
 
void ClearParsBlocking ()
 
TGo4FitParameterFind (const char *ParName)
 
TGo4FitParameterFind (const char *OwnerFullName, const char *ParName)
 
TGo4FitParameterFind (TGo4FitParameter *par)
 
Bool_t RemoveParByIndex (Int_t indx)
 
- Protected Member Functions inherited from TGo4FitSlotList
void CheckDuplicatesOnSlot ()
 
void PrepareSlotsForWriting ()
 
 ClassDef (TGo4FitSlotList, 1)
 

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
 

Additional Inherited Members

- Protected Attributes inherited from TGo4FitModel
Int_t fiMinIntegrDepth
 
Int_t fiMaxIntegrDepth
 
Double_t fdIntegrEps
 
Bool_t fbAbsoluteEps
 
Bool_t fbIntegrScaling
 
- Protected Attributes inherited from TGo4FitSlotList
TObjArray * fxSlotList
 
Bool_t fbUpdateSlotList
 

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 necessary) 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.

References TGo4FitModel::Print().

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

TArrayD* TGo4FitModelPolynom::fxAllOrders
private

Temporary variable for EvalN() function.

Definition at line 128 of file TGo4FitModelPolynom.h.

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

Int_t TGo4FitModelPolynom::Par_ndim
private

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: