Hi there,
I am trying to read entries stored in a TTree within a root file. The structure is a number of folders, within each one is a TTree with several branches, and I am trying to access the leaf values of a specific branch. I created the file, and I can see when I look into it that each leaf of the TTrees I am calling is populated with a number of entries greater than 1. However, when I try to access the Trees, the number of entries is always returned as 1 (this is also seen when I try to print the TTree - the name of each branch is there as expected, but they all say Entries: 1), and the value of all these entries is 0. The code I am running to try to read the Trees is:
TTree* clustTree = (TTree*) fClusts->Get(Form("Event%i/fTreeR",nevent));
TBranch* clustBranch = clustTree->GetBranch("ClusterBranch");
The variable nevent
is an input to the code, I have confirmed that the folder being called exists within the original root file. The Both clustTree→GetEntries()
and clustBranch→GetEntries()
return 1, regardless of the folder I call, while in the file each folder’s Tree usually has between 10 and 50 entries. Any advice is much appreciated, thank you in advance!
ROOT Version: 6.32.06
Platform: MacOS