// // electron_drift.h // mc_electron // // Created by Christian Reiling on 16.05.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #ifndef electron_drift_h #define electron_drift_h #include "drift_base.h" class E_Mover_Drift : public Drift_Base { public: E_Mover_Drift(Particle_Logger_Base *Logger, Population_Base *Population) : Drift_Base(electron, Logger, Population) {}; protected: void doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m); }; void E_Mover_Drift::doWallInteraction(Particle *movePart, vec3 *oldLoc_m, double *znew_m) { if (*znew_m >= z_WGTS_end_m) { // Moveing into Spectrometer and reversing Speed. vec3 reverseLoc_m = *oldLoc_m; // Log Movement before Reflection reverseLoc_m[2] = z_WGTS_end_m; movePart->set_x_m(reverseLoc_m); Logger->log(*movePart, *oldLoc_m); Population->increase_density(*movePart, *oldLoc_m); // Final Movement *oldLoc_m = reverseLoc_m; *znew_m = z_WGTS_end_m - (*znew_m - z_WGTS_end_m); movePart->set_v_ms( -1*(movePart->get_v_ms()) ); } if (*znew_m <= z_RW_m) { *znew_m = z_RW_m; } } #endif /* electron_drift_h */