ROOT version 6.00/00 has been released on May 30, 2014. It introduces the new Cling C++11 interpreter, replacing CINT that has served ROOT well for many years.
For more information, see:
The following people have contributed to this new version:
Bertrand Bellenot, CERN/SFT,
Dario Berzano, CERN/SFT,
Rene Brun, CERN/SFT,
Ioan Gabriel Bucur, CERN/SFT
Philippe Canal, FNAL,
Cristina Cristescu, CERN/SFT,
Olivier Couet, CERN/SFT,
Kyle Cranmer, NYU, RooStats,
Anders Eie, NTNU,
Gerri Ganis, CERN/SFT,
Andrei Gheata, CERN/Alice,
Wim Lavrijsen, LBNL, PyRoot,
Sergey Linev, GSI, http,
Anna-Pia Lohfink,
Pere Mato, CERN/SFT,
Lorenzo Moneta, CERN/SFT,
Axel Naumann, CERN/SFT,
Danilo Piparo, CERN/SFT,
Timur Pocheptsov, CERN/SFT,
Fons Rademakers, CERN/SFT,
Paul Russo, FNAL,
Joerg Stelzer, DESY/Atlas, TMVA,
Alja Tadel, UCSD/CMS, Eve,
Matevz Tadel, UCSD/CMS, Eve,
Eckhard von Toerne, University Bonn, ATLAS, TMVA,
Vassil Vassilev, CERN/SFT
Wouter Verkerke, NIKHEF/Atlas, RooFit,
Yue Shi Lai, MIT
Temporarily for version 6.00/00, ROOT has a reduced set of supported platforms. Most notably Windows is not supported until at least 6.02. 6.00/00 supports only
More platforms are expected to be available later; the lack of support stems from Cling and Clang/LLVM not being ported to these platforms yet.
To aleviate the pain for Windows users who want to try ROOT 6 we provide a recipe on how to run ROOT 6 in a VM on Windows.
Building ROOT also requires a C++11 compatible compiler, so one needs to either have installed gcc >= 4.8 or Clang >= 3.4. On most lecagy platforms these newer compilers are available via a special install. See the build prerequisites page.
Despite that, an additional platform as been added: the x32 psAPI, called linuxx32gcc. It is a regular x86-64 ABI but with shorter pointers (4 bytes instead of 8). This reduces the addressable memory per process to 4GB - but that is usally sufficient. The advantages are reduced memory consumption (due to the smaller pointers) and increased performance compared to 32 bit applications due to the availability of the 64 bit instructions. The Clang developers mailing list archive contains a good comparison.
To build and run binaries compiled in x32, toolchain support is needed. That is available in the in binutils (2.22), GCC (4.8), glibc (2.16), Linux kernel (3.4) and even GDB (7.5). These versions are not available in regular distributions yet (except for this beta Gentoo distro built in x32); once they are, building and running x86-64 and x32 side-by-side will be possible.
ROOT 6.00/00 can be built either using the classic “./configure;make” method or using CMake. The CMake system has been completed for this version and should be functionally equivalent to the classic one. The detailed instructions are available. In upcoming releases the classic method will slowly be deprecated in favor of the CMake one.
Cling follows the C++ standard much more strictly than CINT. In particular some code that used to run with CINT will either issue new warnings or new compilation errors. For example when CINT was parsing Namespace::Symbol it would not only apply the C++ search rules but also search in the outer scopes and for this example could actually return ::Symbol instead of (as Cling now does) issuing a compilation error.
Cling no longer supports refering to a class template instantiation of a class template that has all default template parameter without the <>. With:
template <typename T = int> class templt {};
With Cling (and any standard compliant compiler), using *templt<>*
is allowed (but *templt*
is not).
Given namespace N { class A; template <typename T> class B;}
, the name N::B<N::A>
is no longer “shortened” to N::B<A>
. This affects the forward and backward compatibility of files.
CINT would perform automatic upcasts to derived classes under certain contexts:
TH1* h1 = hpx
TH1F* h1f = h1;
Cling does not allow this anymore. We might add this feature later if demand exists (ROOT-4802).
CINT was processing macros line by line; Cling compiles code. When calling a function (or in general using a symbol) that is provided by a library loaded at runtime, Cling will in some cases report an unresolved symbol:
#include "Event.h"
void dynload() {
gSystem->Load("libEvent");
new Event();
}
You will currently have to provide a rootmap file for libEvent (which also requires include guards for Event.h). This might get fixed in a later version (ROOT-4691).
CINT was processing macros line by line; Cling compiles code. During this compilation, Cling will not see identifiers provided by gROOT->LoadMacro()
. While this will covered by dynamic scopes, they are currently too limited to handle this. Please #include
the header instead.
TInterpreter::GetCurrentMacroName()
has a slightly different behavior in ROOT 6 than in ROOT 5. In ROOT 5 it was a synonym for __FILE__
(so please use __FILE__
to get the old value); in ROOT 6 it returns the currently executing (.x) source file. For nested execution it returns the innermost one.
The following are no longer supported and are now only issuing error messages:
Use of Setgvp and Getgvp should be looked at carefully as they were use to control the behavior of the multiplexing CINT wrappers that were both wrapper the calls to operator new with and without placement and the constructor (and similarly for operator delete and the destructor). Cling does not support such a multiplexing wrapper and alternatively interface must be used (See TClass::New and TClass::Destructor for example).
The following interfaces are not yet available:
They might be re-implemented in a later version.
rootcling is the successor to rootcint and it preserves its old commandline arguments and provides more (see help). The executable rootcint still exists but it is just a redirection to rootcling. The following backward incompatibilities are present between rootcint in version 5 and rootcling in version 6:
Error: in this version of ROOT, the option '!' used in a linkdef file
implies the actual existence of customized operators.
The following declaration is now required:
TBuffer &operator<<(TBuffer &,const THit *);
if the operator <<
declaration is missing.
To steer the parsing done during the execution of rootcling, a new macro: __ROOTCLING__ is now defined during the parsing. The macros __CINT__ and __MAKECINT__ are defined only when looking for #pragma
statement.
The genreflex executable is still available, it preserves the same command line options as in version 5 and provides new ones. Old selection XML files are transparently usable by the new implementation. On the other hand some of the new functionalities can be hardly backported to version 5. See genreflex help for all the details about commandline switches and selection files. It is important to note that it is not anymore a python script interfaced to GCCXML but rather a wrapper around rootcling.
In order to specify the classes selection, three methods are available:
ROOT::Meta::Selection
namespace for all the details.Warning
It is important to note that during the parsing of the header files, rootcint no longer defines __CINT__ and genreflex no longer defines __GCCXML__. This means in particular that data members that were made transient by hiding them from rootcint or genreflex now must be explicitly marked as transient. For rootcint or rootcling use:
sometype datamember; //! The exclamation mark signals the transientness
and for genreflex
<class name="edm::Particle" >
<field name="m_calculated" transient="true" />
</class>
or
<class name="edm::Particle" >
<field name="m_calculated" persistent="false" />
</class>
This new set of executables are responsible also for the generation of pcm files. These are crucial for the functioning of ROOT and must reside in the same directory of the libraries which contain the compiled dictionaries.
The tools used to generate rootmap files are rootcling and genreflex. The rlibmap tool is not present any more in ROOT starting from release 6.00.00.
To enhance the set of functionalities offered by ROOT and its new interpreter, the format of the rootmaps evolved. Rootmap in the old format cannot be produced anymore but only read. The new rootmaps can be still be concatenated. A rootmap file now contains:
At ROOT startup, a check is performed on autoload keys. If the same key (which is not a template instantiation) refers to two different libraries (or sets of libraries) a warning is issued. A typical Rootmap file look like:
{ decls }
fwd declaration 1;
fwd declaration 2;
[...]
fwd declaration N;
[ libraryName1 libraryName2 ... ]
class className1
class className2
...
typedef typedefName1
typedef typedefName2
...
header headerName1
header headerName2
...
The list returned by GetListOfTypes
is no longer filled when the dictionary are loaded but instead are filled on demand, when the user explicitly (directly or indirectly) request each typedef. In particular this means that
gROOT->GetListOfTypes()->ls(); // or Print()
no longer prints the list of all available typedef but instead list only the typedefs that have been previously accessed throught the list (plus the builtins types).
ACLiC has the following backward incompatibilities:
New collection TListOfTypes
that implements on demand creation of the TDataType
describing a typedef.
Setenv
coding.Unsetenv
using the system function unsetenv
.5 new predefined palettes with 255 colors are available vis gStyle->SetPalette(n)
:
Add the optional parameter “alpha” to TColor::SetPalette
and TStyle::SetPalette
. The default value is 1. (opaque palette). Any value between 0. and 1 define the level of transparency. 0. being fully transparent and 1. fully opaque.
In SaveAS
implement the possibility to save an object as C code independant from ROOT. It is enough to save the object in a file with the extension “.cc”. The code as to save each objet should be implement in each SavePrimitive
function like in TF1
.
In SetPalette
predefined palettes were redefined even if it was not necessary.
Mnemonic constants are available:
kHAlignLeft = 10, kHAlignCenter = 20, kHAlignRight = 30,
kVAlignBottom = 1, kVAlignCenter = 2, kVAlignTop = 3
They allow to write:
object->SetTextAlign(kHAlignLeft+kVAlignTop);
New method SetTextColorAlpha(ci, alpha)
to set the color index ci
with a transparency percentage.
SetFillColorAlpha(ci, alpha)
to set the color index ci
with a transparency percentage.SetMarkerColorAlpha(ci, alpha)
to set the color index ci
with a transparency percentage.SetLineColorAlpha(ci, alpha)
to set the color index ci
with a transparency percentage.SetLabelColor
and SetLabelColor
have an optional parameter alpha
allowing to change the transparency of the axis labels and axis body.Classes for which a Streamer function was externally provided are no longer split; they were split in v5 if the dictionary was generated via rootcint but were not split if the dictionary was generated via genreflex.
Classes with a custom Streamer function and classes with an older, non StreamerInfo based automatic streamer are also no longer split.
To force the splitting of those classes, thus by-passing the custom Streamer, when storing the object in a TTree and in a collection object, use:
TClass::GetClass(classname)->SetCanSplit(true);
The algorithm used to calculate a single number giving an indication on whether the schema layout has changed (i.e. if two StreamerInfo are equivalent) have been update to
The algorithm that checks whether two StreamerInfo are equal even-though their checksum is different has been significantly enhanced in particular to also check the base classes.
TFileMerger::AddObjectNames(const char *names)
This method can be called several times to add object names. Several names can be added with one call separated by single blancs (no blanc at the end). Directory names are accepted, applying the merging selection to all content. Two new options are being supported for partial merging:
TFileMerger::PartialMerge(flags | kOnlyListed)
This will merge only the objects in the files having the names in the specified list. If a folder is specified, it whole content will be merged
TFileMerger::PartialMerge(flags | kSkipListed)
This will skip merging for the specified objects. If a folder is specified, its whole content will be skipped
Important note: The kOnlyListed and kSkipListed flags have to be bitwise OR-ed on top of the merging defaults: kAll | kIncremental (as in the example $ROOTSYS/tutorials/io/mergeSelective.C)
A new class TS3WebFile has been introduced. The new class TS3WebFile is an extension of TWebFile and belongs to the net module. The name TS3WebFile reflects better the fact that this solution is intended to be generic to several S3 servers and not limited to Amazon’s, in addition to the fact that it actually extends the capabilities of TWebFile.
Compared to the current support of S3 in ROOT (basically the class TAS3File), the modifications include the improvements below:
Here are some examples of usages from the end user perspective:
TFile* f = TFile::Open("s3://s3.amazonaws.com/mybucket/path/to/my/file", "AUTH=<accessKey>:<secretKey> NOPROXY")
TFile* f = TFile::Open("s3://s3.amazonaws.com/mybucket/path/to/my/file") // Uses environmental variables for retrieving credentials
Limitations:
The TAS3File class will be removed and should not have been used directly by users anyway as it was only accessed via the plugin manager in TFile::Open().
A new HTTP Server package has been introduced. The idea behind such server is to provide direct access to the data from a running ROOT application. Any object can be streamed when requested and delivered to the browser.
To start http server, at any time create instance of the THttpServer
class like:
serv = new THttpServer("http:8080");
This will start civetweb-based http server on port 8080. Then, one should be able to open address “http://localhost:8080” in any modern browser and browse objects created in application. By default, the server can access files, canvases and histograms via gROOT. All such objects can be displayed with JSRootIO graphics.
At any time one could register other objects with the command:
TGraph* gr = new TGraph(10);
gr->SetName("gr1");
serv->Register("graphs/subfolder", gr);
If the object content is changing in the application, like for example histograms being continuously filled, one could enable the monitoring flag in the browser, then the object view will be regularly updated.
ROOT offers a new class TTreeReader
that gives simple, safe and fast access to the content of a TTree
. Using it is trivial:
#include "TFile.h"
#include "TH1F.h"
#include "TTreeReader.h"
#include "TTreeReaderValue.h"
void hsimpleReader() {
TH1F *myHist = new TH1F("h1","ntuple",100,-4,4);
TFile *myFile = TFile::Open("hsimple.root");
// Create a TTreeReader for the tree, for instance by passing the
// TTree's name and the TDirectory / TFile it is in.
TTreeReader myReader("ntuple", myFile);
// The branch "px" contains floats; access them as myPx.
TTreeReaderValue<Float_t> myPx(myReader, "px");
// The branch "py" contains floats, too; access those as myPy.
TTreeReaderValue<Float_t> myPy(myReader, "py");
// Loop over all entries of the TTree or TChain.
while (myReader.Next()) {
// Just access the data as if myPx and myPy were iterators (note the '*'
// in front of them):
myHist->Fill(*myPx + *myPy);
}
myHist->Draw();
}
TTreeReader checks whether the type that you expect can be extracted from the tree’s branch and will clearly complain if not. It reads on demand: only data that are actually needed are read, there is no need for SetBranchStatus()
, SetBranchAddress()
, LoadTree()
or anything alike. It uses the memory management of TTree, removing possible double deletions or memory leaks and relieveing you from the need to manage the memory yourself. It turns on the tree cache, accelerating the reading of data. It has been extensively tested on all known types of TTree branches and is thus a generic, fits-all access method for data stored in TTrees.
All the fixes and improvements in the PROOF system occured since the release of 5.34/00 are available both in the latest 5.34 tags and in 6.00/00. The following is a summary of the major modifications since 5.34 .
$ xpdtest [options]
--help, -h
Gives a short list of options avaliable, and exit
-t <test>
type of test to be run:
0 ping the daemon (includes process existence check if pid specified; see below)
1 ping the daemon and check connection for default user
2 ping the daemon and check connection for the default user and all recent users
...
root[] p = TProof::Open("master", "igprof-pp")
Several consolidation fixes in several parts of the system (see the 5.34 patch release notes for details). In particular, those for ‘xproofd’ were provided by B. Butler and M. Swiatlowski and greatly contributed to consolidate the daemon.
TProfile2D
histograms are handled differently because, for this type of 2D histograms, it is possible to know if an empty bin has been filled or not. So even if all the bins’ contents are positive some empty bins might be painted. And vice versa, if some bins have a negative content some empty bins might be not painted."LEGO3"
. Like the option "LEGO1"
, the option "LEGO3"
draws a lego plot using the hidden surface removal technique but doesn’t draw the border lines of each individual lego-bar. This is very useful for histograms having many bins. With such histograms the option "LEGO1"
gives a black image because of the border lines. This option also works with stacked legos."LEGO4"
. Draw a lego plot with hidden surface removal, like LEGO1, but without the shadow effect on each lego-bar.TH2
in LEGO or SURF mode whatever the coordinate system used (car, pol, cyl, sph, and psr). It also handles THStack
(lego only).Fit parameters with very long name destroyed the stats display. This is now fixed.
Example:
{
gStyle->SetOptFit(111);
TH1F *hist = new TH1F("hist","hist",100,-5,5);
TF1 *fit = new TF1("fit","gaus",-5,5);
fit->SetParName(2,"Parameter with very very very very long name");
hist->FillRandom("gaus",5000);
hist->Draw();
hist->Fit(fit);
}
The statistics display has a new option: “I”=2 (the default one remains “i”=1). The value displayed for integral is TH1::Integral("width")
instead of TH1::Integral()
. Example:
{
TH1D * histo1D = new TH1D ("histo1D","",2,0.,4.) ;
histo1D->SetBinContent( 1,1.) ;
histo1D->SetBinContent( 2,2.) ;
TCanvas * canvas = new TCanvas () ;
canvas->Divide(2,1) ;
canvas->cd(1) ; gStyle->SetOptStat("nemruoi") ; histo1D->DrawClone() ;
canvas->cd(2) ; gStyle->SetOptStat("nemruoI") ; histo1D->DrawClone() ;
}
TH1
was drawn improperly in “Logx” mode if “X” axis starts at negative values. The following macro illustrades this problem.
{
TCanvas *c1 = new TCanvas("c1", "c1",0,0,1200,700);
int n = 100;
Float_t d = 0.5;
TH1F *h1 = new TH1F("h1", "x_min = - d", n, -d, 100-d);
h1->Fill(1, 1); h1->Fill(3, 3); h1->Fill(5, 5); h1->Fill(7, 7);
TH1F *h2 = new TH1F("h2", "x_min = +d", n, d, 100+d);
h2->Fill(1, 1); h2->Fill(3, 3); h2->Fill(5, 5); h2->Fill(7, 7);
c1->Divide(1, 2);
c1->cd(1); gPad->SetLogx(); h1->Draw(); // upper picture
c1->cd(2); gPad->SetLogx(); h2->Draw(); // lower picture
h1->GetXaxis()->SetMoreLogLabels();
h2->GetXaxis()->SetMoreLogLabels();
c1_1->SetGridx();
c1_2->SetGridx();
}
PaintStat2
the temporary string used to paint the fit parameters was too small and in some cases the errors where truncated. The size of the string is now the same as in PaintStat
.New option CANDLE
to draw 2D histograms as Candle-PLot (Box-PLot). A Candle plot (also known as a “box-and whisker plot” or simply “box plot”) is a convenient way to describe graphically a data distribution (D) with only the five numbers. It was invented in 1977 by John Tukey.
With the option CANDLEX five numbers are:
The mean value of the distribution D is also represented as a circle.
In this implementation a TH2 is considered as a collection of TH1 along X (option CANDLE
or CANDLEX
) or Y (option CANDLEY
). Each TH1 is represented as a candle plot.
Example:
{
TH2F *hcandle = new TH2F("hcandle","Option CANDLE example ",40,-4,4,40,-20,20);
Float_t px, py;
for (Int_t i = 0; i < 25000; i++) {
gRandom->Rannor(px,py);
hcandle->Fill(px,5*py);
}
hcandle->SetMarkerSize(0.5);
hcandle->Draw("CANDLE");
}
TPadPainter
.The BOX
option was handling TH2::SetMinimum()
differently from the other drawing options. As reported here.
Fix the problem described here. When drawn with option SAME the histogram 1st and last bins might be wrong. The following macro shows the problem:
{
TCanvas *c = new TCanvas("c","c",900,900);
c->Divide (1,2);
TH1D * histo1 = new TH1D ("histo1","histo1",100,0.,100.) ;
histo1->SetBinContent(51,80.) ;
TH1D * histo2 = new TH1D ("histo2","histo2",100,49.9,51.1) ; /// not ok
histo2->SetMinimum(0.) ; histo2->SetMaximum(100.) ;
c->cd(1); gPad->DrawFrame(49.9, 0., 51.1, 100);
histo1->Draw("same");
Double_t xAxis[4] = {3., 5., 7., 9.};
TH1D *histo2 = new TH1D("histo","",3, xAxis);
histo2->SetBinContent(1,2.);
histo2->SetBinContent(2,4.);
histo2->SetBinContent(3,3.);
c->cd(2); gPad->DrawFrame(4.,0., 10.,5.);
histo2->Draw("same");
}
In TGraph2DPainter::PaintLevels
the colour levels used to paint the triangles did not match the minimum and maximum set by the user on the TGraph2D
. This problem was reported here
TAxis::kCanExtend
, which control the axis extensions (for example in case of time axis) and used to replace the old bit TH1::kCanRebin
(see below). Note that this bit is automatically set when the axis has labels associated to each bin. In this case the axis becomes alphanumeric and there is no more relation to the observed quantities. Note that when an axis is alphanumeric the mean and the rms of the histograms are not anymore coputed and they are set to zero.The bit TH1::kCanRebin
used to extend the histogram axes is now deprecated. The bit exists still in ROOT 6.0 but it has no effect. One should use now the new function TH1::SetCanExtend(..)
passing the axis (using the appropriate enumeration), which needs to be extended. In addition to extend each axis individually, the function can be used also to enable/disable extension for all axes. For example TH1::SetCanExtend(TH1::kXaxis)
will make extendable only the X axis; TH1::SetCanExtend(TH1::kAllAxes)
will make extendable all the axes (this is the same functionality of the previous function SetBit(TH1::kCanRebin)
and TH1::SetCanExtend(TH1::kNoAxis)
will remove the extendable functionality to all the axes (equivalent to the old ResetBit(TH1::kCanRebin)
). The functionality of TestBit(TH1::kCanRebin)
is now replaced by TH1::CanExtendAllAxis()
.
An histogram filled with weights different than one has now automatically the sum of the weight squared stored inside, without the need to call anymore TH1::Sumw2()
. As a consequences an histogram filled with weights will always draw the errors by default. If one desire to continue having the histogram drawn without the errors, one should use the hist
option: h.Draw("hist")
. If, for memory reason, one does not want to remove the internal array storing the bin errors (the bin sum of weight square), one can use the function TH1::Sumw2(false)
.
The copy constructor is not anymore public for TH1. Before (in 5.34) this code was allowed by the compiler, although giving undefined behavior: now not anymore:
TH1D h1;
TH1 h2(h1);
Now this code is not allowed anymore. It will give a compilation error. The copy constructor of the derived classes (TH1D
in this example) should instead be used. This applies also for TH2
and TH3
. In case you want to copy histograms using the TH1 interface, you can use either TObject::Clone
, which uses the I/O system and can be unconvenient in some cases (e.g. in a multi-threaded environment) or TH1::Copy
which is public since some of the latest 5.34 revisions together with TClass::New
as following:
TH1 * h2 = (TH1*) h1->IsA()->New();
h1->Copy(*h2);
Note that TH1::Copy
does not copy the attached list of functions, while TH1::Clone()
does a deep copy also of the contained functions.
Add new method TH1::GetNCells
to retrieve the total number of bins of an histogram including underflow and overflows. This is the product of all the bins in each dimension.
The methods GetCellContent
, GetCellError
and SetCellContent
and SetCellError
have been deprecated. Get/SetBinContent and Get/SetBinError should be instead used and they have exactly the same functionality.
The following code should produce a plot. It did not.
TH1F* h=new TH1F("hist", "histogram", 10, 0, 3);
h->FillRandom("gaus");
h->Draw("same");
Make sure histograms having quotes in title are properly saved in .C files.
Add new functions TH2::QuantilesX
and TH2::QuantilesY
to return in a 1D histogram the projected quantiles distribution along the other Y or X axis. The return histogram will have as bin error an approximate error on the quantile assuming a normal distribution of the bin contents in the other axis.
Update Projection methods of both TH2 and TH3 to not return a null pointer when an histogram with the same name already existed and it was not compatible. Now just set the new correct binning on the previously existing histogram.
TGraph::Draw()
needed at least the option AL
to draw the graph axis even when there was no active canvas or when the active canvas did not have any axis defined. This was counter-intuitive. Now if TGraph::Draw()
is invoked without parameter and if there is no axis defined in the current canvas, the option ALP
is automatically set.SavePrimtive()
to improve speed compilation on generated macros.GetX(YZ)axis
were called on a TGraph2D
, the frame limit and plotting options were changed.Clear
function in order to be able to reuse a TGraph2D
after a Clear
is performed.GetHistogram()
the lower and higher axis limits are always different..q
when SetHistogram()
is called on a TGraph2D
.TMultiGraph::Add(TMultiGraph *multigraph, Option_t *chopt)
If chopt
is defined all the graphs in multigraph
will be added with the chopt
option. If chopt
is undefined each graph will be added with the option it had in multigraph
.Draw()
was not cleaning properly the current pad.pads
. This option is equivalent to the one in THStack
. It allows to draw all the TGraphs
in separated pads.noclear
avoid this behaviour. This is useful when drawing a THStack
on top of an other plot. If the patterns used to draw the histograms in the stack are transparents, then the plot behind will be visible.Change TF1::Integral(double a, double b, double * params = 0, double eps = 1.E-12)
to TF1::Integral(doubnle a, double b, double epsrel=1.E-12)
. One should use TF1::SetParameters
to set the function parameters before computing the integral.
Add a new function TF1::IntegralOneDim(Double_t a, Double_t b, Double_t epsrel, Double_t epsabs, Double_t &err)
that returns as last argument the error in the integration. TF1::Integral
is implemented using Tf1::IntegralOneDim
.
The one-dim and multi-dim integral functions are now implemented using the ROOT::Math::IntegratorOneDim
and ROOT::Math::IntegratorMultiDim
classes. This allows to change the integration algorithm used in TF1
using the static methods of the classes ROOT::Math::IntegratorOneDimOptions
and ROOT::Math::IntegratorMultiDimOptions
. The default algorithm used are ROOT::Math::IntegratorOneDimOptions::DefaultIntegratorType()
and ROOT::Math::IntegratorMultiDimOptions::DefaultIntegratorType()
. For example, if ROOT has been built with mathmore the default one-dim integration type is the GSL AdaptiveSingular integration algorithm.
Implement the possibility to save a TF1
as C code indenpant from ROOT. It is enough to save the function as a “.cc” file.
Example:
root [0] TF1 *f1 = new TF1("f1","x*x",-10,10)
root [1] f1->SaveAs("f1.cc");
Info in <TF1::SaveAs>: cc file: f1.cc has been generated
root [2] .x f1.cc(9.)
(double)8.10019368181367980e+01
Implement TF2::GetMinimumXY
and TF3::GetMinimumXYZ
using the ROOT::Math::Minimizer
class instead of TFitter
. The methods return now the function value at the minimum.
Implement also a TF2::GetMaximumXY
and TF3::GetMaximumXYZ
.
Remove some ambigous Integral
functions
ROOT::Math::Fitter
instead of the TFitter
class.The Python bindings are fully supported in ROOT 6.
The Ruby bindings have not been ported yet to the new interpreter interface in ROOT 6. We hope to have this fixed in a future release.
TVirtualFitter
interface using Minuit2. users should switch to use the ROOT::Math::Minimizer
interfaceAll other changes in the Math packages have been applied also in the 5.34 patched versions of ROOT. See their release notes for the detailed list of applied improvements.
etc/system.rootrc
allows to turn the feature on or off: Canvas.ShowGuideLines
.Canvas.SaveAsDefaultType
option in etc/system.rootrc
(default being pdf).TLatex
symbol #tilde
, was misplaced.TASImage::DrawtText
, TTF::SetTextSize
was called with a rounded value (to pixel). This cause some misplacements of character in TLatex formulae.TBox
clipping issue.This class allow to generate PGF/TikZ
vector graphics output which can be included in TeX and LaTeX documents.
PGF
is a TeX macro package for generating graphics. It is platform and format-independent and works together with the most important TeX backend drivers, including pdftex and dvips. It comes with a user-friedly syntax layer called TikZ
.
To generate a such file it is enough to do:
gStyle->SetPaperSize(10.,10.);
hpx->Draw();
gPad->Print("hpx.tex");
Then, the generated file (hpx.tex) can be included in a LaTeX document (simple.tex
) in the following way:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\title{A simple LaTeX example}
\date{July 2013}
\begin{document}
\maketitle
The following image as been generated using the TTeXDump class:
\par
\input{hpx.tex}
\end{document}
Note the two directive needed at the top of the LaTeX file:
\usepackage{tikz}
\usetikzlibrary{patterns}
Then including the picture in the document is done with the \input
directive.
The command pdflatex simple.tex
will generate the corresponding pdf file simple.pdf
.
Rotated.cxx
had a side effect on rotated text drawn with X11 fonts.TPad::SaveAs
produces named macros in .C files.TGX11
function RequestString
. Now the text appears directly as it will show and it is possible to enter several text string. The input is not block in the RequestString
event loop.TAxis
in order to keep the TAxis
class small. Adding two floating point numbers in that class (in fact in TAttAxis
) would have a none negligible effect on the Root files’ sizes as there is at least two axis per histogram and that there is often 1000th histograms in a single file. So we choose to follow the same mechanism as for the SetMaxDigits
static method. The new function is: SetExponentOffset
. Example:...
TGaxis::SetMaxDigits(2);
TGaxis::SetExponentOffset(-0.01, 0.01, "y"); // X and Y offset for Y axis
TGaxis::SetExponentOffset(-0.05, 0.01, "x"); // Y and Y offset for X axis
...
hist->Draw();
TGaxis::SetMaxDigits()
was not acitve on standalone TGaxis
.SetNDC
. {
TMathText l;
l.SetTextAlign(23);
l.SetTextSize(0.06);
l.DrawMathText(0.50, 1.000, "\\prod_{j\\ge0} \\left(\\sum_{k\\ge0} a_{jk}z^k\\right) = \\sum_{n\\ge0} z^n \\left(\\sum_{k_0,k_1,\\ldots\\ge0\\atop k_0+k_1+\\cdots=n} a_{0k_0}a_{1k_1} \\cdots \\right)");
l.DrawMathText(0.50, 0.800, "W_{\\delta_1\\rho_1\\sigma_2}^{3\\beta} = U_{\\delta_1\\rho_1\\sigma_2}^{3\\beta} + {1\\over 8\\pi^2} \\int_{\\alpha_1}^{\\alpha_2} d\\alpha_2^\\prime \\left[ {U_{\\delta_1\\rho_1}^{2\\beta} - \\alpha_2^\\prime U_{\\rho_1\\sigma_2}^{1\\beta} \\over U_{\\rho_1\\sigma_2}^{0\\beta}} \\right]");
l.DrawMathText(0.50, 0.600, "d\\Gamma = {1\\over 2m_A} \\left( \\prod_f {d^3p_f\\over (2\\pi)^3} {1\\over 2E_f} \\right) \\left| \\mathscr{M} \\left(m_A - \\left\\{p_f\\right\\} \\right) \\right|^2 (2\\pi)^4 \\delta^{(4)} \\left(p_A - \\sum p_f \\right)");
l.DrawMathText(0.50, 0.425, "4\\mathrm{Re}\\left\\{{2\\over 1-\\Delta\\alpha} \\chi(s) \\left[ \\^{g}_\\nu^e \\^{g}_\\nu^f (1 + \\cos^2\\theta) + \\^{g}_a^e \\^{g}_a^f \\cos\\theta \\right] \\right\\}");
l.DrawMathText(0.50, 0.330, "p(n) = {1\\over\\pi\\sqrt{2}} \\sum_{k = 1}^\\infty \\sqrt{k} A_k(n) {d\\over dn} {\\sinh \\left\\{ {\\pi\\over k} \\sqrt{2\\over 3} \\sqrt{n - {1\\over 24}} \\right\\} \\over \\sqrt{n - {1\\over 24}}}");
l.DrawMathText(0.13, 0.150, "{(\\ell+1)C_{\\ell}^{TE} \\over 2\\pi}");
l.DrawMathText(0.27, 0.110, "\\mathbb{N} \\subset \\mathbb{R}");
l.DrawMathText(0.63, 0.100, "\\hbox{RHIC スピン物理 Нью-Йорк}");
}
\\frac
using \\over
.\\mbox
as \\hbox
to improve the compatibility with TTexDump.TMathText
is a TeX math formulae interpreter. It uses plain TeX syntax and uses “\” as control instead of “#”. If a piece of text containing “\” is given to TLatex
then TMathText
is automatically invoked. Therefore, as histograms’ titles, axis titles, labels etc … are drawn using TLatex
, the TMathText
syntax can be used for them also.TTF.cxx
since the beginning). With the following code the spaces between “text” and #lambda were ignored. TLatex t; t.DrawLatex( 0.1,0.1,"text #Lambda" )
#backslash
.DrawLatexNDC
.#minus
and #plus
typographically better than the standard "-"
and "+"
.TTexDump
.#mbox
and #hbox
to improve the compatibility between TLatex
, TMathText
and TTexDump
.#minus
, #plus
, #mp
, #hbar
etc … ignored the color defined by the operator #color
.SetX1()
etc … for TPave
and inherited classes to make sure the NDC coordinates are also defined.TLinearGradient
and TRadialGradient
. Both classes inherit from TColor
and can be used the same way as ROOT’s standard colors in TAttFill
(SetFillColor(newColorIndex)
). Gradient fill can be created using either RGBA values directly, or from color indices (colors from the ROOT’s color table).gStyle->SetCanvasPreferGL(1)
).CanvasPreferGL
in rootrc.in
. So OpenGL can be use by default. The default value for this flag is 0 (no OpenGL).TMathText
work with FTGLtimeonaxis3.C
test the time axis.image2hist
showing how to convert an image to a 2D histogram.