Skip to content

Commit c2fb07e

Browse files
authored
supporting versioning in merger (#480)
1 parent a3d52bb commit c2fb07e

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

Common/Core/aodMerger.cxx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,26 @@ int main(int argc, char* argv[])
289289
}
290290
}
291291

292+
// set to -1 to identify not found tables
293+
for (auto& offset : offsets) {
294+
offset.second = -1;
295+
}
296+
292297
// update offsets
293298
for (auto const& tree : trees) {
294-
offsets[tree.first] = tree.second->GetEntries();
299+
// remove version suffix, e.g. O2v0_001 becomes O2v0
300+
TString treeName(tree.first);
301+
if (treeName.First("_") > 0) {
302+
treeName.Remove(treeName.First("_"));
303+
}
304+
offsets[treeName.Data()] = tree.second->GetEntries();
295305
}
296306

297307
// check for not found tables
298-
for (auto const& offset : offsets) {
299-
if (trees.count(offset.first) == 0) {
308+
for (auto& offset : offsets) {
309+
if (offset.second < 0) {
300310
printf("ERROR: Index on %s but no tree found\n", offset.first.c_str());
311+
offset.second = 0;
301312
}
302313
}
303314

0 commit comments

Comments
 (0)