I’m trying to merge a set of TTrees held in memory (I construct the empty TTrees and SetDirectory(0) on each one before filling them). When I try to merge them with TTree::MergeTrees, a null pointer is returned.
EDIT: It seems this might happen when all the trees being merged happen to be empty.
Hi beojan,
I suggest you to use TChain class which is inherited by TTree class. You can fill a TChain in the same way of a TTree. Then for the merge you have only choose a main TChain and do
I’m filling my TTrees entirely in memory, while a TChain is backed by a set of files.
The problem I’m trying to solve is filling a new TTree from a TDataFrame ForeachSlot operation. I can’t just use snapshot because the new tree has separate leaves for variables while the dataframe has a single column holding a struct of TLorentzVectors.