File indexing completed on 2025-01-30 10:22:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RROOTTDS
0012 #define ROOT_RROOTTDS
0013
0014 #include "ROOT/RDataFrame.hxx"
0015 #include "ROOT/RDataSource.hxx"
0016 #include <TChain.h>
0017
0018 #include <memory>
0019
0020 namespace ROOT {
0021
0022 namespace Internal {
0023
0024 namespace RDF {
0025
0026
0027
0028 class RRootDS final : public ROOT::RDF::RDataSource {
0029 private:
0030 unsigned int fNSlots = 0U;
0031 std::string fTreeName;
0032 std::string fFileNameGlob;
0033 mutable TChain fModelChain;
0034 std::vector<double *> fAddressesToFree;
0035 std::vector<std::string> fListOfBranches;
0036 std::vector<std::pair<ULong64_t, ULong64_t>> fEntryRanges;
0037 std::vector<std::vector<void *>> fBranchAddresses;
0038 std::vector<std::unique_ptr<TChain>> fChains;
0039
0040 std::vector<void *> GetColumnReadersImpl(std::string_view, const std::type_info &) final;
0041
0042 protected:
0043 std::string AsString() final { return "ROOT data source"; };
0044
0045 public:
0046 RRootDS(std::string_view treeName, std::string_view fileNameGlob);
0047 ~RRootDS();
0048 std::string GetTypeName(std::string_view colName) const final;
0049 const std::vector<std::string> &GetColumnNames() const final;
0050 bool HasColumn(std::string_view colName) const final;
0051 void InitSlot(unsigned int slot, ULong64_t firstEntry) final;
0052 void FinalizeSlot(unsigned int slot) final;
0053 std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges() final;
0054 bool SetEntry(unsigned int slot, ULong64_t entry) final;
0055 void SetNSlots(unsigned int nSlots) final;
0056 void Initialize() final;
0057 std::string GetLabel() final;
0058 };
0059
0060 }
0061
0062 }
0063
0064 }
0065
0066 #endif