-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid undefined unsigned integer behavior in pid size checks (#984)
### Briefly, what does this PR introduce? This avoids undefined behavior flagged by ubsan in the statement `std::size_t n_tracks = -1;` and in the signed/unsigned integer comparisons in the pid system, which caused at least MergeTracks to always fail. It also adds output on the problematic sizes, e.g. ``` [DRICH:DRICHMergedTracks] [error] cannot merge input track collections with different sizes 3, 5 [DRICH:DRICHIrtCherenkovParticleID] [error] radiators have differing numbers of TrackSegments 3, 5, 0 ``` ### What kind of change does this PR introduce? - [x] Bug fix (issue #__) - [ ] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? Yes, should now attempt MergeTracks. --------- Co-authored-by: Christopher Dilks <[email protected]>
- Loading branch information
Showing
2 changed files
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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