Skip to content

Commit 80eaee6

Browse files
committed
Geo: order same level pars semantically
Signed-off-by: Felix Schlepper <[email protected]>
1 parent d28e668 commit 80eaee6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Detectors/Base/src/GeometryManager.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,15 @@ bool GeometryManager::applyAlignment(const std::vector<o2::detectors::AlignParam
253253
int nvols = algPars.size();
254254
std::vector<int> ord(nvols);
255255
std::iota(std::begin(ord), std::end(ord), 0); // sort to apply alignment in correct hierarchy
256-
std::sort(std::begin(ord), std::end(ord), [&algPars](int a, int b) { return algPars[a].getLevel() < algPars[b].getLevel(); });
256+
std::sort(std::begin(ord), std::end(ord), [&algPars](int a, int b) {
257+
if (algPars[a].getLevel() < algPars[b].getLevel()) {
258+
return true;
259+
} else {
260+
// if pars are on the same level the order does not matter, however comparing the log for different input it is
261+
// easier to sort these semantically.
262+
return algPars[a].getSymName() < algPars[b].getSymName();
263+
}
264+
});
257265

258266
bool res = true;
259267
for (int i = 0; i < nvols; i++) {

0 commit comments

Comments
 (0)