I am trying to write a program that reads a ROOT tree from a file, determines the type of the variables contained on each brand, and creates an apropiate structure (arrays or class?) to hold the variables when readed.
For example, let’s suppose that I have a single branch on a tree saved on a given file. The structure
can correctly hold the variables contained on the branch. But for some reason, I need to read another file, containing a related tree with a similar branch, in which the structure
can correctly hold the data; and later I need to read another file, containing a related tree … and so on, making imposible to define every possible apropiate structure to hold the data. How can I write some code that checks the variables in a given branch, then creates something (structure, arrays, etc.) to hold the data and then reads this data correctly?
Thanks in advance and I hope I’ve been clear in what I am trying to do.