36std::shared_ptr<GraphNode>
AddDefinesToGraph(std::shared_ptr<GraphNode> node,
const RColumnRegister &colRegister,
37 const std::vector<std::string> &prevNodeDefines,
38 std::unordered_map<
void *, std::shared_ptr<GraphNode>> &visitedMap);
52template <
typename Helper,
typename PrevNode,
typename ColumnTypes_t =
typename Helper::ColumnTypes_t>
54 using TypeInd_t = std::make_index_sequence<ColumnTypes_t::list_size>;
60 std::vector<std::array<RColumnReaderBase *, ColumnTypes_t::list_size>>
fValues;
63 std::array<bool, ColumnTypes_t::list_size>
fIsDefine;
72 const auto nColumns = columns.size();
73 for (
auto i = 0u;
i < nColumns; ++
i)
88 return fHelper.GetMergeableValue();
101 template <
typename... ColTypes, std::size_t... S>
105 fValues[slot][S]->template Get<ColTypes>(entry)...};
122 fHelper.CallFinalizeTask(slot);
133 std::shared_ptr<RDFGraphDrawing::GraphNode>
134 GetGraph(std::unordered_map<
void *, std::shared_ptr<RDFGraphDrawing::GraphNode>> &visitedMap)
final
136 auto prevNode =
fPrevNode.GetGraph(visitedMap);
137 const auto &prevColumns = prevNode->GetDefinedColumns();
140 const auto nodeType =
HasRun() ? RDFGraphDrawing::ENodeType::kUsedAction : RDFGraphDrawing::ENodeType::kAction;
142 std::make_shared<RDFGraphDrawing::GraphNode>(
fHelper.GetActionName(), visitedMap.size(), nodeType);
143 visitedMap[(
void *)
this] = thisNode;
145 auto upmostNode = AddDefinesToGraph(thisNode,
GetColRegister(), prevColumns, visitedMap);
147 thisNode->AddDefinedColumns(
GetColRegister().GenerateColumnNames());
148 upmostNode->SetPrevNode(prevNode);
159 assert(results.size() == nVariations);
161 std::vector<Helper> helpers;
162 helpers.reserve(nVariations);
164 for (
auto &&res : results)
165 helpers.emplace_back(
fHelper.CallMakeNew(res));
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
RActionBase(RLoopManager *lm, const ColumnNames_t &colNames, const RColumnRegister &colRegister, const std::vector< std::string > &prevVariations)
unsigned int GetNSlots() const
const std::vector< std::string > & GetVariations() const
const ColumnNames_t & GetColumnNames() const
virtual bool HasRun() const
RLoopManager * fLoopManager
A raw pointer to the RLoopManager at the root of this functional graph.
RColumnRegister & GetColRegister()
std::shared_ptr< RDFGraphDrawing::GraphNode > GetGraph(std::unordered_map< void *, std::shared_ptr< RDFGraphDrawing::GraphNode > > &visitedMap) final
void FinalizeSlot(unsigned int slot) final
Clean-up operations to be performed at the end of a task.
void Run(unsigned int slot, Long64_t entry) final
std::unique_ptr< RActionBase > CloneAction(void *newResult) final
Returns a new action with a cloned helper.
void InitSlot(TTreeReader *r, unsigned int slot) final
std::make_index_sequence< ColumnTypes_t::list_size > TypeInd_t
void Finalize() final
Clean-up and finalize the action result (e.g.
RAction & operator=(const RAction &)=delete
void TriggerChildrenCount() final
std::unique_ptr< RDFDetail::RMergeableValueBase > GetMergeableValue() const final
Retrieve a wrapper to the result of the action that knows how to merge with others of the same type.
RAction(const RAction &)=delete
void * PartialUpdate(unsigned int slot) final
This method is invoked to update a partial result during the event loop, right before passing the res...
void CallExec(unsigned int slot, Long64_t entry, TypeList< ColTypes... >, std::index_sequence< S... >)
RAction(Helper &&h, const ColumnNames_t &columns, std::shared_ptr< PrevNode > pd, const RColumnRegister &colRegister)
const std::shared_ptr< PrevNode > fPrevNodePtr
ROOT::RDF::SampleCallback_t GetSampleCallback() final
std::unique_ptr< RActionBase > MakeVariedAction(std::vector< void * > &&results) final
std::array< bool, ColumnTypes_t::list_size > fIsDefine
The nth flag signals whether the nth input column is a custom column or not.
std::vector< std::array< RColumnReaderBase *, ColumnTypes_t::list_size > > fValues
Column readers per slot and per input column.
A binder for user-defined columns, variations and aliases.
bool IsDefineOrAlias(std::string_view name) const
Check if the provided name is tracked in the names list.
Just like an RAction, but it has N action helpers and N previous nodes (N is the number of variations...
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
std::shared_ptr< GraphNode > AddDefinesToGraph(std::shared_ptr< GraphNode > node, const RColumnRegister &colRegister, const std::vector< std::string > &prevNodeDefines, std::unordered_map< void *, std::shared_ptr< GraphNode > > &visitedMap)
std::array< RDFDetail::RColumnReaderBase *, sizeof...(ColTypes)> GetColumnReaders(unsigned int slot, TTreeReader *r, TypeList< ColTypes... >, const RColumnReadersInfo &colInfo, const std::string &variationName="nominal")
Create a group of column readers, one per type in the parameter pack.
std::function< void(unsigned int, const ROOT::RDF::RSampleInfo &)> SampleCallback_t
The type of a data-block callback, registered with an RDataFrame computation graph via e....
std::vector< std::string > ColumnNames_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Struct to wrap the call to a function with a guaranteed order of execution of its arguments.
This type aggregates some of the arguments passed to GetColumnReaders.
Lightweight storage for a collection of types.