GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
TGo4FitParsList Class Reference

#include <TGo4FitParsList.h>

+ Inheritance diagram for TGo4FitParsList:

Public Member Functions

 TGo4FitParsList ()
 
 TGo4FitParsList (Bool_t IsParsOwned)
 
 TGo4FitParsList (const char *Name, const char *Title, Bool_t IsParsOwned)
 
virtual ~TGo4FitParsList ()
 
virtual Int_t NumPars ()
 
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 Print (Option_t *option="") const override
 
void PrintPars () const
 
virtual void CollectParsTo (TGo4FitParsList &list)
 
void ClearPars ()
 
- Public Member Functions inherited from TGo4FitNamed
 TGo4FitNamed ()
 
 TGo4FitNamed (const char *Name, const char *Title, TNamed *Owner=nullptr)
 
virtual ~TGo4FitNamed ()
 
const char * GetFullName ()
 
const char * GetOwnerFullName ()
 
void SetOwner (TNamed *iOwner)
 
TNamed * GetOwner ()
 
void Print (Option_t *option="") const override
 

Protected Member Functions

TGo4FitParameterAddPar (TGo4FitParameter *par)
 
TGo4FitParameterInsertPar (TGo4FitParameter *par, Int_t indx)
 
void SetParsOwner (TGo4FitNamed *iOwner)
 
void ClearParsBlocking ()
 
virtual TGo4FitParameterGet (Int_t n)
 
TGo4FitParameterFind (const char *ParName)
 
TGo4FitParameterFind (const char *OwnerFullName, const char *ParName)
 
TGo4FitParameterFind (TGo4FitParameter *par)
 
Bool_t RemoveParByIndex (Int_t indx)
 

Private Attributes

TOrdCollection fxPars
 
Bool_t fbCanRollbackPars {kFALSE}
 

Detailed Description

List of TGo4FitParameter objects. Contain list of parameters and provides access to parameters properties via names. Parameters objects may owned or not owned by TGo4FitParsList object.

Definition at line 28 of file TGo4FitParsList.h.

Constructor & Destructor Documentation

◆ TGo4FitParsList() [1/3]

TGo4FitParsList::TGo4FitParsList ( )

Default constructor.

Definition at line 25 of file TGo4FitParsList.cxx.

Referenced by TGo4FitModel::Initialize().

◆ TGo4FitParsList() [2/3]

TGo4FitParsList::TGo4FitParsList ( Bool_t  IsParsOwned)

Create TGo4FitParsList object and set flag of ownership of parameters object.

Definition at line 27 of file TGo4FitParsList.cxx.

References fxPars.

◆ TGo4FitParsList() [3/3]

TGo4FitParsList::TGo4FitParsList ( const char *  Name,
const char *  Title,
Bool_t  IsParsOwned 
)

Create TGo4FitParsList object, set it's name and title, and ownership flag of parameters pbjects.

Definition at line 32 of file TGo4FitParsList.cxx.

References fxPars.

◆ ~TGo4FitParsList()

TGo4FitParsList::~TGo4FitParsList ( )
virtual

Destroy TGo4FitParsList object.

Definition at line 38 of file TGo4FitParsList.cxx.

Member Function Documentation

◆ AddPar()

TGo4FitParameter * TGo4FitParsList::AddPar ( TGo4FitParameter par)
protected

◆ CanRollbackPars()

virtual bool TGo4FitParsList::CanRollbackPars ( )
inlinevirtual

Return true if parameters can be safely restored from memorized values;

Definition at line 213 of file TGo4FitParsList.h.

References AddPar(), ClearPars(), ClearParsBlocking(), CollectParsTo(), CreatePar(), fbCanRollbackPars, InsertPar(), IsAllParsFixed(), Print(), PrintPars(), RememberPars(), RemovePar(), and SetParsOwner().

Referenced by TGo4FitPanel::AboutToShowFitterMenu().

◆ ClearPars()

void TGo4FitParsList::ClearPars ( )

Remove all parameters from list. If parameters owned by list, they will be destroyed.

Definition at line 352 of file TGo4FitParsList.cxx.

References fbCanRollbackPars, and fxPars.

Referenced by CanRollbackPars(), TGo4FitPanel::Cmd_DeletePars(), TGo4FitterAbstract::CollectAllPars(), and TGo4FitMatrixTrans::SetNumAxis().

◆ ClearParsBlocking()

void TGo4FitParsList::ClearParsBlocking ( )
protected

◆ CollectParsTo()

void TGo4FitParsList::CollectParsTo ( TGo4FitParsList list)
virtual

Add all parameters to provided TGo4FitParsList object. User should take care, that both source and destination have not ownership flag at same time, otherwise it can cause error during these lists destroyment.

