diff --git a/examples/Example13/electrons.cu b/examples/Example13/electrons.cu index 55ad34d2f..4557891bc 100644 --- a/examples/Example13/electrons.cu +++ b/examples/Example13/electrons.cu @@ -84,8 +84,7 @@ static __device__ __forceinline__ void TransportElectrons(Track *electrons, cons for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example13/gammas.cu b/examples/Example13/gammas.cu index c38743c48..b923dc7fb 100644 --- a/examples/Example13/gammas.cu +++ b/examples/Example13/gammas.cu @@ -48,8 +48,7 @@ __global__ void TransportGammas(Track *gammas, const adept::MParray *active, Sec for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example14/electrons.cuh b/examples/Example14/electrons.cuh index 7fc198ee4..51d0efa2b 100644 --- a/examples/Example14/electrons.cuh +++ b/examples/Example14/electrons.cuh @@ -49,7 +49,6 @@ static __device__ __forceinline__ void TransportElectrons(Track *electrons, cons const int slot = (*active)[i]; Track ¤tTrack = electrons[slot]; auto volume = currentTrack.navState.Top(); - int volumeID = volume->id(); // the MCC vector is indexed by the logical volume id int lvolID = volume->GetLogicalVolume()->id(); VolAuxData const &auxData = userScoring->GetAuxData_dev(lvolID); @@ -85,8 +84,7 @@ static __device__ __forceinline__ void TransportElectrons(Track *electrons, cons for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example14/gammas.cuh b/examples/Example14/gammas.cuh index 8434df7c9..615f09d32 100644 --- a/examples/Example14/gammas.cuh +++ b/examples/Example14/gammas.cuh @@ -50,8 +50,7 @@ __global__ void TransportGammas(Track *gammas, const adept::MParray *active, Sec for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example17/electrons.cuh b/examples/Example17/electrons.cuh index 02a138788..fc3efc34c 100644 --- a/examples/Example17/electrons.cuh +++ b/examples/Example17/electrons.cuh @@ -48,7 +48,6 @@ static __device__ __forceinline__ void TransportElectrons(adept::TrackManagerfActiveTracks)[i]; Track ¤tTrack = (*electrons)[slot]; auto volume = currentTrack.navState.Top(); - int volumeID = volume->id(); // the MCC vector is indexed by the logical volume id int lvolID = volume->GetLogicalVolume()->id(); VolAuxData const &auxData = userScoring->GetAuxData_dev(lvolID); @@ -84,8 +83,7 @@ static __device__ __forceinline__ void TransportElectrons(adept::TrackManagerSetNumIALeft(numIALeft, ip); } diff --git a/examples/Example17/gammas.cuh b/examples/Example17/gammas.cuh index 7cd9fd504..71c8256a6 100644 --- a/examples/Example17/gammas.cuh +++ b/examples/Example17/gammas.cuh @@ -50,8 +50,7 @@ __global__ void TransportGammas(adept::TrackManager *gammas, Secondaries for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example18/electrons.cu b/examples/Example18/electrons.cu index b13959947..4a668e1b9 100644 --- a/examples/Example18/electrons.cu +++ b/examples/Example18/electrons.cu @@ -84,8 +84,7 @@ static __device__ __forceinline__ void TransportElectrons(Track *electrons, cons for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example18/gammas.cu b/examples/Example18/gammas.cu index 0ca3814c5..e8f917e45 100644 --- a/examples/Example18/gammas.cu +++ b/examples/Example18/gammas.cu @@ -48,8 +48,7 @@ __global__ void TransportGammas(Track *gammas, const adept::MParray *active, Sec for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } diff --git a/examples/Example19/electrons.cu b/examples/Example19/electrons.cu index 51b543db6..cfd0be449 100644 --- a/examples/Example19/electrons.cu +++ b/examples/Example19/electrons.cu @@ -87,8 +87,7 @@ static __device__ __forceinline__ void TransportElectrons(Track *electrons, cons for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } @@ -308,8 +307,7 @@ __device__ void ElectronInteraction(int const globalSlot, SOAData const & /*soaD GlobalScoring *globalScoring, ScoringPerVolume *scoringPerVolume) { Track ¤tTrack = particles[globalSlot]; - auto volume = currentTrack.navState.Top(); - const int volumeID = volume->id(); + auto volume = currentTrack.navState.Top(); // the MCC vector is indexed by the logical volume id const int lvolID = volume->GetLogicalVolume()->id(); const int theMCIndex = MCIndex[lvolID]; diff --git a/examples/Example19/gammas.cu b/examples/Example19/gammas.cu index d1a080b6d..2c9cb1f0f 100644 --- a/examples/Example19/gammas.cu +++ b/examples/Example19/gammas.cu @@ -51,8 +51,7 @@ __global__ void TransportGammas(Track *gammas, const adept::MParray *active, Sec for (int ip = 0; ip < 3; ++ip) { double numIALeft = currentTrack.numIALeft[ip]; if (numIALeft <= 0) { - numIALeft = -std::log(currentTrack.Uniform()); - currentTrack.numIALeft[ip] = numIALeft; + numIALeft = -std::log(currentTrack.Uniform()); } theTrack->SetNumIALeft(numIALeft, ip); } @@ -123,13 +122,13 @@ __device__ void GammaInteraction(int const globalSlot, SOAData const &soaData, i Secondaries secondaries, adept::MParray *activeQueue, GlobalScoring *globalScoring, ScoringPerVolume *scoringPerVolume) { - Track ¤tTrack = particles[globalSlot]; + Track ¤tTrack = particles[globalSlot]; auto volume = currentTrack.navState.Top(); - const int volumeID = volume->id(); + const int volumeID = volume->id(); // the MCC vector is indexed by the logical volume id const int lvolID = volume->GetLogicalVolume()->id(); const int theMCIndex = MCIndex[lvolID]; - const auto energy = currentTrack.energy; + const auto energy = currentTrack.energy; RanluxppDouble newRNG{currentTrack.rngState.Branch()}; G4HepEmRandomEngine rnge{¤tTrack.rngState}; @@ -254,8 +253,8 @@ __global__ void ComptonScattering(Track *particles, const adept::MParray *active scoringPerVolume); } __global__ void PhotoelectricEffect(Track *particles, const adept::MParray *active, Secondaries secondaries, - adept::MParray *activeQueue, GlobalScoring *globalScoring, - ScoringPerVolume *scoringPerVolume, SOAData const soaData) + adept::MParray *activeQueue, GlobalScoring *globalScoring, + ScoringPerVolume *scoringPerVolume, SOAData const soaData) { InteractionLoop<2>(&GammaInteraction<2>, active, soaData, particles, secondaries, activeQueue, globalScoring, scoringPerVolume);