ROOT Version 5.14/00 Release Notes


ROOT version 5.14/00 has been released December 15, 2006.

Binaries for all supported platforms are available at:

      http://root.cern.ch/root/Version514.html
Versions for AFS have also been updated. See the list of supported platforms:
      http://root.cern.ch/Welcome.html

For more information, see:

      http://root.cern.ch

The following people have contributed to this new version:
Ilka Antcheva,
Maarten Ballintijn,
Bertrand Bellenot,
Rene Brun,
Philippe Canal,
Federico Carminati,
Olivier Couet,
Matthieu Demaret,
Valeri Fine,
Leo Franco,
Markus Frank,
Fabrizio Furano,
Nikolai Gagunashvili,
Gerri Ganis,
Andrei Gheata,
Mihaela Gheata,
Daniel Haertl,
Antti Hahto,
Andy Hanushevsky,
Christian Holm Christensen,
Jan Iwaszkiewicz,
Anna Kreshuk,
Wim Lavrijsen,
Josef Leydold,
Sergei Linev,
Ben Lloyd,
David Gonzalez Maline,
Pere Mato,
Lorenzo Moneta,
Miroslav Morhac,
Axel Naumann,
Jan Fiete Grosse-Oetringhaus,
Eddy Offermann,
Valeriy Onuchin,
Andreas Peters,
Timur Pocheptsov,
Gilles Quemener,
Fons Rademakers,
Stefan Roiser,
Paul Russo,
Scott Snyder,
Alja Tadel,
Matevz Tadel,
Guido Volpi


New tutorials directory structure

The tutorials have been reorganized with new sub-directories.
-fft:      Fast Fourier Transform with the fftw package
-fit:      Several examples illustrating minimization/fitting 
-foam:     Random generator in multi-dimensional space
-geom:     Examples of use of the geometry package (TGeo classes)
-gl:       Visualisation with OpenGL
-graphics: Basic graphics
-graphs:   Use of TGraph, TGraphErrors, etc
-gui:      Scripts to create Graphics User Interface
-hist:     Histograming
-image:    Image Processing
-io:       Input/Output
-math:     Maths and Statistics functions
-matrix:   Matrices (TMatrix) examples
-mlp:      Neural networks with TMultiLayerPerceptron
-net:      Network classes (client/server examples)
-physics:  LorentzVectors, phase space
-pyroot:   python tutorials
-pythia:   Example with pythia6
-quadp:    Quadratic Programming
-ruby:     ruby tutorials
-smatrix:  Matrices with a templated package
-spectrum: Peak finder, background, deconvolutions
-splot:    Example of the TSplot class (signal/background estimator)
-sql:      Interfaces to SQL (mysql, oracle, etc)
-thread:   Using Threads
-tmva:     Examples of the MultiVariate Analysis classes
-tree:     Creating Trees, Playing with Trees
-unuran:   Interface with the unuram random generator library
-xml:      Writing/Reading xml files

You can execute the scripts in $ROOTSYS/tutorials (or sub-directories) by setting your current directory in the script directory or from any user directory with write access.

Several tutorials create new files. If you have write access to the tutorials directory, the new files will be created in the tutorials directory, otherwise they will be created in the user directory.


CINT

Optimisation of the size of the dynamic structures to store the dictionaries. This reduces considerably the size of the ROOT executable modules. On Linux, the standard root.exe takes now about 15 MBytes instead of 30.

A few fixes and extensions:


Clarified the source code license statements.

Core


PROOF


Improvements in THtml

Now generates XHTML 1.0 transitional compliant code.

If THtml knows a class A, but can't find its sources, it assumed that it's a ROOT class, and the user was creating documentation for his/her own classes. This fails if a user dares to have more than one lib. THtml now checks the env var Root.Html.LibName, and creates a link using that base URL, for all classes being defined in libLibName.*. I.e. if that class A is defined in libLibName.so, and Root.Html.LibName is ../LibNameDoc, then THtml will create a link to ../LibNameDoc/A.html. The class name / library name mapping is done with the help of rlibmap; see the class reference for more info.

Many small improvements, most important ones:

Added (optional) class diagrams using GraphViz's dot. The diagrams are:

If javascript is disabled, only the inheritance diagram is visible.

Improvements in Pyroot

Work has been done to reduce the list of known annoyances, that up to now were low priority because workarounds existed. These include: improved late-startup to allow choosing batch mode; allowing the "from ROOT import *" construct in multiple modules, and recovering state after a failed load of a dynamic library.

Interpreter environment

Python 2.5 adds support for 64-bit indexing into python containers, which requires changes in all extension modules. PyROOT has been updated with the needed modifications.

C++ language and pythonization

Looping over a std::map automatically unpacks pairs into a tuple (key, value); string has been added to the list of std:: classes, and overloading priority now distinguishes between ints and doubles.

Optimizations

Following TRint, fewer libraries are loaded on startup.

Improvements in Trees, I/O, Meta



Interfaces to SQL data bases


Improvements in the XML classes


MathCore

Changes for this release are:

In addition the following bug fixes have been applied:

A new test has been added in mathcore/test for the I/O of 3D and 4D Vectors of Double32 and double types and for wrappers of MathCore Vectors. The test provides also the possibility to run with mixed Reflex-Cint dictionary if the environment variable useReflex is set.

More detailed description of the current MathCore release can be found at this location.


MathMore

From this release, MathMore requires a GSL version larger or equal 1.8.

The names of the statistical functions have been changed for clarity and to avoid ambiguities. The previous names are currently kept for providing backward compatibility.

The following picture gives an example of the various normal distribution functions.

This release contains in addition the following statistical functions (some of them are introduced in GSL only from version 1.8):

The headerfile DistFunc.h defines all the statistical functions (PDF, CDF and quantiles). The headers PdfFunc.h, ProbFunc.h and ProbFuncInv.h define separately the PDF, CDF and their inverse (quantiles). Since some of the PDF and CDF functions are also in MathCore, when the standalone MathMore version is used, the header files PdfFuncMathMore.h and ProbFuncMathMore.h must then be used.

Additional main changes for this release are the adoption of the new function interfaces, defined now in MathCore. We provide separate interfaces for basic functions, functions with gradient functionality and parametric functions. The non-backward compatible changes are:

Further additions are:

More detailed description of this released MathMore version can be found here.


SMatrix

Only small changes for this release:

Online documentation of the current released version of SMatrix can be found at this location.


Minuit2

No major changes for this release, only a couple of bug fixes.

