Skip to content

Conversation

@brownd1978
Copy link
Contributor

This includes the updates to support cloning, as well as some subsequent fixes.

Copy link
Contributor

@edcallaghan edcallaghan left a comment

Choose a reason for hiding this comment

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

A couple of small comments, but overall this looks completely reasonable to me.

dtime = newpiece.range().end();
double tstart = std::max(domain->begin(), oldpiece.range().begin());
double tend = std::min(domain->end(),oldpiece.range().end());
if(tstart < tend){
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm having trouble understanding the effect of this branch. When I draw out what I think is happening, I think that the pieceRange() call guarantees that this condition is met (unless the underlying pieces are themselves pathological). If that's correct, then the branch isn't necessary. If it's incorrect, then should there be an else-clause to non-silently handle that situation?

Fit/Track.hh Outdated
for(auto const& hit : hits){
tmin = std::min(tmin,hit->time());
tmax = std::max(tmax,hit->time());
if(hit->active() || !active){
Copy link
Contributor

@edcallaghan edcallaghan Sep 12, 2025

Choose a reason for hiding this comment

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

If just marked as const then the compiler may help with this as-is, but reordering these conditions (or moving the check on the functionally-const active to outside of these loops) would be an optimization for when active == false.

@brownd1978 brownd1978 merged commit 1faa5c8 into KFTrack:main Sep 21, 2025
4 checks passed
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