Working with folders inside ROOT files

Folders

As you worked with the TBrowser, you may have realized that ROOT organizes its internal resources in the form of “folders,” which are conceptually similar to the hierarchy of directories on a disk. You can also have folders within a single ROOT file, to organize objects within a file.1

Copy the file folders.root from my root-class directory into your own, and use the ROOT TBrowser to examine its contents.

Folders for the exercises

You’ll see three folders within the file: example1, example2, and example3. Each of these folders will be the basis of the next three exercises.

All three of the subsequent exercises will require you to make a plot of data points with error bars. In case you missed it, there’s a discussion of these kinds of plots in x-y plots.

To create plots for these Exercises, you may need to know something about C++ containers. We’ll discuss those in the next section.

xkcd self_description

Figure 81: https://xkcd.com/688/ by Randall Munroe


1

You may already be familiar with HDF5, which is conceptually similar to the approach that ROOT takes for its files: containers for a mixed set of different types of data within a hierarchy of directories. I haven’t worked with HDF5 (yet) so it’s hard for me to compare the two.