Geant4 Version: v11.1.1 Operating System: Linux Compiler/Version: CMake Version: 3.22
Dear community,
A sphere (r=0.2m, G4_Galactic) is placed at the center of the world (G4_Galactic).
The source consist of 1 MeV protons with cosine distribution from a r=0.3m sphere, defined from a macro.
I score the angular distribution of the particles on the sphere.
Why is the incidence angle distribution over the sphere centered over pi/4 instead of 0 (as I expected)?
Here is a minimalistic code reproducing this effect, see README to run it:
The relevant lines are of course the macro, and the src/SBG4PSSphereSurfaceFlux.cc file, lines 130-174 where the angle distribution is calculated and printed.
You are not normalizing by the normal area of each polar angle. The cosine weighting is dN/dΩ → cos(θ) as the “normal” for a sphere is dΩ. And with dΩ/dθ ∝ sin(θ) (φ will be integrated as 2π for each lattitude). More precisely:
Far from it, your verification strategy matched the expected result. The question is what distribution do you want on the sphere as a function of the polar angle. If you want a cosine weighting you will have to divide by the sin(θ) dependence either by weighting events from the simulation in that way or by making your own particle gun.
I might be misreading this but I think what you showed is that it gives you what you want? It only “looks” like a sin(2θ) is because you are implicitly integrating around latitudes. You have effectively a point detector where it would see this cos(θ) distribution as in those slides as well.