11#ifndef ROOT_RLOOPMANAGER
12#define ROOT_RLOOPMANAGER
41namespace GraphDrawing {
109 std::shared_ptr<TTree>
fTree{
nullptr};
174 void ToJitExec(
const std::string &)
const;
181 void AddDSValuePtrs(
const std::string &col,
const std::vector<void *> ptrs);
193 std::vector<RDFInternal::RActionBase *>
GetAllActions()
const;
196 std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode>
GetGraph();
unsigned long long ULong64_t
typedef void((*Func_t)())
std::vector< ULong64_t > fCounters
void operator()(unsigned int slot)
TCallback(ULong64_t everyN, Callback_t &&f, unsigned int nSlots)
void operator()(unsigned int slot)
TOneTimeCallback(Callback_t &&f, unsigned int nSlots)
std::vector< int > fHasBeenCalled
The head node of a RDF computation graph.
void StopProcessing() final
unsigned int fNRuns
Number of event loops run.
bool CheckFilters(unsigned int, Long64_t) final
void EvalChildrenCounts()
Trigger counting of number of children nodes for each node of the functional graph.
void CleanUpNodes()
Perform clean-up operations. To be called at the end of each event loop.
void RunEmptySource()
Run event loop with no source files, in sequence.
const std::map< std::string, std::string > & GetAliasMap() const
std::function< void(unsigned int)> Callback_t
void Report(ROOT::RDF::RCutFlowReport &rep) const final
Call FillReport on all booked filters.
std::vector< RFilterBase * > fBookedNamedFilters
Contains a subset of fBookedFilters, i.e. only the named filters.
void RunEmptySourceMT()
Run event loop with no source files, in parallel.
ULong64_t GetNEmptyEntries() const
RLoopManager & operator=(const RLoopManager &)=delete
void AddDSValuePtrs(const std::string &col, const std::vector< void * > ptrs)
void IncrChildrenCount() final
const ColumnNames_t & GetBranchNames()
Return all valid TTree::Branch names (caching results for subsequent calls).
void ToJitExec(const std::string &) const
unsigned int GetNRuns() const
std::vector< RDFInternal::RActionBase * > GetAllActions() const
Return all actions, either booked or already run.
::TDirectory * GetDirectory() const
void SetupDataBlockCallbacks(TTreeReader *r, unsigned int slot)
std::vector< RDFInternal::RActionBase * > GetBookedActions()
bool fMustRunNamedFilters
std::shared_ptr< TTree > fTree
Shared pointer to the input TTree.
const ULong64_t fNEmptyEntries
void RunTreeReader()
Run event loop over one or multiple ROOT files, in sequence.
friend struct RCallCleanUpTask
std::vector< RDFInternal::RActionBase * > fRunActions
Non-owning pointers to actions already run.
void Run()
Start the event loop with a different mechanism depending on IMT/no IMT, data source/no data source.
void AddFilterName(std::vector< std::string > &)
End of recursive chain of calls, does nothing.
std::vector< RRangeBase * > fBookedRanges
std::map< std::string, std::string > fAliasColumnNameMap
ColumnNameAlias-columnName pairs.
std::vector< TCallback > fCallbacks
Registered callbacks.
void RunAndCheckFilters(unsigned int slot, Long64_t entry)
Execute actions and make sure named filters are called for each event.
std::vector< RFilterBase * > fBookedFilters
RDFInternal::RDataBlockNotifier fDataBlockNotifier
std::vector< RDFInternal::RActionBase * > fBookedActions
Non-owning pointers to actions to be run.
std::shared_ptr< ROOT::Internal::RDF::GraphDrawing::GraphNode > GetGraph()
void CheckIndexedFriends()
const ELoopType fLoopType
The kind of event loop that is going to be run (e.g. on ROOT files, on no files)
void AddColumnAlias(const std::string &alias, const std::string &colName)
ColumnNames_t fValidBranchNames
Cache of the tree/chain branch names. Never access directy, always use GetBranchNames().
void CleanUpTask(TTreeReader *r, unsigned int slot)
Perform clean-up operations. To be called at the end of each task execution.
const std::map< std::string, std::vector< void * > > & GetDSValuePtrs() const
std::map< std::string, std::vector< void * > > fDSValuePtrMap
Registry of per-slot value pointers for booked data-source columns.
void SetTree(const std::shared_ptr< TTree > &tree)
const unsigned int fNSlots
std::vector< Callback_t > fDataBlockCallbacks
Registered callbacks to call at the beginning of each "data block".
const ColumnNames_t & GetDefaultColumnNames() const
Return the list of default columns – empty if none was provided when constructing the RDataFrame.
std::vector< RNodeBase * > GetGraphEdges() const
Return all graph edges known to RLoopManager This includes Filters and Ranges but not Defines.
RDataSource * GetDataSource() const
unsigned int GetNSlots() const
std::vector< TOneTimeCallback > fCallbacksOnce
Registered callbacks to invoke just once before running the loop.
void RunDataSourceMT()
Run event loop over data accessed through a DataSource, in parallel.
void PartialReport(ROOT::RDF::RCutFlowReport &) const final
End of recursive chain of calls, does nothing.
bool HasDSValuePtrs(const std::string &col) const
std::vector< std::string > GetFiltersNames()
For each booked filter, returns either the name or "Unnamed Filter".
RLoopManager(const RLoopManager &)=delete
const std::unique_ptr< RDataSource > fDataSource
Owning pointer to a data-source object. Null if no data-source.
const ColumnNames_t fDefaultColumns
void Book(RDFInternal::RActionBase *actionPtr)
void InitNodeSlots(TTreeReader *r, unsigned int slot)
Build TTreeReaderValues for all nodes This method loops over all filters, actions and other booked ob...
void RegisterCallback(ULong64_t everyNEvents, std::function< void(unsigned int)> &&f)
void RunDataSource()
Run event loop over data accessed through a DataSource, in sequence.
void Jit()
Add RDF nodes that require just-in-time compilation to the computation graph.
void RunTreeProcessorMT()
Run event loop over one or multiple ROOT files, in parallel.
void Deregister(RDFInternal::RActionBase *actionPtr)
void AddDataBlockCallback(std::function< void(unsigned int)> &&callback)
void InitNodes()
Initialize all nodes of the functional graph before running the event loop.
RLoopManager * GetLoopManagerUnchecked() final
Base class for non-leaf nodes of the computational graph.
unsigned int fNStopsReceived
Number of times that a children node signaled to stop processing entries.
unsigned int fNChildren
Number of nodes of the functional graph hanging from this object.
Helper class that provides the operation graph nodes.
Class used to create the operation graph to be printed in the dot representation.
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
Describe directory structure in memory.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
A TTree represents a columnar dataset.
std::vector< std::string > ColumnNames_t
std::vector< std::string > GetBranchNames(TTree &t, bool allowDuplicates=true)
Get all the branches names, including the ones of the friend trees.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...