IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 79b7d386 authored by ralfulrich's avatar ralfulrich
Browse files

Merge branch 'addsecondary_interface' of...

Merge branch 'addsecondary_interface' of gitlab.ikp.kit.edu:AirShowerPhysics/corsika into addsecondary_interface
parents 52832796 2d157bb6
No related branches found
No related tags found
1 merge request!258Interface change of DoDecay() and DoInteraction()
Pipeline #2175 canceled
This commit is part of merge request !254. Comments created here will be created in the context of that merge request.
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment