ROOT Version 5.16/00 Development Notes
ROOT version 5.16/00 has been released June 29, 2007.
Binaries for all supported platforms are available at:
http://root.cern.ch/root/Version516.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,
Toby Burnett,
Philippe Canal,
Federico Carminati,
Olivier Couet,
Jason Detwiler,
Valeri Fine,
Leo Franco,
Markus Frank,
Gerri Ganis,
Andrei Gheata,
Mihaela Gheata,
Jan Iwaszkiewicz,
Anna Kreshuk,
Wim Lavrijsen,
Kerry Lee,
Josef Leydold,
Sergei Linev,
Ben Lloyd,
Pere Mato,
Diego Marcos-Segura,
Lorenzo Moneta,
Axel Naumann,
Jan Fiete Grosse-Oetringhaus,
Eddy Offermann,
Valeriy Onuchin,
Timur Pocheptsov,
Fons Rademakers,
Stefan Roiser,
Paul Russo,
Scott Snyder,
Alja Tadel,
Matevz Tadel,
Jakob van Santen,
Guido Volpi
¡¡WARNINGS!! Important Changes in the dire
ctories structure: ¡¡WARNINGS!!
In an effort to reduce the coupling between modules and also reduce the compi
lation
time, we have reorganized some important directories. The executable module r
oot.exe is now
linked only with -lCore -lCint -lRint,
but not anymore with -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -l
Matrix -lPhysics.
When a script (or command) references a class in another ROOT library,
this library is autloaded by the system.
This is achieved using rootmap files.
Each library comes with its own rootmap file, describing which classes are conta
ined
in the library and what other libraries the library depends on.
This allows ROOT to load all the necessary libraries when CINT sees a class name
that is mentioned in one of the rootmap files.
This mechanism currently only works for classes; we plan to expand it to cover a
t least typedefs, too.
You can build your own rootmap file using the rlibmap utility in $ROOT
SYS/bin.
Given the library libMyLib.so which is linked against libHist.so, and for which
a dictionary was built
using include/MyLibLinkDef.h, one would run:
rlibmap -f -o lib/libMyLib.rootmap -l lib/libMyLib.so -d libHist -c include
/MyLibLinkDef.h
From now on, libMyLib will be automatically loaded whenever CINT sees any of th
e classes mentioned
in include/MyLibLinkDef.h.
However, when working with compiled code, the reference
d libraries must be loaded
before executing the corresponding compiled script or code.
This is because compiled code depends on the libraries via the operation system
(the linker, to be exact)
- CINT and ROOT cannot help there.
Nothing was changed with respect to that, except for the number and names of lib
raries that will have to be used for linking.
Note that we strongly recommend to use the root-config utility
to be protected against these kinds of changes.
If you use it, you will not see any changes in this release.
For instance to compile and link your application (with GCC) you can do somethin
g like:
g++ -o myapp.exe myapp.cxx `root-config --cflags --libs`
We have also started a major exercise aiming at
a considerable reduction in size of the dictionaries (generated code and memory). The picture below shows
the evolution of the virtual memory and memory heap use with the various versions of the system released
since 3 years. We expect that for the next production release (December) another substantial reduction
in size of the code generated for the dictionaries.
New math directory
The new math directory includes the following classes previously in base.
- TComplex
- TMath
- TRandom
- TRandom1
- TRandom2
- TRandom3
We are planning to add to this directory several classes currently in MathCore.
The new library is not used by libCore. It is automatically linked
when a class like TMath, TRandom is referenced in an interactive application.
A new file TMathBase.h has been created in base. It contains
some frequently used functions (min,max,abs,range) for scalar or vectors
that are unfortunately not provided in a standard way by all our supported platforms.
TMathBase is in namespace TMath. TMathBase.h is included by TMath.h.
This separation of TMath in the new library may have some side-effects if you were
assuming that TMath.h was included via a class like TNamed or TObject or TH1.
Now, you may have to include explicitely TMath.h in your source file.
New io directory
The new directory io includes all the ROOT classes to do basic Input/Output.
With this release, the classes in this directory are still included in libCore.
The new library libRIO contains on the I/O classes. It is dynamically
linked by applications referencing the I/O classes in this directory.
The class TDirectory is now a pure abstract interface. The new class TDirectoryFile
derives from TDirectory and implement the real I/O functions. TFile derives
from TDirectoryFile instead of TDirectory.
This change may be backward incompatible if your application creates
directly a TDirectory object. If this is the case, you should replace the call to TDirectory by TDirectoryFile
and include TBufferFile.h instead of TBuffer.h.
The class TBuffer is also a pure abstract interface. The class TBufferFile
includes all the function implementations previously in TBuffer, plus a few more
functions that became necessary with the directory restructure.
This change may be backward incompatible if your application creates
directly a TBuffer object. If this is the case, you should replace the call to TBuffer by TBufferFile
and include TBufferFile.h instead of TBuffer.h.
In case you have to maintain code using old and new versions, you can do something like:
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,0)
#include <TBufferFile.h>
#else
#include <TBuffer.h>
#endif
...
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,15,0)
TBufferFile b(TBuffer::kWrite,10000);
#else
TBuffer b(TBuffer::kWrite,10000);
#endif
The macros ROOT_VERSION_CODE and ROOT_VERSION are defined in RVersion.h included by all ROOT headers.
Introduce a new utility class (TCollectionProxyInfo) to allow the
delaying of the creation of the CollectionProxy object until they
are really needed. This also allows to remove the dependency
of the dictionaries on the I/O library.
net directory changes with new library libNet
The classes in the directory net are not referenced anymore by libCore.
They are dynamically linked if referenced in an interactive application.
You should explicitely link with libNet if you use of the these
classes in a batch application.
Changes in graf
The class TView is now an abstract interface and it has been moved to the directory gpad.
All calls like
TView *view = new TView(1);
must be replaced by
TView *view = TView::CreateView(1);
Changes in cont
The classes in the old cont directory dealing with I/O have been moved
to the new directory io. the new cont directory does not depend
anymore on the I/O sub-system.
Changes in meta
The classes in the old meta directory dealing with I/O have been moved
to the new directory io. the new meta directory does not depend
anymore on the I/O sub-system.
Changes in base
The class TMath, TRandom, TRandom1, TRandom2 and TComplex have been moved to
the new math directory.
The new directory base is not dependent on the I/O classes,
the math classes or network classes
The class TView has been moved to directory gpad.
The single $ROOTSYS/etc/system.rootmap has been replaced by individual rootmap files associated
to each library and stored in the $ROOTSYS/lib directory. These rootmap files are automatically
build when running "make". The extra "make map" step is not needed anymore. This change should fix
a large number of problems due to missing or not up-to-date rootmap file.
General cleanup with include files
We have taken advantage of this reorganization to remove unnecessary includes
from many classes and to use forward references instead.
Changes in some files automatically included at startup
The main interactive class TRint was loading by default a set of frequently used
includes like iostream, string, vector, pair.
When the interactive ROOT starts, it can automatically load some frequently
used includes. However, this introduces several overheads
- A long list of cint and system files must be kept open during the session
- The initialisation takes more time (noticeable when using gdb or valgrind)
- Memory overhead of about 5 Mbytes (1/3 of the ROOT executable) when including vector.
In your system.rootrc file, you can set the variable below to 0 to disable the loading of these includes at startup
Rint.Includes: 0
You can set the variable to 1 (default) to load only iostream , string and RTypesCint.h.
You can set it to 2 to load in addition vector and pair.
We strongly recommend setting the variable to 2 if your scripts include vector.
and you execute your scripts multiple times.
Changes in rootcint
When generating the code for the automatic Streamer functions, rootcint generates now
the following code:
void Myclass::Streamer(TBuffer &R__b)
{
// Stream an object of class Myclass.
if (R__b.IsReading()) {
R__b.ReadClassBuffer(Myclass::Class(),this);
} else {
R__b.WriteClassBuffer(Myclass::Class(),this);
}
}
instead of
void Myclass::Streamer(TBuffer &R__b)
{
// Stream an object of class Myclass.
if (R__b.IsReading()) {
Myclass::Class()->ReadBuffer(R__b,this);
} else {
Myclass::Class()->WriteBuffer(R__b,this);
}
}
I/O
- New version of TRFIOFile and TCastorFile supporting Castor 2.1.2-4 .
- Added in TCastorFile the possibility to choose the authentication method via URL-option '&rootAuth=3' (or the environment variable ROOTCASTORAUTH) to allow using GSI/Globus authentication.
- New generic class TFileStager defining the interface to a generic stager.
To issue a stage (prepare) request one has to do the following
// Open connection to the stager
root[] stg = TFileStager::Open("root://lxb6046.cern.ch")
// Issue a stage request
root[] stg->Stage("/alice/sim/2006/pp_minbias/121/168/root_archive.zip")
// Check the status
root[] stg->IsStaged("/alice/sim/2006/pp_minbias/121/168/root_archive.zip")
- New class TXNetFileStager, concrete implementation of TFileStager talking to xrootd.
-
New static function TFile::Cp() which allows any files (also non-ROOT files)
to be copied via any of the many ROOT remote file access plugins.
-
TFile::Open() has now the new option "CACHEREAD" which will
first use TFile::Cp() to copy the file locally to a cache directory and
then open the local cache file. If the remote file already exists in the cache
this file will be used directly, unless the remote file has changed.
For example:
root [0] TFile::SetCacheFileDir("/tmp/fons")
root [1] TFile *f = TFile::Open("http://root.cern.ch/files/aleph.root", "CACHEREAD")
[TFile::Cp] Total 0.11 MB |====================| 100.00 % [8.8 MB/s]
Info in <TFile::Open>: using local cache copy of http://root.cern.ch/files/aleph.root [/tmp/fons/files/aleph.root]
root [2] f->GetName()
(const char* 0x41dd2d0)"/tmp/fons/files/aleph.root"
To shrink the cache use TFile::ShrinkCacheFileDir().
- Add support for TBuffers operator<< and operator>> from the command
line.
- Make sure we are not using a slot number rendered obsolete by an
increase of the size of the TExMap. This prevents the error message:
'Error in <TExMap::Expand>: slot 25085 not empty (should never
happen)
seen by Minos and STAR. (The only side effect was a possible increase of
the data on file due to object duplication).
- Add code to allow the schema evolution from a container of double to
the _same_ container of Double32_t and vice et versa.
- In ShowMember, std::string no longer need a special case. This fix
enable I/O for C-style array of strings.
- Add I/O support for a varying length array of polymorphic
pointers to objects.
Int_t fN;
MyClass** fAry; //[fN]
MyClass** fAryAry[10]; //[fN]
fAry = new MyClass*[fN];
fAryAry[0] = new MyClass*[fN];
fAry[0] = new MyClass;
fAry[1] = new DerivedFromMyClass;
fAryAry[0][0] = new MyClass;
fAryAry[0][1] = new DerivedFromMyClass;
This is implemented using a different file format for data member
which are variable size arrays of pointers to objects.
- Extend the functionality of TDirectory::TContext
The TContext objects will not longer cd back to a directory
that was deleted between creation and their deletion.
For example:
f->cd();
{
TDirectory::TContext ctxt(0);
.... do something that change gDirectory.
delete f;
}
In the prevision implementation this lead to a f->cd() (i.e. core dump).
In the new implementation this leads to a gROOT->cd().
With this improvement we now strong recomment to switch code pattern
similar to:
TDirectory *cursav = gDirectory;
... do something that changes gDirectory;
if (cursav) cursav->cd();
(which also leads to a core dump if cursav is directly or indirectly deleted)
to:
TDirectory::TContext ctxt(0);
... do something that changes gDirectory;
TWebFile
The class TWebFile has been modified to work with any web server without the need of a special plug-in
as it was the case before. You can now connect to any ROOT file visible via a web server, eg
TFile f("http://root.cern.ch/files/alice.root");
This new feature is of particular interest when used in connection with the TGHtml class described
in a section later in these notes.
TTree
In TBranchElement, fix a problem when calculating the address of an base
class
when it happens to be a STL collection (and split). This affected ATLAS in
particular.
When the master tree of a tree 'clone' relationship is deleted, we need
now properly reset the address of only cloned branches in clone tree.
The branch that have been added by hand by the user in the clone tree are
now untouched. Also the branches of TNtuple are now properly reset to
their default values (instead of a new memory area).
New Class TEntryList
TEntryList is a new class, with functionality similar to TEventList. The main differences are:
- For TTree: more compact storage of entry numbers.
- For TChain: unlike the TEventList, TEntryList doesn't store global entry numbers, but has a
TList of TEntryLists for each TTree of the TChain.
- Merging 2 entry lists: if 2 lists are for the same tree, their contents are added, like it
was for TEventLists. If the lists are for different trees, their sum is a TEntryList for a TChain,
consisting of those 2 trees.
- If there is a TEntryList for a TChain, sublists for individual TTrees can be extracted and used
on their own or processed independently.
Saving the result of Draw to a TEventList or a TEntryList
TTree::Draw(const char* varexp, const char* selection, Option_t* option)
can be used to fill a TEventList or a TEntryList object (list of entry numbers).
If varexp has the form >>elist , a TEventList object named "elist"
is created in the current directory. elist will contain the list
of entry numbers satisfying the current selection.
If option "entrylist" is used, a TEntryList object is created
Example:
tree.Draw(">>yplus","y>0")
will create a TEventList object named "yplus" in the current directory.
tree.Draw(">>yplus", "y>0", "entrylist")
will create a TEntryList object named "yplus" in the current directory.
In an interactive session, one can type (after TTree::Draw)
yplus.Print("all")
to print the list of entry numbers in the list.
By default, the specified entry list is reset.
To continue to append data to an existing list, use "+" in front
of the list name;
tree.Draw(">>+yplus","y>0")
will not reset yplus, but will enter the selected entries at the end
of the existing list.
WARNING:: Future changes after this release
In this release version, when an argument of the form >>elist is passed
to TTree::Draw(), by default a TEventList object is created.
After this
release the default will be changed to
TEntryList!
This will require the
following changes in the user code:
Same as before:
tree.Draw(">>elist", "some cut"); //same as before;
but afterwards use
TEntryList *el = (TEntryList*)gDirectory->Get("elist");
instead of
TEventList *el = (TEventList*)gDirectory->Get("elist");
Using a TEventList or a TEntryList as Input
Once a TEventList or a TEntryList object has been generated, it can be used as input
for TTree::Draw. Use TTree::SetEventList or TTree::SetEntryList to set the
current event list
- Example1:
TEventList *elist = (TEventList*)gDirectory->Get("yplus");
tree->SetEventList(elist);
tree->Draw("py");
- Example2:
TEntryList *elist = (TEntryList*)gDirectory->Get("yplus");
tree->SetEntryList(elist);
tree->Draw("py");
If a TEventList object is used as input, a new TEntryList object is created
inside the SetEventList function. In case of a TChain, all tree headers are loaded
for this transformation. This new object is owned by the chain and is deleted
with it, unless the user extracts it by calling GetEntryList() function.
See also comments to SetEventList() function of TTree and TChain.
If arrays are used in the selection critera, the entry entered in the
list are all the entries that have at least one element of the array that
satisfy the selection.
Example:
tree.Draw(">>pyplus","fTracks.fPy>0");
tree->SetEventList(pyplus);
tree->Draw("fTracks.fPy");
will draw the fPy of ALL tracks in event with at least one track with
a positive fPy.
To select only the elements that did match the original selection
use TEventList::SetReapplyCut or TEntryList::SetReapplyCut.
Example:
tree.Draw(">>pyplus","fTracks.fPy>0");
pyplus->SetReapplyCut(kTRUE);
tree->SetEventList(pyplus);
tree->Draw("fTracks.fPy");
will draw the fPy of only the tracks that have a positive fPy.
Note: Use tree->SetEventList(0) if you do not want use the list as input.
New Class TEntryListFromFile
This is a utility class, called by TChain::SetEntryListFile() function.
Use case: suppose the user has TEntryLists, corresponding to files
of the TChain, each in a separate file. This class allows to load the
lists in memory one by one, in the same way that the TChain loads
its TChainElements. If a file with an entry list, corresponding to a
chain element, is not found, it's skipped (with a warning) and the
chain processing continues on the next element. See class description
and the TChain::SetEntryListFile() function comments for more details.
Base
- On MacOS we can not keep track of the dependencies of the library
generated by ACLiC via an hard link (because we do not produce the dylib).
So now, on MacOS, we keep track of those dependencies using a rootmap file
(named MyScript_cxx.rootmap for MyScript.cxx).
-
In addition to rootmap_xxx now also xxx.rootmap is supported. Rootmap files
will be loaded strictly in the LD_LIBRARY_PATH order.
-
Improved TThread on Win32, up to 10 times faster in heavy context
switching applications.
-
Add support for Intel icc v10.0 beta.
- TGrid update and new TAlien plugin using TEntryList instead of TEventList.
Meta
Add a new function TClass::Move which, for now, only information the
address registry of emulated object of the object move ... later this
should be enhanced to really 'move' (as oppose to really on memcpy)
the object from one place to the other. This new function is used
by the Emulated Collection Proxy to properly handle the memory
resizing.
In meta (and TRealData) increase the offset from Int_t to Long_t to
properly support some use case (pyroot) on 64 bits architecture
Improvements in the documentation system class THtml
The class THtml has received a long list of improvements. They are visible in the THtml reference guide.
Some of the highlights are:
- new layout,
- directives that can generate images from Latex ("Begin_Latex"/"End_Latex") or macro calls ("Begin_Macro"/"End_Macro").
Over time, this will replace the static GIF files used for documentation.
Examples are TAttText, TH1, and TArrowEditor.
- modules (like "CONT") and products are now documented,
- add setters and getters for all members instead of relying on gEnv variables,
- add help for the documentation.
Cint
- Improve memory footprint by making data structures for function parameters and inheritance dynamical. This reduces ROOT's memory usage by 10MB when running e.g benchmarks.C.
- reduced dictionary size by re-using function wrappers for virtual functions,
- 1 dimensional arrays and scalars are now properly distinguished,
- improved re-loading of libraries. Occasional TPluginManager's "wrong number of arguments" should be gone, number of crashes when reloading libraries or macros should be decreased dramatically.
- Implement forward declarations for dictionaries: when initializing the dictionary for the function A* f() don't load the dictionary (and thus library) for "A". E.g. libTreePlayer will not be loaded just because libTree was loaded; it will still be loaded when needed.
- valgrind / memleak reports fixed,
- no more temp file flooding on windows, rootcint temp files removed.
- Some fixes for the parsing of arguments of templated functions, the quoting of default values of function arguments, partial template specialization, parameter passing by reference, handling of static members when running rootcint, type determination of integer literals, and call wrappers for conversion operators went into this version.
- Since this version genreflex allows classes to be excluded from the rootmap file, useful e.g. for containers of classes that are used for i/o in several libraries. The syntax for selection.xml is <class pattern="aSelectionExample*" rootmap="FALSE"/>
- Increase G__MAXSTRUCT and G__MAXTYPEDEF to 24000. This has no visible effect on the memory used by CINT.
class TH1
A bug has neen fixed in TH1::Rebin and its functionality extended to support
the rebinning of a fixed size bin histogram into a variable bin size histogram.
Improvements in hadd
Add support for indirect files (thanks Toby Burnett).
Wildcarding and indirect files are also supported
hadd result.root myfil*.root
will merge all files in myfil*.root
hadd result.root file1.root @list.txt file2. root myfil*.root
will merge file1. root, file2. root, all files in myfil*.root
and all files in the indirect text file list.txt ("@" as the first
character of the file indicates an indirect file. An indirect file
is a text file containing a list of other files, including other
indirect files, one line per file).
TF1
Extend TF1 by adding these new possibility to construct a TF1 object:
- from a general C++ function object (functor) with parameters. TF1 can be created from any C++ implementing the operator()(double *x, double *p) .
- From a member function with parameters of a general C++ class. Any member function of a class which has the signature of
(double * , double *) and returning a double can be used for creating a TF1.
An example of creating a TF1 from a functor is the following:
class MyFunctionObject {
public:
// use constructor to customize your function object
double operator() (double *x, double *p) {
// function implementation using class data members
}
};
{
....
MyFunctionObject * fobj = new MyFunctionObject(....); // create the function object
TF1 * f = new TF1("f",fobj,0,1,npar,"MyFunctionObject"); // create TF1 class.
.....
}
Here is an example for creating a TF1 from a member function of the class :
class MyFunction {
public:
...
double Evaluate() (double *x, double *p) {
// function implementation
}
};
{
....
MyFunction * fptr = new MyFunction(....); // create the user function class
TF1 * f = new TF1("f",fptr,&MyFunction::Evaluate,0,1,npar,"MyFunction","Evaluate"); // create TF1 class.
.....
}
See the tutorials math/exampleFunctor.C for a running examples of creating a TF1 using these new features.
Add also in TF1 a new function, TF1::IntegralError to calculate the errors on the integral due to the uncertainties of the function parameters obtained from fitting the function to data set. The error is calculated from the covariance matrix from the last fit performed by the function.
class TMinuit
In TMinuit::Contour, the TGraph object with the contour points is now correctly closed.
MathCore
Major changes for this release are:
In addition, the following bugs have been fixed:
- a bug in the conversion from RotationZ to Quaternion
- a bug in the calculation of Et for the LorentzVector based on Pt, Eta, Phi and M.
- a bug in the calculation of eta for large negative values reported by CMS.
More detailed description of the current MathCore release can be found at this location.
SMatrix
Remove the optimized Cramer inversion for 6x6 matrices (symmetric and normal). Use now the standard method used for large matrices (Bunch-Kaufman for the symmetric and LU factorization for the general squared). The Cramer method has been found to be significantly slower on the new 64 bit machines running gcc 3.4.
Fix a bug discovered by LHCb (thanks to W. Hulsbergen) in the += and -= operators for symmetric matrices when using expressions, for examples in operations like: A += B + C;.
More detailed description of the current SMatrix release can be found at this location.
MathMore
New classes KelvinFunctions to calculate the Kelvin functions Ber(x), Bei(x), Ker(x), Kei(x), and their first derivatives. The functions in this class have been imported by Jason Detwiler (jasondet@gmail.com) from CodeCogs. See MathWorld for the definition of the Kelvin functions.
Minuit2
The following fixes have been applied :
- use same convention in counting the iteration in MnLineSearch as in the Fortran version.
- when doing a negative line search at the beginning, use always a step size equal to the step used in the gradient calculation.
- in Fumili the Hesse is now always calculated at the end of the iterations to be sure to get a correct error matrix.
- add the possibility to modify dynamically the error scale definition by adding the FCNBase::SetErrorDef( up) function.
- add support for the "SET Err" command in TFitterMinuit
- multiply the likelihood function used by TFitterMinuit and TFitterFumili by 2 to be consistent with the functions defined in TFitter.
- remove some warning messages and improve the debugging by using the ROOT Error system for the library built in ROOT. In the case of the stand-alone Minuit2 builds use now by default std::cerr.
More detailed description of the current Minuit2 release can be found at this location.
TRandom
A new algorithm for generating random numbers according to the Gaussian distribution has been introduced. The new implementation is based on the acceptance-complement ratio method from W. Hoermann and G. Derflinger from Institut f. Statistik, WU Wien and comes from the UNU.RAN package (from J. Leydold et al.).
The new algorithm is probably one of the fastest currently existing and it is a factor 2/3 times faster than the previous polar method (Box-Muller) used for TRandom::Gaus. The Box-Muller algorithm is still available in the TRandom::Rannor method for generating 2 numbers. The speed is comparable to the Ziggurat method (from Marsaglia) implemented for example in GSL and available in the MathMore library, via ROOT::Math::Random::Gaus.
For example this is obtained running the tutorial math/testrandom.C on a 2.GHz Intel Core Duo running MacOSX and compiled with gcc 4.0:
Distribution microseconds/call
TRandom TRandom1 TRandom2 TRandom3
Gaus (ACR method) 86.000 242.000 92.000 96.000
Gaus (BM method) 246.000 475.000 255.000 257.000
Rannor 141.000 258.000 148.000 147.000
In the case of Rannor, the method is the same of the previous implementation of TRandom::Gaus (BM method), but both numbers required by the polar method are used.
Unuran
The TUnuran class has been modified and extended to use now discrete and empirical distributrions.
The distribution classes for continuous 1D and multi-dimensional distribution have been re-designed and renamed.
In the following is the updated documentation on how to use UNURAN, via the class TUnuran in ROOT:
- using the UNU.RAN native string API for pre-defined distributions
(see UNU.RAN documentation for the string API):
TUnuran unr;
//initialize unuran to generate normal random numbers using a "arou" method
unr.Init("normal()","method=arou");
//......
// sample distributions N times (generate N random numbers)
for (int i = 0; i < N; ++i)
double x = unr.Sample();
-
Using a distribution object we have the following cases according to the type of the distribution:
- For 1D distribution the class TUnuranContDist must be used.
A TUnuranContDist object can be created from a function
providing the pdf (probability density function) and optionally one providing the derivative of the pdf.
If the derivative is not provided and the generation method requires it, then it is estimated numerically.
The user can optionally provide the cdf (cumulative distribution function) via the
TUnuranContDist::SetCdf me, the mode (via TUnuranContDist::SetMode ),
the domain (via TUnuranContDist::SetDomain(min,max) ) for generating numbers in a restricted region,
the area below the pdf (via TUnuranContDist::SetPdfArea ).
Some of this information is required depending on the chosen UNURAN generation method.
//1D case: create a distribution from two TF1 object pointers pdfFunc
TUnuranContDist dist( pdfFunc);
//initialize unuran passing the distribution and a string defining the method
unr.Init(dist, "method=hinv");
// sample distribution N times (generate N random numbers)
for (int i = 0; i < N; ++i)
double x = unr.Sample();
- For multi-dimensional distribution the class TUnuranMultiContDist must be used.
In this case only the multi-dimensional pdf is
required
//Multi-Dim case from a TF1 (or TF2 or TF3) object describing a multi-dimensional function
TUnuranMultiContDist dist( pdfFuncMulti);
// the recommended method for multi-dimensional function is "hitro"
unr.Init(dist, "method=hitro");
// sample distribution N times (generate N random numbers)
double x[NDIM];
for (int i = 0; i < N; ++i)
unr.SampleMulti(x);
- For discrete distribution the class TUnuranDiscrDist must be used.
The distribution can be initialized from a TF1 or from a vector of probabilities.
// create distribution from a vector of probabilities
double pv[NSize] = {0.1,0.2,.......};
TUnuranDiscrDist dist(pv, pv+NSize);
// the recommended method for discrete distribution is
unr.Init(dist, "method=dgt");
// sample N times (generate N random numbers)
for (int i = 0; i < N; ++i)
int k = unr.SampleDiscr();
- For empirical distribution the class TUnuranEmpDist must be used.
In this case one can generate random numbers from a set of data (un-binned or binned) .
The parent distribution is estimated by UNU.RAN using a gaussian kernel smoothing algorithm.
One can create the distribution class directly from a vector of data or from TH1 (using the bins or from its buffer for un-binned data).
// create distribution from a set of data
// vdata is an std::vector containing the data
TUnuranEmpDist dist( vdata.begin(),vdata.end());
unr.Init(dist);
// sample N times (generate N random numbers)
for (int i = 0; i < N; ++i)
double x = unr.Sample();
- Use some predefined distributions, like Poisson and Binomial. This method is more convenient in passing distribution parameters
than using directly the string interface.
TUnuran unr;
//initialize unuran to generate normal random numbers from the Poisson distribution with parameter mu
unr.InitPoisson(mu);
//......
// sample distributions N times (generate N random numbers)
for (int i = 0; i < N; ++i)
int k = unr.SampleDiscr();
Functionality is also provided via the C++ classes for using a different random number generator by passing a
TRandom pointer when constructing the TUnuran class (by default the ROOT gRandom is passed to UNURAN).
TRandom2 r;
// use inside Unuran the TRandom2 (TausWorthe) generator.
TUnuran unr(&r);
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 the various distributions.
UNU.RAN is very efficient in generating random variates when the parameter of the distributions do not vary during the generation. For example these results are obtained from running the tutorial testrandom.C on a 2.GHz Intel Core Duo running MacOSX and compiled with gcc 4.0:
Distribution nanoseconds/call
TRandom TRandom1 TRandom2 TRandom3
Rndm.............. 24.000 137.000 29.000 30.000
RndmArray......... 17.000 128.000 22.000 22.000
Gaus.............. 86.000 242.000 92.000 96.000
Rannor............ 141.000 258.000 148.000 147.000
Landau............ 68.000 173.000 73.000 74.000
Binomial(5,0.5)... 152.000 695.000 171.000 179.000
Binomial(15,0.5).. 414.000 2060.000 480.000 497.000
Poisson(3)........ 212.000 653.000 231.000 234.000
Poisson(10)....... 402.000 1618.000 456.000 460.000
Poisson(70)....... 1225.000 1651.000 1253.000 1250.000
Poisson(100)...... 1233.000 1664.000 1260.000 1262.000
GausTF1........... 210.000 326.000 218.000 216.000
LandauTF1......... 209.000 325.000 217.000 213.000
GausUNURAN........ 90.000 202.000 97.000 96.000
PoissonUNURAN(10). 160.000 361.000 170.000 170.000
PoissonUNURAN(100) 139.000 347.000 148.000 149.000
In this release the version 1.0.1 of UNU.RAN is used.
Geometry Package
Geometry editors
Material and mixture editors
The material editor can be invoked from the TGeoManagerEditor GUI:
TGeoManager *geom = new TGeoManager("","");
geom->Edit();
The material editor reflects now the new properties added to TGeoMaterial: state, temperature and density. All material properties changes are undoable. The mixture editor currently allows adding elements one by one in the mixture composition. This can be done either by element weight fraction or by number of atoms. Once an element was added using one method the other mehod is not selectable anymore. Summing component fractions up to 1 in the final mixture is the user responsability. Adding materials as components of a mixture is not supported in this version.
The elements that were added to the mixture appear in the bottom TGCanvas of the mixture editor. The operations performed on mixture are not undoable.
PROOF
- Added support for processing datasets 'by name', i.e. by just
sending the name of
a dataset known by the PROOF master node. For example, if a the
analysis defined in the TrackAnalysis.C selector has to applied to the
"dc2006" dataset already known to the cluster:
root[]
proof->ShowDataSets()
...
dc2006
then
one can issue just
root[] proof->Process("dc2006", "TrackAnalysis.C")
By default the first TTree
in the top directory of the dataset files is analyzed; one
can specify a different object and/or a different directory using the
syntax "datasetName[#dirInFile/[ObjName]]" where 'ObjName'
specifies the name of the object to be analyzed and 'dirInFile' the
directory in the files where the objects
can be found.
- Added first infrastructure to support for scheduling
and
quota controls:
- possibility to define groups of users;
- simple dynamic scheduler assigning nodes to
the
sessions based on the cluster load;
- worker-level priority-based throttling of sessions
- Reduced memory footprint of proofserv at
startup by a factor 2
- Added possibility to load a macro or a class
(TProof::Load(...))
root [6] p =
TProof::Open("ganis@lxb6043")
root [7]
p->Load("h1analysis.C+")
Info in
<TUnixSystem::ACLiC> on master0: creating shared library
/pool/proofbox/ganis/session-lxb6043-1174331522-13105/master-0-lxb6043-1174331522-13105/./h1analysis_C.so
Info in
<TUnixSystem::ACLiC> on slave0.0: creating shared library
/pool/proofbox/ganis/session-lxb6043-1174331522-13105/worker-0.0-lxb6041-1174331525-26145/./h1analysis_C.so
...
(Int_t)0
root
[8]
- Added possibility to define a list of ROOT
versions
available on the cluster; the list can browsed using the new method
ShowROOTVersions of TProofMgr:
root [0]
TProof::Mgr("ganis@lxb6043")->ShowROOTVersions()
----------------------------------------------------------
Available
versions (tag ROOT-vers remote-path PROOF-version):
*
vHEAD-19Mar2007 5.15/03 /opt/root/vHEAD-19Mar2007/root 12
vHEAD-13Mar2007 5.15/03 /opt/root/vHEAD-13Mar2007/root 12
vHEAD-05Mar2007 5.15/03 /opt/root/vHEAD-05Mar2007/root 12
----------------------------------------------------------
and the default changed using TProofMgr::SetROOTVersion():
root [1]
TProof::Mgr("ganis@lxb6043")->SetROOTVersion("vHEAD-05Mar2007").
- Added full support
for authentication for
the
xrootd-based communication layer with automatic credential forwarding
to worker nodes; supported protocols: password-based, Kerberos, GSI.
- Added support for the acquisition of AFS tokens within
the
proofserv sessions; this allows to access private AFS areas from any
worker or master node.
- Several improvements in package handling, in particular
- added possibility to enable packages locally
- added support for global paths for public
packages
- Added real-time feedback during package building
- Added support for user names longer than 8
chars for the xrootd-based communication layer.
- Added text-oriented progress bar for runs in batch-mode
- Several improvements in the new packetizer -
TAdaptivePacketizer - which is now the default packetizer.
- Several bug fixes and internal optimizations
GUI
- New Library libGuiHtml
This library contains classes to parse html documents and render them using the ROOT graphics.
Its first prototype cannot support documents with CSS2 (Cascaded Style Sheet) and TWiki web pages.
A simple html browser rhtml application can be created by running the Makefile in
$ROOTSYS/test/rhtml directory. It displays by default the ROOT home page. All links not leading to
ROOT TWiki pages can be followed.
- TGFont
Introduced new structures for describing font attributes and several methods for
measuring and displaying text. All changes in font handling were necessary for the new html
widget development and allow to find the best matching font specified by family name, point
size, weight and slant flags. This implementation is based on similar tk code implemented
in xclass library.struct FontAttributes_t {
const char *fFamily; // Font family. The most important field.
Int_t fPointsize; // Pointsize of font, 0 for default size,
// or negative number meaning pixel size.
Int_t fWeight; // Weight flag
Int_t fSlant; // Slant flag
Int_t fUnderline; // Non-zero for underline font.
Int_t fOverstrike; // Non-zero for overstrike font.
};
A new class TGTextLayout is used to keep track of string measurement information.
The new method ComputeTextLayout of TGFont computes the amount of screen
space needed to display a multi-line, justified string of text; records all the measurements
that were done to determine to size and positioning of the individual lines of text. The return
value is a TGTextLayout that holds the measurement information for the given string. This
information is used to display the text quickly (without re-measuring it). This method is useful
for simple widgets that want to display single-font, multi-line text and want TGFont to handle
the details.
- TGToolTip
A multiline tooltip can be created by inserting a new-line character "\n".
- Drag & Drop (DnD)
Drag and Drop support is introduced for Linux (via Xdnd - the drag
and drop protocol for X window system) and for Windows (via Clipboard).
Users can selects something in ROOT with a mouse press, drags it (moves
the mouse while keeping the mouse button pressed) and releases the mouse
button someplace else. When the button is released the selected data is
"dropped" at that location. This way, a histogram from an opened ROOT file in
the browser can be dragged to any TCanvas. A script file from the browser can
be dropped to a TGTextView or TGTextEdit widget in TGTextEditor.
On Linux, it is possible to drag objects between ROOT and an external application.
For example to drag a macro file from the ROOT browser to the Kate editor.
On Windows, drag and drop works only within a single ROOT application (for the time being).
- TGView, TGTextView, TGTextEdit
Improved screen view of these widgets by eliminating the flickering when a text edit
widget is resized or exposed.
Implemented Undo functionality by using Ctrl+Z in text edit widget.
- TGXYLayout, TGXYLayoutHints
Implemented SavePrimitive methods
- TGButton and TGButtonGroup Signals
The behavior of double emitted signals is fixed in TGCheckButton, TGRadioButton
and TGButtonGroup classes.
ATTENTION: If you have connected (as a workaround) your
slot methods to "Pressed()" or "Released()" signals, you will need
to change your code and to connect these slots to "Clicked()" signal.
For example, if fgr is a button group and you have used:
fgr->Connect("Released(Int_t)","TGraphEditor",this,"DoShape()");to avoid the double call of the slot, you should change it to:
fgr->Connect("Clicked(Int_t)","TGraphEditor",this,"DoShape()");
- TGFileDialog
Any new folder is created 'on place' where users via the TGFileDialog had navigated to.
In previous ROOT versions when users click on "Create New Folder" button, the new folder
was created always into the working directory of ROOT.
- TRootEmbeddedCanvas
OpenGL rendering is enabled for ROOT embedded canvases.
- TGListView
Added new method ResizeColumns() for backward compatibilities. Use this method after all
entries are on place. It will resize column headers showing whole items' names as in
previous ROOT versions.
- TH2Editor
Implemented functionality related to graphical cut draw options.
- TGColorDialog
Added two tabs in color dialog: Color Wheel and Basic Colors. The Color Wheel tab contains a
TColorWheel object and users can select a color from it. TColorWheel object shows a set
of the recommended 216 colors. They are widely supported by web applications because using them
for backgrounds, fonts and graphics will give the best chance of a consistent appearance across
operating systems, color monitors and browser versions. The selected colors allow six levels
each of Red, Green and Blue: 255, 204, 153, 102, 51, o or FF, CC, 99, 66, 33, 00 as HEX values.
The Basic Colors tab keeps the old functionality of this class. The text fields for RGB and
HLS and OK, Cancel buttons are moved to the main dialog frame. They are in common use from both
tabs for setting a color.
Using the Preview button users can apply the selected color to an selected object in the canvas
when the color dialog is called from the ROOT graphics editor. The color selection can be
confirmed as the final one by clicking the OK button or refused - by clicking on Cancel button.
- Fit Panel
General Tab
If selected object has been fitted, the list of its functions is added to the function combo
box and functions and can be selected for later use.
Minimization Tab
"Library" group allows you to use Minuit, Minuit2 or Fumili minimization packages for your fit.
- "Minuit" - the popular Minuit minimization package.
- "Minuit2" - a new object-oriented implementation of Minuit in C++.
- "Fumili" - the popular Fumili minimization package.
"Method" group has currently restricted functionality.
- "MIGRAD" method is available for Minuit and Minuit2.
- "FUMILI" method is available for Fumili and Minuit2.
- "SIMPLEX" method is disabled (will come with the new fitter design)
"Minimization Settings" group allows users to set values for:
- "Error definition" - between 0.0 and 100.0 (default is 1.0).
- "Maximum tolerance" - the fit relative precision in use.
- "Maximum number of iterations" - default is 5000.
Print options:
- "Default" - between Verbose and Quiet.
- "Verbose" - prints results after each iteration.
- "Quiet" - no fit information is printed.
A status bar was added to display information about the current minimization
settings set via the 'Minimization' tab. The following abbreviations are used:
- LIB - shows the current choice between Minuit/Minuit2/Fumili.
- MIGRAD or FUMILI points to the current minimization method in use.
- Itr: - shows the maximum number of iterations nnnn set for the fit.
- Prn: - can be DEF/VER/QT and shows the current print option in use.
OpenGL
TGLHistPainter and TGLViewer
- Invert the Zoom/Unzoom convention when using the mouse wheel forward/backward.
- Enable manipulation with specular light component.
- Fix a problem on MAC when deleting a GL window.
TRootEmbeddedCanvas
Added check for gStyle->GetCanvasPreferGL() in TRootEmbeddedCanvas
constructor in a way it is done in TRootCanvas. This change enables GL
rendering in TRootEmbeddedCanvas objects.
Parametric surfaces
- TGLParametricEquation is the new class to define parametric surfaces. A parametric surface can be
defined by with three equation in a "string form"
(mathematical expression, the same as TF2) or as a pointer to function.
- TGLParametricPlot is the GL painter drawing parametric surface.
It has most of features other gl-painters have - box cut, zooming etc. + 21
color "schemes": you can change the color of surface (which is under cursor)
by pressing 's' or 'S' - the same as TGLTF3Painter + wireframe mode ('w' or
'W' key - temporary solution).
//Author: Timur Pocheptsov
void glparametric()
{
// A parametric surface is defined by three functions:
// S(u, v) : {x(u, v), y(u, v), z(u, v)}.
// To create parametric surface and draw it one has to:
// 1. Create canvas, which support OpenGL drawing (two ways):
// a. Call gStyle->SetCanvasPreferGL(kTRUE)
// b. Or create canvas with name, wich contains "gl".
// 2. create TGLParametricEquation object.
// TGLParametricEquation *eq = new TGLParametricEquation
("name_of_object",
// "some FORMULA here - x(u, v)",
// "some FORMULA here - y(u, v)",
// "some FORMULA here - z(u, v)",
// uMin, uMax, vMin, vMax);
// where FORMULA is the same string (mathematical expression),
// as in TF2, but you should use 'u' (or 'U') instead of 'x'
// and 'v' (or 'V') instead of 'y'.
// 3. Call equation->Draw();
// Parametric surfaces support 21 color "schemes", you can change
// the color:
// -place mouse cursor above surface (surface is selected in pad)
// -press 's' or 'S'.
TCanvas *c = new TCanvas("glcanvas","Parametric surfaces with gl",
100, 10, 700, 700);
c->SetFillColor(42);
gStyle->SetFrameFillColor(42);
c->Divide(2, 2);
c->cd(1);
TGLParametricEquation *p1 = new TGLParametricEquation("Conchoid",
"1.2 ^ u * (1 + cos(v)) * cos(u)",
"1.2 ^ u * (1 + cos(v)) * sin(u)",
"1.2 ^ u * sin(v) - 1.5 * 1.2 ^ u",
0., 6 * TMath::Pi(), 0., TMath::TwoPi());
p1->Draw();
c->cd(2);
TGLParametricEquation *p2 = new TGLParametricEquation("Apple",
"cos(u) * (4 + 3.8 * cos(v)) ",
"sin(u) * (4 + 3.8 * cos(v))",
"(cos(v)+sin(v)-1)*(1+sin(v))*log(1-pi*v/10)+7.5*sin(v)",
0, TMath::TwoPi(), -TMath::Pi(), TMath::Pi());
p2->Draw();
c->cd(3);
TGLParametricEquation *p3 = new TGLParametricEquation("Toupie",
"(abs(u) - 1) ^ 2 * cos(v)",
"(abs(u) - 1) ^ 2 * sin(v)",
"u",
-1., 1., 0, TMath::TwoPi());
p3->Draw();
c->cd(4);
TGLParametricEquation *p4 = new TGLParametricEquation("Trangluoid trefoil",
"2 * sin(3 * u) / (2 + cos(v))",
"2 * (sin(u) + 2 * sin(2 * u)) / (2 + cos(v + 2 * pi / 3))",
"(cos(u)-2*cos(2*u))*(2+cos(v))*(2+cos(v+2*pi/3))/4",
-TMath::Pi(), TMath::Pi(), -TMath::Pi(), TMath::Pi());
p4->Draw();
}
|
 |
Iso-surfaces
TH3 histograms can drawn as iso surfaces (3D iso contours).
 |
void gliso()
{
const Int_t nBin = 70;
const Double_t l = -40., r = 40.;
Double_t w = (r-l)/nBin;
TH3F *volume = new TH3F("V","V", nBin, l, r, nBin, l, r, nBin, l, r);
TCanvas *canvas = new TCanvas("glC","glC",600,600);
//Define and set user's palette,
const Int_t paletteSize = 5;
Float_t rgb[paletteSize * 3] =
{0.9f, 0.60f, 0.f,
0.f, 1.f, 1.f,
1.f, 0.f, 0.f,
0.f, 1.f, 0.f,
1.f, 1.f, 0.f};
Int_t palette[paletteSize] = {0};
for (Int_t i = 0; i < paletteSize; ++i)
palette[i] = TColor::GetColor(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]);
gStyle->SetPalette(paletteSize, palette);
Float_t x,y,z;
for (x = l-w/2; x < r; x += w) {
for (y = l-w/2; y < r; y += w) {
for (z = l-w/2; z < r; z += w) {
if ( x*x + y*y + z*z < 500) volume->Fill(x,y,z,50);
if ( x*x + y*y + z*z < 300) volume->Fill(x,y,z,40);
if ( x*x + y*y + z*z < 200) volume->Fill(x,y,z,30);
if ( x*x + y*y + z*z < 80) volume->Fill(x,y,z,20);
if ( x*x + y*y + z*z < 30) volume->Fill(x,y,z,10);
}
}
}
volume->SetContour(5);
volume->Draw("gliso");
}
|
void gliso2()
{
gStyle->SetCanvasPreferGL(true);
TCanvas * canvas = new TCanvas("C","C",600,600);
ntuple->Draw("px:py:pz>>h3","","Q");
h3->SetContour(50);
h3->Draw("gliso");
}
|
 |
