Adding possibility to add a list of files to TRestDataSet
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.
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.
Perhaps when we call
SetFileListand the list is not empty, we should forcefFilesMatchingPattern = "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 fFilesMatchingPatternto astd::vector <std::string> fFilesMatchingPattern;which can be either a pattern name list or just a file list.
Ok, now fFilePattern is a vector of strings that can be set using SetFilePattern, it should be also compatible with previous implementation.
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.