111 static const Int_t kSliderRes = 10000;
112 static const Int_t kNDrawPts = 500;
114 static const Int_t kBtnRefit = 1000;
115 static const Int_t kBtnAccept = 1001;
116 static const Int_t kBtnCancel = 1002;
117 static const Int_t kBtnReset = 1003;
119 static const Int_t kRangeSlider = 7000;
120 static const Int_t kRangeLoEntry = 7001;
121 static const Int_t kRangeHiEntry = 7002;
123 static const Int_t kSliderStride = 100;
124 static const Int_t kSliderBase = 10000;
125 static const Int_t kEntryBase = 20000;
126 static const Int_t kFixBase = 30000;
127 static const Int_t kLoBoundBase = 40000;
128 static const Int_t kHiBoundBase = 50000;
130 RooSimultaneous *sim_pdf_;
131 RooAbsData *combined_data_;
133 std::vector<SimEditorChannelView> channels_;
134 TString info_label_text_;
136 Double_t range_high_;
137 Double_t original_range_low_;
138 Double_t original_range_high_;
139 Double_t hist_x_min_;
140 Double_t hist_x_max_;
142 TGDoubleHSlider *range_slider_;
143 TGNumberEntry *range_lo_entry_;
144 TGNumberEntry *range_hi_entry_;
146 Bool_t needs_redraw_;
151 TTimer *redraw_timer_;
153 Int_t ChannelIndexFromWidgetId(Int_t base, Int_t parm1, Int_t &local_idx);
156 void BuildChannelTab(TGCompositeFrame *parent, Int_t ch_idx);
157 void BuildPeakSubTab(TGCompositeFrame *parent, Int_t ch_idx, Int_t peak_idx);
158 void BuildBackgroundSubTab(TGCompositeFrame *parent, Int_t ch_idx);
159 void AddParamRow(TGCompositeFrame *parent, Int_t ch_idx, Int_t param_idx,
164 void UpdateCanvases();
169 void SyncAllWidgets();
170 void SyncChannelWidget(Int_t ch_idx, Int_t param_idx);
172 void OnSliderMoved(Int_t ch_idx, Int_t param_idx);
173 void OnEntryChanged(Int_t ch_idx, Int_t param_idx);
174 void OnBoundsChanged(Int_t ch_idx, Int_t param_idx);
175 void OnFixToggled(Int_t ch_idx, Int_t param_idx);
176 void OnRangeChanged();
185 void ApplyBackgroundSlopeBounds();
190 void DiagnoseInvalidComponents();
192 Int_t ValToSlider(Int_t ch_idx, Int_t param_idx, Double_t val);
193 Double_t SliderToVal(Int_t ch_idx, Int_t param_idx, Int_t pos);
194 Bool_t IsFixed(Int_t ch_idx, Int_t param_idx);
195 void GetDefaultBounds(Int_t ch_idx, Int_t param_idx, Double_t &lo,
197 Int_t BkgConstIdx(Int_t ch_idx) {
return channels_[ch_idx].num_peaks * 10; }
198 Int_t BkgSlopeIdx(Int_t ch_idx) {
199 return channels_[ch_idx].num_peaks * 10 + 1;
201 static Int_t PeakStyle(Int_t peak_idx);
220 const TGWindow *parent, RooSimultaneous *sim_pdf,
221 RooAbsData *combined_data, RooRealVar *x,
222 const std::vector<SimEditorChannelView> &channel_views,
223 Double_t range_low, Double_t range_high,
const TString &info_label =
"",
224 Bool_t fit_debug = kFALSE);
235 virtual Bool_t
ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
260 std::vector<SimEditorChannelView> *
GetChannels() {
return &channels_; }
Bool_t LaunchInteractiveSimultaneousFitEditor(RooSimultaneous *sim_pdf, RooAbsData *combined_data, RooRealVar *x, std::vector< SimEditorChannelView > &channel_views, Double_t range_low, Double_t range_high, const TString &info_label, Bool_t fit_debug=kFALSE)
Open the simultaneous editor and pump its event loop.
InteractiveSimultaneousFitEditor(const TGWindow *parent, RooSimultaneous *sim_pdf, RooAbsData *combined_data, RooRealVar *x, const std::vector< SimEditorChannelView > &channel_views, Double_t range_low, Double_t range_high, const TString &info_label="", Bool_t fit_debug=kFALSE)
Build the editor around a converged simultaneous model.