Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion Generators/src/GeneratorFromFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,26 @@ std::vector<std::string> GeneratorFromEventPool::setupFileUniverse(std::string c
if (typeString.size() == 0) {
return result;
} else if (typeString.size() == 1 && typeString.front() == std::string("Type: f")) {
// this is a file ... simply use it
// this is a file:
// 1) list of files ==> select one of the lines and use it
// 2) evtpool.root ==> use as it is
if (!checkFileName(path)) {
// Assume it is a text file containing a list of pools
auto tmpPath = (std::filesystem::temp_directory_path() / ("list_" + std::to_string(getpid()) + ".txt")).string();
auto res = TFile::Cp(Form("%s?filetype=raw", path.c_str()), tmpPath.c_str());
if (!res) {
LOG(fatal) << "Failed to copy file from AliEn: " << path;
} else {
auto files = readLines(tmpPath);
if (checkFileUniverse(files)) {
result = files;
} else {
LOG(fatal) << "The list of files in " << path << " is not valid";
}
std::filesystem::remove(tmpPath);
}
return result;
}
result.push_back(mConfig.eventPoolPath);
return result;
} else if (typeString.size() == 1 && typeString.front() == std::string("Type: d")) {
Expand Down