ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
Dear ROOT users,
I have text files with names in the following form: example_0_1000.txt
, example_500_1500.txt
, example_1000_2000.txt
, example_1500_2500.txt
… where all have the same structure.
Currently, I can read any single one of these in using tree->ReadFile()
. I loop over the ReadFile()
to get different filenames by replacing the numbers with an iterator, so that I can read all of the possible files. Does this overwrite the previous data or ‘merge’ the two input files’ data into tree
?
My main problem is how I can merge different trees, say tree1
with another tree: tree2
. I have tried to use TChain::Add()
but that only seems to work for .root
files. I’d like to merge trees together directly from the text files. How can I do this?