Skip to content

TrigT1CTP: Fix undefined behavior sanitizer warning.

Scott Snyder requested to merge ssnyder/athena:ubsan.TrigT1CTP-20240503 into main

In CTPSimulation::extractMultiplicities, we take a bitmask from an input, go through the corresponding list of triggerLines and note which ones are set.

BUT... there seem to be two types of input, electrical', which is 64 bits, of type uint64_t, and optical', which is 128 bits, of type bitset<128>. Only the processing for the 64-bit inputs is actually implemented. For the 128-bit inputs, the (64-bit) input word is left initialized with 0. But we still go through the motions of testing each triggerLine against it. However, for the optical inputs, some of the triggerLines have bit numbers over 63. When we shift the (64-bit) mask value, we then get a warning from the undefined behavior sanitizer.

Clean this up for now by avoiding doing any shifting if the input word is 0.

Fixes test failure seen in TriggerJobOpts in the debug build.

Merge request reports