diff --git a/Core/include/Acts/Fitter/KalmanFitter.hpp b/Core/include/Acts/Fitter/KalmanFitter.hpp index 683d415e1990d826cf1e77cb955242c6b5d825ff..8ecc7471b37ec58bdd7695e51e0d659a8564fcdb 100644 --- a/Core/include/Acts/Fitter/KalmanFitter.hpp +++ b/Core/include/Acts/Fitter/KalmanFitter.hpp @@ -747,27 +747,40 @@ class KalmanFitter { void materialInteractor( const Surface* surface, propagator_state_t& state, stepper_t& stepper, const MaterialUpdateStage& updateStage = fullUpdate) const { - // Prepare relevant input particle properties - detail::PointwiseMaterialInteraction interaction(surface, state, stepper); - - // Evaluate the material properties - if (interaction.evaluateMaterialProperties(state, updateStage)) { - // Evaluate the material effects - interaction.evaluatePointwiseMaterialInteraction(multipleScattering, - energyLoss); - - ACTS_VERBOSE("Material effects on surface: " - << surface->geoID() << " at update stage: " << updateStage - << " are :"); - ACTS_VERBOSE("eLoss = " - << interaction.Eloss << ", " - << "variancePhi = " << interaction.variancePhi << ", " - << "varianceTheta = " << interaction.varianceTheta << ", " - << "varianceQoverP = " << interaction.varianceQoverP); - - // Update the state and stepper with material effects - interaction.updateState(state, stepper); - } else { + // Indicator if having material + bool hasMaterial = false; + + if (surface and surface->surfaceMaterial()) { + // Prepare relevant input particle properties + detail::PointwiseMaterialInteraction interaction(surface, state, + stepper); + // Evaluate the material properties + if (interaction.evaluateMaterialProperties(state, updateStage)) { + // Surface has material at this stage + hasMaterial = true; + + // Evaluate the material effects + interaction.evaluatePointwiseMaterialInteraction(multipleScattering, + energyLoss); + + // Screen out material effects info + ACTS_VERBOSE("Material effects on surface: " + << surface->geoID() + << " at update stage: " << updateStage << " are :"); + ACTS_VERBOSE("eLoss = " + << interaction.Eloss << ", " + << "variancePhi = " << interaction.variancePhi << ", " + << "varianceTheta = " << interaction.varianceTheta + << ", " + << "varianceQoverP = " << interaction.varianceQoverP); + + // Update the state and stepper with material effects + interaction.updateState(state, stepper); + } + } + + if (not hasMaterial) { + // Screen out message ACTS_VERBOSE("No material effects on surface: " << surface->geoID() << " at update stage: " << updateStage);