Fixed Bug: Ionization near threashold and sampling near maximum secondary energy could lead to negative energy. Since energy was small, setting it to 0.

This commit is contained in:
Christian
2019-06-18 10:35:44 +02:00
parent ec2864b6fc
commit 61c29739a8
2 changed files with 1 additions and 3 deletions
+1
View File
@@ -55,6 +55,7 @@ inline InteractionOut eT2_T2I_Ionization_Base::do_Interaction (Particle *interPa
}
double W_eV = roll_ionW_eV(T_eV);
double E1_eV = T_eV-EionT2_eV - W_eV;
E1_eV = (E1_eV < 0) ? zero : E1_eV;
double phi1 = rngUni->random()*2*pi;
double phi2 = phi1-pi;