144 fParFix[i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
this,
"DoParFix(Bool_t)");
157 fParBnd[i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
this,
"DoParBound(Bool_t)");
175 (
fParVal[i]->GetNumberEntry())->SetToolTipText(
Form(
"%s",
fFunc->GetParName(i)));
176 (
fParVal[i]->GetNumberEntry())->Connect(
"ReturnPressed()",
"TFitParametersDialog",
177 this,
"DoParValue()");
178 fParVal[i]->Connect(
"ValueSet(Long_t)",
"TFitParametersDialog",
this,
"DoParValue()");
179 (
fParVal[i]->GetNumberEntry())->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
180 (
fParVal[i]->GetNumberEntry())->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
194 fFunc->GetParName(i)));
197 fParMin[i]->Connect(
"ReturnPressed()",
"TFitParametersDialog",
this,
199 fParMin[i]->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
200 fParMin[i]->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
227 fFunc->GetParName(i)));
230 fParMax[i]->Connect(
"ReturnPressed()",
"TFitParametersDialog",
this,
"DoParMaxLimit()");
231 fParMax[i]->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
232 fParMax[i]->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
247 (
fParStp[i]->GetNumberEntry())->SetToolTipText(
Form(
"%s",
fFunc->GetParName(i)));
248 (
fParStp[i]->GetNumberEntry())->Connect(
"ReturnPressed()",
"TFitParametersDialog",
249 this,
"DoParStep()");
250 fParStp[i]->Connect(
"ValueSet(Long_t)",
"TFitParametersDialog",
this,
"DoParStep()");
251 (
fParStp[i]->GetNumberEntry())->Connect(
"TabPressed()",
"TFitParametersDialog",
this,
"HandleTab()");
252 (
fParStp[i]->GetNumberEntry())->Connect(
"ShiftTabPressed()",
"TFitParametersDialog",
this,
"HandleShiftTab()");
266 fFunc->GetParName(i)));
280 fUpdate->SetToolTipText(
"Immediate function redrawing");
283 fUpdate->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
this,
"HandleButtons(Bool_t)");
290 fReset->SetToolTipText(
"Reset the parameter settings");
292 fReset->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoReset()");
297 fApply->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoApply()");
298 fApply->SetToolTipText(
"Apply parameter settings and redraw the function");
302 fOK->SetToolTipText(
"Apply parameter settings, redraw function and close this dialog");
303 fOK->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoOK()");
307 fCancel->SetToolTipText(
"Close this dialog with no parameter changes");
308 fCancel->Connect(
"Clicked()",
"TFitParametersDialog",
this,
"DoCancel()");
342 fParSld[i]->Connect(
"PointerPositionChanged()",
"TFitParametersDialog",
344 fParSld[i]->Connect(
"PositionChanged()",
"TFitParametersDialog",
385 txt =
"Do you want to apply last parameters' setting?";
431 txt =
"'Min' value cannot be bigger or equal to 'Max' - set the limits first!";
442 fFunc->SetParameter(i,
v);
453 fFunc->ReleaseParameter(i);
499 fParBnd[i]->Disconnect(
"Toggled(Bool_t)");
501 fParBnd[i]->SetToolTipText(
Form(
"DISABLED - %s is fixed",
fFunc->GetParName(i)));
502 if (
fParVal[i]->GetNumber() != 0) {
515 fParSld[i]->Disconnect(
"PointerPositionChanged()");
516 fParSld[i]->Disconnect(
"PositionChanged()");
519 }
else if (!
fParMin[i]->IsEnabled()) {
537 }
else if (
fPval[i]) {
546 temp =
fParMax[i]->GetNumber();
551 fParBnd[i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
552 this,
"DoParBound(Bool_t)");
562 fParSld[i]->Connect(
"PointerPositionChanged()",
"TFitParametersDialog",
564 fParSld[i]->Connect(
"PositionChanged()",
"TFitParametersDialog",
584 fParVal[i]->GetNumberEntry()->ReturnPressed();
595 fFunc->ReleaseParameter(i);
674 temp =
fParMax[i]->GetNumber();
683 fParSld[i]->Disconnect(
"PointerPositionChanged()");
684 fParSld[i]->Disconnect(
"PositionChanged()");
686 fParBnd[i]->Disconnect(
"Toggled(Bool_t)");
692 if (!
fParMax[i]->IsEnabled()) {
701 fParSld[i]->Connect(
"PointerPositionChanged()",
"TFitParametersDialog",
703 fParSld[i]->Connect(
"PositionChanged()",
"TFitParametersDialog",
706 fParBnd[i]->Connect(
"Toggled(Bool_t)",
"TFitParametersDialog",
707 this,
"DoParBound(Bool_t)");
737 fFunc->SetParameter(i,
fParSld[i]->GetPointerPosition());
783 fFunc->SetParameter(i,
fParSld[i]->GetPointerPosition());
788 fFunc->ReleaseParameter(i);
814 txt =
"'Min' cannot be bigger then 'Max' if this parameter is bounded.";
857 txt =
"'Min' cannot be bigger then 'Max' if this parameter is bounded.";
891 if ( !
fFpad )
return;
895 fFunc->SetLineStyle(2);
907 fFunc->SetLineStyle(st);
929 fParFix[i]->Disconnect(
"Toggled(Bool_t)");
930 fParBnd[i]->Disconnect(
"Toggled(Bool_t)");
931 fParVal[i]->Disconnect(
"ValueSet(Long_t)");
932 fParMin[i]->Disconnect(
"ReturnPressed()");
933 fParMax[i]->Disconnect(
"ReturnPressed()");
934 fParSld[i]->Disconnect(
"PointerPositionChanged()");
935 fParSld[i]->Disconnect(
"PositionChanged()");
936 fParStp[i]->Disconnect(
"ValueSet(Long_t)");
937 fParVal[i]->Disconnect(
"TabPressed(Long_t)");
938 fParVal[i]->Disconnect(
"ShiftTabPressed(Long_t)");
939 fParMin[i]->Disconnect(
"TabPressed(Long_t)");
940 fParMin[i]->Disconnect(
"ShiftTabPressed(Long_t)");
941 fParMax[i]->Disconnect(
"TabPressed(Long_t)");
942 fParMax[i]->Disconnect(
"ShiftTabPressed(Long_t)");
943 fParStp[i]->Disconnect(
"TabPressed(Long_t)");
944 fParStp[i]->Disconnect(
"ShiftTabPressed(Long_t)");
946 fUpdate->Disconnect(
"Toggled(Bool_t)");
947 fReset->Disconnect(
"Clicked()");
948 fApply->Disconnect(
"Clicked()");
949 fOK->Disconnect(
"Clicked()");
950 fCancel->Disconnect(
"Clicked()");
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
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Style_t
Style number (short).
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Int_t fNP
number of function parameters
TGCompositeFrame * fContMin
container of min range values
virtual void DoReset()
Slot related to the Reset button.
Double_t * fPval
original patameters' values
TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func, TVirtualPad *pad, Int_t *ret_code=nullptr)
Bool_t fHasChanges
kTRUE if function was redrawn;
Double_t * fPmin
min limits of patameters range
virtual void DoSlider()
Slot related to the parameters' value settings.
TGNumberEntry ** fParStp
step values
TGCompositeFrame * fContVal
container of parameter values
TF1 * fFunc
function passed to this dialog
Double_t fRangexmin
min function range
TGTextButton * fApply
Apply button.
virtual void HandleTab()
Handle Tab key event (set focus to the next number entry field).
TGCheckButton ** fParFix
fix setting switch
TGCheckButton ** fParBnd
bound setting switch
virtual void HandleShiftTab()
Handle Shift+Tab key event (set focus to the previous number entry field).
TGNumberEntryField ** fParErr
error values
TGCompositeFrame * fContStp
container of step values
void DisconnectSlots()
Disconnect signals from slot methods.
TGCompositeFrame * fContNam
container of parameter names
Int_t * fRetCode
address to store return code
Double_t * fPmax
max limits of patameters range
void SetParameters()
Set the parameter values inside the function.
virtual void DoParStep()
Slot related to parameter step setting.
TGTextButton * fCancel
Cancel button.
TGNumberEntry ** fParVal
parameter values
TGTripleHSlider ** fParSld
triple sliders
Bool_t fImmediateDraw
kTRUE if function is updated on run-time
TGCompositeFrame * fContErr
container of error values
TGCompositeFrame * fContBnd
container of bound settings
virtual void DoApply()
Slot related to the Preview button.
TGNumberEntryField ** fParMax
max range values
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.
TList fTextEntries
list of text entries used for keyboard navigation
virtual void HandleButtons(Bool_t update)
Handle the button dependent states in this dialog.
TGCheckButton * fUpdate
immediate update switch
void CloseWindow() override
Close parameters' dialog.
Double_t * fPstp
original patameters' step
Double_t fRangexmax
max function range
Double_t * fPerr
original patameters' errors
TGNumberEntryField ** fParMin
min range values
virtual void DoOK()
Slot related to the OK button.
virtual void DoParBound(Bool_t on)
Slot related to the Bound check button.
TGCompositeFrame * fContFix
container of fix settings
~TFitParametersDialog() override
Destructor.
virtual void DoParMinLimit()
Slot related to the minumum parameter limit settings.
TVirtualPad * fFpad
pad where the function is drawn
virtual void DrawFunction()
Redraw function graphics.
TGCompositeFrame * fContMax
container of max range values
virtual void DoParMaxLimit()
Slot related to the maximum parameter limit settings.
TGTextButton * fReset
Reset button.
TGTextEntry ** fParNam
parameter names
TGCompositeFrame * fContSld
container of sliders
TGTextButton * fOK
OK button.
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Int_t GetState(TGFrame *f) const
Get state of sub frame.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
TGCompositeFrame(const TGCompositeFrame &)=delete
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void MapWindow() override
map window
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void DeleteWindow()
Delete window.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
TGNumberEntry is a number entry input widget with up/down buttons.
TGClient * fClient
Connection to display server.
A text buffer is used in several widgets, like TGTextEntry, TGFileDialog, etc.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
virtual void SetFocus()
Set focus to this text entry.
void Home(Bool_t mark=kFALSE)
Moves the text cursor to the left end of the line.
TGTransientFrame(const TGTransientFrame &)=delete
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
ROOT GUI Window base class.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
Mother of all ROOT objects.
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
small helper class to store/restore gPad context in TPad methods
TVirtualPad is an abstract base class for the Pad and Canvas classes.
int main(int argc, char **argv)
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.