Reimplemented in TGo4FitComponent.

Definition at line 337 of file TGo4FitParsList.cxx.

References AddPar(), Get(), GetParIndex(), and NumPars().

Referenced by CanRollbackPars(), TGo4FitterAbstract::CollectAllPars(), and TGo4FitComponent::CollectParsTo().

◆ CreatePar()

TGo4FitParameter * TGo4FitParsList::CreatePar ( const char *  ParName,
const char *  Title,
Double_t  iValue = 0 
)

Create new TGo4FitParameter object with given name, title and parameter value, and put this object to the list. Return created parameter object.

Definition at line 274 of file TGo4FitParsList.cxx.

References AddPar(), and Find().

Referenced by TGo4FitterConfig::AddParNew(), CanRollbackPars(), TGo4FitPanel::Cmd_AddNewPar(), TGo4FitterConfig::MakeParForProperties(), and TGo4FitMatrixTrans::SetNumAxis().

◆ Find() [1/3]

TGo4FitParameter * TGo4FitParsList::Find ( const char *  ParName)
protected

◆ Find() [2/3]

TGo4FitParameter * TGo4FitParsList::Find ( const char *  OwnerFullName,
const char *  ParName 
)
protected

◆ Find() [3/3]

TGo4FitParameter * TGo4FitParsList::Find ( TGo4FitParameter par)
protected

Definition at line 305 of file TGo4FitParsList.cxx.

References Get(), and NumPars().

◆ FindPar() [1/3]

TGo4FitParameter* TGo4FitParsList::FindPar ( const char *  ParName)
inline

◆ FindPar() [2/3]

TGo4FitParameter* TGo4FitParsList::FindPar ( const char *  OwnerFullName,
const char *  ParName 
)
inline

Find parameter with given owner full name and parameter name. If no such parameters exists, return 0.

Definition at line 78 of file TGo4FitParsList.h.

References Find().

◆ FindPar() [3/3]

TGo4FitParameter* TGo4FitParsList::FindPar ( TGo4FitParameter par)
inline

◆ Get()

virtual TGo4FitParameter* TGo4FitParsList::Get ( Int_t  n)
inlineprotectedvirtual

◆ GetPar()

TGo4FitParameter* TGo4FitParsList::GetPar ( Int_t  n)
inline

◆ GetParEpsilon()

Bool_t TGo4FitParsList::GetParEpsilon ( const char *  ParName,
Double_t &  Epsilon 
)
virtual

Get epsilon value for parameter with given name. Return kTRUE, is successful.

Reimplemented in TGo4FitterAbstract.

Definition at line 149 of file TGo4FitParsList.cxx.

References Find(), and TGo4FitParameter::GetEpsilon().

Referenced by FindPar(), TGo4FitterConfig::GetParEpsilon(), and TGo4FitterAbstract::GetParEpsilon().

◆ GetParError()

Double_t TGo4FitParsList::GetParError ( const char *  ParName)

Get error value for parameter with given name. If no such parameters, return 0.

Definition at line 77 of file TGo4FitParsList.cxx.

References Find(), and TGo4FitParameter::GetError().

Referenced by FindPar().

◆ GetParFixed()

Bool_t TGo4FitParsList::GetParFixed ( const char *  ParName)
virtual

Return status for parameter with given name, is it fixed or not. If parameter not exist, return kFALSE.

Reimplemented in TGo4FitterAbstract.

Definition at line 103 of file TGo4FitParsList.cxx.

References Find().

Referenced by FindPar(), TGo4FitterConfig::GetParFixed(), and TGo4FitterAbstract::GetParFixed().

◆ GetParFullName()

const char * TGo4FitParsList::GetParFullName ( Int_t  n)

Return full name of parameter with given index. If index out of valid range, return 0.

Definition at line 168 of file TGo4FitParsList.cxx.

References Get(), and TGo4FitNamed::GetFullName().

Referenced by TGo4FitPanel::Button_FitterDraw(), TGo4FitMinuit::DoAction(), FindPar(), TGo4FitterAbstract::InitializeDependencies(), PrintPars(), and TGo4FitterAbstract::ProcessObjects().

◆ GetParIndex()

Int_t TGo4FitParsList::GetParIndex ( const TGo4FitParameter par)

◆ GetParName()

const char * TGo4FitParsList::GetParName ( Int_t  n)

Return name of parameter with given index. If index out of valid range, return 0.

Definition at line 161 of file TGo4FitParsList.cxx.

References Get().

Referenced by TGo4FitModelFormula::CompileFormula(), and FindPar().

◆ GetParRange()

