11#ifndef ROOT_RDF_COLUMNREADERUTILS
12#define ROOT_RDF_COLUMNREADERUTILS
44std::shared_ptr<RDFDetail::RColumnReaderBase>
48 using Ret_t = std::shared_ptr<RDFDetail::RColumnReaderBase>;
52 if (variation !=
nullptr)
53 return Ret_t{
new RVariationReader(slot, colName, variationName, *variation,
typeid(
T))};
56 if (define !=
nullptr) {
65 if (datasetColReader !=
nullptr)
66 return datasetColReader;
68 assert(
r !=
nullptr &&
"We could not find a reader for this column, this should never happen at this point.");
71 auto treeColReader = std::make_unique<RTreeColumnReader<T>>(*
r, colName);
87template <
typename... ColTypes>
88std::array<std::shared_ptr<RDFDetail::RColumnReaderBase>,
sizeof...(ColTypes)>
90 const std::string &variationName =
"nominal")
98 std::array<
bool,
sizeof...(ColTypes)> doesVariationApply;
99 if (variationName ==
"nominal")
100 doesVariationApply.fill(
false);
102 for (
auto i = 0u; i <
sizeof...(ColTypes); ++i)
103 doesVariationApply[i] =
IsStrInVec(variationName, colRegister.GetVariationsFor(colNames[i]));
107 std::array<std::shared_ptr<RDFDetail::RColumnReaderBase>,
sizeof...(ColTypes)> ret{
108 {{(++i, MakeColumnReader<ColTypes>(slot, colRegister.GetDefine(colNames[i]), lm,
r, colNames[i],
109 doesVariationApply[i] ? &colRegister.FindVariation(colNames[i], variationName)
111 variationName))}...}};
116inline std::array<std::shared_ptr<RDFDetail::RColumnReaderBase>, 0>
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 r
const std::vector< std::string > & GetVariations() const
virtual RDefineBase & GetVariedDefine(const std::string &variationName)=0
Return a clone of this Define that works with values in the variationName "universe".
The head node of a RDF computation graph.
std::shared_ptr< RColumnReaderBase > AddTreeColumnReader(unsigned int slot, const std::string &col, std::unique_ptr< RColumnReaderBase > &&reader, const std::type_info &ti)
Register a new RTreeColumnReader with this RLoopManager.
std::shared_ptr< RColumnReaderBase > GetDatasetColumnReader(unsigned int slot, const std::string &col, const std::type_info &ti) const
A binder for user-defined columns and aliases.
Column reader for defined (aka custom) columns.
This type includes all parts of RVariation that do not depend on the callable signature.
Column reader that reads the value for a specific column, variation and slot.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
std::array< std::shared_ptr< RDFDetail::RColumnReaderBase >, sizeof...(ColTypes)> MakeColumnReaders(unsigned int slot, TTreeReader *r, TypeList< ColTypes... >, const RColumnReadersInfo &colInfo, const std::string &variationName="nominal")
Create a group of column readers, one per type in the parameter pack.
bool IsStrInVec(const std::string &str, const std::vector< std::string > &vec)
std::shared_ptr< RDFDetail::RColumnReaderBase > MakeColumnReader(unsigned int slot, RDefineBase *define, RLoopManager &lm, TTreeReader *r, const std::string &colName, RVariationBase *variation, const std::string &variationName)
ROOT type_traits extensions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
This type aggregates some of the arguments passed to MakeColumnReaders.
RLoopManager & fLoopManager
const RColumnRegister & fColRegister
const std::vector< std::string > & fColNames
Lightweight storage for a collection of types.