In G4SPSAngDistribution::GenerateIsotropicFlux(), cosine of a uniformly distributed random angle is not calculated in the proper way: https://github.com/Geant4/geant4/blob/master/source/event/src/G4SPSAngDistribution.cc#L348 costheta = std::cos(MinTheta) - rndm * (std::cos(MinTheta) - std::cos(MaxTheta)); Suggested fix: Theta = MinTheta - rndm * (MinTheta - MaxTheta); costheta = std::cos(Theta); The bug affects at least GPS's sources with angular distribution set to "iso" and results in primaries of the expected isotropic flux being less likely oriented towards the poles.
Theta is azimuth angle. If it is not biased, it should distribute between 0 to pi/2, not evenly but in cosine shape. The current implementation is correct. If theta distributes evenly as you suggest, tracks would concentrate to the polar region.
Sorry, "0 to pi/2" should read "0 to pi".
Thank you, my bad.