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->GetSuppressErrorsForMissingBranches().push_back(fColumnNames[0]);
95 fLoopManager->Deregister(
this);
106 if (!fPrevNodePtr->CheckFilters(
slot,
entry)) {
112 if (fDiscardEntryWithMissingValue) {
135 if (
auto *
datasetColReader = fLoopManager->GetDatasetColumnReader(
slot, fColumnNames[0],
typeid(
void)))
140 return fLoopManager->AddTreeColumnReader(
141 slot, fColumnNames[0], std::make_unique<ROOT::Internal::RDF::RTreeOpaqueColumnReader>(*
r, fColumnNames[0]),
147 fValues[
slot] = GetOrCreateColumnReader(
r,
slot);
148 fLastCheckedEntry[
slot * RDFInternal::CacheLineStep<Long64_t>()] = -1;
156 fPrevNodePtr->PartialReport(
rep);
163 if (fNStopsReceived == fNChildren)
164 fPrevNodePtr->StopProcessing();
171 if (fNChildren == 1 && fName.empty())
172 fPrevNodePtr->IncrChildrenCount();
178 fPrevNodePtr->IncrChildrenCount();
183 fPrevNodePtr->AddFilterName(
filters);
184 auto name = (HasName() ? fName : fDiscardEntryWithMissingValue ?
"FilterAvailable" :
"FilterMissing");
191 std::shared_ptr<RDFGraphDrawing::GraphNode>
195 auto prevNode = fPrevNodePtr->GetGraph(
visitedMap);
196 const auto &
prevColumns = prevNode->GetDefinedColumns();
210 thisNode->AddDefinedColumns(fColRegister.GenerateColumnNames());
220 assert(fVariation ==
"nominal");
229 if (it != fVariedFilters.end())
232 auto prevNode = fPrevNodePtr;
233 if (
static_cast<RNodeBase *
>(fPrevNodePtr.get()) !=
static_cast<RNodeBase *
>(fLoopManager) &&
235 prevNode = std::static_pointer_cast<PrevNode_t>(prevNode->GetVariedFilter(
variationName));
240 fDiscardEntryWithMissingValue, std::move(prevNode), fColRegister, fColumnNames, fName,
variationName));
242 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
ROOT::Detail::RDF::RColumnReaderBase * GetOrCreateColumnReader(TTreeReader *r, unsigned int slot)
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)
bool IsStrInVec(const std::string &str, const std::vector< std::string > &vec)
void Erase(const T &that, std::vector< T > &v)
Erase that element from vector v