Skip to content

Conversation

@SeverinDiederichs
Copy link
Collaborator

@SeverinDiederichs SeverinDiederichs commented Oct 3, 2025

This initializes an empty secondary vector when returning a GPU step to the CPU. This is needed such that the access to the secondary does not crash:

  const std::vector<const G4Track*>  *secondaryVector = aStep->GetSecondaryInCurrentStep();
  secondaryVector->size(); <- currently crashes as it is a nullPtr

With this PR the secondary vector is available, just empty.

This PR is needed to run Athena with the Sim_tf transform.

@SeverinDiederichs SeverinDiederichs added the enhancement Type: New feature or request label Oct 3, 2025
@phsft-bot
Copy link

Can one of the admins verify this patch?

@SeverinDiederichs
Copy link
Collaborator Author

With the latest Athena version, this does not seem to be needed for now, but I'll keep it open for a bit to confirm with the other experiment frameworks that indeed it is no problem.

With this PR, the check for secondaries in a step would not be a nullptr access anymore, preventing potential crashes.

@SeverinDiederichs
Copy link
Collaborator Author

In fact, this is needed by CMSSW and therefore should be merged.

Copy link
Contributor

@JuanGonzalezCaminero JuanGonzalezCaminero left a comment

Choose a reason for hiding this comment

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

Looks good to me

@SeverinDiederichs SeverinDiederichs merged commit 8e49d4e into apt-sim:master Nov 21, 2025
3 checks passed
@SeverinDiederichs SeverinDiederichs deleted the enable_second_vector branch November 21, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Type: New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants