Repository navigation
Commit e4426e4
TPC: fix pair swap when reading CalArray<PadFlags> written by the custom 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>1 parent 2ddcfc8 commit e4426e4
2 files changed
Lines changed: 69 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
| |||
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
43 | | - | |
44 | | - | |
45 | 52 | | |
46 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
47 | 73 | | |
48 | 74 | | |
49 | 75 | | |
50 | 76 | | |
51 | 77 | | |
52 | 78 | | |
53 | 79 | | |
54 | | - | |
55 | | - | |
| 80 | + | |
56 | 81 | | |
57 | 82 | | |
58 | 83 | | |
59 | | - | |
| 84 | + | |
| 85 | + | |
60 | 86 | | |
61 | 87 | | |
62 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
349 | 387 | | |
350 | 388 | | |
351 | 389 | | |
| |||
0 commit comments