From 7d459c73e10dac9b04ae3e180d54f5da066ba847 Mon Sep 17 00:00:00 2001 From: Jan Fiete Date: Thu, 27 Jan 2022 14:20:48 +0100 Subject: [PATCH] supporting versioning in merger --- Common/Core/aodMerger.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Common/Core/aodMerger.cxx b/Common/Core/aodMerger.cxx index 3463ac19401..d069a64caaf 100644 --- a/Common/Core/aodMerger.cxx +++ b/Common/Core/aodMerger.cxx @@ -289,15 +289,26 @@ int main(int argc, char* argv[]) } } + // set to -1 to identify not found tables + for (auto& offset : offsets) { + offset.second = -1; + } + // update offsets for (auto const& tree : trees) { - offsets[tree.first] = tree.second->GetEntries(); + // remove version suffix, e.g. O2v0_001 becomes O2v0 + TString treeName(tree.first); + if (treeName.First("_") > 0) { + treeName.Remove(treeName.First("_")); + } + offsets[treeName.Data()] = tree.second->GetEntries(); } // check for not found tables - for (auto const& offset : offsets) { - if (trees.count(offset.first) == 0) { + for (auto& offset : offsets) { + if (offset.second < 0) { printf("ERROR: Index on %s but no tree found\n", offset.first.c_str()); + offset.second = 0; } }