11#ifndef ROOT_GRAPHUTILS
12#define ROOT_GRAPHUTILS
39namespace GraphDrawing {
40std::shared_ptr<GraphNode>
52 const std::vector<std::string> &prevNodeDefines);
67 using DefinesNodesMap_t = std::map<const ROOT::Detail::RDF::RDefineBase *, std::weak_ptr<GraphNode>>;
68 using FiltersNodesMap_t = std::map<const ROOT::Detail::RDF::RFilterBase *, std::weak_ptr<GraphNode>>;
69 using RangesNodesMap_t = std::map<const ROOT::Detail::RDF::RRangeBase *, std::weak_ptr<GraphNode>>;
97 friend std::shared_ptr<GraphNode>
126 template <
typename Proxied,
typename DataSource>
129 auto loopManager = rInterface.GetLoopManager();
137 template <
typename T>
142 throw std::runtime_error(
"Something went wrong");
144 if (std::is_same<T, RInterface<RLoopManager, void>>::value) {
158 template <
typename NodeType>
The head node of a RDF computation graph.
std::map< const ROOT::Detail::RDF::RFilterBase *, std::weak_ptr< GraphNode > > FiltersNodesMap_t
std::string operator()(NodeType &node)
Functor.
static FiltersNodesMap_t & GetStaticFiltersMap()
Stores the filters defined and which node in the graph defined them.
std::string RepresentGraph(const RResultPtr< T > &resultPtr)
Starting from an action, prints the branch it belongs to.
static DefinesNodesMap_t & GetStaticColumnsMap()
Stores the columns defined and which node in the graph defined them.
friend std::shared_ptr< GraphNode > CreateRangeNode(const ROOT::Detail::RDF::RRangeBase *rangePtr)
Invoked by the RNodes to create a Range graph node.
friend std::shared_ptr< GraphNode > CreateDefineNode(const std::string &columnName, const ROOT::Detail::RDF::RDefineBase *columnPtr)
Invoked by the RNodes to create a define graph node.
std::string FromGraphLeafToDot(std::shared_ptr< GraphNode > leaf)
Starting from any leaf (Action, Filter, Range) it draws the dot representation of the branch.
std::string FromGraphActionsToDot(std::vector< std::shared_ptr< GraphNode > > leaves)
Starting by an array of leaves, it draws the entire graph.
std::map< const ROOT::Detail::RDF::RRangeBase *, std::weak_ptr< GraphNode > > RangesNodesMap_t
std::string RepresentGraph(RInterface< Proxied, DataSource > &rInterface)
Starting from a Filter or Range, prints the branch it belongs to.
std::string RepresentGraph(ROOT::RDataFrame &rDataFrame)
Starting from the root node, prints the entire graph.
friend std::shared_ptr< GraphNode > CreateFilterNode(const ROOT::Detail::RDF::RFilterBase *filterPtr)
Invoked by the RNodes to create a Filter graph node.
std::map< const ROOT::Detail::RDF::RDefineBase *, std::weak_ptr< GraphNode > > DefinesNodesMap_t
static RangesNodesMap_t & GetStaticRangesMap()
Stores the ranges defined and which node in the graph defined them.
static void ClearCounter()
Resets the counter.
Encapsulates the columns defined by the user.
Smart pointer for the return type of actions.
RDFDetail::RLoopManager * fLoopManager
Non-owning pointer to the RLoopManager at the root of this computation graph.
std::shared_ptr< RDFInternal::RActionBase > fActionPtr
Owning pointer to the action that will produce this result.
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
std::shared_ptr< GraphNode > CreateDefineNode(const std::string &columnName, const ROOT::Detail::RDF::RDefineBase *columnPtr)
std::shared_ptr< GraphNode > CreateRangeNode(const ROOT::Detail::RDF::RRangeBase *rangePtr)
std::shared_ptr< GraphNode > AddDefinesToGraph(std::shared_ptr< GraphNode > node, const RDFInternal::RBookedDefines &defines, const std::vector< std::string > &prevNodeDefines)
Add the Defines that have been added between this node and the previous to the graph.
std::shared_ptr< GraphNode > CreateFilterNode(const ROOT::Detail::RDF::RFilterBase *filterPtr)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...