Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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::RBookedDefines &defines)
20 : RNodeBase(implPtr), fLastResult(nSlots * RDFInternal::CacheLineStep<int>()),
21 fAccepted(nSlots * RDFInternal::CacheLineStep<ULong64_t>()),
22 fRejected(nSlots * RDFInternal::CacheLineStep<ULong64_t>()), fName(name), fNSlots(nSlots), fDefines(defines)
23{
24}
25
26// outlined to pin virtual table
28
30{
31 return !fName.empty();
32}
33
34std::string RFilterBase::GetName() const
35{
36 return fName;
37}
38
40{
41 if (fName.empty()) // FillReport is no-op for unnamed filters
42 return;
43 const auto accepted = std::accumulate(fAccepted.begin(), fAccepted.end(), 0ULL);
44 const auto all = accepted + std::accumulate(fRejected.begin(), fRejected.end(), 0ULL);
45 rep.AddCut({fName, accepted, all});
46}
47
49{
50 fLastCheckedEntry = std::vector<Long64_t>(fNSlots * RDFInternal::CacheLineStep<Long64_t>(), -1);
51 if (!fName.empty()) // if this is a named filter we care about its report count
53}
unsigned long long ULong64_t
Definition RtypesCore.h:74
char name[80]
Definition TGX11.cxx:110
const unsigned int fNSlots
Number of thread slots used by this node, inherited from parent node.
std::vector< ULong64_t > fRejected
virtual void FillReport(ROOT::RDF::RCutFlowReport &) const
RFilterBase(RLoopManager *df, std::string_view name, const unsigned int nSlots, const RDFInternal::RBookedDefines &defines)
std::string GetName() const
std::vector< ULong64_t > fAccepted
std::vector< Long64_t > fLastCheckedEntry
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)