Reading a ROOT Tree, filling AIDA histograms and plotting them in HippoDraw
Description
Python program
Click to retrieve the Python script of the example.
After having setup correctly your environment, you can run the example typing :
python -i rootDemo.py
Program flow
- Python bindings to ROOT classes are imported from the ROOT module
(from PyROOT).
- The ROOT file is open and the tree is read. The root file, tree1.root,
is the one created from the ROOT tutorial, tree1.C
- A Python class, PyListOfLeaves, is created. Attributes with names
of the tree leaves, and containing the leaves, are added dynamically
to the class
- The Python module AidaProxy is imported. This module loads
the dictionary for the PI classes, making them available in the Python
environment in the global namespace.
- A 1D and a 2D Cloud are created
- The content of the tree is read, looping on its entries, and the
histograms are filled
- The histograms are plotted using HippoDraw