Skip to content
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

confinement: fix uninitialized variable #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions src/RMGVertexConfinement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ bool RMGVertexConfinement::ActualGenerateVertex(G4ThreeVector& vertex) {

// chose a volume
SampleableObject choice_nonconst;
bool physical_first;
bool physical_first = true;

// for surface events the user has to chose which volume type to sample first
if (fOnSurface) {
Expand Down Expand Up @@ -773,7 +773,7 @@ bool RMGVertexConfinement::ActualGenerateVertex(G4ThreeVector& vertex) {

// chose a volume
SampleableObject choice_nonconst;
bool physical_first;
bool physical_first = true;

if (fOnSurface) {

Expand All @@ -795,7 +795,10 @@ bool RMGVertexConfinement::ActualGenerateVertex(G4ThreeVector& vertex) {
physical_first = fGeomVolumeSolids.total_volume > fPhysicalVolumes.total_volume;
else if (has_physical && not has_geometrical) physical_first = true;
else if (has_geometrical && not has_physical) physical_first = false;
else fFirstSamplingVolumeType == VolumeType::kPhysical;
else {
fFirstSamplingVolumeType == VolumeType::kPhysical;
physical_first = true;
}

choice_nonconst = physical_first ? fPhysicalVolumes.VolumeWeightedRand()
: fGeomVolumeSolids.VolumeWeightedRand();
Expand Down
Loading