diff --git a/corsika/modules/Pythia8.hpp b/corsika/modules/Pythia8.hpp index ee5d18e74975cd3f4459195013a41500f99aed54..80cc67971728aae65d48834a1ddc7cf957469a07 100644 --- a/corsika/modules/Pythia8.hpp +++ b/corsika/modules/Pythia8.hpp @@ -9,5 +9,5 @@ #pragma once #include <corsika/modules/pythia8/Decay.hpp> -#include <corsika/modules/pythia8/Interaction.hpp> +//#include <corsika/modules/pythia8/Interaction.hpp> #include <corsika/modules/pythia8/NeutrinoInteraction.hpp> diff --git a/tests/modules/testPythia8.cpp b/tests/modules/testPythia8.cpp index ee51e1f6d3fbcd04298e540ae58142ca5ab16d90..6c335a9af3d808e2480c30b91fc915efa27dec3b 100644 --- a/tests/modules/testPythia8.cpp +++ b/tests/modules/testPythia8.cpp @@ -165,143 +165,7 @@ TEST_CASE("Pythia8Interface", "modules") { REQUIRE(decay.canHandleDecay(Code::MuPlus)); } - SECTION("pythia interaction") { - - // this will be a p-p collision at sqrts=3.5TeV -> no problem for pythia - auto [stackPtr, secViewPtr] = setup::testing::setup_stack( - Code::Proton, 7_TeV, (DummyEnvironment::BaseNodeType* const)nodePtr, *csPtr); - auto& view = *secViewPtr; - - corsika::pythia8::Interaction collision; - - REQUIRE(collision.canInteract(Code::Proton)); - REQUIRE(collision.canInteract(Code::AntiProton)); - REQUIRE(collision.canInteract(Code::Neutron)); - REQUIRE(collision.canInteract(Code::AntiNeutron)); - REQUIRE(collision.canInteract(Code::PiMinus)); - REQUIRE(collision.canInteract(Code::PiPlus)); - REQUIRE_FALSE(collision.canInteract(Code::Electron)); - - // pi+p - REQUIRE(collision.getCrossSection( - Code::PiPlus, Code::Proton, - {sqrt(static_pow<2>(PiPlus::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Proton::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) > 0_mb); - - // pi+H - REQUIRE(collision.getCrossSection( - Code::PiPlus, Code::Hydrogen, - {sqrt(static_pow<2>(PiPlus::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Hydrogen::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) > 0_mb); - - // K+{p,n,N,O,Ar} - Code const target = - GENERATE(Code::Proton, Code::Neutron, Code::Nitrogen, Code::Oxygen, Code::Argon); - REQUIRE(collision.getCrossSection( - Code::KPlus, target, - {sqrt(static_pow<2>(KPlus::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {get_mass(target), {rootCS, {0_eV, 0_eV, 0_eV}}}) > 0_mb); - - collision.doInteraction(view, Code::Proton, target, - {sqrt(static_pow<2>(Proton::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {get_mass(target), {rootCS, {0_eV, 0_eV, 0_eV}}}); - REQUIRE(view.getSize() >= 2); - } - - SECTION("pythia too low energy") { - - // this is a projectile neutron with very little energy - auto [stackPtr, secViewPtr] = setup::testing::setup_stack( - Code::Neutron, 1_GeV, (DummyEnvironment::BaseNodeType* const)nodePtr, *csPtr); - auto& view = *secViewPtr; - - 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.doInteraction( - view, Code::Neutron, Code::Proton, - {calculate_total_energy(Neutron::mass, 5_MeV), {rootCS, 0_eV, 0_eV, 5_MeV}}, - {Proton::mass, {rootCS, 0_eV, 0_eV, 0_eV}})); - } - - SECTION("pythia wrong target") { - - // incompatible target - auto [env_Fe, csPtr_Fe, nodePtr_Fe] = setup::testing::setup_environment(Code::Iron); - { - [[maybe_unused]] auto const& cs_Fe = *csPtr_Fe; - [[maybe_unused]] auto const& env_dummy_Fe = env_Fe; - [[maybe_unused]] auto const& node_dummy_Fe = nodePtr_Fe; - } - - // resonable projectile, but too low energy - auto [stackPtr, secViewPtr] = setup::testing::setup_stack( - Code::Proton, 1_GeV, (DummyEnvironment::BaseNodeType* const)nodePtr_Fe, - *csPtr_Fe); - auto& view = *secViewPtr; - { [[maybe_unused]] auto const& dummy_StackPtr = stackPtr; } - - corsika::pythia8::Interaction collision; - - REQUIRE(collision.getCrossSectionInelEla( - Code::Proton, Code::Iron, - {calculate_total_energy(Proton::mass, 100_GeV), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Iron::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) == std::tuple{0_mb, 0_mb}); - - REQUIRE(collision.getCrossSection( - Code::Proton, Code::Iron, - {sqrt(static_pow<2>(Proton::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Iron::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) == 0_mb); - - REQUIRE_THROWS(collision.doInteraction( - view, Code::Proton, Code::Iron, - {sqrt(static_pow<2>(Proton::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Iron::mass, {rootCS, {0_eV, 0_eV, 0_eV}}})); - } - - SECTION("pythia wrong projectile") { - // resonable projectile, but tool low energy - auto [stackPtr, secViewPtr] = setup::testing::setup_stack( - Code::Iron, 1_GeV, (DummyEnvironment::BaseNodeType* const)nodePtr, *csPtr); - { [[maybe_unused]] auto const& dummy_StackPtr = stackPtr; } - - corsika::pythia8::Interaction collision; - REQUIRE(collision.getCrossSectionInelEla( - Code::Electron, Code::Electron, - {sqrt(static_pow<2>(Electron::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Proton::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) == std::tuple{0_mb, 0_mb}); - - REQUIRE_THROWS(collision.doInteraction( - *secViewPtr, Code::Helium, Code::Nitrogen, - {sqrt(static_pow<2>(Helium::mass) + static_pow<2>(100_GeV)), - {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Nitrogen::mass, {rootCS, {0_eV, 0_eV, 0_eV}}})); - - // gamma+p not possible - REQUIRE(collision.getCrossSection(Code::Photon, Code::Proton, - {100_GeV, {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Proton::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) == - CrossSectionType::zero()); - - REQUIRE(collision.getCrossSectionInelEla( - Code::Photon, Code::Proton, {100_GeV, {rootCS, {0_eV, 0_eV, 100_GeV}}}, - {Proton::mass, {rootCS, {0_eV, 0_eV, 0_eV}}}) == - std::make_tuple(CrossSectionType::zero(), CrossSectionType::zero())); - } + //#include "tests/modules/testPythia8Interaction.inl" SECTION("pythia neutrino interaction") {