Skip to content

Fix ATOF and AHDC issues: Remove CalibrationConstantsLoader, use IndexedTable directly for AHDC/ATOF calibration#1200

Merged
baltzell merged 5 commits intodevelopmentfrom
iss_1183_v2
Apr 10, 2026
Merged

Fix ATOF and AHDC issues: Remove CalibrationConstantsLoader, use IndexedTable directly for AHDC/ATOF calibration#1200
baltzell merged 5 commits intodevelopmentfrom
iss_1183_v2

Conversation

@mathieuouillon
Copy link
Copy Markdown
Collaborator

Remove CalibrationConstantsLoader and its static mutable state. Engines now fetch IndexedTable references directly from ConstantsManager and pass them to consumer code. This fixes three bugs:

  • CSTLOADED flag prevented constants from reloading across runs. All subsequent runs silently used the first run's calibration
  • ATOFEngine never updated its Run field after loading constants
  • Static HashMap fields were not thread-safe across engine instances

Simplify calibration access: consumer code (HitReader, ATOFHit, BarHit) queries IndexedTable directly via getDoubleValue("column", sector, layer, component). No manual key encoding, no intermediate maps
Separate AHDC/ATOF table requirements: each engine's init() now only registers its own detector's CCDB tables
Fix IndexOutOfBoundsException in ALERTEngine when a track has no matching hits in AHDC::hits
Clean up mode config parsing in AHDCEngine using ModeTrackFinding.valueOf()

Related to issues: #1182 and #1183

Instead of replacing static maps with instance maps, we remove the intermediate layer entirely. Each engine now stores IndexedTable references fetched directly from ConstantsManager (which already caches per run with proper synchronization). Consumer code queries tables via getDoubleValue("column", sector, layer, component) or getDoublesByHash() for bulk access.
baltzell
baltzell previously approved these changes Apr 9, 2026
@ftouchte
Copy link
Copy Markdown
Collaborator

@mathieuouillon I really like this new implementation. Could you also load the ahdcAdcGains table in ALERTEngine? I will use it in my next pull request. Thank you in advance.

ftouchte
ftouchte previously approved these changes Apr 10, 2026
Register /calibration/alert/ahdc/gains in ALERTEngine's init() and refresh the IndexedTable reference on run change, so it is available for downstream use.

Requested by @ftouchte for an upcoming pull request.
@mathieuouillon mathieuouillon dismissed stale reviews from ftouchte and baltzell via 3f33269 April 10, 2026 14:01
@mathieuouillon mathieuouillon requested a review from efuchey as a code owner April 10, 2026 14:01
@baltzell baltzell enabled auto-merge (squash) April 10, 2026 14:14
@baltzell baltzell merged commit 7d517dc into development Apr 10, 2026
23 of 39 checks passed
@baltzell baltzell deleted the iss_1183_v2 branch April 10, 2026 14:14
@baltzell baltzell added the rg-l label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in ATOFHit.convertTdcToTime — timeOffsets array is null IndexOutOfBoundsException in ALERT Track constructor

3 participants