File indexing completed on 2025-01-18 10:10:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RDF_RDATASETSPEC
0012 #define ROOT_RDF_RDATASETSPEC
0013
0014 #include <limits>
0015 #include <string>
0016 #include <utility> // std::pair
0017 #include <vector>
0018
0019 #include <ROOT/RDF/RSample.hxx>
0020 #include <ROOT/RFriendInfo.hxx>
0021 #include <RtypesCore.h> // Long64_t
0022
0023 namespace ROOT {
0024 namespace Detail {
0025 namespace RDF {
0026 class RLoopManager;
0027 }
0028 }
0029 namespace RDF {
0030 namespace Experimental {
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 class RDatasetSpec {
0048
0049 friend class ::ROOT::Detail::RDF::RLoopManager;
0050
0051 public:
0052 struct REntryRange {
0053 Long64_t fBegin{0};
0054 Long64_t fEnd{std::numeric_limits<Long64_t>::max()};
0055 REntryRange();
0056 REntryRange(Long64_t endEntry);
0057 REntryRange(Long64_t startEntry, Long64_t endEntry);
0058 };
0059
0060 private:
0061 std::vector<RSample> fSamples;
0062 ROOT::TreeUtils::RFriendInfo fFriendInfo;
0063 REntryRange fEntryRange;
0064
0065 std::vector<RSample> MoveOutSamples();
0066
0067 public:
0068 RDatasetSpec() = default;
0069
0070 const std::vector<std::string> GetSampleNames() const;
0071 const std::vector<std::string> GetTreeNames() const;
0072 const std::vector<std::string> GetFileNameGlobs() const;
0073 const std::vector<RMetaData> GetMetaData() const;
0074 const ROOT::TreeUtils::RFriendInfo &GetFriendInfo() const;
0075 Long64_t GetEntryRangeBegin() const;
0076 Long64_t GetEntryRangeEnd() const;
0077
0078 RDatasetSpec &AddSample(RSample sample);
0079
0080 RDatasetSpec &
0081 WithGlobalFriends(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias = "");
0082
0083 RDatasetSpec &WithGlobalFriends(const std::string &treeName, const std::vector<std::string> &fileNameGlobs,
0084 const std::string &alias = "");
0085
0086 RDatasetSpec &WithGlobalFriends(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
0087 const std::string &alias = "");
0088
0089 RDatasetSpec &WithGlobalFriends(const std::vector<std::string> &treeNames,
0090 const std::vector<std::string> &fileNameGlobs, const std::string &alias = "");
0091
0092 RDatasetSpec &WithGlobalRange(const RDatasetSpec::REntryRange &entryRange = {});
0093 };
0094
0095 }
0096 }
0097 }
0098
0099 #endif