41 static const Int_t kSliderRes = 10000;
42 static const Int_t kNDrawPts = 500;
44 static const Int_t kBtnRefit = 1000;
45 static const Int_t kBtnAccept = 1001;
46 static const Int_t kBtnCancel = 1002;
47 static const Int_t kBtnReset = 1003;
48 static const Int_t kSliderBase = 2000;
49 static const Int_t kEntryBase = 3000;
50 static const Int_t kFixBase = 4000;
51 static const Int_t kLoBoundBase = 5000;
52 static const Int_t kHiBoundBase = 6000;
53 static const Int_t kRangeSlider = 7000;
54 static const Int_t kRangeLoEntry = 7001;
55 static const Int_t kRangeHiEntry = 7002;
59 TString info_label_text_;
62 Double_t original_range_low_;
63 Double_t original_range_high_;
69 Double_t *original_params_;
70 Double_t *original_bounds_low_;
71 Double_t *original_bounds_high_;
72 Bool_t *original_fixed_;
74 Double_t *current_bounds_low_;
75 Double_t *current_bounds_high_;
77 TRootEmbeddedCanvas *embedded_canvas_;
82 TGNumberEntry **value_entries_;
83 TGCheckButton **fix_checks_;
84 TGNumberEntry **lo_bound_entries_;
85 TGNumberEntry **hi_bound_entries_;
87 TGDoubleHSlider *range_slider_;
88 TGNumberEntry *range_lo_entry_;
89 TGNumberEntry *range_hi_entry_;
92 TGraph *comp_graphs_[3][4];
101 Bool_t needs_redraw_;
105 TTimer *redraw_timer_;
108 void BuildPeakTab(TGCompositeFrame *parent, Int_t peak_idx);
109 void BuildBackgroundTab(TGCompositeFrame *parent);
110 void AddParamRow(TGCompositeFrame *parent, Int_t param_idx,
const char *name);
114 void UpdateCompPoints();
115 void UpdateResPoints();
117 void SyncAllWidgets();
118 void SyncWidget(Int_t param_idx);
120 void OnSliderMoved(Int_t param_idx);
121 void OnEntryChanged(Int_t param_idx);
122 void OnBoundsChanged(Int_t param_idx);
123 void OnFixToggled(Int_t param_idx);
124 void OnRangeChanged();
131 Int_t ValToSlider(Int_t param_idx, Double_t val);
132 Double_t SliderToVal(Int_t param_idx, Int_t pos);
133 Bool_t IsFixed(Int_t param_idx);
134 void GetDefaultBounds(Int_t param_idx, Double_t &lo, Double_t &hi);
135 Int_t BkgConstIdx() {
return num_peaks_ * 10; }
136 Int_t BkgSlopeIdx() {
return num_peaks_ * 10 + 1; }
137 static Int_t PeakStyle(Int_t peak_idx);
151 Double_t range_low, Double_t range_high, Int_t num_peaks,
152 const TString &info_label =
"");
163 virtual Bool_t
ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
Bool_t LaunchInteractiveFitEditor(TH1 *hist, TF1 *fit_func, Double_t range_low, Double_t range_high, Int_t num_peaks, const TString &info_label)
Open the editor and pump its event loop until the user is done.
InteractiveFitEditor(const TGWindow *parent, TH1 *hist, TF1 *fit_func, Double_t range_low, Double_t range_high, Int_t num_peaks, const TString &info_label="")
Build the editor around an existing histogram and fit function.