Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RJittedAction.cxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 09/2018
2
3/*************************************************************************
4 * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
12// Avoid error: invalid application of ‘sizeof’ to incomplete type in RJittedAction::GetMergeableValue
14
15#include <cassert>
16#include <memory>
17
20
21// fwd decls
22class TTreeReader;
23namespace ROOT {
24namespace Detail {
25namespace RDF {
26class RLoopManager;
27}
28} // namespace Detail
29} // namespace ROOT
30namespace ROOT {
31namespace Detail {
32namespace RDF {
33class RLoopManager;
34}
35} // namespace Detail
36} // namespace ROOT
37namespace ROOT {
38namespace Detail {
39namespace RDF {
40class RMergeableValueBase;
41}
42} // namespace Detail
43} // namespace ROOT
44namespace ROOT {
45namespace Internal {
46namespace RDF {
47class RColumnRegister;
48}
49} // namespace Internal
50} // namespace ROOT
51namespace ROOT {
52namespace Internal {
53namespace RDF {
54namespace GraphDrawing {
55class GraphNode;
56}
57} // namespace RDF
58} // namespace Internal
59} // namespace ROOT
60
63 const std::vector<std::string> &prevVariations,
64 std::shared_ptr<ROOT::Detail::RDF::RNodeBase> prevNode)
65 : RActionBase(&lm, columns, colRegister, prevVariations), fPrevNode(prevNode)
66{
67}
68
70
72{
73 assert(fConcreteAction != nullptr);
75}
76
78{
79 assert(fConcreteAction != nullptr);
80 fConcreteAction->Initialize();
81}
82
84{
85 assert(fConcreteAction != nullptr);
86 fConcreteAction->InitSlot(r, slot);
87}
88
90{
91 assert(fConcreteAction != nullptr);
92 fConcreteAction->TriggerChildrenCount();
93}
94
96{
97 assert(fConcreteAction != nullptr);
98 fConcreteAction->FinalizeSlot(slot);
99}
100
102{
103 assert(fConcreteAction != nullptr);
104 fConcreteAction->Finalize();
105}
106
108{
109 assert(fConcreteAction != nullptr);
110 return fConcreteAction->PartialUpdate(slot);
111}
112
114{
115 if (fConcreteAction != nullptr) {
116 return fConcreteAction->HasRun();
117 } else {
118 // The action has not been JITted. This means that it has not run.
119 return false;
120 }
121}
122
124{
125 assert(fConcreteAction != nullptr);
126 return fConcreteAction->SetHasRun();
127}
128
129std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode> RJittedAction::GetGraph(
130 std::unordered_map<void *, std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode>> &visitedMap)
131{
132 assert(fConcreteAction != nullptr);
133 return fConcreteAction->GetGraph(visitedMap);
134}
135
136/**
137 Retrieve a wrapper to the result of the action that knows how to merge
138 with others of the same type.
139*/
140std::unique_ptr<ROOT::Detail::RDF::RMergeableValueBase> RJittedAction::GetMergeableValue() const
141{
142 assert(fConcreteAction != nullptr);
143 return fConcreteAction->GetMergeableValue();
144}
145
147{
148 assert(fConcreteAction != nullptr);
149 return fConcreteAction->GetSampleCallback();
150}
151
152std::unique_ptr<ROOT::Internal::RDF::RActionBase> RJittedAction::MakeVariedAction(std::vector<void *> &&results)
153{
154 assert(fConcreteAction != nullptr);
155 return fConcreteAction->MakeVariedAction(std::move(results));
156}
157
158std::unique_ptr<ROOT::Internal::RDF::RActionBase> RJittedAction::CloneAction(void *newResult)
159{
160 assert(fConcreteAction != nullptr);
161 return fConcreteAction->CloneAction(newResult);
162}
163
164std::shared_ptr<ROOT::Detail::RDF::RNodeBase> RJittedAction::MoveOutPrevNode()
165{
166 return std::move(fPrevNode);
167}
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
The head node of a RDF computation graph.
A binder for user-defined columns, variations and aliases.
ROOT::RDF::SampleCallback_t GetSampleCallback() final
std::unique_ptr< ROOT::Detail::RDF::RMergeableValueBase > GetMergeableValue() const final
Retrieve a wrapper to the result of the action that knows how to merge with others of the same type.
void FinalizeSlot(unsigned int) final
void Run(unsigned int slot, Long64_t entry) final
std::shared_ptr< ROOT::Detail::RDF::RNodeBase > fPrevNode
RJittedAction(RLoopManager &lm, const ROOT::RDF::ColumnNames_t &columns, const RColumnRegister &colRegister, const std::vector< std::string > &prevVariations, std::shared_ptr< ROOT::Detail::RDF::RNodeBase > prevNode=nullptr)
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 InitSlot(TTreeReader *r, unsigned int slot) final
std::unique_ptr< ROOT::Internal::RDF::RActionBase > CloneAction(void *newResult) final
std::shared_ptr< ROOT::Detail::RDF::RNodeBase > MoveOutPrevNode()
std::unique_ptr< RActionBase > fConcreteAction
std::shared_ptr< GraphDrawing::GraphNode > GetGraph(std::unordered_map< void *, std::shared_ptr< GraphDrawing::GraphNode > > &visitedMap) final
std::unique_ptr< RActionBase > MakeVariedAction(std::vector< void * > &&results) final
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition TTreeReader.h:46
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