CORSIKA8  0.0.0
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 
21 #include <corsika/modules/proposal/ProposalProcessBase.hpp>
22 
23 #include <unordered_map>
24 
25 namespace corsika::proposal {
26 
33  : public corsika::ContinuousProcess<proposal::ContinuousProcess>,
35 
36  struct Calculator {
37  std::unique_ptr<PROPOSAL::Displacement> disp;
38  std::unique_ptr<PROPOSAL::Scattering> scatter;
39  };
40 
41  std::unordered_map<calc_key_t, Calculator, hash>
42  calc;
43 
44  HEPEnergyType energy_lost_ = 0 * electronvolt;
45 
49  void buildCalculator(Code, NuclearComposition const&) final;
50 
51  public:
56  template <typename TEnvironment>
57  ContinuousProcess(TEnvironment const&);
58 
64  template <typename TParticle>
65  void scatter(TParticle&, HEPEnergyType const&, GrammageType const&);
66 
75  template <typename TParticle, typename TTrack>
76  ProcessReturn doContinuous(TParticle&, TTrack const& track, bool const limitFlag);
77 
81  template <typename TParticle, typename TTrack>
82  LengthType getMaxStepLength(TParticle const&, TTrack const&);
83 
84  void showResults() const;
85  void reset();
86  HEPEnergyType getEnergyLost() const { return energy_lost_; }
87  };
88 } // namespace corsika::proposal
89 
90 #include <corsika/detail/modules/proposal/ContinuousProcess.inl>
Electro-magnetic and photon continous losses produced by proposal. It makes use of interpolation tabl...
void scatter(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.
ProcessReturn doContinuous(TParticle &, TTrack const &track, bool const limitFlag)
Produces the loss and deflection after given distance for the particle. If the particle if below the ...
PROPOSAL base process which handels mapping of particle codes to stored interpolation tables...
ContinuousProcess(TEnvironment const &)
Produces the continuous loss calculator for leptons based on nuclear compositions and stochastic desc...
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 "|="
Describes the composition of matter Allowes and handles the creation of custom matter compositions...
Interface to particle properties.