Skip to content

unit tests#289

Open
gavinsdavies wants to merge 7 commits into
mainfrom
feature/gsdavies/unit-tests
Open

unit tests#289
gavinsdavies wants to merge 7 commits into
mainfrom
feature/gsdavies/unit-tests

Conversation

@gavinsdavies
Copy link
Copy Markdown
Contributor

test adding some unit tests for KalmanReco and RecoUtils geom functions.
Essentially testing the maths for functions in there.

- Forward-declare TrackSegment instead of including full header, removing canvas dependency from public API
- Change findTrackIntersection and findTrackIntersectionNew to use const references
- Update implementations to match new signatures
- Fix CMake deprecation warning in test/CMakeLists.txt (SOURCES → SOURCE)

Benefits:
- Reduces header coupling and canvas compile-time dependency
- Improves API efficiency with pass-by-reference
- Enables test_recoutils to compile without canvas library"
The test "ZeroFieldJacobianLeavesInitialCovUnchanged" had incorrect
expectations. When propagating with B=0 and tx=ty=0, the Jacobian is
NOT the identity: J[0][2]=st and J[1][3]=st due to position derivatives.

This couples position and angle covariances:
  C_new[0][0] = C_old[0][0] + st² * C_old[2][2]

Add new test "ZeroFieldJacobianWithPositionalDerivatives" that correctly
validates this behavior with st=50mm:
  C_new[0][0] = 1.0e-4 + 2500*5.0e-6 = 0.01251 ✓
  C_new[1][1] = 2.0e-4 + 2500*5.0e-6 = 0.01252 ✓

Fixes false negative: test_propagator now passes.
…s test for accuracy.

Uses the actual computed values with a 0.1% relative tolerance to account for floating-point accumulation
@gavinsdavies gavinsdavies requested a review from jonpaley April 7, 2026 12:46
@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for EMPHATIC Succeeded on slf7 for maxopt -- details available through the CI dashboard

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