Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/Example13/electrons.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/Example13/gammas.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions examples/Example14/electrons.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ static __device__ __forceinline__ void TransportElectrons(Track *electrons, cons
const int slot = (*active)[i];
Track &currentTrack = 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);
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/Example14/gammas.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions examples/Example17/electrons.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static __device__ __forceinline__ void TransportElectrons(adept::TrackManager<Tr
const int slot = (*electrons->fActiveTracks)[i];
Track &currentTrack = (*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);
Expand Down Expand Up @@ -84,8 +83,7 @@ static __device__ __forceinline__ void TransportElectrons(adept::TrackManager<Tr
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);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/Example17/gammas.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ __global__ void TransportGammas(adept::TrackManager<Track> *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);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/Example18/electrons.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions examples/Example18/gammas.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 2 additions & 4 deletions examples/Example19/electrons.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -308,8 +307,7 @@ __device__ void ElectronInteraction(int const globalSlot, SOAData const & /*soaD
GlobalScoring *globalScoring, ScoringPerVolume *scoringPerVolume)
{
Track &currentTrack = 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];
Expand Down
13 changes: 6 additions & 7 deletions examples/Example19/gammas.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -123,13 +122,13 @@ __device__ void GammaInteraction(int const globalSlot, SOAData const &soaData, i
Secondaries secondaries, adept::MParray *activeQueue, GlobalScoring *globalScoring,
ScoringPerVolume *scoringPerVolume)
{
Track &currentTrack = particles[globalSlot];
Track &currentTrack = 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{&currentTrack.rngState};
Expand Down Expand Up @@ -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);
Expand Down