IAP GITLAB

Skip to content
Snippets Groups Projects
Commit f24b9ea2 authored by Nikos Karastathis's avatar Nikos Karastathis :ocean:
Browse files

Only time update should be after .doContinuous()

parent bd024209
No related branches found
No related tags found
1 merge request!397Bug in Cascade.inl
Pipeline #5484 passed
...@@ -147,6 +147,10 @@ namespace corsika { ...@@ -147,6 +147,10 @@ namespace corsika {
// move particle along the trajectory to new position // move particle along the trajectory to new position
// also update momentum/direction/time // also update momentum/direction/time
step.setLength(min_distance); 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 // apply all continuous processes on particle + track
if (sequence_.doContinuous(vParticle, step, limitingId) == if (sequence_.doContinuous(vParticle, step, limitingId) ==
...@@ -162,10 +166,6 @@ namespace corsika { ...@@ -162,10 +166,6 @@ namespace corsika {
} }
return; 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()); vParticle.setTime(vParticle.getTime() + step.getDuration());
if (isContinuous) { if (isContinuous) {
return; // there is nothing further, step is finished return; // there is nothing further, step is finished
......
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