diff --git a/corsika/detail/modules/proposal/ContinuousProcess.inl b/corsika/detail/modules/proposal/ContinuousProcess.inl index f35e1315a4dd2de9b7e54e88f2154b611391e1de..3fbb7025dd81fd50d9246db921357b3f33e21c42 100644 --- a/corsika/detail/modules/proposal/ContinuousProcess.inl +++ b/corsika/detail/modules/proposal/ContinuousProcess.inl @@ -25,6 +25,8 @@ namespace corsika::proposal { auto p_cross = cross.find(code); if (p_cross == cross.end()) throw std::runtime_error("PROPOSAL could not find corresponding builder"); + if (code == Code::Photon) + return; // no continuous builders needed for photons // interpolate the crosssection for given media and energy cut. These may // take some minutes if you have to build the tables and cannot read the @@ -101,7 +103,8 @@ namespace corsika::proposal { if (!canInteract(step.getParticlePre().getPID())) return ProcessReturn::Ok; if (step.getDisplacement().getSquaredNorm() == static_pow<2>(0_m)) return ProcessReturn::Ok; - + if (step.getParticlePre().getPID() == Code::Photon) + return ProcessReturn::Ok; // no continuous energy losses, no scattering for photons // calculate passed grammage auto dX = step.getParticlePre().getNode()->getModelProperties().getIntegratedGrammage( step.getStraightTrack()); @@ -132,6 +135,7 @@ namespace corsika::proposal { TParticle const& vP, TTrajectory const& track) { auto const code = vP.getPID(); if (!canInteract(code)) return meter * std::numeric_limits<double>::infinity(); + if (code == Code::Photon) return meter * std::numeric_limits<double>::infinity(); // no step limitation for photons // Limit the step size of a conitnuous loss. The maximal continuous loss seems to be // a hyper parameter which must be adjusted. diff --git a/corsika/modules/proposal/ProposalProcessBase.hpp b/corsika/modules/proposal/ProposalProcessBase.hpp index 807d358191ca62b8fa2be40b46b5f680d22d30fa..66452df6e9e0cdaec9d2397fa1c5aca6401aa6de 100644 --- a/corsika/modules/proposal/ProposalProcessBase.hpp +++ b/corsika/modules/proposal/ProposalProcessBase.hpp @@ -41,7 +41,7 @@ namespace corsika::proposal { //! Crosssection factories for different particle types. //! template <typename T> - static auto cross_builder = + auto cross_builder = [](PROPOSAL::Medium& m, corsika::units::si::HEPEnergyType emCut) { //!< Stochastic losses smaller than the given cut @@ -52,6 +52,13 @@ namespace corsika::proposal { return PROPOSAL::GetStdCrossSections(particle_def, m, p_cut, true); }; + template <> + auto cross_builder<PROPOSAL::GammaDef> = + [](PROPOSAL::Medium& m, + corsika::units::si::HEPEnergyType) { //!< Only-stochastic propagation + return PROPOSAL::GetStdCrossSections(PROPOSAL::GammaDef(), m, nullptr, true); + }; + //! //! PROPOSAL default crosssections are maped to corresponding corsika particle //! code.