Different branches having identical data


I’m trying to create a tree with 9 branches of the same class (spectrometer), but all the branches are identical. I’ve modified the example Rene sent me and thought it was something wrong I did, but testing again the Rene example, it also has the entries identical for all of the detector. it seems that somehow the branches are taking the same address for all the objects. The example is attached in the message. I did not include my files because I splitted them in several files, if I get the solution for the simple example below I can propagate the solution to my case.

Thanks for any help

dethit-1.C (1.22 KB)

in the test program, replace

see meaning of the dot in TTree::Branch