64 lines
1.8 KiB
C++
64 lines
1.8 KiB
C++
//
|
|
// exc_base.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 18.06.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef exc_base_h
|
|
#define exc_base_h
|
|
|
|
#include "tcs_container.hpp"
|
|
#include "dcs_base.h"
|
|
|
|
class Excitation_Base : public Sub_Interaction_Base {
|
|
DCS_Base *dcs_gen;
|
|
protected:
|
|
double deltaE_eV;
|
|
|
|
public:
|
|
Excitation_Base(Population_Base *Population, UniRNG *rngUni, double deltaE_eV, DCS_Base *dcs_gen) : Sub_Interaction_Base(Population, rngUni) {
|
|
this->deltaE_eV = deltaE_eV;
|
|
this->dcs_gen = dcs_gen;
|
|
}
|
|
|
|
InteractionOut do_Interaction (Particle *interPart);
|
|
private:
|
|
//virtual double get_microSigma_m2(const double &Ekin_EV) = 0;
|
|
};
|
|
|
|
inline InteractionOut Excitation_Base::do_Interaction (Particle *interPart) {
|
|
vec3 vOff_ms = get_vOff_ms(*interPart, deltaE_eV);
|
|
vec3 vLab_ms = interPart->get_v_ms() - vOff_ms;
|
|
double EkinLab_eV = calc_E_eV_from_v_ms(vLab_ms, me_eV);
|
|
double EkinLabNew_eV = EkinLab_eV - deltaE_eV;
|
|
double theta_lab = dcs_gen->get_theta(EkinLab_eV);
|
|
double phi_lab = rngUni->random() * 2 * pi;
|
|
vec3 n0 = calc_n_new(vLab_ms, theta_lab, phi_lab);
|
|
vec3 vnew_ms = n0 * calc_v_ms_from_E_eV(EkinLabNew_eV, me_eV) + vOff_ms;
|
|
interPart->set_v_ms(vnew_ms);
|
|
|
|
return InteractionOut();
|
|
}
|
|
|
|
|
|
class Exp_Excitation_Base : public Excitation_Base {
|
|
TCS_Container tcs_data;
|
|
public:
|
|
Exp_Excitation_Base(Population_Base *T2Population, UniRNG *rngUni, double deltaE_eV, DCS_Base *dcs_gen, std::string load_file_name) : Excitation_Base(T2Population, rngUni, deltaE_eV, dcs_gen),
|
|
tcs_data(scale_start, scale_end, 1e3, get_data_path() + load_file_name) {};
|
|
|
|
private:
|
|
double get_microSigma_m2(const double &E_eV, const vec3 &loc_m) {
|
|
if (E_eV < deltaE_eV) {
|
|
return 0;
|
|
} else {
|
|
return tcs_data.get_value(E_eV);
|
|
}
|
|
}
|
|
};
|
|
|
|
|
|
#endif /* exc_base_h */
|