Merging datasets within RDataFrame

I have a directory containing some (small) known number of identically structured .root files. Each contains a TTree with a branch timeOfEvent.

I know that I can “merge” multiple .root files in an RDataFrame by, for example, passing a vector<string> containing their paths. In that case, however, branches of the same name are merged. In my case, although each file contains the same branch timeOfEvent, I’d like for them to be separate columns in the RDataFrame (e.g. timeOfEvent1, timeOfEvent2, …).

Is there a straight forward way to accomplish this?

Thanks!


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


It seems that rather than doing a vertical merge (i.e. like a TChain or hadd), you might be wanting to do an horizontal merge (associate entry data from various files together, adding (virtually or not) branches/columns) in which case you might want to consider using TTree::AddFriend.