Skip to content

HLTSeeding: Refactor phase-1 RoI tools to reduce code duplication

Rafal Bielski requested to merge rbielski/athena:hltseeding-phase1-part2 into master

Strongly reduce code duplication for phase-1 RoI tools in HLTSeeding. Move all common code for the "RoI unpacking tools" to a template class, similarly to what has already been in place for the "threshold tools". Merge the template parameter definitions for specific instantiations of the "unpacking" and "threshold" tools into one central config namespace HLTSeedingRoIToolDefs.

For the "unpacking" tools this reduces 140*(N types) lines of C++ code to 140 + 15*(N types) lines. Given the current number of implemented threshold types, it effectively removes >300 lines of code. We expect a few more types to be implemented soon, so the total reduction will be larger. It also makes the code much easier to maintain as changes only need to be made in one place rather than multiple copies.

The phase-1 L1Muon path is also moved from a common legacy/phase-1 "unpacking" tool into an instance of the template.


This MR is a refactor only, it does not change any functionality, except two items:

  • the RoI width definitions are moved from C++ defaults to python overrides, since they differ between the threshold types and the C++ code is now common
  • the produced TrigRoIDescriptor objects now have the RoI Word correctly filled (discussed in ATR-24233)

FYI @dzanzi, @afaulkne, @masato, @tbold, @tamartin

Jira: ATR-22762

Edited by Rafal Bielski

Merge request reports