Hi,
just to clarify a bit more the original scope. I have an API, which gets a TTree and should then enable the user to work with the contents of the tree. However I do not have control about the contents of the tree, since they come from various sources. So I need to be able to process the data no matter if they have been booked as Int, float, double, … .
Neither the number of branches, nor the structure of the tree does have to stay the same for the future. The only thing which is (somewhat) guaranteed is the fact that the branch contains an elementary datatype and no objects or arrays
This is why the suggestion to use leaf->GetValue(0) was exactly what I needed, since I can work with the “double” which is returned without problem, but the tree won’t complain that I try to set a wrong type variable to the branchaddress.
I also realized that my boost::any was not all that simply to use, since I only get the information about the tree at runtime.
Sorry if I was a bit harsh in my previous posts.
Cheers,
Erik