Restructured Interaction Base classes and reviewed. Added Parameters for Setting Number of Integration Points for CS and for Population sices.
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
//
|
|
// T5IT2_elastic.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 16.09.19.
|
|
// Copyright © 2019 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef T5IT2_elastic_h
|
|
#define T5IT2_elastic_h
|
|
|
|
#include "TI_thermal_binary_base.h"
|
|
|
|
class T5IT2_Elastic : public TI_thermal_binary_Precomputed_Interaction_Base {
|
|
Tabata_T3IT2_Elastic tcs_gen; // Obviously wrong, but should be good enough.
|
|
Elastic_Kinematic_Base kinematics;
|
|
|
|
public:
|
|
T5IT2_Elastic(Population_Base *T2Population, UniRNG *rngUni) : TI_thermal_binary_Precomputed_Interaction_Base(T2Population, rngUni, 5*mT_eV), kinematics(5*mT_eV, 2*mT_eV) {
|
|
calc_values(); // need to call here, because, constructor can't call pure virtual function
|
|
};
|
|
|
|
double get_microSigma_m2(const double &E_eV) {return tcs_gen.get_TCS(E_eV);}
|
|
InteractionOut do_Interaction (Particle *interPart);
|
|
};
|
|
|
|
inline InteractionOut T5IT2_Elastic::do_Interaction (Particle *interPart) {
|
|
vec3 v1_ms = interPart->get_v_ms();
|
|
vec3 v2_ms = Population->roll_v_ms(interPart->get_x_m());
|
|
double theta_lab = rngUni->random() * pi;
|
|
double phi_lab = rngUni->random() * 2 * pi;
|
|
interPart->set_v_ms(kinematics.get_v1_new(v1_ms, v2_ms, theta_lab, phi_lab));
|
|
return InteractionOut();
|
|
}
|
|
|
|
#endif /* T5IT2_elastic_h */
|