11#ifndef ROOT_RDF_RFilterWithMissingValues
12#define ROOT_RDF_RFilterWithMissingValues
28#include <unordered_map>
35 std::unordered_map<
void *, std::shared_ptr<GraphNode>> &
visitedMap);
40 std::unordered_map<
void *, std::shared_ptr<GraphNode>> &
visitedMap);
57template <
typename PrevNodeRaw>
78 fPrevNodePtr(std::
move(
pd)),
79 fValues(fPrevNodePtr->GetLoopManagerUnchecked()->GetNSlots()),
82 fLoopManager->Register(
this);
84 fLoopManager->InsertSuppressErrorsForMissingBranch(fColumnNames[0]);
95 fLoopManager->Deregister(
this);
96 fLoopManager->EraseSuppressErrorsForMissingBranch(fColumnNames[0]);
106 if (!fPrevNodePtr->CheckFilters(
slot,
entry)) {
112 if (fDiscardEntryWithMissingValue) {
129 *fLoopManager,
r, fColumnNames[0],
typeid(
void));
130 fLastCheckedEntry[
slot * RDFInternal::CacheLineStep<Long64_t>()] = -1;
138 fPrevNodePtr->PartialReport(
rep);
145 if (fNStopsReceived == fNChildren)
146 fPrevNodePtr->StopProcessing();
153 if (fNChildren == 1 && fName.empty())
154 fPrevNodePtr->IncrChildrenCount();
160 fPrevNodePtr->IncrChildrenCount();
165 fPrevNodePtr->AddFilterName(
filters);
166 auto name = (HasName() ? fName : fDiscardEntryWithMissingValue ?
"FilterAvailable" :
"FilterMissing");
173 std::shared_ptr<RDFGraphDrawing::GraphNode>
177 auto prevNode = fPrevNodePtr->GetGraph(
visitedMap);
178 const auto &
prevColumns = prevNode->GetDefinedColumns();
192 thisNode->AddDefinedColumns(fColRegister.GenerateColumnNames());
202 assert(fVariation ==
"nominal");
211 if (it != fVariedFilters.end())
214 auto prevNode = fPrevNodePtr;
215 if (
static_cast<RNodeBase *
>(fPrevNodePtr.get()) !=
static_cast<RNodeBase *
>(fLoopManager) &&
217 prevNode = std::static_pointer_cast<PrevNode_t>(prevNode->GetVariedFilter(
variationName));
222 fDiscardEntryWithMissingValue, std::move(prevNode), fColRegister, fColumnNames, fName,
variationName));
224 return e.first->second;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
implementation of FilterAvailable and FilterMissing operations
RFilterWithMissingValues & operator=(RFilterWithMissingValues &&)=delete
const std::shared_ptr< PrevNode_t > fPrevNodePtr
void TriggerChildrenCount() final
void StopProcessing() final
std::vector< RColumnReaderBase * > fValues
bool CheckFilters(unsigned int slot, Long64_t entry) final
void FinalizeSlot(unsigned int slot) final
Clean-up operations to be performed at the end of a task.
bool fDiscardEntryWithMissingValue
std::shared_ptr< RDFGraphDrawing::GraphNode > GetGraph(std::unordered_map< void *, std::shared_ptr< RDFGraphDrawing::GraphNode > > &visitedMap) final
void IncrChildrenCount() final
std::conditional_t< std::is_same< PrevNodeRaw, RJittedFilter >::value, RFilterBase, PrevNodeRaw > PrevNode_t
std::shared_ptr< RNodeBase > GetVariedFilter(const std::string &variationName) final
Return a clone of this Filter that works with values in the variationName "universe".
RFilterWithMissingValues(const RFilterWithMissingValues &)=delete
void InitSlot(TTreeReader *r, unsigned int slot) final
~RFilterWithMissingValues() final
void AddFilterName(std::vector< std::string > &filters) final
RFilterWithMissingValues & operator=(const RFilterWithMissingValues &)=delete
RFilterWithMissingValues(RFilterWithMissingValues &&)=delete
void PartialReport(ROOT::RDF::RCutFlowReport &rep) const final
void Report(ROOT::RDF::RCutFlowReport &rep) const final
RFilterWithMissingValues(bool discardEntry, std::shared_ptr< PrevNode_t > pd, const RDFInternal::RColumnRegister &colRegister, const ColumnNames_t &columns, std::string_view filterName="", const std::string &variationName="nominal")
Base class for non-leaf nodes of the computational graph.
A binder for user-defined columns, variations and aliases.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
std::shared_ptr< GraphNode > CreateFilterNode(const ROOT::Detail::RDF::RFilterBase *filterPtr, std::unordered_map< void *, std::shared_ptr< GraphNode > > &visitedMap)
std::shared_ptr< GraphNode > AddDefinesToGraph(std::shared_ptr< GraphNode > node, const RColumnRegister &colRegister, const std::vector< std::string > &prevNodeDefines, std::unordered_map< void *, std::shared_ptr< GraphNode > > &visitedMap)
RDFDetail::RColumnReaderBase * GetColumnReader(unsigned int slot, RColumnReaderBase *defineOrVariationReader, RLoopManager &lm, TTreeReader *treeReader, std::string_view colName, const std::type_info &ti)
bool IsStrInVec(const std::string &str, const std::vector< std::string > &vec)