Syntax question - a single value from a tree to a constant

Greetings all,

I have hunted through all of the documentation and I can’t seem to find any pointers on this - it seems to be a very simple question.

I have a tree that contains a branch with five leaves. Each leaf contains a series of values.

I want to read one value from one leaf into a constant. For my purposes it won’t matter whether I have to read the entire leaf into an array of constants or I directly access a single leaf value.

It would be helpful if you could give me both an answer and guidance on where I should have looked for the answer in the documentation.

Any guidance you can give will be greatly appreciated.


Greetings all,

I have continued looking and I still have not been able to figure out a means of reading one value from a leaf in a tree into a constant (or to read a leaf into a constant array).

Any guidance you can give on the appropriate syntax or a pointer where to find the syntax in the documentation or the tutorials would be greatly appreciated.


Assuming that you loop on entries of TTree* T

[code]//outside the loop
TLeaf* leaf = T->GetLeaf(g=leafname);

//inside the loop
double value = leaf->GetValue(0); //if simple scalar
= leaf->GetValue(i); //to return element i in case of an array

Thank you