Skip to content

Tutorial III: Reading ROOT Input

Thomas Mueller edited this page Aug 22, 2019 · 10 revisions

This tutorial is based on the ROOT files generated in the first step.

Reading from ROOT trees or ntuples

Histograms

Simple examples and parameter expansions

  • Different files

     harry.py -i gaussians.root gaussians1000.root -f gaussians -x var0

    plots/histograms_2files.png

  • Different trees

     harry.py -i gaussians3.root -f gaussians1 gaussians2 -x var0

    plots/histograms_2trees.png

  • Different expressions

     harry.py -i gaussians3.root -f gaussians1 -x var0 var1

    plots/histograms_2expressions.png

Binning options

Profiling options

Proxy options

The ROOT function TTree::Draw offers a possibility to execute C++ macros when processing trees. These macros need to be created by the function TTree::MakeProxy. HarryPlotter supports this mechanism and takes care of creating and compiling this code. Users can use this mode with the setting --tree-draw-options proxy and provide code at -x (not -y/z) and -w to provide for the extraction of float values to be plotted and float values for weights and cuts. Note, that the original ROOT functions only support bool cuts, but HarryPlotter modifies this to support also float weight. HarryPlotter creates files called proxy_* in the current directory, which can only be deleted after the last plot in a given HarryPlotter (multiplot) run is finished. This is currently not so easy to implement and therefore files have to be deleted manually afterwards (rm proxy_*).

See entry in introduction page for a first example.

Graphs

Loading histograms, graphs, functions from ROOT files

Binning options

Clone this wiki locally