Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
Math tutorials

Examples showing the Math classes.

Table of contents

Basic features of MathCore

To get started these examples show some of the basic features of the MathCore library.

Tutorial Description
ChebyshevPol.C Example of Chebyshev polynomials using TFormula pre-defined definitions of chebyshev polynomials.
exampleFunction.py Example of using Python functions as inputs to numerical algorithms using the ROOT Functor class.
exampleFunctor.C Tutorial illustrating how to create a TF1 class using c++ functors or class member functions.
GammaFun.C Example showing the usage of the major special math functions (gamma, beta, erf) in ROOT.
goftest.C Example showing usage of goodness of fit tests.
kdTreeBinning.C Example binning the data in cells of equal content using a kd-tree.
limit.C This example shows random number generation for filling histograms.
mathcoreSpecFunc.C Example macro showcasing some special mathematical functions.
multidimSampling.C Example of random number generation by sampling a multi-dim distribution using the DistSampler class.
permute.C Tutorial illustrating the use of TMath::Permute for computing all permutations of n natural numbers.
testrandom.C Performance test of all the ROOT random generator (TRandom, TRandom1, TRandom2 and TRandom3).

Basic features of MathMore

To get started these examples show some of the basic features of the MathMore library, a package incorporating advanced numerical functionality and dependent on external libraries like the GNU Scientific Library (GSL).

Tutorial Description
exampleMultiRoot.C Example of using multiroot finder based on GSL algorithm.
Legendre Polynomials.
Legendre Polynomials.
mathmoreIntegration.C Example on the usage of the adaptive 1D integration algorithm of MathMore.
mathmoreIntegrationMultidim.C Example on the usage of the multidimensional integration algorithm of MathMore.
quasirandom.C Example of quasi-random numbers generation.

Physics vectors

Examples showing usage of the GenVector library, generic class templates for modeling vectors in 2, 3 and 4 dimensions (relativistic vectors) and their rotation and transformation algorithms.

Tutorial Description
mathcoreGenVector.C Example macro testing available methods and operation of the GenVector classes.
mathcoreVectorCollection.C Example showing how to write and read a std vector of ROOT::Math LorentzVector in a ROOT tree.
mathcoreVectorFloatIO.C Macro illustrating I/O with Lorentz Vectors of floats.
mathcoreVectorIO.C Example of I/O of a GenVector Lorentz Vectors in a Tree and comparison with legacy TLorentzVector.

Histogramming related features

Examples showing usage of mathematical features for histigrams.

Tutorial Description
chi2test.C Example to use chi2 test for comparing two histograms.
exampleTKDE.C Example of using the TKDE class (kernel density estimator).
hlquantiles.C Demo for quantiles (with highlight mode).
principal.C principal.py Principal Components Analysis (PCA) example.
qa2.C Test generation of random numbers distributed according to a function defined by the user.
quantiles.C Demo for quantiles.

Minimizer features

Examples showing usage of ROOT minimizers.

Tutorial Description
NumericalMinimization.C Example on how to use the Minimizer class in ROOT.

Topics

 Fast Fourier Transforms tutorials
 Example showing the Fast Fourier Transforms interface in ROOT.
 
 Fit Tutorials
 These tutorials illustrate the main fitting features. Their names are related to the aspect which is treated in the code.
 
 FOAM tutorials
 Examples showing how to use FOAM.
 
 Matrix tutorials
 Examples showing how to use TMatrix.
 
 Probability distributions tutorials
 Examples showing the available probability distributions in ROOT.
 
 Quadratic programming package
 Example showing the usage of the quadratic programming package quadp.
 
 R tutorials
 Examples showing the R interface.
 
 Unuran tutorials
 Examples showing unuran capabilities.
 
 VecOps tutorials
 These examples show the functionalities of the VecOps utilities.
 

Files

file  ChebyshevPol.C
  View in nbviewer Open in SWAN
