From e72a10db9f25559b5f0486ae01ee793dbc774b22 Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@kit.edu> Date: Fri, 10 Jun 2022 16:48:39 +0200 Subject: [PATCH] renamed sibyll::InteractionModel to sibyll::HadronInteractionModel --- ...onModel.inl => HadronInteractionModel.inl} | 12 +++++------ corsika/modules/Sibyll.hpp | 4 ++-- ...onModel.hpp => HadronInteractionModel.hpp} | 20 +++++++++---------- tests/modules/testSibyll.cpp | 10 +++++----- 4 files changed, 22 insertions(+), 24 deletions(-) rename corsika/detail/modules/sibyll/{InteractionModel.inl => HadronInteractionModel.inl} (93%) rename corsika/modules/sibyll/{InteractionModel.hpp => HadronInteractionModel.hpp} (84%) diff --git a/corsika/detail/modules/sibyll/InteractionModel.inl b/corsika/detail/modules/sibyll/HadronInteractionModel.inl similarity index 93% rename from corsika/detail/modules/sibyll/InteractionModel.inl rename to corsika/detail/modules/sibyll/HadronInteractionModel.inl index 5c086677e..5114ce159 100644 --- a/corsika/detail/modules/sibyll/InteractionModel.inl +++ b/corsika/detail/modules/sibyll/HadronInteractionModel.inl @@ -20,9 +20,9 @@ namespace corsika::sibyll { - inline void InteractionModel::setVerbose(bool const flag) { sibyll_listing_ = flag; } + inline void HadronInteractionModel::setVerbose(bool const flag) { sibyll_listing_ = flag; } - inline InteractionModel::InteractionModel() + inline HadronInteractionModel::HadronInteractionModel() : sibyll_listing_(false) { // initialize Sibyll static bool initialized = false; @@ -32,11 +32,11 @@ namespace corsika::sibyll { } } - inline InteractionModel::~InteractionModel() { + inline HadronInteractionModel::~HadronInteractionModel() { CORSIKA_LOG_DEBUG("Sibyll::Model n={}, Nnuc={}", count_, nucCount_); } - inline bool constexpr InteractionModel::isValid(Code const projectileId, + inline bool constexpr HadronInteractionModel::isValid(Code const projectileId, Code const targetId, HEPEnergyType const sqrtSnn) const { if ((minEnergyCoM_ > sqrtSnn) || (sqrtSnn > maxEnergyCoM_)) { return false; } @@ -57,7 +57,7 @@ namespace corsika::sibyll { } inline std::tuple<CrossSectionType, CrossSectionType> - InteractionModel::getCrossSectionInelEla(Code const projectileId, Code const targetId, + HadronInteractionModel::getCrossSectionInelEla(Code const projectileId, Code const targetId, FourMomentum const& projectileP4, FourMomentum const& targetP4) const { @@ -97,7 +97,7 @@ namespace corsika::sibyll { */ template <typename TSecondaryView> - inline void InteractionModel::doInteraction(TSecondaryView& secondaries, + inline void HadronInteractionModel::doInteraction(TSecondaryView& secondaries, Code const projectileId, Code const targetId, FourMomentum const& projectileP4, diff --git a/corsika/modules/Sibyll.hpp b/corsika/modules/Sibyll.hpp index 8d781def6..74dec3158 100644 --- a/corsika/modules/Sibyll.hpp +++ b/corsika/modules/Sibyll.hpp @@ -9,7 +9,7 @@ #pragma once #include <corsika/modules/sibyll/ParticleConversion.hpp> -#include <corsika/modules/sibyll/InteractionModel.hpp> +#include <corsika/modules/sibyll/HadronInteractionModel.hpp> #include <corsika/modules/sibyll/Decay.hpp> #include <corsika/modules/sibyll/NuclearInteractionModel.hpp> @@ -29,7 +29,7 @@ namespace corsika::sibyll { * The sibyll::InteractionModel is wrapped as an InteractionProcess here in order * to provide all the functions for ProcessSequence. */ - class Interaction : public InteractionModel, public InteractionProcess<Interaction> {}; + class Interaction : public HadronInteractionModel, public InteractionProcess<Interaction> {}; /** * @brief sibyll::NuclearInteraction is the process for ProcessSequence. diff --git a/corsika/modules/sibyll/InteractionModel.hpp b/corsika/modules/sibyll/HadronInteractionModel.hpp similarity index 84% rename from corsika/modules/sibyll/InteractionModel.hpp rename to corsika/modules/sibyll/HadronInteractionModel.hpp index 177e77857..51038ecad 100644 --- a/corsika/modules/sibyll/InteractionModel.hpp +++ b/corsika/modules/sibyll/HadronInteractionModel.hpp @@ -18,16 +18,16 @@ namespace corsika::sibyll { /** - * @brief sibyll::InteractionModel provides the SIBYLL proton-nucleus interaction model. + * @brief Provides the SIBYLL hadron-nucleus interaction model. * * This is a TModel argument for InteractionProcess<TModel>. */ - class InteractionModel { + class HadronInteractionModel { public: - InteractionModel(); - ~InteractionModel(); + HadronInteractionModel(); + ~HadronInteractionModel(); /** * @brief Set the Verbose flag. @@ -58,9 +58,8 @@ namespace corsika::sibyll { * * @param projectile is the Code of the projectile * @param target is the Code of the target - * @param sqrtSnn is the center-of-mass energy (per nucleon pair) - * @param Aprojectil is the mass number of the projectils, if it is a nucleus - * @param Atarget is the mass number of the target, if it is a nucleus + * @param projectileP4: four-momentum of projectile + * @param targetP4: four-momentum of target * * @return a tuple of: inelastic cross section, elastic cross section */ @@ -76,9 +75,8 @@ namespace corsika::sibyll { * * @param projectile is the Code of the projectile * @param target is the Code of the target - * @param sqrtSnn is the center-of-mass energy (per nucleon pair) - * @param Aprojectil is the mass number of the projectils, if it is a nucleus - * @param Atarget is the mass number of the target, if it is a nucleus + * @param projectileP4: four-momentum of projectile + * @param targetP4: four-momentum of target * * @return inelastic cross section * elastic cross section @@ -119,4 +117,4 @@ namespace corsika::sibyll { } // namespace corsika::sibyll -#include <corsika/detail/modules/sibyll/InteractionModel.inl> +#include <corsika/detail/modules/sibyll/HadronInteractionModel.inl> diff --git a/tests/modules/testSibyll.cpp b/tests/modules/testSibyll.cpp index 36f188e9a..51ceb684f 100644 --- a/tests/modules/testSibyll.cpp +++ b/tests/modules/testSibyll.cpp @@ -121,7 +121,7 @@ TEST_CASE("SibyllInterface", "modules") { SECTION("InteractionInterface - valid targets") { - corsika::sibyll::InteractionModel model; + corsika::sibyll::HadronInteractionModel model; // sibyll only accepts protons or nuclei with 4<=A<=18 as targets CHECK_FALSE(model.isValid(Code::Proton, Code::Electron, 100_GeV)); CHECK(model.isValid(Code::Proton, Code::Hydrogen, 100_GeV)); @@ -168,7 +168,7 @@ TEST_CASE("SibyllInterface", "modules") { const HEPEnergyType P0 = 60_GeV; MomentumVector const plab = MomentumVector(cs, {P0, 0_eV, 0_eV}); // also print particles after sibyll was called - corsika::sibyll::InteractionModel model; + corsika::sibyll::HadronInteractionModel model; model.setVerbose(true); HEPEnergyType const Elab = sqrt(static_pow<2>(P0) + static_pow<2>(Proton::mass)); FourMomentum const projectileP4(Elab, plab); @@ -202,9 +202,9 @@ TEST_CASE("SibyllInterface", "modules") { total energy: E_tot = SQS/2 * (1+Nw) + (m_N**2-m_i**2)/(2*SQS) * (Nw-1) and P_tot = -m_N * Plab_i / SQS * (Nw-1). - A Lorentztransformation of these quantities to the lab. frame recovers Plab_i for + A Lorentz transformation of these quantities to the lab. frame recovers Plab_i for the total momentum, so momentum is exactly conserved, and Elab_i + Nw * m_N for the - total energy. Not surprisingly the total energy differs from the total energy before + total energy. Not surprisingly, the total energy differs from the total energy before the collision by the mass of the additional nucleons (Nw-1)*m_N. In relative terms the additional energy is entirely negligible and as it is not kinetic energy there is zero influence on the shower development. @@ -252,7 +252,7 @@ TEST_CASE("SibyllInterface", "modules") { HEPMomentumType const P0 = 50_TeV; MomentumVector const plab = MomentumVector(cs, {P0, 0_eV, 0_eV}); - corsika::sibyll::InteractionModel hmodel; + corsika::sibyll::HadronInteractionModel hmodel; NuclearInteractionModel model(hmodel, *env); CHECK(model.isValid(Code::Helium, Code::Oxygen, 100_GeV)); -- GitLab