For improving performances in case of minimization of very simple functions (like those used in the test stressFit.cxx, Minuit2 can be compiled with the option -DMN_USE_STACK_ALLOC, by un commenting the corresponding line in the minuit2/Module.mk. In this case an optimized allocator for the Minuit2 objects is used and providing significant gain in performance. The drawback is that Minuit2 will not be anymore thread-safe.

Online documentation of the current released version of Minuit2 can be found at this location.


Unuran

An interface to a new package, UNU.RAN, (Universal Non Uniform Random number generator for generating non uniform pseudo-random numbers) has been introduced. UNU.RAN is an ANSI C library licensed under GPL.
It contains universal (also called automatic or black-box) algorithms that can generate random numbers from large classes of continuous or discrete distributions, and also from practically all standard distributions. An extensive online documentation are available at the UNU.RAN Web Site.

The classes TUnuran, TUnuranDistr and TUnuranDistrMultiu have been introduced to use the UNU.RAN C library from ROOT and C++ from ROOT and using C++ objects. UNU.RAN can be used in two distinct ways:

Functionality is also provided via the C++ classes for:

The UNU.RAN documentation provides a detailed description of all the available methods and the possible options which one can pass to UNU.RAN for both 1D and multi-dimensional distributions.

 


TH1

$\chi^2$ test for comparing weighted and unweighted histograms

This new implementation is based on the papers "$\chi^2$ test for comparison of weighted and unweighted histograms" in Proceedings of PHYSTAT05 and "Comparison weighted and unweighted histograms", arXiv:physics/0605123 by N.Gagunashvili. This function has been implemented by Daniel Haertl in August 2006.

The algorithm computes also the normalized residuals which can be returned in an array from the TH1::Chi2Test and TH1::Chi2TestX methods. The possible options are:

The function TH1::Chi2TestX(const TH1* h2, Double_t &chi2, Int_t &ndf, Int_t &igood, Option_t *option, Double_t *res) requires now the parameter igood which returns the status of the comparison. For the possible value of igood see the TH1 class description.

Introduction

A frequently used technique in data analysis is the comparison of histograms. First suggested by Pearson [1] the $\chi^2$ test of homogeneity is used widely for comparing usual (unweighted) histograms. This paper describes the implementation modified $\chi^2$ tests for comparison of weighted and unweighted histograms and two weighted histograms [2] as well as usual Pearson's $\chi^2$ test for comparison two usual (unweighted) histograms.

Overview

Comparison of two histograms expect hypotheses that two histograms represent the identical distributions. To make a decision p-value should be calculated. The hypotheses of identity is rejected if p-value is lower then some significance level. Traditionally significance levels 0.1, 0.05 and 0.01 are used. The comparison procedure should include an analysis of the residuals which is often helpful in identifying the bins of histograms responsible for a significant overall X2 value. Residuals are the difference between bin contents and expected bin contents. Most convenient for analysis are the normalized residuals. If hypotheses of identity are valid then normalized residuals are approximately independent and identically distributed random variables having normal distribution. Analysis of residuals expect test of above mentioned properties of residuals. Notice that indirectly the analysis of residuals increase the power of $\chi^2$ test.

Methods of comparison

$\chi^2$ test for comparison two (unweighted) histograms

Let us consider two histograms with the same binning and the number of bins equal to r. Let us denote the number of events in the ith bin in the first histogram as ni and as mi in the second one. The total number of events in the first histogram is equal to $N=\sum_{i=1}^{r}{n_i}$ , and $M=\sum_{i=1}^{r}{m_i}$ in the second histogram. The hypothesis of identity (homogeneity) [3] is that the two histograms represent random values with identical distributions. It is equivalent that there exist r constants p1,...,pr, such that  $\sum_{i=1}^{r} p_i=1$ , and the probability of belonging to the ith bin for some measured value in both experiments is equal to pi. The number of events in the ith bin is a random variable with a distribution approximated by a Poisson probability distribution $e^{-Np_i}(Np_i)^{n_i}/n_i!$ for the first histogram and with distribution $e^{-Mp_i}(Mp_i)^{m_i}/m_i!$ for the second histogram. If the hypothesis of homogeneity is valid, then the maximum likelihood estimator of pi, i=1,...,r, is

\hat{p}_i= \frac{n_{i}+m_{i}}{N+M}
and then

X^2=\sum_{i=1}^{r}{\frac{(n_{i}-N\hat{p}_i)^2}{N\hat{p}_i}}
+\sum_{i=1}^{r}{\frac{(m_{i}-M\hat{p}_i)^2}{M\hat{p}_i}} =\frac{1}{MN} \sum_{i=1}^{r}{\frac{(Mn_i-Nm_i)^2}{n_i+m_i}}X^2=\sum_{i=1}^{r}{\frac{(n_{i}-N\hat{p}_i)^2}{N\hat{p}_i}}
+\sum_{i=1}^{r}{\frac{(m_{i}-M\hat{p}_i)^2}{M\hat{p}_i}} =\frac{1}{MN} \sum_{i=1}^{r}{\frac{(Mn_i-Nm_i)^2}{n_i+m_i}}
has approximately a  $\chi^2_{(r-1)}$ distribution [3]. The comparison procedure can include an analysis of the residuals which is often helpful in identifying the bins of histograms responsible for a significant overall X2 value. Most convenient for analysis are the adjusted (normalized) residuals [4]

$r_i=\frac{n_{i}-N\hat{p}_i}{\sqrt{N\hat{p}_i}\sqrt{(1-N/(N+M))(1-(n_i+m_i)/(N+M))}}$.
If hypotheses of homogeneity are valid then residuals ri are approximately independent and identically distributed random variables having $\mathcal{N}(0,1)$ distribution. The application of the $\chi^2$ test has restrictions related to the value of the expected frequencies Npi, Mpi, i=1,...,r. A conservative rule formulated in [5] is that all the expectations must be 1 or greater for both histograms. In practical cases when expected frequencies are not known the estimated expected frequencies  $M\hat{p}_i$, $N\hat{p}_i, i=1,...,r$ can be used.

Unweighted and weighted histograms comparison

A simple modification of the ideas described above can be used for the comparison of the usual (unweighted) and weighted histograms. Let us denote the number of events in the ith bin in the unweighted histogram as ni and the common weight of events in the ith bin of the weighted histogram as wi. The total number of events in the unweighted histogram is equal to $N=\sum_{i=1}^{r}{n_i}$ and the total weight of events in the weighted histogram is equal to  $W=\sum_{i=1}^{r}{w_i}$. Let us formulate the hypothesis of identity of an unweighted histogram to a weighted histogram so that there exist r constants p1,...,pr, such that $\sum_{i=1}^{r} p_i=1$ , and the probability of belonging to the ith bin for some measured value is equal to pi for the unweighted histogram and expectation value of weight wi equal to Wpi for the weighted histogram. The number of events in the ith bin is a random variable with distribution approximated by the Poisson probability distribution $e^{-Np_i}(Np_i)^{n_i}/n_i!$ for the unweighted histogram. The weight wi is a random variable with a distribution approximated by the normal probability distribution  $ \mathcal{N}(Wp_i,\sigma_i^2)$ , where  $\sigma_i^2$ is the variance of the weight wi. If we replace the variance  $\sigma_i^2$ with estimate  $s_i^2$ (sum of squares of weights of events in the ith bin) and the hypothesis of identity is valid, then the maximum likelihood estimator of pi,i=1,...,r, is

\hat{p}_i= \frac{Ww_i-Ns_i^2+\sqrt{(Ww_i-Ns_i^2)^2+4W^2s_i^2n_i}}{2W^2} .
We may then use the test statistic

X^2=\sum_{i=1}^{r}{\frac{(n_{i}-N\hat{p}_i)^2}{N\hat{p}_i}}
+\sum_{i=1}^{r}{\frac{(w_{i}-W\hat{p}_i)^2}{s_i^2}}
and it has approximately a  $\chi^2_{(r-1)}$ distribution [2]. This test, as well as the original one [3], has a restriction on the expected frequencies. The expected frequencies recommended for the weighted histogram is more than 25. The value of the minimal expected frequency can be decreased down to 10 for the case when the weights of the events are close to constant. In the case of a weighted histogram if the number of events is unknown, then we can apply this recommendation for the equivalent number of events as $n_i^{equiv}={w_i^2}/{s_i^2} \, \text{.}$. The minimal expected frequency for an unweighted histogram must be 1. Notice that any usual (unweighted) histogram can be considered as a weighted histogram with events that have constant weights equal to 1. The variance $z_i^2$ of the difference between the weight wi and the estimated expectation value of the weight is approximately equal to:

$z_i^2=Var(w_{i}-W\hat{p}_i)=N\hat{p}_i(1-N\hat{p}_i)\biggl(\frac{Ws_i^2}
{\sqrt{(Ns_i^2-w_iW)^2+4W^2s_i^2n_i}}\biggr)^2\\
+\frac{s_i^2}{4}\biggl(1+\frac{Ns_i^2-w_iW}
{\sqrt{(Ns_i^2-w_iW)^2+4W^2s_i^2n_i}}\biggr)^2$ $z_i^2=Var(w_{i}-W\hat{p}_i)=N\hat{p}_i(1-N\hat{p}_i)\biggl(\frac{Ws_i^2}
{\sqrt{(Ns_i^2-w_iW)^2+4W^2s_i^2n_i}}\biggr)^2\\
+\frac{s_i^2}{4}\biggl(1+\frac{Ns_i^2-w_iW}
{\sqrt{(Ns_i^2-w_iW)^2+4W^2s_i^2n_i}}\biggr)^2$ $z_i^2=Var(w_{i}-W\hat{p}_i)=N\hat{p}_i(1-N\hat{p}_i)\biggl(\frac{Ws_i^2}
{\sqrt{(Ns_i^2-w_iW)^2+4W^2s_i^2n_i}}\biggr)^2\\
+\frac{s_i^2}{4}\biggl(1+\frac{Ns_i^2-w_iW}
{\sqrt{(Ns_i^2-w_iW)^2+4W^2s_i^2n_i}}\biggr)^2$.
The residuals

r_i=\frac{w_{i}-W\hat{p}_i}{z_i}
have approximately a normal distribution with mean equal to 0 and standard deviation equal to 1.

Two weighted histograms comparison

Let us denote the common weight of events of the ith bin in the first histogram as w1i and as w2i in the second one. The total weight of events in the first histogram is equal to $W_1=\sum_{i=1}^{r}{w_{1i}}$, and $W_2=\sum_{i=1}^{r}{w_{2i}}$ in the second histogram. Let us formulate the hypothesis of identity of weighted histograms so that there exist r constants p1,...,pr, such that $\sum_{i=1}^{r} p_i=1$, and also expectation value of weight w1i equal to W1pi and expectation value of weight w2i equal to W2pi. Weights in both the histograms are random variables with distributions which can be approximated by a normal probability distribution $\mathcal{N}(W_1p_i,\sigma_{1i}^2)$ for the first histogram and by a distribution $\mathcal{N}(W_2p_i,\sigma_{2i}^2)$ for the second. Here $\sigma_{1i}^2$ and $\sigma_{2i}^2$ are the variances of w1i and w2i with estimators $s_{1i}^2$ and $s_{2i}^2$ respectively. If the hypothesis of identity is valid, then the maximum likelihood and Least Square Method estimator of pi,i=1,...,r, is

\hat{p}_i=\frac{w_{1i}W_1/s_{1i}^2+w_{2i}W_2 /s_{2i}^2}{W_1^2/s_{1i}^2+W_2^2/s_{2i}^2} .
We may then use the test statistic

X^2=\sum_{i=1}^{r}{\frac{(w_{1i}-W_1\hat{p}_i)^2}{s_{1i}^2}}
+\sum_{i=1}^{r}{\frac{(w_{2i}-W_2\hat{p}_i)^2}{s_{2i}^2}}=\sum _{i=1}^{r}{\frac{(W_1w_{2i}-W_2w_{1i})^2}{W_1^2s_{2i}^2+W_2^2s_{1i}^2}} X^2=\sum_{i=1}^{r}{\frac{(w_{1i}-W_1\hat{p}_i)^2}{s_{1i}^2}}
+\sum_{i=1}^{r}{\frac{(w_{2i}-W_2\hat{p}_i)^2}{s_{2i}^2}}=\sum _{i=1}^{r}{\frac{(W_1w_{2i}-W_2w_{1i})^2}{W_1^2s_{2i}^2+W_2^2s_{1i}^2}}
and it has approximately a  $\chi^2_{(r-1)}$ distribution [2]. The normalized or studentised residuals [6]

 r_i=\frac{w_{1i}-W_1\hat{p}_i}{s_{1i}\sqrt{1-1/(1+W_2^2s_{1i}^2/W_1^2s_{2i}^2)}}
have approximately a normal distribution with mean equal to 0 and standard deviation 1. A recommended minimal expected frequency is equal to 10 for the proposed test.

Numerical examples

The method described herein is now illustrated with an example. We take a distribution

\phi(x)=\frac{2}{(x-10)^2+1}+\frac{1}{(x-14)^2+1}          (1)
defined on the interval [4,16]. Events distributed according to the formula (1) are simulated to create the unweighted histogram. Uniformly distributed events are simulated for the weighted histogram with weights calculated by formula (1). Each histogram has the same number of bins: 20. Fig. 1 shows the result of comparison of the unweighted histogram with 200 events (minimal expected frequency equal to one) and the weighted histogram with 500 events (minimal expected frequency equal to 25)

fig1
Fig 1. An example of comparison of the unweighted histogram with 200 events and the weighted histogram with 500 events: a) unweighted histogram; b) weighted histogram; c) normalized residuals plot; d) normal Q-Q plot of residuals.

