Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
Loading...
Searching...
No Matches
InteractiveRooFitEditor Class Reference

Interactive editor for an unbinned RooFit fit from RooFitUtils. More...

#include <InteractiveRooFitEditor.hpp>

Inheritance diagram for InteractiveRooFitEditor:
Collaboration diagram for InteractiveRooFitEditor:

Public Member Functions

 InteractiveRooFitEditor (const TGWindow *parent, TH1 *hist, const std::vector< Double_t > *events, Float_t display_bin_width_kev, RooAbsPdf *total_pdf, RooRealVar *x, RooAbsData *data, std::vector< RooFitPeakModel > *peaks, RooFitBackgroundModel *bkg, Double_t range_low, Double_t range_high, const TString &info_label="")
 Build the editor around a converged RooFit model.
virtual ~InteractiveRooFitEditor ()
 Destroys the widgets and drawing objects the editor created.
virtual Bool_t ProcessMessage (Long_t msg, Long_t parm1, Long_t parm2)
 ROOT GUI message dispatch for every widget in the editor.
virtual Bool_t HandleTimer (TTimer *timer)
 Redraw tick.
virtual void CloseWindow ()
 Window-manager close. Treated as a cancel, not an accept.
Bool_t WasAccepted () const
 Whether the user accepted rather than cancelled.
Bool_t IsDone () const
 Whether the editor has finished and the loop may exit.
TTimer * GetRedrawTimer ()
 The coalescing redraw timer, for the driving event loop.
TRootEmbeddedCanvas * GetEmbeddedCanvas ()
 The canvas holding the fit and residual pads.

Detailed Description

Interactive editor for an unbinned RooFit fit from RooFitUtils.

The fit and residual pads update live as parameters move. Parameters can be fixed or freed individually, bounds edited, and Refit re-runs the minimiser from the current values as starting points. The residual panel is marked with dashed guide lines at plus and minus three sigma.

Note
Normally reached through the Launch function below rather than constructed directly; the launcher owns the event loop, the batch-mode toggle and the X error-handler guard.
Warning
None of the objects passed in are owned by the editor, and all of them must outlive it. Accepting writes the edited values back into them in place.

Definition at line 44 of file InteractiveRooFitEditor.hpp.

Constructor & Destructor Documentation

◆ InteractiveRooFitEditor()

InteractiveRooFitEditor::InteractiveRooFitEditor ( const TGWindow * parent,
TH1 * hist,
const std::vector< Double_t > * events,
Float_t display_bin_width_kev,
RooAbsPdf * total_pdf,
RooRealVar * x,
RooAbsData * data,
std::vector< RooFitPeakModel > * peaks,
RooFitBackgroundModel * bkg,
Double_t range_low,
Double_t range_high,
const TString & info_label = "" )

Build the editor around a converged RooFit model.

Parameters
parentParent window, normally gClient->GetRoot().
histDisplay histogram. Borrowed.
eventsEvent-level values behind the histogram, so the display can be rebinned as the range changes. Borrowed.
display_bin_width_kevDisplay bin width.
total_pdfSummed model. Borrowed.
xObservable. Borrowed.
dataUnbinned dataset. Borrowed.
peaksPer-peak parameter models, edited in place.
bkgBackground model, edited in place.
range_lowInitial lower fit bound.
range_highInitial upper fit bound.
info_labelOptional annotation shown in the editor.
Note
Moving the range slider rebuilds the display histogram from events, so binning follows the zoom. The fit itself stays unbinned.

Definition at line 12 of file InteractiveRooFitEditor.cpp.

◆ ~InteractiveRooFitEditor()

InteractiveRooFitEditor::~InteractiveRooFitEditor ( )
virtual

Destroys the widgets and drawing objects the editor created.

Definition at line 118 of file InteractiveRooFitEditor.cpp.

Member Function Documentation

◆ CloseWindow()

void InteractiveRooFitEditor::CloseWindow ( )
virtual

Window-manager close. Treated as a cancel, not an accept.

Definition at line 927 of file InteractiveRooFitEditor.cpp.

◆ GetEmbeddedCanvas()

TRootEmbeddedCanvas * InteractiveRooFitEditor::GetEmbeddedCanvas ( )
inline

The canvas holding the fit and residual pads.

Returns
Borrowed pointer; the editor owns it.

Definition at line 219 of file InteractiveRooFitEditor.hpp.

Referenced by LaunchInteractiveRooFitEditor().

◆ GetRedrawTimer()

TTimer * InteractiveRooFitEditor::GetRedrawTimer ( )
inline

The coalescing redraw timer, for the driving event loop.

Returns
Borrowed pointer; the editor owns it.

Definition at line 216 of file InteractiveRooFitEditor.hpp.

Referenced by LaunchInteractiveRooFitEditor().

◆ HandleTimer()

Bool_t InteractiveRooFitEditor::HandleTimer ( TTimer * timer)
virtual

Redraw tick.

Parameter edits set a dirty flag rather than redrawing inline; this coalesces them so dragging a slider does not queue one full redraw per pixel of travel.

Parameters
timerTimer that fired.
Returns
kTRUE once handled.

Definition at line 920 of file InteractiveRooFitEditor.cpp.

◆ IsDone()

Bool_t InteractiveRooFitEditor::IsDone ( ) const
inline

Whether the editor has finished and the loop may exit.

Definition at line 213 of file InteractiveRooFitEditor.hpp.

Referenced by LaunchInteractiveRooFitEditor().

◆ ProcessMessage()

Bool_t InteractiveRooFitEditor::ProcessMessage ( Long_t msg,
Long_t parm1,
Long_t parm2 )
virtual

ROOT GUI message dispatch for every widget in the editor.

Parameters
msgEncoded message type and subtype.
parm1Widget id that raised it.
parm2Message-specific payload.
Returns
kTRUE once handled.

Definition at line 861 of file InteractiveRooFitEditor.cpp.

◆ WasAccepted()

Bool_t InteractiveRooFitEditor::WasAccepted ( ) const
inline

Whether the user accepted rather than cancelled.

Returns
kTRUE if Accept was pressed. Only meaningful once IsDone().

Definition at line 211 of file InteractiveRooFitEditor.hpp.

Referenced by LaunchInteractiveRooFitEditor().


The documentation for this class was generated from the following files: