fix: prevent unphysical boost in UndoAfterBurner when only one beam found - #2891
Merged
wdconinc merged 1 commit intoAug 24, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates eicrecon::UndoAfterBurner to avoid unphysical boosts/rotations when processing particle-gun MC inputs, which previously could generate extreme momentum values in MCParticlesHeadOnFrameNoBeamFX and break downstream CI validation (capybara histograms).
Changes:
- Detect presence of incoming beam lepton/hadron and add an early “identity transform” path intended for particle-gun events.
- Remove the prior “fake beam particle” fallback logic that attempted to synthesize beam four-vectors.
- Keep the existing boost/rotation workflow for collision events where both beam particles are found.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The fallback logic at lines 67-75 can set hasBeamHadron=true by finding secondary neutrons from particle gun events, but leave hasBeamLepton=false when the neutron energy is not in [270,280] GeV. The old check 'if (!hasBeamHadron && !hasBeamLepton)' only returns when BOTH are false, allowing the code to proceed with: - e_beam = (0,0,0,0) (uninitialized) - h_beam = (small values from secondary neutron) This produces beta^2 > 1 (faster than light), resulting in extreme momentum values ~10^308 GeV after Lorentz transformation. Fix: Change && to || so we return if EITHER beam is missing. This is consistent with the line 62 check and prevents unphysical boosts. Root cause analysis: - Input MCParticles have normal momentum (~1.4 GeV) - Fallback finds neutron with E=0.94 GeV, sets hasBeamHadron=true - e_beam stays (0,0,0,0), h_beam = (0.024, 0, 0.94, 0.94) - beta = (-0.024/0.94, 0, -0.94/0.94) = (-0.026, 0, -1.0) - beta^2 = 1.0006 > 1 → unphysical boost → extreme values Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wdconinc
force-pushed
the
fix-head-on-frame-particle-gun
branch
from
August 24, 2026 03:00
d9c43cb to
3e26c16
Compare
Contributor
Author
|
Still failed, but now likely due to having used a |
wdconinc
merged commit Aug 24, 2026
e1c4e52
into
acts-event-data-seed-deprecated-declarations
51 of 64 checks passed
Merged
14 tasks
Member
|
cc @ajentsch FYI |
tom-bleher
pushed a commit
to tom-bleher/EICrecon
that referenced
this pull request
Sep 5, 2026
… fix UndoAfterBurner (eic#2885) ### Briefly, what does this PR introduce? Please link to any relevant presentations or discussions. In eic/containers#387 we bumped Acts to v46.8.1, but this deprecates the seeding data model (as is fixed in eic#2524, but that's now not ready for merging). Because we build some jobs with `-Werror` we have to allow the deprecated declarations to get CI to complete. See e.g. https://github.com/eic/EICrecon/actions/runs/32506264064/job/97200314068#step:7:571. This PR also includes the following stacked PRs: - eic#2889 This pull request updates the workflow configuration in .github/workflows/linux-eic-shell.yml to improve control over job error handling in the eicrecon-dis job. The main changes introduce a continue-on-error setting to the job matrix, allowing certain job runs (2DStrip in particular) to proceed even if errors occur. - eic#2891 Single-electron gun events with secondary neutrons produce extreme momentum values (~10³⁰⁸ GeV) in MCParticlesHeadOnFrameNoBeamFX, causing CI failures in capybara histogram generation, because the fallback logic incorrectly treats secondary hadrons from particle gun events as beam particles. ### What is the urgency of this PR? - [x] High (please describe reason below) - [ ] Medium - [ ] Low CI is currently broken on `main`. ### What kind of change does this PR introduce? - [x] Bug fix (issue: https://github.com/eic/EICrecon/actions/runs/32506264064/job/97200314068#step:7:571) - [ ] New feature (issue #__) - [ ] Optimization (issue #__) - [ ] Updated parameters, constants (issue #__) - [ ] Updated documentation - [ ] other: __ ### Please check if any of the following apply - [ ] This PR requires changes to geometry (epic PR: __) - [ ] This PR requires changes to EDM4eic (EDM PR: __) - [ ] This PR introduces breaking changes. Please describe changes users need to make below. - [ ] This PR changes default behavior. Please describe changes below. - [ ] AI was used in preparing this PR. Please describe usage below. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix MCParticlesHeadOnFrameNoBeamFX overflow for particle gun events
Stacked on: #2887 (acts-event-data-seed-deprecated-declarations)
Problem
Single-electron gun events with secondary neutrons produce extreme momentum values (~10³⁰⁸ GeV) in
MCParticlesHeadOnFrameNoBeamFX, causing CI failures in capybara histogram generation:Root Cause
The fallback logic (lines 67-75) incorrectly treats secondary hadrons from particle gun events as beam particles:
hasBeamHadron=true, leaveshasBeamLepton=falseif (!hasBeamHadron && !hasBeamLepton)only returns if BOTH are falsee_beam = (0,0,0,0)(uninitialized)h_beam = (0.024, 0, 0.94, 0.94)(from secondary neutron)Solution
One-character fix: Change
&&to||on line 98.This is consistent with the check at line 62 and prevents unphysical boost calculations.
Effect
MCParticlesHeadOnFrameNoBeamFXwill be empty (no valid collision frame)Testing
Verified with
rec_e_1GeV_20GeV_craterlake.edm4eic.root: