-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Testing HelicalTrackLinearizer by comparing its Jacobians to numerically computed derivatives #2141
refactor: Testing HelicalTrackLinearizer by comparing its Jacobians to numerically computed derivatives #2141
Conversation
📊 Physics performance monitoring for ac66957Summary VertexingSeedingCKFAmbiguity resolutionTruth tracking (Kalman Filter)Truth tracking (GSF) |
Codecov Report
@@ Coverage Diff @@
## main #2141 +/- ##
==========================================
- Coverage 49.35% 49.30% -0.05%
==========================================
Files 445 447 +2
Lines 25264 25324 +60
Branches 11650 11693 +43
==========================================
+ Hits 12468 12487 +19
- Misses 4512 4513 +1
- Partials 8284 8324 +40
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how much we could use from RiddersPropagator
- I guess it does basically do what you did here by hand?
It might not have nothing to do with this PR, but there is also a way to validate which is based on the helix model (Eq. 4.28 - 4.34) of https://doi.org/10.1007/978-3-030-65771-0 |
I don't know if it makes sense to unify the code here with the one in |
thanks for looking into this @russofel ! I guess if it would expose the jacobian instead of (or additional to) the covariance it would fit our use case. but right now it does not really make sense as we would have to find the jacobian from the final covariance? and I don't know if that is even possible |
The HelicalTrackLinearizer is purely based on analytical calculations, see Sec. 5.3.3 and 5.3.4 of https://cds.cern.ch/record/1243771?ln=en. I am not quite sure how these calculations relate to the resource you have linked in your comment though... I will need to look into this in detail! |
I am sorry that It is not related to your work anymore. The link that I provided is merely about the jacobian transport (free->free) which is not part of HelicalLinearizer (perigee->free). I just didn't understand this when I made a comment |
Co-authored-by: Andreas Stefl <stefl.andreas@gmail.com> Co-authored-by: Paul Gessinger <hello@paulgessinger.com>
This reverts commit 0a0553f.
…o numerically computed derivatives (acts-project#2141) Previously, the unit test for the HelicalTrackLinearizer only checked if its outputs were non-zero matrices. To improve the testing, a new class, NumericalTrackLinearizer, is introduced, which allows us to compute Jacobians numerically (i.e., we approximate the derivatives like f'(x) ~ (f(x + dx) - f(x)) / dx). The numerically computed Jacobians are then compared to the ones we obtain from the HelicalTrackLinearizer in the improved unit test. Comments concerning code readability and style are highly appreciated!
In this PR the derivatives of/wrt time are added to the Jacobians computed in `HelicalTrackLinearizer`. The terms have been checked by comparing them to numerically computed derivatives (see PR #2141). Here is a PDF where the Jacobians are derived: [Track_Linearization.pdf](https://github.com/acts-project/acts/files/11664828/Track_Linearization.pdf). Note that nobody (except me) read this yet, so it might have some mistakes in it. Any feedback is more than welcome! Something that might need discussion: To compute the new terms, we need to have a mass and a charge hypothesis of the tracks. Right now, Pion mass and unit charge are assumed in the code, but it might be worth adding specific hypotheses to the track objects.
Previously, the unit test for the HelicalTrackLinearizer only checked if its outputs were non-zero matrices. To improve the testing, a new class, NumericalTrackLinearizer, is introduced, which allows us to compute Jacobians numerically (i.e., we approximate the derivatives like f'(x) ~ (f(x + dx) - f(x)) / dx). The numerically computed Jacobians are then compared to the ones we obtain from the HelicalTrackLinearizer in the improved unit test.
Comments concerning code readability and style are highly appreciated!