Skip to content

Draft: Correct L1 prescale calculation in trigger menu code (ATR-24392)

Teng Jian Khoo requested to merge khoo/athena:master-L1PSDef into master

It was realised (ATR-24392) that the L1 prescale cut calculated by the trigger menu, and evidently throughout the athena code, has logic that differs from what is implemented by the CTP. In essence, CTP allows the cut value to run from 0 (PS=1) to 2^24-1, whereas the menu was assuming that cut=1 resulted in PS=1, so had an offset of 1. The offset was then corrected for by CTP but has the side effect that the maximum prescale value of 2^24 is not achievable, and in fact is halved.

This MR corrects all the conversions that I could find between prescale and cut in the athena code. The changes are factorised in case I have been overzealous about any of these instances, e.g. in case the behaviour needs to be preserved for any Run-2-to-Run-3 conversions. The following places were fixed:

  • TriggerMenuMT python: the main target, conversions in both directions. Cut is identical for PS=2 or greater with this formula, changes slightly for smaller prescales.
  • TrigConfData/L1PrescaleSet: C++ conversion only from cut to prescale
  • TrigConfL1Data/PrescaleSet: C++ conversion in both directions, code logic same as elsewhere but the comments indicate an inverted cut convention!
  • LumiCal/LumiCalculator: C++ conversion from cut to prescale, repeated in multiple places, mostly for logging
  • TrigConfStorage/Run2toRun3ConvertersL1: C++ conversion from cut to prescale
  • TrigConfigSvc/TrigConfigSvcUtils: python conversion from cut to prescale

FYI @stelzer, @amarzin, would definitely like to know if I have hit too many/too few places. Unfortunately while it would be nice to define this uniquely in one place, it feels like it could get complicated with package dependencies unless we create a new package solely for this operation.

This would also have to be synced up with a reversion of the offset in CTP

Merge request reports