Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TFitParametersDialog.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/fitpanel:$Id$
0002 // Author: Ilka Antcheva, Lorenzo Moneta, David Gonzalez Maline 03/10/06
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TFitParametersDialog
0013 #define ROOT_TFitParametersDialog
0014 
0015 
0016 #include "TGWidget.h"
0017 #include "TGFrame.h"
0018 
0019 enum EFPDialogBound {
0020    kFPDBounded,
0021    kFPDNoneBounded
0022 };
0023 
0024 /// Enumeration specifying if parameters
0025 /// have been modified by the user
0026 enum EFPDialogChange {
0027    kFPDNoChange,
0028    kFPDChange
0029 };
0030 
0031 class TF1;
0032 class TGNumberEntry;
0033 class TGTextEntry;
0034 class TGCheckButton;
0035 class TGTextButton;
0036 class TGTripleHSlider;
0037 class TGNumberEntryField;
0038 class TVirtualPad;
0039 
0040 
0041 class TFitParametersDialog : public TGTransientFrame {
0042 
0043 protected:
0044    TF1                 *fFunc;            ///< function passed to this dialog
0045    TVirtualPad         *fFpad;            ///< pad where the function is drawn
0046    Bool_t               fHasChanges;      ///< kTRUE if function was redrawn;
0047    Bool_t               fImmediateDraw;   ///< kTRUE if function is updated on run-time
0048    Int_t               *fRetCode;         ///< address to store return code
0049    Int_t                fNP;              ///< number of function parameters
0050    Double_t             fRangexmin;       ///< min function range
0051    Double_t             fRangexmax;       ///< max function range
0052    Double_t            *fPmin;            ///< min limits of patameters range
0053    Double_t            *fPmax;            ///< max limits of patameters range
0054    Double_t            *fPval;            ///< original patameters' values
0055    Double_t            *fPerr;            ///< original patameters' errors
0056    Double_t            *fPstp;            ///< original patameters' step
0057    TGCompositeFrame    *fContNam;         ///< container of parameter names
0058    TGCompositeFrame    *fContVal;         ///< container of parameter values
0059    TGCompositeFrame    *fContFix;         ///< container of fix settings
0060    TGCompositeFrame    *fContBnd;         ///< container of bound settings
0061    TGCompositeFrame    *fContSld;         ///< container of sliders
0062    TGCompositeFrame    *fContMin;         ///< container of min range values
0063    TGCompositeFrame    *fContMax;         ///< container of max range values
0064    TGCompositeFrame    *fContStp;         ///< container of step values
0065    TGCompositeFrame    *fContErr;         ///< container of error values
0066    TGTextEntry         **fParNam;         ///< parameter names
0067    TGCheckButton       **fParBnd;         ///< bound setting switch
0068    TGCheckButton       **fParFix;         ///< fix setting switch
0069    TGNumberEntry       **fParVal;         ///< parameter values
0070    TGNumberEntryField  **fParMin;         ///< min range values
0071    TGNumberEntryField  **fParMax;         ///< max range values
0072    TGNumberEntry       **fParStp;         ///< step values
0073    TGTripleHSlider     **fParSld;         ///< triple sliders
0074    TGNumberEntryField  **fParErr;         ///< error values
0075    TGCheckButton       *fUpdate;          ///< immediate update switch
0076    TGTextButton        *fApply;           ///< Apply button
0077    TGTextButton        *fReset;           ///< Reset button
0078    TGTextButton        *fOK;              ///< OK button
0079    TGTextButton        *fCancel;          ///< Cancel button
0080    TList                fTextEntries;     ///< list of text entries used for keyboard navigation
0081 
0082    void  DisconnectSlots();
0083 public:
0084    TFitParametersDialog(const TGWindow *p, const TGWindow *main, TF1 *func,
0085                         TVirtualPad *pad, Int_t *ret_code = nullptr);
0086    ~TFitParametersDialog() override;
0087 
0088    void  CloseWindow() override;
0089    virtual void  DoApply();
0090    virtual void  DoCancel();
0091    virtual void  DoOK();
0092    virtual void  DoParFix(Bool_t on);
0093    virtual void  DoParBound(Bool_t on);
0094    virtual void  DoParMaxLimit();
0095    virtual void  DoParMinLimit();
0096    virtual void  DoParStep();
0097    virtual void  DoParValue();
0098    virtual void  DoReset();
0099    virtual void  DoSlider();
0100    virtual void  DrawFunction();
0101    virtual void  HandleButtons(Bool_t update);
0102    virtual void  HandleShiftTab();
0103    virtual void  HandleTab();
0104    virtual Bool_t HasChanges() { return fHasChanges; }
0105 
0106 protected:
0107    void SetParameters();
0108 
0109    ClassDefOverride(TFitParametersDialog, 0)  // Fit function parameters dialog
0110 };
0111 
0112 #endif