94 G4ThreeVector randomLocation;
95 randomLocation.setRThetaPhi(radius * std::sqrt(G4UniformRand()),
96 G4UniformRand() * 180 * deg,
98 randomLocation.setZ(z * (G4UniformRand() - 0.5));
99 G4ThreeVector location(randomLocation.x() + sourceCenter.x(),
100 randomLocation.y() + sourceCenter.y(),
101 randomLocation.z() + sourceCenter.z());
103 G4cout <<
"Emission Location: r: " << location << G4endl;
107 G4ThreeVector direction;
108 direction.setRThetaPhi(1.0,
109 std::acos(G4UniformRand() * 2 - 1),
110 (G4UniformRand() * 2 - 1) * 180 * deg);
112 G4cout <<
"Emission Direction: r: " << direction << G4endl;