#ifndef ROOT_TFitEditor
#define ROOT_TFitEditor
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TGButton
#include "TGButton.h"
#endif
#include "Foption.h"
#include "Math/MinimizerOptions.h"
#include "Fit/DataRange.h"
#include <vector>
enum EObjectType {
kObjectHisto,
kObjectGraph,
kObjectGraph2D,
kObjectHStack,
kObjectTree,
kObjectMultiGraph
};
class TGTab;
class TVirtualPad;
class TCanvas;
class TGLabel;
class TGComboBox;
class TGTextEntry;
class TGNumberEntry;
class TGDoubleHSlider;
class TGNumberEntry;
class TGNumberEntryField;
class TGStatusBar;
class TAxis;
class TF1;
class TFitEditor : public TGMainFrame {
protected:
TGTab *fTab;
TGCompositeFrame *fTabContainer;
TGCompositeFrame *fGeneral;
TGCompositeFrame *fMinimization;
TGTextButton *fFitButton;
TGTextButton *fResetButton;
TGTextButton *fCloseButton;
TGLabel *fSelLabel;
TGComboBox *fDataSet;
TGComboBox *fTypeFit;
TGComboBox *fFuncList;
TGTextEntry *fEnteredFunc;
TGTextButton *fUserButton;
TGRadioButton *fNone;
TGRadioButton *fAdd;
TGRadioButton *fConv;
TGLayoutHints *fLayoutNone;
TGLayoutHints *fLayoutAdd;
TGLayoutHints *fLayoutConv;
TGTextButton *fSetParam;
TGCheckButton *fIntegral;
TGCheckButton *fBestErrors;
TGCheckButton *fUseRange;
TGCheckButton *fAdd2FuncList;
TGCheckButton *fUseGradient ;
TGCheckButton *fAllWeights1;
TGCheckButton *fImproveResults;
TGCheckButton *fEmptyBinsWghts1;
TGComboBox *fMethodList;
TGCheckButton *fLinearFit;
TGCheckButton *fNoChi2;
TGCheckButton *fNoStoreDrawing;
TGCheckButton *fNoDrawing;
TGCheckButton *fDrawSame;
TGTextButton *fDrawAdvanced;
TGDoubleHSlider *fSliderX;
TGNumberEntry *fSliderXMax;
TGNumberEntry *fSliderXMin;
TGDoubleHSlider *fSliderY;
TGNumberEntry *fSliderYMax;
TGNumberEntry *fSliderYMin;
TGDoubleHSlider *fSliderZ;
TGHorizontalFrame *fSliderXParent;
TGHorizontalFrame *fSliderYParent;
TGHorizontalFrame *fSliderZParent;
TGNumberEntry *fRobustValue;
TGRadioButton *fOptDefault;
TGRadioButton *fOptVerbose;
TGRadioButton *fOptQuiet;
TVirtualPad *fParentPad;
TObject *fFitObject;
EObjectType fType;
Int_t fDim;
TAxis *fXaxis;
TAxis *fYaxis;
TAxis *fZaxis;
struct FuncParamData_t {
FuncParamData_t() {
fP[0] = 0; fP[1] = 0; fP[2] = 0;
}
Double_t & operator[](UInt_t i) { return fP[i];}
Double_t fP[3];
};
std::vector<FuncParamData_t > fFuncPars;
Double_t fFuncXmin;
Double_t fFuncXmax;
Double_t fFuncYmin;
Double_t fFuncYmax;
Double_t fFuncZmin;
Double_t fFuncZmax;
TGRadioButton *fLibMinuit;
TGRadioButton *fLibMinuit2;
TGRadioButton *fLibFumili;
TGRadioButton *fMigrad;
TGRadioButton *fSimplex;
TGRadioButton *fFumili;
TGRadioButton *fCombination;
TGRadioButton *fScan;
TGNumberEntryField *fErrorScale;
TGNumberEntryField *fTolerance;
TGNumberEntryField *fIterations;
TGStatusBar *fStatusBar;
static TFitEditor *fgFitDialog;
TGComboBox* BuildDataSetList(TGFrame *parent, Int_t id);
TGComboBox* BuildMethodList(TGFrame *parent, Int_t id);
void GetRanges(ROOT::Fit::DataRange&);
TF1* GetFitFunction();
TList* GetFitObjectListOfFunctions();
void DrawSelection(bool restore = false);
Int_t CheckFunctionString(const char* str);
void CreateFunctionGroup();
void CreateGeneralTab();
void CreateMinimizationTab();
void MakeTitle(TGCompositeFrame *parent, const char *title);
TF1* HasFitFunction();
void SetEditable(Bool_t);
private:
TFitEditor(const TFitEditor&);
TFitEditor& operator=(const TFitEditor&);
void RetrieveOptions(Foption_t&, TString&, ROOT::Math::MinimizerOptions&, Int_t);
public:
TFitEditor(TVirtualPad* pad, TObject *obj);
virtual ~TFitEditor();
static TFitEditor *GetInstance(TVirtualPad* pad, TObject *obj);
virtual Option_t *GetDrawOption() const;
virtual void Hide();
virtual void Show(TVirtualPad* pad, TObject *obj);
void ShowObjectName(TObject* obj);
Bool_t SetObjectType(TObject* obj);
virtual void Terminate();
void UpdateGUI();
virtual void CloseWindow();
virtual void ConnectSlots();
virtual void DisconnectSlots();
virtual void RecursiveRemove(TObject* obj);
protected:
virtual void SetCanvas(TCanvas *c);
public:
virtual void SetFitObject(TVirtualPad *pad, TObject *obj, Int_t event);
virtual void SetFunction(const char *function);
void FillFunctionList(Int_t selected = -1);
virtual void DoAddition(Bool_t on);
virtual void DoAdvancedOptions();
virtual void DoAllWeights1();
virtual void DoClose();
virtual void DoEmptyBinsAllWeights1();
virtual void DoEnteredFunction();
virtual void DoFit();
virtual void DoMaxIterations();
virtual void DoDataSet(Int_t sel);
virtual void DoFunction(Int_t sel);
virtual void DoLinearFit();
virtual void DoNoChi2();
virtual void DoNoSelection();
virtual void DoNoStoreDrawing();
virtual void DoReset();
virtual void DoSetParameters();
virtual void DoSliderXMoved();
virtual void DoNumericSliderXChanged();
virtual void DoSliderYMoved();
virtual void DoNumericSliderYChanged();
virtual void DoSliderZMoved();
virtual void DoUserDialog();
virtual void DoUseFuncRange();
virtual void DoLibrary(Bool_t on);
virtual void DoMinMethod(Bool_t on);
virtual void DoPrintOpt(Bool_t on);
public:
typedef std::vector<FuncParamData_t > FuncParams_t;
ClassDef(TFitEditor,0)
};
#endif
Last change: Tue Dec 16 12:24:12 2008
Last generated: 2008-12-16 12:24
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.