From 88a9ca683dc1739685b7385a999bf065e0715ebf Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Mon, 24 Jan 2022 14:05:38 +0100 Subject: [PATCH] [AOD] Ensure the merger moves unassigned offset by the most negative index encountered --- Common/Core/aodMerger.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Common/Core/aodMerger.cxx b/Common/Core/aodMerger.cxx index 1e74db56d70..3463ac19401 100644 --- a/Common/Core/aodMerger.cxx +++ b/Common/Core/aodMerger.cxx @@ -244,6 +244,7 @@ int main(int argc, char* argv[]) auto entries = inputTree->GetEntries(); int minIndexOffset = unassignedIndexOffset[treeName]; + auto newMinIndexOffset = minIndexOffset; for (int i = 0; i < entries; i++) { inputTree->GetEntry(i); // shift index columns by offset @@ -251,6 +252,7 @@ int main(int argc, char* argv[]) // if negative, the index is unassigned. In this case, the different unassigned blocks have to get unique negative IDs if (*(idx.first) < 0) { *(idx.first) += minIndexOffset; + newMinIndexOffset = std::min(newMinIndexOffset, *(idx.first)); } else { *(idx.first) += idx.second; } @@ -260,7 +262,7 @@ int main(int argc, char* argv[]) currentDirSize += nbytes; } } - unassignedIndexOffset[treeName] -= 1; + unassignedIndexOffset[treeName] = newMinIndexOffset; delete inputTree;