Added vibrational excitation 0->1, 0->2
Previous commit was incomplete.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
|
||||
class Excitation_Base : public Sub_Interaction_Base {
|
||||
Inelastic_Kinematic_Base kinematics;
|
||||
DCS_Theta_Container dcs_data;
|
||||
double deltaE_eV;
|
||||
|
||||
public:
|
||||
Excitation_Base(Population_Base *Population, UniRNG *rngUni, double deltaE_eV) : Sub_Interaction_Base(Population, rngUni),
|
||||
kinematics(deltaE_eV, me_eV, mT2_eV),
|
||||
dcs_data(zero, 2e4, 1e3, 200, get_data_path() + "eT2_ela_DCS.dat") {
|
||||
this->deltaE_eV = deltaE_eV;
|
||||
}
|
||||
|
||||
double get_macroSigma_m2(const Particle &interPart);
|
||||
InteractionOut do_Interaction (Particle *interPart);
|
||||
private:
|
||||
double calc_T_eV(Particle *interPart, vec3 *v2_ms);
|
||||
virtual double get_microSigma_m2(const double &Ekin_EV) = 0;
|
||||
};
|
||||
|
||||
|
||||
inline double Excitation_Base::get_macroSigma_m2(const Particle &interPart) {
|
||||
double Ekin_eV = interPart.get_EKin_eV();
|
||||
double microSigma_m2 = get_microSigma_m2(Ekin_eV);
|
||||
vec3 loc_m = interPart.get_Location_m();
|
||||
double n_m3 = Population->get_density_m3(loc_m);
|
||||
return (microSigma_m2*n_m3);
|
||||
}
|
||||
|
||||
inline InteractionOut Excitation_Base::do_Interaction (Particle *interPart) {
|
||||
vec3 v2_ms = Population->roll_speed_ms(interPart->get_Location_m());
|
||||
double T_eV = calc_T_eV(interPart, &v2_ms);
|
||||
double theta_lab = dcs_data.roll_value(T_eV,rngUni);
|
||||
double phi_lab = rngUni->random() * 2 * pi;
|
||||
kinematics.doKinematics(interPart, v2_ms, theta_lab, phi_lab);
|
||||
return (InteractionOut());
|
||||
}
|
||||
|
||||
inline double Excitation_Base::calc_T_eV(Particle *interPart, vec3 *v2_ms) {
|
||||
vec3 v_ms = interPart->get_Speed_ms();
|
||||
vec3 vLab_ms = v_ms - *v2_ms;
|
||||
double T_eV = calc_Ekin_eV_from_speed(vLab_ms, me_eV);
|
||||
if (T_eV < deltaE_eV) {
|
||||
*v2_ms = 0;
|
||||
T_eV = calc_Ekin_eV_from_speed(v_ms, me_eV);
|
||||
if (T_eV < deltaE_eV) {
|
||||
std::stringstream ss;
|
||||
ss<<"Excitation_Base::calc_T_eV: T_eV < deltaE_eV \n";
|
||||
throw MyException (ss.str());
|
||||
}
|
||||
}
|
||||
return (T_eV);
|
||||
}
|
||||
|
||||
|
||||
#endif /* exc_base_h */
|
||||
Reference in New Issue
Block a user