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
14// Avoid error: invalid application of ‘sizeof’ to incomplete type in RJittedAction::GetMergeableValue
16#include "TError.h"
17
18#include <cassert>
19#include <memory>
20
23
25 const ROOT::Internal::RDF::RColumnRegister &colRegister,
26 const std::vector<std::string> &prevVariations)
27 : RActionBase(&lm, columns, colRegister, prevVariations)
28{
29}
30
32{
33 // must Deregister objects from the RLoopManager here, before the fConcreteAction data member is destroyed:
34 // otherwise if fConcreteAction is the RLoopManager, it will be destroyed before the calls to Deregister happen.
35 GetColRegister().Clear(); // triggers RDefine deregistration
37}
38
39void RJittedAction::Run(unsigned int slot, Long64_t entry)
40{
41 assert(fConcreteAction != nullptr);
42 fConcreteAction->Run(slot, entry);
43}
44
46{
47 assert(fConcreteAction != nullptr);
48 fConcreteAction->Initialize();
49}
50
51void RJittedAction::InitSlot(TTreeReader *r, unsigned int slot)
52{
53 assert(fConcreteAction != nullptr);
54 fConcreteAction->InitSlot(r, slot);
55}
56
58{
59 assert(fConcreteAction != nullptr);
60 fConcreteAction->TriggerChildrenCount();
61}
62
63void RJittedAction::FinalizeSlot(unsigned int slot)
64{
65 assert(fConcreteAction != nullptr);
66 fConcreteAction->FinalizeSlot(slot);
67}
68
70{
71 assert(fConcreteAction != nullptr);
72 fConcreteAction->Finalize();
73}
74
75void *RJittedAction::PartialUpdate(unsigned int slot)
76{
77 assert(fConcreteAction != nullptr);
78 return fConcreteAction->PartialUpdate(slot);
79}
80
82{
83 if (fConcreteAction != nullptr) {
84 return fConcreteAction->HasRun();
85 } else {
86 // The action has not been JITted. This means that it has not run.
87 return false;
88 }
89}
90
92{
93 assert(fConcreteAction != nullptr);
94 return fConcreteAction->SetHasRun();
95}
96
97std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode> RJittedAction::GetGraph()
98{
99 assert(fConcreteAction != nullptr);
100 return fConcreteAction->GetGraph();
101}
102
103/**
104 Retrieve a wrapper to the result of the action that knows how to merge
105 with others of the same type.
106*/
107std::unique_ptr<ROOT::Detail::RDF::RMergeableValueBase> RJittedAction::GetMergeableValue() const
108{
109 assert(fConcreteAction != nullptr);
110 return fConcreteAction->GetMergeableValue();
111}
112
114{
115 assert(fConcreteAction != nullptr);
116 return fConcreteAction->GetSampleCallback();
117}
118
119std::unique_ptr<ROOT::Internal::RDF::RActionBase> RJittedAction::MakeVariedAction(std::vector<void *> &&results)
120{
121 assert(fConcreteAction != nullptr);
122 return fConcreteAction->MakeVariedAction(std::move(results));
123}
ROOT::R::TRInterface & r
Definition Object.C:4
long long Long64_t
Definition RtypesCore.h:80
The head node of a RDF computation graph.
void Deregister(RDFInternal::RActionBase *actionPtr)
RLoopManager * fLoopManager
A raw pointer to the RLoopManager at the root of this functional graph.
RColumnRegister & GetColRegister()
A binder for user-defined columns and aliases.
void Clear()
Empty the contents of this ledger.
std::shared_ptr< GraphDrawing::GraphNode > GetGraph()
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
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
RJittedAction(RLoopManager &lm, const ROOT::RDF::ColumnNames_t &columns, const RColumnRegister &colRegister, const std::vector< std::string > &prevVariations)
std::unique_ptr< RActionBase > fConcreteAction
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:44
std::vector< std::string > ColumnNames_t
Definition Utils.hxx:35
std::function< void(unsigned int, const ROOT::RDF::RSampleInfo &)> SampleCallback_t
The type of a data-block callback, registered with a RDataFrame computation graph via e....