Skip to content

fix: fully move CherenkovRadiator state into RadiatorHistory#49

Merged
wdconinc merged 3 commits intov1from
v1-thread-safety
Jan 28, 2026
Merged

fix: fully move CherenkovRadiator state into RadiatorHistory#49
wdconinc merged 3 commits intov1from
v1-thread-safety

Conversation

@wdconinc
Copy link
Contributor

Briefly, what does this PR introduce?

This PR moves the problematic stateful aspects of CherenkovRadiator into RadiatorHistory. With this set of changes, IRT v1 can work in a thread-safe manner without imposing thread-locking requirements on the callers.

What kind of change does this PR introduce?

  • Bug fix (issue: thread-safety)
  • 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?

No. Fully backward compatible for current callers that use the thread-unsafe interface.

@wdconinc wdconinc marked this pull request as ready for review January 28, 2026 01:19
Copilot AI review requested due to automatic review settings January 28, 2026 01:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses thread-safety issues in IRT v1 by moving stateful data (trajectory locations and bin counts) from the shared CherenkovRadiator class to the per-event RadiatorHistory class. This allows multiple threads to safely process events concurrently without requiring external synchronization.

Changes:

  • Moved m_TrajectoryBinCount and m_Locations from CherenkovRadiator to RadiatorHistory for thread safety
  • Added backwards-compatible deprecated API in CherenkovRadiator to maintain compatibility with existing code
  • Updated ChargedParticle::PIDReconstruction to use the new thread-safe API with fallback to deprecated API

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
include/RadiatorHistory.h Added trajectory management methods and members (GetTrajectoryBinCount, SetTrajectoryBinCount, GetLocations, AddLocation, ResetLocations); initialized m_TrajectoryBinCount in constructor; incremented ClassDef to version 2
include/CherenkovRadiator.h Renamed members with _deprecated suffix; added backwards-compatible methods with deprecation warnings; incremented ClassDef to version 6
source/ChargedParticle.cc Implemented fallback logic to use new thread-safe API when available, falling back to deprecated API for backwards compatibility; updated location access to use the appropriate API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wdconinc wdconinc merged commit 188e837 into v1 Jan 28, 2026
2 checks passed
@wdconinc wdconinc deleted the v1-thread-safety branch January 28, 2026 16:05
github-merge-queue bot pushed a commit to eic/EICrecon that referenced this pull request Feb 14, 2026
### Briefly, what does this PR introduce?
This PR makes avoids locking IRT1 when a thread-safe IRT1 is detected
(e.g. the version with the changes in
eic/irt#49). If a thread-unsafe IRT1 is
detected, we continue locking.

### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [x] New feature (issue: avoid locking IRT in EICrecon code with
thread-safe design)
- [ ] 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?
No.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments