Creating a macro…
Automating a ROOT analysis
You can spend a lifetime learning all the in-and-outs of object-oriented programming in C++. 1 Fortunately, you only need a small subset of this to perform analysis tasks with ROOT.
There are two basic approaches to creating a ROOT C++ macro to read through an n-tuple. You can pick just one of these two:
...with MakeSelector
This approach might be better for those without experience in C++. It takes more steps than the other approach, but it hides some of the C++ nitty-gritty:
...with TTreeReader
If you know enough about C++ to understand what a template is, this approach takes fewer steps (and is slightly faster).
Many of the subsequent tutorial pages are written with MakeSelector in mind. You may have to do some intepretation of the detailed instructions (e.g., you’ll have to interpret “copy Analyze.C” as “copy AnalyzeReader.C”).
Footnotes
- 1
That’s four lifetimes, five if you’re studying LaTeX. And you thought you only signed up for a ten-week project! Gosh, I wonder if it takes a lifetime to understand high-energy physics.