rootpy: Pythonic ROOT
The PyROOT bindings introduced
ROOT into the Python arena, however, interacting with
ROOT in Python should not “feel” like you are writing C++. Python also offers a
multitude of powerful packages such as
SciPy,
NumPy,
IPython,
matplotlib,
and PyTables,
but a suitable interface between them and ROOT has been lacking.
The rootpy project is a community-driven initiative aiming to provide a more
pythonic interface with ROOT on top of the existing PyROOT bindings.
Several key features include:
- Improvements to help you create and manipulate trees, histograms, cuts
and vectors.
- Colours and other style attributes can be referred to by descriptive strings.
- Get and Set methods on ROOT objects are also properties.
- Provides a way of mapping ROOT trees onto python objects and collections.
- Easy navigation through ROOT files. You can now access objects with
my_file.some_directory.tree_name, for example.
- Dictionaries for STL types are compiled for you automatically.
- Redirect ROOT’s messages through Python’s logging system.
- Optionally turn ROOT errors into Python exceptions.
- Plot your ROOT histograms or graphs with matplotlib.
- Conversion of ROOT trees into NumPy ndarrays
and recarrays
through the related root_numpy
package. Now take advantage of the many statistical and numerical packages
that Python offers (NumPy, SciPy,
StatsModels,
and scikit-learn).
- Conversion of ROOT files containing trees into
HDF5 format with
PyTables.
- roosh, a Bash-like shell environment for the ROOT file
- rootpy, a command for common tasks such as summing histograms or drawing
tree expressions over multiple files, listing the contents of a file,
or inspecting tree branches and their sizes and types.