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] Re-organize math tutorials #17029

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions math/mathcore/inc/Math/PdfFuncMathCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ namespace Math {

/**

Probability density function of the normal (Gaussian) distribution.
Probability density function of the normal (Gaussian) distribution with mean x0 and standard deviation sigma.

\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-x^2 / 2\sigma^2} \f]
\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-(x-x_0)^2 / 2\sigma^2} \f]

For detailed description see
<A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
Expand Down Expand Up @@ -493,9 +493,9 @@ namespace Math {

/**

Probability density function of the normal (Gaussian) distribution.
Probability density function of the normal (Gaussian) distribution with mean x0 and standard deviation sigma.

\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-x^2 / 2\sigma^2} \f]
\f[ p(x) = {1 \over \sqrt{2 \pi \sigma^2}} e^{-(x-x_0)^2 / 2\sigma^2} \f]

For detailed description see
<A HREF="http://mathworld.wolfram.com/NormalDistribution.html">
Expand Down Expand Up @@ -552,7 +552,7 @@ namespace Math {

\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]

for \f$k \geq 0\f$. For detailed description see
for \f$r \geq 0\f$. For detailed description see
<A HREF="http://mathworld.wolfram.com/Studentst-Distribution.html">
Mathworld</A>.

Expand Down
9 changes: 4 additions & 5 deletions math/mathcore/src/TMath.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2593,11 +2593,10 @@ Bool_t TMath::Permute(Int_t n, Int_t *a)

////////////////////////////////////////////////////////////////////////////////
/// Computes density function for Student's t- distribution
/// (the probability function (integral of density) is computed in StudentI).
///
/// First parameter stands for x - the actual variable of the
/// density function p(x) and the point at which the density is calculated.
/// Second parameter stands for number of degrees of freedom.
/// \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]
/// for \f$n \geq 0\f$, at point x for n (ndf) degrees of freedom.
/// This is equivalent to ROOT::Math::tdistribution_pdf(x,ndf)
/// The probability function (integral of density) is computed in StudentI.
///
/// About Student distribution:
/// Student's t-distribution is used for many significance tests, for example,
Expand Down
48 changes: 24 additions & 24 deletions tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ set(need_network dataframe/df027_SQliteDependencyOverVersion.C)
#---Tutorials disabled depending on the build components-------------

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

Expand Down Expand Up @@ -156,7 +156,7 @@ else()
endif()

if(NOT ROOT_unuran_FOUND)
set(unuran_veto math/testrandom.C unuran/unuranDemo.C unuran/unuranFoamTest.C
set(unuran_veto math/testrandom.C math/unuran/unuranDemo.C math/unuran/unuranFoamTest.C
math/multidimSampling.C)
endif()

Expand Down Expand Up @@ -197,7 +197,7 @@ endif()

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

set(histfactory_veto histfactory/makeExample.C)
Expand All @@ -210,18 +210,18 @@ if(NOT ROOT_mathmore_FOUND)
set(mathmore_veto
math/quasirandom.C
math/exampleMultiRoot.C
math/Bessel.C
math/pdf/pdf009_Bessel.C
math/LegendreAssoc.C
math/Legendre.C
math/mathmoreIntegration.C
math/multivarGaus.C
math/tStudent.C
math/normalDist.C
math/pdf/pdf007_multivarGaus.C
math/pdf/pdf012_tStudent.C
math/pdf/pdf001_Nornal.C
roostats/TestNonCentral.C
roostats/TestNonCentral.py
math/Legendre.py
math/Bessel.py
math/tStudent.py)
math/pdf/pdf009_Bessel.py
math/pdf/pdf012_tStudent.py)
endif()

if(NOT ROOT_fftw3_FOUND)
Expand All @@ -233,9 +233,9 @@ if(NOT ROOT_fftw3_FOUND)
roofit/rf210_angularconv.py
roofit/rf211_paramconv.py
roofit/rf512_wsfactory_oper.py
fft/FFT.C
fit/fitConvolution.C
fit/fitConvolution.py)
math/fft/FFT.C
math/fit/fitConvolution.C
math/fit/fitConvolution.py)
endif()

if(NOT ROOT_opengl_FOUND)
Expand Down Expand Up @@ -268,7 +268,7 @@ if(NOT gdml)
endif()

#---These ones requires a display to run-----------------------------
set(gui_veto fit/fitpanel_playback.C
set(gui_veto math/fit/fitpanel_playback.C
cocoa/*.C
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
gl/glViewerExercise.C gl/glViewerLOD.C gl/gviz3d.C gl/nucleus.C gl/viewer3DLocal.C gl/viewer3DMaster.C
Expand Down Expand Up @@ -417,7 +417,7 @@ set(extra_veto
tree/h1chain.C
http/*.C
eve7/*.C
r/rootlogon.C)
math/r/rootlogon.C)

if(MSVC AND NOT llvm13_broken_tests)
list(APPEND extra_veto
Expand Down Expand Up @@ -500,7 +500,7 @@ if(mpi)
endif()

#---Special return code------------------------------------------------
set(returncode_1 fit/fit2a.C
set(returncode_1 math/fit/fit2a.C
graphics/earth.C
graphics/pavetext.C
graphics/tmathtext.C graphics/tmathtext2.C
Expand All @@ -515,7 +515,7 @@ set(returncode_1 fit/fit2a.C
hist/hlabels2.C
tree/h1analysis.C
math/chi2test.C
r/SimpleFitting.C)
math/r/SimpleFitting.C)
#---Dependencies------------------------------------------------------
set(unfold-testUnfold5d-depends tutorial-unfold-testUnfold5c)
set(unfold-testUnfold5c-depends tutorial-unfold-testUnfold5b)
Expand All @@ -527,15 +527,15 @@ set(xml-xmlmodifyfile-depends tutorial-xml-xmlnewfile)
set(xml-xmlreadfile-depends tutorial-xml-xmlnewfile)
set(roofit-rf503_wspaceread-depends tutorial-roofit-rf502_wspacewrite)
set(io-readCode-depends tutorial-io-importCode)
set(fit-fit1-depends tutorial-hist-fillrandom)
set(fit-myfit-depends tutorial-fit-fitslicesy)
set(foam-foam_demopers-depends tutorial-foam-foam_demo)
set(math-fit-fit1-depends tutorial-hist-fillrandom)
set(math-fit-myfit-depends tutorial-math-fit-fitslicesy)
set(math-foam-foam_demopers-depends tutorial-math-foam-foam_demo)
set(tree-tree502_staff-depends tutorial-tree-tree500_cernbuild)
set(tree-tree501_cernstaff-depends tutorial-tree-tree500_cernbuild)
set(hist-hbars-depends tutorial-tree-tree500_cernbuild)
set(benchmarks-depends tutorial-hsimple
tutorial-fit-fit1
tutorial-fit-myfit
tutorial-math-fit-fit1
tutorial-math-fit-myfit
tutorial-hist-h1ReadAndDraw
tutorial-hist-FirstContour
tutorial-geom-na49view
Expand Down Expand Up @@ -863,8 +863,8 @@ if(ROOT_pyroot_FOUND)
file(GLOB requires_numpy RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
dataframe/df026_AsNumpyArrays.py
dataframe/df032_RDFFromNumpy.py
fit/combinedFit.py
fit/multifit.py
math/fit/combinedFit.py
math/fit/multifit.py
roofit/rf409_NumPyPandasToRooFit.py)
file(GLOB requires_numba RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} pyroot/pyroot004_NumbaDeclare.py)
file(GLOB requires_pandas RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
40 changes: 16 additions & 24 deletions tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ or
root > .x $ROOTSYS/tutorials/benchmarks.C
```

## Get started

If you have never used ROOT before and don’t know where to start, we recommend that you first explore the [ROOT introductory course](https://github.com/root-project/student-course). You can also watch the recording of the course, but you should follow the material along on your PC. You also may want to have a look at the documentation of these modules:

- @ref tutorial_hist
- @ref tutorial_graphs
- @ref tutorial_fit
- @ref tutorial_tree
- @ref tutorial_ntuple
- @ref tutorial_dataframe
- @ref tutorial_roofit

The `$ROOTSYS/tutorials` directory includes several sub-directories:

\defgroup tutorial_hist Histograms tutorials
Expand Down Expand Up @@ -70,14 +82,6 @@ The `$ROOTSYS/tutorials` directory includes several sub-directories:
\ingroup Tutorials
\brief Various ROOT geometry package examples.

\defgroup tutorial_fft Fast Fourier Transforms tutorials
\ingroup Tutorials
\brief Example showing the Fast Fourier Transforms interface in ROOT.

\defgroup tutorial_fit Fit Tutorials
\ingroup Tutorials
\brief These tutorials illustrate the main fitting features. Their names are related to the aspect which is treated in the code.

\defgroup tutorial_roofit RooFit Tutorials
\ingroup Tutorials
\brief These tutorials illustrate the main features of [RooFit](group__Roofitmain.html): the name of the examples and their short description help in figuring out their objective.
Expand Down Expand Up @@ -122,9 +126,9 @@ The `$ROOTSYS/tutorials` directory includes several sub-directories:
\ingroup Tutorials
\brief Examples showing the Math classes.

\defgroup tutorial_matrix Matrix tutorials
\defgroup tutorial_mc Monte Carlo tutorials
\ingroup Tutorials
\brief Examples showing how to use TMatrix.
\brief Monte Carlo examples.

\defgroup tutorial_multicore Multicore tutorials
\ingroup Tutorials
Expand All @@ -138,13 +142,9 @@ The `$ROOTSYS/tutorials` directory includes several sub-directories:
\ingroup Tutorials
\brief Selected examples illustrating how to use ROOT's Python interface: PyROOT.

\defgroup tutorial_quadp Quadratic programming package.
\defgroup tutorial_pythia Pythia tutorials
\ingroup Tutorials
\brief Example showing the usage of the quadratic programming package quadp.

\defgroup tutorial_r R tutorials
\ingroup Tutorials
\brief Examples showing the R interface.
\brief Examples showing the pythia usage.

\defgroup tutorial_roostats RooStats Tutorials
\ingroup Tutorials
Expand All @@ -170,14 +170,6 @@ The `$ROOTSYS/tutorials` directory includes several sub-directories:
\ingroup Tutorials
\brief Test programs for the classes TUnfold and related

\defgroup tutorial_unuran Unuran tutorials
\ingroup Tutorials
\brief Examples showing unuran capabilities.

\defgroup tutorial_vecops VecOps tutorials
\ingroup Tutorials
\brief These examples show the functionalities of the VecOps utilities.

\defgroup tutorial_FITS FITS files interface tutorials
\ingroup Tutorials
\brief Examples showing the FITS file interface.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_math
/// \ingroup tutorial_math_legacy
/// \notebook -nodraw
/// Example macro of using the TFeldmanCousins class in root.
///
Expand Down
2 changes: 1 addition & 1 deletion tutorials/math/Rolke.C → tutorials/legacy/math/Rolke.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_math
/// \ingroup tutorial_math_legacy
/// \notebook -nodraw
/// Example of the usage of the TRolke class
/// The TRolke class computes the profile likelihood
Expand Down
3 changes: 3 additions & 0 deletions tutorials/legacy/math/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
\defgroup tutorial_math_legacy Math tutorials
\ingroup tutorial_legacy
\brief Examples showing the math classes usage.
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.
4 changes: 2 additions & 2 deletions tutorials/fit/fit1.C → tutorials/math/fit/fit1.C
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ void fit1() {
// (see <a href="fillrandom.C.nbconvert.ipynb">Filling histograms with random numbers from a function</a>)
//
TString dir = gROOT->GetTutorialDir();
dir.Append("/fit/");
dir.Append("/math/fit/");
TFile *file = nullptr;
if (!gSystem->AccessPathName("fillrandom.root")) {
// file exists
file = TFile::Open("fillrandom.root");
} else {
gROOT->ProcessLine(Form(".x %s../hist/fillrandom.C(0)",dir.Data()));
gROOT->ProcessLine(Form(".x %s../../hist/fillrandom.C(0)",dir.Data()));
file = TFile::Open("fillrandom.root");
if (!file) return;
}
Expand Down
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.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Int_t foam_demopers()

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

//******************************************
Expand Down
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions tutorials/math/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
\defgroup tutorial_fft Fast Fourier Transforms tutorials
\ingroup tutorial_math
\brief Example showing the Fast Fourier Transforms interface in ROOT.

\defgroup tutorial_fit Fit Tutorials
\ingroup tutorial_math
\brief These tutorials illustrate the main fitting features. Their names are related to the aspect which is treated in the code.

\defgroup tutorial_FOAM FOAM tutorials
\ingroup tutorial_math
\brief Examples showing how to use FOAM.

\defgroup tutorial_matrix Matrix tutorials
\ingroup tutorial_math
\brief Examples showing how to use TMatrix.

\defgroup tutorial_pdf Probability distributions tutorials
\ingroup tutorial_math
\brief Examples showing the available probability distributions in ROOT.

\defgroup tutorial_quadp Quadratic programming package
\ingroup tutorial_math
\brief Example showing the usage of the quadratic programming package quadp.

\defgroup tutorial_r R tutorials
\ingroup tutorial_math
\brief Examples showing the R interface.

\defgroup tutorial_unuran Unuran tutorials
\ingroup tutorial_math
\brief Examples showing unuran capabilities.

\defgroup tutorial_vecops VecOps tutorials
\ingroup tutorial_math
\brief These examples show the functionalities of the VecOps utilities.
2 changes: 1 addition & 1 deletion tutorials/math/limit.C
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// \file
/// \ingroup tutorial_math
/// \notebooks
/// This program demonstrates the computation of 95 % C.L. limits.
/// This program demonstrates the computation of 95 % confidence level (CL) limits.
/// It uses a set of randomly created histograms.
///
/// \macro_image
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_math
/// \ingroup tutorial_pdf
/// \notebook
/// Test the TMath::LaplaceDist and TMath::LaplaceDistI functions
///
Expand All @@ -13,7 +13,7 @@
#include "TF1.h"
#include "TLegend.h"

void mathLaplace(){
void pdf000_Laplace(){
TCanvas *c1=new TCanvas("c1", "TMath::LaplaceDist",600,800);
c1->Divide(1, 2);
TVirtualPad *pad1 = c1->cd(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// \file
/// \ingroup tutorial_math
/// \ingroup tutorial_pdf
/// \notebook
/// Tutorial illustrating the new statistical distributions functions (pdf, cdf and quantile)
///
Expand All @@ -15,7 +15,7 @@
#include "TLegend.h"
#include "TAxis.h"

void normalDist() {
void pdf001_Normal() {

TF1 *pdfunc = new TF1("pdf","ROOT::Math::normal_pdf(x, [0],[1])",-5,5);
TF1 *cdfunc = new TF1("cdf","ROOT::Math::normal_cdf(x, [0],[1])",-5,5);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## \file
## \ingroup tutorial_math
## \ingroup tutorial_dist
## \notebook
## Tutorial illustrating the new statistical distributions functions (pdf, cdf and quantile)
##
Expand Down
Loading
Loading