CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
InteractionModel.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 ofp
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <corsika/modules/qgsjetII/ParticleConversion.hpp>
12 #include <qgsjet-II-04.hpp>
13 
16 #include <corsika/framework/random/RNGManager.hpp>
17 #include <corsika/framework/utility/COMBoost.hpp>
19 
20 #include <boost/filesystem/path.hpp>
21 
22 #include <random>
23 
24 namespace corsika::qgsjetII {
25 
27 
28  public:
29  InteractionModel(boost::filesystem::path dataPath = corsika_data("QGSJetII"));
31 
38  bool isValid(Code const beamId, Code const targetId, HEPEnergyType const sqrtS) const;
39 
54  CrossSectionType getCrossSection(Code const projectile, Code const target,
55  FourMomentum const& projectileP4,
56  FourMomentum const& targetP4) const;
57 
63  template <typename TSecondaries>
64  void doInteraction(TSecondaries&, Code const projectile, Code const target,
65  FourMomentum const& projectileP4, FourMomentum const& targetP4);
66 
67  private:
68  int count_ = 0;
69  QgsjetIIHadronType alternate_ =
70  QgsjetIIHadronType::PiPlusType; // for pi0, rho0 projectiles
71 
72  corsika::default_prng_type& rng_ =
74  std::bernoulli_distribution bernoulli_;
75  static size_t constexpr maxMassNumber_ = 208;
76  static HEPEnergyType constexpr sqrtSmin_ = 10_GeV;
77  };
78 
79 } // namespace corsika::qgsjetII
80 
81 #include <corsika/detail/modules/qgsjetII/InteractionModel.inl>
Import and extend the phys::units package.
Description of physical four-vectors.
Definition: FourVector.hpp:51
void doInteraction(TSecondaries &, Code const projectile, Code const target, FourMomentum const &projectileP4, FourMomentum const &targetP4)
In this function QGSJETII is called to produce one event.
returns the full path of the file filename within the CORSIKA_DATA directory.
CrossSectionType getCrossSection(Code const projectile, Code const target, FourMomentum const &projectileP4, FourMomentum const &targetP4) const
Return the QGSJETII inelastic/production cross section.
bool isValid(Code const beamId, Code const targetId, HEPEnergyType const sqrtS) const
Throws exception if invalid system is passed.
Interface to particle properties.
prng_type & getRandomStream(string_type const &streamName)