Skip to content

Commit 3dbc5f7

Browse files
authored
[tutorials] Re-organize math tutorials (#17029)
* [tutorial] Add `Get started` list * [tutorial] Re-organize math tutorials
1 parent ae4b0b7 commit 3dbc5f7

File tree

109 files changed

+127
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+127
-98
lines changed

Diff for: math/mathcore/inc/Math/PdfFuncMathCore.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ namespace Math {
386386

387387
/**
388388
389-
Probability density function of the normal (Gaussian) distribution.
389+
Probability density function of the normal (Gaussian) distribution with mean x0 and standard deviation sigma.
390390
391-
\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-x^2 / 2\sigma^2} \f]
391+
\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-(x-x_0)^2 / 2\sigma^2} \f]
392392
393393
For detailed description see
394394
<A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
@@ -493,9 +493,9 @@ namespace Math {
493493

494494
/**
495495
496-
Probability density function of the normal (Gaussian) distribution.
496+
Probability density function of the normal (Gaussian) distribution with mean x0 and standard deviation sigma.
497497
498-
\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-x^2 / 2\sigma^2} \f]
498+
\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-(x-x_0)^2 / 2\sigma^2} \f]
499499
500500
For detailed description see
501501
<A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
@@ -552,7 +552,7 @@ namespace Math {
552552
553553
\f[ p_{r}(x) = \frac{\Gamma(\frac{r+1}{2})}{\sqrt{r \pi}\Gamma(\frac{r}{2})} \left( 1+\frac{x^2}{r}\right)^{-(r+1)/2} \f]
554554
555-
for \f$k \geq 0\f$. For detailed description see
555+
for \f$r \geq 0\f$. For detailed description see
556556
<A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
557557
Mathworld</A>.
558558

Diff for: math/mathcore/src/TMath.cxx

+4-5
Original file line numberDiff line numberDiff line change
@@ -2593,11 +2593,10 @@ Bool_t TMath::Permute(Int_t n, Int_t *a)
25932593

25942594
////////////////////////////////////////////////////////////////////////////////
25952595
/// Computes density function for Student's t- distribution
2596-
/// (the probability function (integral of density) is computed in StudentI).
2597-
///
2598-
/// First parameter stands for x - the actual variable of the
2599-
/// density function p(x) and the point at which the density is calculated.
2600-
/// Second parameter stands for number of degrees of freedom.
2596+
/// \f[ p_{n}(x) = \frac{\Gamma(\frac{n+1}{2})}{\sqrt{n \pi}\Gamma(\frac{n}{2})} \left( 1+\frac{x^2}{n}\right)^{-(n+1)/2} \f]
2597+
/// for \f$n \geq 0\f$, at point x for n (ndf) degrees of freedom.
2598+
/// This is equivalent to ROOT::Math::tdistribution_pdf(x,ndf)
2599+
/// The probability function (integral of density) is computed in StudentI.
26012600
///
26022601
/// About Student distribution:
26032602
/// Student's t-distribution is used for many significance tests, for example,

Diff for: tutorials/CMakeLists.txt

+24-24
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ set(need_network dataframe/df027_SQliteDependencyOverVersion.C)
6767
#---Tutorials disabled depending on the build components-------------
6868

6969
if(NOT clad)
70-
set(clad_veto fit/minuit2GausFit.C
70+
set(clad_veto math/fit/minuit2GausFit.C
7171
# TODO: the next veto should not be necessary!
7272
# The tutorial should also work without clad.
7373
# See https://github.com/root-project/root/issues/15091.
74-
fit/exampleFit3D.C
74+
math/fit/exampleFit3D.C
7575
)
7676
endif()
7777

@@ -156,7 +156,7 @@ else()
156156
endif()
157157

158158
if(NOT ROOT_unuran_FOUND)
159-
set(unuran_veto math/testrandom.C unuran/unuranDemo.C unuran/unuranFoamTest.C
159+
set(unuran_veto math/testrandom.C math/unuran/unuranDemo.C math/unuran/unuranFoamTest.C
160160
math/multidimSampling.C)
161161
endif()
162162

@@ -197,7 +197,7 @@ endif()
197197

198198
# variables identifying the package must have the package name in lower case (it corresponds to the CMake option name)
199199
if(NOT ROOT_r_FOUND)
200-
set(r_veto r/*.C)
200+
set(r_veto math/r/*.C)
201201
endif()
202202

203203
set(histfactory_veto histfactory/makeExample.C)
@@ -210,18 +210,18 @@ if(NOT ROOT_mathmore_FOUND)
210210
set(mathmore_veto
211211
math/quasirandom.C
212212
math/exampleMultiRoot.C
213-
math/Bessel.C
213+
math/pdf/pdf009_Bessel.C
214214
math/LegendreAssoc.C
215215
math/Legendre.C
216216
math/mathmoreIntegration.C
217-
math/multivarGaus.C
218-
math/tStudent.C
219-
math/normalDist.C
217+
math/pdf/pdf007_multivarGaus.C
218+
math/pdf/pdf012_tStudent.C
219+
math/pdf/pdf001_Nornal.C
220220
roostats/TestNonCentral.C
221221
roostats/TestNonCentral.py
222222
math/Legendre.py
223-
math/Bessel.py
224-
math/tStudent.py)
223+
math/pdf/pdf009_Bessel.py
224+
math/pdf/pdf012_tStudent.py)
225225
endif()
226226

227227
if(NOT ROOT_fftw3_FOUND)
@@ -233,9 +233,9 @@ if(NOT ROOT_fftw3_FOUND)
233233
roofit/rf210_angularconv.py
234234
roofit/rf211_paramconv.py
235235
roofit/rf512_wsfactory_oper.py
236-
fft/FFT.C
237-
fit/fitConvolution.C
238-
fit/fitConvolution.py)
236+
math/fft/FFT.C
237+
math/fit/fitConvolution.C
238+
math/fit/fitConvolution.py)
239239
endif()
240240

241241
if(NOT ROOT_opengl_FOUND)
@@ -268,7 +268,7 @@ if(NOT gdml)
268268
endif()
269269

270270
#---These ones requires a display to run-----------------------------
271-
set(gui_veto fit/fitpanel_playback.C
271+
set(gui_veto math/fit/fitpanel_playback.C
272272
cocoa/*.C
273273
geom/building.C geom/cheongwadae.C geom/geom*.C geom/lego.C geom/robot.C geom/south_gate.C geom/station*.C geom/tank.C geom/webdemo.C geom/web_cms.cxx
274274
gl/glViewerExercise.C gl/glViewerLOD.C gl/gviz3d.C gl/nucleus.C gl/viewer3DLocal.C gl/viewer3DMaster.C
@@ -417,7 +417,7 @@ set(extra_veto
417417
tree/h1chain.C
418418
http/*.C
419419
eve7/*.C
420-
r/rootlogon.C)
420+
math/r/rootlogon.C)
421421

422422
if(MSVC AND NOT llvm13_broken_tests)
423423
list(APPEND extra_veto
@@ -500,7 +500,7 @@ if(mpi)
500500
endif()
501501

502502
#---Special return code------------------------------------------------
503-
set(returncode_1 fit/fit2a.C
503+
set(returncode_1 math/fit/fit2a.C
504504
graphics/earth.C
505505
graphics/pavetext.C
506506
graphics/tmathtext.C graphics/tmathtext2.C
@@ -515,7 +515,7 @@ set(returncode_1 fit/fit2a.C
515515
hist/hlabels2.C
516516
tree/h1analysis.C
517517
math/chi2test.C
518-
r/SimpleFitting.C)
518+
math/r/SimpleFitting.C)
519519
#---Dependencies------------------------------------------------------
520520
set(unfold-testUnfold5d-depends tutorial-unfold-testUnfold5c)
521521
set(unfold-testUnfold5c-depends tutorial-unfold-testUnfold5b)
@@ -527,15 +527,15 @@ set(xml-xmlmodifyfile-depends tutorial-xml-xmlnewfile)
527527
set(xml-xmlreadfile-depends tutorial-xml-xmlnewfile)
528528
set(roofit-rf503_wspaceread-depends tutorial-roofit-rf502_wspacewrite)
529529
set(io-readCode-depends tutorial-io-importCode)
530-
set(fit-fit1-depends tutorial-hist-fillrandom)
531-
set(fit-myfit-depends tutorial-fit-fitslicesy)
532-
set(foam-foam_demopers-depends tutorial-foam-foam_demo)
530+
set(math-fit-fit1-depends tutorial-hist-fillrandom)
531+
set(math-fit-myfit-depends tutorial-math-fit-fitslicesy)
532+
set(math-foam-foam_demopers-depends tutorial-math-foam-foam_demo)
533533
set(tree-tree502_staff-depends tutorial-tree-tree500_cernbuild)
534534
set(tree-tree501_cernstaff-depends tutorial-tree-tree500_cernbuild)
535535
set(hist-hbars-depends tutorial-tree-tree500_cernbuild)
536536
set(benchmarks-depends tutorial-hsimple
537-
tutorial-fit-fit1
538-
tutorial-fit-myfit
537+
tutorial-math-fit-fit1
538+
tutorial-math-fit-myfit
539539
tutorial-hist-h1ReadAndDraw
540540
tutorial-hist-FirstContour
541541
tutorial-geom-na49view
@@ -863,8 +863,8 @@ if(ROOT_pyroot_FOUND)
863863
file(GLOB requires_numpy RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
864864
dataframe/df026_AsNumpyArrays.py
865865
dataframe/df032_RDFFromNumpy.py
866-
fit/combinedFit.py
867-
fit/multifit.py
866+
math/fit/combinedFit.py
867+
math/fit/multifit.py
868868
roofit/rf409_NumPyPandasToRooFit.py)
869869
file(GLOB requires_numba RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} pyroot/pyroot004_NumbaDeclare.py)
870870
file(GLOB requires_pandas RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}

Diff for: tutorials/index.md

+16-24

Diff for: tutorials/math/FeldmanCousins.C renamed to tutorials/legacy/math/FeldmanCousins.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// \file
2-
/// \ingroup tutorial_math
2+
/// \ingroup tutorial_math_legacy
33
/// \notebook -nodraw
44
/// Example macro of using the TFeldmanCousins class in root.
55
///

Diff for: tutorials/math/Rolke.C renamed to tutorials/legacy/math/Rolke.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// \file
2-
/// \ingroup tutorial_math
2+
/// \ingroup tutorial_math_legacy
33
/// \notebook -nodraw
44
/// Example of the usage of the TRolke class
55
/// The TRolke class computes the profile likelihood

Diff for: tutorials/legacy/math/index.md

+3
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tutorials/fit/fit1.C renamed to tutorials/math/fit/fit1.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ void fit1() {
3636
// (see <a href="fillrandom.C.nbconvert.ipynb">Filling histograms with random numbers from a function</a>)
3737
//
3838
TString dir = gROOT->GetTutorialDir();
39-
dir.Append("/fit/");
39+
dir.Append("/math/fit/");
4040
TFile *file = nullptr;
4141
if (!gSystem->AccessPathName("fillrandom.root")) {
4242
// file exists
4343
file = TFile::Open("fillrandom.root");
4444
} else {
45-
gROOT->ProcessLine(Form(".x %s../hist/fillrandom.C(0)",dir.Data()));
45+
gROOT->ProcessLine(Form(".x %s../../hist/fillrandom.C(0)",dir.Data()));
4646
file = TFile::Open("fillrandom.root");
4747
if (!file) return;
4848
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tutorials/foam/foam_demopers.C renamed to tutorials/math/foam/foam_demopers.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Int_t foam_demopers()
2323

2424
// need to load the foam_demo tutorial for the definition of the function
2525
TString macroName = gROOT->GetTutorialDir();
26-
macroName.Append("/foam/foam_demo.C");
26+
macroName.Append("/math/foam/foam_demo.C");
2727
gROOT->ProcessLine(TString::Format(".L %s+",macroName.Data()));
2828

2929
//******************************************
File renamed without changes.

Diff for: tutorials/math/index.md

+35

Diff for: tutorials/math/limit.C

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// \file
22
/// \ingroup tutorial_math
33
/// \notebooks
4-
/// This program demonstrates the computation of 95 % C.L. limits.
4+
/// This program demonstrates the computation of 95 % confidence level (CL) limits.
55
/// It uses a set of randomly created histograms.
66
///
77
/// \macro_image
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tutorials/math/mathLaplace.C renamed to tutorials/math/pdf/pdf000_Laplace.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// \file
2-
/// \ingroup tutorial_math
2+
/// \ingroup tutorial_pdf
33
/// \notebook
44
/// Test the TMath::LaplaceDist and TMath::LaplaceDistI functions
55
///
@@ -13,7 +13,7 @@
1313
#include "TF1.h"
1414
#include "TLegend.h"
1515

16-
void mathLaplace(){
16+
void pdf000_Laplace(){
1717
TCanvas *c1=new TCanvas("c1", "TMath::LaplaceDist",600,800);
1818
c1->Divide(1, 2);
1919
TVirtualPad *pad1 = c1->cd(1);

Diff for: tutorials/math/normalDist.C renamed to tutorials/math/pdf/pdf001_Normal.C

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// \file
2-
/// \ingroup tutorial_math
2+
/// \ingroup tutorial_pdf
33
/// \notebook
44
/// Tutorial illustrating the new statistical distributions functions (pdf, cdf and quantile)
55
///
@@ -15,7 +15,7 @@
1515
#include "TLegend.h"
1616
#include "TAxis.h"
1717

18-
void normalDist() {
18+
void pdf001_Normal() {
1919

2020
TF1 *pdfunc = new TF1("pdf","ROOT::Math::normal_pdf(x, [0],[1])",-5,5);
2121
TF1 *cdfunc = new TF1("cdf","ROOT::Math::normal_cdf(x, [0],[1])",-5,5);

Diff for: tutorials/math/normalDist.py renamed to tutorials/math/pdf/pdf001_Normal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## \file
2-
## \ingroup tutorial_math
2+
## \ingroup tutorial_dist
33
## \notebook
44
## Tutorial illustrating the new statistical distributions functions (pdf, cdf and quantile)
55
##

0 commit comments

Comments
 (0)