Logo ROOT   6.18/05
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 <numeric> // std::accumulate
14
15using namespace ROOT::Detail::RDF;
16
17RFilterBase::RFilterBase(RLoopManager *implPtr, std::string_view name, const unsigned int nSlots,
18 const RDFInternal::RBookedCustomColumns &customColumns)
19 : RNodeBase(implPtr), fLastResult(nSlots), fAccepted(nSlots), fRejected(nSlots), fName(name), fNSlots(nSlots),
20 fCustomColumns(customColumns) {}
21
22// outlined to pin virtual table
24
26{
27 return !fName.empty();
28}
29
30std::string RFilterBase::GetName() const
31{
32 return fName;
33}
34
36{
37 if (fName.empty()) // FillReport is no-op for unnamed filters
38 return;
39 const auto accepted = std::accumulate(fAccepted.begin(), fAccepted.end(), 0ULL);
40 const auto all = accepted + std::accumulate(fRejected.begin(), fRejected.end(), 0ULL);
41 rep.AddCut({fName, accepted, all});
42}
43
45{
46 fLastCheckedEntry = std::vector<Long64_t>(fNSlots, -1);
47 if (!fName.empty()) // if this is a named filter we care about its report count
49}
char name[80]
Definition: TGX11.cxx:109
const unsigned int fNSlots
Number of thread slots used by this node, inherited from parent node.
Definition: RFilterBase.hxx:43
std::vector< ULong64_t > fRejected
Definition: RFilterBase.hxx:41
virtual void FillReport(ROOT::RDF::RCutFlowReport &) const
Definition: RFilterBase.cxx:35
std::string GetName() const
Definition: RFilterBase.cxx:30
std::vector< ULong64_t > fAccepted
Definition: RFilterBase.hxx:40
std::vector< Long64_t > fLastCheckedEntry
Definition: RFilterBase.hxx:38
The head node of a RDF computation graph.
Base class for non-leaf nodes of the computational graph.
Definition: RNodeBase.hxx:41
Encapsulates the columns defined by the user.
void AddCut(TCutInfo &&ci)
basic_string_view< char > string_view