The value of the test statistic X2 is equal to 21.09 with p-value equal to 0.33, therefore the hypothesis of identity of the two histograms can be accepted for 0.05 significant level. The behavior of the normalized residuals plot (see Fig. 1c) and the normal Q-Q plot (see Fig. 1d) of residuals are regular and we cannot identify the outliers or bins with a big influence on X2.

The second example presented the same two histograms but 17 events was added to content of bin number 15 in unweighted histogram. Fig. 2 shows the result of comparison of the unweighted histogram with 217 events (minimal expected frequency equal to one) and the weighted histogram with 500 events (minimal expected frequency equal to 25)

fig1_bad
Fig 2. An example of comparison of the unweighted histogram with 217 events and the weighted histogram with 500 events: a) unweighted histogram; b) weighted histogram; c) normalized residuals plot; d) normal Q-Q plot of residuals.

The value of the test statistic X2 is equal to 32.33 with p-value equal to 0.029, therefore the hypothesis of identity of the two histograms is rejected for 0.05 significant level. The behavior of the normalized residuals plot (see Fig. 2c) and the normal Q-Q plot (see Fig. 2d) of residuals are not regular and we can identify the outlier or bin with a big influence on X2.

References

[1] Pearson, K., 1904. On the Theory of Contingency and Its Relation to Association and Normal Correlation. Drapers' Co. Memoirs, Biometric Series No. 1, London.

[2] Gagunashvili, N., 2006. $\chi^2$ test for comparison of weighted and unweighted histograms. Statistical Problems in Particle Physics, Astrophysics and Cosmology, Proceedings of PHYSTAT05, Oxford, UK, 12-15 September 2005, Imperial College Press, London, 43-44.
    Gagunashvili,N., Comparison of weighted and unweighted histograms, arXiv:physics/0605123, 2006.

[3] Cramer, H., 1946. Mathematical methods of statistics. Princeton University Press, Princeton.

[4] Haberman, S.J., 1973. The analysis of residuals in cross-classified tables. Biometrics 29, 205-220.

[5] Lewontin, R.C. and Felsenstein, J., 1965. The robustness of homogeneity test in 2 × N tables. Biometrics 21, 19-33.

[6] Seber, G.A.F., Lee, A.J., 2003, Linear Regression Analysis. John Wiley & Sons Inc., New York.

New package spectrum

A new package spectrum is introduced with its own library libSpectrum. The classes TSpectrum and TSpectrum2 previously in libHist have been moved to this new library.

Several enhancements to TSpectrum::Search and TSpectrum::Background with several new options. Same options in TSpectrum2.

New classes added to this package:


Changes to the TMatrix classes

Previously, the matrix package contained a large amount of ASSERT statements which are a nuisance for programs analyzing a series of independent events like in high-energy physics . Assert's were issued when for instance a division by zero was requested or a matrix was invalid . Most algorithms made matrices/vectors invalid after an error occured in an operation , like inversion of a singular matrix . Unfortunately, not all assert's were accompanied by error messages .

This situation has been completely overhauled :

In the past the result of an inversion could be checked through the value of the returned determinant or checking whether the inverted matrix was valid . Since from now on, we never make the matrix invalid in this operation, the latter check will not indicate a singular matrix anymore .

The decompostion classes TDecomp... have a backward-compatible change in the interface which makes detection of singularity easier :

	   old interface :

	         void         Invert    (TMatrixD &inv);
	         TMatrixD Invert    ();

	   new interface :

	         Bool_t      Invert    (TMatrixD &inv);
	         TMatrixD Invert    (Bool_t &status);
	         TMatrixD Invert    () { Bool_t status; return Invert(status);
	}
The returned status is kFALSE in case of singularity . The old situation is easily reproduced by setting the ROOT variable gErrorAbortLevel to kError . This cause an exception when there is an error message (Error...) ., In the past the matrix would be made invalid which would cause the next operation to throw an exception .

Reflex

Non backwards compatible API changes

Backwards compatible API changes (additions)

Changes in the source (patches)

Changes concerning dictionary generation via genreflex


Cintex

Changes in the source (patches)


GUI

Qt BNL Interface


OpenGL

New classes:

  1. TGLBoxPainter - implements "glbox" option for TH3, shows bin contents as boxes, which sizes are proportional to bin content. "glbox1" is the same, as previous, but with spheres instead of boxes. Slices (XOY/YOZ/XOZ) are now drawn as sets of rectangles.

  2. TGLLegoPainter. Changes: removed all stuff, which works with gl projections, modelview transformations, textures, etc.

  3. TGLPlotPainter. Added common parts of different painters: generic Paint function, PlotSelected, etc.

  4. TGLOrthoCamera. Added operations, required by gl hist painters.

  5. TGLHistPainter. Class completely changed (previously known as TGLPadHistPainter).

  6. TGLPlotBox. New class, draws back box for different kinds of plots, highlights planes which are under cursor, makes some sizes calculations (converts 3d into 2d coords) etc.

  7. TGLSurfacePainter. New class, for different surf options. Supports cartesian, polar, cylindrical and spherical coords. Slices (XOY, YOZ, XOZ), projections.

  8. TGLTF3. New class, draws TF3. No slices available now.

  9. TGLUtil. Added new auxilary classes TGLLevelPalette, TGL2DArray, functions, required by different plot painters, TGLEnableGuard and TGLDisableGuard removed from RootGL namespace into global namespace.

Dynamic slicing

Mods for box painter, adding dynamic slicing for TH3 hist. try $ROOTSYS/tutorials/gl/glbox.C

TGLPolyLine

Line width now properly handled.

TASImage

Animated GIF

Add possibility to create an animated GIF file from canvas (in both GUI and batch mode).

It's possible to Print pad into an animated GIF file by specifying the file name as myfile.gif+ or myfile.gif+NN , where NN is the delay for displaying subimages during animation in 10ms units. If NN is ommitted the animation will be infinite.

        for (int i=0; i<10; ++i) {
           // fill canvas for context
           // ...
           c1.Print("file.gif+");  // print canvas to GIF file
        }// end loop

Other items


Basic Graphics

TGraph

TMultiGraph

New method: Add(TMultiGraph *multigraph, Option_t *chopt=""); it allows to add all the graphs in "*multigraph" in the current MultiGraph.

Example:

        {
           float x1[] = {1,2,3}; float y1[] = {4,7,6};
           float x2[] = {3,5,6}; float y2[] = {0,9,4};
           float x3[] = {7,8,9}; float y3[] = {1,2,4};
           float x4[] = {0,6,5}; float y4[] = {5,2,7};

           TGraph *gr1 = new TGraph(3,x1,y1);
           TGraph *gr2 = new TGraph(3,x2,y2);
           TGraph *gr3 = new TGraph(3,x3,y3);
           TGraph *gr4 = new TGraph(3,x4,y4);

           TMultiGraph *mg1 = new TMultiGraph();
           mg1->Add(gr1); mg1->Add(gr2);
           TMultiGraph *mg2 = new TMultiGraph();
           mg2->Add(gr3); mg2->Add(gr4);
           mg2->Add(mg1); // mg2 now contains gr1 gr2 gr3 and gr4

           mg2->Draw("AL*");
        }

TBox

Changes in TBox::Draw and TBox::PaintBox: if the box has no fill style (ie fill style=0), the box contour is drawn if the box has a fill style, the box contour is not drawn by default. to force the contour to be drawn, specify option "l"

TGraphPolar

New version done by Matthieu Demaret (Summer Student). It includes: Example:

TPad

In TPad::PaintBox, implement a new option "l" If this option is specified the contour of the box is also drawn when the box has a fillstyle specified non null.

TGaxis

TPie

New classe drawing a pie chart.

Example: $ROOTSYS/tutorials/graphics/piechart.C

