Accessing information from tree->Print()

Hi:
Suppose that I have a TTree named mytree. mytree->Print() prints something similar to:


*Tree :mytree : Data from mytree *
*Entries : 137655 : Total = 311081104 bytes File Size = 102510938 *

  •    :          : Tree compression factor =   3.03                       *
    

*Br 0 :Branch_1 : var1/i *
*Entries : 137655 : Total Size= 552828 bytes File Size = 190511 *
*Baskets : 17 : Basket Size= 32000 bytes Compression= 2.86 *

*Br 1 :Branch_2 : var1/D *
*Entries : 137655 : Total Size= 1104900 bytes File Size = 489726 *
*Baskets : 34 : Basket Size= 32000 bytes Compression= 2.22 *

*Br 2 :Branch_3 : var1/i:var2/i:var3/i:var4/i *
*Entries : 137655 : Total Size= 2210109 bytes File Size = 17112 *
*Baskets : 69 : Basket Size= 32000 bytes Compression= 129.02 *
.
.
.

How can I get, from a ROOT program, the information contained in the branch variable description? (that is “var1/i:var2/i:var3/i:var4/i” for Branch_3,in the example output) It would be nice to be able to get the string containing this info, or peharps there’s a better way of doing this.

Saludos

Hugo

see TTree, TBranch, TLeaf user interface
from TTree get the list of branches
TList *list = tree.GetListOfBranches(); etc

Rene

Thanks for your reply.
I already had something like:

TBranch *event = chn->GetBranch(“Cluster_45”);
TObjArray *leaves = event->GetListOfLeaves();

for(Int_t i = 0; i < leafEnts; i++){
std::string leafName = (std::string)leaves->At(i)->GetName();
.
.
.
}

but this only tells me the name of the variables, and I am not sure how can I get its type (I, i, L, l, F, f, etc.)

Saludos

Hugo

Finally I’ve found just what I was looking for, by reading TBranch.cxx:

TBranch *br = // Get your branch code
br->GetTitle(); // Returns exactly what I want.

This is not documented anywhere, and it’s very strange to use this. Maybe I shouldn’t be using this, but this is exactly what I need.
Mr. Brun, thanks for your help.