55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
//
|
|
// E_Terminator.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 19.05.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef E_Terminator_h
|
|
#define E_Terminator_h
|
|
|
|
#include "terminator_base.h"
|
|
|
|
|
|
class E_Terminator : public Terminator_Base, private Energy_Terminator_Base, private MaxInteractions_Terminator_Base {
|
|
|
|
public:
|
|
E_Terminator(const int &maxInteractions, const double &cutoffEnergy_eV) : Terminator_Base(electron), Energy_Terminator_Base(cutoffEnergy_eV), MaxInteractions_Terminator_Base(maxInteractions) {};
|
|
|
|
bool checkTermination (const Particle &movePart);
|
|
private:
|
|
bool check_Wall(const Particle &movePart);
|
|
};
|
|
|
|
|
|
inline bool E_Terminator::checkTermination (const Particle &movePart) {
|
|
if (check_Wall(movePart)) {
|
|
return true;
|
|
}
|
|
if (check_Energy(movePart)) {
|
|
return true;
|
|
}
|
|
if (check_MaxInteractions(movePart)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
inline bool E_Terminator::check_Wall(const Particle &movePart) {
|
|
vec3 loc_m = movePart.get_x_m();
|
|
double z_m = loc_m[2];
|
|
double r_m = sqrt( pow(loc_m[0],2) + pow(loc_m[1],2) );
|
|
if (z_m <= z_RW_m) {
|
|
return true;
|
|
}
|
|
if (r_m >= r_WGTS_m) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
#endif /* E_Terminator_h */
|