TreeViewer with multiple TVector3 objects in TTree

Hi Rooters

I create a TTree object which contains multiple TVector3 objects. When I view the tree using the TreeViewer it seems to become confused between the data members of the different TVector3 objects.

The view of the objects in the right hand window has a “branch symbol” for each TVector3 object. Below each of these is a “branch symbol” labeled TObject and three “leaf symbols” labeled fX, fY and fZ which are the data members of a TVector3 object. If I drag one of these data members (fY say) from one TVector3 object and another (fY again say) from another TVector3 to produce a scatter plot then I get a straight line. This is logical since the output of that operation is:

tv__tree->Draw(“fY:fY”,"","", 2676, 0);

which doesn’t differentiate between the Different TVector3’s. How can I get the TreeViewer to differentiate between the different TVector3 objects while still retaining its functionality (i.e. dragging and dropping etc.) ?

Regards
Mark

Hi,

You can try to use the name of the branch in the Draw command:

However, the best is to disambiguate the names at the time you tree is being built by adding a period to the branch name:

Cheers,
Philippe