Hello, ROOTers.
I am very new to ROOT, and I need some help to make my Tree organized better.
I’m trying to make subbranches under a parent branch using http://root.cern.ch/root/html/TBranch.html#TBranch:TBranch@3, but I can’t get it to work.
Hello,
I have the same problem, and could not find a solution in what was suggested: how to build a sub-branch of a branch, from a list of leaves, not from a class object.
I tried this (as a kind of minimal example):
**// define a branch**
Int_t myBuffer [3] = { -1, -1, -1 };
TBranch * myBranch = outTree->Branch ( "MainBr", &myBuffer[0], "VarA/I:VarB/I:VarC/I" );
**// define a sub-branch of the main branch**
Int_t mySubBuffer[2] = { -1, -1 };
TBranch * mySubBranch = new TBranch ( myBranch, "SubBr", &mySubBuffer[0], "VarSub1/I:VarSub2/I" );
myBranch->GetListOfBranches()->Add ( mySubBranch );
but when setting non-zero values in the buffers, and filling the TTree:
if reading the TTree entries, the sub-branch leaves are 0
with a TBrowser in ROOT, the sub-branch does not appear