Text drawing with OpenGL
The FTGL package has been imported inside the ROOT framework. This package,
provided by Henry Maddocks, allows TTF font display in OpenGL. It is used by the
new class TGLText which draws 3D in OpenGL scenes. TGLText
being itself used by TGLAxis to draw 3D axis also in OpenGL scenes.
Major restructuring of GL viewer-scene relationship
The main idea was to generalize current GL infrustructure so that the
following features can be done in the future:
- Full pad rendering via GL including 3D histo/func painters and 2D graphics.
- Implementation of GL canvas (with independent viewers serving as pads).
- Multi-view event-visualization front-end.
- Inclusion of external scenes (non-ROOT-gl) in ROOT viewer.
Rendering of ROOT scenes in external GL frameworks.
Changes on the code level
- Extend current scene/viewer classes into a 2-level class hierarchy.
New classes TGLViewerBase and TGLSceneBase.
- Allow scenes to be shared among viewers. View-specific scene-cache
needs to be kept at the viewer side.
- Viewer now manages a list of scenes. It is possible to put together
a combination of scenes (e.g. one showing geometry, another one tracks
and yet another clusters). Each scene can define its own clipping object.
- Provide API for fine-grained control over rendered object removal,
creation and update. This allows for efficient scene-updates.
- Disentangle selection, clipping and other markup objects from
within viewer-scene singleton.
New classes TGLClipSet, TGLManipSet.
- Disentangle selection management.
- Separate overlay rendering to allow any number of active GL-GUI
elements (like manipulators are now).
New classes TGLOverlayElement.
- Trailing white space has been removed in all files.
Restructure low-level interface to OpenGL
- Allow sharing GL resources among viewers.
- Do not bind GL-output (windowed or offscreen) to ROOT GUI.
New classes TGLContext, TGLFormat, TGLWidget.
This oboletes TGLKernel and TVirtualGL classes.
Basic Graphics
TGraph
- When a point is added using TGraph::SetPoint the current
fHistogram, it it exists, is invalid.i So, now it is deleted.
A new one will be recomputed next time the TGraph will be plotted.
- Due to some wrong initialisation of an internal variable,
the following macro drew an horizontal line at Y=0:
{
TCanvas c1;
TGraph g;
g.SetPoint(0, -1,-1);
g.SetPoint(1, 0, 0);
g.SetPoint(2, 1, 1);
g.Draw("A*");
}
- TGraph::PaintGrapHist shifted points by half-a-bin when painting
lines in low-res. The following macro showed the problem:
void lowRes(int nbins=10000) {
c = new TCanvas("lowRes","lowRes",0,0,700,800);
TH1F *h1 = new TH1F("h1","my histogram",nbins,-3,3);
for (int i=0;i<1000000;i++) h1->Fill(gRandom->Gaus(0,1));
h1->SetMarkerStyle(20); h1->Draw("EP");
TH1F *h12 = h1->DrawCopy("l same");
h12->SetLineColor(kRed);
h1->GetXaxis()->SetRange(1,40);
}
- In the TGraph destructor, reset fFunctions to 0 to
avoid access to a deleted object in TGraph::RecursiveRemove.
TText and TLatex
- GetBoundingBox has a new optionnal parameter: Bool_t angle. When it is true,
the bounding is computed taking care of the text angle. When it is false
(default), the horizontal bounding box is computed.
- In case the font size in pixel (precision 3) the values returned by
GetBoundingBox were not correct.
- After a call to TLatex::GetXsize() the text angle was reset to 0.
Now fixed.
- valgrind was correctly complaining about sscanf accessing invalid
memory areas in TLatex. That's caused by not 0-terminated buffers.
It is now fixed.
- Better rendering of the sqrt symbol:
- The middle line is not vertical anymore.
- The left line is thicker than the two other lines.
- The line width depends on text's size.
Time axis
TH2: Arrow Plots and Errors Plots
Lego Plots
- In a previous version the lego plot was changed to draw the 3D boxes from z=0
even for bins with negative contents. It was not possible to get the old
behavior. This functionnality correspond, in fact, to something already existing
for 1D histograms: gStyle->SetHistMinimumZero();
Now the lego plot behave the same way:
If gStyle->SetHistMinimumZero() is set, the 3D boxes are drawn from 0
even for bins with negative contents. If this option is not set the 3D
boxes are drawn from the histogram minimum, exactly like for 1D
histograms.
c1 = new TCanvas("c1","c1",0,0,700,500);
c1->Divide(2,1)
c1->cd(1);
hpxpy->Draw("lego");
gStyle->SetHistMinimumZero()
c1->cd(2);
hpxpy->Draw("lego");
|
 |
