CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
HadronInteractionModel.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 
13 #include <corsika/framework/random/RNGManager.hpp>
15 
16 #include <tuple>
17 
18 namespace corsika::sibyll {
19 
27 
28  public:
31 
40  void setVerbose(bool const flag);
41 
48  bool constexpr isValid(Code const projectileId, Code const targetId,
49  HEPEnergyType const sqrtSnn) const;
50 
66  std::tuple<CrossSectionType, CrossSectionType> getCrossSectionInelEla(
67  Code const projectile, Code const target, FourMomentum const& projectileP4,
68  FourMomentum const& targetP4) const;
69 
84  CrossSectionType getCrossSection(Code const projectile, Code const target,
85  FourMomentum const& projectileP4,
86  FourMomentum const& targetP4) const {
87  return std::get<0>(
88  getCrossSectionInelEla(projectile, target, projectileP4, targetP4));
89  }
90 
102  template <typename TSecondaries>
103  void doInteraction(TSecondaries& view, Code const projectile, Code const target,
104  FourMomentum const& projectileP4, FourMomentum const& targetP4);
105 
106  private:
107  HEPEnergyType constexpr getMinEnergyCoM() const { return minEnergyCoM_; }
108  HEPEnergyType constexpr getMaxEnergyCoM() const { return maxEnergyCoM_; }
109 
110  // hard model limits
111  static HEPEnergyType constexpr minEnergyCoM_ = 10. * 1e9 * electronvolt;
112  static HEPEnergyType constexpr maxEnergyCoM_ = 1.e6 * 1e9 * electronvolt;
113  static unsigned int constexpr maxTargetMassNumber_ = 18;
114  static unsigned int constexpr minNuclearTargetA_ = 4;
115 
116  default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("sibyll");
117 
118  // data members
119  int count_ = 0;
120  int nucCount_ = 0;
121  bool sibyll_listing_;
122  };
123 
124 } // namespace corsika::sibyll
125 
126 #include <corsika/detail/modules/sibyll/HadronInteractionModel.inl>
Import and extend the phys::units package.
Provides the SIBYLL hadron-nucleus interaction model.
std::tuple< CrossSectionType, CrossSectionType > getCrossSectionInelEla(Code const projectile, Code const target, FourMomentum const &projectileP4, FourMomentum const &targetP4) const
Returns inelastic AND elastic cross sections.
bool constexpr isValid(Code const projectileId, Code const targetId, HEPEnergyType const sqrtSnn) const
evaluated validity of collision system.
Description of physical four-vectors.
Definition: FourVector.hpp:51
CrossSectionType getCrossSection(Code const projectile, Code const target, FourMomentum const &projectileP4, FourMomentum const &targetP4) const
Returns inelastic (production) cross section.
void setVerbose(bool const flag)
Set the Verbose flag.
Interface to particle properties.
General FourVector object.
prng_type & getRandomStream(string_type const &streamName)
void doInteraction(TSecondaries &view, Code const projectile, Code const target, FourMomentum const &projectileP4, FourMomentum const &targetP4)
In this function SIBYLL is called to produce one event.