-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding possibility to add a list of files to TRestDataSet #514
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
Maybe it could be generalized to a list of file patterns? I have found myself in this situation where one file pattern isn't enough to get all the files I need. I found out that TRestTools::GetFilesMatchingPattern() accepts several file patterns by joining them with "\n" (for example "/data/R00001_*_tags.root\n/data/R00002_*_tags.root") and I have using this workaround but is quite annoying. This will be a more readable solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps when we call SetFileList
and the list is not empty, we should force fFilesMatchingPattern = "fileList"
so that when we explore the metadata we know the file list was initialized by other means other than a filename pattern.
Or, following @AlvaroEzq proposal we may promote std::string fFilesMatchingPattern
to a std::vector <std::string> fFilesMatchingPattern;
which can be either a pattern name list or just a file list.
…possibility to add several patterns to a single dataSet
for more information, see https://pre-commit.ci
Ok, now |
@@ -182,7 +182,7 @@ class TRestDataSet : public TRestMetadata { | |||
inline auto IsMergedDataSet() const { return fMergedDataset; } | |||
|
|||
inline void SetObservablesList(const std::vector<std::string>& obsList) { fObservablesList = obsList; } | |||
inline void SetFilePattern(const std::string& pattern) { fFilePattern = pattern; } | |||
inline void SetFilePattern(const std::string& pattern) { fFilePatternList.push_back(pattern); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle if it is adding an entry to the list, the method name should be like "AddFilePattern"...
In principle it is always possible to describe a series of files with one single pattern. In the case "/data/R00001_tags.root\n/data/R00002tags.root", it is equivalent with "/data/R0000[1-2]*_tags.root". But it's still OK to have a list of patterns for convenience. |
Added the posibility to add a file list instead of a file pattern in TRestDataSet.
Note that if the file list is empty it will just use the file pattern provided, however the file pattern will be ignored if the file list is not empty.