CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
BetheBlochPDG.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 
12 #include <corsika/framework/geometry/Point.hpp>
13 #include <corsika/framework/geometry/Vector.hpp>
14 #include <corsika/framework/process/ContinuousProcess.hpp>
15 #include <corsika/media/ShowerAxis.hpp>
16 
17 #include <map>
18 
19 namespace corsika {
20 
36  class BetheBlochPDG : public ContinuousProcess<BetheBlochPDG> {
37 
38  using MeVgcm2 = decltype(1e6 * electronvolt / gram * square(1e-2 * meter));
39 
40  public:
41  BetheBlochPDG(ShowerAxis const& showerAxis);
42 
52  template <typename TParticle, typename TTrajectory>
53  ProcessReturn doContinuous(TParticle& particle, TTrajectory const& track,
54  bool const limitFlag);
55 
56  template <typename TParticle, typename TTrajectory>
57  LengthType getMaxStepLength(TParticle const&,
58  TTrajectory const&)
59  const;
60  template <typename TParticle>
62  static HEPEnergyType getBetheBloch(TParticle const&, const GrammageType);
63 
64  template <typename TParticle>
65  static HEPEnergyType getRadiationLosses(TParticle const&, const GrammageType);
66 
67  template <typename TParticle>
68  static HEPEnergyType getTotalEnergyLoss(TParticle const&, const GrammageType);
69 
70  void showResults() const;
71  void reset();
72  HEPEnergyType getEnergyLost() const { return energy_lost_; }
73  void printProfile() const;
74  HEPEnergyType getTotal() const;
75 
76  private:
77  template <typename TParticle>
78  void updateMomentum(TParticle&, HEPEnergyType Enew);
79 
80  template <typename TTrajectory>
81  void fillProfile(TTrajectory const&, HEPEnergyType);
82 
83  GrammageType const dX_ = 10_g / square(1_cm); // profile binning
84  GrammageType const dX_threshold_ = 0.0001_g / square(1_cm);
85  ShowerAxis const& shower_axis_;
86  HEPEnergyType energy_lost_ = HEPEnergyType::zero();
87  std::vector<HEPEnergyType> profile_; // longitudinal profile
88  };
89 
90 } // namespace corsika
91 
92 #include <corsika/detail/modules/energy_loss/BetheBlochPDG.inl>
The environment::ShowerAxis is created from a Point and a Vector and inside an Environment.
Definition: ShowerAxis.hpp:44
PDG2018, passage of particles through matter.
Import and extend the phys::units package.
ProcessReturn doContinuous(TParticle &particle, TTrajectory const &track, bool const limitFlag)
clang-format-off Interface function of ContinuousProcess.
Processes with continuous effects along a particle Trajectory.
constexpr detail::Power< D, 2, X > square(quantity< D, X > const &x)
square.
Definition: quantity.hpp:650
The cascade namespace assembles all objects needed to simulate full particles cascades.
static constexpr quantity zero()
We need a "zero" of each type – for comparisons, to initialize running totals, etc.
Definition: quantity.hpp:359
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 "|="
static HEPEnergyType getBetheBloch(TParticle const &, const GrammageType)
limited by the energy threshold! By default the limit is the particle rest mass, i.e. kinetic energy is zero