In G4LowEnergyPolarizedCompton::GetPerpendicularPolarization We see the formula: // p = a + (a o n)/(n o n)*n return gammaPolarization + gammaPolarization.dot(gammaDirection)/gammaDirection.dot(gammaDirection)*gammaDirection; I think the formula should read: // p = a - (a o n)/(n o n)*n so that p o n = a o n - a o n / (n o n) * (n o n)= 0 What the function try to achive with the formula above p o n !=0 Correct code should be: return gammaPolarization - gammaPolarization.dot(gammaDirection)/gammaDirection.dot(gammaDirection)*gammaDirection;
The problem has been found also by another developer who took care of modify the CG4 class in the proper way.
Sign corrected