00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4FITTERABSTRACT_H
00015 #define TGO4FITTERABSTRACT_H
00016
00017 #include "TGo4FitParsList.h"
00018 #include "TGo4FitSlot.h"
00019
00020 #include "TObjArray.h"
00021 #include "TArrayD.h"
00022
00023 class TVirtualPad;
00024 class TGo4FitterConfig;
00025 class TGo4FitterAction;
00026 class TGo4FitterOutput;
00027
00035 class TGo4FitterAbstract : public TGo4FitParsList, public TGo4FitSlotList {
00036 public:
00037
00041 TGo4FitterAbstract();
00042
00048 TGo4FitterAbstract(const char * iName, const char * iTitle);
00049
00053 virtual ~TGo4FitterAbstract();
00054
00059 virtual void Clear(Option_t* option = "");
00060
00065 virtual Int_t NumPars() { CheckParsListChanging(); return TGo4FitParsList::NumPars(); }
00066
00071 void SetParsListChange() { fbParsChange = kTRUE; }
00072
00076 void CopyParsValuesFrom(TGo4FitterAbstract* fitter);
00077
00082 virtual Bool_t GetParFixed(const char* ParName);
00083
00088 virtual Bool_t GetParRange(const char* ParName, Double_t& RangeMin, Double_t& RangeMax);
00089
00094 virtual Bool_t GetParEpsilon(const char* ParName, Double_t& Epsilon);
00095
00099 Bool_t IsSuitableConfig(TGo4FitterConfig* Config);
00100
00105 Bool_t ApplyConfig(TGo4FitterConfig* Config);
00106
00112 Double_t CalculateFitFunction(Double_t* pars = 0);
00113
00119 void AddAction(TGo4FitterAction* Action);
00120
00124 void AddActionAt(TGo4FitterAction* Action, Int_t indx);
00125
00129 Int_t GetNumActions() { return fxActions.GetLast()+1; }
00130
00134 TGo4FitterAction* GetAction(Int_t num);
00135
00139 void DeleteActions() { fxActions.Delete(); }
00140
00144 void DeleteAction(TGo4FitterAction* action);
00145
00149 void ReplaceAction(TGo4FitterAction* action, Int_t dir);
00150
00159 void DoActions(Bool_t AllowFitterChange = kFALSE, TObjArray* Actions = 0);
00160
00164 void DoAction(TGo4FitterAction* Action);
00165
00169 void DoAction(Int_t indx);
00170
00171
00172 TObjArray* ProcessObjects(TObjArray* objs, Bool_t CloneFitter = kTRUE, Bool_t OnlyRequired = kTRUE, TObjArray* rownames = 0, TObjArray* colnames = 0);
00173
00179 void AddSimpleMinuit();
00180
00184 TGo4FitterOutput* AddOutputAction(const char* Action, const char* Option = 0);
00185
00189 void DeleteOutputActions();
00190
00195 Int_t NeedPadsNumber();
00196
00202 void SetPad(Int_t indx, TVirtualPad* pad);
00203
00207 Bool_t IsParsAsResults() { return fbParsAsResults; }
00208
00212 Int_t GetNumResults() const { return fxResults.GetSize() > 2 ? fxResults.GetSize() - 2 : 0; }
00213
00220 Double_t GetResultValue(Int_t n) const;
00221
00225 Double_t GetResultFF() const;
00226
00230 Int_t GetResultNDF() const;
00231
00235 const TArrayD* GetResults() { return &fxResults; }
00236
00240 void PrintResults() const;
00241
00245 virtual void Print(Option_t* option) const;
00246
00247 protected:
00248
00253 virtual Bool_t Initialize();
00254
00258 Bool_t IsInitialized() { return fbInitializationDone; }
00259
00263 virtual void Finalize();
00264
00269 virtual void CollectAllPars();
00270
00275 virtual TGo4FitParameter* Get(Int_t n) { CheckParsListChanging(); return TGo4FitParsList::Get(n); }
00276
00280 void CheckParsListChanging() { if(fbParsChange) CollectAllPars(); }
00281
00286 virtual Double_t DoCalculation() { return 0; }
00287
00292 virtual Int_t DoNDFCalculation() { return 0; }
00293
00297 Bool_t InitializeDependencies(TObjArray& Dependencies, Bool_t BlockPars, Bool_t DoInit);
00298
00302 void RunDependenciesList(TObjArray& Dependencies, Double_t* pars);
00303
00307 void FinalizeDependencies(TObjArray& Dependencies);
00308
00312 void ExecuteDependencies(Double_t* pars);
00313
00319 virtual Bool_t InitFitterData() { return kTRUE; }
00320
00326 virtual void FinalizeFitterData() { return; }
00327
00331 TObjArray fxActions;
00332
00338 TArrayD fxResults;
00339
00343 TGo4FitterConfig* fxCurrentConfig;
00344
00345
00349 Bool_t fbParsChange;
00350
00351
00355 Bool_t fbInitializationDone;
00356
00357
00361 Bool_t fbNeedToFinalize;
00362
00363 Bool_t fbParsAsResults;
00364
00367
00368
00369 ClassDef(TGo4FitterAbstract,1)
00370 };
00371 #endif // TGO4FITTERABSTRACT_H