Skip to content

R7-58 S1 For an open-ended reaction the fitted step-0 decaying particle is written to the tree with zero momentum: DecayingLambda__P4_KinFit is (0, 0, 0, 1.115683 GeV) in 146 of 146 combos - #1223

Closed
DraTeots wants to merge 1 commit into
masterfrom
auto-hunt/analysis-r7-58

Conversation

@DraTeots

@DraTeots DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

These fixes come from the Hall D bug hunt, an autonomous campaign that read the GlueX software, built a test for every suspect line, and kept only findings confirmed by a measurement: a test run of the program on data or simulation, or a direct call of the code against a known answer. Each commit below fixes one finding and is named by its finding id and grade (S1 most serious, S4 least). Every commit has a comment in this pull request with the finding's card: what is wrong, the code, the measured effect, who is affected and the fix. Full cards with plots are on the campaign pages (JLab login): https://pages.jlab.org/halld/auto-hunt/index.html, by library: https://pages.jlab.org/halld/auto-hunt/libraries.html

Overall gains

1 confirmed bugs fixed in this pull request (S1 1), one commit each, in the order of the commits (most serious first).

finding grade what was wrong the fix
R7-58 S1 ReactionFilter can write a decay with no beam, such as Lambda -> p pi- (opt-in, a job option). Once its three crashes and tree layout are repaired (findings R7-51, R7-32, R7-53, R7-54 of this report), the fitted Lambda is written with zero momentum: the code asks for it at its production point, which the fit never determined, and ignores the refusal. For a user the five are one failure: no usable fitted beamless tree until all are fixed. Keep the fitted values when the move to the other vertex is refused.

How it was tested

Each finding's card says how it was confirmed (a run of the program before and after the fix on the same events, or a direct call of the function). The commits were rebased on the current default branch; every changed source file compiles (syntax check against the release headers). A full build and a physics benchmark of this combination of commits has not been run on the new base.


Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

…le is written to the tree with zero momentum: DecayingLambda__P4_KinFit is (0, 0, 0, 1.115683 GeV) in 146 of 146 combos

`libraries/ANALYSIS/DParticleComboCreator.cc`, `Build_KinematicData`: the propagation to the other vertex is tried
only where it was tried before, and its return value is read; when it is not tried or is refused, the object takes the
fitted values as they are (the first branch, unchanged). Before, a refused propagation left the object from the
resource pool with momentum zero. Six lines added (two of them a comment), three removed; the branch that runs when
the propagation succeeds is unchanged.

This depends on the fixes of the open-ended form: packages `r7-51-reactionfilter-open-ended-reaction-crash` (R7-51,
R7-32), `r7-53-open-ended-fit-null-production-step` and `r7-54-open-ended-step0-booked-as-beam`. Without them no
open-ended combo is fitted and written. The patch itself applies at master alone; it is written against master
115209d (the measured step carried it one line lower, below a line the R7-53 fix adds in the same file). The file is
identical in release 5.9.0; `patches/r5.9.0.patch` is the same patch.
Card: https://pages.jlab.org/halld/auto-hunt/cards/r7-58-open-ended-step0-fit-momentum-zero/index.html
Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/ANALYSIS/r7-58-open-ended-step0-fit-momentum-zero

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DraTeots

DraTeots commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

R7-58 S1 (commit 756ac1d)

A fitted reaction without a beam writes its decaying particle at rest: the last link of one failure

What is wrong. ReactionFilter can write a decay with no beam, such as Lambda -> p pi- (opt-in, a job option).
Once its three crashes and tree layout are repaired (findings R7-51, R7-32, R7-53, R7-54 of this report), the fitted
Lambda is written with zero momentum: the code asks for it at its production point, which the fit never determined,
and ignores the refusal. For a user the five are one failure: no usable fitted beamless tree until all are fixed.

The code (on GitHub):

if((locProductionVertexFlag == locKinFitParticle->Get_VertexP4AtProductionVertex()) || ...)
{
    locKinematicData->setMomentum(...locKinFitParticle->Get_Momentum()...);   // the fitted values
    ...
}
else   // move to the other vertex; for this Lambda that vertex was never fitted
    dKinFitUtils->Propagate_TrackInfoToCommonVertex(locKinematicData, locKinFitParticle, ...);   // returns false, unread

Fixed:

bool locPropagatedFlag = false;
if(!( ...same test... ))
    locPropagatedFlag = dKinFitUtils->Propagate_TrackInfoToCommonVertex(locKinematicData, locKinFitParticle, ...);
if(!locPropagatedFlag)
    { ...the fitted values, as before... }

What it does (4000 simulated events, Lambda -> p pi-; 146 candidates in 132 tree entries; both sides carry the
earlier repairs, as today's code writes no tree):

earlier repairs only with this fix too
Lambda momentum zero 146 of 146 0 of 146
Lambda momentum (median) 0 1.733 GeV/c, equal to its fitted p + pi-

Plot: BH-413: written Lambda momentum against its fitted p + pi-

BH-413. Limits: one reaction, one fit type.

Who is affected. Users who fit a reaction without a beam and read its fitted decaying particle.

Who is not. Particles that decay where they are made, as in gamma p -> eta p, eta -> pi0 gamma gamma: only a
particle that flies before decaying takes this step (by reading). The single K+ Lambda candidate run alongside
changed only where identical runs also differ.

The fix. Keep the fitted values when the move to the other vertex is refused.

Grade S1 (most severe of four): with the earlier repairs, the Lambda momentum is zero in all 132 tree
entries. It counts how often a value is wrong, not physics weight; opt-in.


Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r7-58-open-ended-step0-fit-momentum-zero/index.html
Evidence folder (tests, patches, review): https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/ANALYSIS/r7-58-open-ended-step0-fit-momentum-zero

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@gluex

gluex commented Dec 1, 2026

Copy link
Copy Markdown

Build status for this pull request: FAILURE

Build log: make_auto-hunt_analysis-r7-58.log
Build report: report_auto-hunt_analysis-r7-58.txt

@aaust

aaust commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Please combine all changes to the analysis library that are only relevant for "open-ended reactions" without a beam particle into one pull request. If I am correct, these should be: R7-58, R7-54, R7-53 and R7-32

@DraTeots

DraTeots commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Closed as the analysis maintainer asked in #1223: this fix is now in #1273 with the other open-ended-reaction fixes of the analysis library (R7-53, R7-32, R7-54, R7-58), one commit each.

Created by Autonomous HallD "auto-hunt" campaign (executed by Claude)

@DraTeots DraTeots closed this Dec 4, 2026
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.

3 participants