Bool_t TGo4FitParsList::GetParRange ( const char *  ParName,
Double_t &  RangeMin,
Double_t &  RangeMax 
)
virtual

Get range limits for parameter with given name. If successful, return kTRUE.

Reimplemented in TGo4FitterAbstract.

Definition at line 133 of file TGo4FitParsList.cxx.

References Find().

Referenced by FindPar(), TGo4FitterConfig::GetParRange(), and TGo4FitterAbstract::GetParRange().

◆ GetParsValues()

void TGo4FitParsList::GetParsValues ( Double_t *  pars)

Copy values of all parameters in list to provided array. Array should have at lest NumPars() elements, otherwise routine can cause error.

Definition at line 64 of file TGo4FitParsList.cxx.

References Get(), TGo4FitParameter::GetValue(), and NumPars().

Referenced by TGo4FitterAbstract::ApplyConfig(), TGo4FitModel::BeforeEval(), TGo4FitterAbstract::Finalize(), FindPar(), TGo4FitModel::Initialize(), and TGo4FitMatrixTrans::SetNumAxis().

◆ GetParValue()

Double_t TGo4FitParsList::GetParValue ( const char *  ParName)

Return value of parameter with given name. If no such parameter, return 0.

Definition at line 48 of file TGo4FitParsList.cxx.

References Find().

Referenced by TGo4FitMinuit::DoAction(), FindPar(), and TXXXCalibPar::UpdateFrom().

◆ InsertPar()

TGo4FitParameter * TGo4FitParsList::InsertPar ( TGo4FitParameter par,
Int_t  indx 
)
protected

◆ IsAllParsFixed()

Bool_t TGo4FitParsList::IsAllParsFixed ( )

Returns true, if all parameters in list fixed;

Definition at line 229 of file TGo4FitParsList.cxx.

References Get(), TGo4FitParameter::GetFixed(), and NumPars().

Referenced by CanRollbackPars(), and TGo4FitData::Initialize().

◆ MemorizePars()

void TGo4FitParsList::MemorizePars ( )
virtual

Memorize values of all parameters. This values can be restore later by RemeberedPars().

Definition at line 216 of file TGo4FitParsList.cxx.

References fbCanRollbackPars, Get(), TGo4FitParameter::MemorizeValue(), and NumPars().

Referenced by TGo4FitPanel::Button_PerformFit(), TGo4FitPanel::Cmd_ExecuteActions(), TGo4FitPanel::Cmd_MemorizePars(), FindPar(), and TGo4FitterAbstract::ProcessObjects().

◆ NumFixedPars()

Int_t TGo4FitParsList::NumFixedPars ( )

Return number of fixed pars

Definition at line 109 of file TGo4FitParsList.cxx.

References Get(), TGo4FitParameter::GetFixed(), and NumPars().

Referenced by FindPar(), and NumFreePars().

◆ NumFreePars()

Int_t TGo4FitParsList::NumFreePars ( )

Return number of free pars

Definition at line 118 of file TGo4FitParsList.cxx.

References NumFixedPars(), and NumPars().

Referenced by TGo4Fitter::CalculateNDF(), and FindPar().

◆ NumPars()

virtual Int_t TGo4FitParsList::NumPars ( )
inlinevirtual

◆ Print()

void TGo4FitParsList::Print ( Option_t *  option = "") const
override

Default print method. Call print method for every parameter object in list.

Definition at line 237 of file TGo4FitParsList.cxx.

References fxPars, GetPar(), NumPars(), and TGo4FitParameter::Print().

Referenced by CanRollbackPars(), TGo4FitMatrixTrans::Print(), TGo4FitLinearTrans::Print(), TGo4FitterConfig::Print(), TGo4FitComponent::Print(), and TGo4FitterAbstract::Print().

◆ PrintPars()

void TGo4FitParsList::PrintPars ( ) const

Print only value and error of all parameters in list.

Definition at line 247 of file TGo4FitParsList.cxx.

References TGo4FitParameter::GetError(), GetPar(), GetParFullName(), TGo4FitParameter::GetValue(), l, and NumPars().

Referenced by CanRollbackPars(), Example6(), and TGo4Fitter::Print().

◆ RememberPars()

void TGo4FitParsList::RememberPars ( )
virtual

◆ RemovePar() [1/2]

Bool_t TGo4FitParsList::RemovePar ( const char *  name)

Remove parameter from list with given name. If parameter owned by list, parameter will be destroyed. Return kTRUE if successful.

Definition at line 320 of file TGo4FitParsList.cxx.

References FindPar().

