Skip to content
Open
6 changes: 5 additions & 1 deletion source/framework/core/inc/TRestDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class TRestDataSet : public TRestMetadata {
/// A list of new columns together with its corresponding expressions added to the dataset
std::vector<std::pair<std::string, std::string>> fColumnNameExpressions; //<

/// List of files to generate the dataSet
std::vector<std::string> fFileList; //!

/// A flag to enable Multithreading during dataframe generation
Bool_t fMT = false; //<

Expand Down Expand Up @@ -181,6 +184,7 @@ class TRestDataSet : public TRestMetadata {
inline auto GetCut() const { return fCut; }
inline auto IsMergedDataSet() const { return fMergedDataset; }

inline void SetFileList(const std::vector<std::string>& fileList) { fFileList = fileList; }
inline void SetObservablesList(const std::vector<std::string>& obsList) { fObservablesList = obsList; }
inline void SetFilePattern(const std::string& pattern) { fFilePattern = pattern; }
inline void SetQuantity(const std::map<std::string, RelevantQuantity>& quantity) { fQuantity = quantity; }
Expand Down Expand Up @@ -209,6 +213,6 @@ class TRestDataSet : public TRestMetadata {
TRestDataSet(const char* cfgFileName, const std::string& name = "");
~TRestDataSet();

ClassDefOverride(TRestDataSet, 7);
ClassDefOverride(TRestDataSet, 8);
};
#endif
6 changes: 3 additions & 3 deletions source/framework/core/src/TRestDataSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,16 @@ std::vector<std::string> TRestDataSet::FileSelection() {
return fFileSelection;
}

std::vector<std::string> fileNames = TRestTools::GetFilesMatchingPattern(fFilePattern);
if (fFileList.empty()) fFileList = TRestTools::GetFilesMatchingPattern(fFilePattern);

RESTInfo << "TRestDataSet::FileSelection. Starting file selection." << RESTendl;
RESTInfo << "Total files : " << fileNames.size() << RESTendl;
RESTInfo << "Total files : " << fFileList.size() << RESTendl;
RESTInfo << "This process may take long computation time in case there are many files." << RESTendl;

fTotalDuration = 0;
std::cout << "Processing file selection.";
int cnt = 1;
for (const auto& file : fileNames) {
for (const auto& file : fFileList) {
if (cnt % 100 == 0) {
std::cout << std::endl;
std::cout << "Files processed: " << cnt << " ." << std::flush;
Expand Down