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
14#include "ROOT/RDF/Utils.hxx"
15#include <numeric> // std::accumulate
16
17using namespace ROOT::Detail::RDF;
18
19RFilterBase::RFilterBase(RLoopManager *implPtr, std::string_view name, const unsigned int nSlots,
20 const RDFInternal::RColumnRegister &colRegister, const ColumnNames_t &columns,
21 const std::vector<std::string> &prevVariations, const std::string &variation)
22 : RNodeBase(ROOT::Internal::RDF::Union(colRegister.GetVariationDeps(columns), prevVariations), implPtr),
23 fLastCheckedEntry(nSlots * RDFInternal::CacheLineStep<Long64_t>(), -1),
24 fLastResult(nSlots * RDFInternal::CacheLineStep<int>()),
25 fAccepted(nSlots * RDFInternal::CacheLineStep<ULong64_t>()),
26 fRejected(nSlots * RDFInternal::CacheLineStep<ULong64_t>()), fName(name), fColumnNames(columns),
27 fColRegister(colRegister), fIsDefine(columns.size()), fVariation(variation)
28{
29 const auto nColumns = fColumnNames.size();
30 for (auto i = 0u; i < nColumns; ++i) {
32 if (fVariation != "nominal" && fIsDefine[i])
34 }
35}
36
37// outlined to pin virtual table
39
41{
42 return !fName.empty();
43}
44
45std::string RFilterBase::GetName() const
46{
47 return fName;
48}
49
51{
52 if (fName.empty()) // FillReport is no-op for unnamed filters
53 return;
54 const auto accepted = std::accumulate(fAccepted.begin(), fAccepted.end(), 0ULL);
55 const auto all = accepted + std::accumulate(fRejected.begin(), fRejected.end(), 0ULL);
56 rep.AddCut({fName, accepted, all});
57}
58
60{
61 if (!fName.empty()) // if this is a named filter we care about its report count
63}
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
virtual void MakeVariations(const std::vector< std::string > &variations)=0
Create clones of this Define that work with values in varied "universes".
const ROOT::RDF::ColumnNames_t fColumnNames
ROOT::RVecB fIsDefine
The nth flag signals whether the nth input column is a custom column or not.
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::RColumnRegister &colRegister, const ColumnNames_t &columns, const std::vector< std::string > &prevVariations, const std::string &variation="nominal")
std::string fVariation
This indicates for what variation this filter evaluates values.
std::string GetName() const
RDFInternal::RColumnRegister fColRegister
std::vector< ULong64_t > fAccepted
The head node of a RDF computation graph.
Base class for non-leaf nodes of the computational graph.
Definition RNodeBase.hxx:43
A binder for user-defined columns, variations and aliases.
bool IsDefineOrAlias(std::string_view name) const
Check if the provided name is tracked in the names list.
RDFDetail::RDefineBase * GetDefine(const std::string &colName) const
Return the RDefine for the requested column name, or nullptr.
void AddCut(TCutInfo &&ci)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.