diff --git a/Processes/HadronicElasticModel/HadronicElasticModel.cc b/Processes/HadronicElasticModel/HadronicElasticModel.cc index dbece1ac127c2f3f3d0970971ce7fde6aba7aee5..5cfc99174c023f2c8eb9b3556658bf953a3ea863 100644 --- a/Processes/HadronicElasticModel/HadronicElasticModel.cc +++ b/Processes/HadronicElasticModel/HadronicElasticModel.cc @@ -131,8 +131,7 @@ process::EProcessReturn HadronicElasticInteraction::DoInteraction(SetupView& vie do { // |t| cannot become arbitrarily large, max. given by GER eq. (4.16), so we just - // throw again until we have an acceptable value. Note that the formula holds in - // any frame despite of what is stated in the book. + // throw again until we have an acceptable value. absT = tDist(fRNG); } while (absT >= maxT); @@ -155,12 +154,10 @@ process::EProcessReturn HadronicElasticInteraction::DoInteraction(SetupView& vie pProjectileCoMNorm * sin(theta) * sin(phi), pProjectileCoMNorm * cos(theta)}))); - p.SetMomentum(projectileScatteredLab.GetSpaceLikeComponents()); - p.SetEnergy( - sqrt(projectileScatteredLab.GetSpaceLikeComponents().squaredNorm() + - units::static_pow<2>(particles::GetMass( - p.GetPID())))); // Don't use energy from boost. It can be smaller than - // the momentum due to limited numerical accuracy. + view.AddSecondary(std::tuple<particles::Code, units::si::HEPEnergyType, + corsika::stack::MomentumVector, geometry::Point, units::si::TimeType>{ + p.GetPID(), sqrt(projectileScatteredLab.GetSpaceLikeComponents().squaredNorm() + units::static_pow<2>(particles::GetMass(p.GetPID()))), + projectileScatteredLab.GetSpaceLikeComponents(), p.GetPosition(), p.GetTime()}); return process::EProcessReturn::eOk; }