IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 8a8051b2 authored by Felix Riehn's avatar Felix Riehn
Browse files

output format etc

parent 61df23dc
No related branches found
No related tags found
No related merge requests found
...@@ -40,8 +40,8 @@ namespace corsika::process { ...@@ -40,8 +40,8 @@ namespace corsika::process {
auto const Plab = corsika::geometry::FourVector(e_original, p_original); auto const Plab = corsika::geometry::FourVector(e_original, p_original);
auto const m_kinetic = Plab.GetNorm(); auto const m_kinetic = Plab.GetNorm();
auto const m_corsika = particles::GetMass(pid); auto const m_corsika = particles::GetMass(pid);
auto const m_err = abs(m_kinetic - m_corsika) / m_corsika; auto const m_err_abs = abs(m_kinetic - m_corsika);
if (m_err > mass_tolerance_) { if (m_err_abs >= mass_tolerance_ * m_corsika) {
const HEPEnergyType e_shifted = const HEPEnergyType e_shifted =
sqrt(p_original.GetSquaredNorm() + m_corsika * m_corsika); sqrt(p_original.GetSquaredNorm() + m_corsika * m_corsika);
auto const e_shift_relative = (e_shifted / e_original - 1); auto const e_shift_relative = (e_shifted / e_original - 1);
...@@ -50,20 +50,23 @@ namespace corsika::process { ...@@ -50,20 +50,23 @@ namespace corsika::process {
we could promote this to an error. we could promote this to an error.
*/ */
if (abs(e_shift_relative) > energy_tolerance_) { if (abs(e_shift_relative) > energy_tolerance_) {
std::cout << "OnShellCheck::DoSecondaries: warning! shifted particle energy by " std::cout << "OnShellCheck: warning! shifted particle energy by "
<< e_shift_relative*100 << " %" << std::endl; << e_shift_relative*100 << " %" << std::endl;
} }
std::cout << "OnShellCheck::DoSecondaries: shift particle mass for " << pid std::cout << "OnShellCheck: shift particle mass for " << pid
<< std::endl << std::endl
<< std::setw(20) << std::setfill(' ') << std::setw(35) << std::setfill(' ')
<< "corsika mass (GeV): " << m_corsika / 1_GeV << std::endl << "corsika mass (GeV): " << m_corsika / 1_GeV << std::endl
<< std::setw(35) << std::setfill(' ')
<< "kinetic mass (GeV): " << m_kinetic / 1_GeV << std::endl << "kinetic mass (GeV): " << m_kinetic / 1_GeV << std::endl
<< "(m_kin-m_cor)/en: " << m_err << std::endl << std::setw(35) << std::setfill(' ')
<< "mass tolerance: " << mass_tolerance_ << std::endl; << "m_kin-m_cor (GeV): " << m_err_abs / 1_GeV << std::endl
<< std::setw(35) << std::setfill(' ')
<< "mass tolerance (GeV): " << ( m_corsika * mass_tolerance_ ) / 1_GeV << std::endl;
// reset energy // reset energy
p.SetEnergy(e_shifted); p.SetEnergy(e_shifted);
} else } else
std::cout << "OnShellCheck::DoSecondaries: particle mass for " << pid << " OK" << std::endl; std::cout << "OnShellCheck: particle mass for " << pid << " OK" << std::endl;
} }
return EProcessReturn::eOk; return EProcessReturn::eOk;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment