diff --git a/corsika/detail/framework/core/Cascade.inl b/corsika/detail/framework/core/Cascade.inl index 0f4e9dae3f6f763fd37634e62adb90ffff39dec1..07ec495469d8b1ef64f896f2b6facb3853ed60c0 100644 --- a/corsika/detail/framework/core/Cascade.inl +++ b/corsika/detail/framework/core/Cascade.inl @@ -147,6 +147,10 @@ namespace corsika { // move particle along the trajectory to new position // also update momentum/direction/time step.setLength(min_distance); + vParticle.setPosition(step.getPosition(1)); + // assumption: tracking does not change absolute momentum (continuous physics can and + // will): + vParticle.setMomentum(step.getDirection(1) * vParticle.getMomentum().getNorm()); // apply all continuous processes on particle + track if (sequence_.doContinuous(vParticle, step, limitingId) == @@ -162,10 +166,6 @@ namespace corsika { } return; } - vParticle.setPosition(step.getPosition(1)); - // assumption: tracking does not change absolute momentum (continuous physics can and - // will): - vParticle.setMomentum(step.getDirection(1) * vParticle.getMomentum().getNorm()); vParticle.setTime(vParticle.getTime() + step.getDuration()); if (isContinuous) { return; // there is nothing further, step is finished