GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4FitParsList.h
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
14#ifndef TGO4FITPARSLIST_H
15#define TGO4FITPARSLIST_H
16
17#include "TGo4FitNamed.h"
18
19#include "TOrdCollection.h"
20
22
30 public:
31
36
40 TGo4FitParsList(Bool_t IsParsOwned);
41
45 TGo4FitParsList(const char *Name, const char *Title, Bool_t IsParsOwned);
46
50 virtual ~TGo4FitParsList();
51
55 virtual Int_t NumPars() { return fxPars.GetSize(); }
56
61 TGo4FitParameter *GetPar(Int_t n) { return Get(n); }
62
67 Int_t GetParIndex(const TGo4FitParameter *par);
68
73 TGo4FitParameter *FindPar(const char *ParName) { return Find(ParName); }
74
79 TGo4FitParameter *FindPar(const char *OwnerFullName, const char *ParName) { return Find(OwnerFullName,ParName); }
80
86
91 Double_t GetParValue(const char *ParName);
92
97 Bool_t SetParValue(const char *ParName, Double_t iValue);
98
103 void GetParsValues(Double_t *pars);
104
108 void SetParsValues(Double_t *pars);
109
114 Double_t GetParError(const char *ParName);
115
120 Bool_t SetParError(const char *ParName, Double_t iError);
121
125 virtual Bool_t SetParFixed(const char *ParName, Bool_t iFixed = kTRUE);
126
131 virtual Bool_t GetParFixed(const char *ParName);
132
136 Int_t NumFixedPars();
137
141 Int_t NumFreePars();
142
147 virtual Bool_t SetParRange(const char *ParName, Double_t RangeMin, Double_t RangeMax);
148
153 virtual Bool_t GetParRange(const char *ParName, Double_t& RangeMin, Double_t& RangeMax);
154
159 virtual Bool_t SetParEpsilon(const char *ParName, Double_t Epsilon);
160
165 virtual Bool_t GetParEpsilon(const char *ParName, Double_t& Epsilon);
166
170 void SetParName(Int_t n, const char *name);
171
176 const char *GetParName(Int_t n);
177
182 const char *GetParFullName(Int_t n);
183
190 void SetParsNames(const char *name0 = "Par0", const char *name1 = "Par1",
191 const char *name2 = "Par2", const char *name3 = "Par3",
192 const char *name4 = "Par4", const char *name5 = "Par5",
193 const char *name6 = "Par6", const char *name7 = "Par7",
194 const char *name8 = "Par8", const char *name9 = "Par9");
195
202 void SetParsValues(Double_t par0 = 0., Double_t par1 = 0., Double_t par2 = 0., Double_t par3 = 0., Double_t par4 = 0.,
203 Double_t par5 = 0., Double_t par6 = 0., Double_t par7 = 0., Double_t par8 = 0., Double_t par9 = 0.);
204
209 virtual void MemorizePars();
210
214 virtual bool CanRollbackPars() { return fbCanRollbackPars; }
215
219 virtual void RememberPars();
220
224 Bool_t IsAllParsFixed();
225
230 TGo4FitParameter *CreatePar(const char *ParName, const char *Title, Double_t iValue = 0);
231
237 Bool_t RemovePar(const char *name);
238
244 Bool_t RemovePar(TGo4FitParameter *par);
245
250 void Print(Option_t *option = "") const override;
251
255 void PrintPars() const;
256
261 virtual void CollectParsTo(TGo4FitParsList & list);
262
267 void ClearPars();
268
269 protected:
272 void SetParsOwner(TGo4FitNamed* iOwner);
273
274 void ClearParsBlocking();
275
276 virtual TGo4FitParameter *Get(Int_t n) { return (n >= 0) && (n < NumPars()) ? (TGo4FitParameter *) fxPars.At(n) : nullptr; }
277 TGo4FitParameter *Find(const char *ParName);
278 TGo4FitParameter *Find(const char *OwnerFullName, const char *ParName);
280 Bool_t RemoveParByIndex(Int_t indx);
281
282 private:
283 TOrdCollection fxPars;
284
288 Bool_t fbCanRollbackPars{kFALSE};
289
290 ClassDefOverride(TGo4FitParsList,1)
291};
292
293#endif // TGO4FITPARSLIST_H
Extension of ROOT TNamed class.
TGo4FitNamed()
Default constructor.
Model and data objects parameter.
List of TGo4FitParameter objects.
Bool_t IsAllParsFixed()
Returns true, if all parameters in list fixed;.
Bool_t SetParValue(const char *ParName, Double_t iValue)
Set value of 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.
TOrdCollection fxPars
TGo4FitParameter * FindPar(const char *ParName)
Find parameter object with given name.
Double_t GetParValue(const char *ParName)
Return value of parameter with given name.
Bool_t RemoveParByIndex(Int_t indx)
virtual Bool_t SetParRange(const char *ParName, Double_t RangeMin, Double_t RangeMax)
Set range limits for parameter with given name.
virtual Bool_t GetParFixed(const char *ParName)
Return status for parameter with given name, is it fixed or not.
Int_t GetParIndex(const TGo4FitParameter *par)
Return index of given parameter in list.
virtual Bool_t GetParRange(const char *ParName, Double_t &RangeMin, Double_t &RangeMax)
Get range limits for parameter with given name.
TGo4FitParameter * Find(const char *ParName)
void SetParsValues(Double_t *pars)
Set value for all parameters from array.
virtual void CollectParsTo(TGo4FitParsList &list)
Add all parameters to provided TGo4FitParsList object.
void GetParsValues(Double_t *pars)
Copy values of all parameters in list to provided array.
void SetParsOwner(TGo4FitNamed *iOwner)
Bool_t RemovePar(const char *name)
Remove parameter from list with given name.
virtual Bool_t GetParEpsilon(const char *ParName, Double_t &Epsilon)
Get epsilon value for parameter with given name.
virtual bool CanRollbackPars()
Return true if parameters can be safely restored from memorized values;.
const char * GetParFullName(Int_t n)
Return full name of parameter with given index.
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.
Int_t NumFixedPars()
Return number of fixed pars.
Double_t GetParError(const char *ParName)
Get error value for parameter with given name.
virtual TGo4FitParameter * Get(Int_t n)
const char * GetParName(Int_t n)
Return name of parameter with given index.
virtual void MemorizePars()
Memorize values of all parameters.
void Print(Option_t *option="") const override
Default print method.
TGo4FitParsList()
Default constructor.
TGo4FitParameter * GetPar(Int_t n)
Return parameter according given index.
void ClearPars()
Remove all parameters from list.
virtual void RememberPars()
Restore parameters values, which were stored by MemorizePars() routine;.
void PrintPars() const
Print only value and error of all parameters in list.
Int_t NumFreePars()
Return number of free pars.
TGo4FitParameter * 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...
virtual Int_t NumPars()
Return number of parameters in list.
virtual ~TGo4FitParsList()
Destroy TGo4FitParsList object.
TGo4FitParameter * FindPar(TGo4FitParameter *par)
Find parameter in list.
TGo4FitParameter * FindPar(const char *OwnerFullName, const char *ParName)
Find parameter with given owner full name and parameter name.
virtual Bool_t SetParEpsilon(const char *ParName, Double_t Epsilon)
Set epsilon value for parameter with given name.
void SetParName(Int_t n, const char *name)
Set new name for parameter object with provided index.
TGo4FitParameter * InsertPar(TGo4FitParameter *par, Int_t indx)
TGo4FitParameter * AddPar(TGo4FitParameter *par)
Bool_t fbCanRollbackPars
If true, parameters can be safely rollback.