@@ -38,6 +38,31 @@ struct RDatasetSpec {
38
38
}
39
39
};
40
40
41
+ struct RFriendInfo {
42
+ std::vector<std::string> fTreeNames {};
43
+ std::vector<std::string> fFileNameGlobs {};
44
+ RFriendInfo () {}
45
+
46
+ RFriendInfo (const std::string &treeName, const std::string &fileName)
47
+ : fTreeNames (std::vector<std::string>{treeName}), fFileNameGlobs (std::vector<std::string>{fileName})
48
+ {
49
+ }
50
+
51
+ RFriendInfo (const std::string &treeName, const std::vector<std::string> &fileNames)
52
+ : fTreeNames (std::vector<std::string>{treeName}), fFileNameGlobs (fileNames)
53
+ {
54
+ }
55
+
56
+ RFriendInfo (const std::vector<std::string> &treeNames, const std::vector<std::string> &fileNames)
57
+ : fTreeNames (
58
+ fileNames.size() != treeNames.size() && treeNames.size() != 1
59
+ ? throw std::logic_error (" RFriendInfo exepcts either N trees and N files, or 1 tree and N files." )
60
+ : treeNames),
61
+ fFileNameGlobs(fileNames)
62
+ {
63
+ }
64
+ };
65
+
41
66
/* *
42
67
* A list of names of trees.
43
68
* This list should go in lockstep with fFileNameGlobs, only in case this dataset is a TChain where each file
@@ -49,31 +74,35 @@ struct RDatasetSpec {
49
74
* A list of file names.
50
75
* They can contain the globbing characters supported by TChain. See TChain::Add for more information.
51
76
*/
52
-
53
77
std::vector<std::string> fFileNameGlobs {};
54
78
55
79
ULong64_t fStartEntry {}; // /< The entry where the dataset processing should start (inclusive).
56
80
ULong64_t fEndEntry {}; // /< The entry where the dataset processing should end (exclusive).
57
81
58
- RDatasetSpec (const std::string &treeName, const std::string &fileName, REntryRange entryRange = {})
82
+ std::vector<RFriendInfo> fFriendInfos {}; // /< List of friends
83
+
84
+ RDatasetSpec (const std::string &treeName, const std::string &fileName, REntryRange entryRange = {},
85
+ const std::vector<RFriendInfo> &friendInfos = {})
59
86
: fTreeNames (std::vector<std::string>{treeName}), fFileNameGlobs (std::vector<std::string>{fileName}),
60
- fStartEntry(entryRange.fStartEntry ), fEndEntry(entryRange.fEndEntry )
87
+ fStartEntry (entryRange.fStartEntry ), fEndEntry (entryRange.fEndEntry ), fFriendInfos (friendInfos)
61
88
{
62
89
}
63
90
64
- RDatasetSpec (const std::string &treeName, const std::vector<std::string> &fileNames, REntryRange entryRange = {})
91
+ RDatasetSpec (const std::string &treeName, const std::vector<std::string> &fileNames, REntryRange entryRange = {},
92
+ const std::vector<RFriendInfo> &friendInfos = {})
65
93
: fTreeNames (std::vector<std::string>{treeName}), fFileNameGlobs (fileNames), fStartEntry (entryRange.fStartEntry ),
66
- fEndEntry(entryRange.fEndEntry )
94
+ fEndEntry (entryRange.fEndEntry ), fFriendInfos (friendInfos)
67
95
{
68
96
}
69
97
70
98
RDatasetSpec (const std::vector<std::string> &treeNames, const std::vector<std::string> &fileNames,
71
- REntryRange entryRange = {})
99
+ REntryRange entryRange = {}, const std::vector<RFriendInfo> &friendInfos = {} )
72
100
: fTreeNames (
73
101
fileNames.size() != treeNames.size() && treeNames.size() != 1
74
- ? throw std::runtime_error (" RDatasetSpec exepcts either N trees and N files, or 1 tree and N files." )
102
+ ? throw std::logic_error (" RDatasetSpec exepcts either N trees and N files, or 1 tree and N files." )
75
103
: treeNames),
76
- fFileNameGlobs(fileNames), fStartEntry(entryRange.fStartEntry ), fEndEntry(entryRange.fEndEntry )
104
+ fFileNameGlobs(fileNames), fStartEntry(entryRange.fStartEntry ), fEndEntry(entryRange.fEndEntry ),
105
+ fFriendInfos(friendInfos)
77
106
{
78
107
}
79
108
};
0 commit comments