Logo ROOT  
Reference Guide
RJittedFilter.hxx
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 
11 #ifndef ROOT_RJITTEDFILTER
12 #define ROOT_RJITTEDFILTER
13 
14 #include "ROOT/RDF/GraphNode.hxx"
15 #include "ROOT/RDF/RFilterBase.hxx"
17 #include "ROOT/RStringView.hxx"
18 #include "RtypesCore.h"
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 class TTreeReader;
25 
26 namespace ROOT {
27 namespace RDF {
28 class RCutFlowReport;
29 }
30 
31 namespace Detail {
32 namespace RDF {
33 
35 
36 /// A wrapper around a concrete RFilter, which forwards all calls to it
37 /// RJittedFilter is the type of the node returned by jitted Filter calls: the concrete filter can be created and set
38 /// at a later time, from jitted code.
39 class RJittedFilter final : public RFilterBase {
40  std::unique_ptr<RFilterBase> fConcreteFilter = nullptr;
41 
42 public:
45 
46  void SetFilter(std::unique_ptr<RFilterBase> f);
47 
48  void InitSlot(TTreeReader *r, unsigned int slot) final;
49  bool CheckFilters(unsigned int slot, Long64_t entry) final;
50  void Report(ROOT::RDF::RCutFlowReport &) const final;
51  void PartialReport(ROOT::RDF::RCutFlowReport &) const final;
52  void FillReport(ROOT::RDF::RCutFlowReport &) const final;
53  void IncrChildrenCount() final;
54  void StopProcessing() final;
55  void ResetChildrenCount() final;
56  void TriggerChildrenCount() final;
57  void ResetReportCount() final;
58  void InitNode() final;
59  void AddFilterName(std::vector<std::string> &filters) final;
60  void FinaliseSlot(unsigned int slot) final;
61  std::shared_ptr<RDFGraphDrawing::GraphNode> GetGraph();
62 };
63 
64 } // ns RDF
65 } // ns Detail
66 } // ns ROOT
67 
68 #endif // ROOT_RJITTEDFILTER
ROOT::Detail::RDF::RFilterBase
Definition: RFilterBase.hxx:36
filters
const char * filters[]
Definition: TGFileBrowser.cxx:61
f
#define f(i)
Definition: RSha256.hxx:104
ROOT::Detail::RDF::RJittedFilter::IncrChildrenCount
void IncrChildrenCount() final
Definition: RJittedFilter.cxx:56
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
RFilterBase.hxx
GraphNode
Class used to create the operation graph to be printed in the dot representation.
Definition: GraphNode.hxx:26
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
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::RJittedFilter::~RJittedFilter
~RJittedFilter()
Definition: RJittedFilter.hxx:44
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::Internal::RDF::GraphDrawing
Definition: GraphNode.hxx:24
RStringView.hxx
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::Detail::RDF::RNodeBase::fLoopManager
RLoopManager * fLoopManager
Definition: RNodeBase.hxx:43
RtypesCore.h
ROOT::Detail::RDF::RJittedFilter
A wrapper around a concrete RFilter, which forwards all calls to it RJittedFilter is the type of the ...
Definition: RJittedFilter.hxx:39
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
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::RLoopManager::Deregister
void Deregister(RDFInternal::RActionBase *actionPtr)
Definition: RLoopManager.cxx:624
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
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Detail::RDF::RJittedFilter::SetFilter
void SetFilter(std::unique_ptr< RFilterBase > f)
Definition: RJittedFilter.cxx:21
GraphNode.hxx
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