57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
//
|
|
// positive_terminator.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 04.07.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef positive_terminator_h
|
|
#define positive_terminator_h
|
|
|
|
#include "terminator_base.h"
|
|
#include "katrin_geo.hpp"
|
|
|
|
class Positive_Terminator : public Terminator_Base, private Energy_Terminator_Base, private MaxInteractions_Terminator_Base {
|
|
|
|
public:
|
|
Positive_Terminator(species this_species, const int &maxInteractions, const double &cutoffEnergy_eV) : Terminator_Base(this_species), Energy_Terminator_Base(cutoffEnergy_eV), MaxInteractions_Terminator_Base(maxInteractions) {};
|
|
|
|
bool checkTermination (const Particle &movePart);
|
|
private:
|
|
bool check_Wall(const Particle &movePart);
|
|
};
|
|
|
|
|
|
inline bool Positive_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 Positive_Terminator::check_Wall(const Particle &movePart) {
|
|
vec3 loc_m = movePart.get_Location_m();
|
|
double z_m = loc_m[2];
|
|
double r_m = sqrt( pow(loc_m[0],2) + pow(loc_m[1],2) );
|
|
if (z_m <= Katrin_Geo::get_z_RW_m()) {
|
|
return true;
|
|
}
|
|
if (z_m >= Katrin_Geo::get_z_WGTSend_m()) {
|
|
return true;
|
|
}
|
|
if (r_m >= Katrin_Geo::get_radius_m()) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
#endif /* positive_terminator_h */
|