How to do operation between two RDataFrame objects with different dimension?

suppose I have two RdataFrames. One data frame has branches X1, Y1 and another has branches X2, Y2 with different dimension compare to first one. I want to do operation on X1,X2 (i.e X1-X2) based on Y1 and Y2. How should I proceed?
Please read tips for efficient and successful posting and posting code

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

Hi @souvikc ,

what’s typically done is to join the two datasets at the level of TTree/TChain and then build an RDataFrame that operates on the combined dataset.

To perform an horizontal concatenation of two TTree/TChain datasets (which requires that the two datasets have the same number of entries and results in a new dataset that has the union of their columns) you declare one dataset as a “friend” of the first. For an example you can search the RDataFrame users guide for “friend trees” (or the forum, or the TTree documentation). It works the same for TChains.

To perform a more elaborate join you can use a TTreeIndex.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.