From c920a0ef982e5a7f280c6db2001145886582bbed Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 15 Nov 2019 19:17:06 +0100 Subject: [PATCH] Fixed Bug: Forgot Theta distributino function in integration --- src/mc_electron/sub_interaction_base.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mc_electron/sub_interaction_base.h b/src/mc_electron/sub_interaction_base.h index 25e892a..975023e 100644 --- a/src/mc_electron/sub_interaction_base.h +++ b/src/mc_electron/sub_interaction_base.h @@ -95,7 +95,7 @@ protected: } else { double v1_ms = sqrt(2*E_eV/mI_eV)*c_ms; auto integrand = [&](double theta) { - double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2); + double E_eV = m_eV/2/pi * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2); return get_microSigma_m2(E_eV); }; return integrate(integrand, 0., pi, 30, simpson()); @@ -154,7 +154,7 @@ protected: double calc_microSigma_m2(const double &E_eV) { double v1_ms = sqrt(2*E_eV/m2_eV)*c_ms; auto integrand = [&](double theta) { - double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2); + double E_eV = m_eV/2/pi * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2); return get_microSigma_m2(E_eV); }; return integrate(integrand, 0., pi, 30, simpson()); @@ -195,7 +195,7 @@ protected: double calc_microSigma_divbyn_m2(const double &E_eV) { double v1_ms = sqrt(2*E_eV/m2_eV)*c_ms; auto integrand = [&](double theta) { - double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2); + double E_eV = m_eV/2/pi * (pow(v1_ms,2) + pow(v_therm,2) - 2*v1_ms*v_therm*cos(theta)) * pow(c_ms, -2); return get_microSigma_divbyn_m2(E_eV); }; return integrate(integrand, 0., pi, 30, simpson()); @@ -252,7 +252,7 @@ protected: return get_microSigma_m2(Ee_mids[Ee_bin]); // location is dummy again... } else { auto integrand = [&](double theta) { - double E_eV = m_eV/2 * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2); + double E_eV = m_eV/2/pi * (pow(v1_ms,2) + pow(v2_ms,2) - 2*v1_ms*v2_ms*cos(theta)) * pow(c_ms, -2); return get_microSigma_m2(E_eV); // location is dummy again... }; return integrate(integrand, 0., pi, 30, simpson());