File indexing completed on 2025-09-16 09:08:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RDF_COLUMNREADERUTILS
0012 #define ROOT_RDF_COLUMNREADERUTILS
0013
0014 #include "RColumnReaderBase.hxx"
0015 #include "RColumnRegister.hxx"
0016 #include "RDefineBase.hxx"
0017 #include "RDefineReader.hxx"
0018 #include "RDSColumnReader.hxx"
0019 #include "RLoopManager.hxx"
0020 #include "RVariationBase.hxx"
0021 #include "RVariationReader.hxx"
0022
0023 #include <ROOT/RDataSource.hxx>
0024 #include <ROOT/TypeTraits.hxx>
0025
0026 #include <array>
0027 #include <cassert>
0028 #include <map>
0029 #include <memory>
0030 #include <string>
0031 #include <typeinfo> // for typeid
0032 #include <vector>
0033
0034 class TTreeReader;
0035
0036 namespace ROOT {
0037 namespace Internal {
0038 namespace RDF {
0039
0040 using namespace ROOT::TypeTraits;
0041 namespace RDFDetail = ROOT::Detail::RDF;
0042
0043 RDFDetail::RColumnReaderBase *GetColumnReader(unsigned int slot, RColumnReaderBase *defineOrVariationReader,
0044 RLoopManager &lm, TTreeReader *treeReader, std::string_view colName,
0045 const std::type_info &ti);
0046
0047
0048
0049
0050
0051 struct RColumnReadersInfo {
0052 const std::vector<std::string> &fColNames;
0053 RColumnRegister &fColRegister;
0054 const bool *fIsDefine;
0055 RLoopManager &fLoopManager;
0056 };
0057
0058
0059 template <typename... ColTypes>
0060 std::array<RDFDetail::RColumnReaderBase *, sizeof...(ColTypes)>
0061 GetColumnReaders(unsigned int slot, TTreeReader *treeReader, TypeList<ColTypes...>, const RColumnReadersInfo &colInfo,
0062 const std::string &variationName = "nominal")
0063 {
0064
0065 const auto &colNames = colInfo.fColNames;
0066 auto &lm = colInfo.fLoopManager;
0067 auto &colRegister = colInfo.fColRegister;
0068
0069 int i = -1;
0070
0071 std::array<RDFDetail::RColumnReaderBase *, sizeof...(ColTypes)> ret{
0072 (++i, GetColumnReader(slot, colRegister.GetReader(slot, colNames[i], variationName, typeid(ColTypes)), lm,
0073 treeReader, colNames[i], typeid(ColTypes)))...};
0074 return ret;
0075 }
0076
0077
0078 inline std::array<RDFDetail::RColumnReaderBase *, 0>
0079 GetColumnReaders(unsigned int, TTreeReader *, TypeList<>, const RColumnReadersInfo &, const std::string & = "nominal")
0080 {
0081 return {};
0082 }
0083
0084 }
0085 }
0086 }
0087
0088 #endif