TTree accessing base type variables as "pointers"


Sorry for the non-explicit title.
My problem is actually simple :

v = tree.myvar
v == tree.myvar

In my case ‘myvar’ is a simple type (int, float), so is ‘v’. As a result the variable ‘v’ is not updated by the 2nd GetEntry() call and the last line returns False.

Is there a way to access a sort of pointer to ‘myvar’ that gets automatically updated when GetEntry is called ?
(the reason is I’m collecting a bunch of variable from different tree in some generic container : would be useful not to have to reconnect to each tree with the correct var name to get the variable updated…)



I’ve been trying to figure out a python way, but can’t think of any, since the result is a temporary object and the “link” underlying is lost. The only way I see is to use SetBranchAddress() and a C/C++ representation (a python array or a datamember of a struct).