Nonuniform spatial distribution of primaries on an ellipsoidal surface

Hello,

I am trying to generate a distribution of primaries using the macro commands supplied by the G4GeneralParticleSource class. I used the following code in the visualization macro:

/gps/particle proton
/gps/energy 1 keV
/gps/pos/type Surface
/gps/pos/shape Ellipsoid
/gps/pos/centre 0 0 0 mm
/gps/pos/halfx 7 um
/gps/pos/halfz 7 um
/gps/pos/halfy 2.5 um

With the cylinder (/gps/pos/shape Cylinder) and the parallelepiped (/gps/pos/shape Para) I got the expected results, but with the ellipsoid the spatial distribution seems to have a larger density of primaries in the center than in the periphery (I attach a screenshot).

I am using Geant4 v10.7.4 and Operating System Ubuntu 22.04.
Have you experienced the same problem using /gps/pos/shape Ellipsoid ?

Does GPS simply call into G4VSolid::GetPointOnSurface() when /gps/pos/shape is used? If so, this is probably a “known feature” (or rather, a “we are not going to change it” feature). See 1074 – GetPointOnSurface() returns non-uniform distribution for some classes

We (CDMS) discovered several years ago that GetPointOnSurface() never guarantees uniform coverage, so we had to implement our own method, based on the Detweiler et al. paper cited in that bug report (A Generic Surface Sampler for Monte Carlo Simulations | IEEE Journals & Magazine | IEEE Xplore). The method works for any solid, including complex booleans.