Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RJittedAction.hxx
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
11#ifndef ROOT_RJITTEDACTION
12#define ROOT_RJITTEDACTION
13
16#include "RtypesCore.h"
17
18#include <memory>
19
20class TTreeReader;
21
22namespace ROOT {
23namespace Detail {
24namespace RDF {
25class RMergeableValueBase;
26class RNodeBase;
27} // namespace RDF
28} // namespace Detail
29} // namespace ROOT
30
31namespace ROOT {
32namespace Internal {
33namespace RDF {
34
35// fwd decl
36namespace GraphDrawing {
37class GraphNode;
38} // ns GraphDrawing
39
40class RJittedAction : public RActionBase {
41private:
42 std::unique_ptr<RActionBase> fConcreteAction;
43 std::shared_ptr<ROOT::Detail::RDF::RNodeBase> fPrevNode;
44
45public:
47 const std::vector<std::string> &prevVariations,
48 std::shared_ptr<ROOT::Detail::RDF::RNodeBase> prevNode = nullptr);
50
51 void SetAction(std::unique_ptr<RActionBase> a) { fConcreteAction = std::move(a); }
52
53 void Run(unsigned int slot, Long64_t entry) final;
54 void Initialize() final;
55 void InitSlot(TTreeReader *r, unsigned int slot) final;
57 void FinalizeSlot(unsigned int) final;
58 void Finalize() final;
59 void *PartialUpdate(unsigned int slot) final;
60 bool HasRun() const final;
61 void SetHasRun() final;
62
63 std::shared_ptr<GraphDrawing::GraphNode>
64 GetGraph(std::unordered_map<void *, std::shared_ptr<GraphDrawing::GraphNode>> &visitedMap) final;
65
66 // Helper for RMergeableValue
67 std::unique_ptr<ROOT::Detail::RDF::RMergeableValueBase> GetMergeableValue() const final;
68
70
71 std::unique_ptr<RActionBase> MakeVariedAction(std::vector<void *> &&results) final;
72 std::unique_ptr<ROOT::Internal::RDF::RActionBase> CloneAction(void *newResult) final;
73 std::shared_ptr<ROOT::Detail::RDF::RNodeBase> MoveOutPrevNode();
74};
75
76} // ns RDF
77} // ns Internal
78} // ns ROOT
79
80#endif // ROOT_RJITTEDACTION
#define a(i)
Definition RSha256.hxx:99
Basic types used by ROOT and required by TInterpreter.
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
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.
Base class of RMergeableValue.
Base class for non-leaf nodes of the computational graph.
Definition RNodeBase.hxx:43
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()
void SetAction(std::unique_ptr< RActionBase > a)
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