diff --git a/conanfile.txt b/conanfile.txt index d2928fbcb4d5ebb86eae9c32ef91db05a24dfd84..514f5d0a73c806cc6e464df9b0f3b70539379a25 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -4,7 +4,7 @@ catch2/2.13.8 eigen/3.3.8 boost/1.76.0 zlib/1.2.11 -proposal/7.0.5 +proposal/7.2.1 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..72d406cc9a6e88f5256af24ec932e4030b772eea 100644 --- a/corsika/detail/modules/proposal/Interaction.inl +++ b/corsika/detail/modules/proposal/Interaction.inl @@ -68,6 +68,12 @@ namespace corsika::proposal { auto [type, target_hash, v] = std::get<eINTERACTION>(c->second)->SampleLoss( projectile.getEnergy() / 1_MeV, rates, distr(RNG_)); + // TODO: Is this case necessary? + // In this case, the original particle should not be altered and put back on the stack + if (type == PROPOSAL::InteractionType::Undefined) { + 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 +92,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) {