Logo ROOT   6.18/05
Reference Guide
RJittedFilter.cxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 09/2018
2
3/*************************************************************************
4 * Copyright (C) 1995-2018, 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
15
16using namespace ROOT::Detail::RDF;
17
18RJittedFilter::RJittedFilter(RLoopManager *lm, std::string_view name)
19 : RFilterBase(lm, name, lm->GetNSlots(), RDFInternal::RBookedCustomColumns()) { }
20
21void RJittedFilter::SetFilter(std::unique_ptr<RFilterBase> f)
22{
23 fConcreteFilter = std::move(f);
24}
25
26void RJittedFilter::InitSlot(TTreeReader *r, unsigned int slot)
27{
28 R__ASSERT(fConcreteFilter != nullptr);
29 fConcreteFilter->InitSlot(r, slot);
30}
31
32bool RJittedFilter::CheckFilters(unsigned int slot, Long64_t entry)
33{
34 R__ASSERT(fConcreteFilter != nullptr);
35 return fConcreteFilter->CheckFilters(slot, entry);
36}
37
39{
40 R__ASSERT(fConcreteFilter != nullptr);
41 fConcreteFilter->Report(cr);
42}
43
45{
46 R__ASSERT(fConcreteFilter != nullptr);
47 fConcreteFilter->PartialReport(cr);
48}
49
51{
52 R__ASSERT(fConcreteFilter != nullptr);
53 fConcreteFilter->FillReport(cr);
54}
55
57{
58 R__ASSERT(fConcreteFilter != nullptr);
59 fConcreteFilter->IncrChildrenCount();
60}
61
63{
64 R__ASSERT(fConcreteFilter != nullptr);
65 fConcreteFilter->StopProcessing();
66}
67
69{
70 R__ASSERT(fConcreteFilter != nullptr);
71 fConcreteFilter->ResetChildrenCount();
72}
73
75{
76 R__ASSERT(fConcreteFilter != nullptr);
77 fConcreteFilter->TriggerChildrenCount();
78}
79
81{
82 R__ASSERT(fConcreteFilter != nullptr);
83 fConcreteFilter->ResetReportCount();
84}
85
86void RJittedFilter::ClearValueReaders(unsigned int slot)
87{
88 R__ASSERT(fConcreteFilter != nullptr);
89 fConcreteFilter->ClearValueReaders(slot);
90}
91
92void RJittedFilter::ClearTask(unsigned int slot)
93{
94 R__ASSERT(fConcreteFilter != nullptr);
95 fConcreteFilter->ClearTask(slot);
96}
97
99{
100 R__ASSERT(fConcreteFilter != nullptr);
101 fConcreteFilter->InitNode();
102}
103
104void RJittedFilter::AddFilterName(std::vector<std::string> &filters)
105{
106 if (fConcreteFilter == nullptr) {
107 // No event loop performed yet, but the JITTING must be performed.
109 }
110 fConcreteFilter->AddFilterName(filters);
111}
112
113std::shared_ptr<RDFGraphDrawing::GraphNode> RJittedFilter::GetGraph()
114{
115 if (fConcreteFilter != nullptr) {
116 // Here the filter exists, so it can be served
117 return fConcreteFilter->GetGraph();
118 }
119 throw std::runtime_error("The Jitting should have been invoked before this method.");
120}
ROOT::R::TRInterface & r
Definition: Object.C:4
#define f(i)
Definition: RSha256.hxx:104
long long Long64_t
Definition: RtypesCore.h:69
#define R__ASSERT(e)
Definition: TError.h:96
const char * filters[]
char name[80]
Definition: TGX11.cxx:109
void ClearValueReaders(unsigned int slot) final
void FillReport(ROOT::RDF::RCutFlowReport &) const final
void ClearTask(unsigned int slot) final
void AddFilterName(std::vector< std::string > &filters) final
void Report(ROOT::RDF::RCutFlowReport &) const final
std::shared_ptr< RDFGraphDrawing::GraphNode > GetGraph()
void InitSlot(TTreeReader *r, unsigned int slot) final
std::unique_ptr< RFilterBase > fConcreteFilter
void PartialReport(ROOT::RDF::RCutFlowReport &) const final
bool CheckFilters(unsigned int slot, Long64_t entry) final
void SetFilter(std::unique_ptr< RFilterBase > f)
The head node of a RDF computation graph.
void Jit()
Add RDF nodes that require just-in-time compilation to the computation graph.
virtual RLoopManager * GetLoopManagerUnchecked()
Definition: RNodeBase.hxx:64
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition: TTreeReader.h:44
basic_string_view< char > string_view
unsigned int GetNSlots()
Definition: RDFUtils.cxx:257