More to explore
uproot
As opposed to The RDataframe Path, let’s go to the other end of the spectrum: ROOT I/O without using ROOT. The Python uproot package reads ROOT files using Python and some commonly-used packages: numpy, awkward, and pandas. Uproot is particularly handy if you were already a Python expert before taking this ROOT tutorial, and would rather not have to touch ROOT again if you can help it.
I’ve installed uproot in the Python installations available at Nevis.1
coffea
The coffea package is column-based analysis system specifically designed for high-energy physics. I think of it as a Python-only equivalent to RDataFrames.

Figure 75: https://xkcd.com/2054/ by Randall Munroe. Hopefully your use of ROOT data will be more rational.
- 1
I’ve played around with uproot. My initial (and highly-biased) opinion is that you have to be a full dues-paying member of the “ROOT-haters club” to do a serious ROOT-based analysis using uproot. For the kinds of simplistic analyses that I present in this tutorial, uproot is fine. But if you want to do work like that described in Exercise 15, the uproot code may be even more cryptic than the equivalent pyroot-based code.
Another possible pitfall is that one has to think carefully about when uproot performs the event loop. As I described in Lazy Evaluation with
RDataFrame
, it’s possible to invoke uproot operations in the wrong order and get very inefficient code.According to the uproot development page, uproot is primarily intended as a way to reorganize data in ROOT files into a form suitable to pass on to machine-learning libraries. From what I see of the package, its benefits (and limitations) are well-suited for that purpose.