This new, backward compatible, version has major enhancements described below.
Binaries for all supported platforms are available at:
http://root.cern.ch/root/Version400.html
Versions for AFS have also been updated. See the list of supported platforms:
http://root.cern.ch/root/AFS.html
Both links are reachable via the download page. Note that with this release,
we are supporting binaries for more platforms/compilers.
A new version of the USERS GUIDE is available at:
http://root.cern.ch/root/doc/RootDoc.html
Individual pdf files corresponding to each chapter can be downloaded separately.
For more information, see:
http://root.cern.ch
Ilka Antcheva,
TTree::SetMaxTreeSize(Long64_t maxsize)
Double32_t fPt:
Double32_t fVertex[3];
Int_t fNtracks;
Double32_t *fPx; //[fNtracks]
The new data type is supported in all I/O modes (TKey or TTree).
The automatic schema evolution algorithm accepts this new type. For example a class in a file containing a Double_t data member can be read by a new class where the member is now of type Double32_t and vice-versa.
template <class T> void GetObject(const char* namecycle, T*& ptr) // See TDirectory::Get for information virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0); virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *option=""); template <class T> Int_t WriteObject(const T* obj, const char* name, Option_t *option="") // see TDirectory::WriteObject or TDirectoryWriteObjectAny for explanation virtual Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option=""); virtual Int_t WriteObjectAny(const void *obj, const TClass *cl, const char *name, Option_t *option="");In particular to save any object (including TObject*) in both compiled code and interpreted code, just do:
ptrclass *ptr;
directory->WriteObject(ptr,"name");
To read back an object, the prefered interface for both compiled code
and interpreted code for non TObject* is (It also works with TObject*).
ptrclass *ptr = 0;
directory->GetObject("name",ptr);
The TZIPFile class describes a ZIP archive file containing multiple sub-files. Typically the sub-files are ROOT files. Notice that the ROOT files should not be compressed when being added to the ZIP file, since ROOT files are normally already compressed. Such a ZIP file should be created like:
zip -n root multi file1.root file2.root
which creates a ZIP file multi.zip.
A ZIP archive consists of files compressed with the popular ZLIB compression algorithm. The archive format is used among others by PKZip and Info-ZIP. The compression algorithm is also used by GZIP and the PNG graphics standard. The format of the archives is explained briefly below. This class provides an interface to read such archives.
The ROOT files in an archive can be simply accessed like this:
TFile *f = TFile::Open("multi.zip#file2.root")
or
TFile *f = TFile::Open("root://pcsalo/multi.zip#2")
where the second form opens the 3rd ROOT file in the archive via rootd.
A TFile can also be used to just browse an archive file, like:
TFile *f = TFile::Open("multi.zip")
f->GetArchive->Print()
A TBrowser and TChain interface will follow shortly.
TLorentzVector v;without executing gSystem->Load("libPhysics").
The new method TClass::GetSharedLibs() returns the library containing the code of the class and the libraries it depends on. This information is obtained from TCint and cached in TClass.
The XML format should be used only for small data volumes, typically histogram files, pictures, geometries, calibrations. The XML file is built in memory before being dumped to disk.
Like for normal ROOT files, XML files use the same I/O mechanism exploiting the ROOT/CINT dictionary. Any class having a dictionary can be saved in XML format.
This first implementation does not support subdirectories or Trees.
The shared library libRXML.so may be loaded dynamically via gSystem->Load("libRXML"). This library is automatically loaded by the plugin manager as soon as a XML file is created via, e.g.:
TFile::Open("file.xml","recreate");
TFile::Open() returns a TXMLFile object. When a XML file is open in write mode,
one can use the normal TObject::Write() to write an object in the file.
An example of a session saving a histogram to a XML file:
TFile *f = TFile::Open("Example.xml","recreate");
TH1F *h = new TH1F("h","test",1000,-2,2);
h->FillRandom("gaus");
h->Write();
delete f;
An example of a session reading the histogram from the file:
TFile *f = TFile::Open("Example.xml");
TH1F *h = (TH1F*)f->Get("h");
h->Draw();
A new option in the canvas "File" menu is available to save
a TCanvas as a XML file. One can also do
canvas->Print("Example.xml");
Plugin.TVirtualPadEditor: Ged TPadEditorOld GedOld "TPadEditorOld()" #Plugin.TVirtualPadEditor: Ged TGedEditor Ged "TGedEditor(TCanvas*)"With the new editor, new widgets for editing line, fill, text and marker attributes have been introduced, as well as a new axis attribute editor.
--enable-qt \
--with-qt-incdir=$QT/include \
--with-qt-libdir=$QT/lib \
where $QT points to the directory where the Qt software has been installed.
The Qt version >= 3.1 is required for this interface.
The Qt package itself must have been compiled with the same compiler
and compiler options as used to compile ROOT.
Once the $ROOTSYS/lib/libGQt.so (dll) library is created, one has the possibility to select this driver as an alternative to libGX11 by adding the following two lines in the local ".rootrc" file
Gui.Backend: qt
Gui.Factory: qt
The package has currently been tested on Linux only.
This first implementation may show some deficiencies compared to
the libGX11 default version.
Please report any problems with this version to
rootdev@root.cern.ch as well as fine@bnl.gov
The test directory contains an extensive stress code of the package, stressLinear.cxx, which is also a good source for code examples. In addition, the tutorial directory contains examples for the many ways to invert a matrix (invertMatrix.C) and solve a linear least-squares problem with the matrix package (solveLinear.C).
A compile option is available (-DCBLAS) which forces the usage of hardware-optimized CBLAS routines at critical positions. For instance on the PowerPC platform, these routines use the AltiVec processor. Speed improvements have been observed for matrices (40x40).
Summary of the main new features:
minimize c^T x + ( 1/2 ) x^T * Q x
subject to A x = b
clo <= C x <= cup
xlo <= x <= xup
where Q, A and C are matrices and the other are vectors. The only requirements on these
elements is that Q is positive semidefinite and at least one x-component
is bound on at least one side. A detailed description of this subject can
be found in the on-line book by Robert vanderBei at http://www.princeton.edu/~rvdb/LPbook
The implementation is mostly based on the package OOQP by Mike Gertz and Steve Right, http://www.cs.wisc.edu/~swright/ooqp. Here extensive documentation about the implementation details can be found.
A very simple application would be to find a point in a space, bound by many surfaces, which has the shortest distance to a some point outside this bound region. However, the package has been setup the handle much larger problems with up to hundreds of variables. Depending on the structure of the problem, two different formulations can be used: TQpProbDens, for dense matrices and TQpProbSparse, for sparse ones. Furthermore, the user can then choose between two solving algorithms: TMehrotraSolver or TGondzioSolver.
In the tutorial directory the usage of Quadp is shown in great detail for a financial application: optimization of a stock portfolio. In addition, the test directory contains a stress test, QpRandomDriver.cxx. Here, the user can specify the number of free variables, equality and inequality constrains and after randomly generating a solution vector, the other elements of problem are made. Quadp's solution is then compared with the original solution vector.
static Double_t Mean(Int_t n, const Short_t *a,const Double_t *w=0); static Double_t Mean(Int_t n, const Int_t *a,const Double_t *w=0); static Double_t Mean(Int_t n, const Float_t *a,const Double_t *w=0); static Double_t Mean(Int_t n, const Double_t *a,const Double_t *w=0); static Double_t Mean(Int_t n, const Long_t *a,const Double_t *w=0); static Double_t Mean(Int_t n, const Long64_t *a,const Double_t *w=0); static Double_t GeomMean(Int_t n, const Short_t *a); static Double_t GeomMean(Int_t n, const Int_t *a); static Double_t GeomMean(Int_t n, const Float_t *a); static Double_t GeomMean(Int_t n, const Double_t *a); static Double_t GeomMean(Int_t n, const Long_t *a); static Double_t GeomMean(Int_t n, const Long64_t *a); static Short_t Median(Int_t n, const Short_t *a, const Double_t *w=0, Int_t *work=0); static Int_t Median(Int_t n, const Int_t *a, const Double_t *w=0, Int_t *work=0); static Float_t Median(Int_t n, const Float_t *a, const Double_t *w=0, Int_t *work=0); static Double_t Median(Int_t n, const Double_t *a, const Double_t *w=0, Int_t *work=0); static Long_t Median(Int_t n, const Long_t *a, const Double_t *w=0, Int_t *work=0); static Long64_t Median(Int_t n, const Long64_t *a, const Double_t *w=0, Int_t *work=0); static Double_t MedianSorted(Int_t n, Double_t *a); static Double_t RMS(Int_t n, const Short_t *a); static Double_t RMS(Int_t n, const Int_t *a); static Double_t RMS(Int_t n, const Float_t *a); static Double_t RMS(Int_t n, const Double_t *a); static Double_t RMS(Int_t n, const Long_t *a); static Double_t RMS(Int_t n, const Long64_t *a);
static void Sort(Int_t n, const Long64_t *a, Int_t *index, Bool_t down=kTRUE); static void Sort(Long64_t n, const Long64_t *a, Long64_t *index, Bool_t down=kTRUE);
static Double_t Erfc(Double_t x);
static Double_t ErfInverse(Double_t x);
static Double_t ErfcInverse(Double_t x) {return TMath::ErfInverse(1-x);}
static Double_t Beta(Double_t p, Double_t q); static Double_t BetaCf(Double_t x, Double_t a, Double_t b); static Double_t BetaIncomplete(Double_t x, Double_t a, Double_t b); static Double_t Binomial(Int_t n,Int_t k); // Calculate the binomial coefficient n over k static Double_t BinomialI(Double_t p, Int_t n, Int_t k); static Double_t FDist(Double_t F, Double_t N, Double_t M); static Double_t FDistI(Double_t F, Double_t N, Double_t M); static Bool_t Permute(Int_t n, Int_t *a); // Find permutations static Double_t Student(Double_t T, Double_t ndf); static Double_t StudentI(Double_t T, Double_t ndf);
Binomial() Permute()by F. Carminati. See also the corresponding tutorials binomial.C and permute.C.
TList *fUserInfo;
and the corresponding getter function
TList *TTree::GetUserInfo();
With this addition, it is possible to add any user defined object to the Tree
that is not depending on the entry number.
Without this facility, users were forced to derive from TTree to add
their own attributes or objects.
By default, the list is not created. The list is created at the first call
to GetUserInfo().
Implemented splitting of TClonesArray and vectors which are embedded (as opposed to pointed to) in a base class.
Add a new static function:
TTree *TTree::MergeTrees(TList *list)
static function merging the Trees in the TList into a new Tree.
Trees in the list can be memory or disk-resident trees
The new tree is created in the current directory (memory if gROOT).
See also new function TTree::Merge().
In TTree, we added a method MakeProxy and modified the behavior of TTree::Draw. In TTreePlayer we added TTreePlayer::MakeProxy and TTreePlayer::DrawScript.
TTreeProxyGenerator is a new class implementing the generation of the skeleton.
TBranchProxy is the base class of a new hierarchy of classes implementing the indirect access to the branch of a TTree. The main features are:
Double_t somepx = fTracks.fPx[2];
somepx is updated with the current fPx of the 3rd track.
TTree::Draw() has been updated so that upon seeing:
tree->Draw("h1analysis.C+","")
tree->Draw("h1analysis.C+","h1analysisCut.C")
If h1analysis.C (and h1analysisCut.C in the 2nd case) are readable files,
the new MakeProxy will be used instead of TTreeFormula. Currently
TTreeFormula and 'TBranchProxy' can not be used together.
Both files are expected to be source files which contain at least a free standing function with the signature:
x_t filename();and
y_t cutfilename();x_t and y_t needs to be type that can convert respectively to a double and a bool (because the code does; if (cutfilename()) htemp->Fill(filename());
The 2 free standing functions are run in a context such that the branch names are available as local variables of the correct (read-only) type.
Note that if you use the same 'variable' twice, it is more efficient to 'cache' the value. For example
Int_t n = fEventNumber; // Read fEventNumber
if (n<10 || n>10) { ... }
is more efficient than
if (fEventNumber<10 || fEventNumber>10)Also, optionally, the generated selector will also call methods named scriptname_methodname in each of 6 main selector methods if the method scriptname_methodname exist.
Concretely, with the script named h1analysisProxy.C,
The method calls the method (if it exist) Begin -> h1analysisProxy_Begin SlaveBegin -> h1analysisProxy_SlaveBegin Notify -> h1analysisProxy_Notify Process -> h1analysisProxy_Proces SlaveTerminate -> h1analysisProxy_SlaveTerminate Terminate -> h1analysisProxy_TerminateIf 'filename' is suffixed with an ACLiC mode, the ACLiC mode is enforced Note that at this time, interpreted mode is not supported and if no ACLiC mode is specified, a '+' is used by default.
The generated script file (currently generatedSel.h but subject to change in a future release) is intentionally not deleted at the end of the processing. Also if the file already exist, it is updated if and only if the new version is different. In particular this means issuing twice in a row:
tree->Draw("Script.C+");
does not result in a second (useless) compilation.
For example to draw px using the file hsimple.root (generated by the hsimple.C tutorial) just have a hsimple.cxx file:
double hsimple() {
return px;
}
and do:
new TFile("hsimple.root")
tree = ntuple
draw(tree,"hsimple.cxx");
or
draw(tree,"hsimple.cxx+");A more complete example has been added to the tutorials directory: h1analysisProxy.cxx , h1analysProxy.h and h1analysisProxyCut.C, which reimplement the selector found in h1analysis.C
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.
Double_t TH1::Chi2Test(TH1 *h, Option_t *option, Int_t constraint)
Add an optional argument to TH1::GetMinimum and TH1::GetMaximum
Double_t TH1::GetMinimum(Double_t minval=-FLT_MAX)
The function returns the minimum value of the histograms for bins
with a content greater than minval. For example, h->GetMinimum(0) returns
the minimum of all bins with non zero contents.
Symmetric behaviour for TH1::GetMaximum().
Several improvements in the histogram painter:
void TRandom::Sphere(Double_t &x, Double_t &y, Double_t &z, Double_t xlong)
which generates random vectors, uniformly distributed over the surface
of a sphere of given radius.
virtual void SetDecimals(Bool_t dot=kTRUE); // *TOGGLE*
sets the Decimals flag.
By default, blank characters are stripped, and then the
label is correctly aligned. The dot, if last character of the string,
is also stripped, unless this option is specified.
One can disable the option by calling axis.SetDecimals(kTRUE).
Double_t TCutG::Integral(TH2 *h, Option_t *option) const
computes the integral of 2-d histogram h for all bins inside the cut.
if option "width" is specified, the integral is the sum of
the bin contents multiplied by the bin width in x and in y.
TSpline::SaveAs()
to generate C++ code for the spline. This code can be used in a non
ROOT application.
Support feedback histograms, i.e. histograms that are periodically fed back to the client to follow the progress of the query.
New performance monitoring framework.
Optimizations in the packetizer code.
New proof.conf keyword "master" and "worker" in place of "node" and "slave" keywords (the old ones remain valid for backward compatibility).
Set shell variable PROOF_SANDBOX to the session directory (i.e. sandbox)), this env var can be used in the package setup scripts.
Support for UsrPwd authentication via /etc/hosts.equiv and/or $HOME/.rhosts.
Make code more robust by using snprintf() (or std::string's) to avoid boundary violations.
Fix problem with Krb5 credential exporting for daemons with superuser privileges; complete cleanup of allocated memory on server side; improved support for non-default principals.
Fix problem with AFS authentication in case shadow passwords are inaccessible to the process.
Support for 'authenticated' sockets: authentication is delegated to TSocket by calling a static method
CreateAuthSocket()
returning a TSocket*. TSocket is now the only class calling TAuthenticate.