Skip to content

RoiDescriptor: convert RoiUtil to member functions

Frank Winklmeier requested to merge fwinkl/athena:roiutils_speedup into 23.0

Move the RoiUtil::contains (and all other helper functions) into the RoiDescriptor class. This allows the compiler to inline the various (virtual) functions calls.

This leads to a speedup of ~3% in TrigFastTrackFinder_jet (ATR-27858).

Other changes:

  • Use std::any_of instead of hand-written loop for composite Roi.
  • Use recursion in contains and contains_zrange instead of lambda (not really needed functionality-wise but makes it consistent with all other methods).
  • Replace RoiUtil::range_error exception with std::range_error.
  • Add final keyword to all overrides. Inlining seems to work even without that but the bulk of RoiDescriptor is really "final" as the only descendant (TrigRoiDescriptor) only overwrites L1-related methods.

cc @sutt

Merge request reports