Skip to content

Proposal: CRTP track state creator#5264

Draft
andiwand wants to merge 7 commits intoacts-project:mainfrom
andiwand:proposal-crtp-track-state-creator
Draft

Proposal: CRTP track state creator#5264
andiwand wants to merge 7 commits intoacts-project:mainfrom
andiwand:proposal-crtp-track-state-creator

Conversation

@andiwand
Copy link
Copy Markdown
Contributor

Proposal for a CRTP track state creator which provides helpers and customization points to simplify and generalize the implementation of a track state creator.

We saw quite some performance improvements in Athena after the implementation of a track state creator as it cuts the overhead of passing all the measurements through the track state EDM. Making this available in ACTS should equally improve the performance in our Examples framework and allow users to move away from the old source link accessor solution more easily.

This implementation should also make it possible to split measurements into multiple track states which is necessary for the Run 4 track finding in dense environment prototype.

This further generalizes the track state creation to holes and outliers which ultimately gives to user more control over the track finding procedure. For example, one can easily reject a hole and continue the finding if the track just clipped a sensor. Or one might branch into a hole + measurement / outlier + measurement / edge hole + measurement state due to ambiguity.

Further ideas

  • create a state object and pass it to all the CRTP functions instead of argument lists
    • allow users to create their own state object or extend the default one
    • allows the user to resolve the detector element once and derive information once
    • allows to determine cuts once and easily access them later

--- END COMMIT MESSAGE ---

@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Track Finding labels Mar 19, 2026
@github-actions github-actions bot added this to the next milestone Mar 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

📊: Physics performance monitoring for 6615e71

Full contents

physmon summary

const MeasurementClassification classification =
derived().classifyMeasurement(surface, measurement, chi2,
maxChi2Compatible, maxChi2Outlier);
result.emplace_back(i, chi2, classification);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about only keeping classifications below the outlier cut ?

Not clear whether it is really an advantage, but if the results are added sorted, than the list could be limited to the maximum number of branches.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it might be convenient to have the outliers also in the list for downstream handling. but depends if this generates some overhead and if it really turns out to be useful

right, we can also insertion sort them. I guess this also depends on the performance


std::optional<TrackStateProxy> firstTrackState;

if (derived().hasHole(surface, boundState, selectedMeasurements, logger)) {
Copy link
Copy Markdown
Contributor

@goetzgaycken goetzgaycken Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make sense to add holes and measurements at the same time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure, but I can imagine that scenarios where it is not clear if you should pick a measurement or produce an (edge) hole. ultimately it should be up to the user to choose so I allowed for this for now

ACTS_VERBOSE("Found " << measurementRange.size()
<< " measurements on surface "
<< surface.geometryId());
if (measurementRange.begin() == measurementRange.end()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about support for "edge holes" ?
The derived class could test in case of no-measurements (same applies for the case that there are no measurements which pass the outlier cut), whether the prediction is close to the edge with a negative boundary tolerance and return the special error code for no measurement expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point - I wasn't sure how this is handled right now

I think it would be more convenient if the track state creator would also deal with holes / edge holes so we can pull this logic out of the CKF. but one step at a time. I will make this compatible with the current version

const Surface& surface, const BoundState& boundState,
const TrackIndexType prevTip,
std::vector<track_state_proxy_t>& trackStateCandidates,
track_state_container_backend_t& trajectory, const Logger& logger) const {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger gets passed to almost every function here: at that point, maybe this should be a class member?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the logger is part of the track state creator interface so it might be confusing to add a second one

@sonarqubecloud
Copy link
Copy Markdown

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 Component - Examples Affects the Examples module Track Finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants