Repository navigation
Conversation
…h its doca-propagated copy `libraries/TRACKING/DTrackFitterKalmanSIMD.cc`, `SmoothCentral`: the covariance propagated to the point of closest approach goes into a local `myCs`, and `V_track` is computed from it; `Cs` stays the smoother's covariance at the trajectory point, as the state `Ss` already does through its copy `myS`. Two lines. `patches/master.patch` for master, `patches/r5.9.0.patch` for release 5.9.0 (same lines, 12 lines earlier). Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-11-smoothcentral-overwrites-smoothed-covariance/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-11-smoothcentral-overwrites-smoothed-covariance Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One line in `libraries/TRACKING/DTrackCandidate_factory.cc`, `DoRefit`: `fit.tanl=M_PI_2-atan(theta);` becomes `fit.tanl=tan(M_PI_2-theta);`, the definition of tanl used in the rest of the file. Nothing else changes. Release 5.9.0 does not have the refit. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-13-dorefit-tanl-fallback-wrong-formula/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-13-dorefit-tanl-fallback-wrong-formula Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad; bogus first region; last region never pushed `libraries/TRACKING/DTrackCandidate_factory_CDC.cc`, the loop that records the rejected phi regions: - the region is stored under `locSuperLayer`, the key both readers use (was `locSuperLayer - 1`); - `locPreviousIndex` and `locEndIndex` start at the first rejected seed, so no region is pushed against seed 0; - after the loop the last region is pushed. Nothing else changes. `patches/master.patch` applies unchanged to release 5.9.0. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-15-cdc-rejected-phi-regions-misindexed/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-15-cdc-rejected-phi-regions-misindexed Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…0, so the charge is always + One line in `libraries/TRACKING/DTrackCandidate_factory_CDC.cc`: after a successful fallback `FitCircle`, the factory calls `GuessChargeFromCircleFit()` in place of `FindSenseOfRotation()`. `FindSenseOfRotation` needs `tanl`, which no fit has set at this point, and returns +1 for any hits; `GuessChargeFromCircleFit` uses the circle alone and is what the Riemann branch right below already calls. Nothing else changes. `patches/master.patch` applies unchanged to release 5.9.0. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-17-cdc-fallback-circle-charge-fixed/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-17-cdc-fallback-circle-charge-fixed Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One line in `libraries/TRACKING/DTrackCandidate_factory.cc`: `break;` after `fdc_matches[i]=1; cdc_matches[j]=1;` in the first CDC/FDC matching loop, so an FDC candidate that has been merged is not merged again into a later CDC candidate. The later matching loop of the factory already skips used FDC candidates. Nothing else changes. Release 5.9.0 has a different matcher without these lines; the patch is for master only. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-21-fdc-candidate-merged-into-several-cdc/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-21-fdc-candidate-merged-into-several-cdc Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… FDC candidate after a refit `libraries/TRACKING/DTrackCandidate_factory.cc`, the step that attaches unused CDC hits to an unmatched FDC candidate: when the step refits (`num_axial>2`), the new candidate takes `fit.chisq`, `fit.ndof` and `FactorForSenseOfRotation*fit.h`, as the matched branch above already does; without a refit it keeps the FDC candidate's values as before. The same condition as the refit itself, three assignments, no other line touched. Releases 5.10.0 and master (= 5.16.0 of version set 7.10.0) (`patches/master.patch`): release 5.9.0 has an older candidate finder whose stray-hit step does not refit, so it has no such mismatch and the patch does not apply there. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-22-unused-cdc-refit-takes-fdc-values/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-22-unused-cdc-refit-takes-fdc-values Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DTrackFitterKalmanSIMD.cc`, central `FastStep`: the loss term updates `S(state_q_over_pt)` in place of `S(state_q_over_p)`, which is `state_z` in the central state vector. The term keeps `one_over_p` of the start of the step, as the forward `FastStep` does. Nothing else changes. Release 5.9.0 has the line two lines earlier: `patches/r5.9.0.patch`. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-25-central-faststep-eloss-into-z/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-25-central-faststep-eloss-into-z Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ond match empties it One line in `libraries/TRACKING/DTrackCandidate_factory.cc`: `mData[i]->cdchits=std::move(cdchits);` becomes a copy, `mData[i]->cdchits=cdchits;`. The local list is read again when the loop over the FDC candidates finds a second match; a copy keeps it intact. Nothing else changes. Release 5.9.0 does not have the final matching pass. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-3-final-fdc-match-empties-cdc-hits/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-3-final-fdc-match-empties-cdc-hits Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DTrackCandidate_factory_FDCCathodes.cc`, `GetPositionAndMomentum(segment, pos, mom)`: the field taken for pt becomes `fabs(bfield->GetBz(x,y,zmin))`, as in the twin routine for a helical fit. The direction is already set by the charge and `FactorForSenseOfRotation`. One line. The patch applies to release 5.9.0 with an offset of 74 lines and was built and run there. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-34-fdc-cathode-momentum-signed-bz/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-34-fdc-cathode-momentum-signed-bz Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… charge, so in a reversed field it goes the wrong way round the circle `libraries/TRACKING/DTrackCandidate_factory_FDCCathodes.cc`, `GetPositionAndMomentum(segment, pos, mom)`: the step angle becomes `-FactorForSenseOfRotation*dz*q_over_rc_tanl`, with a comment. `FactorForSenseOfRotation` is -1 for positive Bz, so with the 2025 maps the step is the same as before; in a reversed field it now goes the same way round the circle as the trajectory. One line. The patch applies to release 5.9.0 with an offset of 74 lines (patch dry run; not built at 5.9.0). It is independent of the fix of the momentum sign in the same routine (`fabs(Bz)`); the two patches touch different lines and apply in either order. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-34b-fdc-cathode-start-step-charge-sign/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-34b-fdc-cathode-start-step-charge-sign Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tiple-scattering fields `libraries/TRACKING/DReferenceTrajectory.cc`, `FastSwimForHitSelection`: in the branch that ends the swim when a step leaves the tracking volume, the step gets the running sums `itheta02`, `itheta02s`, `itheta02s2` and `invX0=Nswim_steps/X0sum` before the break, the same four lines every other step gets at the end of the loop. Nothing else changes. `patches/master.patch` for master; `patches/r5.9.0.patch` for release 5.9.0 (same lines, 5 lines later; the 5.9.0 step applied the master patch with that offset). Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-39-fastswim-last-step-stale-scattering/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-39-fastswim-last-step-stale-scattering Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DReferenceTrajectory.cc`, `FastSwim(..., origin, dir, smax)`: `ptot+=dP_dx*ds` becomes `ptot-=dP_dx*fabs(ds)`. `dP_dx` already holds the direction sign, so the step length enters without its sign. One line. The patch applies to release 5.9.0 with an offset of 5 lines. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-43a-fastswim-forward-gains-momentum/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-43a-fastswim-forward-gains-momentum Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DTrackFitter.cc`, `CorrectForELoss`: the back-swim keeps `kBackward` and passes the momentum and charge as they are; the final `mom = -mom` goes. `kBackward` alone steps backwards and restores the loss. Keeping `-mom`, `-q` with `kForward` instead would reverse once but lose momentum on the way back, so the patch keeps `kBackward`. Nothing else changes. Release 5.9.0 has the code five lines later: `patches/r5.9.0.patch`. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-43b-correctforeloss-direction-reversed-twice/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-43b-correctforeloss-direction-reversed-twice Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DReferenceTrajectory.cc`, `Swim`: `PropagateCovariance` gets `swim_step->mom` and `swim_step->origin`, the state at the start of the current step, in place of the arguments of `Swim`. Nothing else changes. Release 5.9.0 has the line at 812: `patches/r5.9.0.patch`. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-43c-swim-covariance-start-state/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-43c-swim-covariance-start-state Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DReferenceTrajectory.cc`, `Straw_dx`: `a = |B|^2`, `b = 2 A.B`, `c = |A|^2 - r^2`, the coefficients of the intersection of the line with the cylinder. Nothing else changes. Release 5.9.0 has the lines at 2247: `patches/r5.9.0.patch`. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-43e-straw-dx-wrong-quadratic/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-43e-straw-dx-wrong-quadratic Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`libraries/TRACKING/DReferenceTrajectory.cc`, `operator=`: the owned buffer is freed and reallocated when it is smaller than `rt.max_swim_steps`, the capacity the operator then records, in place of `rt.Nswim_steps`. Keeping the owned buffer with its own capacity would also be safe but would cut later swims short; the patch keeps the recorded capacity and makes the buffer match it. Nothing else changes. Release 5.9.0 has the code four lines later: `patches/r5.9.0.patch`. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-43f-reftraj-assignment-keeps-small-buffer/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-43f-reftraj-assignment-keeps-small-buffer Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tersectionWithRadius/Plane `libraries/TRACKING/DReferenceTrajectory.cc`: - `GetIntersectionWithRadius`: the existing `Nswim_steps<1` branch now returns `VALUE_OUT_OF_RANGE` after its message. - `GetIntersectionWithPlane`: the early-return test becomes `Nswim_steps<1 || origin.z()>...`, so the last step is read only when it exists. Both changes use the return value the functions already give for "no intersection". Two lines. The patch applies to release 5.9.0 with an offset of 37 lines. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-43g-intersection-reads-empty-trajectory/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-43g-intersection-reads-empty-trajectory Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es the member, so FillTrackParams uses a stale or zero dz/dphi for theta, phi and the charge `libraries/TRACKING/DHelicalFit.cc`, `FitTrack()`: `float dzdphi = Syy/Sxy;` becomes `dzdphi = Syy/Sxy;`, so the fitted slope goes into the member that `FillTrackParams()` reads, as `FitTrack_FixedZvertex()` already does. One line. The patch applies to release 5.9.0 with an offset of 3 lines (patch dry run; not built at 5.9.0). Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-55-helicalfit-dzdphi-local-hides-member/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-55-helicalfit-dzdphi-local-hides-member Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hisq, so it returns the last thrown particle with chisq < 1e8 rather than the best match `libraries/TRACKING/DTrackHitSelectorTHROWN.cc`, `FindTrackNumber`: set `min_chisq = chisq` together with `myid`, so the loop returns the thrown particle closest to the track. One cause, two lines. The patch applies to release 5.9.0 unchanged. This fix should go in with the separate fix of `GetMCTrackHit` (`patches/companion-reader-itrack.patch`: filter the truth hits by `itrack`, the thrown id, instead of `track`, the Geant4 track number). Without it the corrected id selects the hits of another particle. The hit-filter fix is filed as its own finding (R3-61). Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-57-thrown-hit-selector-min-chisq-never-updated/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-57-thrown-hit-selector-min-chisq-never-updated Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rack (the Geant4 track number) where the thrown id is itrack, so truth hit lists of THROWN tracks miss or mix hits after any intermediate particle `libraries/TRACKING/DTrackHitSelectorTHROWN.cc`, `GetMCTrackHit`: compare the filter with `DMCTrackHit::itrack` instead of `DMCTrackHit::track`, and drop the `primary` test (a positive `itrack` equal to the thrown id already means the particle itself). Three lines. The patch applies to release 5.9.0 unchanged. It should go in with the fix of `FindTrackNumber` (R3-57), which picks the thrown id this filter uses. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-61-thrown-hit-selector-filters-geant4-track/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-61-thrown-hit-selector-filters-geant4-track Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tBfield() default argument) whatever the event's run; today the sticky BFIELD_MAP (R8-3) hands it a second copy of the run's map, with R8-3 fixed it gets run 1's NoField `src/libraries/TRACKING/DTrackTimeBased_factory_THROWN.cc` line 73: `GetBfield()` becomes `GetBfield(runnumber)`, as in DTrackWireBased_factory_THROWN.cc. `patches/master.patch` applies with `git apply -p1` at current halld_recon master. Merge it together with any change that stops BFIELD_MAP from sticking to its first value. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-66-thrown-tracks-take-field-of-run-1/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-66-thrown-tracks-take-field-of-run-1 Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rst to the last rejected seed in seed-index order, not over the group's phi, so some seeds lie outside it (2 of 17 super layers) `libraries/TRACKING/DTrackCandidate_factory_CDC.cc`, `Reject_SuperLayerSeeds_HighSeedDensity`: keep, for the group being formed, the smallest arc whose ends are seed edges and which holds every seed range of the group, and store that arc as the group's region (instead of the first seed's first phi and the last seed's last phi in index order). When the ranges wrap the circle the region is the whole circle. The R3-15 patch and then this one apply to release 5.9.0. Card: https://pages.jlab.org/halld/auto-hunt/cards/r3-15b-cdc-rejected-region-index-order-not-phi/index.html Evidence folder: https://code.jlab.org/halld/auto-hunt/-/tree/main/bughunt/confirmed/halld_recon/TRACKING/r3-15b-cdc-rejected-region-index-order-not-phi Ported by hand onto this branch: written on top of R3-15; R3-15's comment on the 1-based key is kept on the group-region push_back Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R3-11 S4 (commit 9241a29)CDC hit pulls get their track error from a matrix the smoother has already overwrittenWhat is wrong. After a central track is fitted, the smoother walks back along it and, at each CDC hit, computes The code (on GitHub): With the fix: What it does (1000 raw events of run 132404, 2025-01):
Plot: BH-881: 18322 of 19598 CDC hits get their track error from an overwritten matrix; 0 with the fix BH-881. Smoothed CDC hits of 1000 raw events, today and with the fix. Dashed: the count expected from the Who is affected.
Who is not. Tracks, showers, particles, reduced (REST) files and analysis trees: the smoother feeds only the The fix. Move a copy of the error matrix to the wire. Grade S4 (lowest of four): 0 of 998 events change a reconstructed object; only monitoring and alignment inputs Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-11-smoothcentral-overwrites-smoothed-covariance/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-13 S4 (commit 29dc053)A rare fallback of the track finder gives forward track candidates a polar angle of 32 to 43 degreesWhat is wrong. The track finder refits candidates that join CDC and FDC hits. When the straight-line part of The code (on GitHub): With the fix, the cotangent, the form the same code uses elsewhere for this slope: What it does (track candidates that take the fallback):
Plot: BH-887: all 6 changed candidates sit at 32.6 to 42.6 deg today; with the fix 0.5 to 30.0 deg BH-887. The 6 track candidates the fix changes in the first 100 000 events of a 2025-01 raw file, today and with Who is affected.
Who is not. Physics results: no benchmark reaction moves beyond the run-to-run noise (1M raw events, 2025-01 The fix. Use the cotangent of the forward candidate's angle. Grade S4 (lowest of four): candidates change in 6 of 99 998 events, final tracks in 2; which side is closer to Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-13-dorefit-tanl-fallback-wrong-formula/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-15 S4 (commit f4e0445)Dense CDC regions are mostly not remembered, so outer layers start tracks there anywayWhat is wrong. The CDC has seven rings of wire layers, called super layers. Where one super layer's hits are The code (on GitHub): With the fix every stretch, the last included, is stored under its own number, from its first dropped seed. What it does (1000 raw events of a 2025-01 run):
BH-893 version 2. Every dense super layer in 1000 raw events and what is stored for it. The three faults were not Who is affected.
Who is not. Physics analyses at 2025-01 rate: no benchmark reaction moves beyond the run-to-run noise (1M raw The fix. Store every stretch, the last one included, under its own super layer and with its true edges. Grade S4 (lowest of four): track candidates change in 2 of 998 events (0.2%), final tracks in 1. It says nothing Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-15-cdc-rejected-phi-regions-misindexed/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-17 S4 (commit 67191e7)A rare fallback of the CDC track finder gives every circle it fits the same chargeWhat is wrong. The CDC track finder fits a circle to each track seed. When that fit fails, a second circle fit The code (on GitHub): With the fix, the fallback takes the charge from the circle, as the first fit does: What it does:
Plot: BH-889: the one candidate the fix changes in 998 events, today moving inward, with the fix outward BH-889. The changed candidate (5 CDC hits) seen along the beam, start point and direction today and with the fix. Who is affected.
Who is not. Final tracks and physics: the changed candidate makes no track, and no benchmark reaction moves The fix. Take the charge from the circle in the fallback too. Grade S4 (lowest of four): one candidate changes in 1 of 998 events, nothing downstream. Present in release 5.9.0 Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-17-cdc-fallback-circle-charge-fixed/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-21 S4 (commit dfb847e)One forward track piece can be joined to two central track candidates at onceWhat is wrong. The track finder joins forward (FDC) track pieces to central (CDC) track candidates. Once a pair The code (on GitHub): With the fix the inner loop stops after the first match: What it does (998 raw events of a 2025-01 run):
BH-878. The two candidates that take a forward piece a second time, today and with the fix. Today's and fixed Who is affected.
Who is not. Physics analyses: no benchmark reaction moves beyond the run-to-run noise (1M raw events). The number The fix. Stop the search once a forward piece is joined. Grade S4 (lowest of four): tracks change in 2 of 998 events (0.2%). It says nothing about physics weight. Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-21-fdc-candidate-merged-into-several-cdc/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-22 S4 (commit f0538c6)Forward track candidates that pick up stray CDC hits keep the fit quality and charge of the FDC fit aloneWhat is wrong. The track finder gives CDC hits that no candidate uses ("stray" hits) to a forward (FDC) The code (on GitHub): With the fix, after a refit (as the code already does for the other matching step a few lines above): What it does (track candidates the fix changes):
Plot: BH-525: today no changed candidate counts its CDC hits; with the fix 591 of 749 count them all BH-525. Candidates by CDC hits the fit quality leaves out. With the fix these are, by reading, stereo hits, added Who is affected.
Who is not. Final tracks and physics. Later fits start from the candidate's charge but refit the hits: a charge The fix. After a refit, take chi-square, degrees of freedom and charge from the refit. Grade S4 (lowest of four): the changed values stay inside the reconstruction; no file or final track carries Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-22-unused-cdc-refit-takes-fdc-values/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-25 S4 (commit d1aaf37)The central track step puts its energy-loss correction into the track's z positionWhat is wrong. The track fitter's fast helical step can apply an energy-loss term at its end. The central (CDC) The code (on GitHub): With the fix: What it does (the step called directly on a constructed track, 2 T field, pion mass; a 1 cm step backward with
BH-883. One step of the same track state, in the three test cases with the term. Signs follow the code: stepping Who is affected.
Who is not. Every reconstruction and simulation output: the line ran in no event of this study. No physics The fix. Write the term into q/pt. Grade S4 (lowest of four): the line runs in no event; the grade does not say how wrong the line is. Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-25-central-faststep-eloss-into-z/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-3 S4 (commit 323f72f)A track candidate extended twice in the forward direction ends with no CDC hitsWhat is wrong. The track finder ends with a pass that joins forward (FDC) track pieces to candidates that already The code (on GitHub): With the fix the list is copied: What it does (998 raw events of a 2025-01 run):
Plot: BH-875: today 3 of 4 changed track candidates end with no CDC hits; the fix keeps 1, 10 and 1 BH-875. CDC hits on each candidate the fix changes, today and with the fix. The track fit then picks its own hits Who is affected.
Who is not. Physics analyses: no benchmark reaction moves beyond the run-to-run noise (1M raw events). The The fix. Copy the list instead of handing it over. Grade S4 (lowest of four): track candidates change in 4 of 998 events (0.4%), final charged tracks in 1. It says Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-3-final-fdc-match-empties-cdc-hits/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-34 S4 (commit 7aada3f)FDC track stubs would point backward in a reversed solenoid fieldWhat is wrong. For an FDC segment linked to no other, the track finder makes a stub whose start momentum The code. The real lines, shortened (on GitHub): Fixed, as the routine for linked segments does: What it does (one forward segment, momentum in GeV/c; the charge flips with the field, so both are the same
The small transverse difference left is a separate slip, with its own finding. BH-277. Momentum of one forward FDC segment in both field directions, before and after the fix. Limits: constant Who is affected. Reconstruction or simulation with a reversed solenoid field: single-segment FDC stubs start Who is not. Every run with the standard field direction: 0 of 998 raw events change. The fix. Use the size of Bz. Grade S4 (lowest of four): 0 of 998 events of the output change. Benchmark jobs run this line, but with a Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-34-fdc-cathode-momentum-signed-bz/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-34b S4 (commit ddf2c90)FDC track stubs would start off their track in a reversed solenoid fieldWhat is wrong. For an FDC segment linked to no other, the track finder puts the stub's start point 1 cm upstream The code. The real lines (on GitHub): Fixed, with the field sign the routine already reads (-1 for a positive field): What it does (one forward segment, start point in cm; the charge flips with the field, so both are the same
BH-278. Start point of one forward FDC segment in both field directions, before and after the fix. Limits: constant Who is affected. Reconstruction or simulation with a reversed solenoid field: single-segment FDC stubs start Who is not. Every run with the standard field direction: the fixed line is the same expression there. The fix. Turn the step with the field sign as well as the charge. Grade S4 (lowest of four): no output can change with a positive field. A companion finding fixes the stub's Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-34b-fdc-cathode-start-step-charge-sign/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-39 S4 (commit bb90058)The swim that picks track hits keeps stale scattering errors in its last stepWhat is wrong. By default, before the wire-based fit, each track candidate is swum through the detector, and The code. The real lines, shortened (on GitHub): Fixed: the same four lines also inside the exit branch, before the break. What it does (a direct call with three test tracks; 1000 raw events of a 2025-01 run):
BH-900. Exit-step scattering sums of three test tracks, and the tracks that change in 1000 raw events of a 2025-01 Who is affected. Wire-based track fits, for a hit whose nearest step is the exit step: rare, one event in 998 at Who is not. All other hits. No benchmark reaction moves beyond the run-to-run noise (1 000 000 raw events). The fix. Write the sums for the last step too. Grade S4 (lowest of four): tracks change in 0 of 998 events of the output at master and in 1 of 998 at release Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-39-fastswim-last-step-stale-scattering/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-43a S4 (commit f1bd19a)A forward swim to a line gains momentum where it should lose itWhat is wrong. A tracking routine swims a track to its closest approach to a line and corrects the momentum for The code. The real lines, shortened (on GitHub): Fixed: What it does (a 1 GeV/c pi+ swum 40 cm through the field and material of a 2025-01 run):
Plot: BH-902: a forward swim gains 2.317 MeV/c today; the backward swim is right before and after the fix BH-902. Momentum change over the two test swims, today and with the fix. Limits: constructed tracks, no event data. Who is affected. Nobody today. Code that would swim forward with this routine, in a plugin or a later change, Who is not. Reconstruction, REST files and analyses: the track factories swim backward only, and 0 of 998 raw The fix. Take the direction from the loss rate alone. Grade S4 (lowest of four): 0 of 998 events of the output change; no caller takes the wrong branch. Measured Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-43a-fastswim-forward-gains-momentum/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-43b S4 (commit ba2b859)An unused energy-loss correction of the track fitter swims the wrong wayWhat is wrong. A routine of the track fitter carries a track from its first wire back to the target and puts back The code. The real lines (on GitHub): Fixed: What it does (four test tracks from the beam line to a wire 20 cm out, then back):
Plot: BH-903: today the swim back ends near the wire; with the fix it returns to the start BH-903. Returned point of four test tracks, today and with the fix. Limits: constructed tracks, no event data. Who is affected. Nobody today. Turned back on as it stands, the call would return a point near the first wire, Who is not. Reconstruction, REST files and analyses: the track factories use their own energy-loss corrections, The fix. Keep the backward swim and drop the two manual reversals. Grade S4 (lowest of four): the routine runs in no event of the program's samples. Measured together with 12 Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-43b-correctforeloss-direction-reversed-twice/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-43c S4 (commit 69eba1b)A swim that carries a track's errors uses the start point at every stepWhat is wrong. The tracking swim can carry a track's error matrix along the track, step by step. Each step should The code. The real lines, shortened (on GitHub): Fixed: What it does (a 0.15 GeV/c pi+ in 2 T, momentum error 0.01 GeV/c across the start direction; the exact
BH-904. Flight-time variance at four points of the swim, for an error along and across the start momentum: exact, Who is affected. Nobody today. A caller that passes an error matrix would get flight-time errors that grow with Who is not. Reconstruction, REST files and analyses: every caller swims without an error matrix. The fix. Pass the position and momentum of the current step. Grade S4 (lowest of four): the code runs in no event of the program's samples. Measured together with 12 other Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-43c-swim-covariance-start-state/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-43e S4 (commit 787684f)Length of a track inside a CDC straw comes from the wrong quadraticWhat is wrong. A tracking routine returns the length of track inside one CDC straw: it finds the two points where The code. The real lines, shortened (on GitHub): Fixed: What it does (straight test tracks past a wire, straw radius 0.8 cm):
Plot: BH-906: the length in the straw is wrong in all five test crossings; the fix gives the exact chord BH-906. Length in the straw for five constructed crossings: exact chord, today, with the fix. Limits: test tracks, Who is affected. Users of the optional plugin cdc_hists on simulated events: it writes this length for each CDC Who is not. Reconstruction, REST files and analyses: no library calls the routine, and no default build The fix. Use the three coefficients of a line crossing a cylinder. Grade S4 (lowest of four): unused path; no default build includes the only caller. Measured together with 12 Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-43e-straw-dx-wrong-quadratic/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-43f S4 (commit cd9499a)Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-43f-reftraj-assignment-keeps-small-buffer/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-43g S4 (commit f011d63)Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-43g-intersection-reads-empty-trajectory/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-55 S4 (commit 1ca8ce7)Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-55-helicalfit-dzdphi-local-hides-member/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-57 S4 (commit 6603535)The truth-based hit selector gives every track the hits of the last thrown particleWhat is wrong. In simulation one can switch on a hit selector that uses the truth: each track gets the hits of the The code. The real lines, shortened (on GitHub): Fixed: What it does (1000 simulated events, 16607 searches; hits looked up as the companion fix does, in both columns):
BH-1278. Choices of the selector in 1000 simulated events, before and after the fix. Limits: one generator. Who is affected. Simulation studies that switch this selector on, to separate hit finding from fitting. Who is not. The standard reconstruction and real data: they never use this selector. The fix. Store the best match. It ships with the companion fix, which looks the hits up by the thrown particle's Grade S2 (second of four; S1 is the most severe), on jobs that choose this selector: tracks change in 287 of 1000 Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-57-thrown-hit-selector-min-chisq-never-updated/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-61 S4 (commit 94e9139)Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-61-thrown-hit-selector-filters-geant4-track/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-66 S4 (commit cd5788e)Simulated (thrown) tracks ask for the magnetic field of run 1, not of the event's runWhat is wrong. The code that refits the generated (thrown) tracks asks for the magnetic field without naming a run, so it gets the field of run 1. Every other tracking code names the event's run. Today a service quirk hides this by returning a second copy of the right map; once that is fixed, these tracks get no field. The code (on GitHub): What it does (run 132404):
Plot: Service fixed: coded request gets no field, fixed request the run map Limits: the factory was not compiled; its two calls were run on the geometry service. Who is affected. Simulation jobs with a plugin that asks for the refit thrown tracks. Who is not. Raw-data jobs and the standard simulation benchmark jobs. The fix. Pass the event's run to the field request; merge it with the geometry-service fix. Grade S4: today no output changes; the cost is memory and 2 s per job. Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-66-thrown-tracks-take-field-of-run-1/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
R3-15b S4 (commit 09c68c4)Dense CDC regions are stored over the wrong stretch of angle, so they can miss the seeds they should coverWhat is wrong. Where the CDC hits of one super layer are too dense, the track finder drops the track seeds there The code (on GitHub), with the earlier fix in place: With the fix each group keeps the smallest arc that holds every one of its seeds, and stores that. What it does (1000 raw events of a 2025-01 run, 17 dense super layers):
BH-1301. The six dense super layers whose stretch changes. Limits: one run at 2025-01 rate; with the fix 5 of the 6 Who is affected.
Who is not. Physics analyses at 2025-01 rate: with both fixes no benchmark reaction moves beyond the run-to-run The fix. Store, per dense group, the smallest arc that holds all its seeds. Grade S4 (lowest of four): track candidates change in 2 of 998 events (0.2%). It says nothing about physics weight. Full card with plots and the evidence for the code owner: https://pages.jlab.org/halld/auto-hunt/cards/r3-15b-cdc-rejected-region-index-order-not-phi/index.html Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
|
This pull request was split out of #1259 at your request. It collects the 22 minor (S4) tracking findings, from R3-11 ( Created by Autonomous HallD "auto-hunt" campaign (executed by Claude) |
|
Test status for this pull request: SUCCESS Summary: summary.txt Build log: make_auto-hunt_tracking-s4.log |
staylorjlab
left a comment
There was a problem hiding this comment.
R3-13: Yes, this fixes a mix-up between tan(lambda) and lambda.
staylorjlab
left a comment
There was a problem hiding this comment.
R3-34, R3-34b. These are fine. We don't plan to reverse the solenoid field, but the consistency with other parts of the code is improved.
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
Split out of #1259 at the reviewer's request. #1259 first held all 49 tracking findings. It now holds the production-tracking fixes (S1 to S3); the straight-line (field-off) fixes and the minor (S4) fixes are in two separate pull requests, #1263 (straight-line) and this one. The commits are the same changes as before, cherry-picked onto the current master without conflicts; the three pull requests merge together in any order, and their combination equals the former #1259 branch file for file.
Overall gains
22 confirmed bugs fixed in this pull request (S4 22), one commit each, in the order of the commits (most serious first).
Related findings and commits that belong together
DTrackFitterKalmanSIMD.cc,DReferenceTrajectory.cc,DTrackFitter.cc,DHelicalFit.cc,DTrackCandidate_factory_FDCCathodes.cc) in different places; they merge without conflict in either order.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)