Logo ROOT   6.16/01
Reference Guide
TFitParametersDialog.h
Go to the documentation of this file.
1// @(#)root/fitpanel:$Id$
2// Author: Ilka Antcheva, Lorenzo Moneta, David Gonzalez Maline 03/10/06
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TFitParametersDialog
13#define ROOT_TFitParametersDialog
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TFitParametersDialog //
18// //
19// This class is used for fit function parameter settings. //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23#include "TGWidget.h"
24#include "TGFrame.h"
25
29};
30
31/// Enumeration specifying if parameters
32/// have been modified by the user
36};
37
38class TF1;
39class TGNumberEntry;
40class TGTextEntry;
41class TGCheckButton;
42class TGTextButton;
43class TGTripleHSlider;
45class TVirtualPad;
46
47
49
50protected:
51 TF1 *fFunc; // function passed to this dialog
52 TVirtualPad *fFpad; // pad where the function is drawn
53 Bool_t fHasChanges; // kTRUE if function was redrawn;
54 Bool_t fImmediateDraw; // kTRUE if function is updated on run-time
55 Int_t *fRetCode; // address to store return code
56 Int_t fNP; // number of function parameters
57 Double_t fRangexmin; // min function range
58 Double_t fRangexmax; // max function range
59 Double_t *fPmin; // min limits of patameters range
60 Double_t *fPmax; // max limits of patameters range
61 Double_t *fPval; // original patameters' values
62 Double_t *fPerr; // original patameters' errors
63 Double_t *fPstp; // original patameters' step
64 TGCompositeFrame *fContNam; // container of parameter names
65 TGCompositeFrame *fContVal; // container of parameter values
66 TGCompositeFrame *fContFix; // container of fix settings
67 TGCompositeFrame *fContBnd; // container of bound settings
68 TGCompositeFrame *fContSld; // container of sliders
69 TGCompositeFrame *fContMin; // container of min range values
70 TGCompositeFrame *fContMax; // container of max range values
71 TGCompositeFrame *fContStp; // container of step values
72 TGCompositeFrame *fContErr; // container of error values
73 TGTextEntry **fParNam; // parameter names
74 TGCheckButton **fParBnd; // bound setting switch
75 TGCheckButton **fParFix; // fix setting switch
76 TGNumberEntry **fParVal; // parameter values
77 TGNumberEntryField **fParMin; // min range values
78 TGNumberEntryField **fParMax; // max range values
79 TGNumberEntry **fParStp; // step values
80 TGTripleHSlider **fParSld; // triple sliders
81 TGNumberEntryField **fParErr; // error values
82 TGCheckButton *fUpdate; // immediate update switch
83 TGTextButton *fApply; // Apply button
84 TGTextButton *fReset; // Reset button
85 TGTextButton *fOK; // OK button
86 TGTextButton *fCancel; // Cancel button
87 TList fTextEntries; // list of text entries used for keyboard navigation
88
89 void DisconnectSlots();
90public:
91 TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func,
92 TVirtualPad *pad, Int_t *ret_code = 0);
93 virtual ~TFitParametersDialog();
94
95 virtual void CloseWindow();
96 virtual void DoApply();
97 virtual void DoCancel();
98 virtual void DoOK();
99 virtual void DoParFix(Bool_t on);
100 virtual void DoParBound(Bool_t on);
101 virtual void DoParMaxLimit();
102 virtual void DoParMinLimit();
103 virtual void DoParStep();
104 virtual void DoParValue();
105 virtual void DoReset();
106 virtual void DoSlider();
107 virtual void DrawFunction();
108 virtual void HandleButtons(Bool_t update);
109 virtual void HandleShiftTab();
110 virtual void HandleTab();
111 virtual Bool_t HasChanges() { return fHasChanges; }
112
113protected:
114 void SetParameters();
115
116 ClassDef(TFitParametersDialog, 0) // Fit function parameters dialog
117};
118
119#endif
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:324
EFPDialogChange
Enumeration specifying if parameters have been modified by the user.
@ kFPDChange
@ kFPDNoChange
EFPDialogBound
@ kFPDBounded
@ kFPDNoneBounded
1-Dim function class
Definition: TF1.h:211
TGCompositeFrame * fContMin
virtual void DoReset()
Slot related to the Reset button.
virtual Bool_t HasChanges()
TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, TVirtualPad *pad, Int_t *ret_code=0)
virtual void DoSlider()
Slot related to the parameters' value settings.
TGNumberEntry ** fParStp
TGCompositeFrame * fContVal
virtual void CloseWindow()
Close parameters' dialog.
virtual void HandleTab()
Handle Tab key event (set focus to the next number entry field)
TGCheckButton ** fParFix
TGCheckButton ** fParBnd
virtual void HandleShiftTab()
Handle Shift+Tab key event (set focus to the previous number entry field)
TGNumberEntryField ** fParErr
virtual ~TFitParametersDialog()
Destructor.
TGCompositeFrame * fContStp
void DisconnectSlots()
Disconnect signals from slot methods.
TGCompositeFrame * fContNam
void SetParameters()
Set the parameter values inside the function.
virtual void DoParStep()
Slot related to parameter step setting.
TGNumberEntry ** fParVal
TGTripleHSlider ** fParSld
TGCompositeFrame * fContErr
TGCompositeFrame * fContBnd
virtual void DoApply()
Slot related to the Preview button.
TGNumberEntryField ** fParMax
virtual void DoCancel()
Slot related to the Cancel button.
virtual void DoParValue()
Slot related to the parameter value settings.
virtual void DoParFix(Bool_t on)
Slot related to the Fix check button.
virtual void HandleButtons(Bool_t update)
Handle the button dependent states in this dialog.
TGNumberEntryField ** fParMin
virtual void DoOK()
Slot related to the OK button.
virtual void DoParBound(Bool_t on)
Slot related to the Bound check button.
TGCompositeFrame * fContFix
virtual void DoParMinLimit()
Slot related to the minumum parameter limit settings.
virtual void DrawFunction()
Redraw function graphics.
TGCompositeFrame * fContMax
virtual void DoParMaxLimit()
Slot related to the maximum parameter limit settings.
TGCompositeFrame * fContSld
A doubly linked list.
Definition: TList.h:44
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
int main(int argc, char **argv)