IAP GITLAB

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

removed IsNucleus from projectile test in nuclear interaction

parent b304f38d
No related branches found
No related tags found
No related merge requests found
...@@ -227,15 +227,20 @@ namespace corsika::process::sibyll { ...@@ -227,15 +227,20 @@ namespace corsika::process::sibyll {
RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(); RootCoordinateSystem::GetInstance().GetRootCoordinateSystem();
const particles::Code corsikaBeamId = vP.GetPID(); const particles::Code corsikaBeamId = vP.GetPID();
if (!particles::IsNucleus(corsikaBeamId)) {
// no nuclear interaction if (corsikaBeamId != particles::Code::Nucleus) {
return std::numeric_limits<double>::infinity() * 1_g / (1_cm * 1_cm); // check if target-style nucleus (enum), these are not allowed as projectile
if (particles::IsNucleus(corsikaBeamId))
throw std::runtime_error(
"NuclearInteraction: GetInteractionLength: Wrong nucleus type. Nuclear "
"projectiles should use NuclearStackExtension!");
else {
// no nuclear interaction
cout << "NuclearInteraction::GetInteractionLength: non nuclear projectile: "
<< corsikaBeamId << " set interaction length to inf" << endl;
return std::numeric_limits<double>::infinity() * 1_g / (1_cm * 1_cm);
}
} }
// check if target-style nucleus (enum)
if (corsikaBeamId != particles::Code::Nucleus)
throw std::runtime_error(
"NuclearInteraction: GetInteractionLength: Wrong nucleus type. Nuclear "
"projectiles should use NuclearStackExtension!");
// read from cross section code table // read from cross section code table
...@@ -333,13 +338,6 @@ namespace corsika::process::sibyll { ...@@ -333,13 +338,6 @@ namespace corsika::process::sibyll {
// const auto ProjMass = vP.GetMass(); // const auto ProjMass = vP.GetMass();
cout << "NuclearInteraction: DoInteraction: called with:" << ProjId << endl; cout << "NuclearInteraction: DoInteraction: called with:" << ProjId << endl;
if (!IsNucleus(ProjId)) {
cout << "WARNING: non nuclear projectile in NUCLIB!" << endl;
// this should not happen
// throw std::runtime_error("Non nuclear projectile in NUCLIB!");
return process::EProcessReturn::eOk;
}
// check if target-style nucleus (enum) // check if target-style nucleus (enum)
if (ProjId != particles::Code::Nucleus) if (ProjId != particles::Code::Nucleus)
throw std::runtime_error( throw std::runtime_error(
......
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