Logo ROOT  
Reference Guide
df025_RNode.C File Reference

Detailed Description

View in nbviewer Open in SWAN RNode is a generic type which represents any transformation node in the computation graph.

This tutorial shows how to take advantage of the RNode class.

/// This function does not need to be a template: the RNode type accommodates all
/// possible nodes.
ROOT::RDF::RNode AddFilter(ROOT::RDF::RNode node, string_view filterStr)
{
return node.Filter(filterStr);
}
/// Trivial helper function which returns the demangled typename from a typeid
template<typename T>
std::string GetName(T&)
{
int dummy;
return TClassEdit::DemangleName(typeid(T).name(), dummy);
}
void df025_RNode()
{
std::cout << "Type name of input node: " << GetName(df) << std::endl;
auto f1 = AddFilter(df, "rdfentry_ > 0");
auto f2 = f1.Filter([](ULong64_t e) { return e > 1; }, {"rdfentry_"});
std::cout << "Type name of input node: " << GetName(f2) << std::endl;
auto f3 = AddFilter(f2, "rdfentry_ > 2");
std::cout << "Entries passing the selection: " << *f3.Count() << std::endl;
}
#define e(i)
Definition: RSha256.hxx:103
static RooMathCoreReg dummy
unsigned long long ULong64_t
Definition: RtypesCore.h:72
char name[80]
Definition: TGX11.cxx:109
The public interface to the RDataFrame federation of classes.
Definition: RInterface.hxx:89
RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > Filter(F f, const ColumnNames_t &columns={}, std::string_view name="")
Append a filter to the call graph.
Definition: RInterface.hxx:187
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
Definition: RDataFrame.hxx:42
TF1 * f1
Definition: legend1.C:11
double T(double x)
Definition: ChebyshevPol.h:34
char * DemangleName(const char *mangled_name, int &errorCode)
Definition: TClassEdit.h:217
Type name of input node: ROOT::RDataFrame
Type name of input node: ROOT::RDF::RInterface<ROOT::Detail::RDF::RFilter<df025_RNode()::$_0, ROOT::Detail::RDF::RNodeBase>, void>
Entries passing the selection: 5
Date
December 2018
Author
Danilo Piparo

Definition in file df025_RNode.C.