|
14 | 14 | /// \author julian.myrcha@cern.ch |
15 | 15 |
|
16 | 16 | #include "EventVisualisationBase/DirectoryLoader.h" |
| 17 | +#include "Framework/DefaultsHelpers.h" |
| 18 | +#include "Framework/DataTakingContext.h" |
17 | 19 | #include <filesystem> |
18 | 20 | #include <algorithm> |
19 | 21 | #include <climits> |
@@ -65,10 +67,13 @@ bool DirectoryLoader::canCreateNextFile(const std::vector<std::string>& paths, c |
65 | 67 | } |
66 | 68 |
|
67 | 69 | // comparison with safety if marker not in the filename (-1+1 gives 0) |
68 | | - std::ranges::sort(result.begin(), result.end(), |
69 | | - [marker](const std::string& a, const std::string& b) { |
70 | | - return a.substr(a.find_first_of(marker) + 1) > b.substr(b.find_first_of(marker) + 1); |
71 | | - }); |
| 70 | + if (result.size() > 1) { |
| 71 | + std::ranges::sort(result.begin(), result.end(), |
| 72 | + [marker](const std::string& a, const std::string& b) { |
| 73 | + return a.substr(a.find_first_of(marker) + 1) > b.substr(b.find_first_of(marker) + 1); |
| 74 | + }); |
| 75 | + } |
| 76 | + |
72 | 77 | unsigned long accumulatedSize = 0L; |
73 | 78 | const std::regex delimiter{"_"}; |
74 | 79 | for (auto const& file : result) { |
@@ -113,11 +118,15 @@ deque<string> DirectoryLoader::load(const std::vector<std::string>& paths, const |
113 | 118 |
|
114 | 119 | std::vector<std::string> DirectoryLoader::allFolders(const std::string& location) |
115 | 120 | { |
116 | | - auto const pos = location.find_last_of('_'); |
117 | 121 | std::vector<std::string> folders; |
118 | | - folders.push_back(location.substr(0, pos) + "_PHYSICS"); |
119 | | - folders.push_back(location.substr(0, pos) + "_COSMICS"); |
120 | | - folders.push_back(location.substr(0, pos) + "_SYNTHETIC"); |
| 122 | + if (o2::framework::DefaultsHelpers::deploymentMode() == o2::framework::DeploymentMode::OnlineDDS) { |
| 123 | + auto const pos = location.find_last_of('_'); |
| 124 | + folders.push_back(location.substr(0, pos) + "_PHYSICS"); |
| 125 | + folders.push_back(location.substr(0, pos) + "_COSMICS"); |
| 126 | + folders.push_back(location.substr(0, pos) + "_SYNTHETIC"); |
| 127 | + } else { |
| 128 | + folders.push_back(location); |
| 129 | + } |
121 | 130 | return folders; |
122 | 131 | } |
123 | 132 |
|
|
0 commit comments