Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tutorials] Renaming histogram tutorials #17355

Merged
merged 5 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/base/src/TExec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ such as TPad::GetEvent, TPad::GetEventX, TPad::GetEventY to find
which type of event and the X,Y position of the mouse.
By default, the list of TExecs is executed. This can be disabled
via the canvas menu "Option".
See $ROOTSYS/tutorials/hist/exec2.C for an example.
See $ROOTSYS/tutorials/hist/hist058_TExec_th2.C for an example.
~~~ {.cpp}
Root > TFile f("hsimple.root");
Root > hpxpy.Draw();
Root > c1.AddExec("ex2",".x exec2.C");
Root > c1.AddExec("ex2",".x hist058_TExec_th2.C");
~~~
When moving the mouse in the canvas, a second canvas shows the
projection along X of the bin corresponding to the Y position
Expand Down
17 changes: 8 additions & 9 deletions graf2d/gpad/src/TRatioPlot.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Available options are for `option`:
| diffsig | subtracts the histograms and divides by the uncertainty |
Begin_Macro(source)
../../../tutorials/hist/ratioplot1.C
../../../tutorials/hist/hist029_TRatioPlot_simple.C
End_Macro
## Fit residuals
Expand All @@ -73,7 +73,7 @@ the function value as the error.
Begin_Macro(source)
../../../tutorials/hist/ratioplot2.C
../../../tutorials/hist/hist030_TRatioPlot_residual.C
End_Macro
## Error options for difference divided by uncertainty and fit residual
Expand All @@ -82,8 +82,8 @@ options to the `option` argument.
| Option | Description |
| ---------- | ------------------------------------------------------------ |
| errasym | Uses calculated asymmetric errors from `TH1::GetBinErrorUp`/`TH1::GetBinErrorLow`. Note that you need to set `TH1::SetBinErrorOption` first |
| errfunc | Uses \f$ \sqrt{f(x)} \f$ as the error |
| errasym | Uses calculated asymmetric errors from `TH1::GetBinErrorUp`/`TH1::GetBinErrorLow`. Note that you need to
set `TH1::SetBinErrorOption` first | | errfunc | Uses \f$ \sqrt{f(x)} \f$ as the error |
The asymmetric error case uses the upper or lower error depending on the relative size
of the bin contents, or the bin content and the function value.
Expand All @@ -98,7 +98,6 @@ is responsible for the range, which enables you to modify the range.
\image html gpad_ratioplot.png
*/


////////////////////////////////////////////////////////////////////////////////
/// TRatioPlot default constructor

Expand Down Expand Up @@ -522,7 +521,7 @@ void TRatioPlot::SetRightMargin(Float_t margin)
/// \param margin The new margin
///
/// Begin_Macro(source)
/// ../../../tutorials/hist/ratioplot6.C
/// ../../../tutorials/hist/hist034_TRatioPlot_fit_margin.C
/// End_Macro

void TRatioPlot::SetSeparationMargin(Float_t margin)
Expand Down Expand Up @@ -700,7 +699,7 @@ void TRatioPlot::Draw(Option_t *option)
/// graphs are only created then.
///
/// Begin_Macro(source)
/// ../../../tutorials/hist/ratioplot3.C
/// ../../../tutorials/hist/hist031_TRatioPlot_residual_fit.C
/// End_Macro

TGraph *TRatioPlot::GetLowerRefGraph() const
Expand Down Expand Up @@ -1665,7 +1664,7 @@ void TRatioPlot::SetConfidenceLevels(Double_t c1, Double_t c2)
/// \param gridlines Vector of y positions for the dashes lines
///
/// Begin_Macro(source)
/// ../../../tutorials/hist/ratioplot4.C
/// ../../../tutorials/hist/hist032_TRatioPlot_fit_lines.C
/// End_Macro

void TRatioPlot::SetGridlines(std::vector<double> gridlines)
Expand Down Expand Up @@ -1695,7 +1694,7 @@ void TRatioPlot::SetGridlines(Double_t *gridlines, Int_t numGridlines)
/// \param ci2 Color of the 2 sigma band
/// Sets the color of the 1 and 2 sigma bands in the fit residual case.
/// Begin_Macro(source)
/// ../../../tutorials/hist/ratioplot5.C
/// ../../../tutorials/hist/hist033_TRatioPlot_fit_confidence.C
/// End_Macro

void TRatioPlot::SetConfidenceIntervalColors(Color_t ci1, Color_t ci2)
Expand Down
2 changes: 1 addition & 1 deletion graf2d/graf/src/TGaxis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ only with histograms because the labels'definition is stored in `TAxis`.
The following example demonstrates how to create such labels.
Begin_Macro(source)
../../../tutorials/hist/hlabels2.C
../../../tutorials/hist/hist036_TH2_labels.C
End_Macro
Because the alphanumeric labels are usually longer that the numeric labels, their
Expand Down
2 changes: 1 addition & 1 deletion graf2d/graf/src/TLegend.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ The following example illustrate this facility. Only the width and height of the
legend is specified in percentage of the pad size.
Begin_Macro(source)
../../../tutorials/hist/legendautoplaced.C
../../../tutorials/hist/hist011_TH1_legend_autoplaced.C
End_Macro
*/
Expand Down
3 changes: 1 addition & 2 deletions graf2d/graf/src/TPaveStats.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,10 @@ to `gStyle->SetOptFit(111)`
The following example show how to remove and add a line in a statistics box.
Begin_Macro(source)
../../../tutorials/hist/statsEditing.C
../../../tutorials/hist/hist036_TH2_labels.C
End_Macro
*/


const UInt_t kTakeStyle = BIT(17); //see TStyle::SetOptFit/Stat

////////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 3 additions & 4 deletions hist/hist/src/THStack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ End_Macro
A more complex example:
Begin_Macro(source)
../../../tutorials/hist/hstack.C
../../../tutorials/hist/hist023_THStack_simple.C
End_Macro
Note that picking is supported for all drawing modes.
Expand All @@ -117,18 +117,17 @@ Stacks of 2D histograms can also be painted as violin plots, combinations of can
violin plots are possible as well:
Begin_Macro(source)
../../../tutorials/hist/candleplotstack.C
../../../tutorials/hist/hist051_Graphics_candle_plot_stack.C
End_Macro
Automatic coloring according to the current palette is available as shown in the
following example:
Begin_Macro(source)
../../../tutorials/hist/thstackpalettecolor.C
../../../tutorials/hist/hist027_THStack_palette_color.C
End_Macro
*/


////////////////////////////////////////////////////////////////////////////////
/// constructor with name and title

Expand Down
32 changes: 16 additions & 16 deletions hist/histpainter/src/THistPainter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,15 @@ is determined according to the number of objects having palette coloring in
the current pad.

Begin_Macro(source)
../../../tutorials/hist/histpalettecolor.C
../../../tutorials/hist/hist005_TH1_palettecolor.C
End_Macro

Begin_Macro(source)
../../../tutorials/hist/thstackpalettecolor.C
../../../tutorials/hist/hist027_THStack_palette_color.C
End_Macro

Begin_Macro(source)
../../../tutorials/hist/thstack2palettecolor.C
../../../tutorials/hist/hist025_THStack_2d_palette_color.C
End_Macro

\anchor HP06
Expand Down Expand Up @@ -788,7 +788,7 @@ End_Macro
When the option `bar` or `hbar` is specified, a bar chart is drawn. A vertical
bar-chart is drawn with the options `bar`, `bar0`, `bar1`, `bar2`, `bar3`, `bar4`.
An horizontal bar-chart is drawn with the options `hbar`, `hbar0`, `hbar1`,
`hbar2`, `hbar3`, `hbar4` (hbars.C).
`hbar2`, `hbar3`, `hbar4` (hist006_TH1_bar_charts.C).

- The bar is filled with the histogram fill color.
- The left side of the bar is drawn with a light fill color.
Expand All @@ -803,7 +803,7 @@ An horizontal bar-chart is drawn with the options `hbar`, `hbar0`, `hbar1`,
When an histogram has errors the option ["HIST"](\ref OPTHIST) together with the `(h)bar` option.

Begin_Macro(source)
../../../tutorials/hist/hbars.C
../../../tutorials/hist/hist006_TH1_bar_charts.C
End_Macro

To control the bar width (default is the bin width) `TH1::SetBarWidth()`
Expand Down Expand Up @@ -1275,7 +1275,7 @@ X (option `CANDLE` or `CANDLEX`) or Y (option `CANDLEY`).
Each TH1 is represented as one candle.

Begin_Macro(source)
../../../tutorials/hist/candleplotwhiskers.C
../../../tutorials/hist/hist052_Graphics_candle_plot_whiskers.C
End_Macro

The candle reduces the information coming from a whole distribution into few values.
Expand Down Expand Up @@ -1502,7 +1502,7 @@ Also the color, the line width, the size of the points and so on can be changed
standard attribute setting methods such as SetLineColor() SetLineWidth().

Begin_Macro(source)
../../../tutorials/hist/candleplot.C
../../../tutorials/hist/hist049_Graphics_candle_plot.C
End_Macro

\anchor HP140b
Expand Down Expand Up @@ -1600,7 +1600,7 @@ End_Macro
The next example illustrates a time development of a certain value:

Begin_Macro(source)
../../../tutorials/hist/candledecay.C
../../../tutorials/hist/hist047_Graphics_candle_decay.C
End_Macro


Expand Down Expand Up @@ -1856,10 +1856,10 @@ To access the first graph in the list one should do:
TGraph *gr1 = (TGraph*)list->First();


The following example (ContourList.C) shows how to use this functionality.
The following example (hist102_TH2_contour_list.C) shows how to use this functionality.

Begin_Macro(source)
../../../tutorials/hist/ContourList.C
../../../tutorials/hist/hist102_TH2_contour_list.C
End_Macro

\anchor HP16b
Expand Down Expand Up @@ -2363,10 +2363,10 @@ End_Macro

Rectangular bins are a frequent case. The special version of
the `AddBin` method allows to define them more easily like
shown in the following example (th2polyBoxes.C).
shown in the following example (hist037_TH2Poly_boxes.C).

Begin_Macro(source)
../../../tutorials/hist/th2polyBoxes.C
../../../tutorials/hist/hist037_TH2Poly_boxes.C
End_Macro

One `TH2Poly` bin can be a list of polygons. Such bins are defined
Expand Down Expand Up @@ -2721,10 +2721,10 @@ If the option `PADS` is specified, the current pad/canvas is
subdivided into a number of pads equal to the number of histograms and each
histogram is paint into a separate pad.

The following example shows various types of stacks (hstack.C).
The following example shows various types of stacks (hist023_THStack_simple.C).

Begin_Macro(source)
../../../tutorials/hist/hstack.C
../../../tutorials/hist/hist023_THStack_simple.C
End_Macro

The option `nostackb` allows to draw the histograms next to each
Expand Down Expand Up @@ -3051,8 +3051,8 @@ highlight mode is on, mouse movement over the bin will be represented
graphically. Bin will be highlighted as "bin box" (presented by box
object). Moreover, any highlight (change of bin) emits signal
`TCanvas::Highlighted()` which allows the user to react and call their own
function. For a better understanding see also the tutorials
`$ROOTSYS/tutorials/hist/hlHisto*.C` files.
function. For a better understanding see also the tutorial `hist043` to `hist046`
lacated in `$ROOTSYS/tutorials/hist/`.

