Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4FitterAbstract.h

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef TGO4FITTERABSTRACT_H
00017 #define TGO4FITTERABSTRACT_H
00018 
00019 #include "TGo4FitParsList.h"
00020 #include "TGo4FitSlot.h"
00021 
00022 #include "TObjArray.h"
00023 #include "TArrayD.h"
00024 
00025 class TVirtualPad;
00026 class TGo4FitterConfig;
00027 class TGo4FitterAction;
00028 class TGo4FitterOutput;
00029 
00037 class TGo4FitterAbstract : public TGo4FitParsList, public TGo4FitSlotList {
00038    public:
00039 
00043       TGo4FitterAbstract();
00044 
00050       TGo4FitterAbstract(const char * iName, const char * iTitle);
00051 
00055       virtual ~TGo4FitterAbstract();
00056 
00061       virtual void Clear(Option_t* option = "");
00062 
00067       virtual Int_t NumPars() { CheckParsListChanging(); return TGo4FitParsList::NumPars(); }
00068 
00073       void SetParsListChange() { fbParsChange = kTRUE; }
00074 
00078       void CopyParsValuesFrom(TGo4FitterAbstract* fitter);
00079 
00084       virtual Bool_t GetParFixed(const char* ParName);
00085 
00090       virtual Bool_t GetParRange(const char* ParName, Double_t& RangeMin, Double_t& RangeMax);
00091 
00096       virtual Bool_t GetParEpsilon(const char* ParName, Double_t& Epsilon);
00097 
00101       Bool_t IsSuitableConfig(TGo4FitterConfig* Config);
00102 
00107       Bool_t ApplyConfig(TGo4FitterConfig* Config);
00108 
00114       Double_t CalculateFitFunction(Double_t* pars = 0);
00115 
00121       void AddAction(TGo4FitterAction* Action);
00122 
00126       void AddActionAt(TGo4FitterAction* Action, Int_t indx);
00127 
00131       Int_t GetNumActions() { return fxActions.GetLast()+1; }
00132 
00136       TGo4FitterAction* GetAction(Int_t num);
00137 
00141       void DeleteActions() { fxActions.Delete(); }
00142 
00146       void DeleteAction(TGo4FitterAction* action);
00147 
00151       void ReplaceAction(TGo4FitterAction* action, Int_t dir);
00152 
00161       void DoActions(Bool_t AllowFitterChange = kFALSE, TObjArray* Actions = 0);
00162 
00166       void DoAction(TGo4FitterAction* Action);
00167 
00171       void DoAction(Int_t indx);
00172 
00173 
00174       TObjArray* ProcessObjects(TObjArray* objs, Bool_t CloneFitter = kTRUE, Bool_t OnlyRequired = kTRUE, TObjArray* rownames = 0, TObjArray* colnames = 0);
00175 
00181       void AddSimpleMinuit();
00182 
00186       TGo4FitterOutput* AddOutputAction(const char* Action, const char* Option = 0);
00187 
00191       void DeleteOutputActions();
00192 
00197       Int_t NeedPadsNumber();
00198 
00204       void SetPad(Int_t indx, TVirtualPad* pad);
00205 
00209       Bool_t IsParsAsResults() { return fbParsAsResults; }
00210 
00214       Int_t GetNumResults() const { return fxResults.GetSize() > 2 ? fxResults.GetSize() - 2 : 0; }
00215 
00222       Double_t GetResultValue(Int_t n) const;
00223 
00227       Double_t GetResultFF() const;
00228 
00232       Int_t GetResultNDF() const;
00233 
00237       const TArrayD* GetResults() { return &fxResults; }
00238 
00242       void PrintResults() const;
00243 
00247       virtual void Print(Option_t* option) const;
00248 
00249    protected:
00250 
00255       virtual Bool_t Initialize();
00256 
00260       Bool_t IsInitialized() { return fbInitializationDone; }
00261 
00265       virtual void Finalize();
00266 
00271       virtual void CollectAllPars();
00272 
00277       virtual TGo4FitParameter* Get(Int_t n) { CheckParsListChanging(); return TGo4FitParsList::Get(n); }
00278 
00282       void CheckParsListChanging() { if(fbParsChange) CollectAllPars(); }
00283 
00288       virtual Double_t DoCalculation() { return 0; }
00289 
00294       virtual Int_t DoNDFCalculation() { return 0; }
00295 
00299       Bool_t InitializeDependencies(TObjArray& Dependencies, Bool_t BlockPars, Bool_t DoInit);
00300 
00304       void RunDependenciesList(TObjArray& Dependencies, Double_t* pars);
00305 
00309       void FinalizeDependencies(TObjArray& Dependencies);
00310 
00314       void ExecuteDependencies(Double_t* pars);
00315 
00321       virtual Bool_t InitFitterData() { return kTRUE; }
00322 
00328       virtual void FinalizeFitterData() { return; }
00329 
00333       TObjArray fxActions;
00334 
00340       TArrayD fxResults;
00341 
00345       TGo4FitterConfig* fxCurrentConfig;               
00346 
00347 
00351       Bool_t fbParsChange;                             
00352 
00353 
00357       Bool_t fbInitializationDone;                     
00358 
00359 
00363       Bool_t fbNeedToFinalize;                         
00364 
00365       Bool_t fbParsAsResults;                          
00366 
00369       /*#  TGo4FitterAction lnkTGo4FitterAbstract; */
00370 
00371    ClassDef(TGo4FitterAbstract,1)
00372 };
00373 #endif // TGO4FITTERABSTRACT_H
00374 
00375 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:13 2008 for Go4-v3.04-1 by  doxygen 1.4.2