13#ifndef ROOT_RDF_HELPERS
14#define ROOT_RDF_HELPERS
33template <
typename... ArgTypes,
typename F>
36 return std::function<
bool(ArgTypes...)>([=](ArgTypes... args)
mutable {
return !
f(args...); });
39template <
typename... ArgTypes,
typename Ret,
typename... Args>
42 return std::function<
bool(ArgTypes...)>([=](ArgTypes... args)
mutable {
return !
f(args...); });
45template <
typename I,
typename T,
typename F>
48template <std::size_t...
N,
typename T,
typename F>
50 template <std::
size_t Idx>
52 typename std::decay<F>::type fFunc;
56 auto operator()(AlwaysT<N>... args) ->
decltype(fFunc({args...})) {
return fFunc({args...}); }
59template <std::
size_t N,
typename T,
typename F>
79 typename Args =
typename ROOT::TypeTraits::CallableTraits<typename std::decay<F>::type>::arg_types_nodecay,
80 typename Ret =
typename ROOT::TypeTraits::CallableTraits<typename std::decay<F>::type>::ret_type>
83 static_assert(std::is_same<Ret, bool>::value,
"RDF::Not requires a callable that returns a bool.");
100template <std::
size_t N,
typename T,
typename F>
117template <
typename NodeType>
136template <
typename NodeType>
137void SaveGraph(NodeType node,
const std::string &outputFile)
140 std::string dotGraph = helper(node);
142 std::ofstream out(outputFile);
143 if (!out.is_open()) {
144 throw std::runtime_error(
"Could not open output file \"" + outputFile +
"\"for reading");
155template <
typename NodeType>
182void RunGraphs(std::vector<RResultHandle> handles);
TRObject operator()(const T1 &t1) const
The public interface to the RDataFrame federation of classes.
std::function< bool(ArgTypes...)> NotHelper(ROOT::TypeTraits::TypeList< ArgTypes... >, F &&f)
auto PassAsVec(F &&f) -> PassAsVecHelper< std::make_index_sequence< N >, T, F >
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 ...
std::string SaveGraph(NodeType node)
Create a graphviz representation of the dataframe computation graph, return it as a string.
RNode AsRNode(NodeType node)
Cast a RDataFrame node to the common type ROOT::RDF::RNode.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Lightweight storage for a collection of types.