diff --git a/conanfile.txt b/conanfile.txt index d2928fbcb4d5ebb86eae9c32ef91db05a24dfd84..b6fc21fa5b7d1e45b2f7213322de9b128bcf92ac 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,10 +1,10 @@ [requires] -spdlog/1.8.5 +spdlog/1.9.2 catch2/2.13.8 eigen/3.3.8 boost/1.76.0 zlib/1.2.11 -proposal/7.0.5 +proposal/7.3.0 yaml-cpp/0.6.3 arrow/2.0.0 cli11/1.9.1 diff --git a/corsika/detail/modules/proposal/Interaction.inl b/corsika/detail/modules/proposal/Interaction.inl index 9b2e23138a060e0d9e4105e9adb6b07b5df8020e..062aebe190c03c9424f5c25cdbdb627893197c55 100644 --- a/corsika/detail/modules/proposal/Interaction.inl +++ b/corsika/detail/modules/proposal/Interaction.inl @@ -68,6 +68,16 @@ namespace corsika::proposal { auto [type, target_hash, v] = std::get<eINTERACTION>(c->second)->SampleLoss( projectile.getEnergy() / 1_MeV, rates, distr(RNG_)); + // TODO: This should become obsolete as soon #482 is fixed + if (type == PROPOSAL::InteractionType::Undefined) { + CORSIKA_LOG_WARN( + "PROPOSAL: No particle interaction possible. " + "Put initial particle back on stack."); + view.addSecondary(std::make_tuple(projectileId, projectile.getEnergy(), + projectile.getDirection())); + return ProcessReturn::Ok; + } + // Read how much random numbers are required to calculate the secondaries. // Calculate the secondaries and deploy them on the corsika stack. auto rnd = std::vector<double>( @@ -86,7 +96,9 @@ namespace corsika::proposal { auto loss = PROPOSAL::StochasticLoss( static_cast<int>(type), v * projectile.getEnergy() / 1_MeV, point, direction, projectile.getTime() / 1_s, 0., projectile.getEnergy() / 1_MeV); - auto target = PROPOSAL::Component::component_map->operator[](target_hash); + PROPOSAL::Component target; + if (type != PROPOSAL::InteractionType::Ioniz) + target = PROPOSAL::Component::GetComponentForHash(target_hash); auto sec = std::get<eSECONDARIES>(c->second)->CalculateSecondaries(loss, target, rnd); for (auto& s : sec) {