Questions on RDataFrame example

Hi all,

I am reading https://root.cern.ch/doc/master/df002__dataModel_8py.html example and I got a question & comment:

  1. Minor typo (5 and 8)
# Operating on branches which are collection of objects
# Here we deal with the simplest of the cuts: we decide to accept the event
# only if the number of tracks is greater than 5.
n_cut = 'tracks.size() > 8'
  1. Aren’t arguments in Map TExecutor misplaced?
RVec<double> getPt(const RVec<FourVector> &tracks)
{
   auto pt = [](const FourVector &v) { return v.pt(); };
   return Map(tracks, pt);
}

as in documentation it states that function is the 1st argument and sequence is the 2nd.

auto ROOT::TExecutor< subc >::Map(F func, std::vector< T > & args )
-> std::vector<typename std::result_of<F(T)>::type>

cheers,
Bohdan

ROOT Version: 6.22

Hi Bohdan,
thank you for reaching out, really appreciated!

1.: absolutely, will be fixed in master soon, thanks for the report (also feel free to open a pull request yourself should you find more problems)

2.: I agree it’s a bit confusing, but that Map is ROOT::VecOps::Map, while the Map you mention is TExecutor::Map

Cheers,
Enrico

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