Specular reflection

Hi experts,

I am trying to simulate the specular reflection of low-energy neutrons.
The process must implement

Sin(tetha_critical_angle) = U_eff / E
Sin(tetha) <= Sin(tetha_critical_angle).

In my task neutron interact with a material under 30 degrees with the energy 1.7*10^(-5) eV…
and U_eff = 60 neV.

I have found this code related this problem.

G4StepPoint* aStepPoint = 0;
if(aStep->GetPostStepPoint()->GetStepStatus() == fGeomBoundary && aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName() == “MgfoilMat”)
{
aStepPoint = aStep->GetPostStepPoint();
G4ThreeVector pointInSurf = aStepPoint->GetPosition();
const G4VTouchable *aStepTouchable = aStepPoint->GetTouchable();
const G4AffineTransform *trans = aStepTouchable->GetHistory()->GetPtrTopTransform();
G4ThreeVector localPointInSurf = trans->TransformPoint(pointInSurf);
G4ThreeVector localNormal = aStepTouchable->GetVolume()->GetLogicalVolume()->GetSolid()->SurfaceNormal(localPointInSurf);
G4ThreeVector localDirection = trans->TransformAxis(aStepPoint->GetMomentumDirection());
G4double AngleToNormal = localDirection.angle(localNormal);
}

Thank you in advance.