Added bug, where drift Approximation would not propergate particles with macro_sigma = 0 properly.

This commit is contained in:
Christian
2019-09-19 13:45:34 +02:00
parent e54354d91d
commit 319e3261fe
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -47,7 +47,10 @@ inline double Drift_Base::get_zNew_m(Particle *movePart, const double &macroSigm
double zDir = v_ms[2] <= 0 ? -1 : 1;
double znew_m;
if (macroSigma_m2 == 0) {
znew_m = (zDir == -1) ? z_RW_m : z_WGTS_end_m;
if (zDir == -1) {
znew_m = z_RW_m - 2*l_WGTS_m;
} else
znew_m = z_WGTS_end_m + 2*l_WGTS_m;
} else {
double distance_m = 1/macroSigma_m2;
znew_m = zold_m + zDir*vForwardAbs_ms/vTotAbs_ms * distance_m;