Adding data from an external container to a DataFrame

Important correction: in multi-thread event loops rdfentry_ will not correspond to the input dataset’s entry number, as the entries are processed in an unspecified order. This is documented at ROOT: ROOT::RDataFrame Class Reference but I forgot about it in my reply above, sorry about that!

In this scenario the stable solution is to write the extra column out into another TTree that you can add as a friend of the main dataset: entries from the main tree and its friends are guaranteed to be processed in sync.