Creating and filling AIDA histograms and plotting them in HippoDraw
Unbinned Histograms (AIDA Clouds), are created ("booked"), and filled with different random number distributions and then plotted using HippoDraw.
Click to retrieve the Python script of the example.
After having setup correctly your environment, you can run the example typing :
python -i hippoDemo.py
- 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.
- 1D and 2D Clouds are booked
- The clouds are filled with random data. The random data are generated with gaussian, exponential, log normal, gamma distributions using functions available from the Python random package
- The Python module hippoPlotter is imported, which imports the hippo module, python bindings to HippoDraw. The hippoPlotter module defines a python class, HippoPlotter, which copies the AIDA histograms in HippoDraw objects (tuples) and shows them in the Hippo canvas
- An instance of the HippoPlotter class is created. This class creates a HippoDraw canvas and the HippoDraw Inspector
- The histograms are plotted in the Hippodraw canvas. The user can then fit
them, change the binning of the histograms, etc.... using the Inspector
- An AIDA 2 dim. DataPointSet is created from vector of x,y and error values. The DataPointSet is plotted as a X-Y Plot in the HippoDraw page.
- Binned 1D and 2D histogram obtained filled from the clouds contents are plotted in Hippodraw