Use Range to limit the amount of data processed. 
This tutorial shows how to express the concept of ranges when working with the RDataFrame.
 
{
   int i(0);
   d.Define(
"b1", [&i]() { 
return i; })
 
      .Define("b2",
              [&i]() {
                 ++i;
              })
}
 
int df006_ranges()
{
 
   
   auto fileName = "df006_ranges.root";
 
   
 
   
   
 
   
 
   
 
   
 
   
   
 
   
   
   
 
   
   cout << "Usage of ranges:\n"
        << 
" - All entries: " << *
c_all << endl
 
        << 
" - Entries from 0 to 30: " << *
c_0_30 << endl
 
        << 
" - Entries from 15 onwards: " << *
c_15_end << endl
 
        << 
" - Entries from 15 onwards in steps of 3: " << *
c_15_end_3 << endl
 
        << 
" - Entries from 0 to 50, odd only: " << *
c_0_50_odd_b1 << endl
 
 
   return 0;
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
 
   
Usage of ranges:
 - All entries: 100
 - Entries from 0 to 30: 30
 - Entries from 15 onwards: 85
 - Entries from 15 onwards in steps of 3: 29
 - Entries from 0 to 50, odd only: 25
 - First three entries of all even entries: 3
(int) 0
- Date
 - March 2017 
 
- Author
 - Danilo Piparo (CERN) 
 
Definition in file df006_ranges.C.