void piechart()
{
   // Pie chart example.
   //Authors: Olivier Couet, Guido Volpi
   
   Float_t vals[] = {.2,1.1,.6,.9,2.3};
   Int_t colors[] = {2,3,4,5,6};
   Int_t nvals = sizeof(vals)/sizeof(vals[0]);

   TCanvas *cpie = new TCanvas("cpie","TPie test",700,700);
   cpie->Divide(2,2);

   TPie *pie1 = new TPie("pie1","Pie with offset and no colors",nvals,vals);
   TPie *pie2 = new TPie("pie2","Pie with radial labels",nvals,vals,colors);
   TPie *pie3 = new TPie("pie3","Pie with tangential labels",nvals,vals,colors);
   TPie *pie4 = new TPie("pie4","Pie with verbose labels",nvals,vals,colors);

   cpie->cd(1);
   pie1->SetAngularOffset(30.);
   pie1->SetEntryRadiusOffset( 4, 0.1);
   pie1->SetRadius(.35);
   pie1->Draw("3d");

   cpie->cd(2);
   pie2->SetEntryRadiusOffset(2,.05);
   pie2->SetEntryLineColor(2,2);
   pie2->SetEntryLineWidth(2,5);
   pie2->SetEntryLineStyle(2,2);
   pie2->SetEntryFillStyle(1,3030);
   pie2->SetCircle(.5,.45,.3);
   pie2->Draw("r");

   cpie->cd(3);
   pie3->SetEntryVal(0,.8);
   pie3->SetLabelsOffset(-.1);
   pie3->Draw("3d t nol");

   cpie->cd(4);
   pie4->SetRadius(.2);
   pie4->SetLabelsOffset(.01);
   pie4->SetLabelFormat("#splitline{%val (%perc)}{%txt}");
   pie4->Draw("nol");
}

THistPainter

TSpectrum2Painter

spectrumpainter is a new package for surface and contours drawing. This new package is automatically called by THistpainter::Paint when drawing a TH2 with the "SPEC" option. For more details about the option, see TSpectrum2Painter::PaintSpectrum.

Example:

        {
           // Examples showing how to use TSpectrum2Painter (the SPEC option)

           TH2 *h2 = new TH2F("h2","h2",40,-8,8,40,-9,9);
           Float_t px, py;
           for (Int_t i = 0; i < 50000; i++) {
              gRandom->Rannor(px,py);
              Float_t random = gRandom->Rndm(1);
              h2->Fill(px,py);
              h2->Fill(px+4,py-4,0.5);
              h2->Fill(px+4,py+4,0.25);
              h2->Fill(px-3,py+4,0.125);
           }

           TCanvas *c1 = new TCanvas("c1","Illustration of 2D graphics",10,10,800,700);
           c1->Divide(2,2);

           c1->cd(1);
           h2->Draw("SPEC dm(2,10) zs(1)");
           c1->cd(2);
           h2->Draw("SPEC dm(1,10) pa(2,1,1) ci(1,4,8) a(15,45,0)");
           c1->cd(3);
           h2->Draw("SPEC dm(2,10) pa(1,1,1) ci(1,1,1) a(15,45,0) s(1,1)");
           c1->cd(4);
           h2->Draw("SPEC dm(1,10) pa(2,1,1) ci(1,4,8) a(15,45,0) cm(1,15,4,4,1) cg(1,2)");
        }

PostScript/PDF

Miscellaneous

TGraph

Several improvements in the exclusion zone algorithm (PaintPolyLineHatches):

TMultiGraph

New method: Add(TMultiGraph *multigraph, Option_t *chopt=""); it allows to add all the graphs in "*multigraph" in the current MultiGraph. Example:
	 {
	    float x1[] = {1,2,3}; float y1[] = {4,7,6};
	    float x2[] = {3,5,6}; float y2[] = {0,9,4};
	    float x3[] = {7,8,9}; float y3[] = {1,2,4};
	    float x4[] = {0,6,5}; float y4[] = {5,2,7};
	
	    TGraph *gr1 = new TGraph(3,x1,y1);
	    TGraph *gr2 = new TGraph(3,x2,y2);
	    TGraph *gr3 = new TGraph(3,x3,y3);
	    TGraph *gr4 = new TGraph(3,x4,y4);
	
	    TMultiGraph *mg1 = new TMultiGraph();
	    mg1->Add(gr1); mg1->Add(gr2);
	    TMultiGraph *mg2 = new TMultiGraph();
	    mg2->Add(gr3); mg2->Add(gr4);
	    mg2->Add(mg1); // mg2 now contains gr1 gr2 gr3 and gr4
	
	    mg2->Draw("AL*");
	 }

TBox

Changes in TBox::Draw and TBox::PaintBox: if the box has no fill style (ie fill style=0), the box contour is drawn if the box has a fill style, the box contour is not drawn by default. to force the contour to be drawn, specify option "l"

TPad

In TPad::PaintBox, implement a new option "l" If this option is specified the contour of the box is also drawn when the box has a fillstyle specified non null.

TGaxis

PaintAxis takes into account the timezone offset for the current location. This fixes the bug: http://savannah.cern.ch/bugs/?20056. All standard time axis the tests are running correctly.

THistPainter

PostScript

In DrawPolyMarker the line style and line width were not correctly reset.

stressGraphics

TH1

TH1 Revision 1.302, (To allow, in TH1::Draw, the option "same" if a canvas does not exist or is empty) had a side effect: the macro $ROOTSYS/tutorials/transpad.C did not work anymore. Now, the condition to remove the option "same" is now more strict: if gPad does not have the default range we keep the option.

New tutorials

New macro gldemos.C. It displays help on the GL features and access all the GL demos with a small GUI (like demos.C). GL macros have been updated also.

New features in the Geometry classes

Support for radionuclides

A new class TGeoElementRN was introduced in this version to provide support for radioactive nuclides and their decays. A database of 3162 radionuclides can be loaded on demand via the table of elements (TGeoElementTable class). One can make then materials/mixtures based on these radionuclides and use them in a geometry:

    root [1] TGeoManager *geom = new TGeoManager("geom", "test radionuclides");

    root [2] TGeoElementTable *table = geom->GetElementTable();
    root [3] TGeoElementRN *c14 = table->GetElementRN(14,6);  // A,Z
    root [4] c14->Print();

6-C-014      ENDF=60140; A=14; Z=6; Iso=0; Level=0[MeV]; Dmass=3.0199[MeV]; Hlife=1.81e+11[s]
             J/P=0+; Abund=0; Htox=5.8e-10; Itox=5.8e-10; Stat=0
Decay modes:
BetaMinus            Diso:   0 BR:   100.000% Qval: 0.1565

    root [5] TGeoMaterial *mat = new TGeoMaterial("C14", c14, 2.0);

The following properties of radionulides can be currently accessed via getters in the TGeoElementRN class:
The radioactive decays of a radionuclide are represented by the class TGeoDecayChannel and they are stored in a TObjArray. A decay provides:
Radionuclides are linked one to each other via their decays, until the last element in the decay chain which must be stable. One can iterate decay chains using the iterator TGeoElemIter:

    root [6] TGeoElemIter next(c14);

    root [7] TGeoElementRN *elem;
    root [8] while ((elem=next())) next.Print();

6-C-014 (100% BetaMinus) T1/2=1.81e+11
 7-N-014 stable

To create a radioactive material based on a radionuclide, one should use the constructor:

   TGeoMaterial(const char *name, TGeoElement *elem, Double_t density)

To create a radioactive mixture, one can use radionuclides as well as stable elements:
 
   TGeoMixture(const char *name, Int_t nelements, Double_t density);
   TGeoMixture::AddElement(TGeoElement *elem, Double_t weight_fraction);

Once defined, one can retrieve the time evolution for the radioactive  materials/mixtures by using one of the 2 methods:

  1.    void TGeoMaterial::FillMaterialEvolution(TObjArray *population,  Double_t   precision=0.001)
Material evolution
To use this method, one has to provide an empty TObjArray object that will be filled with all elements coming from the decay chain of the initial radionuclides contained by the material/mixture. The precision represent the cumulative branching ratio for which decay products are still considered.
The population list may contain stable elements as well as radionuclides, depending on the initial elements. To test if an element is a radionuclide:

   Bool_t TGeoElement::IsRadioNuclide() const

All radionuclides in the output population list have attached objects that represent the time evolution of their fraction of nuclei with respect to the top radionuclide in the decay chain. These objects (Bateman solutions) can be retrieved and drawn:

   TGeoBatemanSol *TGeoElementRN::Ratio();
    void TGeoBatemanSol::Draw();

Another method allows to create the evolution of a given radioactive material/mixture at a given moment in time:

  1.    TGeoMaterial::DecayMaterial(Double_t time, Double_t precision=0.001)

The method will create the mixture that result from the decay of a initial material/mixture at time, while all resulting elements having a fractional weight less than precision are excluded.
A demo macro for radioactive material features can be found in $ROOTSYS/tutorials/RadioNuclides.C

Mixture evolution

GDML

GDML Import/Export

The current Python implementation has been removed and replaced with a fully integrated C++ interface. The TGDMLParse class imports GDML files into ROOT through the TGeoManager::Import("*.gdml") method. The old python interface worked well. However, the import process was far too slow, in comparison to the import of .C files into ROOT. The new interface has shown great results, dependent on the geometry structure, of up to a factor 10 decrease in time to import a GDML file. Mathematical constants for the Import are now used from the TMath Class and are no longer separately specified, providing consistency with ROOT. The Python scripts remain for the Export of GDML, however this script has been slightly modified and optimised to improve and decrease the Export time by up to a factor 15.

Modular GDML Import

GDML Files can now be imported in Modular Form using the 'file' tag. The tag is used within the Physical Volume ('physvol') node, and replaces the replaces the volume reference ('volumeref') tag. By default the volume referenced instead will be the top (world) volume of the geometry file specified in the file tag. Filenames are specified using the 'name' attribute of the File tag. If the volume you wish to reference to the physical volume is contained within the specified geometry file, but is not the top volume, this can be done using the 'volname' attribute of the file tag. This attribute is optional and when not specified the top volume is defaulted. Files you use in this tag have to be fully independent GDML files. Eg. They can be imported and visualised individually if required. This is an example of how the tag appears:
< file name="abc.gdml" volname="volume123" />

New tutorials



ROOT page - Class index - Top of the page