GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4FitParsList Class Reference

List of TGo4FitParameter objects. More...

#include <TGo4FitParsList.h>

+ Inheritance diagram for TGo4FitParsList:

Public Member Functions

 TGo4FitParsList ()
 Default constructor.
 
 TGo4FitParsList (Bool_t IsParsOwned)
 Create TGo4FitParsList object and set flag of ownership of parameters object.
 
 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.
 
virtual ~TGo4FitParsList ()
 Destroy TGo4FitParsList object.
 
virtual bool CanRollbackPars ()
 Return true if parameters can be safely restored from memorized values;.
 
void ClearPars ()
 Remove all parameters from list.
 
virtual void CollectParsTo (TGo4FitParsList &list)
 Add all parameters to provided TGo4FitParsList object.
 
TGo4FitParameterCreatePar (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.
 
TGo4FitParameterFindPar (const char *OwnerFullName, const char *ParName)
 Find parameter with given owner full name and parameter name.
 
TGo4FitParameterFindPar (const char *ParName)
 Find parameter object with given name.
 
TGo4FitParameterFindPar (TGo4FitParameter *par)
 Find parameter in list.
 
TGo4FitParameterGetPar (Int_t n)
 Return parameter according given index.
 
virtual Bool_t GetParEpsilon (const char *ParName, Double_t &Epsilon)
 Get epsilon value for parameter with given name.
 
Double_t GetParError (const char *ParName)
 Get error value for parameter with given name.
 
virtual Bool_t GetParFixed (const char *ParName)
 Return status for parameter with given name, is it fixed or not.
 
const char * GetParFullName (Int_t n)
 Return full name of parameter with given index.
 
Int_t GetParIndex (const TGo4FitParameter *par)
 Return index of given parameter in list.
 
const char * GetParName (Int_t n)
 Return name of parameter with given index.
 
virtual Bool_t GetParRange (const char *ParName, Double_t &RangeMin, Double_t &RangeMax)
 Get range limits for parameter with given name.
 
void GetParsValues (Double_t *pars)
 Copy values of all parameters in list to provided array.
 
Double_t GetParValue (const char *ParName)
 Return value of parameter with given name.
 
Bool_t IsAllParsFixed ()
 Returns true, if all parameters in list fixed;.
 
virtual void MemorizePars ()
 Memorize values of all parameters.
 
Int_t NumFixedPars ()
 Return number of fixed pars.
 
Int_t NumFreePars ()
 Return number of free pars.
 
virtual Int_t NumPars ()
 Return number of parameters in list.
 
void Print (Option_t *option="") const override
 Default print method.
 
void PrintPars () const
 Print only value and error of all parameters in list.
 
virtual void RememberPars ()
 Restore parameters values, which were stored by MemorizePars() routine;.
 
Bool_t RemovePar (const char *name)
 Remove parameter from list with given name.
 
Bool_t RemovePar (TGo4FitParameter *par)
 Remove parameter from list.
 
virtual Bool_t SetParEpsilon (const char *ParName, Double_t Epsilon)
 Set epsilon value for parameter with given name.
 
Bool_t SetParError (const char *ParName, Double_t iError)
 Set error value for parameter with given name.
 
virtual Bool_t SetParFixed (const char *ParName, Bool_t iFixed=kTRUE)
 Set for parameter with given name, is it fixed or not.
 
void SetParName (Int_t n, const char *name)
 Set new name for parameter object with provided index.
 
virtual Bool_t SetParRange (const char *ParName, Double_t RangeMin, Double_t RangeMax)
 Set range limits for parameter with given name.
 
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")
 Set names of first 10 parameters.
 
void SetParsValues (Double_t *pars)
 Set value for all parameters from array.
 
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.)
 Set values for first 10 parameters.
 
Bool_t SetParValue (const char *ParName, Double_t iValue)
 Set value of parameter with given name.
 
- Public Member Functions inherited from TGo4FitNamed
 TGo4FitNamed ()
 Default constructor.
 
 TGo4FitNamed (const char *Name, const char *Title, TNamed *Owner=nullptr)
 Creates TGo4FitNamed object and set name and title.
 
virtual ~TGo4FitNamed ()
 Destroy TGo4FitNamed object.
 
const char * GetFullName ()
 Returns full name of object.
 
