CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
NuclearInteraction.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 
12 #include <corsika/framework/random/RNGManager.hpp>
13 #include <corsika/framework/process/InteractionProcess.hpp>
14 
15 namespace corsika::sibyll {
16 
17  class Interaction; // fwd-decl
18 
23  template <class TEnvironment>
24  class NuclearInteraction : public InteractionProcess<NuclearInteraction<TEnvironment>> {
25 
26  public:
27  NuclearInteraction(sibyll::Interaction&, TEnvironment const&);
29 
30  void initializeNuclearCrossSections();
31  void printCrossSectionTable(Code);
32  CrossSectionType readCrossSectionTable(int const, Code const, HEPEnergyType const);
33  HEPEnergyType getMinEnergyPerNucleonCoM() { return gMinEnergyPerNucleonCoM_; }
34  HEPEnergyType getMaxEnergyPerNucleonCoM() { return gMaxEnergyPerNucleonCoM_; }
35  unsigned int constexpr getMaxNucleusAProjectile() { return gMaxNucleusAProjectile_; }
36  unsigned int constexpr getMaxNFragments() { return gMaxNFragments_; }
37  unsigned int constexpr getNEnergyBins() { return gNEnBins_; }
38 
39  template <typename Particle>
40  std::tuple<CrossSectionType, CrossSectionType> getCrossSection(Particle const& p,
41  const Code TargetId);
42 
43  template <typename Particle>
44  GrammageType getInteractionLength(Particle const&);
45 
46  template <typename TSecondaryView>
47  void doInteraction(TSecondaryView&);
48 
49  private:
50  int count_ = 0;
51  int nucCount_ = 0;
52 
53  TEnvironment const& environment_;
54  sibyll::Interaction& hadronicInteraction_;
55  std::map<Code, int> targetComponentsIndex_;
56  default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("sibyll");
57  static unsigned int constexpr gNSample_ =
58  500; // number of samples in MC estimation of cross section
59  static unsigned int constexpr gMaxNucleusAProjectile_ = 56;
60  static unsigned int constexpr gNEnBins_ = 6;
61  static unsigned int constexpr gMaxNFragments_ = 60;
62  // energy limits defined by table used for cross section in signuc.f
63  // 10**1 GeV to 10**6 GeV
64  static HEPEnergyType constexpr gMinEnergyPerNucleonCoM_ = 10. * 1e9 * electronvolt;
65  static HEPEnergyType constexpr gMaxEnergyPerNucleonCoM_ = 1.e6 * 1e9 * electronvolt;
66  };
67 
68 } // namespace corsika::sibyll
69 
70 #include <corsika/detail/modules/sibyll/NuclearInteraction.inl>
Interface to particle properties.
Process describing the interaction of particles.
prng_type & getRandomStream(string_type const &streamName)