44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
//
|
|
// T2IT2_cx.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 12.07.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef T2IT2_cx_h
|
|
#define T2IT2_cx_h
|
|
|
|
#include "sub_interaction_base.h"
|
|
#include "janev_T2IT2_cx.h"
|
|
|
|
|
|
class T2IT2_CX : public Sub_Interaction_Base {
|
|
public:
|
|
T2IT2_CX(Population_Base *T2Population, UniRNG *rngUni) : Sub_Interaction_Base(T2Population, rngUni) {}
|
|
double get_macroSigma_m2(const Particle &interPart);
|
|
InteractionOut do_Interaction (Particle *interPart);
|
|
};
|
|
|
|
|
|
inline double T2IT2_CX::get_macroSigma_m2(const Particle &interPart) {
|
|
double E_eV = interPart.get_E_eV();
|
|
double microSigma_m2 = Janev_T2IT2_CX::get_TCS(E_eV);
|
|
vec3 loc_m = interPart.get_x_m();
|
|
double nT2_m3 = Population->get_density_m3(loc_m);
|
|
return microSigma_m2*nT2_m3;
|
|
}
|
|
|
|
inline InteractionOut T2IT2_CX::do_Interaction (Particle *interPart) {
|
|
vec3 loc_m = interPart->get_x_m();
|
|
vec3 v2_ms = Population->roll_v_ms(loc_m);
|
|
|
|
vec3 vLab_ms = interPart->get_v_ms() - v2_ms;
|
|
vec3 v1_ms = roll_uniform_direction(rngUni) * calc_vec3_abs(vLab_ms) + v2_ms;
|
|
interPart->set_v_ms(v1_ms);
|
|
return InteractionOut();
|
|
}
|
|
|
|
|
|
#endif /* T2IT2_cx_h */
|