GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitterAbstract.h
Go to the documentation of this file.
1 // $Id: TGo4FitterAbstract.h 748 2011-03-22 15:50:25Z linev $
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 für 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 TGO4FITTERABSTRACT_H
15 #define TGO4FITTERABSTRACT_H
16 
17 #include "TGo4FitParsList.h"
18 #include "TGo4FitSlot.h"
19 
20 #include "TObjArray.h"
21 #include "TArrayD.h"
22 
23 class TVirtualPad;
24 class TGo4FitterConfig;
25 class TGo4FitterAction;
26 class TGo4FitterOutput;
27 
36  public:
37 
42 
48  TGo4FitterAbstract(const char * iName, const char * iTitle);
49 
53  virtual ~TGo4FitterAbstract();
54 
59  virtual void Clear(Option_t* option = "");
60 
65  virtual Int_t NumPars() { CheckParsListChanging(); return TGo4FitParsList::NumPars(); }
66 
71  void SetParsListChange() { fbParsChange = kTRUE; }
72 
77 
82  virtual Bool_t GetParFixed(const char* ParName);
83 
88  virtual Bool_t GetParRange(const char* ParName, Double_t& RangeMin, Double_t& RangeMax);
89 
94  virtual Bool_t GetParEpsilon(const char* ParName, Double_t& Epsilon);
95 
99  Bool_t IsSuitableConfig(TGo4FitterConfig* Config);
100 
105  Bool_t ApplyConfig(TGo4FitterConfig* Config);
106 
112  Double_t CalculateFitFunction(Double_t* pars = 0);
113 
119  void AddAction(TGo4FitterAction* Action);
120 
124  void AddActionAt(TGo4FitterAction* Action, Int_t indx);
125 
129  Int_t GetNumActions() { return fxActions.GetLast()+1; }
130 
134  TGo4FitterAction* GetAction(Int_t num);
135 
139  void DeleteActions() { fxActions.Delete(); }
140 
144  void DeleteAction(TGo4FitterAction* action);
145 
149  void ReplaceAction(TGo4FitterAction* action, Int_t dir);
150 
159  void DoActions(Bool_t AllowFitterChange = kFALSE, TObjArray* Actions = 0);
160 
164  void DoAction(TGo4FitterAction* Action);
165 
169  void DoAction(Int_t indx);
170 
171 
172  TObjArray* ProcessObjects(TObjArray* objs, Bool_t CloneFitter = kTRUE, Bool_t OnlyRequired = kTRUE, TObjArray* rownames = 0, TObjArray* colnames = 0);
173 
179  void AddSimpleMinuit();
180 
184  TGo4FitterOutput* AddOutputAction(const char* Action, const char* Option = 0);
185 
189  void DeleteOutputActions();
190 
195  Int_t NeedPadsNumber();
196 
202  void SetPad(Int_t indx, TVirtualPad* pad);
203 
207  Bool_t IsParsAsResults() { return fbParsAsResults; }
208 
212  Int_t GetNumResults() const { return fxResults.GetSize() > 2 ? fxResults.GetSize() - 2 : 0; }
213 
220  Double_t GetResultValue(Int_t n) const;
221 
225  Double_t GetResultFF() const;
226 
230  Int_t GetResultNDF() const;
231 
235  const TArrayD* GetResults() { return &fxResults; }
236 
240  void PrintResults() const;
241 
245  virtual void Print(Option_t* option) const;
246 
247  protected:
248 
253  virtual Bool_t Initialize();
254 
258  Bool_t IsInitialized() { return fbInitializationDone; }
259 
263  virtual void Finalize();
264 
269  virtual void CollectAllPars();
270 
276 
281 
286  virtual Double_t DoCalculation() { return 0; }
287 
292  virtual Int_t DoNDFCalculation() { return 0; }
293 
297  Bool_t InitializeDependencies(TObjArray& Dependencies, Bool_t BlockPars, Bool_t DoInit);
298 
302  void RunDependenciesList(TObjArray& Dependencies, Double_t* pars);
303 
307  void FinalizeDependencies(TObjArray& Dependencies);
308 
312  void ExecuteDependencies(Double_t* pars);
313 
319  virtual Bool_t InitFitterData() { return kTRUE; }
320 
326  virtual void FinalizeFitterData() { return; }
327 
331  TObjArray fxActions;
332 
338  TArrayD fxResults;
339 
344 
345 
349  Bool_t fbParsChange;
350 
351 
356 
357 
362 
364 
367  /*# TGo4FitterAction lnkTGo4FitterAbstract; */
368 
370 };
371 #endif // TGO4FITTERABSTRACT_H
virtual Bool_t GetParEpsilon(const char *ParName, Double_t &Epsilon)
virtual void FinalizeFitterData()
virtual void Clear(Option_t *option="")
void DoAction(TGo4FitterAction *Action)
Int_t GetResultNDF() const
void DeleteAction(TGo4FitterAction *action)
virtual Double_t DoCalculation()
void AddAction(TGo4FitterAction *Action)
const TArrayD * GetResults()
virtual Bool_t InitFitterData()
virtual Int_t NumPars()
void ReplaceAction(TGo4FitterAction *action, Int_t dir)
void CopyParsValuesFrom(TGo4FitterAbstract *fitter)
virtual Bool_t GetParFixed(const char *ParName)
Int_t GetNumResults() const
void RunDependenciesList(TObjArray &Dependencies, Double_t *pars)
void FinalizeDependencies(TObjArray &Dependencies)
TGo4FitterOutput * AddOutputAction(const char *Action, const char *Option=0)
virtual Int_t NumPars()
virtual void Print(Option_t *option) const
virtual void CollectAllPars()
void DoActions(Bool_t AllowFitterChange=kFALSE, TObjArray *Actions=0)
TObjArray * ProcessObjects(TObjArray *objs, Bool_t CloneFitter=kTRUE, Bool_t OnlyRequired=kTRUE, TObjArray *rownames=0, TObjArray *colnames=0)
TGo4FitterConfig * fxCurrentConfig
ClassDef(TGo4FitSlotList, 1)
virtual TGo4FitParameter * Get(Int_t n)
Bool_t InitializeDependencies(TObjArray &Dependencies, Bool_t BlockPars, Bool_t DoInit)
Double_t GetResultFF() const
Double_t CalculateFitFunction(Double_t *pars=0)
Double_t GetResultValue(Int_t n) const
virtual Bool_t GetParRange(const char *ParName, Double_t &RangeMin, Double_t &RangeMax)
TGo4FitterAction * GetAction(Int_t num)
virtual Bool_t Initialize()
virtual TGo4FitParameter * Get(Int_t n)
void SetPad(Int_t indx, TVirtualPad *pad)
void AddActionAt(TGo4FitterAction *Action, Int_t indx)
Bool_t IsSuitableConfig(TGo4FitterConfig *Config)
Bool_t ApplyConfig(TGo4FitterConfig *Config)
virtual Int_t DoNDFCalculation()
void ExecuteDependencies(Double_t *pars)