Skip to content

Conversation

@jmcarcell
Copy link
Collaborator

@jmcarcell jmcarcell commented May 28, 2025

The intention is to remove a hit that was just added (see comment in the code a few lines above), but remove will end up calling std::vector::erase for the element that is after the last one. The definition is here: https://github.com/iLCSoft/ConformalTracking/blob/master/include/KDTrack.h#L37 or basically

void remove(int clusterN) {
  m_clusters.erase(m_clusters.begin() + clusterN);
}

Other alternatives like tempTrack.m_clusters.pop_back(); are also possible, I guess it's better to use the interface.

BEGINRELEASENOTES

  • Fix out of bounds erase in ConformalTracking
  • Throw an exception if removing something out of bounds

ENDRELEASENOTES

Tagging @Zehvogel since there may be some changes in tracking for CLD

jmcarcell added 2 commits May 28, 2025 11:48
The intention is to remove a cluster that was just created, but remove will end
up calling std::vector::erase for the element that is after the last one.
The definition is here:
https://github.com/iLCSoft/ConformalTracking/blob/master/include/KDTrack.h#L37
or basically
```
  void remove(int clusterN) {
    m_clusters.erase(m_clusters.begin() + clusterN);
  }
```
@tmadlener
Copy link
Contributor

Was this uncovered by some static analysis? Or triggered by an actual issue?

Also CI workflows seem way outdated here. I won't be able to fix those today (or still this week) most likely.

@jmcarcell
Copy link
Collaborator Author

I suspected there were some cases where the ported and the original version give different results. I ran simulation and reconstruction many times until I found one case and then when I tried to run locally it was crashing when using Gaudi, which is actually the first time it happens. Not sure why since the different results seems to be independent of this. I'll have a look at the CI.

@jmcarcell
Copy link
Collaborator Author

CI is passing. I think it should not change much since in key4hep/k4Reco#31 (fix in Gaudi but not in Marlin) the CI passed which means for 6 events with 10 muons each the tracks were identical.

@jmcarcell jmcarcell enabled auto-merge (squash) May 28, 2025 15:56
@jmcarcell jmcarcell merged commit c278a43 into iLCSoft:master May 28, 2025
5 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