11 #include <PROPOSAL/PROPOSAL.h> 14 #include <corsika/framework/process/InteractionProcess.hpp> 17 #include <corsika/framework/random/RNGManager.hpp> 18 #include <corsika/framework/random/UniformRealDistribution.hpp> 19 #include <corsika/modules/proposal/ProposalProcessBase.hpp> 20 #include <corsika/modules/proposal/HadronicPhotonModel.hpp> 36 template <
class THadronicLEModel,
class THadronicHEModel>
41 enum { eSECONDARIES, eINTERACTION, eLPM_SUPPRESSION };
42 struct LPM_calculator;
43 using calculator_t = std::tuple<std::unique_ptr<PROPOSAL::SecondariesCalculator>,
44 std::unique_ptr<PROPOSAL::Interaction>,
45 std::unique_ptr<LPM_calculator>>;
47 std::unordered_map<calc_key_t, calculator_t, hash>
55 inline static auto logger_{
get_logger(
"corsika_proposal_InteractionModel")};
58 struct LPM_calculator {
59 std::unique_ptr<PROPOSAL::crosssection::PhotoPairLPM> photo_pair_lpm_ =
nullptr;
60 std::unique_ptr<PROPOSAL::crosssection::BremsLPM> brems_lpm_ =
nullptr;
61 std::unique_ptr<PROPOSAL::crosssection::EpairLPM> epair_lpm_ =
nullptr;
63 const double mass_density_baseline_;
64 const double particle_mass_;
66 LPM_calculator(
const PROPOSAL::Medium& medium,
const Code code,
67 std::vector<PROPOSAL::InteractionType> inter_types)
68 : mass_density_baseline_(medium.GetMassDensity())
69 , particle_mass_(particle[code].mass) {
73 if (std::find(inter_types.begin(), inter_types.end(),
74 PROPOSAL::InteractionType::Photopair) != inter_types.end())
75 photo_pair_lpm_ = std::make_unique<PROPOSAL::crosssection::PhotoPairLPM>(
76 particle[code], medium, PROPOSAL::crosssection::PhotoPairKochMotz());
77 if (std::find(inter_types.begin(), inter_types.end(),
78 PROPOSAL::InteractionType::Brems) != inter_types.end())
79 brems_lpm_ = std::make_unique<PROPOSAL::crosssection::BremsLPM>(
80 particle[code], medium, PROPOSAL::crosssection::BremsElectronScreening());
81 if (std::find(inter_types.begin(), inter_types.end(),
82 PROPOSAL::InteractionType::Epair) != inter_types.end())
84 std::make_unique<PROPOSAL::crosssection::EpairLPM>(particle[code], medium);
92 const PROPOSAL::InteractionType,
94 const PROPOSAL::Component&,
const double v);
101 template <
typename TEnvironment>
102 InteractionModel(TEnvironment
const& env, THadronicLEModel&, THadronicHEModel&,
129 template <
typename TSecondaryView>
136 template <
typename TParticle>
143 #include <corsika/detail/modules/proposal/InteractionModel.inl> PROPOSAL base process which handels mapping of particle codes to stored interpolation tables...
InteractionModel(TEnvironment const &env, THadronicLEModel &, THadronicHEModel &, HEPEnergyType const &)
Produces the stoachastic loss calculator for leptons based on nuclear compositions and stochastic des...
ProcessReturn doInteraction(TSecondaryView &, Code const projectileId, FourMomentum const &projectileP4)
Calculate the rates for the different targets and interactions. Sample a pair of interaction-type, component and rate, followed by sampling a loss and produce the corresponding secondaries and store them on the particle stack. interactions in PROPOSAL are:
std::shared_ptr< spdlog::logger > get_logger(std::string const &name, bool const defaultlog=false)
Get a smart pointer to an existing logger.
Electro-magnetic and photon stochastic losses produced by proposal. It makes use of interpolation tab...
Description of physical four-vectors.
ProcessReturn
since in a process sequence many status updates can accumulate for a single particle, this enum should define only bit-flags that can be accumulated easily with "|="
Implements the production of secondary hadrons for the hadronic interaction of real and virtual photo...
Describes the composition of matter Allowes and handles the creation of custom matter compositions...
Interface to particle properties.
General FourVector object.
CrossSectionType getCrossSection(TParticle const &p, Code const projectileId, FourMomentum const &projectileP4)
Calculates and returns the cross section.