How to read TTree with two branches using the same struct?

Hi,

you’d have to create s1 and s2 structs to hold the values and use SetBranchAddress(), like you would in C++. The shortcut using member access does not work as it would require a two-step lookup (T.s2.bin), and the internal code is only expecting one step.

As an alternate, you could change the labels in the .C code by calling them bin2, etc. They’re just labels and do not need to match the member names in the struct.

Cheers,
Wim