Several txt files to root


I have four root files each with an ntuple of event number, time and energy. The four files are related to four channels of a detector I’m studying. I need to plot only during a time window of a certain error (for example 20 ns). So I need to somehow combine the files to be able to define my time condition and plot histogram of energies from different channels.
Any suggestions please?
When I combined my text files together then wrote the root file it did not work because the time condition only applies for the same event number of different channels.

Please if you can help, I would appreciate it so much.


I am not sure I fully understand.
Would a TChain the kind of combination you are looking for?

Does creating a chain between the four root files allow me to draw a function of combinations from all four ntuples?

It will allow you to treat the 4 trees as if it was one big tree, yes.

I will try it
Thank you so much