Thresholds: also implement new logic of threshold finding from
repackThresholdMap in repackThresholdVsDAC. Looks all fine now.