Repository navigation
TPC: fix pair swap when reading CalArray<PadFlags> written by the cus… - #16124
Conversation
…tom streamer The custom member streamer for CalArray<PadFlags>::mData writes the count N/2 followed by N single shorts, but reads N/2 ints and reinterprets each as a pair of flags (the layout written by ROOT < 6.33). Every object written by the streamer itself (ROOT >= 6.33) therefore comes back with each pair of adjacent pads swapped. This affects all IDC_PadStatusMap objects written since the streamer was introduced (e.g. 2026 data, ROOT 6.36.04): the dead channel map used in reconstruction marks the neighbour of an isolated bad pad instead of the pad itself. Objects written with ROOT < 6.33 (e.g. 2025, ROOT 6.32.06) are read correctly. The class version did not change, so the reader now selects the layout by the ROOT version that wrote the buffer (TBuffer::GetVersionOwner(); the current ROOT if the buffer has no file): < 6.33 as before, >= 6.33 N shorts. The writer is unchanged, so existing objects stay readable and no re-upload is needed. Add a ROOT I/O round-trip unit test for CalDet<PadFlags>, which fails with the old reader (349440 of 524160 flags differ) and passes with the new one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Error while checking build/O2/fullCI_slc9 for e4426e4 at 2026-11-14 12:43: Full log here. |
|
I will take a look at this. Please wait before merging. |
|
Thanks for tracking this down. I agree with the diagnosis: the write branch of the streamer, which I carried over in #14830 without a round-trip test, never produced the old ROOT layout, so objects written through it come back with adjacent pads swapped. The fix reads both layouts correctly for the CCDB objects we have. Since this code runs in the async tags, the backport matters. I believe it is needed for all tags on ROOT 6.36 that read maps written since the streamer went live, i.e. 2026 data and MC anchored to it. Tags reading only 2025 or earlier maps are not affected, and on ROOT 6.32 the streamer is not compiled in. One request before merging: please use The remaining points can follow later, and I propose to track them in a JIRA ticket:
|
…tom streamer
The custom member streamer for CalArray::mData writes the count N/2 followed by N single shorts, but reads N/2 ints and reinterprets each as a pair of flags (the layout written by ROOT < 6.33). Every object written by the streamer itself (ROOT >= 6.33) therefore comes back with each pair of adjacent pads swapped. This affects all IDC_PadStatusMap objects written since the streamer was introduced (e.g. 2026 data, ROOT 6.36.04): the dead channel map used in reconstruction marks the neighbour of an isolated bad pad instead of the pad itself. Objects written with ROOT < 6.33 (e.g. 2025, ROOT 6.32.06) are read correctly.
The class version did not change, so the reader now selects the layout by the ROOT version that wrote the buffer (TBuffer::GetVersionOwner(); the current ROOT if the buffer has no file): < 6.33 as before, >= 6.33 N shorts. The writer is unchanged, so existing objects stay readable and no re-upload is needed.
Add a ROOT I/O round-trip unit test for CalDet, which fails with the old reader (349440 of 524160 flags differ) and passes with the new one.