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

  1. Python bindings to ROOT classes are imported from the ROOT module (from PyROOT).
  2. 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
  3. A Python class, PyListOfLeaves, is created. Attributes with names of the tree leaves, and containing the leaves, are added dynamically to the class
  4. 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.
  5. A 1D and a 2D Cloud are created
  6. The content of the tree is read, looping on its entries, and the histograms are filled
  7. The histograms are plotted using HippoDraw