Skip to content

Jdkio/308 kalman chi2 - #309

Open
jdkio wants to merge 2 commits into
mainfrom
jdkio/308_kalman_chi2
Open

Jdkio/308 kalman chi2#309
jdkio wants to merge 2 commits into
mainfrom
jdkio/308_kalman_chi2

Conversation

@jdkio

@jdkio jdkio commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Fixes a few issues with the kalman filter. First, the chi2 issue mentioned in #308. Second, that the muon and anti-muons were switched.

SFBayLaser and others added 2 commits August 14, 2026 09:22
TMS_Kalman::Runchi2() deliberately skips nodes 0 and 1 when computing
chi2 ("too sensitive at the end"), but TMS_KalmanNode::chi2 was never
initialized in the constructor. GetTrackChi2() unconditionally sums
chi2 across all nodes, so every track's chi2 -- and therefore the
plus/minus charge-sign selection at TMS_TrackFinder::FindTracks()'s
use_minus decision -- included uninitialized stack memory.

Confirmed via valgrind --track-origins=yes: this was the only
non-ROOT/zlib finding in the whole reconstruction pipeline (everything
else was well-known ROOT TStorage::UpdateIsOnHeap and Geant4's bundled
zlib longest_match/deflate_fast false positives). Initializing chi2 to
0.0 matches the apparent intent -- nodes excluded from the chi2 sum
should contribute nothing, not garbage.
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.

2 participants