Reading all branches of TTree from file

Hi Vangi,
out of curiosity, why do you want to assign all branches to the same C++ variable? For each entry in the TTree this variable should take many different values; how would you expect that to work?

If you mean you want to have each branch of a TTree as an element of an array, that is definitely possible. For example you can assign branch “a” to “array[0]” and branch “b” to “array[1]”.

Here there are some more small snippets of code (and links to tutorials) that show various methods to read data from a root file. Maybe you’ll find one that suits your needs.

Cheers,
Enrico