Skip to content
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

fix(gx2f): propagate final covariance for trackstates #2949

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

AJPfleger
Copy link
Contributor

@AJPfleger AJPfleger commented Feb 14, 2024

Issue

I figured out, that the trackstates in the final track contain the wrong covariance. This occurred, while investigating the unbiased pulls. There, some dimensions had a negative covariance.

if (ipar == eUnbiased && state.hasSmoothed() && state.hasProjector()) {

Reason

After the last update we calculate the covariance of the initial parameters and add this covariance to the final track. However, the last propagation was done with the initial guess for the covariance. Therefore, the wrong covariance got propagated and assigned to each trackstate.

Solution

Propagate an additional time, with the final parameters+covariance.

Future Plans

Since an additional propagation is quite expensive, we should look into the following two ideas:

  • calculate covariance after each update (matrix inverse)
  • toggle the re-propagation if we are not interested in the propagated covariance

Notes

This also removes nUpdate from the Actor since it wasn't needed anymore.

Blocked by

@AJPfleger AJPfleger added this to the next milestone Feb 14, 2024
@github-actions github-actions bot added Component - Core Affects the Core module Track Fitting labels Feb 14, 2024
@andiwand
Copy link
Contributor

I think it would be good to have some physmon for gx2f like we have it for KF and GSF. otherwise it will be very hard to judge for someone how these changes behave

@AJPfleger
Copy link
Contributor Author

Good point, on the other hand, the gx2f is still in namespace Experimental, so might be confusing if something gives weird physmon outputs?

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (6fb49f1) 48.74% compared to head (ef55e41) 48.73%.

Files Patch % Lines
...nclude/Acts/TrackFitting/GlobalChiSquareFitter.hpp 44.44% 0 Missing and 10 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2949      +/-   ##
==========================================
- Coverage   48.74%   48.73%   -0.01%     
==========================================
  Files         493      493              
  Lines       28926    28943      +17     
  Branches    13765    13776      +11     
==========================================
+ Hits        14099    14106       +7     
  Misses       4924     4924              
- Partials     9903     9913      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AJPfleger
Copy link
Contributor Author

AJPfleger commented Feb 19, 2024

Discussion in meeting 19.02.2024

Pros:

  • Changes are more comprehensible
  • Nice plots
  • Easy

Cons:

  • Almost all gx2f-updates change physmon
  • Plots need to be updated in each PR

Outcome:

We want to implement it soon, but no preference before or after this PR. Implement in the next 2 weeks.
The corresponding PR is here:

@AJPfleger AJPfleger added the 🛑 blocked This item is blocked by another item label Feb 21, 2024
@AJPfleger AJPfleger removed the 🛑 blocked This item is blocked by another item label Feb 22, 2024
@AJPfleger AJPfleger requested a review from andiwand February 22, 2024 15:35
@kodiakhq kodiakhq bot merged commit ae56406 into acts-project:main Feb 22, 2024
57 checks passed
@AJPfleger AJPfleger deleted the covtransport branch February 22, 2024 15:52
kodiakhq bot pushed a commit that referenced this pull request Mar 4, 2024
## What?
Lets the `RootTrackStatesWriter.cpp` write unbiased states, even if there are no `smoothed` states.

## Why?
The states we are writing are based upon the Kalman Filter formalism. There, we would expect `predicted`, `filtered`, and `smoothed` states. The `smoothed` states should be the final states. Other fitters, like the GX2F, do not take this path. Therefore, the final estimate is written to `predicted`.

Until now, the `unbiased` states could only be computed from `smoothed` states. However, it is also for interest for other fitters to investigate the `unbiased` pulls and residuals.

The idea for this PR evolved while investigating the track states for the GX2F (PR #2949). Seems to be useful to have this in.

## Notes
We need to check for `state.hasCalibrated()`, since the physmon tests for the GSF were crashing. It seems, the GSF creates states without measurements. There, the programme aborted with
```
state.calibratedSize(): 4294967295
template_switch<Fn, 6, 6>(v=4294967295) is not valid (v > NMAX)
```
@paulgessinger paulgessinger modified the milestones: next, v33.0.0 Mar 6, 2024
Ragansu pushed a commit to Ragansu/acts that referenced this pull request Mar 7, 2024
…ct#2999)

## What?
Lets the `RootTrackStatesWriter.cpp` write unbiased states, even if there are no `smoothed` states.

## Why?
The states we are writing are based upon the Kalman Filter formalism. There, we would expect `predicted`, `filtered`, and `smoothed` states. The `smoothed` states should be the final states. Other fitters, like the GX2F, do not take this path. Therefore, the final estimate is written to `predicted`.

Until now, the `unbiased` states could only be computed from `smoothed` states. However, it is also for interest for other fitters to investigate the `unbiased` pulls and residuals.

The idea for this PR evolved while investigating the track states for the GX2F (PR acts-project#2949). Seems to be useful to have this in.

## Notes
We need to check for `state.hasCalibrated()`, since the physmon tests for the GSF were crashing. It seems, the GSF creates states without measurements. There, the programme aborted with
```
state.calibratedSize(): 4294967295
template_switch<Fn, 6, 6>(v=4294967295) is not valid (v > NMAX)
```
EleniXoch pushed a commit to EleniXoch/acts that referenced this pull request May 6, 2024
)

## Issue
I figured out, that the trackstates in the final track contain the wrong covariance. This occurred, while investigating the unbiased pulls. There, some dimensions had a negative covariance.

https://github.com/acts-project/acts/blob/19464fa0d24f031083ef3ad3108b74f2b5fa5454/Examples/Io/Root/src/RootTrackStatesWriter.cpp#L456

## Reason
After the last update we calculate the covariance of the initial parameters and add this covariance to the final track. However, the last propagation was done with the initial guess for the covariance. Therefore, the wrong covariance got propagated and assigned to each trackstate.

## Solution
Propagate an additional time, with the final parameters+covariance.

## Future Plans
Since an additional propagation is quite expensive, we should look into the following two ideas:
- calculate covariance after each update (matrix inverse)
- toggle the re-propagation if we are not interested in the propagated covariance

## Notes
This also removes `nUpdate` from the Actor since it wasn't needed anymore.

## Blocked by
- acts-project#2972
- acts-project#2966
EleniXoch pushed a commit to EleniXoch/acts that referenced this pull request May 6, 2024
…ct#2999)

## What?
Lets the `RootTrackStatesWriter.cpp` write unbiased states, even if there are no `smoothed` states.

## Why?
The states we are writing are based upon the Kalman Filter formalism. There, we would expect `predicted`, `filtered`, and `smoothed` states. The `smoothed` states should be the final states. Other fitters, like the GX2F, do not take this path. Therefore, the final estimate is written to `predicted`.

Until now, the `unbiased` states could only be computed from `smoothed` states. However, it is also for interest for other fitters to investigate the `unbiased` pulls and residuals.

The idea for this PR evolved while investigating the track states for the GX2F (PR acts-project#2949). Seems to be useful to have this in.

## Notes
We need to check for `state.hasCalibrated()`, since the physmon tests for the GSF were crashing. It seems, the GSF creates states without measurements. There, the programme aborted with
```
state.calibratedSize(): 4294967295
template_switch<Fn, 6, 6>(v=4294967295) is not valid (v > NMAX)
```
asalzburger pushed a commit to asalzburger/acts that referenced this pull request May 21, 2024
)

## Issue
I figured out, that the trackstates in the final track contain the wrong covariance. This occurred, while investigating the unbiased pulls. There, some dimensions had a negative covariance.

https://github.com/acts-project/acts/blob/19464fa0d24f031083ef3ad3108b74f2b5fa5454/Examples/Io/Root/src/RootTrackStatesWriter.cpp#L456

## Reason
After the last update we calculate the covariance of the initial parameters and add this covariance to the final track. However, the last propagation was done with the initial guess for the covariance. Therefore, the wrong covariance got propagated and assigned to each trackstate.

## Solution
Propagate an additional time, with the final parameters+covariance.

## Future Plans
Since an additional propagation is quite expensive, we should look into the following two ideas:
- calculate covariance after each update (matrix inverse)
- toggle the re-propagation if we are not interested in the propagated covariance

## Notes
This also removes `nUpdate` from the Actor since it wasn't needed anymore.

## Blocked by
- acts-project#2972
- acts-project#2966
asalzburger pushed a commit to asalzburger/acts that referenced this pull request May 21, 2024
…ct#2999)

## What?
Lets the `RootTrackStatesWriter.cpp` write unbiased states, even if there are no `smoothed` states.

## Why?
The states we are writing are based upon the Kalman Filter formalism. There, we would expect `predicted`, `filtered`, and `smoothed` states. The `smoothed` states should be the final states. Other fitters, like the GX2F, do not take this path. Therefore, the final estimate is written to `predicted`.

Until now, the `unbiased` states could only be computed from `smoothed` states. However, it is also for interest for other fitters to investigate the `unbiased` pulls and residuals.

The idea for this PR evolved while investigating the track states for the GX2F (PR acts-project#2949). Seems to be useful to have this in.

## Notes
We need to check for `state.hasCalibrated()`, since the physmon tests for the GSF were crashing. It seems, the GSF creates states without measurements. There, the programme aborted with
```
state.calibratedSize(): 4294967295
template_switch<Fn, 6, 6>(v=4294967295) is not valid (v > NMAX)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - Core Affects the Core module Track Fitting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants