25#include <unordered_set>
31 if (!
dynamic_cast<const TChain *
>(tree) && !tree->GetCurrentFile()) {
47 const auto tree = fLoopManager->GetTree();
49 const auto treeName = tree->GetName();
79 ss <<
"\nwith friend\n";
81 ss <<
"\nwith friends\n";
111 else if (fDataSource) {
117 const auto n = fLoopManager->GetNEmptyEntries();
119 return "Empty dataframe filling 1 row";
121 return "Empty dataframe filling " + std::to_string(
n) +
" rows";
127 : fLoopManager(
lm), fDataSource(
lm->GetDataSource()), fColRegister(
lm.get())
134 fDataSource(
lm.GetDataSource()),
166 auto tree = fLoopManager->GetTree();
173 for (
const auto &s : fDataSource->GetColumnNames()) {
174 if (s.rfind(
"R_rdf_sizeof", 0) != 0)
199 const auto col = fColRegister.ResolveAlias(column);
243 for (
const auto &
name : GetDefinedColumnNames())
247 const std::vector<std::string>
metadataProperties = {
"Columns in total",
"Columns from defines",
"Event loops run",
251 std::to_string(GetNRuns()), std::to_string(GetNSlots())};
259 std::stringstream
ss;
282 for (
auto i = 0
u; i <
nCols; i++) {
313 const auto columns = fColRegister.BuildDefineNames();
314 for (
const auto &column :
columns) {
336 return fColRegister.BuildVariationsDescription();
358 if (fLoopManager->GetTree()) {
359 const auto &
branchNames = fLoopManager->GetBranchNames();
365 if (fDataSource && fDataSource->HasColumn(
columnName))
385 return fLoopManager->GetNSlots();
404 return fLoopManager->GetNRuns();
409 std::vector<std::string>
types;
412 types.push_back(GetColumnType(column));
421 error +=
" was called with ImplicitMT enabled, but multi-thread is not supported.";
422 throw std::runtime_error(error);
445 fColRegister, *fLoopManager);
446 fColRegister.AddDefine(std::move(
slotColumn));
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The head node of a RDF computation graph.
A binder for user-defined columns, variations and aliases.
A DFDescription contains useful information about a given RDataFrame computation graph.
virtual std::size_t GetNFiles() const
Returns the number of files from which the dataset is constructed.
RVariationsDescription GetVariations() const
Return a descriptor for the systematic variations registered in this branch of the computation graph.
std::string GetColumnType(std::string_view column)
Return the type of a given column as a string.
RDFDescription Describe()
Return information about the dataframe.
ColumnNames_t GetColumnTypeNamesList(const ColumnNames_t &columnList)
std::shared_ptr< ROOT::Detail::RDF::RLoopManager > fLoopManager
< The RLoopManager at the root of this computation graph. Never null.
unsigned int GetNRuns() const
Gets the number of event loops run.
RDataSource * fDataSource
Non-owning pointer to a data-source object. Null if no data-source. RLoopManager has ownership of the...
ColumnNames_t GetDefinedColumnNames()
Returns the names of the defined columns.
void CheckIMTDisabled(std::string_view callerName)
unsigned int GetNSlots() const
Gets the number of data processing slots.
RInterfaceBase(std::shared_ptr< RDFDetail::RLoopManager > lm)
bool HasColumn(std::string_view columnName)
Checks if a column is present in the dataset.
std::string DescribeDataset() const
ColumnNames_t GetColumnNames()
Returns the names of the available columns.
A descriptor for the systematic variations known to a given RDataFrame node.
const_iterator begin() const
const_iterator end() const
A chain is a collection of files containing TTree objects.
std::vector< std::string > GetBranchNames(TTree &t, bool allowDuplicates=true)
Get all the branches names, including the ones of the friend trees.
unsigned int GetColumnWidth(const std::vector< std::string > &names, const unsigned int minColumnSpace=8u)
Get optimal column width for printing a table given the names and the desired minimal space between c...
std::string ColumnName2ColumnTypeName(const std::string &colName, TTree *, RDataSource *, RDefineBase *, bool vector2RVec=true)
Return a string containing the type of the given branch.
bool IsInternalColumn(std::string_view colName)
Whether custom column with name colName is an "internal" column such as rdfentry_ or rdfslot_.
ROOT::TreeUtils::RFriendInfo GetFriendInfo(const TTree &tree, bool retrieveEntries=false)
std::vector< std::string > GetFileNamesFromTree(const TTree &tree)
std::vector< std::string > ColumnNames_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.