32#pragma GCC diagnostic push
33#pragma GCC diagnostic ignored "-Woverloaded-virtual"
34#pragma GCC diagnostic ignored "-Wshadow"
38#pragma GCC diagnostic pop
50class RCustomColumnBase;
72 lexertk::generator generator;
73 const auto ok = generator.process(expr);
75 const auto msg =
"Failed to tokenize expression:\n" + expr +
"\n\nMake sure it is valid C++.";
76 throw std::runtime_error(msg);
79 std::set<std::string> potCols;
80 const auto nToks = generator.size();
81 std::string potColWithDots;
83 auto IsSymbol = [](
const lexertk::token &t) {
return t.type == lexertk::token::e_symbol; };
84 auto IsDot = [](
const lexertk::token &t) {
return t.value ==
"."; };
87 for (
auto i = 0ULL; i < nToks; ++i) {
88 auto &tok = generator[i];
92 if (i == 0 || (i > 0 && !IsDot(generator[i - 1])))
93 potCols.insert(tok.value);
99 potColWithDots = tok.value;
103 auto &nextTok = generator[i + 1];
104 auto &next2nextTok = generator[i + 2];
105 if (!IsDot(nextTok) || !IsSymbol(next2nextTok)) {
108 potColWithDots +=
"." + next2nextTok.value;
109 potCols.insert(potColWithDots);
126 std::unique_ptr<RDFInternal::RActionBase> actionPtr)
130 auto snapshotRDF = std::make_shared<ROOT::RDataFrame>(treeName, fileName, validCols);
131 auto snapshotRDFResPtr =
MakeResultPtr(snapshotRDF, loopManager, std::move(actionPtr));
136 return snapshotRDFResPtr;
151 const auto theRegexSize = columnNameRegexp.size();
152 std::string theRegex(columnNameRegexp);
154 const auto isEmptyRegex = 0 == theRegexSize;
156 if (theRegexSize > 0 && theRegex[0] !=
'^')
157 theRegex =
"^" + theRegex;
158 if (theRegexSize > 0 && theRegex[theRegexSize - 1] !=
'$')
159 theRegex = theRegex +
"$";
162 selectedColumns.reserve(32);
167 for (
auto &&branchName : customColumns.
GetNames()) {
168 if ((isEmptyRegex || 0 != regexp.
Match(branchName.c_str())) &&
170 selectedColumns.emplace_back(branchName);
176 for (
auto &branchName : branchNames) {
177 if (isEmptyRegex || 0 != regexp.
Match(branchName.c_str())) {
178 selectedColumns.emplace_back(branchName);
185 for (
auto &dsColName : dsColNames) {
186 if ((isEmptyRegex || 0 != regexp.
Match(dsColName.c_str())) &&
188 selectedColumns.emplace_back(dsColName);
193 if (selectedColumns.empty()) {
194 std::string
text(callerName);
195 if (columnNameRegexp.empty()) {
196 text =
": there is no column available to match.";
198 text =
": regex \"" + std::string(columnNameRegexp) +
"\" did not match any column.";
200 throw std::runtime_error(
text);
202 return selectedColumns;
206 std::set<TTree *> &analysedTrees)
209 if (!analysedTrees.insert(&t).second) {
215 for (
auto branchObj : *branches) {
216 auto name = branchObj->GetName();
217 if (bNamesReg.insert(
name).second) {
218 bNames.emplace_back(
name);
228 for (
auto friendTreeObj : *friendTrees) {
238 std::set<std::string> bNamesSet;
240 std::set<TTree *> analysedTrees;
249 const char firstChar = var[0];
252 auto isALetter = [](
char c) {
return (
c >=
'A' &&
c <=
'Z') || (
c >=
'a' &&
c <=
'z'); };
253 const bool isValidFirstChar = firstChar ==
'_' || isALetter(firstChar);
254 if (!isValidFirstChar)
258 auto isANumber = [](
char c) {
return c >=
'0' &&
c <=
'9'; };
259 auto isValidTok = [&isALetter, &isANumber](
char c) {
return c ==
'_' || isALetter(
c) || isANumber(
c); };
260 for (
const char c : var)
268 const std::map<std::string, std::string> &aliasMap,
const ColumnNames_t &dataSourceColumns)
270 const std::string definedColStr(definedCol);
273 const auto msg =
"Cannot define column \"" + definedColStr +
"\": not a valid C++ variable name.";
274 throw std::runtime_error(msg);
277 if (treePtr !=
nullptr) {
279 const auto branch = treePtr->
GetBranch(definedColStr.c_str());
280 if (branch !=
nullptr) {
281 const auto msg =
"branch \"" + definedColStr +
"\" already present in TTree";
282 throw std::runtime_error(msg);
286 if (std::find(customCols.begin(), customCols.end(), definedCol) != customCols.end()) {
287 const auto msg =
"Redefinition of column \"" + definedColStr +
"\"";
288 throw std::runtime_error(msg);
292 const auto aliasColNameIt = aliasMap.find(definedColStr);
293 if (aliasColNameIt != aliasMap.end()) {
294 const auto msg =
"An alias with name " + definedColStr +
" pointing to column " +
295 aliasColNameIt->second +
" is already existing.";
296 throw std::runtime_error(msg);
300 if (!dataSourceColumns.empty()) {
301 if (std::find(dataSourceColumns.begin(), dataSourceColumns.end(), definedCol) != dataSourceColumns.end()) {
302 const auto msg =
"Redefinition of column \"" + definedColStr +
"\" already present in the data-source";
303 throw std::runtime_error(msg);
310 if (nTemplateParams != nColumnNames) {
311 std::string err_msg =
"The number of template parameters specified is ";
312 err_msg += std::to_string(nTemplateParams);
313 err_msg +=
" while ";
314 err_msg += std::to_string(nColumnNames);
315 err_msg +=
" columns have been specified.";
316 throw std::runtime_error(err_msg);
326 if (defaultNames.size() < nRequiredNames)
327 throw std::runtime_error(
328 std::to_string(nRequiredNames) +
" column name" + (nRequiredNames == 1 ?
" is" :
"s are") +
329 " required but none were provided and the default list has size " + std::to_string(defaultNames.size()));
331 return ColumnNames_t(defaultNames.begin(), defaultNames.begin() + nRequiredNames);
334 if (names.size() != nRequiredNames) {
335 auto msg = std::to_string(nRequiredNames) +
" column name" + (nRequiredNames == 1 ?
" is" :
"s are") +
336 " required but " + std::to_string(names.size()) + (names.size() == 1 ?
" was" :
" were") +
338 for (
const auto &
name : names)
339 msg +=
" \"" +
name +
"\",";
341 throw std::runtime_error(msg);
351 for (
auto &column : requiredCols) {
352 const auto isBranch = std::find(datasetColumns.begin(), datasetColumns.end(), column) != datasetColumns.end();
355 const auto isCustomColumn = std::find(definedCols.begin(), definedCols.end(), column) != definedCols.end();
358 const auto isDataSourceColumn =
359 std::find(dataSourceColumns.begin(), dataSourceColumns.end(), column) != dataSourceColumns.end();
360 if (isDataSourceColumn)
362 unknownColumns.emplace_back(column);
364 return unknownColumns;
369 const auto str = colName.data();
370 const auto goodPrefix = colName.size() > 3 &&
371 (
'r' == str[0] ||
't' == str[0]) &&
372 0 == strncmp(
"df", str + 1, 2);
373 return goodPrefix &&
'_' == colName.back();
376std::vector<std::string>
GetFilterNames(
const std::shared_ptr<RLoopManager> &loopManager)
378 return loopManager->GetFiltersNames();
382unsigned int Replace(std::string &
s,
const std::string what,
const std::string withWhat)
385 auto numReplacements = 0U;
386 while ((idx =
s.find(what, idx)) != std::string::npos) {
387 s.replace(idx, what.size(), withWhat);
388 idx += withWhat.size();
391 return numReplacements;
398 const std::map<std::string, std::string> &aliasMap)
403 if (potCols.size() == 0)
return {};
405 std::set<std::string> usedBranches;
408 for (
auto &brName : customColumns) {
409 if (potCols.find(brName) != potCols.end()) {
410 usedBranches.insert(brName);
422 std::sort(branches.begin(), branches.end(),
423 [](
const std::string &
s0,
const std::string &
s1) {return s0 > s1;});
425 for (
auto &brName : branches) {
427 if (potCols.find(brName) == potCols.end()) {
432 auto isContained = [&brName](
const std::string &usedBr) {
437 return usedBr.find(brName) != std::string::npos &&
438 std::count(usedBr.begin(), usedBr.end(),
'.') > std::count(brName.begin(), brName.end(),
'.');
440 auto it = std::find_if(usedBranches.begin(), usedBranches.end(), isContained);
441 if (it == usedBranches.end()) {
442 usedBranches.insert(brName);
447 for (
auto &col : dsColumns) {
448 if (potCols.find(col) != potCols.end()) {
449 usedBranches.insert(col);
454 for (
auto &alias_colName : aliasMap) {
455 auto &alias = alias_colName.first;
456 if (potCols.find(alias) != potCols.end()) {
457 usedBranches.insert(alias);
461 return std::vector<std::string>(usedBranches.begin(), usedBranches.end());
467 std::vector<std::string> dotlessNames = colNames;
468 for (
auto &
c : dotlessNames) {
469 const bool hasDot =
c.find_first_of(
'.') != std::string::npos;
471 std::replace(
c.begin(),
c.end(),
'.',
'_');
472 c.insert(0u,
"__rdf_arg_");
480 const std::map<std::string, std::string> &aliasMap,
TTree *
tree,
481 RDataSource *ds, std::string &expr,
unsigned int namespaceID,
484 std::vector<std::string> colTypes;
485 colTypes.reserve(colNames.size());
486 const auto aliasMapEnd = aliasMap.end();
488 for (
auto c = colNames.begin(),
v = varNames.begin();
c != colNames.end();) {
489 const auto &colName = *
c;
491 if (colName.find(
'.') != std::string::npos) {
493 auto numRepl =
Replace(expr, colName, *
v);
498 c = colNames.erase(
c);
499 v = varNames.erase(
v);
505 const auto paddedExpr =
" " + expr +
" ";
506 static const std::string noWordChars(
"[^a-zA-Z0-9_]");
507 const auto colNameRxBody = noWordChars + colName + noWordChars;
508 TRegexp colNameRegex(colNameRxBody.c_str());
510 const auto colStillThere = colNameRegex.
Index(paddedExpr.c_str(), &matchedLen) != -1;
511 if (!colStillThere) {
512 c = colNames.erase(
c);
513 v = varNames.erase(
v);
520 const auto aliasMapIt = aliasMap.find(colName);
521 const auto &realColName = aliasMapEnd == aliasMapIt ? colName : aliasMapIt->second;
523 const auto isCustomCol = customCols.
HasName(realColName);
524 const auto customColID = isCustomCol ? customCols.
GetColumns().at(realColName)->GetID() : 0;
525 const auto colTypeName =
527 colTypes.emplace_back(colTypeName);
537 const std::vector<std::string> &colTypes,
bool hasReturnStmt)
539 R__ASSERT(colNames.size() == colTypes.size());
541 static unsigned int iNs = 0U;
542 std::stringstream dummyDecl;
543 dummyDecl <<
"namespace __rdf_" << std::to_string(iNs++) <<
"{ auto rdf_f = []() {";
545 for (
auto col = colNames.begin(),
type = colTypes.begin(); col != colNames.end(); ++col, ++
type) {
546 dummyDecl << *
type <<
" " << *col <<
";\n";
552 dummyDecl << expression <<
"\n;};}";
554 dummyDecl <<
"return " << expression <<
"\n;};}";
559 "Cannot interpret the following expression:\n" + std::string(expression) +
"\n\nMake sure it is valid C++.";
560 throw std::runtime_error(msg);
567 R__ASSERT(vars.size() == varTypes.size());
569 std::stringstream ss;
571 for (
auto i = 0u; i < vars.size(); ++i) {
574 ss << varTypes[i] <<
"& " << vars[i] <<
", ";
577 ss.seekp(-2, ss.cur);
583 ss << expr <<
"\n;}";
592 s << std::hex << std::showbase << reinterpret_cast<size_t>(addr);
600 std::string_view expression,
const std::map<std::string, std::string> &aliasMap,
609 auto dotlessExpr = std::string(expression);
610 const auto usedColTypes =
613 TRegexp re(
"[^a-zA-Z0-9_]?return[^a-zA-Z0-9_]");
615 const bool hasReturnStmt = re.
Index(dotlessExpr, &matchedLen) != -1;
621 const auto filterLambda =
BuildLambdaString(dotlessExpr, varNames, usedColTypes, hasReturnStmt);
632 std::stringstream filterInvocation;
633 filterInvocation <<
"ROOT::Internal::RDF::JitFilterHelper(" << filterLambda <<
", {";
634 for (
const auto &brName : usedBranches) {
636 const auto aliasMapIt = aliasMap.find(brName);
637 auto &realBrName = aliasMapIt == aliasMap.end() ? brName : aliasMapIt->second;
638 filterInvocation <<
"\"" << realBrName <<
"\", ";
640 if (!usedBranches.empty())
641 filterInvocation.seekp(-2, filterInvocation.cur);
642 filterInvocation <<
"}, \"" <<
name <<
"\", "
643 <<
"reinterpret_cast<ROOT::Detail::RDF::RJittedFilter*>(" << jittedFilterAddr <<
"), "
644 <<
"reinterpret_cast<std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>(" << prevNodeAddr <<
"),"
645 <<
"reinterpret_cast<ROOT::Internal::RDF::RBookedCustomColumns*>(" << columnsOnHeapAddr <<
")"
648 lm->ToJitExec(filterInvocation.str());
653 const std::shared_ptr<RJittedCustomColumn> &jittedCustomColumn,
658 const auto namespaceID = lm.
GetID();
664 auto dotlessExpr = std::string(expression);
665 const auto usedColTypes =
668 TRegexp re(
"[^a-zA-Z0-9_]?return[^a-zA-Z0-9_]");
670 const bool hasReturnStmt = re.
Index(dotlessExpr, &matchedLen) != -1;
675 const auto definelambda =
BuildLambdaString(dotlessExpr, varNames, usedColTypes, hasReturnStmt);
676 const auto customColID = std::to_string(jittedCustomColumn->GetID());
677 const auto lambdaName =
"eval_" + std::string(
name) + customColID;
678 const auto ns =
"__rdf" + std::to_string(namespaceID);
686 const auto defineDeclaration =
687 "namespace " +
ns +
" { auto " + lambdaName +
" = " + definelambda +
";\n" +
"using " + std::string(
name) +
688 customColID +
"_type = typename ROOT::TypeTraits::CallableTraits<decltype(" + lambdaName +
" )>::ret_type; }\n";
691 std::stringstream defineInvocation;
692 defineInvocation <<
"ROOT::Internal::RDF::JitDefineHelper(" << definelambda <<
", {";
693 for (
auto brName : usedBranches) {
695 auto aliasMapIt = aliasMap.find(brName);
696 auto &realBrName = aliasMapIt == aliasMap.end() ? brName : aliasMapIt->second;
697 defineInvocation <<
"\"" << realBrName <<
"\", ";
699 if (!usedBranches.empty())
700 defineInvocation.seekp(-2, defineInvocation.cur);
701 defineInvocation <<
"}, \"" <<
name <<
"\", reinterpret_cast<ROOT::Detail::RDF::RLoopManager*>("
702 <<
PrettyPrintAddr(&lm) <<
"), *reinterpret_cast<ROOT::Detail::RDF::RJittedCustomColumn*>("
704 <<
"reinterpret_cast<ROOT::Internal::RDF::RBookedCustomColumns*>(" << customColumnsAddr <<
")"
713 void *rOnHeap,
TTree *
tree,
const unsigned int nSlots,
715 std::shared_ptr<RJittedAction> *jittedActionOnHeap,
unsigned int namespaceID)
717 auto nBranches = bl.size();
720 std::vector<std::string> columnTypeNames(nBranches);
721 for (
auto i = 0u; i < nBranches; ++i) {
722 const auto isCustomCol = customCols.
HasName(bl[i]);
723 const auto customColID = isCustomCol ? customCols.
GetColumns().at(bl[i])->GetID() : 0;
724 const auto columnTypeName =
726 if (columnTypeName.empty()) {
727 std::string exceptionText =
"The type of column ";
728 exceptionText += bl[i];
729 exceptionText +=
" could not be guessed. Please specify one.";
730 throw std::runtime_error(exceptionText.c_str());
732 columnTypeNames[i] = columnTypeName;
737 if (!actionResultTypeClass) {
738 std::string exceptionText =
"An error occurred while inferring the result type of an operation.";
739 throw std::runtime_error(exceptionText.c_str());
741 const auto actionResultTypeName = actionResultTypeClass->GetName();
745 if (!actionTypeClass) {
746 std::string exceptionText =
"An error occurred while inferring the action type of the operation.";
747 throw std::runtime_error(exceptionText.c_str());
749 const auto actionTypeName = actionTypeClass->GetName();
756 std::stringstream createAction_str;
757 createAction_str <<
"ROOT::Internal::RDF::CallBuildAction"
758 <<
"<" << actionTypeName;
759 for (
auto &colType : columnTypeNames)
760 createAction_str <<
", " << colType;
763 createAction_str <<
">(reinterpret_cast<std::shared_ptr<ROOT::Detail::RDF::RNodeBase>*>("
765 for (
auto i = 0u; i < bl.size(); ++i) {
767 createAction_str <<
", ";
768 createAction_str <<
'"' << bl[i] <<
'"';
770 createAction_str <<
"}, " << std::dec << std::noshowbase << nSlots <<
", reinterpret_cast<" << actionResultTypeName
772 <<
", reinterpret_cast<std::shared_ptr<ROOT::Internal::RDF::RJittedAction>*>("
774 <<
"reinterpret_cast<ROOT::Internal::RDF::RBookedCustomColumns*>(" << customColumnsAddr <<
")"
776 return createAction_str.str();
781 for (
const auto &
s : strings) {
788std::shared_ptr<RNodeBase>
UpcastNode(std::shared_ptr<RNodeBase> ptr)
801 auto selectedColumns =
SelectColumns(nColumns, columns, defaultColumns);
803 const auto unknownColumns =
FindUnknownColumns(selectedColumns, validBranchNames, validCustomColumns,
806 if (!unknownColumns.empty()) {
808 std::stringstream unknowns;
809 std::string delim = unknownColumns.size() > 1 ?
"s: " :
": ";
810 for (
auto &unknownColumn : unknownColumns) {
811 unknowns << delim << unknownColumn;
814 throw std::runtime_error(
"Unknown column" + unknowns.str());
819 auto aliasMapEnd = aliasMap.end();
821 for (
auto idx :
ROOT::TSeqU(selectedColumns.size())) {
822 const auto &colName = selectedColumns[idx];
823 const auto aliasColumnNameIt = aliasMap.find(colName);
824 if (aliasMapEnd != aliasColumnNameIt) {
825 selectedColumns[idx] = aliasColumnNameIt->second;
829 return selectedColumns;
837 const auto nColumns = requestedCols.size();
838 std::vector<bool> mustBeDefined(nColumns,
false);
839 for (
auto i = 0u; i < nColumns; ++i)
840 mustBeDefined[i] = std::find(definedCols.begin(), definedCols.end(), requestedCols[i]) == definedCols.end();
841 return mustBeDefined;
static RooMathCoreReg dummy
A wrapper around a concrete RFilter, which forwards all calls to it RJittedFilter is the type of the ...
The head node of a RDF computation graph.
const std::map< std::string, std::string > & GetAliasMap() const
const ColumnNames_t & GetBranchNames()
Return all valid TTree::Branch names (caching results for subsequent calls).
void ToJitDeclare(const std::string &s)
void ToJitExec(const std::string &s)
unsigned int GetID() const
void JitDeclarations()
Declare to the interpreter type aliases and other entities required by RDF jitted nodes.
const ColumnNames_t & GetDefaultColumnNames() const
Return the list of default columns – empty if none was provided when constructing the RDataFrame.
virtual RLoopManager * GetLoopManagerUnchecked()
Encapsulates the columns defined by the user.
ColumnNames_t GetNames() const
Returns the list of the names of the defined columns.
bool HasName(std::string_view name) const
Check if the provided name is tracked in the names list.
const RCustomColumnBasePtrMap_t & GetColumns() const
Returns the list of the pointers to the defined columns.
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
virtual const std::vector< std::string > & GetColumnNames() const =0
Returns a reference to the collection of the dataset's column names.
A pseudo container class which is a generator of indices.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
A TFriendElement TF describes a TTree object TF in a file.
Int_t Match(const TString &s, const TString &mods="", Int_t start=0, Int_t nMaxMatch=10, TArrayI *pos=0)
The number of matches is returned, this equals the full match + sub-pattern matches.
Regular expression class.
Ssiz_t Index(const TString &str, Ssiz_t *len, Ssiz_t start=0) const
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match...
A TTree represents a columnar dataset.
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
virtual TObjArray * GetListOfBranches()
virtual TList * GetListOfFriends() const
basic_string_view< char > string_view
RResultPtr< T > MakeResultPtr(const std::shared_ptr< T > &r, RLoopManager &df, std::shared_ptr< ROOT::Internal::RDF::RActionBase > actionPtr)
Create a RResultPtr and set its pointer to the corresponding RAction This overload is invoked by non-...
const ColumnNames_t SelectColumns(unsigned int nRequiredNames, const ColumnNames_t &names, const ColumnNames_t &defaultNames)
Choose between local column names or default column names, throw in case of errors.
std::string BuildLambdaString(const std::string &expr, const ColumnNames_t &vars, const ColumnNames_t &varTypes, bool hasReturnStmt)
std::vector< std::string > ReplaceDots(const ColumnNames_t &colNames)
bool IsValidCppVarName(const std::string &var)
unsigned int Replace(std::string &s, const std::string what, const std::string withWhat)
HeadNode_t CreateSnaphotRDF(const ColumnNames_t &validCols, std::string_view treeName, std::string_view fileName, bool isLazy, RLoopManager &loopManager, std::unique_ptr< RDFInternal::RActionBase > actionPtr)
std::shared_ptr< RNodeBase > UpcastNode(std::shared_ptr< RNodeBase > ptr)
std::vector< std::string > GetFilterNames(const std::shared_ptr< RLoopManager > &loopManager)
ColumnNames_t ConvertRegexToColumns(const RDFInternal::RBookedCustomColumns &customColumns, TTree *tree, ROOT::RDF::RDataSource *dataSource, std::string_view columnNameRegexp, std::string_view callerName)
std::string PrettyPrintAddr(const void *const addr)
ColumnNames_t GetTopLevelBranchNames(TTree &t)
Get all the top-level branches names, including the ones of the friend trees.
void CheckTypesAndPars(unsigned int nTemplateParams, unsigned int nColumnNames)
std::string DemangleTypeIdName(const std::type_info &typeInfo)
bool AtLeastOneEmptyString(const std::vector< std::string_view > strings)
std::set< std::string > GetPotentialColumnNames(const std::string &expr)
A tokeniser for the expression which is in C++ The goal is to extract all names which are potentially...
std::vector< std::string > FindUsedColumnNames(std::string_view expression, ColumnNames_t branches, const ColumnNames_t &customColumns, const ColumnNames_t &dsColumns, const std::map< std::string, std::string > &aliasMap)
ColumnNames_t FindUnknownColumns(const ColumnNames_t &requiredCols, const ColumnNames_t &datasetColumns, const ColumnNames_t &definedCols, const ColumnNames_t &dataSourceColumns)
std::string JitBuildAction(const ColumnNames_t &bl, void *prevNode, const std::type_info &art, const std::type_info &at, void *rOnHeap, TTree *tree, const unsigned int nSlots, const RDFInternal::RBookedCustomColumns &customCols, RDataSource *ds, std::shared_ptr< RJittedAction > *jittedActionOnHeap, unsigned int namespaceID)
bool IsInternalColumn(std::string_view colName)
std::string ColumnName2ColumnTypeName(const std::string &colName, unsigned int namespaceID, TTree *tree, RDataSource *ds, bool isCustomColumn, bool vector2rvec, unsigned int customColID)
Return a string containing the type of the given branch.
ColumnNames_t GetValidatedColumnNames(RLoopManager &lm, const unsigned int nColumns, const ColumnNames_t &columns, const ColumnNames_t &validCustomColumns, RDataSource *ds)
Given the desired number of columns and the user-provided list of columns:
void GetTopLevelBranchNamesImpl(TTree &t, std::set< std::string > &bNamesReg, ColumnNames_t &bNames, std::set< TTree * > &analysedTrees)
std::vector< bool > FindUndefinedDSColumns(const ColumnNames_t &requestedCols, const ColumnNames_t &definedCols)
Return a bitset each element of which indicates whether the corresponding element in selectedColumns ...
void TryToJitExpression(const std::string &expression, const ColumnNames_t &colNames, const std::vector< std::string > &colTypes, bool hasReturnStmt)
void BookDefineJit(std::string_view name, std::string_view expression, RLoopManager &lm, RDataSource *ds, const std::shared_ptr< RJittedCustomColumn > &jittedCustomColumn, const RDFInternal::RBookedCustomColumns &customCols, const ColumnNames_t &branches)
void BookFilterJit(RJittedFilter *jittedFilter, void *prevNodeOnHeap, std::string_view name, std::string_view expression, const std::map< std::string, std::string > &aliasMap, const ColumnNames_t &branches, const RDFInternal::RBookedCustomColumns &customCols, TTree *tree, RDataSource *ds, unsigned int namespaceID)
std::vector< std::string > ColumnTypesAsString(ColumnNames_t &colNames, ColumnNames_t &varNames, const std::map< std::string, std::string > &aliasMap, TTree *tree, RDataSource *ds, std::string &expr, unsigned int namespaceID, const RDFInternal::RBookedCustomColumns &customCols)
void CheckCustomColumn(std::string_view definedCol, TTree *treePtr, const ColumnNames_t &customCols, const std::map< std::string, std::string > &aliasMap, const ColumnNames_t &dataSourceColumns)
Namespace for new ROOT classes and functions.
ROOT::Detail::RDF::ColumnNames_t ColumnNames_t
char * DemangleTypeIdName(const std::type_info &ti, int &errorCode)
Demangle in a portable way the type id name.
static constexpr double s
static constexpr double ns