Changing the alpha distribution in the UNIFIED model

Hi! I’m new in the Geant4 and I’m using it to study rough surfaces. One of the first studies that I want to make is to analyse the dispersion of light in a metal so I’m modifying the OpNovice2 example to match what I want. But I want to make a little change in the physics of the UNIFIED model used in Geant4 to simulate this interactions. In this model the angle between a micro-facet normal and the average surface normal, alpha, is assumed to follow a gaussian distribution of standard deviation of sigma-alpha. But I want to make a little change in the physics of the UNIFIED model used in Geant4 to simulate this interactions. In this model the angle between a micro-facet normal and the average surface normal, alpha, is assumed to follow a gaussian distribution of standard deviation of sigma-alpha. What I want is to modify this distribution to have a constante distribution of alpha, this is, having an equal probability for all alphas between -pi/2 and pi/2. Does anyone know how can I do this?

You would need to modify G4OpBoundaryProcess::GetFacetNormal, changing the G4RandGauss::shoot in line 666 to G4RandFlat.

http://www-geant4.kek.jp/lxr/source/processes/optical/src/G4OpBoundaryProcess.cc#L666

Let us know if you run into difficulties.