[ROOT] TTrees question

From: Siva Subramania (siva@uhhep.phys.uh.edu)
Date: Mon Jan 27 2003 - 06:08:32 MET


Hi, 
Can anybody help me out with this...
I have a Class ThreeVector, which has x, y, z as its private members and 
whole lot of constructors and functions as public....
Now I define a tree, then create a branch like this 
T->Branch("ThreeVector", &trivec, "x:y:z");
and then I fill the tree with 10 values each for x, y, z with a 
constructor of ThreeVector. 
Now I write another program to read the tree and I set the branch address 
to the threevector in the tree, and I try to read back x, y, z.  I 
couldn't, it gives all wrong values.   Can you give an example code to 
read x, y, z and cout << the values.  The ThreeVector class has x(), y(), 
z() as the getters. 
I guess, I have tried to explain what I want, please lemme know if I am 
not clear... Expecting a reply soon. Thanq

Siva.



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET