- What's New
- Download ROOT
- Building ROOT
- v6-04 Release
- v6-02 Release
- v5-34 Release
- Older Versions
- Download Statistics
The backbone of the ROOT architecture is a layered class hierarchy with, currently, around 1200 classes grouped in about 60 frameworks (libraries) divided in 19 main categories (modules). This hierarchy is organized in a mostly single-rooted class library, that is, most of the classes inherit from a common base class TObject. While this organization is not universally popular in C++, it has proven to be well suited for our needs (and indeed for almost all successful class libraries: Java, Smalltalk, MFC, etc.). It enables the implementation of some essential infrastructure inherited by all descendants of
TObject. However, we also can have classes not inheriting from
TObject when appropriate (e.g., classes that are used as built-in types, like
The Class Categories
The classes in the ROOT base category provide the most low-level building blocks of ROOT. For example, the TObject class, which implements common behaviour for all ROOT classes. The class TClass and its helper classes that provide support for extended runtime type information. The storage manager TStorage which handles all memory allocation and de-allocation operations and performs basic error checking (memory overwrites, etc.). The class TFile which provides a hierachical sequential and direct access persistant object store. The operating system abstraction layer TSystem and the concrete OS interfaces TUnixSystem and TWinNTSystem concentrate all OS dependent behavior, like file system access, dynamic loading, error handling and networking for the different platforms supported by ROOT.
The histogram category provides classes for advanced statistical data analysis, like 1D, 2D and 3D histograming of short, long, float or double values, with fixed or variable bin sizes, profile histograms and formula evaluation.
The tree and ntuple category contains the tree system. The row-wise and column-wise ntuples have been one of the major strengths of the PAW system. Trees extend the concept of ntuples to all complex objects and data structures found in raw data, ESD's and AOD.s. The idea is that the same data model, same language, same style of queries can be used on all data sets in an experiment. Trees are designed to support not only complex objects, but also a very large number of them in a large number of files. Ntuples are simple trees with only simple types (int, float, double, etc.).
The 2D graphics category provides classes for low-level graphics primitives, like lines, arrows, rectangles, ellipses, text, legends, annotations, text with Latex notation, splines, etc., but also the higher level constructs like pads and canvases. They also handle basic style and attribute management.
The 3D graphics category provides basic 3D graphics primitives, like 3D polylines and 3D polymarkers as well as higher level geometrical shapes (boxes, cones, polygons, tubes, etc.) which can be efficiently assembled into complex geometries.
The detector geometry category provides classes for building, browsing, tracking and visualizing detector geometries. The code is independent from the Monte Carlo simulation packages and therefore it does not contain any constraints related to physics. However, the package defines a number of hooks for tracking, such as materials, magnetic field or track state flags, in order to allow interfacing to tracking MC's. The final goal is to be able to use the same geometry for several purposes, such as tracking, reconstruction or visualization, taking advantage of the ROOT features related to bookkeeping, I/O, histograming, browsing and GUI's. The geometrical modeler is the most important component of the package and it provides answers to the basic questions like "Where am I ?" or "How far am I from the next boundary ?", but also to more complex ones like "How far am I from the closest surface ?" or "Which is the next crossing along a helix ?".
The graphical user interface category provides all the classes needed to build a modern, cross-platform, GUI. There are classes for many basic widgets such as buttons, windows, dialogs and menus and higher level widgets.
The C++ interpreter, CINT, allows the construction of applications in which the user has to learn only one language, C++, to communicate with the system. The command language, macro language and programming language are all one and the same.
The SQL interface provides a simple, but powerful abstract interface to different SQL database servers (MySQL, SAPDB, PostgreSQL, Oracle).
The documentation classes allow the creation of hyperized C++ header and source files, inheritance trees, class indices, macro's and session transcripts. Thanks to this facility almost everything in the ROOT system can be automatically documented and cross-referenced.
The TObject Class
Most ROOT classes are derived from the TObject class. The TObject class defines protocols (abstract methods) for comparing objects, for object inspection, for object I/O, for graphics hit detection and for object notification, to name just the most important ones.
The ROOT object I/O facility supports the streaming of arbitrarily complex polymorphic data structures from memory to a buffer. This buffer can than be to stored in a ROOT binary machine-independent file, an XML file or send over the network. This functionality is based on the abstract Streamer method, which is overridden in subclasses to stream an object's instance variables. Circular structures are linearized, and multiple references to the same object are restored properly. Storing pointers is implemented by an object table, which assigns a unique identifier to each transmitted object. This identifier can be transferred to other address spaces or to permanent storage.
The Class Dictionary and Object Run-time Support
Even with the upcoming run-time type identification (RTTI) extension for C++, the run-time system does not provide any information about the class structure, the instance variables or the member functions of an object. Consequently, an additional mechanism had to be introduced to gather this information, in order to support InheritsFrom, Inspect and Dump methods, the object I/O facility and the automatic documentation system. ROOT uses the approach of associating with each class (via a static pointer) a special object describing its structure. These descriptors are instances of the class TClass which is itself a subclass of TObject. The TClass objects store the following information about a class:
- The name and title of a class.
- The size of an instance in bytes.
- Its parent class(es).
- The names, types and descriptions of its instance variables.
- The names and signatures of its member functions.
- A source code reference to the definition and implementation part of the class.
- The address of the class' object factory method used to create a new object.
Because the C++ run-time system gives no access to type and structure information, the ROOT system uses a dictionary generator called CINT. CINT parses the class header files and generates a dictionary (in the form of a C++ function). To link the CINT generated dictionary function to a class the programmer only has to add two pre-processor macros to the code. One macro, ClassDef, must be placed in the class definition file and the other macro, ClassImp, in the implementation file.