From d32f51b79f43aa56b96f91b017f7e5e2a9cd36b4 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Fri, 11 Jun 2021 10:40:23 +0200 Subject: [PATCH] catch particles trying to evade the observation plane --- corsika/detail/modules/ObservationPlane.inl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/corsika/detail/modules/ObservationPlane.inl b/corsika/detail/modules/ObservationPlane.inl index c28485f6b..7adc1730b 100644 --- a/corsika/detail/modules/ObservationPlane.inl +++ b/corsika/detail/modules/ObservationPlane.inl @@ -27,16 +27,20 @@ namespace corsika { The current step did not yet reach the ObservationPlane, do nothing now and wait: */ if (!stepLimit) { -#ifdef DEBUG + // @todo this is actually needed to fix small instabilities of the leap-frog + // tracking: Note, this is NOT a general solution and should be clearly revised with + // a more robust tracking. #ifdef DEBUG if (deleteOnHit_) { LengthType const check = (particle.getPosition() - plane_.getCenter()).dot(plane_.getNormal()); if (check < 0_m) { - CORSIKA_LOG_DEBUG("PARTICLE AVOIDED OBSERVATIONPLANE {}", check); - } - } -#endif - return ProcessReturn::Ok; + CORSIKA_LOG_WARN("PARTICLE AVOIDED OBSERVATIONPLANE {}", check); + CORSIKA_LOG_WARN("Temporary fix: write and remove particle."); + } else + return ProcessReturn::Ok; + } else + // #endif + return ProcessReturn::Ok; } HEPEnergyType const energy = particle.getEnergy(); -- GitLab