Skip to content

Commit eaccfc0

Browse files
authored
Merge pull request #144 from zhaozhiwen/fix/109-sphere-vertex-radius
Fix sphere vertex sampling: compare squared radius to squared bound
2 parents 48f83e5 + 87735c8 commit eaccfc0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gemc/gparticle/gparticle.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ G4ThreeVector Gparticle::calculateVertex() {
166166
z = randomizeNumberFromSigmaWithModel(0, max_radius, gutilities::uniform);
167167
radius = x * x + y * y + z * z;
168168
}
169-
while (radius > max_radius);
169+
while (radius > max_radius * max_radius);
170170

171171
// Offset the sampled point by the nominal vertex.
172172
x = x + v.x();

0 commit comments

Comments
 (0)