Example of Chebyshev polynomials using TFormula pre-defined definitions of chebyshev polynomials.
 
file  chi2test.C
  View in nbviewer Open in SWAN
Example to use chi2 test for comparing two histograms.
 
file  exampleFunction.py
  View in nbviewer Open in SWAN
Example of using Python functions as inputs to numerical algorithms using the ROOT Functor class.
 
file  exampleFunctor.C
  View in nbviewer Open in SWAN
Tutorial illustrating how to create a TF1 class using C++ functors or class member functions.
 
file  exampleMultiRoot.C
  View in nbviewer Open in SWAN
Example of using multiroot finder based on GSL algorithm.
 
file  exampleTKDE.C
  View in nbviewer Open in SWAN
Example of using the TKDE class (kernel density estimator).
 
file  GammaFun.C
  View in nbviewer Open in SWAN
Example showing the usage of the major special math functions (gamma, beta, erf) in ROOT.
 
file  goftest.C
  View in nbviewer Open in SWAN
Example showing usage of goodness of fit tests.
 
file  hlquantiles.C
 Demo for quantiles (with highlight mode).
 
file  kdTreeBinning.C
  View in nbviewer Open in SWAN
Example binning the data in cells of equal content using a kd-tree.
 
file  Legendre.C
  View in nbviewer Open in SWAN
Example of first few Legendre Polynomials.
 
file  Legendre.py
  View in nbviewer Open in SWAN
Example of first few Legendre Polynomials.
 
file  LegendreAssoc.C
  View in nbviewer Open in SWAN
Example describing the usage of different kinds of Associate Legendre Polynomials.
 
file  limit.C
  View in nbviewer Open in SWAN
This example shows random number generation for filling histograms.
 
file  mathcoreGenVector.C
  View in nbviewer Open in SWAN
Example macro testing available methods and operation of the GenVector classes.
 
file  mathcoreSpecFunc.C
  View in nbviewer Open in SWAN
Example macro showcasing some special mathematical functions.
 
file  mathcoreVectorCollection.C
  View in nbviewer Open in SWAN
Example showing how to write and read a std vector of ROOT::Math LorentzVector in a ROOT tree.
 
file  mathcoreVectorFloatIO.C
  View in nbviewer Open in SWAN
Macro illustrating I/O with Lorentz Vectors of floats.
 
file  mathcoreVectorIO.C
  View in nbviewer Open in SWAN
Example of I/O of a GenVector Lorentz Vectors in a Tree and comparison with legacy TLorentzVector.
 
file  mathmoreIntegration.C
  View in nbviewer Open in SWAN
Example on the usage of the adaptive 1D integration algorithm of MathMore.
 
file  mathmoreIntegrationMultidim.C
  View in nbviewer Open in SWAN
Example on the usage of the multidimensional integration algorithm of MathMore.
 
file  multidimSampling.C
  View in nbviewer Open in SWAN
Example of random number generation by sampling a multi-dim distribution using the DistSampler class.
 
file  NumericalMinimization.C
  View in nbviewer Open in SWAN
Example on how to use the Minimizer class in ROOT.
 
file  permute.C
  View in nbviewer Open in SWAN
Tutorial illustrating the use of TMath::Permute for computing all permutations of n natural numbers.
 
file  principal.C
  View in nbviewer Open in SWAN
Principal Components Analysis (PCA) example.
 
file  principal.py
  View in nbviewer Open in SWAN
Principal Components Analysis (PCA) example.
 
file  qa2.C
  View in nbviewer Open in SWAN
Test generation of random numbers distributed according to a function defined by the user.
 
file  quantiles.C
  View in nbviewer Open in SWAN
Demo for quantiles.
 
file  quasirandom.C
  View in nbviewer Open in SWAN
Example of quasi-random numbers generation.
 
file  testrandom.C
  View in nbviewer Open in SWAN
Performance test of all the ROOT random generator (TRandom, TRandom1, TRandom2 and TRandom3).