11#ifndef ROOT_RDF_TINTERFACE
12#define ROOT_RDF_TINTERFACE
48#include "RConfigure.h"
57#include <initializer_list>
67#include <unordered_set>
91template <
typename Proxied>
94using RNode = RInterface<::ROOT::Detail::RDF::RNodeBase>;
108 const std::vector<std::size_t> &vecSizes,
float vecPadding,
ROOT::RVecF &
dest);
125template <
typename Proxied>
133 template <
typename T>
140 friend std::vector<std::pair<std::uint64_t, std::uint64_t>>
145 const std::vector<std::size_t> &vecSizes,
float vecPadding,
155 auto nColumns = columnList.size();
156 std::vector<const std::type_info *> colTypeIDs;
157 colTypeIDs.reserve(nColumns);
158 for (
decltype(nColumns) i{}; i < nColumns; i++) {
159 const auto &colName = validColumnNames[i];
163 colTypeIDs.push_back(colTypeID);
170 auto location = std::shared_ptr<ROOT::RVecF>(&
dest, [](
ROOT::RVecF *) {});
171 auto action = RDFInternal::BuildAction(validColumnNames, colTypeIDs, location, vecSizes, vecPadding,
fProxiedPtr,
173 auto resPtr = MakeResultPtr(location, *
GetLoopManager(), std::move(action));
198 template <typename T = Proxied, typename = std::enable_if_t<std::is_same<T, RLoopManager>::value,
int>>
273 template <typename F, std::enable_if_t<!std::is_convertible<F, std::string>::value,
int> = 0>
276 RDFInternal::CheckFilter(
f);
277 using ColTypes_t =
typename TTraits::CallableTraits<F>::arg_types;
278 constexpr auto nColumns = ColTypes_t::list_size;
296 template <typename F, std::enable_if_t<!std::is_convertible<F, std::string>::value,
int> = 0>
312 template <
typename F>
393 throw std::runtime_error(
"Unknown column: \"" + std::string(column) +
"\"");
444 throw std::runtime_error(
"Unknown column: \"" + std::string(column) +
"\"");
491 template <typename F, typename std::enable_if_t<!std::is_convertible<F, std::string>::value,
int> = 0>
494 return DefineImpl<F, RDFDetail::ExtraArgsForDefine::None>(
name, std::move(expression), columns,
"Define");
521 template <
typename F>
524 return DefineImpl<F, RDFDetail::ExtraArgsForDefine::Slot>(
name, std::move(expression), columns,
"DefineSlot");
552 template <
typename F>
555 return DefineImpl<F, RDFDetail::ExtraArgsForDefine::SlotAndEntry>(
name, std::move(expression), columns,
583 constexpr auto where =
"Define";
592 newCols.
AddDefine(std::move(jittedDefine));
610 template <typename F, std::enable_if_t<!std::is_convertible<F, std::string>::value,
int> = 0>
613 return DefineImpl<F, RDFDetail::ExtraArgsForDefine::None>(
name, std::move(expression), columns,
"Redefine");
629 template <
typename F>
632 return DefineImpl<F, RDFDetail::ExtraArgsForDefine::Slot>(
name, std::move(expression), columns,
"RedefineSlot");
648 template <
typename F>
651 return DefineImpl<F, RDFDetail::ExtraArgsForDefine::SlotAndEntry>(
name, std::move(expression), columns,
652 "RedefineSlotEntry");
671 constexpr auto where =
"Redefine";
680 newCols.
AddDefine(std::move(jittedDefine));
720 template <
typename T>
723 constexpr auto where{
"DefaultValueFor"};
733 if (retTypeName.empty()) {
737 retTypeName =
"CLING_UNKNOWN_TYPE_" + demangledType;
741 auto newColumn = std::make_shared<ROOT::Internal::RDF::RDefaultValueFor<T>>(
746 newCols.AddDefine(std::move(newColumn));
783 template <typename F, typename RetType_t = typename TTraits::CallableTraits<F>::ret_type>
786 return DefinePerSampleImpl<F, RetType_t>(
name, std::move(expression),
false);
792 template <typename F, typename RetType_t = typename TTraits::CallableTraits<F>::ret_type>
795 return DefinePerSampleImpl<F, RetType_t>(
name, std::move(expression),
true);
895 template <
typename F>
897 const std::vector<std::string> &variationTags, std::string_view variationName =
"")
899 std::vector<std::string> colNames{{std::string(colName)}};
900 const std::string theVariationName{variationName.empty() ? colName : variationName};
902 return VaryImpl<true>(std::move(colNames), std::forward<F>(expression), inputColumns, variationTags,
934 template <
typename F>
936 std::size_t nVariations, std::string_view variationName =
"")
938 R__ASSERT(nVariations > 0 &&
"Must have at least one variation.");
940 std::vector<std::string> variationTags;
941 variationTags.reserve(nVariations);
942 for (std::size_t i = 0u; i < nVariations; ++i)
943 variationTags.emplace_back(std::to_string(i));
945 const std::string theVariationName{variationName.empty() ? colName : variationName};
947 return Vary(colName, std::forward<F>(expression), inputColumns, std::move(variationTags), theVariationName);
982 template <
typename F>
984 const std::vector<std::string> &variationTags, std::string_view variationName)
986 return VaryImpl<false>(colNames, std::forward<F>(expression), inputColumns, variationTags, variationName);
1003 template <
typename F>
1005 Vary(std::initializer_list<std::string> colNames, F &&expression,
const ColumnNames_t &inputColumns,
1006 const std::vector<std::string> &variationTags, std::string_view variationName)
1008 return Vary(std::vector<std::string>(colNames), std::forward<F>(expression), inputColumns, variationTags, variationName);
1043 template <
typename F>
1045 std::size_t nVariations, std::string_view variationName)
1047 R__ASSERT(nVariations > 0 &&
"Must have at least one variation.");
1049 std::vector<std::string> variationTags;
1050 variationTags.reserve(nVariations);
1051 for (std::size_t i = 0u; i < nVariations; ++i)
1052 variationTags.emplace_back(std::to_string(i));
1054 return Vary(colNames, std::forward<F>(expression), inputColumns, std::move(variationTags), variationName);
1073 template <
typename F>
1075 const ColumnNames_t &inputColumns, std::size_t nVariations, std::string_view variationName)
1077 return Vary(std::vector<std::string>(colNames), std::forward<F>(expression), inputColumns, nVariations, variationName);
1118 const std::vector<std::string> &variationTags, std::string_view variationName =
"")
1120 std::vector<std::string> colNames{{std::string(colName)}};
1121 const std::string theVariationName{variationName.empty() ? colName : variationName};
1123 return JittedVaryImpl(colNames, expression, variationTags, theVariationName,
true);
1163 std::string_view variationName =
"")
1165 std::vector<std::string> variationTags;
1166 variationTags.reserve(nVariations);
1167 for (std::size_t i = 0u; i < nVariations; ++i)
1168 variationTags.emplace_back(std::to_string(i));
1170 return Vary(colName, expression, std::move(variationTags), variationName);
1225 std::size_t nVariations, std::string_view variationName)
1227 std::vector<std::string> variationTags;
1228 variationTags.reserve(nVariations);
1229 for (std::size_t i = 0u; i < nVariations; ++i)
1230 variationTags.emplace_back(std::to_string(i));
1232 return Vary(colNames, expression, std::move(variationTags), variationName);
1249 std::size_t nVariations, std::string_view variationName)
1251 return Vary(std::vector<std::string>(colNames), expression, nVariations, variationName);
1302 const std::vector<std::string> &variationTags, std::string_view variationName)
1304 return JittedVaryImpl(colNames, expression, variationTags, variationName,
false);
1328 constexpr auto where =
"Alias";
1336 newCols.AddAlias(alias, validColumnName);
1340 return newInterface;
1364 if (stride == 0 || (end != 0 && end < begin))
1365 throw std::runtime_error(
"Range: stride must be strictly greater than 0 and end must be greater than begin.");
1369 auto rangePtr = std::make_shared<Range_t>(begin, end, stride,
fProxiedPtr);
1371 return newInterface;
1409 auto cSPtr = std::make_shared<ULong64_t>(0);
1410 using Helper_t = RDFInternal::CountHelper;
1414 return MakeResultPtr(cSPtr, *
fLoopManager, std::move(action));
1437 template <
typename T,
typename COLL = std::vector<T>>
1445 using Helper_t = RDFInternal::TakeHelper<T, T, COLL>;
1447 auto valuesPtr = std::make_shared<COLL>();
1452 return MakeResultPtr(valuesPtr, *
fLoopManager, std::move(action));
1480 template <
typename V = RDFDetail::RInferredType>
1487 std::shared_ptr<::TH1D>
h(
nullptr);
1489 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1490 h = model.GetHistogram();
1493 if (
h->GetXaxis()->GetXmax() ==
h->GetXaxis()->GetXmin())
1495 return CreateAction<RDFInternal::ActionTags::Histo1D, V>(validatedColumns,
h,
h,
fProxiedPtr);
1515 template <
typename V = RDFDetail::RInferredType>
1518 const auto h_name = std::string(vName);
1519 const auto h_title = h_name +
";" + h_name +
";count";
1520 return Histo1D<V>({h_name.c_str(), h_title.c_str(), 128u, 0., 0.}, vName);
1541 template <
typename V = RDFDetail::RInferredType,
typename W = RDFDetail::RInferredType>
1544 const std::vector<std::string_view> columnViews = {vName, wName};
1548 std::shared_ptr<::TH1D>
h(
nullptr);
1550 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1551 h = model.GetHistogram();
1554 if (
h->GetXaxis()->GetXmax() ==
h->GetXaxis()->GetXmin())
1556 return CreateAction<RDFInternal::ActionTags::Histo1D, V, W>(userColumns,
h,
h,
fProxiedPtr);
1578 template <
typename V = RDFDetail::RInferredType,
typename W = RDFDetail::RInferredType>
1582 std::string str_vName{vName};
1583 std::string str_wName{wName};
1584 const auto h_name = str_vName +
"_weighted_" + str_wName;
1585 const auto h_title = str_vName +
", weights: " + str_wName +
";" + str_vName +
";count * " + str_wName;
1586 return Histo1D<V, W>({h_name.c_str(), h_title.c_str(), 128u, 0., 0.}, vName, wName);
1598 template <
typename V,
typename W>
1601 return Histo1D<V, W>(model,
"",
"");
1632 template <
typename V1 = RDFDetail::RInferredType,
typename V2 = RDFDetail::RInferredType>
1635 std::shared_ptr<::TH2D>
h(
nullptr);
1637 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1638 h = model.GetHistogram();
1640 if (!RDFInternal::HistoUtils<::TH2D>::HasAxisLimits(*
h)) {
1641 throw std::runtime_error(
"2D histograms with no axes limits are not supported yet.");
1643 const std::vector<std::string_view> columnViews = {v1Name, v2Name};
1647 return CreateAction<RDFInternal::ActionTags::Histo2D, V1, V2>(userColumns,
h,
h,
fProxiedPtr);
1676 Histo2D(
const TH2DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view wName)
1678 std::shared_ptr<::TH2D>
h(
nullptr);
1680 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1681 h = model.GetHistogram();
1683 if (!RDFInternal::HistoUtils<::TH2D>::HasAxisLimits(*
h)) {
1684 throw std::runtime_error(
"2D histograms with no axes limits are not supported yet.");
1686 const std::vector<std::string_view> columnViews = {v1Name, v2Name, wName};
1690 return CreateAction<RDFInternal::ActionTags::Histo2D, V1, V2, W>(userColumns,
h,
h,
fProxiedPtr);
1693 template <
typename V1,
typename V2,
typename W>
1696 return Histo2D<V1, V2, W>(model,
"",
"",
"");
1731 std::string_view v3Name =
"")
1733 std::shared_ptr<::TH3D>
h(
nullptr);
1735 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1736 h = model.GetHistogram();
1738 if (!RDFInternal::HistoUtils<::TH3D>::HasAxisLimits(*
h)) {
1739 throw std::runtime_error(
"3D histograms with no axes limits are not supported yet.");
1741 const std::vector<std::string_view> columnViews = {v1Name, v2Name, v3Name};
1745 return CreateAction<RDFInternal::ActionTags::Histo3D, V1, V2, V3>(userColumns,
h,
h,
fProxiedPtr);
1780 std::string_view v3Name, std::string_view wName)
1782 std::shared_ptr<::TH3D>
h(
nullptr);
1784 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1785 h = model.GetHistogram();
1787 if (!RDFInternal::HistoUtils<::TH3D>::HasAxisLimits(*
h)) {
1788 throw std::runtime_error(
"3D histograms with no axes limits are not supported yet.");
1790 const std::vector<std::string_view> columnViews = {v1Name, v2Name, v3Name, wName};
1794 return CreateAction<RDFInternal::ActionTags::Histo3D, V1, V2, V3, W>(userColumns,
h,
h,
fProxiedPtr);
1797 template <
typename V1,
typename V2,
typename V3,
typename W>
1800 return Histo3D<V1, V2, V3, W>(model,
"",
"",
"",
"");
1828 template <
typename FirstColumn,
typename... OtherColumns>
1831 std::shared_ptr<::THnD>
h(
nullptr);
1833 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1834 h = model.GetHistogram();
1835 const auto hDims =
h->GetNdimensions();
1836 decltype(hDims) nCols = columnList.size();
1838 if (!wName.empty() && nCols == hDims + 1)
1839 throw std::invalid_argument(
"The weight column was passed as an argument and at the same time the list of "
1840 "input columns contains one column more than the number of dimensions of the "
1841 "histogram. Call as 'HistoND(model, cols, weightCol)'.");
1843 if (nCols == hDims + 1)
1844 Warning(
"HistoND",
"Passing the column with the weights as the last column in the list is deprecated. "
1845 "Instead, pass it as a separate argument, e.g. 'HistoND(model, cols, weightCol)'.");
1847 if (!wName.empty() || nCols == hDims + 1)
1850 if (nCols != hDims + 1 && nCols != hDims)
1851 throw std::invalid_argument(
"Wrong number of columns for the specified number of histogram axes.");
1854 if (!wName.empty()) {
1858 userColumns.push_back(std::string{wName});
1859 return CreateAction<RDFInternal::ActionTags::HistoND, FirstColumn, OtherColumns...>(userColumns,
h,
h,
1862 return CreateAction<RDFInternal::ActionTags::HistoND, FirstColumn, OtherColumns...>(columnList,
h,
h,
1888 std::shared_ptr<::THnD>
h(
nullptr);
1890 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1891 h = model.GetHistogram();
1892 const auto hDims =
h->GetNdimensions();
1893 decltype(hDims) nCols = columnList.size();
1895 if (!wName.empty() && nCols == hDims + 1)
1896 throw std::invalid_argument(
"The weight column was passed as an argument and at the same time the list of "
1897 "input columns contains one column more than the number of dimensions of the "
1898 "histogram. Call as 'HistoND(model, cols, weightCol)'.");
1900 if (nCols == hDims + 1)
1901 Warning(
"HistoND",
"Passing the column with the weights as the last column in the list is deprecated. "
1902 "Instead, pass it as a separate argument, e.g. 'HistoND(model, cols, weightCol)'.");
1904 if (!wName.empty() || nCols == hDims + 1)
1907 if (nCols != hDims + 1 && nCols != hDims)
1908 throw std::invalid_argument(
"Wrong number of columns for the specified number of histogram axes.");
1911 if (!wName.empty()) {
1915 userColumns.push_back(std::string{wName});
1916 return CreateAction<RDFInternal::ActionTags::HistoND, RDFDetail::RInferredType>(userColumns,
h,
h,
fProxiedPtr,
1917 userColumns.size());
1919 return CreateAction<RDFInternal::ActionTags::HistoND, RDFDetail::RInferredType>(columnList,
h,
h,
fProxiedPtr,
1948 template <
typename FirstColumn,
typename... OtherColumns>
1952 std::shared_ptr<::THnSparseD>
h(
nullptr);
1954 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
1955 h = model.GetHistogram();
1956 const auto hDims =
h->GetNdimensions();
1957 decltype(hDims) nCols = columnList.size();
1959 if (!wName.empty() && nCols == hDims + 1)
1960 throw std::invalid_argument(
"The weight column was passed as an argument and at the same time the list of "
1961 "input columns contains one column more than the number of dimensions of the "
1962 "histogram. Call as 'HistoNSparseD(model, cols, weightCol)'.");
1964 if (nCols == hDims + 1)
1966 "Passing the column with the weights as the last column in the list is deprecated. "
1967 "Instead, pass it as a separate argument, e.g. 'HistoNSparseD(model, cols, weightCol)'.");
1969 if (!wName.empty() || nCols == hDims + 1)
1972 if (nCols != hDims + 1 && nCols != hDims)
1973 throw std::invalid_argument(
"Wrong number of columns for the specified number of histogram axes.");
1976 if (!wName.empty()) {
1980 userColumns.push_back(std::string{wName});
1981 return CreateAction<RDFInternal::ActionTags::HistoNSparseD, FirstColumn, OtherColumns...>(userColumns,
h,
h,
1984 return CreateAction<RDFInternal::ActionTags::HistoNSparseD, FirstColumn, OtherColumns...>(columnList,
h,
h,
2011 std::shared_ptr<::THnSparseD>
h(
nullptr);
2013 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
2014 h = model.GetHistogram();
2015 const auto hDims =
h->GetNdimensions();
2016 decltype(hDims) nCols = columnList.size();
2018 if (!wName.empty() && nCols == hDims + 1)
2019 throw std::invalid_argument(
"The weight column was passed as an argument and at the same time the list of "
2020 "input columns contains one column more than the number of dimensions of the "
2021 "histogram. Call as 'HistoNSparseD(model, cols, weightCol)'.");
2023 if (nCols == hDims + 1)
2025 "Passing the column with the weights as the last column in the list is deprecated. "
2026 "Instead, pass it as a separate argument, e.g. 'HistoNSparseD(model, cols, weightCol)'.");
2028 if (!wName.empty() || nCols == hDims + 1)
2031 if (nCols != hDims + 1 && nCols != hDims)
2032 throw std::invalid_argument(
"Wrong number of columns for the specified number of histogram axes.");
2035 if (!wName.empty()) {
2039 userColumns.push_back(std::string{wName});
2040 return CreateAction<RDFInternal::ActionTags::HistoNSparseD, RDFDetail::RInferredType>(
2043 return CreateAction<RDFInternal::ActionTags::HistoNSparseD, RDFDetail::RInferredType>(
2066 template <
typename BinContentType =
double,
typename V = RDFDetail::RInferredType>
2068 Hist(std::uint64_t nNormalBins, std::pair<double, double> interval, std::string_view vName)
2070 std::shared_ptr
h = std::make_shared<ROOT::Experimental::RHist<BinContentType>>(nNormalBins, interval);
2074 return Hist<V>(
h, columnList);
2101 if (axes.size() != columnList.size()) {
2102 std::string msg =
"Wrong number of columns for the specified number of histogram axes: ";
2103 msg +=
"expected " + std::to_string(axes.size()) +
", got " + std::to_string(columnList.size());
2104 throw std::invalid_argument(msg);
2107 std::shared_ptr
h = std::make_shared<ROOT::Experimental::RHist<BinContentType>>(std::move(axes));
2109 return Hist<ColumnType, ColumnTypes...>(
h, columnList);
2140 if (
h->GetNDimensions() != columnList.size()) {
2141 std::string msg =
"Wrong number of columns for the passed histogram: ";
2142 msg +=
"expected " + std::to_string(
h->GetNDimensions()) +
", got " + std::to_string(columnList.size());
2143 throw std::invalid_argument(msg);
2174 Hist(std::uint64_t nNormalBins, std::pair<double, double> interval, std::string_view vName, std::string_view wName)
2176 std::shared_ptr
h = std::make_shared<ROOT::Experimental::RHist<BinContentType>>(nNormalBins, interval);
2180 return Hist<V, W>(
h, columnList, wName);
2209 Hist(std::vector<ROOT::Experimental::RAxisVariant> axes,
const ColumnNames_t &columnList, std::string_view wName)
2212 "weighted filling is not supported for integral bin content types");
2214 if (axes.size() != columnList.size()) {
2215 std::string msg =
"Wrong number of columns for the specified number of histogram axes: ";
2216 msg +=
"expected " + std::to_string(axes.size()) +
", got " + std::to_string(columnList.size());
2217 throw std::invalid_argument(msg);
2220 std::shared_ptr
h = std::make_shared<ROOT::Experimental::RHist<BinContentType>>(std::move(axes));
2222 return Hist<ColumnType, ColumnTypes...>(
h, columnList, wName);
2253 std::string_view wName)
2256 "weighted filling is not supported for integral bin content types");
2260 if (
h->GetNDimensions() != columnList.size()) {
2261 std::string msg =
"Wrong number of columns for the passed histogram: ";
2262 msg +=
"expected " + std::to_string(
h->GetNDimensions()) +
", got " + std::to_string(columnList.size());
2263 throw std::invalid_argument(msg);
2268 columnListWithWeights.push_back(std::string(wName));
2270 return CreateAction<RDFInternal::ActionTags::HistWithWeight, ColumnType, ColumnTypes...>(
2271 columnListWithWeights,
h,
h,
fProxiedPtr, columnListWithWeights.size());
2302 if (
h->GetNDimensions() != columnList.size()) {
2303 std::string msg =
"Wrong number of columns for the passed histogram: ";
2304 msg +=
"expected " + std::to_string(
h->GetNDimensions()) +
", got " + std::to_string(columnList.size());
2305 throw std::invalid_argument(msg);
2340 std::string_view wName)
2343 "weighted filling is not supported for integral bin content types");
2347 if (
h->GetNDimensions() != columnList.size()) {
2348 std::string msg =
"Wrong number of columns for the passed histogram: ";
2349 msg +=
"expected " + std::to_string(
h->GetNDimensions()) +
", got " + std::to_string(columnList.size());
2350 throw std::invalid_argument(msg);
2355 columnListWithWeights.push_back(std::string(wName));
2357 return CreateAction<RDFInternal::ActionTags::HistWithWeight, ColumnType, ColumnTypes...>(
2358 columnListWithWeights,
h,
h,
fProxiedPtr, columnListWithWeights.size());
2390 template <
typename X = RDFDetail::RInferredType,
typename Y = RDFDetail::RInferredType>
2393 auto graph = std::make_shared<::TGraph>();
2394 const std::vector<std::string_view> columnViews = {
x,
y};
2402 const auto g_name = validatedColumns[1] +
"_vs_" + validatedColumns[0];
2403 const auto g_title = validatedColumns[1] +
" vs " + validatedColumns[0];
2404 graph->SetNameTitle(g_name.c_str(), g_title.c_str());
2405 graph->GetXaxis()->SetTitle(validatedColumns[0].c_str());
2406 graph->GetYaxis()->SetTitle(validatedColumns[1].c_str());
2408 return CreateAction<RDFInternal::ActionTags::Graph, X, Y>(validatedColumns, graph, graph,
fProxiedPtr);
2457 std::string_view exh =
"", std::string_view eyl =
"", std::string_view eyh =
"")
2459 auto graph = std::make_shared<::TGraphAsymmErrors>();
2460 const std::vector<std::string_view> columnViews = {
x,
y, exl, exh, eyl, eyh};
2468 const auto g_name = validatedColumns[1] +
"_vs_" + validatedColumns[0];
2469 const auto g_title = validatedColumns[1] +
" vs " + validatedColumns[0];
2470 graph->SetNameTitle(g_name.c_str(), g_title.c_str());
2471 graph->GetXaxis()->SetTitle(validatedColumns[0].c_str());
2472 graph->GetYaxis()->SetTitle(validatedColumns[1].c_str());
2474 return CreateAction<RDFInternal::ActionTags::GraphAsymmErrors, X, Y, EXL, EXH, EYL, EYH>(validatedColumns, graph,
2501 template <
typename V1 = RDFDetail::RInferredType,
typename V2 = RDFDetail::RInferredType>
2505 std::shared_ptr<::TProfile>
h(
nullptr);
2507 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
2508 h = model.GetProfile();
2511 if (!RDFInternal::HistoUtils<::TProfile>::HasAxisLimits(*
h)) {
2512 throw std::runtime_error(
"Profiles with no axes limits are not supported yet.");
2514 const std::vector<std::string_view> columnViews = {v1Name, v2Name};
2518 return CreateAction<RDFInternal::ActionTags::Profile1D, V1, V2>(userColumns,
h,
h,
fProxiedPtr);
2550 std::shared_ptr<::TProfile>
h(
nullptr);
2552 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
2553 h = model.GetProfile();
2556 if (!RDFInternal::HistoUtils<::TProfile>::HasAxisLimits(*
h)) {
2557 throw std::runtime_error(
"Profile histograms with no axes limits are not supported yet.");
2559 const std::vector<std::string_view> columnViews = {v1Name, v2Name, wName};
2563 return CreateAction<RDFInternal::ActionTags::Profile1D, V1, V2, W>(userColumns,
h,
h,
fProxiedPtr);
2569 template <
typename V1,
typename V2,
typename W>
2572 return Profile1D<V1, V2, W>(model,
"",
"",
"");
2605 std::string_view v2Name =
"", std::string_view v3Name =
"")
2607 std::shared_ptr<::TProfile2D>
h(
nullptr);
2609 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
2610 h = model.GetProfile();
2613 if (!RDFInternal::HistoUtils<::TProfile2D>::HasAxisLimits(*
h)) {
2614 throw std::runtime_error(
"2D profiles with no axes limits are not supported yet.");
2616 const std::vector<std::string_view> columnViews = {v1Name, v2Name, v3Name};
2620 return CreateAction<RDFInternal::ActionTags::Profile2D, V1, V2, V3>(userColumns,
h,
h,
fProxiedPtr);
2653 std::string_view v3Name, std::string_view wName)
2655 std::shared_ptr<::TProfile2D>
h(
nullptr);
2657 ROOT::Internal::RDF::RIgnoreErrorLevelRAII iel(
kError);
2658 h = model.GetProfile();
2661 if (!RDFInternal::HistoUtils<::TProfile2D>::HasAxisLimits(*
h)) {
2662 throw std::runtime_error(
"2D profiles with no axes limits are not supported yet.");
2664 const std::vector<std::string_view> columnViews = {v1Name, v2Name, v3Name, wName};
2668 return CreateAction<RDFInternal::ActionTags::Profile2D, V1, V2, V3, W>(userColumns,
h,
h,
fProxiedPtr);
2673 template <
typename V1,
typename V2,
typename V3,
typename W>
2676 return Profile2D<V1, V2, V3, W>(model,
"",
"",
"",
"");
2716 auto h = std::make_shared<std::decay_t<T>>(std::forward<T>(model));
2717 if (!RDFInternal::HistoUtils<T>::HasAxisLimits(*
h)) {
2718 throw std::runtime_error(
"The absence of axes limits is not supported yet.");
2739 template <
typename V = RDFDetail::RInferredType>
2743 if (!
value.empty()) {
2744 columns.emplace_back(std::string(
value));
2747 if (std::is_same<V, RDFDetail::RInferredType>::value) {
2750 return Fill<V>(
TStatistic(), validColumnNames);
2771 template <
typename V = RDFDetail::RInferredType,
typename W = RDFDetail::RInferredType>
2775 constexpr auto vIsInferred = std::is_same<V, RDFDetail::RInferredType>::value;
2776 constexpr auto wIsInferred = std::is_same<W, RDFDetail::RInferredType>::value;
2782 if (vIsInferred && wIsInferred) {
2784 }
else if (vIsInferred != wIsInferred) {
2785 std::string error(
"The ");
2786 error += vIsInferred ?
"value " :
"weight ";
2787 error +=
"column type is explicit, while the ";
2788 error += vIsInferred ?
"weight " :
"value ";
2789 error +=
" is specified to be inferred. This case is not supported: please specify both types or none.";
2790 throw std::runtime_error(error);
2792 return Fill<V, W>(
TStatistic(), validColumnNames);
2817 template <
typename T = RDFDetail::RInferredType>
2821 using RetType_t = RDFDetail::MinReturnType_t<T>;
2822 auto minV = std::make_shared<RetType_t>(std::numeric_limits<RetType_t>::max());
2823 return CreateAction<RDFInternal::ActionTags::Min, T>(userColumns, minV, minV,
fProxiedPtr);
2847 template <
typename T = RDFDetail::RInferredType>
2851 using RetType_t = RDFDetail::MaxReturnType_t<T>;
2852 auto maxV = std::make_shared<RetType_t>(std::numeric_limits<RetType_t>::lowest());
2853 return CreateAction<RDFInternal::ActionTags::Max, T>(userColumns, maxV, maxV,
fProxiedPtr);
2878 template <
typename T = RDFDetail::RInferredType>
2882 auto meanV = std::make_shared<double>(0);
2883 return CreateAction<RDFInternal::ActionTags::Mean, T>(userColumns, meanV, meanV,
fProxiedPtr);
2906 template <
typename T = RDFDetail::RInferredType>
2910 auto stdDeviationV = std::make_shared<double>(0);
2911 return CreateAction<RDFInternal::ActionTags::StdDev, T>(userColumns, stdDeviationV, stdDeviationV,
fProxiedPtr);
2942 template <
typename T = RDFDetail::RInferredType>
2946 auto medianV = std::make_shared<double>(0);
2947 return CreateAction<RDFInternal::ActionTags::Median, T>(userColumns, medianV, medianV,
fProxiedPtr);
2973 template <
typename T = RDFDetail::RInferredType>
2975 Sum(std::string_view columnName =
"",
2976 const RDFDetail::SumReturnType_t<T> &initValue = RDFDetail::SumReturnType_t<T>{})
2979 auto sumV = std::make_shared<RDFDetail::SumReturnType_t<T>>(initValue);
2980 return CreateAction<RDFInternal::ActionTags::Sum, T>(userColumns, sumV, sumV,
fProxiedPtr);
3010 bool returnEmptyReport =
false;
3017 returnEmptyReport =
true;
3019 auto rep = std::make_shared<RCutFlowReport>();
3026 return MakeResultPtr(rep, *
fLoopManager, std::move(action));
3055 template <
typename... ColumnTypes>
3059 auto newCols = columnList;
3060 newCols.insert(newCols.begin(),
"rdfentry_");
3061 auto displayer = std::make_shared<RDisplay>(newCols,
GetColumnTypeNamesList(newCols), nMaxCollectionElements);
3062 using displayHelperArgs_t = std::pair<size_t, std::shared_ptr<RDisplay>>;
3065 std::move(newCols), displayer, std::make_shared<displayHelperArgs_t>(nRows, displayer),
fProxiedPtr);
3082 auto newCols = columnList;
3083 newCols.insert(newCols.begin(),
"rdfentry_");
3084 auto displayer = std::make_shared<RDisplay>(newCols,
GetColumnTypeNamesList(newCols), nMaxCollectionElements);
3085 using displayHelperArgs_t = std::pair<size_t, std::shared_ptr<RDisplay>>;
3086 return CreateAction<RDFInternal::ActionTags::Display, RDFDetail::RInferredType>(
3087 std::move(newCols), displayer, std::make_shared<displayHelperArgs_t>(nRows, displayer),
fProxiedPtr,
3088 columnList.size() + 1);
3102 Display(std::string_view columnNameRegexp =
"",
size_t nRows = 5,
size_t nMaxCollectionElements = 10)
3106 return Display(selectedColumns, nRows, nMaxCollectionElements);
3118 Display(std::initializer_list<std::string> columnList,
size_t nRows = 5,
size_t nMaxCollectionElements = 10)
3121 return Display(selectedColumns, nRows, nMaxCollectionElements);
3132 template <
typename... ColumnTypes>
3133 [[deprecated(
"Snapshot is not any more a template. You can safely remove the template parameters.")]]
3226 const auto pairOfColumnLists =
3228 const auto &colListNoAliasesWithSizeBranches = pairOfColumnLists.first;
3229 const auto &colListWithAliasesAndSizeBranches = pairOfColumnLists.second;
3231 const auto fullTreeName = treename;
3233 treename = parsedTreePath.fTreeName;
3234 const auto &dirname = parsedTreePath.fDirName;
3240 auto retrieveTypeID = [](
const std::string &colName,
const std::string &colTypeName,
3241 bool isRNTuple =
false) ->
const std::type_info * {
3244 }
catch (
const std::runtime_error &err) {
3248 if (std::string(err.what()).find(
"Cannot extract type_info of type") != std::string::npos) {
3250 std::string trueTypeName{colTypeName};
3251 if (colTypeName.rfind(
"CLING_UNKNOWN_TYPE", 0) == 0)
3252 trueTypeName = colTypeName.substr(19);
3253 std::string msg{
"No runtime type information is available for column \"" + colName +
3254 "\" with type name \"" + trueTypeName +
3255 "\". Thus, it cannot be written to disk with Snapshot. Make sure to generate and load "
3256 "ROOT dictionaries for the type of this column."};
3258 throw std::runtime_error(msg);
3271 auto newRDF = std::make_shared<RInterface<RLoopManager>>(std::make_shared<RLoopManager>(colListNoPoundSizes));
3273 auto snapHelperArgs = std::make_shared<RDFInternal::SnapshotHelperArgs>(RDFInternal::SnapshotHelperArgs{
3274 std::string(
filename), std::string(dirname), std::string(treename), colListWithAliasesAndSizeBranches,
3275 options, newRDF->GetLoopManager(),
GetLoopManager(),
true ,
false});
3277 auto &&nColumns = colListNoAliasesWithSizeBranches.size();
3281 std::vector<const std::type_info *> colTypeIDs;
3282 colTypeIDs.reserve(nColumns);
3283 for (
decltype(nColumns) i{}; i < nColumns; i++) {
3284 const auto &colName = validColumnNames[i];
3287 const std::type_info *colTypeID = retrieveTypeID(colName, colTypeName,
true);
3288 colTypeIDs.push_back(colTypeID);
3296 resPtr = MakeResultPtr(newRDF, *
GetLoopManager(), std::move(action));
3301 "The default Snapshot output data format is TTree, but the input data format is RNTuple. If you "
3302 "want to Snapshot to RNTuple or suppress this warning, set the appropriate fOutputFormat option in "
3303 "RSnapshotOptions. Note that this current default behaviour might change in the future.");
3308 auto newRDF = std::make_shared<RInterface<RLoopManager>>(
3309 std::make_shared<RLoopManager>(colListNoAliasesWithSizeBranches));
3311 auto snapHelperArgs = std::make_shared<RDFInternal::SnapshotHelperArgs>(RDFInternal::SnapshotHelperArgs{
3312 std::string(
filename), std::string(dirname), std::string(treename), colListWithAliasesAndSizeBranches,
3313 options, newRDF->GetLoopManager(),
GetLoopManager(),
false , options.fIncludeVariations});
3315 auto &&nColumns = colListNoAliasesWithSizeBranches.size();
3319 std::vector<const std::type_info *> colTypeIDs;
3320 colTypeIDs.reserve(nColumns);
3321 for (
decltype(nColumns) i{}; i < nColumns; i++) {
3322 const auto &colName = validColumnNames[i];
3325 const std::type_info *colTypeID = retrieveTypeID(colName, colTypeName);
3326 colTypeIDs.push_back(colTypeID);
3334 resPtr = MakeResultPtr(newRDF, *
GetLoopManager(), std::move(action));
3356 std::string_view columnNameRegexp =
"",
3364 std::copy_if(dsColumns.begin(), dsColumns.end(), std::back_inserter(dsColumnsWithoutSizeColumns),
3365 [](
const std::string &
name) { return name.size() < 13 || name.substr(0, 13) !=
"R_rdf_sizeof_"; });
3367 columnNames.reserve(definedColumns.size() + dsColumnsWithoutSizeColumns.size());
3368 columnNames.insert(columnNames.end(), definedColumns.begin(), definedColumns.end());
3369 columnNames.insert(columnNames.end(), dsColumnsWithoutSizeColumns.begin(), dsColumnsWithoutSizeColumns.end());
3375 std::vector<std::string> selectedColumns;
3379 catch (
const std::runtime_error &
e){
3409 std::initializer_list<std::string> columnList,
3451 template <
typename... ColumnTypes>
3454 auto staticSeq = std::make_index_sequence<
sizeof...(ColumnTypes)>();
3455 return CacheImpl<ColumnTypes...>(columnList, staticSeq);
3468 if (columnList.empty()) {
3469 auto nEntries = *this->
Count();
3474 std::stringstream cacheCall;
3481 cacheCall <<
"*reinterpret_cast<ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager>*>("
3483 <<
") = reinterpret_cast<ROOT::RDF::RInterface<ROOT::Detail::RDF::RNodeBase>*>("
3488 const auto validColumnNames =
3490 const auto colTypes =
3492 for (
const auto &colType : colTypes)
3493 cacheCall << colType <<
", ";
3494 if (!columnListWithoutSizeColumns.empty())
3495 cacheCall.seekp(-2, cacheCall.cur);
3496 cacheCall <<
">(*reinterpret_cast<std::vector<std::string>*>("
3519 std::copy_if(dsColumns.begin(), dsColumns.end(), std::back_inserter(dsColumnsWithoutSizeColumns),
3520 [](
const std::string &
name) { return name.size() < 13 || name.substr(0, 13) !=
"R_rdf_sizeof_"; });
3522 columnNames.reserve(definedColumns.size() + dsColumns.size());
3523 columnNames.insert(columnNames.end(), definedColumns.begin(), definedColumns.end());
3524 columnNames.insert(columnNames.end(), dsColumns.begin(), dsColumns.end());
3526 return Cache(selectedColumns);
3538 return Cache(selectedColumns);
3559 template <
typename F>
3562 using arg_types =
typename TTraits::CallableTraits<
decltype(
f)>::arg_types_nodecay;
3563 using ret_type =
typename TTraits::CallableTraits<
decltype(
f)>::ret_type;
3564 ForeachSlot(RDFInternal::AddSlotParameter<ret_type>(
f, arg_types()), columns);
3589 template <
typename F>
3593 constexpr auto nColumns = ColTypes_t::list_size;
3598 using Helper_t = RDFInternal::ForeachSlotHelper<F>;
3676 template <typename AccFun, typename MergeFun, typename R = typename TTraits::CallableTraits<AccFun>::ret_type,
3677 typename ArgTypes =
typename TTraits::CallableTraits<AccFun>::arg_types,
3678 typename ArgTypesNoDecay =
typename TTraits::CallableTraits<AccFun>::arg_types_nodecay,
3679 typename U = TTraits::TakeFirstParameter_t<ArgTypes>,
3680 typename T = TTraits::TakeFirstParameter_t<TTraits::RemoveFirstParameter_t<ArgTypes>>>
3683 RDFInternal::CheckAggregate<R, MergeFun>(ArgTypesNoDecay());
3689 auto accObjPtr = std::make_shared<U>(aggIdentity);
3690 using Helper_t = RDFInternal::AggregateHelper<AccFun, MergeFun, R, T, U>;
3692 auto action = std::make_unique<Action_t>(
3693 Helper_t(std::move(aggregator), std::move(merger), accObjPtr,
fLoopManager->GetNSlots()), validColumnNames,
3695 return MakeResultPtr(accObjPtr, *
fLoopManager, std::move(action));
3711 template <typename AccFun, typename MergeFun, typename R = typename TTraits::CallableTraits<AccFun>::ret_type,
3712 typename ArgTypes =
typename TTraits::CallableTraits<AccFun>::arg_types,
3713 typename U = TTraits::TakeFirstParameter_t<ArgTypes>,
3714 typename T = TTraits::TakeFirstParameter_t<TTraits::RemoveFirstParameter_t<ArgTypes>>>
3718 std::is_default_constructible<U>::value,
3719 "aggregated object cannot be default-constructed. Please provide an initialisation value (aggIdentity)");
3720 return Aggregate(std::move(aggregator), std::move(merger), columnName, U());
3789 using HelperT = std::decay_t<Helper>;
3792 static_assert(std::is_base_of<AH, HelperT>::value && std::is_convertible<HelperT *, AH *>::value,
3793 "Action helper of type T must publicly inherit from ROOT::Detail::RDF::RActionImpl<T>");
3795 auto hPtr = std::make_shared<HelperT>(std::forward<Helper>(helper));
3796 auto resPtr = hPtr->GetResultPtr();
3798 if (std::is_same<FirstColumn, RDFDetail::RInferredType>::value && columns.empty()) {
3801 return CreateAction<RDFInternal::ActionTags::Book, FirstColumn, OtherColumns...>(columns, resPtr, hPtr,
3837 template <typename F, typename T = typename TTraits::CallableTraits<F>::ret_type>
3841 std::is_default_constructible<T>::value,
3842 "reduce object cannot be default-constructed. Please provide an initialisation value (redIdentity)");
3843 return Reduce(std::move(
f), columnName, T());
3860 template <typename F, typename T = typename TTraits::CallableTraits<F>::ret_type>
3870 template <typename F, typename DefineType, typename RetType = typename TTraits::CallableTraits<F>::ret_type>
3874 if (where.compare(0, 8,
"Redefine") != 0) {
3884 using ArgTypes_t =
typename TTraits::CallableTraits<F>::arg_types;
3886 std::is_same<DefineType, RDFDetail::ExtraArgsForDefine::Slot>::value, ArgTypes_t>
::type;
3888 std::is_same<DefineType, RDFDetail::ExtraArgsForDefine::SlotAndEntry>::value, ColTypesTmp_t>
::type;
3890 constexpr auto nColumns = ColTypes_t::list_size;
3897 if (retTypeName.empty()) {
3901 retTypeName =
"CLING_UNKNOWN_TYPE_" + demangledType;
3905 auto newColumn = std::make_shared<NewCol_t>(
name, retTypeName, std::forward<F>(expression), validColumnNames,
3909 newCols.
AddDefine(std::move(newColumn));
3913 return newInterface;
3919 template <typename F, typename DefineType, typename RetType = typename TTraits::CallableTraits<F>::ret_type,
3920 bool IsFStringConv = std::is_convertible<F, std::string>::value,
3921 bool IsRetTypeDefConstr = std::is_default_constructible<RetType>::value>
3922 std::enable_if_t<!IsFStringConv && !IsRetTypeDefConstr, RInterface<Proxied>>
3925 static_assert(std::is_default_constructible<typename TTraits::CallableTraits<F>::ret_type>
::value,
3926 "Error in `Define`: type returned by expression is not default-constructible");
3932 template <typename F, typename RetType_t = typename TTraits::CallableTraits<F>::ret_type>
3946 if (retTypeName.empty()) {
3950 retTypeName =
"CLING_UNKNOWN_TYPE_" + demangledType;
3954 std::make_shared<RDFDetail::RDefinePerSample<F>>(
name, retTypeName, std::move(expression), *
fLoopManager);
3957 newCols.AddDefine(std::move(newColumn));
3959 return newInterface;
3980 newCols.
AddDefine(std::move(jittedDefine));
3984 return newInterface;
3989 template <
typename... ColTypes, std::size_t... S>
3995 constexpr bool areCopyConstructible =
3996 RDFInternal::TEvalAnd<std::is_copy_constructible<ColTypes>::value...>
::value;
3997 static_assert(areCopyConstructible,
"Columns of a type which is not copy constructible cannot be cached yet.");
4001 auto colHolders = std::make_tuple(Take<ColTypes>(columnListWithoutSizeColumns[S])...);
4002 auto ds = std::make_unique<
RLazyDS<ColTypes...>>(
4003 std::make_pair(columnListWithoutSizeColumns[S], std::get<S>(colHolders))...);
4010 template <
bool IsSingleColumn,
typename F>
4013 const std::vector<std::string> &variationTags, std::string_view variationName)
4015 using F_t = std::decay_t<F>;
4016 using ColTypes_t =
typename TTraits::CallableTraits<F_t>::arg_types;
4017 using RetType =
typename TTraits::CallableTraits<F_t>::ret_type;
4018 constexpr auto nColumns = ColTypes_t::list_size;
4020 SanityChecksForVary<RetType>(colNames, variationTags, variationName);
4026 if (retTypeName.empty()) {
4030 retTypeName =
"CLING_UNKNOWN_TYPE_" + demangledType;
4033 auto variation = std::make_shared<RDFInternal::RVariation<F_t, IsSingleColumn>>(
4038 newCols.AddVariation(std::move(variation));
4042 return newInterface;
4046 const std::vector<std::string> &variationTags, std::string_view variationName,
4047 bool isSingleColumn)
4049 R__ASSERT(!variationTags.empty() &&
"Must have at least one variation.");
4050 R__ASSERT(!colNames.empty() &&
"Must have at least one varied column.");
4051 R__ASSERT(!variationName.empty() &&
"Must provide a variation name.");
4053 for (
auto &colName : colNames) {
4061 if (colNames.size() > 1) {
4062 std::set<std::string> uniqueCols(colNames.begin(), colNames.end());
4063 if (uniqueCols.size() != colNames.size())
4064 throw std::logic_error(
"A column name was passed to the same Vary invocation multiple times.");
4069 auto jittedVariation =
4074 newColRegister.
AddVariation(std::move(jittedVariation));
4078 return newInterface;
4081 template <
typename Helper,
typename ActionResultType>
4083 const std::shared_ptr<Helper> &hPtr,
4087 return CreateAction<RDFInternal::ActionTags::Book>({}, resPtr, hPtr,
fProxiedPtr, 0u);
4090 template <
typename Helper,
typename ActionResultType,
typename... Others>
4091 RResultPtr<ActionResultType>
4093 const std::shared_ptr<Helper>& ,
4096 throw std::logic_error(std::string(
"An action was booked with no input columns, but the action requires "
4097 "columns! The action helper type was ") +
4098 typeid(Helper).
name());
Basic types used by ROOT and required by TInterpreter.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
long long Long64_t
Portable signed long integer 8 bytes.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Base class for action helpers, see RInterface::Book() for more information.
implementation of FilterAvailable and FilterMissing operations
The head node of a RDF computation graph.
A histogram data structure to bin data along multiple dimensions.
A histogram for aggregation of data along multiple dimensions.
Helper class that provides the operation graph nodes.
A RDataFrame node that produces a result.
A binder for user-defined columns, variations and aliases.
std::vector< std::string_view > GenerateColumnNames() const
Return the list of the names of the defined columns (Defines + Aliases).
void AddVariation(std::shared_ptr< RVariationBase > variation)
Register a new systematic variation.
void AddDefine(std::shared_ptr< RDFDetail::RDefineBase > column)
Add a new defined column.
RDFDetail::RDefineBase * GetDefine(std::string_view colName) const
Return the RDefine for the requested column name, or nullptr.
The dataset specification for RDataFrame.
virtual const std::vector< std::string > & GetColumnNames() const =0
Returns a reference to the collection of the dataset's column names.
The base public interface to the RDataFrame federation of classes.
std::string GetColumnType(std::string_view column)
Return the type of a given column as a string.
ColumnNames_t GetValidatedColumnNames(const unsigned int nColumns, const ColumnNames_t &columns)
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.
RResultPtr< ActionResultType > CreateAction(const ColumnNames_t &columns, const std::shared_ptr< ActionResultType > &r, const std::shared_ptr< HelperArgType > &helperArg, const std::shared_ptr< RDFNode > &proxiedPtr, const int=-1)
Create RAction object, return RResultPtr for the action Overload for the case in which all column typ...
RDataSource * GetDataSource() const
void CheckAndFillDSColumns(ColumnNames_t validCols, TTraits::TypeList< ColumnTypes... > typeList)
void CheckIMTDisabled(std::string_view callerName)
ColumnNames_t GetColumnNames()
Returns the names of the available columns.
RDFDetail::RLoopManager * GetLoopManager() const
RDFInternal::RColumnRegister fColRegister
Contains the columns defined up to this node.
The public interface to the RDataFrame federation of classes.
RResultPtr< RDisplay > Display(const ColumnNames_t &columnList, size_t nRows=5, size_t nMaxCollectionElements=10)
Provides a representation of the columns in the dataset.
RResultPtr<::TProfile > Profile1D(const TProfile1DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view wName)
Fill and return a one-dimensional profile (lazy action).
RResultPtr<::THnD > HistoND(const THnDModel &model, const ColumnNames_t &columnList, std::string_view wName="")
Fill and return an N-dimensional histogram (lazy action).
RResultPtr<::TGraph > Graph(std::string_view x="", std::string_view y="")
Fill and return a TGraph object (lazy action).
RInterface< Proxied > Vary(std::string_view colName, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName="")
Register systematic variations for a single existing column using custom variation tags.
RInterface< Proxied > Vary(const std::vector< std::string > &colNames, std::string_view expression, std::size_t nVariations, std::string_view variationName)
Register systematic variations for multiple existing columns using auto-generated variation tags.
RResultPtr< ROOT::Experimental::RHist< BinContentType > > Hist(std::uint64_t nNormalBins, std::pair< double, double > interval, std::string_view vName, std::string_view wName)
Fill and return a one-dimensional RHist with weights (lazy action).
RInterface(const RInterface &)=default
Copy-ctor for RInterface.
RResultPtr< RDFDetail::MaxReturnType_t< T > > Max(std::string_view columnName="")
Return the maximum of processed column values (lazy action).
auto CallCreateActionWithoutColsIfPossible(const std::shared_ptr< ActionResultType > &resPtr, const std::shared_ptr< Helper > &hPtr, TTraits::TypeList< RDFDetail::RInferredType >) -> decltype(hPtr->Exec(0u), RResultPtr< ActionResultType >{})
RInterface(RInterface &&)=default
Move-ctor for RInterface.
RInterface< Proxied > Vary(std::string_view colName, std::string_view expression, const std::vector< std::string > &variationTags, std::string_view variationName="")
Register systematic variations for a single existing column using custom variation tags.
RInterface< RDFDetail::RFilter< F, Proxied > > Filter(F f, const std::initializer_list< std::string > &columns)
Append a filter to the call graph.
RInterface< RLoopManager > Cache(std::initializer_list< std::string > columnList)
Save selected columns in memory.
RInterface< Proxied > Vary(std::string_view colName, F &&expression, const ColumnNames_t &inputColumns, std::size_t nVariations, std::string_view variationName="")
Register systematic variations for a single existing column using auto-generated variation tags.
RInterface< Proxied > Vary(std::initializer_list< std::string > colNames, std::string_view expression, std::size_t nVariations, std::string_view variationName)
Register systematic variations for multiple existing columns using auto-generated variation tags.
RResultPtr< RInterface< RLoopManager > > Snapshot(std::string_view treename, std::string_view filename, const ColumnNames_t &columnList, const RSnapshotOptions &options=RSnapshotOptions())
RResultPtr<::TProfile2D > Profile2D(const TProfile2DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view v3Name, std::string_view wName)
Fill and return a two-dimensional profile (lazy action).
RResultPtr< RInterface< RLoopManager > > Snapshot(std::string_view treename, std::string_view filename, std::string_view columnNameRegexp="", const RSnapshotOptions &options=RSnapshotOptions())
Save selected columns to disk, in a new TTree or RNTuple treename in file filename.
RResultPtr< RDisplay > Display(const ColumnNames_t &columnList, size_t nRows=5, size_t nMaxCollectionElements=10)
Provides a representation of the columns in the dataset.
RResultPtr< RDisplay > Display(std::initializer_list< std::string > columnList, size_t nRows=5, size_t nMaxCollectionElements=10)
Provides a representation of the columns in the dataset.
RInterface(const std::shared_ptr< RLoopManager > &proxied)
Build a RInterface from a RLoopManager.
RResultPtr<::THnSparseD > HistoNSparseD(const THnSparseDModel &model, const ColumnNames_t &columnList, std::string_view wName="")
Fill and return a sparse N-dimensional histogram (lazy action).
RInterface< Proxied > Redefine(std::string_view name, F expression, const ColumnNames_t &columns={})
Overwrite the value and/or type of an existing column.
std::shared_ptr< Proxied > fProxiedPtr
Smart pointer to the graph node encapsulated by this RInterface.
RInterface< Proxied > Vary(const std::vector< std::string > &colNames, std::string_view expression, const std::vector< std::string > &variationTags, std::string_view variationName)
Register systematic variations for multiple existing columns using custom variation tags.
RInterface< Proxied > Vary(std::string_view colName, std::string_view expression, std::size_t nVariations, std::string_view variationName="")
Register systematic variations for a single existing column using auto-generated variation tags.
RResultPtr<::TH1D > Histo1D(std::string_view vName)
Fill and return a one-dimensional histogram with the values of a column (lazy action).
RInterface< RDFDetail::RRange< Proxied > > Range(unsigned int begin, unsigned int end, unsigned int stride=1)
Creates a node that filters entries based on range: [begin, end).
RInterface< Proxied > DefinePerSampleImpl(std::string_view name, F expression, bool redefine)
Implementation of DefinePerSample and RedefinePerSample (non-jitted).
RResultPtr< typename std::decay_t< Helper >::Result_t > Book(Helper &&helper, const ColumnNames_t &columns={})
Book execution of a custom action using a user-defined helper object.
RResultPtr< ROOT::Experimental::RHist< BinContentType > > Hist(std::vector< ROOT::Experimental::RAxisVariant > axes, const ColumnNames_t &columnList)
Fill and return an RHist (lazy action).
RResultPtr<::TProfile > Profile1D(const TProfile1DModel &model, std::string_view v1Name="", std::string_view v2Name="")
Fill and return a one-dimensional profile (lazy action).
const std::shared_ptr< Proxied > & GetProxiedPtr() const
RResultPtr<::TH1D > Histo1D(const TH1DModel &model={"", "", 128u, 0., 0.})
Fill and return a one-dimensional histogram with the weighted values of a column (lazy action).
RResultPtr< T > Reduce(F f, std::string_view columnName="")
Execute a user-defined reduce operation on the values of a column.
RResultPtr< double > Median(std::string_view columnName="")
Return the median value of the input column (lazy action).
RResultPtr< T > Reduce(F f, std::string_view columnName, const T &redIdentity)
Execute a user-defined reduce operation on the values of a column.
RInterface< Proxied > Vary(const std::vector< std::string > &colNames, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName)
Register systematic variations for multiple existing columns using custom variation tags.
RInterface< RLoopManager > Cache(const ColumnNames_t &columnList)
Save selected columns in memory.
RResultPtr<::TH1D > Histo1D(const TH1DModel &model, std::string_view vName, std::string_view wName)
Fill and return a one-dimensional histogram with the weighted values of a column (lazy action).
RResultPtr< RDisplay > Display(std::string_view columnNameRegexp="", size_t nRows=5, size_t nMaxCollectionElements=10)
Provides a representation of the columns in the dataset.
RInterface & operator=(const RInterface &)=default
Copy-assignment operator for RInterface.
RInterface< Proxied > VaryImpl(const std::vector< std::string > &colNames, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName)
RResultPtr<::THnSparseD > HistoNSparseD(const THnSparseDModel &model, const ColumnNames_t &columnList, std::string_view wName="")
Fill and return a sparse N-dimensional histogram (lazy action).
RInterface< Proxied > Define(std::string_view name, std::string_view expression)
Define a new column.
RInterface< RDFDetail::RFilterWithMissingValues< Proxied > > FilterAvailable(std::string_view column)
Discard entries with missing values.
std::enable_if_t<!IsFStringConv &&!IsRetTypeDefConstr, RInterface< Proxied > > DefineImpl(std::string_view, F, const ColumnNames_t &, const std::string &)
RInterface< Proxied > Redefine(std::string_view name, std::string_view expression)
Overwrite the value and/or type of an existing column.
std::vector< std::string > GetFilterNames()
Returns the names of the filters created.
RInterface< RLoopManager > Cache(std::string_view columnNameRegexp="")
Save selected columns in memory.
RResultPtr<::TH1D > Histo1D(const TH1DModel &model={"", "", 128u, 0., 0.}, std::string_view vName="")
Fill and return a one-dimensional histogram with the values of a column (lazy action).
RInterface< Proxied > Vary(std::initializer_list< std::string > colNames, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName)
Register systematic variations for multiple existing columns using custom variation tags.
RResultPtr<::TH3D > Histo3D(const TH3DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view v3Name, std::string_view wName)
Fill and return a three-dimensional histogram (lazy action).
RInterface< Proxied > DefinePerSampleJitImpl(std::string_view name, std::string_view expression, bool redefine)
Implementation of DefinePerSample and RedefinePerSample (jitted).
void LoadValuesCustom(const ColumnNames_t &columnList, const std::vector< std::size_t > &vecSizes, float vecPadding, ROOT::RVecF &dest)
friend class RDFInternal::GraphDrawing::GraphCreatorHelper
RResultPtr< ROOT::Experimental::RHistEngine< BinContentType > > Hist(std::shared_ptr< ROOT::Experimental::RHistEngine< BinContentType > > h, const ColumnNames_t &columnList)
Fill the provided RHistEngine (lazy action).
RInterface< RLoopManager > CacheImpl(const ColumnNames_t &columnList, std::index_sequence< S... >)
Implementation of cache.
RResultPtr<::TProfile2D > Profile2D(const TProfile2DModel &model, std::string_view v1Name="", std::string_view v2Name="", std::string_view v3Name="")
Fill and return a two-dimensional profile (lazy action).
RInterface< RDFDetail::RFilter< F, Proxied > > Filter(F f, std::string_view name)
Append a filter to the call graph.
RResultPtr< U > Aggregate(AccFun aggregator, MergeFun merger, std::string_view columnName="")
Execute a user-defined accumulation operation on the processed column values in each processing slot.
RInterface< Proxied > RedefinePerSample(std::string_view name, std::string_view expression)
Redefine an existing column that is updated when the input sample changes.
std::enable_if_t< std::is_default_constructible< RetType >::value, RInterface< Proxied > > DefineImpl(std::string_view name, F &&expression, const ColumnNames_t &columns, const std::string &where)
RResultPtr< ROOT::Experimental::RHist< BinContentType > > Hist(std::shared_ptr< ROOT::Experimental::RHist< BinContentType > > h, const ColumnNames_t &columnList)
Fill the provided RHist (lazy action).
RInterface(const std::shared_ptr< Proxied > &proxied, RLoopManager &lm, const RDFInternal::RColumnRegister &colRegister)
RResultPtr< COLL > Take(std::string_view column="")
Return a collection of values of a column (lazy action, returns a std::vector by default).
RInterface< Proxied > Alias(std::string_view alias, std::string_view columnName)
Allow to refer to a column with a different name.
RResultPtr< RDFDetail::MinReturnType_t< T > > Min(std::string_view columnName="")
Return the minimum of processed column values (lazy action).
RResultPtr< RInterface< RLoopManager > > Snapshot(std::string_view treename, std::string_view filename, const ColumnNames_t &columnList, const RSnapshotOptions &options=RSnapshotOptions())
Save selected columns to disk, in a new TTree or RNTuple treename in file filename.
RResultPtr< ROOT::Experimental::RHistEngine< BinContentType > > Hist(std::shared_ptr< ROOT::Experimental::RHistEngine< BinContentType > > h, const ColumnNames_t &columnList, std::string_view wName)
Fill the provided RHistEngine with weights (lazy action).
RResultPtr< RCutFlowReport > Report()
Gather filtering statistics.
RResultPtr<::TH3D > Histo3D(const TH3DModel &model)
RResultPtr<::TH3D > Histo3D(const TH3DModel &model, std::string_view v1Name="", std::string_view v2Name="", std::string_view v3Name="")
Fill and return a three-dimensional histogram (lazy action).
RResultPtr<::TH1D > Histo1D(std::string_view vName, std::string_view wName)
Fill and return a one-dimensional histogram with the weighted values of a column (lazy action).
RInterface< Proxied > DefinePerSample(std::string_view name, std::string_view expression)
Define a new column that is updated when the input sample changes.
RInterface< Proxied > DefineSlotEntry(std::string_view name, F expression, const ColumnNames_t &columns={})
Define a new column with a value dependent on the processing slot and the current entry.
RResultPtr< std::decay_t< T > > Fill(T &&model, const ColumnNames_t &columnList)
Return an object of type T on which T::Fill will be called once per event (lazy action).
RInterface< Proxied > DefineSlot(std::string_view name, F expression, const ColumnNames_t &columns={})
Define a new column with a value dependent on the processing slot.
RInterface< RDFDetail::RFilterWithMissingValues< Proxied > > FilterMissing(std::string_view column)
Keep only the entries that have missing values.
RResultPtr< TStatistic > Stats(std::string_view value="")
Return a TStatistic object, filled once per event (lazy action).
RInterface< Proxied > JittedVaryImpl(const std::vector< std::string > &colNames, std::string_view expression, const std::vector< std::string > &variationTags, std::string_view variationName, bool isSingleColumn)
RInterface< Proxied > DefaultValueFor(std::string_view column, const T &defaultValue)
In case the value in the given column is missing, provide a default value.
RResultPtr< TStatistic > Stats(std::string_view value, std::string_view weight)
Return a TStatistic object, filled once per event (lazy action).
RResultPtr<::TProfile2D > Profile2D(const TProfile2DModel &model)
Fill and return a two-dimensional profile (lazy action).
RInterface< Proxied > RedefineSlot(std::string_view name, F expression, const ColumnNames_t &columns={})
Overwrite the value and/or type of an existing column.
void Foreach(F f, const ColumnNames_t &columns={})
Execute a user-defined function on each entry (instant action).
RResultPtr<::TH2D > Histo2D(const TH2DModel &model, std::string_view v1Name="", std::string_view v2Name="")
Fill and return a two-dimensional histogram (lazy action).
RResultPtr< ActionResultType > CallCreateActionWithoutColsIfPossible(const std::shared_ptr< ActionResultType > &, const std::shared_ptr< Helper > &, Others...)
RInterface< Proxied > Define(std::string_view name, F expression, const ColumnNames_t &columns={})
Define a new column.
void ForeachSlot(F f, const ColumnNames_t &columns={})
Execute a user-defined function requiring a processing slot index on each entry (instant action).
RResultPtr<::TGraphAsymmErrors > GraphAsymmErrors(std::string_view x="", std::string_view y="", std::string_view exl="", std::string_view exh="", std::string_view eyl="", std::string_view eyh="")
Fill and return a TGraphAsymmErrors object (lazy action).
RResultPtr< U > Aggregate(AccFun aggregator, MergeFun merger, std::string_view columnName, const U &aggIdentity)
Execute a user-defined accumulation operation on the processed column values in each processing slot.
RResultPtr< ROOT::Experimental::RHist< BinContentType > > Hist(std::shared_ptr< ROOT::Experimental::RHist< BinContentType > > h, const ColumnNames_t &columnList, std::string_view wName)
Fill the provided RHist with weights (lazy action).
RResultPtr<::TProfile > Profile1D(const TProfile1DModel &model)
Fill and return a one-dimensional profile (lazy action).
RResultPtr< RInterface< RLoopManager > > Snapshot(std::string_view treename, std::string_view filename, std::initializer_list< std::string > columnList, const RSnapshotOptions &options=RSnapshotOptions())
Save selected columns to disk, in a new TTree or RNTuple treename in file filename.
RInterface & operator=(RInterface &&)=default
Move-assignment operator for RInterface.
RResultPtr<::TH2D > Histo2D(const TH2DModel &model)
RResultPtr< double > Mean(std::string_view columnName="")
Return the mean of processed column values (lazy action).
RInterface< RDFDetail::RFilter< F, Proxied > > Filter(F f, const ColumnNames_t &columns={}, std::string_view name="")
Append a filter to the call graph.
RInterface< RLoopManager > Cache(const ColumnNames_t &columnList)
Save selected columns in memory.
RInterface< Proxied > DefinePerSample(std::string_view name, F expression)
Define a new column that is updated when the input sample changes.
RInterface< Proxied > Vary(std::initializer_list< std::string > colNames, F &&expression, const ColumnNames_t &inputColumns, std::size_t nVariations, std::string_view variationName)
Register systematic variations for for multiple existing columns using custom variation tags.
RInterface< RDFDetail::RRange< Proxied > > Range(unsigned int end)
Creates a node that filters entries based on range.
RInterface< Proxied > RedefineSlotEntry(std::string_view name, F expression, const ColumnNames_t &columns={})
Overwrite the value and/or type of an existing column.
RInterface< RDFDetail::RJittedFilter > Filter(std::string_view expression, std::string_view name="")
Append a filter to the call graph.
RResultPtr< ROOT::Experimental::RHist< BinContentType > > Hist(std::uint64_t nNormalBins, std::pair< double, double > interval, std::string_view vName)
Fill and return a one-dimensional RHist (lazy action).
RResultPtr< ROOT::Experimental::RHist< BinContentType > > Hist(std::vector< ROOT::Experimental::RAxisVariant > axes, const ColumnNames_t &columnList, std::string_view wName)
Fill and return an RHist with weights (lazy action).
RResultPtr< ULong64_t > Count()
Return the number of entries processed (lazy action).
RInterface< Proxied > RedefinePerSample(std::string_view name, F expression)
Redefine an existing column that is updated when the input sample changes.
RResultPtr<::TH2D > Histo2D(const TH2DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view wName)
Fill and return a weighted two-dimensional histogram (lazy action).
RInterface< Proxied > Vary(const std::vector< std::string > &colNames, F &&expression, const ColumnNames_t &inputColumns, std::size_t nVariations, std::string_view variationName)
Register systematic variations for multiple existing columns using auto-generated tags.
RResultPtr<::THnD > HistoND(const THnDModel &model, const ColumnNames_t &columnList, std::string_view wName="")
Fill and return an N-dimensional histogram (lazy action).
RResultPtr< double > StdDev(std::string_view columnName="")
Return the unbiased standard deviation of processed column values (lazy action).
RResultPtr< RDFDetail::SumReturnType_t< T > > Sum(std::string_view columnName="", const RDFDetail::SumReturnType_t< T > &initValue=RDFDetail::SumReturnType_t< T >{})
Return the sum of processed column values (lazy action).
A RDataSource implementation which is built on top of result proxies.
Smart pointer for the return type of actions.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
typename RemoveFirstParameter< T >::type RemoveFirstParameter_t
TDirectory::TContext keeps track and restore the current directory.
A TGraph is an object made of two arrays X and Y with npoints each.
Statistical variable, defined by its mean and variance (RMS).
void CheckForNoVariations(const std::string &where, std::string_view definedColView, const RColumnRegister &colRegister)
Throw if the column has systematic variations attached.
ParsedTreePath ParseTreePath(std::string_view fullTreeName)
const std::type_info & TypeName2TypeID(const std::string &name)
Return the type_info associated to a name.
void ChangeEmptyEntryRange(const ROOT::RDF::RNode &node, std::pair< ULong64_t, ULong64_t > &&newRange)
std::shared_ptr< RJittedDefine > BookDefinePerSampleJit(std::string_view name, std::string_view expression, RLoopManager &lm, const RColumnRegister &colRegister)
Book the jitting of a DefinePerSample call.
void CheckValidCppVarName(std::string_view var, const std::string &where)
void ChangeSpec(const ROOT::RDF::RNode &node, ROOT::RDF::Experimental::RDatasetSpec &&spec)
Changes the input dataset specification of an RDataFrame.
const std::vector< std::string > & GetTopLevelFieldNames(const ROOT::RDF::RDataSource &ds)
void RemoveDuplicates(ColumnNames_t &columnNames)
std::shared_ptr< RNodeBase > UpcastNode(std::shared_ptr< RNodeBase > ptr)
std::string TypeID2TypeName(const std::type_info &id)
Returns the name of a type starting from its type_info An empty string is returned in case of failure...
void CheckSnapshotOptionsFormatCompatibility(const ROOT::RDF::RSnapshotOptions &opts)
void CheckForDefinition(const std::string &where, std::string_view definedColView, const RColumnRegister &colRegister, const ColumnNames_t &dataSourceColumns)
Throw if column definedColView is not already there.
std::vector< std::string > GetFilterNames(const std::shared_ptr< RLoopManager > &loopManager)
std::string GetDataSourceLabel(const ROOT::RDF::RNode &node)
std::string PrettyPrintAddr(const void *const addr)
std::shared_ptr< RDFDetail::RJittedFilter > BookFilterJit(std::shared_ptr< RDFDetail::RNodeBase > prevNode, std::string_view name, std::string_view expression, const RColumnRegister &colRegister, TTree *tree, RDataSource *ds)
Book the jitting of a Filter call.
void TriggerRun(ROOT::RDF::RNode node)
Trigger the execution of an RDataFrame computation graph.
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::pair< std::vector< std::string >, std::vector< std::string > > AddSizeBranches(ROOT::RDF::RDataSource *ds, std::vector< std::string > &&colsWithoutAliases, std::vector< std::string > &&colsWithAliases)
Return copies of colsWithoutAliases and colsWithAliases with size branches for variable-sized array b...
void LoadCustomValues(ROOT::RDF::RNode &node, const std::vector< std::string > &cols, const std::vector< std::size_t > &vecSizes, float vecPadding, ROOT::RVecF &dest)
std::string ColumnName2ColumnTypeName(const std::string &colName, TTree *, RDataSource *, RDefineBase *, bool vector2RVec=true)
Return a string containing the type of the given branch.
void SetTTreeLifeline(ROOT::RDF::RNode &node, std::any lifeline)
void RemoveRNTupleSubfields(ColumnNames_t &columnNames)
std::vector< std::pair< std::uint64_t, std::uint64_t > > GetDatasetGlobalClusterBoundaries(const RNode &node)
Retrieve the cluster boundaries for each cluster in the dataset, across files, with a global offset.
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.
void WarnHist()
Warn once about experimental filling of RHist.
void CheckForDuplicateSnapshotColumns(const ColumnNames_t &cols)
ColumnNames_t ConvertRegexToColumns(const ColumnNames_t &colNames, std::string_view columnNameRegexp, std::string_view callerName)
void CheckForRedefinition(const std::string &where, std::string_view definedColView, const RColumnRegister &colRegister, const ColumnNames_t &dataSourceColumns)
Throw if column definedColView is already there.
std::shared_ptr< RJittedDefine > BookDefineJit(std::string_view name, std::string_view expression, RLoopManager &lm, RDataSource *ds, const RColumnRegister &colRegister)
Book the jitting of a Define call.
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, bool isSingleColumn, const std::string &varyColType)
Book the jitting of a Vary call.
void ChangeBeginAndEndEntries(const RNode &node, Long64_t begin, Long64_t end)
RInterface<::ROOT::Detail::RDF::RNodeBase > RNode
std::vector< std::string > ColumnNames_t
ROOT type_traits extensions.
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
void DisableImplicitMT()
Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
A special bin content type to compute the bin error in weighted filling.
type is TypeList if MustRemove is false, otherwise it is a TypeList with the first type removed
Tag to let data sources use the native data type when creating a column reader.
A collection of options to steer the creation of the dataset on disk through Snapshot().
A struct which stores some basic parameters of a TH1D.
A struct which stores some basic parameters of a TH2D.
A struct which stores some basic parameters of a TH3D.
A struct which stores some basic parameters of a THnD.
A struct which stores some basic parameters of a THnSparseD.
A struct which stores some basic parameters of a TProfile.
A struct which stores some basic parameters of a TProfile2D.
Lightweight storage for a collection of types.