TPie
- Introduction of the TPieSlice class to hold the content of any
slice. A single slice responds to the mouse if the pointer is near a
slice's corner (the pointer became a cross). TPie now uses
TPieSlice.
- Bug fixed: The labels using options "tan" or "rad" in
some conditions were upside down.
- The tutorial piechart.C now illustrate the
"No Out-Line" option and how to make a legend on a TPie.
- The labels now are not printed over the pie area.
- Added the SetAngle3D() and GetAngle3D() method to change
the perspective angle if the 3d option is used.
TLegend
- In the TLegend and TPaveLabel constructors use
gStyle->GetTextFont() instead of the hardwired values 42
and 62.
- New method in TLegend to set the number of columns
used to draw the legend: SetNColumns(Int_t nColumns)
(From Jason Detwiler). In the following example the legend has
been defined with 2 columns:
TEllipse
- Make sure that phmin<phimax to fix the bug reported
here.
- Modify help to use the new THtml doc and added missing information.
THStack
- THStack::Paint: if the first histogram in the stack has alphanumeric labels on X-axis,
they are now displayed.
New class TColorWheel
TColor
- Two new static functions in TColor:
- Int_t TColor::GetColorBright(Int_t n)
Returns the bright color number corresponding to n
If the TColor object does not exist, it is created.
The convention is that the bright color nb = n+150
- Int_t TColor::GetColorDark(Int_t n)
Returns the dark color number corresponding to n
If the TColor object does not exist, it is created.
The convention is that the dark color nd = n+100
PostScript and Image Dump
TASImage/TImage
- The gif file generated in batch from a single TPad is now correct
(size and background color).
- In TASImage::DrawGlyph Clip text drawn outside of image.
- Fix some graphics synchronization problems.
- TASImage::Image2Drawable: Fix for Windows. Image mask generation was missing.
- Fix memory leak in DrawCircle, DrawEllipse methods
- Fix for drawing images with transparency.
- Improve text size in batch mode (now closer to the size in interactive mode)
- Empty boxes were not drawn correctly.
- Fixed problems with alignment of rotated text.
- TASImage: new method introduced:
DrawText(Text *text, Int_t x, Int_t y)
which allows to draw TText object in TImage, where x,y are in pixels.
- Implement the line styles > 4
- TASImage::ReadImage: when image doesn't have a file extension
the detection of the image type is done by reading "magic number"
(first bytes of file).
- TASImage::TypeFromMagicNumber:
more image types detected by "magic number"
according to this page.
- TASImage::WriteImage:
more comments added on "how to create animated image".
- TImage::PaintImage:
extend this method to allow to draw a part of an image
on window (previously the whole image was drawn).
PaintImage(Drawable_t wid, Int_t x, Int_t y, Int_t xsrc, Int_t ysrc,
UInt_t wsrc, UInt_t hsrc);
where:
- wid - a window where image is drawn
- x,y - window coordinates where image is drawn
- xsrc, ysrc, wsrc, hsrc - an image area to be drawn.
In TPad::Print
- "[" and "]" are special characters for ExpandPathName. They may appear
at the end of the PS filename (see TPad::Print help). In that case, they
are now removed before performing ExpandPathName and put back afterwards.
It was decided to do the fix in TPad::Print and not in ExpandPathName
because ExpandPathName is a low level function and modifying it may
produce unwanted side effects.
TImagePalette
- New constructor TImagePalette::TImagePalette(Int_t ncolors, Int_t *colors)
added. This allows to create image palette corresponding to
TStyle::SetPalette method.
This constructor is "100% compatible" with TStyle::SetPalette method.
To test it, one can run tutorials/image/hist2image.C by creating "rainbow
palette":
TImagePalette *pal = new TImagePalette(1, 0);
TPostScript
- Change in SetFillPatterns to make sure the line width will be properly
reset after a filled pattern area is drawn.
- Rotated text aligned center or right horizontally was misplaced.
Miscellaneous
TH1
- In TH1::SavePrimitives() the contour levels in case of LogZ were not saved correctly.
- Two new methods: TH1::SetTitleFont and TH1::GetTitleFont.
TGraph2D
- New method TGraph2D::SetNameTitle. This is required when changing
the name of a TGraph2D, otherwise the directory hashlist is not updated.
Hatches painting
- TPad::PaintHatches: for a given hatches index, the hatches'
angles varried with the window aspect ratio. Now the hatches' angles are
fixed.
TGraphAsymmErrors
- TGraphAsymmErrors::Paint, takes into account the graph fill style
when painting the boxes with option "e2".
TGraphPolar/TPolarGram
- New options allowing to draw only the polar axis or radial axis.
- Possibility to define text string as labels.
- Clean up: avoid duplicated code.
TGaxis
- The title offset could not be smaller than 0.1. There is no reasons
why it should not be.
- Fix possible uninitialized variables in TGaxis::PaintAxis and
THLimitsFinder.
TPaveStats
- A previous modification (cvs revision 1.29 of TPaveStats.cxx)
broke the automatic computation of the
title size in TPaveStats::Paint. Now it works again
and the problem which was wrongly fixed has been treated also.
THistPainter::Paint2DErrors
- In case of option "lego e1" the z axis was painted twice.
TPolyMarker
- Make SetPolyMarker(Int_t n) compliant with
SetPolyMarker(Int_t n, Double_t *x, Double_t *y, Option_t *option)
and with the documentation, ie:
If n <= 0 the current arrays of points are deleted.
Xft
- Add Xft support to ROOT X11. This is an important extension as it allows
GUI text to be rendered (server side) with TrueType fonts making the GUI
much more readable. During configuration we check for Xft availability.
At run time the user can decide to use or not use it via the:
X11.UseXft: yes/no
flag in the rootrc file. The default is to use it when the capability
is compiled in the ROOT libraries.
Tutorials
- Make sure that the fitted surface and the TGraph2D cloud of points
have the same Z range when they are plotted on top of each others in
graph2dfit.C and graph2derrorsfit.C.
- Mods in trans_graph.C allowing to run this script
by clicking with a ROOT browser, i.e. in gui mode (add switching back
to GUI mode at the end of script).
- motorcycle.C: When calling TPad::DrawFrame, one must use the
current pad (gPad)
Changes in Ruby
Thanks to Jakob van Santen for fixing a problem with the Ruby library.
libRuby worked fine from ROOT/Cint, but did not load from within Ruby. On OS
X, Ruby could only load extension libraries compiled as mach-o bundles, not
those compiled as dynamiclibs. This problem is now fixed.
New tutorials
- math/ErrorIntegral.C: To estimate the error in the integral of a fitted function taking into account the
/errors in the parameters resulting from the fit.
- math/exampleFunctor.C: Example of creating TF1 using a functor and a member function of a class
- gl/glparametric.C: new tutorial, showing how to build and draw four
different parametric surfaces.
- graphics/mandelbrot.C from Luigi Bardelli (bardelli@fi.infn.it),
Example macro of using TExec to handle keyboard events.
- image/trans_graph.C: from V.Onuchin illustrating operations on images.
We added set of nice macros illustrating the power of the geometry package.
These macros were developped at the Department of Physics, University of Seoul
under the supervision of Professor Inkyu Park (icpark@physics.uos.ac.kr),
for the evaluation of Computational Physics course in 2006.
- geom/building.C by Hyung Ju Lee (laccalus@nate.com)
Drawing a building where Dept. of Physics is.
- geom/cheongwadae.C by Hee Jun Shin (s-heejun@hanmail.net)
Drawing the Cheongwadae building which is the Presidential
Residence of the Republic of Korea.
- geom/lego.C by Soon Gi Kwon(1116won@hanmail.net)
Drawing a figure, made of lego block.
- geom/mp3player.C by Eun Young Kim
Drawing a mp3 type music player.
- geom/robot.C by Jin Hui Hwang
Drawing a famous Korean robot, TaekwonV.
- geom/south_gate.C by Lan Hee Yang(yangd5d5@hotmail.com)
Drawing a famous Korean gate, the South gate, called Namdeamoon
in Korean.
- geom/station1.C by Chang Yeol Lee
Drawing a space station.
- geom/station2.C by Dong Ryeol Lee (leedr2580@hanmail.net)
Drawing a space station.
- geom/tank.C by Dong Gyu Lee (ravirus@hanmail.net)
Drawing a fine tank.
ROOT page
- Class index - Top of the page