Accessing list of leaves

I encountered a macro that write a tree file with something like this:

tree->Branch ("var1", &var1, "ch1:ch2:ch3:ch4");
tree->Branch ("var2", &var2 "ch1:ch2:ch3:ch4");

where var1 and var2 are struct that contain the set of 4 variables with the same names.
when I open the output file of the macro (in python), I can not access the ch1 variable under the `var1’ by tree.GetEvent(n) followed by tree.var1.ch1

So what is the way to correctly access the ch1 variable under the `var1’ in a particular event ?

_ROOT Version: 6.24 (PyROOT via conda)
_Compiler: gcc9

var1.ch1 (no “tree.”)

sorry. I tried that and it did not work

Then it’s better is you show all the related relevant code, or better, a working example showing the issue and that can be run.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.