Logo ROOT  
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 
16 using namespace ROOT::Detail::RDF;
17 
19  : RFilterBase(lm, name, lm->GetNSlots(), RDFInternal::RBookedDefines()) { }
20 
21 void RJittedFilter::SetFilter(std::unique_ptr<RFilterBase> f)
22 {
23  fConcreteFilter = std::move(f);
24 }
25 
26 void RJittedFilter::InitSlot(TTreeReader *r, unsigned int slot)
27 {
28  R__ASSERT(fConcreteFilter != nullptr);
29  fConcreteFilter->InitSlot(r, slot);
30 }
31 
32 bool 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 
86 void RJittedFilter::FinaliseSlot(unsigned int slot)
87 {
88  R__ASSERT(fConcreteFilter != nullptr);
89  fConcreteFilter->FinaliseSlot(slot);
90 }
91 
93 {
94  R__ASSERT(fConcreteFilter != nullptr);
95  fConcreteFilter->InitNode();
96 }
97 
98 void RJittedFilter::AddFilterName(std::vector<std::string> &filters)
99 {
100  if (fConcreteFilter == nullptr) {
101  // No event loop performed yet, but the JITTING must be performed.
103  }
104  fConcreteFilter->AddFilterName(filters);
105 }
106 
107 std::shared_ptr<RDFGraphDrawing::GraphNode> RJittedFilter::GetGraph()
108 {
109  if (fConcreteFilter != nullptr) {
110  // Here the filter exists, so it can be served
111  return fConcreteFilter->GetGraph();
112  }
113  throw std::runtime_error("The Jitting should have been invoked before this method.");
114 }
ROOT::Detail::RDF::RFilterBase
Definition: RFilterBase.hxx:36
filters
const char * filters[]
Definition: TGFileBrowser.cxx:61
RJittedFilter.hxx
f
#define f(i)
Definition: RSha256.hxx:104
ROOT::Detail::RDF::RJittedFilter::IncrChildrenCount
void IncrChildrenCount() final
Definition: RJittedFilter.cxx:56
RBookedDefines.hxx
r
ROOT::R::TRInterface & r
Definition: Object.C:4
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
ROOT::Detail::RDF::RJittedFilter::RJittedFilter
RJittedFilter(RLoopManager *lm, std::string_view name)
Definition: RJittedFilter.cxx:18
string_view
basic_string_view< char > string_view
Definition: libcpp_string_view.h:785
ROOT::Detail::RDF::RNodeBase::GetLoopManagerUnchecked
virtual RLoopManager * GetLoopManagerUnchecked()
Definition: RNodeBase.hxx:65
ROOT::Detail::RDF::RJittedFilter::TriggerChildrenCount
void TriggerChildrenCount() final
Definition: RJittedFilter.cxx:74
ROOT::Detail::RDF::RJittedFilter::fConcreteFilter
std::unique_ptr< RFilterBase > fConcreteFilter
Definition: RJittedFilter.hxx:40
RCutFlowReport.hxx
ROOT::Detail::RDF::RJittedFilter::AddFilterName
void AddFilterName(std::vector< std::string > &filters) final
Definition: RJittedFilter.cxx:98
ROOT::Detail::RDF::RJittedFilter::PartialReport
void PartialReport(ROOT::RDF::RCutFlowReport &) const final
Definition: RJittedFilter.cxx:44
ROOT::Detail::RDF
Definition: GraphUtils.hxx:28
ROOT::Detail::RDF::RJittedFilter::ResetReportCount
void ResetReportCount() final
Definition: RJittedFilter.cxx:80
ROOT::Detail::RDF::RJittedFilter::StopProcessing
void StopProcessing() final
Definition: RJittedFilter.cxx:62
ROOT::Detail::RDF::RJittedFilter::GetGraph
std::shared_ptr< RDFGraphDrawing::GraphNode > GetGraph()
Definition: RJittedFilter.cxx:107
ROOT::Detail::RDF::RJittedFilter::CheckFilters
bool CheckFilters(unsigned int slot, Long64_t entry) final
Definition: RJittedFilter.cxx:32
TTreeReader
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition: TTreeReader.h:44
ROOT::Internal::RDF::GetNSlots
unsigned int GetNSlots()
Definition: RDFUtils.cxx:268
R__ASSERT
#define R__ASSERT(e)
Definition: TError.h:120
ROOT::Detail::RDF::RJittedFilter::InitNode
void InitNode() final
Definition: RJittedFilter.cxx:92
ROOT::Detail::RDF::RJittedFilter::ResetChildrenCount
void ResetChildrenCount() final
Definition: RJittedFilter.cxx:68
ROOT::RDF::RCutFlowReport
Definition: RCutFlowReport.hxx:47
ROOT::Internal::RDF
Definition: RArrowDS.hxx:15
ROOT::Detail::RDF::RLoopManager::Jit
void Jit()
Add RDF nodes that require just-in-time compilation to the computation graph.
Definition: RLoopManager.cxx:557
name
char name[80]
Definition: TGX11.cxx:110
ROOT::Detail::RDF::RJittedFilter::InitSlot
void InitSlot(TTreeReader *r, unsigned int slot) final
Definition: RJittedFilter.cxx:26
ROOT::Detail::RDF::RJittedFilter::Report
void Report(ROOT::RDF::RCutFlowReport &) const final
Definition: RJittedFilter.cxx:38
RLoopManager.hxx
ROOT::Detail::RDF::RJittedFilter::FinaliseSlot
void FinaliseSlot(unsigned int slot) final
Clean-up operations to be performed at the end of a task.
Definition: RJittedFilter.cxx:86
ROOT::Detail::RDF::RJittedFilter::SetFilter
void SetFilter(std::unique_ptr< RFilterBase > f)
Definition: RJittedFilter.cxx:21
ROOT::Detail::RDF::RLoopManager
The head node of a RDF computation graph.
Definition: RLoopManager.hxx:57
ROOT::Detail::RDF::RJittedFilter::FillReport
void FillReport(ROOT::RDF::RCutFlowReport &) const final
Definition: RJittedFilter.cxx:50