hotfix: guard fADC pulse fitting against channels missing from /daq/fadc CCDB config#1358
Merged
Merged
Conversation
…/fadc config PR #1323 replaced the per-detector `fitterTables` loop in `DetectorEventDecoder.fitPulses` with a direct table lookup and, in doing so, dropped the `hasEntryByHash(hash)` guard that previously protected the `nsa`/`nsb`/`tet`/`pedestal` reads. Because `IndexedTable.getIntValueByHash` does not null-check its internal map lookup, a decoded ADC hit whose `(crate,slot,channel)` is present in `/daq/tt/<det>` but absent from the corresponding `/daq/fadc/<det>` table now unboxes a null `Integer` and throws `NullPointerException` on every such hit. Restore the guard: skip channels that have no FADC config entry, matching the pre-#1323 (14.1.1) behavior. Reproduced on RG-L run 23061: `/daq/tt/ltcc` maps ADC channel (crate 19, slot 18, chan 150) to LTCC sector 4, but `/daq/fadc/ltcc` has no row for it, so 1999/2000 decoded events threw NPE with 14.1.2. With the guard restored the same 2000 events decode cleanly (0 NPE).
mathieuouillon
requested review from
baltzell and
raffaelladevita
as code owners
July 23, 2026 15:21
c-dilks
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DetectorEventDecoder.fitPulsescan throwNullPointerExceptionon every decoded event when a channel is present in the translation table (/daq/tt/<det>) but has no matching row in the FADC config table (/daq/fadc/<det>). This is a regression introduced by #1323, which removed thehasEntryByHashguard that previously protected thensa/nsb/tet/pedestallookups. This PR restores that guard.Regression
Before #1323, the fitter looped over
fitterTablesand only read parameters when the entry existed:#1323 refactored this into a direct
getOrDefaultlookup + a dedicatedfitPulses(data, cfg)helper, but the per-hash existence check was dropped, sogetIntValueByHashis now always called.IndexedTable.getIntValueByHashdoes not null-check its map lookup:So a hit whose
(crate,slot,channel)is absent from the FADC table unboxes anullIntegerand throws.Symptom
Because decoding is the first stage of reconstruction, this aborts the whole cook. In the RG-L
p0v11production it failed 618/623 reconstruction jobs; each affected job logged the exception on ~every event, growing multi-MB logs (~16 GB for the workflow) and secondarily exhausting the farm output quota.Root cause (real-world trigger)
RG-L data contains an LTCC ADC hit on hardware
(crate 19, slot 18, channel 150). The translation table maps it, but the FADC config table has no such row:This particular inconsistency is a data/CCDB issue that will be addressed separately by the DAQ table maintainers, but the decoder should not hard-fail on it — a channel with no fit configuration should be skipped, exactly as it was before #1323.
The fix
private void fitPulses(DetectorDataDgtz data, IndexedTable cfg) { final DetectorDescriptor dd = data.getDescriptor(); final long hash = IndexedTable.DEFAULT_GENERATOR.hashCode(dd.getCrate(), dd.getSlot(), dd.getChannel()); + // Guard re-added (was removed in PR #1323): skip channels with no FADC config entry, + // otherwise getIntValueByHash returns null and NPEs (e.g. LTCC crate 19 / slot 18 / chan 150). + if (!cfg.hasEntryByHash(hash)) return; final int nsa = cfg.getIntValueByHash("nsa", hash); final int nsb = cfg.getIntValueByHash("nsb", hash); final int tet = cfg.getIntValueByHash("tet", hash);One line + comment; behavior matches 14.1.1 (skip the channel).
Validation
Decoded 2000 events of RG-L run 23061 (
clas_023061.evio.00040), variationrgl_spring2025, timestamp07/20/2026-16:00:00:NullPointerException/ 2000The unpatched-vs-patched pair is the same build tree with only this one-line change differing, isolating the fix as the sole cause. The patched decoder simply skips the unconfigured LTCC channel and processes everything else normally.
Impact / risk
/daq/fadcentry.Alternative considered
Making
IndexedTable.getIntValueByHashnull-safe would harden all callers, but is a broader behavioral change; restoring the local guard is the minimal, targeted fix and matches the long-standing prior behavior. Happy to also add a null-check / warning inIndexedTableif preferred.