Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix time of flight gammas
Browse files Browse the repository at this point in the history
SeverinDiederichs committed Jan 16, 2025
1 parent 137bf87 commit caed755
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/AdePT/kernels/gammas.cuh
Original file line number Diff line number Diff line change
@@ -119,6 +119,11 @@ __global__ void TransportGammas(adept::TrackManager<Track> *gammas, Secondaries
theTrack->SetGStepLength(geometryStepLength);
theTrack->SetOnBoundary(nextState.IsOnBoundary());

// Update the flight times of the particle
double deltaTime = theTrack->GetGStepLength() / copcore::units::kCLight;
globalTime += deltaTime;
localTime += deltaTime;

int winnerProcessIndex;
if (nextState.IsOnBoundary()) {
// For now, just count that we hit something.
@@ -169,11 +174,6 @@ __global__ void TransportGammas(adept::TrackManager<Track> *gammas, Secondaries
currentTrack.numIALeft[0] = -1.0;
}

// Update the flight times of the particle
double deltaTime = theTrack->GetGStepLength() / copcore::units::kCLight;
globalTime += deltaTime;
localTime += deltaTime;

// Perform the discrete interaction.
G4HepEmRandomEngine rnge(&currentTrack.rngState);
// We might need one branched RNG state, prepare while threads are synchronized.

0 comments on commit caed755

Please sign in to comment.