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:
@@ -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;
|
||||
|
||||
@@ -13,11 +13,8 @@ using namespace std;
|
||||
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
|
||||
clock_t start = clock();
|
||||
Simulation Sim;
|
||||
Sim.doit();
|
||||
cout<<"Duration: "<< ( clock() - start ) / (double) CLOCKS_PER_SEC <<"\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user