Highlight mode is switched on/off by `TH1::SetHighlight()` function
or interactively from `TH1` context menu. `TH1::IsHighlight()` to verify
Expand Down
36 changes: 18 additions & 18 deletions tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ set(gui_veto math/fit/fitpanel_playback.C
visualisation/geom/building.C visualisation/geom/cheongwadae.C visualisation/geom/geom*.C visualisation/geom/lego.C visualisation/geom/robot.C visualisation/geom/south_gate.C visualisation/geom/station*.C visualisation/geom/tank.C visualisation/geom/webdemo.C visualisation/geom/web_cms.cxx
visualisation/gl/glViewerExercise.C visualisation/gl/glViewerLOD.C visualisation/gl/gviz3d.C visualisation/gl/nucleus.C visualisation/gl/viewer3DLocal.C visualisation/gl/viewer3DMaster.C
visualisation/gui/*.C
hist/exec1.C
hist/exec2.C
hist/tprofile2polyRealistic.C
hist/tprofile2polyRealisticModuleError.C
hist/hist057_TExec_th1.C
hist/hist058_TExec_th2.C
hist/hist041_TProfile2Poly_realistic.C
hist/hist042_TProfile2Poly_module_error.C
visualisation/image/*.C
visualisation/graphics/psview.C visualisation/graphics/gtime.C
visualisation/graphics/graph_edit_playback.C
Expand Down Expand Up @@ -513,13 +513,13 @@ set(returncode_1 math/fit/fit2a.C
visualisation/graphics/tmathtext.C visualisation/graphics/tmathtext2.C
visualisation/graphs/exclusiongraph.C
visualisation/graphs/graphstruct.C
hist/ContourList.C
hist/hist102_TH2_contour_list.C
hist/hist006_TH1_bar_charts.C
hist/th2polyBoxes.C
hist/statsEditing.C
hist/cumulative.C
hist/hist037_TH2Poly_boxes.C
hist/hist060_TH1_Stats.C
hist/hist014_TH1_cumulative.C
hist/hist004_TH1_labels.C
hist/hlabels2.C
hist/hist036_TH2_labels.C
io/tree/h1analysis.C
math/chi2test.C
math/r/SimpleFitting.C)
Expand All @@ -534,17 +534,17 @@ set(io-xml-xmlmodifyfile-depends tutorial-io-xml-xmlnewfile)
set(io-xml-xmlreadfile-depends tutorial-io-xml-xmlnewfile)
set(roofit-rf503_wspaceread-depends tutorial-roofit-rf502_wspacewrite)
set(io-readCode-depends tutorial-io-importCode)
set(math-fit-fit1-depends tutorial-hist-fillrandom)
set(math-fit-fit1-depends tutorial-hist-hist001_TH1_fillrandom)
set(math-fit-myfit-depends tutorial-math-fit-fitslicesy)
set(math-foam-foam_demopers-depends tutorial-math-foam-foam_demo)
set(io-tree-tree502_staff-depends tutorial-io-tree-tree500_cernbuild)
set(io-tree-tree501_cernstaff-depends tutorial-io-tree-tree500_cernbuild)
set(hist-hbars-depends tutorial-io-tree-tree500_cernbuild)
set(hist-hist006_TH1_bar_charts-depends tutorial-io-tree-tree500_cernbuild)
set(benchmarks-depends tutorial-hsimple
tutorial-math-fit-fit1
tutorial-math-fit-myfit
tutorial-hist-h1ReadAndDraw
tutorial-hist-FirstContour
tutorial-hist-hist015_TH1_read_and_draw
tutorial-hist-hist056_TPolyMarker_contour
tutorial-visualisation-geom-na49view
tutorial-io-tree-tree120_ntuple.C
tutorial-io-tree-spider
Expand Down Expand Up @@ -842,14 +842,14 @@ if(ROOT_pyroot_FOUND)
message(STATUS "${nAfterVeto}/${nTotal} python tutorials have been activated.")

#---Python tutorials dependencies--------------------------------------
set(tree-ntuple1-depends tutorial-hsimple-py)
set(hist-h1ReadAndDraw-depends tutorial-hsimple-py)
set(io-tree-ntuple1-depends tutorial-hsimple-py)
set(hist-hist015_TH1_read_and_draw-depends tutorial-hsimple-py)
set(pyroot-benchmarks-depends tutorial-hsimple-py
tutorial-math-fit-fit1-py
tutorial-visualisation-geom-na49view-py
tutorial-hist-h1ReadAndDraw-py
tutorial-tree-ntuple1-py)
set(math-fit-fit1-depends tutorial-hist-fillrandom-py)
tutorial-hist-hist015_TH1_read_and_draw-py
tutorial-io-tree-ntuple1-py)
set(math-fit-fit1-depends tutorial-hist-hist001_TH1_fillrandom-py)
set(visualisation-geom-na49view-depends tutorial-visualisation-geom-geometry-py)
set(roofit-rf503_wspaceread-depends tutorial-roofit-rf502_wspacewrite-py)
set(roofit-rf618_mixture_models-depends tutorial-analysis-dataframe-df106_HiggsToFourLeptons-py)
Expand Down
Loading
Loading