Logo ROOT  
Reference Guide
RFilterBase.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
13#include "ROOT/RDF/Utils.hxx"
14#include <numeric> // std::accumulate
15
16using namespace ROOT::Detail::RDF;
17
18RFilterBase::RFilterBase(RLoopManager *implPtr, std::string_view name, const unsigned int nSlots,
19 const RDFInternal::RColumnRegister &colRegister, const ColumnNames_t &columns)
20 : RNodeBase(implPtr), fLastCheckedEntry(std::vector<Long64_t>(nSlots * RDFInternal::CacheLineStep<Long64_t>(), -1)),
21 fLastResult(nSlots * RDFInternal::CacheLineStep<int>()),
22 fAccepted(nSlots * RDFInternal::CacheLineStep<ULong64_t>()),
23 fRejected(nSlots * RDFInternal::CacheLineStep<ULong64_t>()), fName(name), fColumnNames(columns),
24 fColRegister(colRegister), fIsDefine(columns.size())
25{
26 const auto nColumns = fColumnNames.size();
27 for (auto i = 0u; i < nColumns; ++i)
29}
30
31// outlined to pin virtual table
33
35{
36 return !fName.empty();
37}
38
39std::string RFilterBase::GetName() const
40{
41 return fName;
42}
43
45{
46 if (fName.empty()) // FillReport is no-op for unnamed filters
47 return;
48 const auto accepted = std::accumulate(fAccepted.begin(), fAccepted.end(), 0ULL);
49 const auto all = accepted + std::accumulate(fRejected.begin(), fRejected.end(), 0ULL);
50 rep.AddCut({fName, accepted, all});
51}
52
54{
55 if (!fName.empty()) // if this is a named filter we care about its report count
57}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
long long Long64_t
Definition: RtypesCore.h:80
unsigned long long ULong64_t
Definition: RtypesCore.h:81
char name[80]
Definition: TGX11.cxx:110
const ROOT::RDF::ColumnNames_t fColumnNames
Definition: RFilterBase.hxx:45
ROOT::RVecB fIsDefine
The nth flag signals whether the nth input column is a custom column or not.
Definition: RFilterBase.hxx:48
std::vector< ULong64_t > fRejected
Definition: RFilterBase.hxx:43
virtual void FillReport(ROOT::RDF::RCutFlowReport &) const
Definition: RFilterBase.cxx:44
std::string GetName() const
Definition: RFilterBase.cxx:39
RDFInternal::RColumnRegister fColRegister
Definition: RFilterBase.hxx:46
std::vector< ULong64_t > fAccepted
Definition: RFilterBase.hxx:42
The head node of a RDF computation graph.
Base class for non-leaf nodes of the computational graph.
Definition: RNodeBase.hxx:42
A binder for user-defined columns and aliases.
bool HasName(std::string_view name) const
Check if the provided name is tracked in the names list.
void AddCut(TCutInfo &&ci)
basic_string_view< char > string_view
constexpr std::size_t CacheLineStep()
Stepping through CacheLineStep<T> values in a vector<T> brings you to a new cache line.
Definition: Utils.hxx:220
std::vector< std::string > ColumnNames_t
Definition: Utils.hxx:35