Confused about leafs/branches in splitted tree

Hi,

I want to check a single variable (unpackError) in a branch (Anticounter) of a tree (Physics). The tree is however splitted so each variable in the Anticounter branch is by itself a branch (see below). To save processing time I thought to use (TBranch->GetLeaf())->GetValue() to read the variable, but because the “leafs” are branches they are not visible in this way. So my question is: how can I read this single variable in such a fast way as possible? I would like to avoid using setbranchaddress as that method reads in ALL variables in the branch, which are many (all are not included below) and that method therefor takes quite some time

thanks for you help!
Petter

root [1] TTree t = (TTree)f->Get(“Physics”)
root [2] TBranch b = (TBranch)t->GetBranch(“Anticounter”)
root [3] b->Print()
*Branch :Anticounter *
*Entries : 10 : BranchElement (see below) *

*Br 0 :fUniqueID : *
*Entries : 10 : Total Size= 700 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *

*Br 1 :fBits : *
*Entries : 10 : Total Size= 720 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *

*Br 2 :unpackError: *
*Entries : 10 : Total Size= 796 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *

Hi,

You could use TTreeFormula or use the result of calling TTree::MakeSelector on your file (TTree::MakeProxy might also work for you).

Cheers,
Philippe.