ROOT version 4.02/00 Release Notes
The ROOT Team is pleased to announce a stable release of ROOT version 4.02/00.
This new, backward compatible, version has major enhancements described
below.
Binaries for all supported platforms are available at:
http://root.cern.ch/root/Version402.html
Versions for AFS have also been updated. See the list of supported platforms:
http://root.cern.ch/root/AFS.html
For more information, see:
http://root.cern.ch
Ilka Antcheva,
Maarten Ballintijn,
Bertrand Bellenot,
Marek Biskup,
Rene Brun,
Philippe Canal,
Olivier Couet,
Valeri Fine,
Gerri Ganis,
Andrei Gheata,
Mihaela Gheata,
Masaharu Goto,
Carsten Hof,
Anna Kreshuk,
Wim Lavrijsen,
Richard Maunder,
Axel Naumann,
Eddy Offermann,
Valeriy Onuchin,
Timur Pocheptsov,
Fons Rademakers
New file server xrootd
and corresponding ROOT client TXNetFile
The file server xrootd
(eXtended ROOT daemon) has been developed by Andy Hanushevsky of SLAC.
The server exploits a multithreaded architecture to provide to provide
high-performance file based access, focusing on scalability and fault
tolerance. The server is being extensively used by the BaBar
collaboration. More information is available from http://xrootd.slac.stanford.edu/
.
The xrootd file server is available for Linux (including 64-bit AMD
Opteron and Itanium) , Solaris and MacOSx.
The xrootd file server will in the near future replace the current
daemon rootd.
The new client class TXNetFile
implements the xrootd protocol and is provided to open a file via
the xrootd daemon. Sources for TXNetFile and the associated
auxilliary classes are located under the new module netx; the
corresponding library is libNetx.
For the systems for which xrootd is available a new TFile plugin entry
is defined in $ROOTSYS/etc/system.rootrc, associating the
protocol "root:" to TXNetFile.
To open a file via xrootd, just use the static method TFile::Open:
root[ ] TFile *f =
TFile::Open("root://remote.host.dom//tmp/remotefile.root")
the plugin manager will recognize the protocol and load the library
libNetx . The library has to be loaded manually to use directly the
TXNetFile constructor:
root[ ] .L lib/libNetx.so
root[ ] TFile *f = new
TXNetFile("root://remote.host.dom//tmp/remotefile.root")
TXNetFile is TNetFile-compatible: a TNetFile is returned if the remote
daemon is a rootd.
Several options are available to control the behaviour of TXNetFile:
see $ROOTSYS/etc/system.rootrc for details.
A general framework for authentication services is available in xrootd,
allowing to activate the different protocols as plug-ins. The framework
is implemented in TXNetFile. For the time being only plug-ins for
Kerberos IV and Kerberos V are available: additional plug-ins,
including GSI and password-based ones, are under development.
New Features in the Input/Output System
Extended support for I/O of STL collections
In collaboration with Markus Frank from LHCB, the
TCollectionProxies for all STL collections, including complex cases of
collections, or collections of collections, etc has been implemented. In
particular, this means that
- ROOT files containing an STL collections can be read
without the original library
- TTree::Draw is able to handle any type of STL
collections
- STL collections are supported in TTree split mode.
The test program $ROOTSYS/test/bench.cxx,TBench.cxx has been
extended to test STL collections of objects or pointers.
Extensions of the Automatic Schema Evolution
- Add support for automatic schema evolution when a
namespace is added to a class. For example A is MyClass and B is
MyNamespace::MyClass.
- Supports the case where the type of a data member
changed from [NamespaceA::]ClassName to [NamespaceB::]ClassName, where both
namespaces are optional.
- Implements the schema evolution to and from selected containers.
The following cases are currently implemented:
- TClonesArray object -> STL object containing the same type
- TClonesArray pointer -> STL pointer containing the same type
- STL object -> STL object containing the same type
- STL pointer -> STL pointer containing the same type
- STL split branches -> TClonesArray
- In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.
Improvement in TVirtualCollectionProxy
An important step toward the implementation of the member-wise
saving of STL containers. Mainly, the code does not require anymore the collection proxy to be
able to provide a C-style array of pointer to its content. This avoid the
problems of having to iterate twice through some collection and/or to
have to keep in memory a version of
this array. Concretely this also mean that
the I/O routine will now be able to recurse through stl containers.
Technically, this is done by templating TStreamerInfo::ReadBuffer and TStreamerInfo::WriteBufferAux (as well
as the ReadBufferSkip And
ReadBufferConv) so that you can use it directly with
a char** or with a TVirtualCollection (to which we added an
operator [] and removed the method GetPtrArray). In addition, we added 2
new method to TtualCollectionProxy::PushProxy and PopProxy that will allow
to keep some
state on where we are in the iteration for
a collection when we recurse. (This is required for
a reasonable implementation of the TVirtualCollection for std::list).
We implemented MemberWise streaming for collection with a
TVirtualCollectionProxy and whose content is splittable (i.e. guaranteed
homogeneous).
In this first implementation, objectwise streaming is still the default.
To activate memberwise streaming, call the static function
TStreamerInfo::SetStreamMemberWise(kTRUE);
Support for large Tree/TChain with more than 2 billion entries.
The implementation of this new feature has required changes in many places.
Trees produced by this new version cannot be read by old ROOT versions.
The new version can digest old ROOT files.
Note that when creating a Tree, the default maximum size for a Tree
is set to 1.9 GBytes. You can change this default value by calling:
TTree::SetMaxTreeSize(Long64_t maxsize)
$ROOTSYS/bin/hadd
hadd can now merge files into a big file up to 100 Gbytes by default.
New TSystem Features and Updates
Setting dynamic load path at run-time
const char* TSystem::GetDynamicPath()
Returns the dynamic path which used by ROOT to find shared libraries
void TSystem::SetDynamicPath(const char *path)
Set the dynamic path to a new value. If the value of 'path' is zero, the dynamic path is reset to its default value.
Autoloading
Implemented support for autoloading of namespaces as well as properly ignoring the one that are not needed but listed in a .rootmap.
PROOF New Features and Updates
New Benchmark Package
The benchmark package consists of three components, test data generation,
standard test queries, and the system performance monitoring. Together they
provide a standalone package that can be used to validate the configuration
of a (new) PROOF cluster, provide a quick way to measure its performance,
or to study in dept the performance characteristics of its components.
The package is fully self contained,
a standard ROOT installation is all that is required. All the files of
the benchmark can be found in $ROOTSYS/test/ProofBench including
a comprehensive README file.
Other improvements
- New class TDrawFeedback, new methods TProof::AddFeedback()
,
TProof::RemoveFeedback(), TProof::ClearFeedback(),
TProof::ShowFeedback().
This class and these methods simplify the use of the PROOF feedback
mechanism. Instantiating a TDrawFeedback object and registering a (few)
objects using TProof::AddFeedback("objName") is all that is needed to
watch these objects during the PROOF query.
- New TProof::GetSlaveInfo() method. This method provides information
about the active slaves in a PROOF session in a form useful for scripts.
- Many fixes and enhancements in the packetizer classes that distribute work
over the PROOF slaves.
- Initial implementation of TDSet::Draw() for drawing TTrees using PROOF, currently only for the one
dimensional case. A more extensive implementation is being worked on.
New TTree Features
Trees with circular buffers
Implement a first version of circular buffers for memory resident Trees.
void TTree::SetCircular(Long64_t maxEntries)
where maxEntries is the maximum number of entries to be kept in the buffers.
When the number of entries exceeds this value, the first entries in the Tree
are deleted and the buffers used again.
The implementation minimizes memory operations by swapping basket pointers
and only shifting the data in the new first buffer.
An example of a script using a circular buffer is shown below
void circular() {
gROOT->cd(); //make sure that the Tree is memory resident
TTree *T = new TTree("T","test circular buffers");
TRandom r;
Float_t px,py,pz;
Double_t random;
UShort_t i;
T->Branch("px",&px,"px/F");
T->Branch("py",&py,"px/F");
T->Branch("pz",&pz,"px/F");
T->Branch("random",&random,"random/D");
T->Branch("i",&i,"i/s");
T->SetCircular(20000);
for (i = 0; i < 65000; i++) {
r.Rannor(px,py);
pz = px*px + py*py;
random = r.Rndm();
T->Fill();
}
T->Print();
}
Tree Friend Indices
The new class TTreeIndex replaces the previous TTree index code.
The class derives from the abstract interface TVirtualIndex.
It provides the same functionality as the previous code, but
in addition, it supports more complex cases.
When a Tree friend has a TTreeIndex (created as before via
TTree::BuildIndex), the friend tree and the parent Tree do not
need to have the same serial numbers.
The friend tree may have less or more events.
When getting an entry in the parent tree, the corresponding entry
in the friend will be computed via the index. Note that to support
this new feature, the parent Tree does not need an index. Only the
friend Tree must have an index. See comments in the TTreeIndex
constructor.
TTree::BuildIndex() may be used with a major-name only.
New method TTree::BranchRef and new classes TBranchRef, TRefTable
- TRefTable
When writing referenced objects, a table of parents of
these referenced objects is kept in the TRefTable eg, when writing a Tree, the
parent object is the TBranch with the referenced object. In this case the
TRefTable is activated when filling the Tree. The information about the
parents is kept in a separate Tree branch, such that when dereferencing a TRef
the parent branch containing the referenced object can be loaded
automatically.
-
New class TBranchRef deriving from TBranch.
This is a special branch keeping the information about the
branch numbers having referenced objects.
The TBranchRef object is created by the new function
TTree::BranchRef
Improvements in TTree::Scan
add the ability to format the output of
TTree::Scan. The option parameter can now contains the following
customization:
colsize=ss
Where 'ss' will be used as the default size for all the column
If this options is not specified, the default column size is 9
precision=pp
Where 'pp' will be used as the default 'precision' for the
printing format.
col=xxx
Where 'xxx' is colon (:) delimited list of printing format for
each column if no format is specified for a column, the default is
used.
For example:
tree->Scan("a:b:c","","colsize=30 precision=3 col=::20.10");
Will print 3 columns, the first 2 columns will be 30 characters long,
the third columns will be 20 characters long. The
for the columns (assuming they are numbers) will be respectively:
%30.3g %30.3g %20.10g
New function TTree::ReadFile
Long64_t TTree::ReadFile(const char *filename, const char *branchDescriptor)
Create or simply read branches from filename
if branchDescriptor = "" (default), it is assumed that the Tree descriptor
is given in the first line of the file with a syntax like
A/D:Table[2]/F:Ntracks/I:astring/s
otherwise branchDescriptor must be specified with the above syntax.
A TBranch object is created for each variable in the expression.
The total number of rows read from the file is returned.
TNtuple::ReadFile has been modified to be consistent with TTree::ReadFile.
Browsing Class Methods
Axel Naumann has added code that allows the TBrowser to
browse simple member methods (called "browsable" methods: public, not
pure virtual, const, no args without default value, return type not
void, and none of those Impl/DeclFile/IsA/... methods).
When TBranchElement::Browse is
called, TBranchElement::GetBrowsableMethods creates a list of browsable
methods, containing an object of type TMethodBrowsable for each browsable
TMethod of the current BranchElement's object (or its clone) and all of its
base classes. This list is needed for deleting these objects when
the TBranchElement ceases to be. All these objects are added to the
TBrowser in TBranchElement::Browse. TMethodBrowsable implements Browse, and
callsTBranchElement::GetTree()->Draw(branchname.methodname).
If a method returns a class object (or a pointer to one) which is known
to ROOT, fReturnClass is set. If that method is browsed, it expands to a
folder, giving access to the returned class's methods.
Axel added an icon for methods - a leaf with a red exclamation mark (as in
"execute!") for methods not returning a class, and a folder with an
exclamation mark for methods returning a class.
Add a new option in TTreePlayer::UnbinnedFit
If option = "D" Draw the projected histogram with the fitted function
normalized to the number of selected rows
and multiplied by the bin width
Classes TH1, TH2
New Rebin methods for 2-d histograms
- TH2 *TH2::RebinX(Int_t ngroup, const char *newname)
- TH2 *TH2::RebinY(Int_t ngroup, const char *newname)
- TH2 *TH2::Rebin2D(Int_t nxgroup, Int_t nygroup, const char *newname):
TH1::SetBuffer enhancements
Upgrade the histogram buffer algorithm such that it can be used in a
coming version of the rebinner of the TH1,2 editors.
When the histogram buffer is active (TH1::SetBuffer has been called),
the buffer is kept alive as long as the number of entries can
be accomodated by the buffer.
When calling the Draw/Paint functions, the histogram is reset and
refilled from the buffer.
The buffer is also preserved by the I/O operations.
Better Error calculation in TH1::Divide
Improve the calculation of errors in TH1::Divide with the binomial option.
In the previous algorithm, when the bin contents of the two histograms
were equal, the resulting error was null.
In the new algorithm, the method used in TGraphAsymmErrors::BayesDivide
is used to make a better error estimation.
Two new functions returning the error on the mean and RMS respectively
Double_t TH1::GetMeanError(Int_t axis) const
Double_t TH1::GetRMSError(Int_t axis) const
New options in THistPainter
An algorithm sent by Ernst-Jan Buis for plotting contours using
the special projections for viewing skymaps or exposure maps has been
introduced in THistPainter and associated classes.
In Hoption.h a new member HOption.Proj has been introduced
int Proj; // = 1 to get an Aitoff projection, usefull for skymaps or exposure maps..
// = 2 to get a Mercator ptojection
// = 3 to get a Sinusoidal ptojection
// = 4 to get a Parabolic ptojection
in THistPainter::Paint, the following options are supported:
"AITOFF" : Draw a contour via an AITOFF projection
"MERCATOR" : Draw a contour via an Mercator projection
"SINUSOIDAL" : Draw a contour via an Sinusoidal projection
"PARABOLIC" : Draw a contour via an Parabolic projection
New function TPad::PaintFillAreaHatches
In addition to the existing fill area patterns, the following hatch
styles have been introduced (same convention as in PAW): They are visible in PS
files with gv even with anti-aliasing on.
FillStyle = 3ijk
i (1-9) : specify the space between each hatch
1 = 1/2mm 9 = 6mm
j (0-9) : specify angle between 0 and 90 degrees
0 = 0
1 = 10
2 = 20
3 = 30
4 = 45
5 = Not drawn
6 = 60
7 = 70
8 = 80
9 = 90
k (0-9) : specify angle between 90 and 180 degrees
0 = 180
1 = 170
2 = 160
3 = 150
4 = 135
5 = Not drawn
6 = 120
7 = 110
8 = 100
9 = 90
Improvements in the Linear Algebra package (thanks Eddy Offermann)
- added new decomposition class TDecompBK: Bunch-Kaufman algorithm
this class is designed to decompose real symmetric matrices . Now
we can guarantee that inverse of a symmetric matrix is again
symmetric .
- As a consequence of the introduction of TDecompBK, we added
Invert(..) functionality to TMatrixD/FSym
Also added InvertFast to TMatrixD/FSym which uses Cramer
inversion for matrices <= (6 x 6) , resulting in large speedup
but less accuracy . The necessary routines are encapsulated
in the new TMatrixDSymCramerInv class .
Note of caution :
Unlike the other decompositions, Bunch-Kaufmann does not result
in a triangular matrix of which the determinant is trivially calculated
by multiplying the diagonal elements . As a consequence,
we have to invoke yet another decomposition when the user
requests the determinant .
So Invert() will be roughly twice faster than Double_t *det; Invert(det)
- Changed the algoritm for the Cholesky decomposition so that we
do not need to have a copy of the original matrix around !
After removal of class member fA, increased the version to 2
- Added sorting of eigen -values/-vectors to TMatrixDEigen .
They are now sorted according to Re^2+Im^2 of the (possible)
complex eigenvalues in descending order . TMatrixDSymEigen
already sorted . Since most users use TMatrixD instead of
TMatrixDSym, this will ensure backward compatiblity since
old root contained the symmetric algorithms in TMatrixD .
- Added rank 1 update algorihms : A += alpha * x y^T
(x and y are vectors)
to the non-sparse matrix classes (adding this to sparse
would make this matrix immediately dense :)
- Moved Invert fom TDecompBase to the different decomposition
classes . Reason is that some classes can decompose A(m,n)
where m > n . The result of Invert() is then a "pseudo-invert"
: A_pseudo = (A^T A)^-1 A^T .
- Added support to do in one operation A*B^T . A*B and A^T*B were
already available . This allows new constructors like
TMatrixD/F(a,TMatrixD/F::kMultTranspose,b)
- Introduced in TMatrixD/FSym 3 new similarity operations . They could
be done by brute-force multiplying the matrices but the final result
could then not take advantage that the matrix is symmetric . The
operations are:
TMatrixDSym &Similarity (const TMatrixD &n); // n * (*this)*n^T
TMatrixDSym &Similarity (const TMatrixDSym &n);// n_sym *(*this) *n^T
TMatrixDSym &SimilarityT (const TMatrixD &n); // n^T *(*this) * n
- removed bug in TMatrixFSym that prevented correct streaming :
Float_t *fElements; //![fNelems] elements themselves should be
Float_t *fElements; //[fNelems] elements themselves
It was ok in TMatrixDSym
- moved the protected and not streamed data member (this is an
interesting one!!!!)
Double_t fDataStack[kSizeMax]; //! data container
from the base classes to the actual classes .
The idea is and was that for matrices with less than kSizeMax+1 elements
no heap space is allocated and elements are stored on the stack .
This should result in signifant speed improvements for small matrices .
However, it became apparent (at least on my MacOSX G4) that it is only
effective when the data member is in the same class as its pointer fElements .
Moving this member necessitated also moving several (protected)
routines like New_m, Delete_m and Memcpy_m.
New class TRobustEstimator (thanks Anna Kreshuk)
Minimum Covariance Determinant Estimator
Fast Algorithm
invented by Peter J.Rousseeuw and Katrien Van Dreissen
"A Fast Algorithm for the Minimum covariance Determinant Estimator"
Technometrics, August 1999, Vol.41, NO.3
What are robust estimators?
"An important property of an estimator is its robustness. An estimator
is called robust if it is insensitive to measurements that deviate
from the expected behaviour. There are 2 ways to treat such deviating
measurements: one may either try to recongize them and then remove
them from the data sample; or one may leave them in the sample, taking
care that they do not influence the estimate unduly. In both cases robust
estimators are needed...Robust procedures compensate for systematic errors
as much as possible, and indicate any situation in which a danger of not being
able to operate reliably is detected."
R.Fruhwirth, M.Regler, R.K.Bock, H.Grote, D.Notz
"Data Analysis Techniques for High-Energy Physics", 2nd edition
What does this algorithm do?
It computes a highly robust estimator of multivariate location and scatter.
Then, it takes those estimates to compute robust distances of all the
data vectors. Those with large robust distances are considered outliers.
Robust distances can then be plotted for better visualization of the data.
How does this algorithm do it?
The MCD objective is to find h observations(out of n) whose classical
covariance matrix has the lowest determinant. The MCD estimator of location
is then the average of those h points and the MCD estimate of scatter
is their covariance matrix. The minimum(and default) h = (n+nvariables+1)/2
so the algorithm is effective when less than (n+nvar+1)/2 variables are outliers.
The algorithm also allows for exact fit situations - that is, when h or more
observations lie on a hyperplane. Then the algorithm still yields the MCD location T
and scatter matrix S, the latter being singular as it should be. From (T,S) the
program then computes the equation of the hyperplane.
How can this algorithm be used?
In any case, when contamination of data is suspected, that might influence
the classical estimates.
Also, robust estimation of location and scatter is a tool to robustify
other multivariate techniques such as, for example, principal-component analysis
and discriminant analysis.
TMath enhancements
- TMath is changed from a class to a namespace.
-
The Median functions have been improved in speed (thanks Anna Kreshuk).
-
The following functions are either new or have a new prototype
that should be back compatible.
Double_t TMath::DiLog(Double_t x)
Double_t TMath::CauchyDist(Double_t x, Double_t t, Double_t s)
Double_t TMath::GammaDist(Double_t x, Double_t gamma, Double_t mu, Double_t beta)
Double_t TMath::LogNormal(Double_t x, Double_t sigma, Double_t theta, Double_t m)
Double_t BetaDist(Double_t x, Double_t p, Double_t q)
Double_t BetaDistI(Double_t x, Double_t p, Double_t q)
Double_t LaplaceDist(Double_t x, Double_t alpha=0, Double_t beta=1);
Double_t LaplaceDistI(Double_t x, Double_t alpha=0, Double_t beta=1);
// Min, Max of an array
static Short_t MinElement(Long64_t n, const Short_t *a);
static Int_t MinElement(Long64_t n, const Int_t *a);
static Float_t MinElement(Long64_t n, const Float_t *a);
static Double_t MinElement(Long64_t n, const Double_t *a);
static Long64_t MinElement(Long64_t n, const Long64_t *a);
static Short_t MaxElement(Long64_t n, const Short_t *a);
static Int_t MaxElement(Long64_t n, const Int_t *a);
static Float_t MaxElement(Long64_t n, const Float_t *a);
static Double_t MaxElement(Long64_t n, const Double_t *a);
static Long64_t MaxElement(Long64_t n, const Long64_t *a);
// Locate Min, Max element number in an array
static Long64_t LocMin(Long64_t n, const Short_t *a);
static Long64_t LocMin(Long64_t n, const Int_t *a);
static Long64_t LocMin(Long64_t n, const Float_t *a);
static Long64_t LocMin(Long64_t n, const Double_t *a);
static Long64_t LocMin(Long64_t n, const Long64_t *a);
static Long64_t LocMax(Long64_t n, const Short_t *a);
static Long64_t LocMax(Long64_t n, const Int_t *a);
static Long64_t LocMax(Long64_t n, const Float_t *a);
static Long64_t LocMax(Long64_t n, const Double_t *a);
static Long64_t LocMax(Long64_t n, const Long64_t *a);
//Mean, Geometric Mean, Median, RMS
static Double_t Mean(Long64_t n, const Short_t *a, const Double_t *w=0);
static Double_t Mean(Long64_t n, const Int_t *a, const Double_t *w=0);
static Double_t Mean(Long64_t n, const Float_t *a, const Double_t *w=0);
static Double_t Mean(Long64_t n, const Double_t *a,const Double_t *w=0);
static Double_t Mean(Long64_t n, const Long64_t *a,const Double_t *w=0);
static Double_t GeomMean(Long64_t n, const Short_t *a);
static Double_t GeomMean(Long64_t n, const Int_t *a);
static Double_t GeomMean(Long64_t n, const Float_t *a);
static Double_t GeomMean(Long64_t n, const Double_t *a);
static Double_t GeomMean(Long64_t n, const Long64_t *a);
static Double_t RMS(Long64_t n, const Short_t *a);
static Double_t RMS(Long64_t n, const Int_t *a);
static Double_t RMS(Long64_t n, const Float_t *a);
static Double_t RMS(Long64_t n, const Double_t *a);
static Double_t RMS(Long64_t n, const Long64_t *a);
static Double_t Median(Long64_t n, const Short_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Int_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Float_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Double_t *a, const Double_t *w=0, Long64_t *work=0);
static Double_t Median(Long64_t n, const Long64_t *a, const Double_t *w=0, Long64_t *work=0);
static Short_t KOrdStat(Long64_t n, const Short_t *a, Long64_t k, Long64_t *work=0);
static Int_t KOrdStat(Long64_t n, const Int_t *a, Long64_t k, Long64_t *work=0);
static Float_t KOrdStat(Long64_t n, const Float_t *a, Long64_t k, Long64_t *work=0);
static Double_t KOrdStat(Long64_t n, const Double_t *a, Long64_t k, Long64_t *work=0);
static Long64_t KOrdStat(Long64_t n, const Long64_t *a, Long64_t k, Long64_t *work=0);
// Binary search
static Long64_t BinarySearch(Long64_t n, const Short_t *array, Short_t value);
static Long64_t BinarySearch(Long64_t n, const Short_t **array, Short_t value);
static Long64_t BinarySearch(Long64_t n, const Int_t *array, Int_t value);
static Long64_t BinarySearch(Long64_t n, const Int_t **array, Int_t value);
static Long64_t BinarySearch(Long64_t n, const Float_t *array, Float_t value);
static Long64_t BinarySearch(Long64_t n, const Float_t **array, Float_t value);
static Long64_t BinarySearch(Long64_t n, const Double_t *array, Double_t value);
static Long64_t BinarySearch(Long64_t n, const Double_t **array, Double_t value);
static Long64_t BinarySearch(Long64_t n, const Long64_t *array, Long64_t value);
static Long64_t BinarySearch(Long64_t n, const Long64_t **array, Long64_t value);
// Sorting
static void Sort(Int_t n, const Short_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Int_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Float_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Double_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Int_t n, const Long64_t *a, Int_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Short_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Int_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Float_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Double_t *a, Long64_t *index, Bool_t down=kTRUE);
static void Sort(Long64_t n, const Long64_t *a, Long64_t *index, Bool_t down=kTRUE);
New functions in TLorentzVector
Double_t Et2() const; // Transverse energy squared.
Double_t Et() const; // Transverse energy.
Double_t Et2(const TVector3 &) const; // Transverse energy w.r.t. given axis squared.
Double_t Et(const TVector3 &) const; // Transverse energy w.r.t. given axis.
Improvements in ACLIC
Implements autoloading for ACLiC. Essentially this means
that a script that can be interpreted thanks to the fact that ROOT
automatically loads dependent library, can now also be loaded via
ACLiC (without the user explicitly loading the dependent library).
We added a new option to rootcint --lib-list-prefi=xxx.
When used, it tells rootcint to read a list of rootmap files
in xxx.in and output in xxx.out a list of libraries where the
symbols in the header files can be found.
Also to keep track of the dependencies, the library produced by
ACLiC are now explictly linked to all the libraries loaded in
ROOT at the time (which now included the result of autoloading).
This allow the resulting library to be also loaded in a new
session (with the user loading any other library).
New features in TF1
- New algorithm for TF1::Derivative with better precision.
- New functions TF1::Derivative2 and TF1::Derivative3 computing the second
and third derivative (from original code by Anna Kreshuk)
- gausn: a normalized gaussian
- landaun: a normalized landau
The expression "gaus" is a substitute for
[0]*exp(-0.5*((x-[1])/[2])**2)
To obtain a standard normalized gaussian, use "gausn" instead of "gaus".
The expression "gausn" is a substitute for
[0]*exp(-0.5*((x-[1])/[2])**2)/sqrt(2*pi*[2])
The "gaus" and "gausn" functions use now TMath::Gaus.
Graphics
- New function PaintFillAreaHatches (see the help of this function for
details) to paint hatches with lines. These hatches are visible in PS
files with gv even with anti-aliasing on.
- New entry Canvas.PrintDirectory in system.rootrc. The default value is
".". It allows to define the directory in which the files generated from
the TPad "Save" menu item are saved.
- In TEllipse::DrawEllipse take into account the option kNoEdges
- With CONT1 (and option LIST)option, the contours were not properly sorted if they were
all negative. This is fixed by initializing the variable "first" to
"ncontour-1" instead of "0".
Also in case of positive and negative
contours, the 1st positive contour was always returned at the beginning
of the list. Now all the negative contours are returned first
then all the positive ones.
- In TLatex, #splitline now uses the normal alignment rules
- Plotting options POL and COL can now be combined (2D histograms) to get a color plot in polar coordinates.
- New option COL to draw trees.
tree.Draw("x:y:z","","col");
the z variable is mapped on the color table.
- New options in TGraphErrors::Paint, TGraphAsymmErrors::Paint and in
TGraphBentErrors::Paint :
if option "2" is specified error rectangles are drawn.
if option "3" is specified a filled area is drawn through the end
points of the vertical error bars.
if option "4" is specified a smoothed filled area is drawn through
the end points of the vertical error bars.
Example:
{
gROOT->Reset();
c1 = new TCanvas("c1","A Simple GraphErrors Example",200,10,700,500);
const Int_t n = 20;
Double_t x[n], y[n], ex[n], ey[n];
for (Int_t i=0;i<n;i++) {
x[i] = i*0.1;
y[i] = 10*sin(x[i]+0.2);
ex[i] = 0.08;
ey[i] = 0.1*i;
}
gr = new TGraphErrors(n,x,y,ex,ey);
gr->Draw("A3");
}
- New method PaintDate() in TPad to paint the current date and time if
the option date is on. This new method is used in PaintModified and Paint
methods. Previously the date painting was done in PaintModified only
which prevented to get the date in the PostScript output. Calling
PaintDate from Paint allows to also get the date in the PostScript
output.
- Log scales are taken into account with option TEXT (2d histograms drawing).
Graphical cuts
- TH2::ProjectionX, TH2::ProjectionY, TH2::ProfileX and TH2::ProfileY can
now be performed according to graphical cuts.
Using a TCutG object, it is possible to select a sub-range of a 2-D histogram.
One must create a graphical cut (mouse or C++) and specify the name
of the cut between [] in the option.
For example, with a TCutG named "cutg", one can call:
myhist->ProjectionX(" ",firstybin,lastybin,"[cutg]");
To invert the cut, it is enough to put a "-" in front of its name:
myhist->ProjectionX(" ",firstybin,lastybin,"[-cutg]");
It is possible to apply several cuts:
myhist->ProjectionX(" ",firstybin,lastybin,[cutg1,cutg2]");
Example:
{
TCanvas *c = new TCanvas("c","example",0,0,700,600);
c->Divide(1,2);
TCutG *gcut = new TCutG("gcut",8);
gcut->SetPoint(0,-0.646552,0.932203);
gcut->SetPoint(1,-1.26437,0.105932);
gcut->SetPoint(2,-0.574713,-1.10169);
gcut->SetPoint(3,0.948276,-0.338983);
gcut->SetPoint(4,1.07759,0.720339);
gcut->SetPoint(5,-0.316092,-0.0847458);
gcut->SetPoint(6,-0.45977,0.402542);
gcut->SetPoint(7,-0.646552,0.932203);
TFile f("hsimple.root")
TH2F *hpxpy = (TH2F*)f.Get("hpxpy");
TH1D *hppx = hpxpy->ProjectionX("",1,40,"[gcut]");
c->cd(1);
hpxpy->SetFillColor(kBlue);
hpxpy->DrawCopy("box");
hpxpy->SetFillColor(kRed);
hpxpy->Draw("same box [gcut]");
c->cd(2);
hppx->Draw();
}
Time Axis
- In TGaxis::Paint the member tm_isdst of the tm C struct is set to 0.
Before it was -1. -1 meant "daylight saving time is not available". 0
means "daylight saving time is not in effect". See the man pages of mktime
for more details. Before this fix the following macro produced an X axis
shifted by one hour for the months between April and October (the month
is now fixed to July).
{
TCanvas* c = new TCanvas("c","Data",600,500);
TDatime da(2004,07,09,00,00,00);
Int_t t0 = da.Convert();
Int_t dt = 5.*60.*60.;
TH2F* hiscom = new TH2F("hiscom","",1000,0.,dt,10,0.,1.);
hiscom->GetXaxis()->SetTimeOffset(t0);
hiscom->GetXaxis()->SetTimeDisplay(1);
hiscom->GetXaxis()->SetTimeFormat("%d-%H:%Mh");
hiscom->GetXaxis()->SetLabelSize(0.021);
hiscom->GetXaxis()->SetLabelOffset(0.02);
hiscom->GetXaxis()->SetNdivisions(210);
hiscom->Draw("");
}
SVG and PDF files
- In SVG output the markers "Up Triangle" and "Down triangle" were inverted.
- Fix a text alignment problem in PDF files
- The CropBox is now defined in PDF files. It defines the region containing the
picture. This is used by external programs such as LaTeX to include
precisely PDF files in documents.
- In some cases the R, G, B components of a color may be very small. In that
case WriteReal() produces a number in exponent notation which is not
accepted by the setcolor PDF operator. Now, if the one of the color's
component is less than 0.000001, it is set to 0.
TGraph, TArrow, TCurlyArc, TCurlyLine, TH1 and TH2 Graphics editors
.
The Editors for changing the attributes of TGraph, TArrow, TCurlyLine, TCurlyArc,
TH1/TH2 and the rebinning
of TH1/TH2 via the GUI have been implemented.
- All draw options of TGraph, TArrow, TCurlyLine, TCurlyArc, TH1/TH2 can be set by using the Editors.
Changing histograms and graphs without typing any command makes it possible to
create the wished layout in a short time. Saving the histogram/graph via the Canvas Menu
as a macro, it can be used as a prototype.
- Becoming quite large the Editor is seperated in up to three Tabs. For the THEditors, the first
Tab Style is reserved for the widgets, which change the appearance of the according object.
Whereas the second Tab Binning provides the GUI elements to rebin the histogram.
- All the widgets, especially the sliders, will give immediate feedback in the Pad and also in the Editor.
Functionalities of the THEditors in detail:
- Style Tab:
- Change the title of the histogram.
- Switch from a 2D plot to 3D plot and vice versa.
- Change type, coordinate system, errors, contours and addons by selecting them from a ComboBox.
- Activate further draw options by setting check boxes.
- Set color and pattern for all drawn objects using special widgets.
- Binning Tab:
- Use Sliders and NumberEntryFields to set the number of bins in the rebinned histogram.
- For the last drawn ntuple the rebinned histogram will be automatically created from the original data stored in the ntuple.
- Press Apply or Ignore Button to adopt or reprobate the rebinned histogram.
- Change the origin of the histogram via a slider to see the binning effect on the data.
- Zoom into a special axis range by moving doublesliders.
- Activate "delayed drawing" CheckBox to see the changes on the histogram only after releasing the sliders.
New GUI MDI classes
new MDI (Multiple Document Interface) GUI classes. Ported from xclass 95.
To see how this works and for example code
see $ROOTSYS/tutorials/mditest.C.
Improvements in TASImage
ASImage (generic image manipulation library by Sasha Vasko)
is now supported for all ROOT platforms.
That allows to read, browse (via TBrowser) images of the following formats:
XPM, PNG, JPG,XCF,PNM,PPM,BMP,ICO,CUR,GIF,TIFF,XBM
write images into the following formats:
XPM, JPG, PNG, GIF, TIFF
That also allows to generate images (without X server) via XML scripts.
Numerous new methods added to TImage/TASImage class which allow
sophisticated image processing, drawing vector graphics, convertion images from/to arrays.
Many of these methods are added to image context menu.
For details see TASImage documentation at
http://root.cern.ch/root/htmldoc/TASImage.htm
Try image tutorials rose_image.C, galaxy_image.C, img2pad.C and new one
hist2image.C which converts 2D histogram to image.
The GUI Builder: new class TGuiBuilder
ROOT GUI Builder principles
You can start the builder from the canvas Inspect menu.
With the GUI builder, we try to make the next step from WYSIWYG
to embedded editing concept - WYSIWYE ("what you see is what you edit").
The ROOT GUI Builder allows modifying real GUI objects.
For example, one can edit the existing GUI application $ROOTSYS/tutorials/guitest.C.
GUI components can be added to a design area from a widget palette,
or can be borrowed from another application.
One can drag and and drop TCanvas's menu bar into the application.
GUI objects can be resized and dragged, copied and pasted.
ROOT GUI Builder allows changing the layout, snap to grid, change object's
layout order via the GUI Builder toolbar, or by options in the right-click
context menus.
A final design can be immediatly tested and used, or saved as a C++ macro.
For example, it's possible to rearrange buttons in control bar,
add separators etc. and continue to use a new fancy control bar in the
application.
The following is a short description of the GUI Builder actions and key shortcuts:
- Press Ctrl-Double-Click to start/stop edit mode
- Press Double-Click to activate quick edit action (defined in root.mimes)
Selection, grabbing, dropping
It is possible to select, drag any frame and drop it to any frame
- Click left mouse button or Ctrl-Click to select an object to edit.
- Press right mouse button to activate context menu
- Mutiple selection (grabbing):
- draw lasso and press Return key
- press Shift key and draw lasso
- Dropping:
- select frame and press Ctrl-Return key
- Changing layout order:
- select frame and use arrow keys to change layout order
- Alignment:
- draw lasso and press arrow keys (or Shift-Arrow key) to align frames
Key shortcuts
o Del - delete selected frame
o Shift-Del - crop action
o Ctrl-X - cut action
o Ctrl-C - copy action
o Ctrl-V - paste action
o Ctrl-R - replace action
o Ctrl-L - compact layout
o Ctrl-B - break layout
o Ctrl-H - switch horizontal-vertical layout
o Ctrl-G - switch on/off grid
o Ctrl-S - save action
o Ctrl-O - open and execute a ROOT macro file. GUI components created
after macro execution will be emebedded to currently edited
design area.
o Ctrl-N - create new main frame
General GUI improvements
The File/Print menu
The Print command in the TCanvas File menu is enabled and pops-up a
proper print dialog where the user can specify his preferred print
command and printer. Both print parameters can be set via the new
Print.Command and Print.Printer rootrc resources as follows:# Printer
settings.
WinNT.*.Print.Command: AcroRd32.exe
Unix.*.Print.Command: a2ps -P%p --landscape --columns=2 --margin=30 -rf8.0 %f
Print.Printer: 32-rb205-hp
Print.Directory: .
If the %p and %f are specified as a part of the print command, they will
be replaced by the specified printer name and the file name. All other
parameters will be kept as they are written. Examples are provided in
system.rootrc file.The print button was added to the canvas tool bar
(activated via View menu/Toolbar).
The File/Save menu
Using File/Save cascade menu users can save the canvas as one of the
files from the list. Please note that saving this way will overwrite the
file with the same name. The protection of the file overwriting was
included if saving a file via the SaveAs dialog. A message appears if
the file already exists and asks users to overwrite it (Yes/No).
All supported file types can be saved via File menu / SaveAs. The last
selected file type is kept when the dialog pops-up next time.
The old and new graphics editors
If you are still using the old Editor of ROOT, you should include the
following line in the rootrc file:
Root.PadEditor GedOld
By default the new pad editor, named 'Ged' is set. The set editor can be
toggled by selectingthe canvas View menu / Editor. It appears on the
left side if the canvas window. users can edit the attributes of the
selected object vie provided new GUI in the editor frame. An object in
the canvas is selected after the left mouse click on ot. Its name name
is displayed on the top of the editor frame with a set of options
available for interactive changing. If the editor frame needs more space
then the canvas window, a vertical scroll bar appears for easy
navigation. A known GUI bug here is that the editor frame keeps its
initial height and it does not fit to the canvas window height after
some canvas resizing.
The buttons for primitive drawing are placed in the toolbar that users
can toggled by selecting the canvas View menu / Toolbar. All picture
buttons provide so-called tool tips for help.
New "garbage collection" method
New "garbage collection" method introduced which allows simplify
frames, layout hints deallocation.
For details look at
http://root.cern.ch/root/htmldoc/TGCompositeFrame.html#TGCompositeFrame:SetCleanup
32k pixmap limitation
Limitation on number of entries ( < 3000) fixed for TGListBox class (not for win32 yet)
Improvements in RootShower demo
- New color scheme for particle tracks, to obtain a better
rendering.
- Introduction of TGenPhaseSpace class usage for generation of
secondaries.
- Code changed to be compliant with ROOT coding conventions.
- Two new files for win32 users : Physics.hlp and Physics.cnt (used
with
help-physics recalls menu entry).
- Small layout improvements and new left/right pictures with
transparent
background.
New Graphics 3-D classes TBuffer3D, TVirtualViewer3D and TViewerOpenGL
TViewerOpenGLThe 3-D graphics system has been redesigned to show more
homogeneity between the various packages and the graphics drivers. A new experimental
OpenGL viewer has been created (at present time it works only for 3D objects
- inherited from TAtt3D). It can be activated from the View
menu of the canvas. See the Help button in the viewer.
Scene Properties
You can add clipping plane by clicking the checkbox and
specifying the plane's equation A*x+B*y+C*z+D=0.
Colors
After you selected an object or a light source, you can modify
object's material and light source color.
Light Sources
There are two pickable light sources in the current
implementation. They are shown as spheres. Each light source has three light
components : DIFFUSE, AMBIENT, SPECULAR. Each of this components is defined by
the amounts of red, green and blue light it emits. You can EDIT this parameters:
1. Select light source sphere. 2. Select light component you want to modify by
pressing one of radio buttons. 3. Change RGB by moving sliders
Material Rendering
Object's material is specified by the percentage of
red, green, blue light it reflects. A surface can reflect diffuse, ambient and
specular light. A surface has two additional parameters: EMISSION - you can make
surface self-luminous; SHININESS - modifying this parameter you can change
surface highlights. Sometimes changes are not visible, or light sources seem not
to work - you should understand the meaning of diffuse, ambient etc. light and
material components. For example, if you define material, wich has diffuse
component (1., 0., 0.) and you have a light source with diffuse component (0.,
1., 0.) - you surface does not reflect diffuse light from this source. For
another example - the color of highlight on the surface is specified by: light's
specular component, material specular component. At the top of the color editor
there is a small window with sphere. When you are editing surface material, you
can see this material applyed to sphere. When edit light source, you see this
light reflected by sphere whith DIFFUSE and SPECULAR components (1., 1., 1.).
Objects Geometry editor
You can edit object's location and stretch it by
entering desired values in respective number entry controls.
How to view detector geometries by default using the new GL
viewer
TGeoVolume::Draw uses the TEnv variable Viewer3D.DefaultDrawOption as
an option to draw. If this environment variable is defined in system.rootrc (or
.rootrc), it is used to specify the default value when drawing a volume. For
example, if this variable is set to "ogl", the TViewerOpenGL viewer will be used
by default to draw TGeo objects instead of TPad.
class TApplication: Exiting from ROOT
The user can finally exit ROOT even if the
system is crashing within the CINT clean-up routines.
Namely, we now support:
.qqqqq (or .QQQQQ) calls gSystem->Exit
.qqqqqqq (or .QQQQQQQ) calls gSystem->Abort
This matches the corresponding CINT options:
qqqqq : exit process immediately
qqqqqqq : abort process
PyROOT improvements
There are improvements to most of the PyROOT functionality
(by Wim Lavrijsen, as well as some
completely new features. Most changes were initiated by user input and from
the fallout of a basic, but real-life, ATLAS Z->ee analysis example.
Python/C++ language features
C++ namespaces, global pointer variables, global enums, static methods, and
STL classes are now correctly handled. All pointers and references that enter
python are now cast to the actual underlying object. Special cases, such as
the gPad global are handled.
Foundation classes, such as TString, TList, TTree, etc., are enriched with
member functions that implement the python protocols appropriate for their
use. Some examples: all TSeqCollection derived classes can now be used in
python style loops, sliced, searched, counted, etc. TTree instances can be
browsed directly by accessing the leaves as if these were data members. The
TF1 class got an additional contructor which accepts a python function. Thus,
it is possible to plot python functions, and to use them to fit histograms.
Access to, and use of ROOT/CINT
Some of the basic ROOT/CINT commands (.q, .!, .x, .cd, .ls, and .pwd) are
mimicked, CINT global scope variables are directly accessible, and interpreted
classes can be instantiated, albeit through their default constructor only.
The "from ROOT import *" language construct no longer uses the exception hook
and it can safely be used in scripts. It is, however, still not recommended.
Code quality
Judicious use of caches, laziness, and a tighter memory management have
improved speed and lowered the amount of memory usage. Better checks for null
pointers and array boundaries reduces crashes and worse problems in end-user
python sessions.
To build, it is no longer necessary to configure ROOT with the
--enable-explicitlink option, which helps portability. Linkage problems with
auto-loading have been resolved for the most popular platforms: Linux, MacOSX,
and Win32. The public interfaces have comments that work with the automatic
documentation generation.
Modifications in TThread and related classes
New Howtos
New tutorials
- transpad.C demonstrating the use of transparent pads.
- mathGammaNormal.C
- mathBeta illustrating the new functions TMath::BetaDist and TMath::BetaDistI
- mditest.C
- earth.C illustrating the new contour draw options
// "AITOFF" : Draw a contour via an AITOFF projection
// "MERCATOR" : Draw a contour via an Mercator projection
// "SINUSOIDAL" : Draw a contour via an Sinusoidal projection
// "PARABOLIC" : Draw a contour via an Parabolic projection
// from an original macro sent by Ernst-Jan Buis
The picture produced by the new tutorial earth.C is visible at
http://root.cern.ch/root/htmldoc/THistPainter.html#THistPainter:PaintContour
- latex4.C showing greek letters and variants.
The Greek characters table is now complete. Some of the Greek capital
letters were missing. Some special Greek letter, like varUpsilon, have
been added. The list is now:
#alpha #beta #chi #delta #varepsilon #phi #gamma #eta #iota #varphi
#kappa #lambda #mu #nu #omicron #pi #theta #rho #sigma #tau #upsilon
#varomega #omega #xi #psi #zeta #Alpha #Beta #Chi #Delta #Epsilon #Phi
#Gamma #Eta #Iota #vartheta #Kappa #Lambda #Mu #Nu #Omicron #Pi #Theta
#Rho #Sigma #Tau #Upsilon #varsigma #Omega #Xi #Psi #Zeta #varUpsilon
#epsilon
- ContourList.C: Shows how to get a list of contours from a TH2.
- nucleus.C showing with OpenGL a nucleus with a variable
number of protons and neutrons (default is 40,60).
- threads.C, threadsh1.C: see section about threads above
ROOT page - Class index - Top of the page