ROOT is modular scientific software toolkit and provides numerous tools for big data processing, statistical analysis, visualization and storage.
The ROOT Reference Guide provides a complete list of all available ROOT classes and their documentation. It is the central source of information for all ROOT classes.
ROOT is implementing new interfaces following new design style.
ROOT contains several classes developed in the past which are following a specific naming convention and a special inheritance scheme.
ROOT has a set of global ROOT variables that apply to a ROOT session, → see Global ROOT variables.
The following naming conventions apply to ROOT objects:
Non-class types end with
Data members begin with
Member functions begin with a capital letter.
Constants begin with
Global variables begin with
gfollowed by a capital letter.
Static data members begin with
Enumeration types begin with
Locals and parameters begin with a lower case
Getters and setters begin with Get and Set
TObject - the ROOT base class
In ROOT, almost all ROOT classes inherit from the common ROOT base class TObject .
TObject class provides default behavior and protocol such as:
Object I/O (
Access to meta information (
- TFile::ls: Lists objects in a file or directory.
list->ls(): Lists objects in a collection pointed by list.
list->Dump(): Dumps all objects in a collection pointed by list.
TObject::Inspect Dumps the contents of this object in a graphics canvas. A table is displayed where, for each data member, its name, current value and its title are given. If a data member is a pointer to another object, one can click on the pointer and, in turn, inspect the pointed object,etc.
TObject::Dump: Same as
TObject::Inspect, except that the output is on stdout. An object dump can be written to a file.
- ROOT Object Browser ( TBrowser ): Allows you to browse collections, such as the list of classes, geometries, files and TTree . → See also ROOT Object Browser.
Global ROOT variables
ROOT has a set of global ROOT variables that apply to a ROOT session.
Via the global
gROOT variable, a single instance of
is accessible. The global gROOT variable holds the information relative to the current session.
By using the global
gROOT variable, you get the access to every object created in a ROOT program. The
TROOT object has several lists pointing to the main ROOT objects. During a ROOT session, the global
gROOT variable keeps a series of collections to manage these objects.
They can be accessed via the
gROOT::GetListOf()... methods return a
, meaning a collection of objects. They can be used to do list operations such as finding an object, traversing a list and calling a method for each of the members.
for the full set of methods supported for a ROOT collection.
For finding a canvas called
c1, you can use:
gFile is the pointer to the current opened ROOT file in a ROOT session (
gStyle holds the current style, which is the global object of class
A generic interface to the underlying Operating System.
gDirectory is a pointer to the current directory.
gPad points to an active pad on which a graphic object is drawn.
gRandom is a pointer to the current random number generator (
By default, it points to a
object. You can replace the current
random number generator by deleting
gRandom and recreating with your own desired generator.
gEnv contains all the environment settings for the current session and is of type
gEnv is set by reading the contents of the
.rootrc file (or
$ROOTSYS/etc/system.rootrc) at the beginning of a ROOT session.
gGeoManager is used to access the geometry manager class created with
New ROOT classes
The new interface styles follow the C++ Core Guidelines where reasonable in our context. Most noticeably this means
- new classes are in
namespace ROOTand their names begin with
R; headers are in
include/ROOT/and are included as
<ROOT/...>; libraries are starting with
- use of references as parameters instead of pointers,
- massive reduction of virtual functions (and calls), no more TObject inheritance,
- use of stdlib classes (
std::string) instead of
- separation of concerns, including separation of internal (
ROOT::Internal::) and user-facing functionality.