###################### Creating a macro... ###################### .. admonition:: Automating a ROOT analysis You can spend a lifetime learning all the in-and-outs of object-oriented programming in C++. [#four]_ 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: .. toctree:: :maxdepth: 1 AnalyzeTree.md RunAnalyze.md HistogramAnalyze.md ========================= \.\.\.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`"). .. toctree:: :maxdepth: 1 AnalyzeTreeReader.md RunAnalyzeReader.md HistogramAnalyzeReader.md .. rubric:: Footnotes .. [#four] 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.