From a33132aa18b105bee57b40b95a7dc93a6b26f1f8 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Mon, 1 Nov 2021 16:26:46 +0100 Subject: [PATCH] no explicity cut on Argon in NuclearInteractionModel --- .../{Interaction.inl => InteractionModel.inl} | 8 +------- .../sibyll/NuclearInteractionModel.inl | 9 +++++---- corsika/modules/Epos.hpp | 20 ++++++++++++++++++- .../{Interaction.hpp => InteractionModel.hpp} | 3 +-- 4 files changed, 26 insertions(+), 14 deletions(-) rename corsika/detail/modules/epos/{Interaction.inl => InteractionModel.inl} (98%) rename corsika/modules/epos/{Interaction.hpp => InteractionModel.hpp} (97%) diff --git a/corsika/detail/modules/epos/Interaction.inl b/corsika/detail/modules/epos/InteractionModel.inl similarity index 98% rename from corsika/detail/modules/epos/Interaction.inl rename to corsika/detail/modules/epos/InteractionModel.inl index 7346b1846..98db3875c 100644 --- a/corsika/detail/modules/epos/Interaction.inl +++ b/corsika/detail/modules/epos/InteractionModel.inl @@ -8,18 +8,12 @@ #pragma once -#include <corsika/modules/epos/Interaction.hpp> +#include <corsika/modules/epos/InteractionModel.hpp> #include <corsika/modules/epos/EposStack.hpp> -#include <corsika/media/Environment.hpp> -#include <corsika/media/NuclearComposition.hpp> - #include <corsika/framework/utility/COMBoost.hpp> #include <corsika/framework/utility/CorsikaData.hpp> -#include <corsika/setup/SetupStack.hpp> -#include <corsika/setup/SetupTrajectory.hpp> - #include <epos.hpp> #include <string> diff --git a/corsika/detail/modules/sibyll/NuclearInteractionModel.inl b/corsika/detail/modules/sibyll/NuclearInteractionModel.inl index bda2996b5..c2bfecd92 100644 --- a/corsika/detail/modules/sibyll/NuclearInteractionModel.inl +++ b/corsika/detail/modules/sibyll/NuclearInteractionModel.inl @@ -57,10 +57,11 @@ namespace corsika::sibyll { inline void NuclearInteractionModel<TEnvironment, TNucleonModel>::printCrossSectionTable( Code const pCode) const { - if (pCode == Code::Argon) { - CORSIKA_LOG_WARN("SIBYLL cannot handle Argon as target!"); + if (!hadronicInteraction_.isValid(Code::Proton, pCode, 100_GeV)) { + CORSIKA_LOG_ERROR("Invalid target type {} for hadron interaction model.", pCode); return; } + int const k = targetComponentsIndex_.at(pCode); Code const pNuclei[] = {Code::Helium, Code::Lithium7, Code::Oxygen, Code::Neon, Code::Argon, Code::Iron}; @@ -109,12 +110,12 @@ namespace corsika::sibyll { // loop over target components, at most 4!! int k = -1; for (Code const ptarg : allElementsInUniverse) { - if (ptarg == Code::Argon) continue; // NEED TO IGNORE Argon .... ++k; CORSIKA_LOG_DEBUG("init target component: {} A={}", ptarg, get_nucleus_A(ptarg)); int const ib = get_nucleus_A(ptarg); if (!hadronicInteraction_.isValid(Code::Proton, ptarg, 100_GeV)) { - throw std::runtime_error("Invalid target type."); + CORSIKA_LOG_ERROR("Invalid target type {} for hadron interaction model.", ptarg); + continue; } targetComponentsIndex_.insert(std::pair<Code, int>(ptarg, k)); // loop over energies, fNEnBins log. energy bins diff --git a/corsika/modules/Epos.hpp b/corsika/modules/Epos.hpp index c25be9b14..b4aa9086c 100644 --- a/corsika/modules/Epos.hpp +++ b/corsika/modules/Epos.hpp @@ -9,4 +9,22 @@ #pragma once #include <corsika/modules/epos/ParticleConversion.hpp> -#include <corsika/modules/epos/Interaction.hpp> +#include <corsika/modules/epos/InteractionModel.hpp> +#include <corsika/framework/process/InteractionProcess.hpp> + +/** + * @file Sibyll.hpp + * + * Includes all the parts of the EPOS model. Defines the InteractionProcess<TModel> + * classes needed for the ProcessSequence. + */ + +namespace corsika::epos { + /** + * epos::Interaction is the process for ProcessSequence. + * + * The epos::InteractionModel is wrapped as an InteractionProcess here in order + * to provide all the functions for ProcessSequence. + */ + class Interaction : public InteractionModel, public InteractionProcess<Interaction> {}; +} // namespace corsika::epos \ No newline at end of file diff --git a/corsika/modules/epos/Interaction.hpp b/corsika/modules/epos/InteractionModel.hpp similarity index 97% rename from corsika/modules/epos/Interaction.hpp rename to corsika/modules/epos/InteractionModel.hpp index 96306b8fa..5a2c4a290 100644 --- a/corsika/modules/epos/Interaction.hpp +++ b/corsika/modules/epos/InteractionModel.hpp @@ -12,7 +12,6 @@ #include <corsika/framework/core/PhysicalUnits.hpp> #include <corsika/framework/geometry/FourVector.hpp> #include <corsika/framework/random/RNGManager.hpp> -#include <corsika/framework/process/InteractionProcess.hpp> #include <tuple> namespace corsika::epos { @@ -98,4 +97,4 @@ namespace corsika::epos { } // namespace corsika::epos -#include <corsika/detail/modules/epos/Interaction.inl> +#include <corsika/detail/modules/epos/InteractionModel.inl> -- GitLab