Referenced by CanRollbackPars(), TGo4FitPanel::Cmd_DeletePar(), RemoveParByIndex(), TGo4FitModelGaussN::SetAxisNumbers(), TGo4FitModelPolynom::SetMaxNumAxis(), TGo4FitModelFormula::SetNumberOfExprPar(), and TGo4FitModelFunction::SetNumberOfFuncPar().

◆ RemovePar() [2/2]

Bool_t TGo4FitParsList::RemovePar ( TGo4FitParameter par)

Remove parameter from list. If parameter owned by list, parameter will be destroyed. Return kTRUE if successful.

Definition at line 325 of file TGo4FitParsList.cxx.

References fbCanRollbackPars, and fxPars.

◆ RemoveParByIndex()

Bool_t TGo4FitParsList::RemoveParByIndex ( Int_t  indx)
protected

Definition at line 313 of file TGo4FitParsList.cxx.

References Get(), NumPars(), and RemovePar().

Referenced by Get(), and TGo4FitComponent::RemoveAmpl().

◆ SetParEpsilon()

Bool_t TGo4FitParsList::SetParEpsilon ( const char *  ParName,
Double_t  Epsilon 
)
virtual

Set epsilon value for parameter with given name. Return kTRUE, if parameter exist.

Definition at line 139 of file TGo4FitParsList.cxx.

References Find(), and TGo4FitParameter::SetEpsilon().

Referenced by FindPar().

◆ SetParError()

Bool_t TGo4FitParsList::SetParError ( const char *  ParName,
Double_t  iError 
)

Set error value for parameter with given name. If such parameters exists, return kTRUE, otherwise kFALSE.

Definition at line 83 of file TGo4FitParsList.cxx.

References Find().

Referenced by TGo4FitMinuit::DoAction(), and FindPar().

◆ SetParFixed()

Bool_t TGo4FitParsList::SetParFixed ( const char *  ParName,
Bool_t  iFixed = kTRUE 
)
virtual

Set for parameter with given name, is it fixed or not.

Definition at line 93 of file TGo4FitParsList.cxx.

References Find().

Referenced by FindPar().

◆ SetParName()

void TGo4FitParsList::SetParName ( Int_t  n,
const char *  name 
)

Set new name for parameter object with provided index.

Definition at line 155 of file TGo4FitParsList.cxx.

References Get().

Referenced by FindPar(), and SetParsNames().

◆ SetParRange()

Bool_t TGo4FitParsList::SetParRange ( const char *  ParName,
Double_t  RangeMin,
Double_t  RangeMax 
)
virtual

Set range limits for parameter with given name. Return kTRUE, if parameter exist.

Definition at line 123 of file TGo4FitParsList.cxx.

References Find().

Referenced by FindPar().

◆ SetParsNames()

void TGo4FitParsList::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" 
)

Set names of first 10 parameters. For instance: list->SetParsNames("CoefK","CoefB","Const"). If there are more then 3 parameters in list, for the rest parameters standard names will be applied: "Par3", "Par4" and so on.

Definition at line 175 of file TGo4FitParsList.cxx.

References SetParName().

Referenced by TGo4FitPanel::CreateModel(), Example13(), Example2(), and FindPar().

◆ SetParsOwner()

void TGo4FitParsList::SetParsOwner ( TGo4FitNamed iOwner)
protected

Definition at line 268 of file TGo4FitParsList.cxx.

References Get(), NumPars(), and TGo4FitNamed::SetOwner().

Referenced by CanRollbackPars(), and InsertPar().

◆ SetParsValues() [1/2]

void TGo4FitParsList::SetParsValues ( Double_t *  pars)

◆ SetParsValues() [2/2]

void TGo4FitParsList::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. 
)

Set values for first 10 parameters. For instance, list->SetParsValues(1,345,23); If more than 3 parameters in list, for rest 0 values will be set.

Definition at line 191 of file TGo4FitParsList.cxx.

References Get(), and TGo4FitParameter::SetValue().

◆ SetParValue()

Bool_t TGo4FitParsList::SetParValue ( const char *  ParName,
Double_t  iValue 
)

Set value of parameter with given name. Return kTRUE in case of success, otherwise 0.

Definition at line 54 of file TGo4FitParsList.cxx.

References Find().

Referenced by TGo4FitMinuit::DoAction(), Example3(), Example4(), and FindPar().

Member Data Documentation

◆ fbCanRollbackPars

Bool_t TGo4FitParsList::fbCanRollbackPars {kFALSE}
private

If true, parameters can be safely rollback

Definition at line 287 of file TGo4FitParsList.h.

Referenced by AddPar(), CanRollbackPars(), ClearPars(), InsertPar(), MemorizePars(), and RemovePar().

◆ fxPars

TOrdCollection TGo4FitParsList::fxPars
private

The documentation for this class was generated from the following files: