diff --git a/tests/modules/testPythia8Interaction.inl b/tests/modules/testPythia8Interaction.inl index 991cbfd970657bf27249f94ed29003d4ea3efd83..71e35186a4853d70406dfaf132a99587b3f63167 100644 --- a/tests/modules/testPythia8Interaction.inl +++ b/tests/modules/testPythia8Interaction.inl @@ -61,8 +61,8 @@ SECTION("pythia interaction: proton") { SECTION("pythia interaction: PiPlus") { // test some combinations of valid target and projectile particles - // so far only hadron-hadron and hadron-Nucleus is allowed - Code const target = GENERATE(Code::Proton, Code::Nitrogen, Code::Oxygen, Code::Argon); + // + Code const target = GENERATE(Code::Nitrogen, Code::Oxygen, Code::Argon); Code const projectile = Code::PiPlus; CORSIKA_LOG_INFO("testing: {}-{}", projectile, target); @@ -82,7 +82,7 @@ SECTION("pythia interaction: PiPlus") { SECTION("pythia interaction: KPlus") { // test some combinations of valid target and projectile particles // so far only hadron-hadron and hadron-Nucleus is allowed - Code const target = GENERATE(Code::Proton, Code::Nitrogen, Code::Oxygen, Code::Argon); + Code const target = GENERATE(Code::Nitrogen, Code::Oxygen, Code::Argon); Code const projectile = Code::KPlus; CORSIKA_LOG_INFO("testing: {}-{}", projectile, target); @@ -99,6 +99,26 @@ SECTION("pythia interaction: KPlus") { REQUIRE(view.getSize() >= 2); } +SECTION("pythia interaction: angantyr fail") { + // test some combinations of valid target and projectile particles + // so far only hadron-hadron and hadron-Nucleus is allowed + Code const target = Code::Proton; + Code const projectile = GENERATE(Code::KPlus, Code::PiPlus); + + CORSIKA_LOG_INFO("testing: {}-{}", projectile, target); + REQUIRE( + collision.getCrossSection( + projectile, target, + {calculate_total_energy(P0, get_mass(projectile)), {rootCS, {0_eV, 0_eV, P0}}}, + {get_mass(target), {rootCS, {0_eV, 0_eV, 0_eV}}}) > 0_mb); + + REQUIRE_THROWS( + collision.doInteraction(view, projectile, target, + {corsika::calculate_total_energy(P0, get_mass(projectile)), + {rootCS, {0_eV, 0_eV, P0}}}, + {get_mass(target), {rootCS, {0_eV, 0_eV, 0_eV}}})); +} + SECTION("pythia too low energy") { // this is a projectile neutron with very little energy @@ -109,10 +129,11 @@ SECTION("pythia too low energy") { corsika::pythia8::Interaction collision; // 5 MeV lab is too low, 0 mb expected - REQUIRE(collision.getCrossSectionInelEla( - Code::Proton, Code::Proton, - {calculate_total_energy(Proton::mass, 5_MeV), {rootCS, 0_eV, 0_eV, 5_MeV}}, - {Proton::mass, {rootCS, 0_eV, 0_eV, 0_eV}}) == std::tuple{0_mb, 0_mb}); + REQUIRE_THROWS( + collision.getCrossSectionInelEla( + Code::Proton, Code::Proton, + {calculate_total_energy(Proton::mass, 5_MeV), {rootCS, 0_eV, 0_eV, 5_MeV}}, + {Proton::mass, {rootCS, 0_eV, 0_eV, 0_eV}}) == std::tuple{0_mb, 0_mb}); REQUIRE_THROWS(collision.doInteraction( view, Code::Neutron, Code::Proton,