GSI Object Oriented Online Offline (Go4)
GO4-5.3.2
|
#include <TGo4FitParsList.h>
Public Member Functions | |
TGo4FitParsList () | |
TGo4FitParsList (Bool_t IsParsOwned) | |
TGo4FitParsList (const char *Name, const char *Title, Bool_t IsParsOwned) | |
virtual | ~TGo4FitParsList () |
virtual Int_t | NumPars () |
TGo4FitParameter * | GetPar (Int_t n) |
Int_t | GetParIndex (const TGo4FitParameter *par) |
TGo4FitParameter * | FindPar (const char *ParName) |
TGo4FitParameter * | FindPar (const char *OwnerFullName, const char *ParName) |
TGo4FitParameter * | FindPar (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 () |
TGo4FitParameter * | CreatePar (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 | |
TGo4FitParameter * | AddPar (TGo4FitParameter *par) |
TGo4FitParameter * | InsertPar (TGo4FitParameter *par, Int_t indx) |
void | SetParsOwner (TGo4FitNamed *iOwner) |
void | ClearParsBlocking () |
virtual TGo4FitParameter * | Get (Int_t n) |
TGo4FitParameter * | Find (const char *ParName) |
TGo4FitParameter * | Find (const char *OwnerFullName, const char *ParName) |
TGo4FitParameter * | Find (TGo4FitParameter *par) |
Bool_t | RemoveParByIndex (Int_t indx) |
Private Attributes | |
TOrdCollection | fxPars |
Bool_t | fbCanRollbackPars |
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.
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.
|
virtual |
Destroy TGo4FitParsList object.
Definition at line 43 of file TGo4FitParsList.cxx.
|
protected |
Definition at line 327 of file TGo4FitParsList.cxx.
References fbCanRollbackPars, fxPars, and TGo4FitNamed::SetOwner().
Referenced by CollectParsTo(), CreatePar(), TGo4FitComponent::NewAmplitude(), TGo4FitComponent::NewParameter(), and TGo4FitLinearTrans::TGo4FitLinearTrans().
|
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().
|
protected |
Definition at line 314 of file TGo4FitParsList.cxx.
References TGo4FitParameter::ClearBlocked(), Get(), and NumPars().
Referenced by TGo4FitterAbstract::Initialize().
|
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().
|
protected |
Definition at line 256 of file TGo4FitParsList.cxx.
References Get(), TGo4FitNamed::GetFullName(), and NumPars().
Referenced by CreatePar(), FindPar(), GetParEpsilon(), GetParError(), GetParFixed(), GetParRange(), GetParValue(), TGo4FitterAbstract::InitializeDependencies(), SetParEpsilon(), SetParError(), SetParFixed(), SetParRange(), and SetParValue().
|
protected |
Definition at line 267 of file TGo4FitParsList.cxx.
References Get(), TGo4FitNamed::GetOwner(), TGo4FitNamed::GetOwnerFullName(), and NumPars().
|
protected |
Definition at line 278 of file TGo4FitParsList.cxx.
|
inline |
Find parameter object with given name. Name can be both name or full name of TGo4FitParameter object. If no such parameters exists, return 0.
Definition at line 72 of file TGo4FitParsList.h.
References Find().
Referenced by TGo4FitPanel::ChangeObjectName(), TGo4FitPanel::Cmd_AddNewPar(), TGo4FitterAbstract::CopyParsValuesFrom(), TGo4FitModelPolynom::GetMaxNumAxis(), TGo4FitModelPolynom::GetPolynomOrder(), TGo4FitterConfig::MakeParForProperties(), QFitParCfgWidget::ParNameEdit_textChanged(), RemovePar(), TGo4FitModelGaussN::SetAxisNumbers(), and TGo4FitModelPolynom::SetMaxNumAxis().
|
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().
|
inline |
Find parameter in list. If no such parameters exists, return 0.
Definition at line 84 of file TGo4FitParsList.h.
References Find().
|
inlineprotectedvirtual |
Reimplemented in TGo4FitModel, and TGo4FitterAbstract.
Definition at line 275 of file TGo4FitParsList.h.
References fxPars, and NumPars().
Referenced by ClearParsBlocking(), CollectParsTo(), Find(), TGo4FitterAbstract::Get(), TGo4FitModel::Get(), GetPar(), GetParFullName(), GetParName(), GetParsValues(), IsAllParsFixed(), MemorizePars(), NumFixedPars(), RememberPars(), RemoveParByIndex(), TGo4FitComponent::SetAmplError(), TGo4FitComponent::SetAmplValue(), SetParName(), SetParsOwner(), and SetParsValues().
|
inline |
Return parameter according given index. If index out of valid range, return 0.
Definition at line 60 of file TGo4FitParsList.h.
References Get().
Referenced by TGo4FitModelGauss1::BeforeEval(), TGo4FitModelFormula::BeforeEval(), TGo4FitModelGauss2::BeforeEval(), TGo4FitPanel::Button_FitterDraw(), TGo4FitModelGaussN::FillMuVector(), TGo4FitPanel::FillParsList(), TGo4FitPanel::FillParsTable(), TGo4FitModelGaussN::FillSigmaMatrix(), TGo4FitComponent::GetAmplPar(), TGo4FitLinearTrans::GetCoefB(), TGo4FitLinearTrans::GetCoefK(), TGo4FitModelFormula::GetExprPar(), TGo4FitModelFunction::GetFuncPar(), GetParIndex(), TGo4FitModelGauss1::Integral(), Print(), PrintPars(), TGo4FitModel::RebuildShape(), TGo4FitLinearTrans::SetCoef(), TGo4FitLinearTrans::SetCoefB(), TGo4FitLinearTrans::SetCoefK(), TGo4FitMatrixTrans::Transformation(), and TGo4FitPanel::UpdateItem().
|
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().
|
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 | ) |
Return index of given parameter in list. If parameter not in list, return -1.
Definition at line 47 of file TGo4FitParsList.cxx.
References GetPar(), and NumPars().
Referenced by CollectParsTo(), TGo4FitModelFormula::GetPosParIndex(), TGo4FitModelFunction::GetPosParIndex(), TGo4FitModelFormula::GetWidthParIndex(), TGo4FitModelFunction::GetWidthParIndex(), TGo4FitterAbstract::InitializeDependencies(), TGo4FitModelGaussN::SetAxisNumbers(), and TGo4FitModelPolynom::SetMaxNumAxis().
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().
|
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().
|
protected |
Definition at line 335 of file TGo4FitParsList.cxx.
References fbCanRollbackPars, fxPars, and TGo4FitNamed::SetOwner().
Referenced by TGo4FitComponent::NewAmplitude(), and TGo4FitComponent::NewParameter().
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().
|
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().
|
inlinevirtual |
Return number of parameters in list.
Reimplemented in TGo4FitModel, and TGo4FitterAbstract.
Definition at line 54 of file TGo4FitParsList.h.
References fxPars.
Referenced by ClearParsBlocking(), CollectParsTo(), TGo4FitPanel::FillParsList(), TGo4FitPanel::FillParsTable(), Find(), Get(), TGo4FitModel::Get(), TGo4FitMatrixTrans::GetNumAxis(), TGo4FitModelFormula::GetNumberOfExprPar(), TGo4FitModelFunction::GetNumberOfFuncPar(), GetParIndex(), GetParsValues(), TGo4FitModel::Initialize(), IsAllParsFixed(), MemorizePars(), TGo4FitComponent::NewAmplitude(), NumFixedPars(), NumFreePars(), TGo4FitterAbstract::NumPars(), TGo4FitModel::NumPars(), Print(), PrintPars(), TGo4FitModel::RebuildShape(), RememberPars(), RemoveParByIndex(), TGo4FitMatrixTrans::SetNumAxis(), SetParsOwner(), SetParsValues(), and TGo4FitPanel::UpdateItem().
|
virtual |
Default print method. Call print method for every parameter object in list.
Reimplemented in TGo4Fitter, TGo4FitterAbstract, TGo4FitComponent, TGo4FitData, TGo4FitModel, TGo4FitModelFunction, TGo4FitModelPolynom, TGo4FitModelGaussN, TGo4FitModelFromData, TGo4FitDataRidge, TGo4FitModelGauss2, TGo4FitModelFormula, TGo4FitDataGraph, TGo4FitDataHistogram, TGo4FitDataProfile, TGo4FitModelGauss1, TGo4FitLinearTrans, and TGo4FitMatrixTrans.
Definition at line 216 of file TGo4FitParsList.cxx.
References fxPars, GetPar(), NumPars(), and TGo4FitParameter::Print().
Referenced by TGo4FitMatrixTrans::Print(), TGo4FitLinearTrans::Print(), TGo4FitterConfig::Print(), TGo4FitComponent::Print(), and TGo4FitterAbstract::Print().
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().
|
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.
|
protected |
Definition at line 285 of file TGo4FitParsList.cxx.
References Get(), NumPars(), and RemovePar().
Referenced by TGo4FitComponent::RemoveAmpl().
|
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().
|
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().
|
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().
|
protected |
Definition at line 244 of file TGo4FitParsList.cxx.
References Get(), NumPars(), and TGo4FitNamed::SetOwner().
void TGo4FitParsList::SetParsValues | ( | Double_t * | pars | ) |
Set value for all parameters from array.
Definition at line 74 of file TGo4FitParsList.cxx.
References Get(), NumPars(), and TGo4FitParameter::SetValue().
Referenced by TGo4FitterAbstract::ApplyConfig(), TGo4FitterAbstract::CalculateFitFunction(), TGo4Fitter::CalculateFitFunction(), Example13(), and Example2().
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().
|
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().
|
private |
Definition at line 282 of file TGo4FitParsList.h.
Referenced by AddPar(), ClearPars(), Get(), InsertPar(), NumPars(), Print(), RemovePar(), and TGo4FitParsList().