diff --git a/Framework/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index c4f07d64791e0fc1950e825fe4069680ef717c95..29c99d28e926937a86e22c70b0a53b9741c3f38b 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -327,9 +327,7 @@ namespace corsika::cascade { units::si::InverseTimeType inv_decay_count = units::si::InverseTimeType::zero(); auto const returnCode = fProcessSequence.SelectDecay(particle, view, sample_process, inv_decay_count); - if constexpr (TStackView::has_event) { - view.GetProjectile().GetEvent()->setEventType(history::EventType::Decay); - } + SetEventType(view, history::EventType::Decay); return returnCode; } @@ -345,10 +343,14 @@ namespace corsika::cascade { auto inv_lambda_count = units::si::InverseGrammageType::zero(); auto const returnCode = fProcessSequence.SelectInteraction( particle, view, sample_process, inv_lambda_count); + SetEventType(view, history::EventType::Interaction); + return returnCode; + } + + void SetEventType(TStackView& view, history::EventType eventType) { if constexpr (TStackView::has_event) { - view.GetProjectile().GetEvent()->setEventType(history::EventType::Interaction); + for (auto&& sec : view) { sec.GetEvent()->setEventType(eventType); } } - return returnCode; } // but this here temporarily. Should go into dedicated file later: