Skip to content

Fix global time in scoring #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2025
Merged

Conversation

SeverinDiederichs
Copy link
Collaborator

@SeverinDiederichs SeverinDiederichs commented May 22, 2025

This PR fixes the global time in the scoring, as it is now passed back to Geant4. Also, a bug is fixed: for calculating the global time, the initial velocity must be used, before updating the kinetic energy due to energy loss. Before, stopped particles would then lead to an infinite global time. Now it conforms with G4.

The globalTime for secondaries is also corrected: before it was taking the globaltime from currentTrack, however, the member currentTrack.globalTime was only updated in survive, so after the secondary was created. Now the current globalTime is passed to the constructor.

Now, the time seems to be fully correct in the Gauss histograms

@phsft-bot
Copy link

Can one of the admins verify this patch?

@SeverinDiederichs SeverinDiederichs marked this pull request as draft May 22, 2025 10:03
@SeverinDiederichs SeverinDiederichs marked this pull request as ready for review May 22, 2025 11:49
@agheata agheata merged commit 289d454 into apt-sim:master May 22, 2025
2 of 3 checks passed
@SeverinDiederichs SeverinDiederichs deleted the fix_global_time branch May 22, 2025 12:22
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.

3 participants