diff --git a/Processes/Sibyll/NuclearInteraction.h b/Processes/Sibyll/NuclearInteraction.h index daf93a4a7d6b421ea4307eb864fe64da4d94ec98..35ab127c993c9b0dc16ca4cb71f19bf5f0b5c70e 100644 --- a/Processes/Sibyll/NuclearInteraction.h +++ b/Processes/Sibyll/NuclearInteraction.h @@ -459,19 +459,18 @@ namespace corsika::process::sibyll { } // create dummy stack, to store nucleon projectile - Stack inelasticNucleons; + // Stack inelasticNucleons; // add one nucleon per inelastic interaction for(int j=0; j<nInelNucleons; ++j){ // TODO: sample neutron or proton auto pCode = corsika::particles::Proton::GetCode(); - inelasticNucleons.AddParticle( pCode, PprojNucLab.GetTimeLikeComponent(), PprojNucLab.GetSpaceLikeComponents(), pOrig, tOrig ); - } - - // process stack of inelastic nucleons - for(auto& nucl : inelasticNucleons) - // create inelastic nucleon-nucleon interaction - fHadronicInteraction.DoInteraction( nucl, s); + // temporarily add to stack, will be removed after interaction + auto inelasticNucleon = p.AddSecondary( pCode, PprojNucLab.GetTimeLikeComponent(), + PprojNucLab.GetSpaceLikeComponents(), pOrig, tOrig ); + // create inelastic interaction + fHadronicInteraction.DoInteraction( inelasticNucleon, s); + } // delete parent particle p.Delete();