Show usage of RDataFrame's helper tools, contained in ROOT/RDFHelpers.hxx.
void df020_helpers()
{
const auto nEntries = 3;
auto df = _df.Define("one", [] { return 1; }).Define("two", [] { return 2; });
auto isOne = [] (
int a) {
return a == 1; };
auto c1 = df.Filter(isOne, {
"one"}).Count();
auto c2 = df.Filter(isNotOne, {
"two"}).Count();
auto checkOneTwo = [] (
const std::vector<int> &
v) {
return v.size() == 2 &&
v[0] == 1 &&
v[1] == 2; };
auto c3 = df.Filter(ROOT::RDF::PassAsVec<2, int>(checkOneTwo), {
"one",
"two"}).Count();
}
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTree,...
auto Not(F &&f) -> decltype(RDFInternal::NotHelper(Args(), std::forward< F >(f)))
Given a callable with signature bool(T1, T2, ...) return a callable with same signature that returns ...
- Date
- July 2018
- Author
- Enrico Guiraud (CERN)
Definition in file df020_helpers.C.