Filter RDataFrame in a range of entries

Dear experts,

I am wondering if the RDataFrame have a similar functionality to TTree::CopyTree. After searching a bit, I am not sure I find the answer. For TTree::CopyTree, I can specify the starting entry and number of entries to save. I am not sure Filter and Snapshot provide similar functinality. If they do, please forgive this stupid question and could you please provide me the solution?

Many thanks in advance!

Please read tips for efficient and successful posting and posting code

ROOT Version: LCG_100
Platform: CentOS 7
Compiler: gcc10

Hi @Y.S.Zhang ,
this is the simplest but only works in single-thread runs: df.Range(start, end).Snapshot(...).

The most general way is to build a TEntryList, attach it to the TTree or TChain, then pass the TTree/TChain to RDataFrame’s constructor.


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