00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4FitGUIOptions.h"
00017
00018 TGo4FitGUIOptions::TGo4FitGUIOptions() : TObject(),
00019 fxFitter(0),
00020 fxWizDataName(), fxWizModelName(), fbWizShowAllModels(kTRUE), fiWizPageIndex(0),
00021 fbUseAmplEstim(kFALSE), fiNumMigradIter(0) {
00022 }
00023
00024 TGo4FitGUIOptions::~TGo4FitGUIOptions() {
00025 if (fxFitter) delete fxFitter;
00026 }
00027
00028 void TGo4FitGUIOptions::SetFitter(TGo4Fitter*f) {
00029 if (fxFitter) delete fxFitter;
00030 fxFitter = f;
00031 }
00032
00033 TGo4Fitter* TGo4FitGUIOptions::TakeFitter() {
00034 TGo4Fitter* f = fxFitter;
00035 fxFitter = 0;
00036 return f;
00037 }
00038
00039 TGo4FitData* TGo4FitGUIOptions::GetWizData() {
00040 TGo4Fitter* fitter = GetFitter();
00041 if (fitter) return fitter->FindData(GetWizDataName());
00042 return 0;
00043 }
00044
00045 TGo4FitModel* TGo4FitGUIOptions::GetWizModel() {
00046 TGo4Fitter* fitter = GetFitter();
00047 if (fitter) return fitter->FindModel(GetWizModelName());
00048 return 0;
00049 }
00050
00051 TGo4FitPeakFinder* TGo4FitGUIOptions::GetPeakFinder(Bool_t AutoCreate) {
00052 TGo4Fitter* fitter = GetFitter();
00053 if (fitter==0) return 0;
00054 for (Int_t n=0;n<fitter->GetNumActions();n++) {
00055 TGo4FitPeakFinder* finder = dynamic_cast<TGo4FitPeakFinder*> (fitter->GetAction(n));
00056 if (finder) return finder;
00057 }
00058
00059 if (AutoCreate) {
00060 TGo4FitPeakFinder* finder = new TGo4FitPeakFinder("Finder", 0, kTRUE, 1);
00061 finder->SetPeakFinderType(2);
00062 fitter->AddActionAt(finder, 0);
00063 return finder;
00064 }
00065
00066 return 0;
00067 }
00068
00069 void TGo4FitGUIOptions::CopyFrom(TGo4FitGUIOptions& other, Bool_t CopyFitter) {
00070 if(fxFitter) delete fxFitter;
00071 fxFitter = 0;
00072 if (CopyFitter && (other.fxFitter!=0)) fxFitter = (TGo4Fitter*) other.fxFitter->Clone();
00073
00074 fxWizDataName = other.fxWizDataName;
00075 fxWizModelName = other.fxWizModelName;
00076 fbWizShowAllModels = other.fbWizShowAllModels;
00077 fiWizPageIndex = other.fiWizPageIndex;
00078
00079 fbUseAmplEstim = other.fbUseAmplEstim;
00080 fiNumMigradIter = other.fiNumMigradIter;
00081 }
00082
00083