TNamed * GetOwner ()
 Return owner of object.
 
const char * GetOwnerFullName ()
 Return full name of owner.
 
void Print (Option_t *option="") const override
 
void SetOwner (TNamed *iOwner)
 Sets owner of object.
 

Protected Member Functions

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

Private Attributes

Bool_t fbCanRollbackPars {kFALSE}
 If true, parameters can be safely rollback.
 
TOrdCollection fxPars
 

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

Constructor & Destructor Documentation

◆ TGo4FitParsList() [1/3]

◆ 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 TGo4FitNamed::TGo4FitNamed(), fbCanRollbackPars, and 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 TGo4FitNamed::TGo4FitNamed(), fbCanRollbackPars, and fxPars.

◆ ~TGo4FitParsList()

TGo4FitParsList::~TGo4FitParsList ( )
virtual

Destroy TGo4FitParsList object.

Definition at line 38 of file TGo4FitParsList.cxx.

Member Function Documentation

◆ AddPar()

◆ CanRollbackPars()

virtual bool TGo4FitParsList::CanRollbackPars ( )
inlinevirtual

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

Definition at line 214 of file TGo4FitParsList.h.

References fbCanRollbackPars.

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 TGo4FitPanel::Cmd_DeletePars(), TGo4FitterAbstract::CollectAllPars(), and TGo4FitMatrixTrans::SetNumAxis().

◆ ClearParsBlocking()

void TGo4FitParsList::ClearParsBlocking ( )
protected

Definition at line 346 of file TGo4FitParsList.cxx.

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

Referenced by TGo4FitterAbstract::Initialize().

◆ 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 TGo4FitParsList(), AddPar(), Get(), GetParIndex(), and NumPars().

Referenced by 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 TGo4FitPanel::Cmd_AddNewPar(), and TGo4FitMatrixTrans::SetNumAxis().

◆ Find() [1/3]

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

◆ Find() [2/3]

◆ 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 * 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 79 of file TGo4FitParsList.h.

References Find().

◆ FindPar() [2/3]

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

◆ FindPar() [3/3]

TGo4FitParameter * TGo4FitParsList::FindPar ( TGo4FitParameter * par)
inline

Find parameter in list.

If no such parameters exists, return 0.

Definition at line 85 of file TGo4FitParsList.h.

References Find().

◆ Get()

◆ GetPar()

◆ 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 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().

◆ 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 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(), TGo4FitterAbstract::InitializeDependencies(), and TGo4FitterAbstract::ProcessObjects().

◆ GetParIndex()

◆ 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().

◆ 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 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(), 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(), 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(), and NumPars().

Referenced by 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(), and TGo4FitterAbstract::ProcessObjects().

◆ NumFixedPars()

Int_t TGo4FitParsList::NumFixedPars ( )

Return number of fixed pars.

Definition at line 109 of file TGo4FitParsList.cxx.

References Get(), and NumPars().

Referenced by 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().

◆ NumPars()

◆ 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 TGo4FitParsList(), fxPars, GetPar(), NumPars(), and TGo4FitParameter::Print().

Referenced by 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 TGo4FitParsList(), and l.

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

◆ RememberPars()

void TGo4FitParsList::RememberPars ( )
virtual

Restore parameters values, which were stored by MemorizePars() routine;.

Definition at line 223 of file TGo4FitParsList.cxx.

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

Referenced by TGo4FitPanel::Cmd_RememberPars(), TGo4FitPanel::Fitter_RollbackParameters(), and TGo4FitterAbstract::ProcessObjects().

◆ 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(), and RemovePar().

Referenced by TGo4FitPanel::Cmd_DeletePar(), RemovePar(), 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 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().

◆ 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().

◆ 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().

◆ 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 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().

◆ 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(), and Example2().

◆ SetParsOwner()

void TGo4FitParsList::SetParsOwner ( TGo4FitNamed * iOwner)
protected

◆ 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(), and Example4().

Field Documentation

◆ fbCanRollbackPars

Bool_t TGo4FitParsList::fbCanRollbackPars {kFALSE}
private

If true, parameters can be safely rollback.

Definition at line 288 of file TGo4FitParsList.h.

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

◆ fxPars

TOrdCollection TGo4FitParsList::fxPars
private

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