Repository navigation
Commands
peter edited this page Aug 25, 2026
·
2 revisions
This page lists the current interactive commands implemented in
libraries/GRoot/GCommands.cxx and libraries/GRoot/GCanvas.cxx.
Most histogram commands are dispatched through the GRootInteract() TExec.
GCanvas adds that exec automatically. A normal ROOT TCanvas can use the
same command path if the exec is added manually:
canvas->AddExec("groot_interact", "GRootInteract()");| Input | Context | Action | Notes |
|---|---|---|---|
| Left click | 1D or 2D histogram | Add a primary marker | Primary markers are generally limited to two. |
| Ctrl + left click | 1D histogram | Add a fit marker | Four fit markers are used for double-Gaussian fitting. This depends on GCanvas event-state tracking. |
| Ctrl + left click | 2D histogram | Add a cut marker | This depends on GCanvas event-state tracking. |
| Left click after starting 2D cut mode | 2D histogram | Add another cut vertex | Once cut markers exist, ordinary clicks continue the cut. |
| Shift + left click | Histogram | Open a clean draw-copy in a new GCanvas
|
Copied helper objects such as markers and fits are removed from the copy. |
| Drag marker | Marker object | Move marker | Handled by GMarker::ExecuteEvent. |
Drag existing TCutG
|
2D histogram cut | Let ROOT edit the cut | Existing cuts are left to ROOT's native interaction. |
These commands operate on the current 1D histogram returned by GrabHist().
| Key | Marker Requirement | Action | Notes |
|---|---|---|---|
b |
None | Show calculated background |
GH1D only. |
B |
None | Toggle background display/removal state |
GH1D only. |
e |
Two primary markers | Expand/zoom X range to the marker interval | Markers are removed after zooming. |
f |
Two primary markers | Run PhotoPeakFit() over the marker interval |
Uses the photopeak fit model. |
g |
Two primary markers | Run GausFit() over the marker interval |
Markers are removed after a successful fit. |
g |
Four fit markers | Run DoubleGausFit()
|
Fit markers are usually created with Ctrl + left click in GCanvas. |
m |
None | Remove markers | Removes all marker types on the histogram. |
n |
None | Clear fits, markers, residual state, sumw2, and shown peak markers | Does not delete the histogram. |
o |
None | Unzoom X axis | Restores the full X range. |
q |
None | Unbin by a factor of two |
GH1D only; preserves the current viewed X range. |
r |
None | Toggle residual display |
GH1D only. This is the current code behavior. |
s |
None | Show searched peaks |
GH1D::ShowPeaks(). |
w |
None | Rebin by a factor of two |
GH1D only; preserves the current viewed X range. |
l or z
|
None | Toggle log Y scale | Uses the current pad. |
These commands apply when the current 1D histogram is a GH1D projection with a
GH2D parent.
| Key | Marker Requirement | Action | Notes |
|---|---|---|---|
c |
Two primary markers | Store the marker interval as a background range | Only valid on a projection from a GH2D. Existing background markers are replaced. |
p |
Two primary markers | Project the parent matrix onto the opposite axis through the marker interval | If two background markers exist, the background projection is subtracted. Current subtraction is unscaled by gate width. |
These commands operate on 2D histograms. Some require the histogram to be a
GH2D; plain ROOT TH2 support is limited to ROOT-native behavior.
| Key | Marker Requirement | Action | Notes |
|---|---|---|---|
c |
At least one primary marker | Convert primary markers into cut markers | Starts polygon cut-vertex mode. |
e |
Two primary markers | Expand/zoom X and Y ranges to the marker box | Markers are removed after zooming. |
g |
Cut markers | Build a TCutG from cut markers |
The cut is named cutN, added to the histogram function list, and markers are removed. |
m |
None | Remove markers | Removes all marker types on the histogram. |
n |
None | Clear fits and markers | Also clears Sumw2. |
o |
None | Unzoom X and Y axes | Restores both axes. |
x |
None | Create and draw a full X projection in a new GCanvas
|
GH2D only. The projection remembers its parent. |
X |
None | Enable ROOT's TH2::SetShowProjectionX(1)
|
Works on any TH2. |
y |
None | Create and draw a full Y projection in a new GCanvas
|
GH2D only. The projection remembers its parent. |
l or z
|
None | Toggle log Z scale | Uses the current pad. |
These commands are handled by GCanvas, not by the GRootInteract() TExec
alone.
| Key | Context | Action | Notes |
|---|---|---|---|
| Space | Multi-pad canvas | Make the selected pad current and update pads | Useful after clicking between subpads. |
| Left arrow | 1D histogram | Slide the viewed X range left by half a window | Shift or locked pads applies the slide to all histograms on the canvas. |
| Right arrow | 1D histogram | Slide the viewed X range right by half a window | Shift or locked pads applies the slide to all histograms on the canvas. |
| Up arrow | 1D projection from GH2D
|
Draw the next projection remembered by the parent GH2D
|
Projection-history navigation. |
| Down arrow | 1D projection from GH2D
|
Draw the previous projection remembered by the parent GH2D
|
Projection-history navigation. |
| Command | Status |
|---|---|
? shortcut help |
Listed in older README text, but no current key binding was found in GCommands.cxx. |
R remove ROIs |
Listed in older README text, but no current key binding was found in GCommands.cxx. |
| ROI creation key |
GROI exists, but no current key binding was found in GCommands.cxx. |
| Graph commands |
GRootInteractGraph* functions currently return without doing meaningful work. |