CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
ContinuousProcess.hpp
1 /*
2  * (c) Copyright 2018 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 
13 #include <corsika/media/Environment.hpp>
14 
16 #include <corsika/framework/process/ContinuousProcess.hpp>
18 #include <corsika/framework/random/RNGManager.hpp>
19 #include <corsika/framework/random/UniformRealDistribution.hpp>
20 #include <corsika/modules/writers/WriterOff.hpp>
21 #include <corsika/framework/core/Step.hpp>
22 
23 #include <corsika/modules/proposal/ProposalProcessBase.hpp>
24 
25 #include <unordered_map>
26 
27 namespace corsika::proposal {
28 
34  template <typename TOutput = WriterOff>
36  : public corsika::ContinuousProcess<proposal::ContinuousProcess<TOutput>>,
37  public ProposalProcessBase,
38  public TOutput {
39 
40  struct Calculator {
41  std::unique_ptr<PROPOSAL::Displacement> disp;
42  std::unique_ptr<PROPOSAL::multiple_scattering::Parametrization> scatter;
43  };
44 
45  std::unordered_map<calc_key_t, Calculator, hash>
46  calc;
47 
51  void buildCalculator(Code, NuclearComposition const&) final;
52 
53  public:
58  template <typename TEnvironment, typename... TOutputArgs>
59  ContinuousProcess(TEnvironment const&, TOutputArgs&&...);
60 
66  template <typename TParticle>
67  void scatter(Step<TParticle>&, HEPEnergyType const&, GrammageType const&);
68 
77  template <typename TParticle>
78  ProcessReturn doContinuous(Step<TParticle>&, bool const limitFlag);
79 
83  template <typename TParticle, typename TTrack>
84  LengthType getMaxStepLength(TParticle const&, TTrack const&);
85 
89  YAML::Node getConfig() const;
90  };
91 } // namespace corsika::proposal
92 
93 #include <corsika/detail/modules/proposal/ContinuousProcess.inl>
Electro-magnetic and photon continous losses produced by proposal. It makes use of interpolation tabl...
PROPOSAL base process which handels mapping of particle codes to stored interpolation tables...
ContinuousProcess(TEnvironment const &, TOutputArgs &&...)
Produces the continuous loss calculator for leptons based on nuclear compositions and stochastic desc...
void scatter(Step< TParticle > &, HEPEnergyType const &, GrammageType const &)
Multiple Scattering of the lepton. Stochastic deflection is not yet taken into account. Displacment of the track due to multiple scattering is not possible because of the constant referernce. The final direction will be updated anyway.
LengthType getMaxStepLength(TParticle const &, TTrack const &)
Calculates maximal step length of process.
Processes with continuous effects along a particle Trajectory.
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 "|="
YAML::Node getConfig() const
Provide the config as YAML object to be stored on disk as output.
Describes the composition of matter Allowes and handles the creation of custom matter compositions...
ProcessReturn doContinuous(Step< TParticle > &, bool const limitFlag)
Produces the loss and deflection after given distance for the particle. If the particle if below the ...
Interface to particle properties.