Commit d80c5cb
Fix out-of-range hit access in the TOF hit merging
This fixes a crash in TOF ProcessHits when the first step of an event
cannot be assigned to a pad.
- Geo::getIndex returns -1 when the position does not resolve to a valid
sector/plate/strip.
- mLastChannelID is -1 at the start of every event, so channel ==
mLastChannelID holds, the || does not short-circuit, and mHits->back()
is called on an empty vector, giving "free(): invalid pointer".
- The merging condition now requires a non-empty hit vector and a valid
channel, so an off-pad step always starts a new hit.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent e4eaccd commit d80c5cb
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
0 commit comments