From 9bb87e999ec88f8cb352dd2d5789323be790c61e Mon Sep 17 00:00:00 2001 From: Gordon McCann Date: Thu, 16 Jun 2022 11:12:35 -0400 Subject: [PATCH] Small bugfixes in energy loss table and test. Added testonly flag in main --- src/ElossTable.cpp | 10 +++++----- src/ElossTable.h | 2 +- src/GenerateTable.cpp | 2 +- src/main.cpp | 15 ++++++++------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/ElossTable.cpp b/src/ElossTable.cpp index 1c211a1..85141e8 100644 --- a/src/ElossTable.cpp +++ b/src/ElossTable.cpp @@ -76,23 +76,23 @@ namespace PunchTable { m_isValid = true; } - double ElossTable::GetEnergyLoss(double finalEnergy, double theta_incident) + double ElossTable::GetEnergyLoss(double thetaIncident, double finalEnergy) { - theta_incident /= s_deg2rad; + thetaIncident /= s_deg2rad; if(!m_isValid) { std::cerr<<"ElossTable not initialized at GetEnergyLoss()"< m_thetaMax) + else if(thetaIncident < m_thetaMin || thetaIncident > m_thetaMax) { std::cerr<<"Theta incident outside of range of calculated values for ElossTable::GetEnergyLoss()"<