I try to extract data from a multiple-leaf root file.
the multiple-leaf is built, like below: tree->Branch("event","&event", "nevent/I: multi: impactar");
However, I try to get the branch,
unfortunately, the error:
Error in <TTree::SetBranchStatus>: unknown branch -> nevent
Error in <TTree::SetBranchStatus>: unknown branch -> multi
The syntax you use create a single branch with 3 leaves which are always read and written together and you can only call SetBranchStatus("event", status). To have finer grain control, you need to create 3 separate branch either manually or by creating a dictionary for the struct even and using tree->Branch("event.", &event);
Thanks for your answer. Actually, I have created the TTree owning a branch with 3 leaves using a struct class. Now, I just want to read the TTree. Just as I explained before
‘tree->Branch(“event”,"&event", “nevent/I: multi: impactar”);’
the branch event has three leaves: nevent, multi and impactar. To read a branch owning only one leaf, I know to call SetBranchStatus(" ", status), and contact the branch to the corresponding array[] using the SetBranchAddress("", array). However, for the branch owning three leaves, is there a convenient method or I have to use a struct class to have finer control.
If possible, I am appreciated that there is an example.