Changes to Interaction Processor, making possible to add infinite Interactions for all kind of Particles
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// BED_eT2_ionization.cpp
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 29.04.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#include "BED_eT2_ionization.hpp"
|
||||
|
||||
#include "functions.hpp"
|
||||
#include "constants.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <cmath>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace BED_eT2_Ionization {
|
||||
double get_TCS(double T_eV) {
|
||||
if (T_eV<=0) {
|
||||
stringstream ss;
|
||||
ss<<"get_TCS(double T_eV): Input energy T_eV="<<T_eV<<" eV < 0.";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
|
||||
if (T_eV<=B_eV) {
|
||||
return (0);
|
||||
} else {
|
||||
double t = get_t(T_eV);
|
||||
double fac = S_m2/(t+u+1);
|
||||
double sum1 = get_Dt(t)*log(t);
|
||||
double sum2 = (2-Ni/N)*( (t-1)/t - log(t)/(t+1) );
|
||||
return(fac*(sum1 + sum2) );
|
||||
}
|
||||
}
|
||||
|
||||
double get_SDCS (double T_eV, double W_eV) {
|
||||
if (T_eV<0) {
|
||||
stringstream ss;
|
||||
ss<<"getSDCS(double T_eV, double W_eV): Input energy T_eV="<<T_eV<<" eV < 0.";
|
||||
throw MyException(ss.str());
|
||||
} else if (W_eV<0) {
|
||||
stringstream ss;
|
||||
ss<<"getSDCS(double T_eV, double W_eV): Input energy W_eV="<<W_eV<<" eV < 0.";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
|
||||
if ( (T_eV<=B_eV) ||(W_eV >= (T_eV-B_eV) ) ) {
|
||||
return (0);
|
||||
} else {
|
||||
double t = get_t(T_eV);
|
||||
double w = get_w(W_eV);
|
||||
double fac = S_m2/B_eV/(t+u+1);
|
||||
double sum1 = (Ni/N - 2)/(t+1) * (1/(w+1) + 1/(t-w));
|
||||
double sum2 = (2-Ni/N) * (pow(w+1,-2) + pow(t-w,-2));
|
||||
double sum3 = log(t)/(N*(w+1)) * get_dfdw(w);
|
||||
return(fac*(sum1 + sum2 + sum3));
|
||||
}
|
||||
}
|
||||
|
||||
inline double get_t(double T_eV) {
|
||||
return(T_eV/B_eV);
|
||||
}
|
||||
|
||||
inline double get_w(double W_eV) {
|
||||
return(W_eV/B_eV);
|
||||
}
|
||||
|
||||
inline double get_dfdw(double w) {
|
||||
double y = 1/(w+1);
|
||||
double res = 0;
|
||||
for (int i=0;i<4;i++) {
|
||||
res += c[i]*pow(y,i+3);
|
||||
}
|
||||
return(res);
|
||||
}
|
||||
|
||||
inline double get_Dt(double t) {
|
||||
double yh = 2/(t+1);
|
||||
double res = 0;
|
||||
for (int i=0;i<4;i++) {
|
||||
res += c[i]/(i+3)*(1-pow(yh,i+3));
|
||||
}
|
||||
res = res/N;
|
||||
return(res);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user