11#ifndef ROOT_RDF_COLUMNREADERUTILS
12#define ROOT_RDF_COLUMNREADERUTILS
40std::unique_ptr<RDFDetail::RColumnReaderBase>
42 const std::vector<void *> *DSValuePtrsPtr,
const std::string &colName)
44 using Ret_t = std::unique_ptr<RDFDetail::RColumnReaderBase>;
46 if (define !=
nullptr)
49 if (DSValuePtrsPtr !=
nullptr) {
51 auto &DSValuePtrs = *DSValuePtrsPtr;
57 return ds->GetColumnReaders(slot, colName,
typeid(T));
65std::unique_ptr<RDFDetail::RColumnReaderBase>
67 const std::map<std::string, std::vector<void *>> &DSValuePtrsMap,
TTreeReader *
r,
70 const auto DSValuePtrsIt = DSValuePtrsMap.find(colName);
71 const std::vector<void *> *DSValuePtrsPtr = DSValuePtrsIt != DSValuePtrsMap.end() ? &DSValuePtrsIt->second :
nullptr;
72 R__ASSERT(define !=
nullptr ||
r !=
nullptr || DSValuePtrsPtr !=
nullptr || ds !=
nullptr);
73 return MakeColumnReader<T>(slot, define,
r, ds, DSValuePtrsPtr, colName);
91template <
typename... ColTypes>
92std::array<std::unique_ptr<RDFDetail::RColumnReaderBase>,
sizeof...(ColTypes)>
102 const auto &customColMap = customCols.GetColumns();
105 std::array<std::unique_ptr<RDFDetail::RColumnReaderBase>,
sizeof...(ColTypes)> ret{
106 {{(++i, MakeColumnReadersHelper<ColTypes>(slot, isDefine[i] ? customColMap.at(colNames[i]).get() :
nullptr,
107 DSValuePtrsMap,
r, ds, colNames[i]))}...}};
typedef void((*Func_t)())
Encapsulates the columns defined by the user.
Column reader type that deals with values read from RDataSources.
Column reader for defined (aka custom) columns.
RTreeColumnReader specialization for TTree values read via TTreeReaderValues.
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
std::array< std::unique_ptr< RDFDetail::RColumnReaderBase >, sizeof...(ColTypes)> MakeColumnReaders(unsigned int slot, TTreeReader *r, TypeList< ColTypes... >, const RColumnReadersInfo &colInfo)
Create a group of column readers, one per type in the parameter pack.
std::unique_ptr< RDFDetail::RColumnReaderBase > MakeColumnReader(unsigned int slot, RDFDetail::RDefineBase *define, TTreeReader *r, ROOT::RDF::RDataSource *ds, const std::vector< void * > *DSValuePtrsPtr, const std::string &colName)
std::unique_ptr< RDFDetail::RColumnReaderBase > MakeColumnReadersHelper(unsigned int slot, RDFDetail::RDefineBase *define, const std::map< std::string, std::vector< void * > > &DSValuePtrsMap, TTreeReader *r, ROOT::RDF::RDataSource *ds, const std::string &colName)
ROOT type_traits extensions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
This type aggregates some of the arguments passed to InitColumnReaders.
const std::map< std::string, std::vector< void * > > & fDSValuePtrsMap
ROOT::RDF::RDataSource * fDataSource
const RBookedDefines & fCustomCols
const std::vector< std::string > & fColNames
Lightweight storage for a collection of types.