File indexing completed on 2025-09-15 09:11: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
0030 namespace RDF {
0031 namespace Experimental {
0032 class RDatasetSpec;
0033 class RSample;
0034 }
0035 }
0036
0037 namespace Internal {
0038 namespace RDF {
0039 std::vector<ROOT::RDF::Experimental::RSample> MoveOutSamples(ROOT::RDF::Experimental::RDatasetSpec &spec);
0040 }
0041 }
0042
0043 namespace RDF {
0044 namespace Experimental {
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 class RDatasetSpec {
0062
0063 friend class ::ROOT::Detail::RDF::RLoopManager;
0064 friend std::vector<ROOT::RDF::Experimental::RSample> ROOT::Internal::RDF::MoveOutSamples(ROOT::RDF::Experimental::RDatasetSpec &);
0065
0066
0067 public:
0068 struct REntryRange {
0069 Long64_t fBegin{0};
0070 Long64_t fEnd{std::numeric_limits<Long64_t>::max()};
0071 REntryRange();
0072 REntryRange(Long64_t endEntry);
0073 REntryRange(Long64_t startEntry, Long64_t endEntry);
0074 };
0075
0076 private:
0077 std::vector<RSample> fSamples;
0078 ROOT::TreeUtils::RFriendInfo fFriendInfo;
0079 REntryRange fEntryRange;
0080 std::vector<RSample> MoveOutSamples();
0081
0082 public:
0083 RDatasetSpec() = default;
0084
0085 const std::vector<std::string> GetSampleNames() const;
0086 const std::vector<std::string> GetTreeNames() const;
0087 const std::vector<std::string> GetFileNameGlobs() const;
0088 const std::vector<RMetaData> GetMetaData() const;
0089 const ROOT::TreeUtils::RFriendInfo &GetFriendInfo() const;
0090 Long64_t GetEntryRangeBegin() const;
0091 Long64_t GetEntryRangeEnd() const;
0092
0093 RDatasetSpec &AddSample(RSample sample);
0094
0095 RDatasetSpec &
0096 WithGlobalFriends(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias = "");
0097
0098 RDatasetSpec &WithGlobalFriends(const std::string &treeName, const std::vector<std::string> &fileNameGlobs,
0099 const std::string &alias = "");
0100
0101 RDatasetSpec &WithGlobalFriends(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
0102 const std::string &alias = "");
0103
0104 RDatasetSpec &WithGlobalFriends(const std::vector<std::string> &treeNames,
0105 const std::vector<std::string> &fileNameGlobs, const std::string &alias = "");
0106
0107 RDatasetSpec &WithGlobalRange(const RDatasetSpec::REntryRange &entryRange = {});
0108 };
0109
0110 }
0111 }
0112 }
0113
0114 #endif