CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
LongitudinalProfile.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 <corsika/media/ShowerAxis.hpp>
12 #include <corsika/framework/process/ContinuousProcess.hpp>
14 
15 #include <array>
16 #include <fstream>
17 #include <limits>
18 #include <string>
19 
20 namespace corsika {
21 
37  class LongitudinalProfile : public ContinuousProcess<LongitudinalProfile> {
38 
39  public:
41  GrammageType dX = 10_g / square(1_cm)); // profile binning);
42 
43  template <typename TParticle, typename TTrack>
44  ProcessReturn doContinuous(
45  TParticle const&, TTrack const&,
46  bool const flagLimit = false); // not needed for LongitudinalProfile
47 
48  template <typename TParticle, typename TTrack>
49  LengthType getMaxStepLength(TParticle const&, TTrack const&) {
50  return meter * std::numeric_limits<double>::infinity();
51  }
52 
53  void save(std::string const&, int const width = 14, int const precision = 6);
54 
55  private:
56  GrammageType const dX_;
57  ShowerAxis const& shower_axis_;
58  using ProfileEntry = std::array<uint32_t, 7>;
59  enum ProfileIndex {
60  Photon = 0,
61  Positron = 1,
62  Electron = 2,
63  MuPlus = 3,
64  MuMinus = 4,
65  Hadron = 5,
66  Invisible = 6,
67  };
68  std::vector<ProfileEntry> profiles_; // longitudinal profile
69  };
70 
71 } // namespace corsika
72 
73 #include <corsika/detail/modules/LongitudinalProfile.inl>
The environment::ShowerAxis is created from a Point and a Vector and inside an Environment.
Definition: ShowerAxis.hpp:44
Import and extend the phys::units package.
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
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.
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 "|="