CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
Interaction.hpp
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <PROPOSAL/PROPOSAL.h>
12 
14 #include <corsika/framework/process/InteractionProcess.hpp>
16 #include <corsika/framework/random/RNGManager.hpp>
17 #include <corsika/framework/random/UniformRealDistribution.hpp>
18 
19 #include <corsika/modules/proposal/ProposalProcessBase.hpp>
20 
21 namespace corsika::proposal {
22 
28  class Interaction : public InteractionProcess<Interaction>, ProposalProcessBase {
29 
30  enum { eSECONDARIES, eINTERACTION };
31  using calculator_t = std::tuple<std::unique_ptr<PROPOSAL::SecondariesCalculator>,
32  std::unique_ptr<PROPOSAL::Interaction>>;
33 
34  std::unordered_map<calc_key_t, calculator_t, hash>
35  calc;
36 
40  void buildCalculator(Code, NuclearComposition const&) final;
41 
42  public:
47  template <typename TEnvironment>
48  Interaction(TEnvironment const& env);
49 
55  template <typename TSecondaryView>
56  ProcessReturn doInteraction(TSecondaryView&);
57 
61  template <typename TParticle>
62  GrammageType getInteractionLength(TParticle const& p);
63  };
64 } // namespace corsika::proposal
65 
66 #include <corsika/detail/modules/proposal/Interaction.inl>
PROPOSAL base process which handels mapping of particle codes to stored interpolation tables...
Interaction(TEnvironment const &env)
Produces the stoachastic loss calculator for leptons based on nuclear compositions and stochastic des...
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
GrammageType getInteractionLength(TParticle const &p)
Calculates the mean free path length.
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 "|="
ProcessReturn doInteraction(TSecondaryView &)
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.
Describes the composition of matter Allowes and handles the creation of custom matter compositions...
Interface to particle properties.
Process describing the interaction of particles.
Electro-magnetic and photon stochastic losses produced by proposal. It makes use of interpolation tab...
Definition: Interaction.hpp:28