Skip to content

feat: Compare track state parameters against their own measurement - #5975

Open
andiwand wants to merge 4 commits into
acts-project:mainfrom
andiwand:feat-measurement-reference-track-param-perf
Open

feat: Compare track state parameters against their own measurement#5975
andiwand wants to merge 4 commits into
acts-project:mainfrom
andiwand:feat-measurement-reference-track-param-perf

Conversation

@andiwand

@andiwand andiwand commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Adds a reference option to the track parameter performance collector and
writer, selecting whether track states are compared against the truth behind
their measurement or against the measurement itself.

The measurement reference needs no truth input and therefore also runs on data.
A measurement only constrains the local parameters, so only those residual and
pull histograms are filled, and the binning is taken from the reconstructed
side. The residual covariance is V + HPH^T for parameters that did not use
the state's own measurement and V - HPH^T for those that did, so an explicit
parameterType is required in this mode.

The TrackState source now names its histograms loc0/loc1 instead of the
perigee d0/z0, which is what the first two bound parameters are on a sensor
surface. Names a caller picked itself are left alone.

Residuals of phi are reduced over the periodicity. A track near the +-pi
wrap previously got a residual of almost a full turn and landed in the
underflow bin. This also affects the existing truth reference, so the phi
residual and pull histograms move slightly.

@andiwand

andiwand commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

What to look at

Sign of the residual covariance (measurementResidual). Predicted and
unbiased parameters do not use the state's own measurement, so the covariance
adds; filtered and smoothed do, so it subtracts. V - HPH^T is not positive
definite, so the pull is dropped when the variance is non-positive.

This is also why parameterType is mandatory here. Unset,
recoParametersOnSurface picks smoothed, else filtered, else predicted per
state
, mixing both conventions into one histogram.

reference is a second enum rather than a third TrackParameterSource
value, so the illegal Track + Measurement combination does not look legal.
The collector constructor rejects it.

Only a subset of the histograms fill: loc0 always, loc1 for 2D
measurements, never phi/theta/q/p/t or the derived q/pT pair. The
rest are booked and written out empty. extractMeanWidthProfiles skips slices
below fitMinEntries without counting them as failures, so that yields
fitFailureFraction = 0 and no warning.

Binning comes off the reconstructed side in this mode, since a measurement
has no direction and no pT.

The truth path shares the loop through a nullable TrackStateTruth.

The phi wrap also changes the truth reference, so physmon may need a
reference update.

Not in scope

A per-module breakdown: residual mean/width by GeometryIdentifier, by local
position on the sensor, and by incidence angle. ResPlotTool only has
eta/phi/pT axes, so this answers "the selected region has a bias of X" rather
than "sensor N is off". Follow-up.

Validation

MeasurementResidualTests covers the subspace selection for 1D and 2D
measurements, both covariance signs, the residual convention, and the
no-measurement case. ResPlotToolTests covers the phi wrap. The default
reference is Truth and no existing caller sets it.

@github-actions github-actions Bot added this to the next milestone Aug 29, 2026
@github-actions github-actions Bot added the Component - Examples Affects the Examples module label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Public API surface diff

No change to the public API surface. ✅

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

📊: Physics performance monitoring for 17d8909

Full contents

physmon summary

@andiwand
andiwand marked this pull request as ready for review August 31, 2026 12:09
andiwand and others added 3 commits September 1, 2026 13:23
Adds a `reference` option to the track parameter performance collector and
writer, selecting whether track states are compared against the truth behind
their measurement or against the measurement itself.

The measurement reference needs no truth input at all and therefore also runs
on data, which is what makes track-to-hit residual monitoring for alignment
possible. A measurement only constrains the local parameters, so only those
residual and pull histograms are filled and the binning is taken from the
reconstructed side. The residual covariance is `V + HPH^T` for parameters that
did not use the state's own measurement and `V - HPH^T` for those that did, so
an explicit `parameterType` is required in this mode.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185o8p9JBg4MSNFn8AxW3qp
…eters

Takes the bound subspace helper rather than a raw index span, and builds the
residual and its covariance directly at full bound size instead of going
through dynamic temporaries and a second expand pass. Drops the charge fields
from `ResPlotTool::Binning`, which only the truth fill reads.

The `TrackState` source now names its histograms `loc0`/`loc1` rather than the
perigee `d0`/`z0`, which is what the first two bound parameters are on a sensor
surface. Names a caller picked itself are left alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016kxszHDNxUNersWUnrnJ8m
A track near the `+-pi` wrap has its truth and reconstructed phi on opposite
sides of the range, so the plain difference is almost a full turn and lands in
the residual underflow bin. This affects the existing truth reference as well,
so the phi residual and pull histograms move slightly and physmon may need a
reference update.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016kxszHDNxUNersWUnrnJ8m
@andiwand
andiwand force-pushed the feat-measurement-reference-track-param-perf branch from 6eb06ed to 97a6b90 Compare September 1, 2026 11:34
Reducing the phi residual over the periodicity moves one track per sample
out of the flow bin the ROOT converter drops, so `res_phi` and `pull_phi`
gain one entry. The fitted mean/width profiles move further because
`TH1::Fit("gaus")` shares ROOT's global fit state across slices.
@github-actions github-actions Bot added Infrastructure Changes to build tools, continous integration, ... Changes Performance labels Sep 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes Performance Component - Examples Affects the Examples module Infrastructure Changes to build tools, continous integration, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant