I have to read TTrees from many root files together. The trees are located inside TLists within TDirectories. How does one read these trees using TChain? Whenever I use TChain to add the trees, root cannot find the tree.
The command I am trying to use is
TChain* ch = new TChain(“ResultsData/AnalysisMain_tree_FB768/fTreeEvent”)
ch->Add(“AnalysisResults1.root”)
ch->Add(“AnalysisResults2.root”)
I get the following error:
Error in TChain::LoadTree: Cannot find tree with name ResultsData/fTreeEvent in file datafile/AnalysisResults2.root
Welcome to the ROOT Forum!
As the message is telling, there is apparently no ResultsData/fTreeEvent tree in the datafile/AnalysisResults2.root file… Can you check with rootls -l datafile/AnalysisResults2.root?
Thanks for the quick reply. I posted the error wrongly.
The error is
Error in TChain::LoadTree: Cannot find tree with name ResultsData/AnalysisMain_tree_FB768/fTreeEvent in file datafile/AnalysisResults1.root
Error in TChain::LoadTree: Cannot find tree with name ResultsData/AnalysisMain_tree_FB768/fTreeEvent in file datafile/AnalysisResults2.root
After running the makeclass command over a single root file, I run some codes and see the error.
Unfortunately, I cannot attach any files or pictures here as the website is not allowing to post them currently.