11#ifndef ROOT_RDF_TINTERFACE_UTILS
12#define ROOT_RDF_TINTERFACE_UTILS
42#include <unordered_map>
55template<
typename T,
typename V>
80class RIgnoreErrorLevelRAII {
85 RIgnoreErrorLevelRAII(
int errorIgnoreLevel) {
gErrorIgnoreLevel = errorIgnoreLevel; }
113template <
typename T,
bool ISV6HISTO = std::is_base_of<TH1, std::decay_t<T>>::value>
116 static bool HasAxisLimits(T &
h)
118 auto xaxis =
h.GetXaxis();
119 return !(xaxis->GetXmin() == 0. && xaxis->GetXmax() == 0.);
124struct HistoUtils<
T, false> {
125 static void SetCanExtendAllAxes(T &) {}
126 static bool HasAxisLimits(T &) {
return true; }
130template <
typename... ColTypes,
typename ActionTag,
typename ActionResultType,
typename PrevNodeType>
131std::unique_ptr<RActionBase>
132BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<ActionResultType> &
h,
const unsigned int nSlots,
133 std::shared_ptr<PrevNodeType> prevNode, ActionTag,
const RColumnRegister &colRegister)
135 using Helper_t = FillParHelper<ActionResultType>;
136 using Action_t = RAction<Helper_t, PrevNodeType,
TTraits::TypeList<ColTypes...>>;
137 return std::make_unique<Action_t>(Helper_t(
h, nSlots), bl, std::move(prevNode), colRegister);
141template <
typename... ColTypes,
typename PrevNodeType>
142std::unique_ptr<RActionBase>
143BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<::TH1D> &
h,
const unsigned int nSlots,
144 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Histo1D,
const RColumnRegister &colRegister)
146 auto hasAxisLimits = HistoUtils<::TH1D>::HasAxisLimits(*
h);
149 using Helper_t = FillParHelper<::TH1D>;
150 using Action_t = RAction<Helper_t, PrevNodeType,
TTraits::TypeList<ColTypes...>>;
151 return std::make_unique<Action_t>(Helper_t(
h, nSlots), bl, std::move(prevNode), colRegister);
153 using Helper_t = FillHelper;
154 using Action_t = RAction<Helper_t, PrevNodeType,
TTraits::TypeList<ColTypes...>>;
155 return std::make_unique<Action_t>(Helper_t(
h, nSlots), bl, std::move(prevNode), colRegister);
159template <
typename... ColTypes,
typename PrevNodeType>
160std::unique_ptr<RActionBase>
161BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<TGraph> &
g,
const unsigned int nSlots,
162 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Graph,
const RColumnRegister &colRegister)
164 using Helper_t = FillTGraphHelper;
165 using Action_t = RAction<Helper_t, PrevNodeType,
TTraits::TypeList<ColTypes...>>;
166 return std::make_unique<Action_t>(Helper_t(
g, nSlots), bl, std::move(prevNode), colRegister);
170template <
typename ColType,
typename PrevNodeType,
typename ActionResultType>
171std::unique_ptr<RActionBase>
172BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<ActionResultType> &minV,
const unsigned int nSlots,
173 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Min,
const RColumnRegister &colRegister)
175 using Helper_t = MinHelper<ActionResultType>;
176 using Action_t = RAction<Helper_t, PrevNodeType, TTraits::TypeList<ColType>>;
177 return std::make_unique<Action_t>(Helper_t(minV, nSlots), bl, std::move(prevNode), colRegister);
181template <
typename ColType,
typename PrevNodeType,
typename ActionResultType>
182std::unique_ptr<RActionBase>
183BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<ActionResultType> &maxV,
const unsigned int nSlots,
184 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Max,
const RColumnRegister &colRegister)
186 using Helper_t = MaxHelper<ActionResultType>;
187 using Action_t = RAction<Helper_t, PrevNodeType, TTraits::TypeList<ColType>>;
188 return std::make_unique<Action_t>(Helper_t(maxV, nSlots), bl, std::move(prevNode), colRegister);
192template <
typename ColType,
typename PrevNodeType,
typename ActionResultType>
193std::unique_ptr<RActionBase>
194BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<ActionResultType> &sumV,
const unsigned int nSlots,
195 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Sum,
const RColumnRegister &colRegister)
197 using Helper_t = SumHelper<ActionResultType>;
198 using Action_t = RAction<Helper_t, PrevNodeType, TTraits::TypeList<ColType>>;
199 return std::make_unique<Action_t>(Helper_t(sumV, nSlots), bl, std::move(prevNode), colRegister);
203template <
typename ColType,
typename PrevNodeType>
204std::unique_ptr<RActionBase>
205BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<double> &meanV,
const unsigned int nSlots,
206 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Mean,
const RColumnRegister &colRegister)
208 using Helper_t = MeanHelper;
209 using Action_t = RAction<Helper_t, PrevNodeType, TTraits::TypeList<ColType>>;
210 return std::make_unique<Action_t>(Helper_t(meanV, nSlots), bl, std::move(prevNode), colRegister);
214template <
typename ColType,
typename PrevNodeType>
215std::unique_ptr<RActionBase>
216BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<double> &stdDeviationV,
const unsigned int nSlots,
217 std::shared_ptr<PrevNodeType> prevNode, ActionTags::StdDev,
const RColumnRegister &colRegister)
219 using Helper_t = StdDevHelper;
220 using Action_t = RAction<Helper_t, PrevNodeType, TTraits::TypeList<ColType>>;
221 return std::make_unique<Action_t>(Helper_t(stdDeviationV, nSlots), bl, prevNode, colRegister);
224using displayHelperArgs_t = std::pair<size_t, std::shared_ptr<ROOT::RDF::RDisplay>>;
227template <
typename... ColTypes,
typename PrevNodeType>
228std::unique_ptr<RActionBase>
229BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<displayHelperArgs_t> &helperArgs,
const unsigned int,
230 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Display,
233 using Helper_t = DisplayHelper<PrevNodeType>;
234 using Action_t = RAction<Helper_t, PrevNodeType,
TTraits::TypeList<ColTypes...>>;
235 return std::make_unique<Action_t>(Helper_t(helperArgs->first, helperArgs->second, prevNode), bl, prevNode,
239struct SnapshotHelperArgs {
240 std::string fFileName;
241 std::string fDirName;
242 std::string fTreeName;
243 std::vector<std::string> fOutputColNames;
248template <
typename... ColTypes,
typename PrevNodeType>
249std::unique_ptr<RActionBase>
250BuildAction(
const ColumnNames_t &colNames,
const std::shared_ptr<SnapshotHelperArgs> &snapHelperArgs,
251 const unsigned int nSlots, std::shared_ptr<PrevNodeType> prevNode, ActionTags::Snapshot,
252 const RColumnRegister &colRegister)
254 const auto &filename = snapHelperArgs->fFileName;
255 const auto &dirname = snapHelperArgs->fDirName;
256 const auto &treename = snapHelperArgs->fTreeName;
257 const auto &outputColNames = snapHelperArgs->fOutputColNames;
258 const auto &options = snapHelperArgs->fOptions;
260 auto makeIsDefine = [&] {
261 std::vector<bool> isDef;
262 isDef.reserve(
sizeof...(ColTypes));
263 for (
auto i = 0u; i <
sizeof...(ColTypes); ++i)
264 isDef[i] = colRegister.HasName(colNames[i]);
267 std::vector<bool> isDefine = makeIsDefine();
269 std::unique_ptr<RActionBase> actionPtr;
272 using Helper_t = SnapshotHelper<ColTypes...>;
273 using Action_t = RAction<Helper_t, PrevNodeType>;
275 new Action_t(Helper_t(filename, dirname, treename, colNames, outputColNames, options, std::move(isDefine)),
276 colNames, prevNode, colRegister));
279 using Helper_t = SnapshotHelperMT<ColTypes...>;
280 using Action_t = RAction<Helper_t, PrevNodeType>;
281 actionPtr.reset(
new Action_t(
282 Helper_t(nSlots, filename, dirname, treename, colNames, outputColNames, options, std::move(isDefine)),
283 colNames, prevNode, colRegister));
289template <
typename... ColTypes,
typename PrevNodeType,
typename Helper_t>
290std::unique_ptr<RActionBase>
291BuildAction(
const ColumnNames_t &bl,
const std::shared_ptr<Helper_t> &
h,
const unsigned int ,
292 std::shared_ptr<PrevNodeType> prevNode, ActionTags::Book,
const RColumnRegister &colRegister)
294 using Action_t = RAction<Helper_t, PrevNodeType,
TTraits::TypeList<ColTypes...>>;
295 return std::make_unique<Action_t>(Helper_t(std::move(*
h)), bl, std::move(prevNode), colRegister);
300template <
typename Filter>
301void CheckFilter(Filter &)
303 using FilterRet_t =
typename RDF::CallableTraits<Filter>::ret_type;
304 static_assert(std::is_convertible<FilterRet_t, bool>::value,
305 "filter expression returns a type that is not convertible to bool");
312void CheckForRedefinition(
const std::string &where, std::string_view definedCol,
const RColumnRegister &customCols,
315void CheckForDefinition(
const std::string &where, std::string_view definedColView,
const RColumnRegister &customCols,
318void CheckForNoVariations(
const std::string &where, std::string_view definedColView,
const RColumnRegister &customCols);
322std::shared_ptr<RJittedFilter>
BookFilterJit(std::shared_ptr<RNodeBase> *prevNodeOnHeap, std::string_view
name,
327 RDataSource *ds,
const RColumnRegister &customCols,
328 const ColumnNames_t &branches, std::shared_ptr<RNodeBase> *prevNodeOnHeap);
332 std::shared_ptr<RNodeBase> *upcastNodeOnHeap);
334std::shared_ptr<RJittedVariation>
335BookVariationJit(
const std::vector<std::string> &colNames, std::string_view variationName,
336 const std::vector<std::string> &variationTags, std::string_view expression,
RLoopManager &lm,
338 std::shared_ptr<RNodeBase> *upcastNodeOnHeap);
341 const std::type_info &art,
const std::type_info &at,
void *rOnHeap,
TTree *
tree,
342 const unsigned int nSlots,
const RColumnRegister &colRegister,
RDataSource *ds,
343 std::weak_ptr<RJittedAction> *jittedActionOnHeap);
352std::weak_ptr<T> *MakeWeakOnHeap(
const std::shared_ptr<T> &shPtr)
354 return new std::weak_ptr<T>(shPtr);
359std::shared_ptr<T> *MakeSharedOnHeap(
const std::shared_ptr<T> &shPtr)
361 return new std::shared_ptr<T>(shPtr);
368std::shared_ptr<RNodeBase>
UpcastNode(std::shared_ptr<RNodeBase> ptr);
371 const RColumnRegister &validDefines,
RDataSource *ds);
380void AddDSColumnsHelper(
const std::string &colName,
RLoopManager &lm,
RDataSource &ds, RColumnRegister &colRegister)
386 if (!valuePtrs.empty()) {
388 std::vector<void*> typeErasedValuePtrs(valuePtrs.begin(), valuePtrs.end());
395template <
typename... ColumnTypes>
400 using expander =
int[];
402 (
void)expander{(AddDSColumnsHelper<ColumnTypes>(requiredCols[i], lm, ds, colRegister), ++i)..., 0};
406template <
typename F,
typename PrevNode>
407void JitFilterHelper(
F &&
f,
const char **colsPtr, std::size_t colsSize, std::string_view
name,
408 std::weak_ptr<RJittedFilter> *wkJittedFilter, std::shared_ptr<PrevNode> *prevNodeOnHeap,
409 RColumnRegister *colRegister)
noexcept
411 if (wkJittedFilter->expired()) {
414 delete wkJittedFilter;
418 delete prevNodeOnHeap;
425 const auto jittedFilter = wkJittedFilter->lock();
428 using Callable_t = std::decay_t<F>;
430 using ColTypes_t =
typename TTraits::CallableTraits<Callable_t>::arg_types;
431 constexpr auto nColumns = ColTypes_t::list_size;
438 AddDSColumns(cols, lm, *ds, ColTypes_t(), *colRegister);
440 jittedFilter->SetFilter(
441 std::unique_ptr<RFilterBase>(
new F_t(std::forward<F>(
f), cols, *prevNodeOnHeap, *colRegister,
name)));
445 delete prevNodeOnHeap;
446 delete wkJittedFilter;
449namespace DefineTypes {
451struct RDefinePerSampleTag {};
455auto MakeDefineNode(DefineTypes::RDefineTag, std::string_view
name, std::string_view dummyType,
F &&
f,
459 name, dummyType, std::forward<F>(
f), cols, colRegister, lm));
463auto MakeDefineNode(DefineTypes::RDefinePerSampleTag, std::string_view
name, std::string_view dummyType,
F &&
f,
466 return std::unique_ptr<RDefineBase>(
473template <
typename RDefineTypeTag,
typename F>
474void JitDefineHelper(
F &&
f,
const char **colsPtr, std::size_t colsSize, std::string_view
name,
RLoopManager *lm,
475 std::weak_ptr<RJittedDefine> *wkJittedDefine, RColumnRegister *colRegister,
476 std::shared_ptr<RNodeBase> *prevNodeOnHeap)
noexcept
479 auto doDeletes = [&] {
480 delete wkJittedDefine;
484 delete prevNodeOnHeap;
488 if (wkJittedDefine->expired()) {
497 auto jittedDefine = wkJittedDefine->lock();
499 using Callable_t = std::decay_t<F>;
500 using ColTypes_t =
typename TTraits::CallableTraits<Callable_t>::arg_types;
504 AddDSColumns(cols, *lm, *ds, ColTypes_t(), *colRegister);
508 const auto dummyType =
"jittedCol_t";
510 std::unique_ptr<RDefineBase> newCol{
511 MakeDefineNode(RDefineTypeTag{},
name, dummyType, std::forward<F>(
f), cols, *colRegister, *lm)};
512 jittedDefine->SetDefine(std::move(newCol));
518void JitVariationHelper(
F &&
f,
const char **colsPtr, std::size_t colsSize,
const char **variedCols,
519 std::size_t variedColsSize,
const char **variationTags, std::size_t variationTagsSize,
521 std::weak_ptr<RJittedVariation> *wkJittedVariation, RColumnRegister *colRegister,
522 std::shared_ptr<RNodeBase> *prevNodeOnHeap)
noexcept
525 auto doDeletes = [&] {
528 delete[] variationTags;
530 delete wkJittedVariation;
534 delete prevNodeOnHeap;
537 if (wkJittedVariation->expired()) {
544 const ColumnNames_t inputColNames(colsPtr, colsPtr + colsSize);
545 std::vector<std::string> variedColNames(variedCols, variedCols + variedColsSize);
546 std::vector<std::string> tags(variationTags, variationTags + variationTagsSize);
548 auto jittedVariation = wkJittedVariation->lock();
550 using Callable_t = std::decay_t<F>;
551 using ColTypes_t =
typename TTraits::CallableTraits<Callable_t>::arg_types;
555 AddDSColumns(inputColNames, *lm, *ds, ColTypes_t(), *colRegister);
558 std::unique_ptr<RVariationBase> newVariation{
559 new RVariation<std::decay_t<F>>(std::move(variedColNames), variationName, std::forward<F>(
f), std::move(tags),
560 jittedVariation->GetTypeName(), *colRegister, *lm, std::move(inputColNames))};
561 jittedVariation->SetVariation(std::move(newVariation));
567template <
typename ActionTag,
typename... ColTypes,
typename PrevNodeType,
typename HelperArgType>
568void CallBuildAction(std::shared_ptr<PrevNodeType> *prevNodeOnHeap,
const char **colsPtr, std::size_t colsSize,
569 const unsigned int nSlots, std::shared_ptr<HelperArgType> *helperArgOnHeap,
570 std::weak_ptr<RJittedAction> *wkJittedActionOnHeap, RColumnRegister *colRegister)
noexcept
573 auto doDeletes = [&] {
575 delete helperArgOnHeap;
576 delete wkJittedActionOnHeap;
580 delete prevNodeOnHeap;
583 if (wkJittedActionOnHeap->expired()) {
592 auto jittedActionOnHeap = wkJittedActionOnHeap->lock();
595 auto &prevNodePtr = *prevNodeOnHeap;
596 auto &loopManager = *prevNodePtr->GetLoopManagerUnchecked();
597 using ColTypes_t =
TypeList<ColTypes...>;
598 constexpr auto nColumns = ColTypes_t::list_size;
599 auto ds = loopManager.GetDataSource();
601 AddDSColumns(cols, loopManager, *ds, ColTypes_t(), *colRegister);
603 auto actionPtr = BuildAction<ColTypes...>(cols, std::move(*helperArgOnHeap), nSlots, std::move(prevNodePtr),
604 ActionTag{}, *colRegister);
605 jittedActionOnHeap->SetAction(std::move(actionPtr));
611template <typename T, bool Container = IsDataContainer<T>::value && !std::is_same<T, std::string>::value>
612struct RMinReturnType {
622struct RMinReturnType<
T, true> {
623 using type = TTraits::TakeFirstParameter_t<T>;
627template <
typename R,
typename F,
typename... Args>
630 return [
f](
unsigned int, Args...
a)
mutable ->
R {
return f(
a...); };
633template <
typename ColType,
typename... Rest>
634struct RNeedJittingHelper {
635 static constexpr bool value = RNeedJittingHelper<Rest...>::value;
638template <
typename... Rest>
640 static constexpr bool value =
true;
644struct RNeedJittingHelper<
T> {
645 static constexpr bool value =
false;
650 static constexpr bool value =
true;
653template <
typename ...ColTypes>
655 static constexpr bool value = RNeedJittingHelper<ColTypes...>::value;
659struct RNeedJitting<> {
660 static constexpr bool value =
false;
667template <
typename R,
typename Merge,
typename U,
typename T,
typename decayedU = std::decay_t<U>,
668 typename mergeArgsNoDecay_t =
typename CallableTraits<Merge>::arg_types_nodecay,
669 typename mergeArgs_t =
typename CallableTraits<Merge>::arg_types,
670 typename mergeRet_t =
typename CallableTraits<Merge>::ret_type>
673 constexpr bool isAggregatorOk =
674 (std::is_same<R, decayedU>::value) || (std::is_same<R, void>::value && std::is_lvalue_reference<U>::value);
675 static_assert(isAggregatorOk,
"aggregator function must have signature `U(U,T)` or `void(U&,T)`");
676 constexpr bool isMergeOk =
677 (std::is_same<TypeList<decayedU, decayedU>, mergeArgs_t>::value && std::is_same<decayedU, mergeRet_t>::value) ||
678 (std::is_same<
TypeList<std::vector<decayedU> &>, mergeArgsNoDecay_t>::value &&
679 std::is_same<void, mergeRet_t>::value);
680 static_assert(isMergeOk,
"merge function must have signature `U(U,U)` or `void(std::vector<U>&)`");
685template <
typename R,
typename T>
686void CheckAggregate(T)
688 static_assert(
sizeof(
T) == 0,
"aggregator function must take exactly two arguments");
700 const RColumnRegister &definedCols,
const ColumnNames_t &dataSourceColumns);
703std::vector<std::string>
GetFilterNames(
const std::shared_ptr<RLoopManager> &loopManager);
706template <
typename NodeType>
707std::vector<std::string>
GetFilterNames(
const std::shared_ptr<NodeType> &node)
709 std::vector<std::string> filterNames;
710 node->AddFilterName(filterNames);
714struct ParsedTreePath {
715 std::string fTreeName;
716 std::string fDirName;
726using IsTrueForAllImpl_t =
typename std::is_same<TBoolPack<bs...,
true>, TBoolPack<
true, bs...>>;
728template <
bool... Conditions>
730 static constexpr bool value = IsTrueForAllImpl_t<Conditions...>::value;
737struct IsList_t : std::false_type {};
740struct IsList_t<std::list<T>> : std::true_type {};
743struct IsDeque_t : std::false_type {};
746struct IsDeque_t<std::deque<T>> : std::true_type {};
754struct InnerValueType {
758template <
typename Elem>
764using InnerValueType_t =
typename InnerValueType<T>::type;
766std::pair<std::vector<std::string>, std::vector<std::string>>
767AddSizeBranches(
const std::vector<std::string> &branches,
TTree *
tree, std::vector<std::string> &&colsWithoutAliases,
768 std::vector<std::string> &&colsWithAliases);
780using MinReturnType_t =
typename RDFInternal::RMinReturnType<T>::type;
783using MaxReturnType_t = MinReturnType_t<T>;
786using SumReturnType_t = MinReturnType_t<T>;
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
R__EXTERN Int_t gErrorIgnoreLevel
The head node of a RDF computation graph.
void AddDSValuePtrs(const std::string &col, const std::vector< void * > ptrs)
RDataSource * GetDataSource() const
bool HasDSValuePtrs(const std::string &col) const
RLoopManager * GetLoopManagerUnchecked() final
A binder for user-defined columns and aliases.
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
virtual bool HasColumn(std::string_view colName) const =0
Checks if the dataset has a certain column.
std::vector< T ** > GetColumnReaders(std::string_view columnName)
Called at most once per column by RDF.
The public interface to the RDataFrame federation of classes.
A "std::vector"-like collection of values implementing handy operation to analyse them.
A TTree represents a columnar dataset.
R Sum(const RVec< T > &v, const R zero=R(0))
Sum elements of an RVec.
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.
ParsedTreePath ParseTreePath(std::string_view fullTreeName)
std::shared_ptr< RJittedVariation > BookVariationJit(const std::vector< std::string > &colNames, std::string_view variationName, const std::vector< std::string > &variationTags, std::string_view expression, RLoopManager &lm, RDataSource *ds, const RColumnRegister &colRegister, const ColumnNames_t &branches, std::shared_ptr< RNodeBase > *upcastNodeOnHeap)
Book the jitting of a Vary call.
void CheckValidCppVarName(std::string_view var, const std::string &where)
void RemoveDuplicates(ColumnNames_t &columnNames)
std::shared_ptr< RNodeBase > UpcastNode(std::shared_ptr< RNodeBase > ptr)
ColumnNames_t GetValidatedColumnNames(RLoopManager &lm, const unsigned int nColumns, const ColumnNames_t &columns, const RColumnRegister &customColumns, RDataSource *ds)
Given the desired number of columns and the user-provided list of columns:
std::vector< std::string > GetFilterNames(const std::shared_ptr< RLoopManager > &loopManager)
std::string PrettyPrintAddr(const void *const addr)
std::string JitBuildAction(const ColumnNames_t &cols, std::shared_ptr< RDFDetail::RNodeBase > *prevNode, const std::type_info &helperArgType, const std::type_info &at, void *helperArgOnHeap, TTree *tree, const unsigned int nSlots, const RColumnRegister &customCols, RDataSource *ds, std::weak_ptr< RJittedAction > *jittedActionOnHeap)
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)
void CheckForDefinition(const std::string &where, std::string_view definedColView, const RColumnRegister &customCols, const ColumnNames_t &treeColumns, const ColumnNames_t &dataSourceColumns)
Throw if column definedColView is not already there.
ColumnNames_t FilterArraySizeColNames(const ColumnNames_t &columnNames, const std::string &action)
Take a list of column names, return that list with entries starting by '#' filtered out.
std::shared_ptr< RJittedDefine > BookDefinePerSampleJit(std::string_view name, std::string_view expression, RLoopManager &lm, const RColumnRegister &customCols, std::shared_ptr< RNodeBase > *upcastNodeOnHeap)
Book the jitting of a DefinePerSample call.
void CheckForRedefinition(const std::string &where, std::string_view definedColView, const RColumnRegister &customCols, const ColumnNames_t &treeColumns, const ColumnNames_t &dataSourceColumns)
Throw if column definedColView is already there.
void CheckForDuplicateSnapshotColumns(const ColumnNames_t &cols)
ColumnNames_t ConvertRegexToColumns(const ColumnNames_t &colNames, std::string_view columnNameRegexp, std::string_view callerName)
std::pair< std::vector< std::string >, std::vector< std::string > > AddSizeBranches(const std::vector< std::string > &branches, TTree *tree, std::vector< std::string > &&colsWithoutAliases, std::vector< std::string > &&colsWithAliases)
Return copies of colsWithoutAliases and colsWithAliases with size branches for variable-sized array b...
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 ...
std::shared_ptr< RJittedDefine > BookDefineJit(std::string_view name, std::string_view expression, RLoopManager &lm, RDataSource *ds, const RColumnRegister &customCols, const ColumnNames_t &branches, std::shared_ptr< RNodeBase > *upcastNodeOnHeap)
Book the jitting of a Define call.
std::vector< std::string > GetValidatedArgTypes(const ColumnNames_t &colNames, const RColumnRegister &colRegister, TTree *tree, RDataSource *ds, const std::string &context, bool vector2rvec)
void CheckForNoVariations(const std::string &where, std::string_view definedColView, const RColumnRegister &customCols)
Throw if the column has systematic variations attached.
ColumnNames_t FindUnknownColumns(const ColumnNames_t &requiredCols, const ColumnNames_t &datasetColumns, const RColumnRegister &definedCols, const ColumnNames_t &dataSourceColumns)
void TriggerRun(ROOT::RDF::RNode &node)
Trigger the execution of an RDataFrame computation graph.
std::shared_ptr< RDFDetail::RJittedFilter > BookFilterJit(std::shared_ptr< RDFDetail::RNodeBase > *prevNodeOnHeap, std::string_view name, std::string_view expression, const ColumnNames_t &branches, const RColumnRegister &customCols, TTree *tree, RDataSource *ds)
Book the jitting of a Filter call.
std::vector< std::string > ColumnNames_t
ROOT type_traits extensions.
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.
Short_t Max(Short_t a, Short_t b)
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
Return the weighted mean of an array a with length n.
Short_t Min(Short_t a, Short_t b)
Double_t StdDev(Long64_t n, const T *a, const Double_t *w=0)
A collection of options to steer the creation of the dataset on file.
Lightweight storage for a collection of types.