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 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)
 
virtual void Print (Option_t *option) const
 
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=0)
 
virtual ~TGo4FitNamed ()
 
const char * GetFullName ()
 
const char * GetOwnerFullName ()
 
void SetOwner (TNamed *iOwner)
 
TNamed * GetOwner ()
 
void Print (Option_t *option) const
 

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
 

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::TGo4FitParsList ( )

Default constructor.

Definition at line 25 of file TGo4FitParsList.cxx.

Referenced by TGo4FitModel::Initialize().

TGo4FitParsList::TGo4FitParsList ( Bool_t  IsParsOwned)

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

Definition at line 31 of file TGo4FitParsList.cxx.

References fxPars.

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 37 of file TGo4FitParsList.cxx.

References fxPars.

TGo4FitParsList::~TGo4FitParsList ( )
virtual

Destroy TGo4FitParsList object.

Definition at line 43 of file TGo4FitParsList.cxx.

Member Function Documentation

TGo4FitParameter * TGo4FitParsList::AddPar ( TGo4FitParameter par)
protected
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 fbCanRollbackPars.

Referenced by TGo4FitPanel::AboutToShowFitterMenu().

void TGo4FitParsList::ClearPars ( )

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

Definition at line 320 of file TGo4FitParsList.cxx.

References fbCanRollbackPars, and fxPars.

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

void TGo4FitParsList::ClearParsBlocking ( )
protected

Definition at line 314 of file TGo4FitParsList.cxx.

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

Referenced by TGo4FitterAbstract::Initialize().

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 306 of file TGo4FitParsList.cxx.

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

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

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 250 of file TGo4FitParsList.cxx.

References AddPar(), and Find().

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

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

Definition at line 278 of file TGo4FitParsList.cxx.

References Get(), and NumPars().

TGo4FitParameter* TGo4FitParsList::FindPar ( const char *  ParName)
inline
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().

TGo4FitParameter* TGo4FitParsList::FindPar ( TGo4FitParameter par)
inline

Find parameter in list. If no such parameters exists, return 0.

Definition at line 84 of file TGo4FitParsList.h.

References Find().

virtual TGo4FitParameter* TGo4FitParsList::Get ( Int_t  n)
inlineprotectedvirtual
TGo4FitParameter* TGo4FitParsList::GetPar ( Int_t  n)
inline
Bool_t TGo4FitParsList::GetParEpsilon ( const char *  ParName,
Double_t &  Epsilon 
)
virtual

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

Reimplemented in TGo4FitterAbstract.

Definition at line 144 of file TGo4FitParsList.cxx.

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

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

Double_t TGo4FitParsList::GetParError ( const char *  ParName)

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

Definition at line 81 of file TGo4FitParsList.cxx.

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

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 102 of file TGo4FitParsList.cxx.

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

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

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 162 of file TGo4FitParsList.cxx.

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

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

Int_t TGo4FitParsList::GetParIndex ( const TGo4FitParameter par)
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 156 of file TGo4FitParsList.cxx.

References Get().

Referenced by TGo4FitModelFormula::CompileFormula().

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

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

Reimplemented in TGo4FitterAbstract.

Definition at line 130 of file TGo4FitParsList.cxx.

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

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

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 68 of file TGo4FitParsList.cxx.

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

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

Double_t TGo4FitParsList::GetParValue ( const char *  ParName)

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

Definition at line 54 of file TGo4FitParsList.cxx.

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

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

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

Returns true, if all parameters in list fixed;

Definition at line 209 of file TGo4FitParsList.cxx.

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

Referenced by TGo4FitData::Initialize().

void TGo4FitParsList::MemorizePars ( )
virtual

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

Definition at line 196 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().

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

Int_t TGo4FitParsList::NumFreePars ( )

Return number of free pars

Definition at line 117 of file TGo4FitParsList.cxx.

References NumFixedPars(), and NumPars().

Referenced by TGo4Fitter::CalculateNDF().

virtual Int_t TGo4FitParsList::NumPars ( )
inlinevirtual
void TGo4FitParsList::Print ( Option_t *  option) const
virtual
void TGo4FitParsList::PrintPars ( ) const

Print only value and error of all parameters in list.

Definition at line 226 of file TGo4FitParsList.cxx.

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

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

void TGo4FitParsList::RememberPars ( )
virtual

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

Definition at line 203 of file TGo4FitParsList.cxx.

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

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

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 succesfull.

Definition at line 291 of file TGo4FitParsList.cxx.

References FindPar().

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

Bool_t TGo4FitParsList::RemovePar ( TGo4FitParameter par)

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

Definition at line 296 of file TGo4FitParsList.cxx.

References fbCanRollbackPars, and fxPars.

Bool_t TGo4FitParsList::RemoveParByIndex ( Int_t  indx)
protected

Definition at line 285 of file TGo4FitParsList.cxx.

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

Referenced by TGo4FitComponent::RemoveAmpl().

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 137 of file TGo4FitParsList.cxx.

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

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 88 of file TGo4FitParsList.cxx.

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

Referenced by TGo4FitMinuit::DoAction().

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 95 of file TGo4FitParsList.cxx.

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

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

Set new name for parameter object with provided index.

Definition at line 151 of file TGo4FitParsList.cxx.

References Get().

Referenced by SetParsNames().

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(), and TGo4FitParameter::SetRange().

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 168 of file TGo4FitParsList.cxx.

References SetParName().

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

void TGo4FitParsList::SetParsOwner ( TGo4FitNamed iOwner)
protected

Definition at line 244 of file TGo4FitParsList.cxx.

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

void TGo4FitParsList::SetParsValues ( Double_t *  pars)
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 182 of file TGo4FitParsList.cxx.

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

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 61 of file TGo4FitParsList.cxx.

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

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

Member Data Documentation

Bool_t TGo4FitParsList::fbCanRollbackPars
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().

TOrdCollection TGo4FitParsList::fxPars
private

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