How to read the value from a tree

I have some *.root files, each column(branch of tree) can be seen as one attribute, and each row is one sample, I want to get the value from the tree, but I cannot find build-in function can read the data easily, is there somebody know how to do? Thx

http://root.cern.ch/download/doc/ROOTUsersGuideHTML/ch12.html
http://root.cern.ch/root/html/tutorials/tree/index.html
http://root.cern.ch/root/html/TTree.html#TTree:MakeClass
http://root.cern.ch/root/html/TTree.html#TTree:MakeProxy
http://root.cern.ch/root/html/TTree.html#TTree:MakeSelector

not useful, I have read them. who can give a example?

Hi,

Why not? How is your use case different? What are you trying to do?

Philippe.

Actually, I only need to read the data from *.root, then deal with it by python, the tree structure like this:
I want to get the value from every branch, I have tried the “root_numpy”, but it cannot deal with vector type branch.


*Tree :TruthTree : Truth Tree *
*Entries : 1000 : Total = 94806134 bytes File Size = 48397513 *

  •    :          : Tree compression factor =   1.94                       *
    

*Br 0 :Event : Event/I *
*Entries : 1000 : Total Size= 7278 bytes File Size = 238 *
*Baskets : 2 : Basket Size= 16017 bytes Compression= 17.45 *

*Br 1 :Event_Number : vector *
*Entries : 1000 : Total Size= 36518 bytes File Size = 4153 *
*Baskets : 2 : Basket Size= 16017 bytes Compression= 5.34 *

*Br 2 :Event_Nparticles : vector *
*Entries : 1000 : Total Size= 30070 bytes File Size = 4977 *
*Baskets : 2 : Basket Size= 16017 bytes Compression= 3.66 *

*Br 3 :Event_ProcessID : vector *
*Entries : 1000 : Total Size= 30062 bytes File Size = 1929 *
*Baskets : 2 : Basket Size= 16017 bytes Compression= 9.43 *

*Br 4 :Event_Weight : vector *
*Entries : 1000 : Total Size= 36518 bytes File Size = 1990 *
*Baskets : 2 : Basket Size= 16017 bytes Compression= 11.15 *

See root.cern.ch/drupal/content/pyroot.
ifh.de/~middell/public/pyroot/pyroot.html
or ifh.de/~middell/public/pyroot/numpy.html

Philippe.