CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
UrQMD.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 
13 #include <corsika/framework/process/InteractionProcess.hpp>
14 #include <corsika/framework/random/RNGManager.hpp>
16 
17 #include <boost/filesystem/path.hpp>
18 #include <boost/multi_array.hpp>
19 
20 #include <array>
21 #include <utility>
22 #include <string>
23 
24 namespace corsika::urqmd {
25 
26  class UrQMD : public InteractionProcess<UrQMD> {
27  public:
33  UrQMD(boost::filesystem::path const path = corsika_data("UrQMD/UrQMD-1.3.1-xs.dat"),
34  int const retryFlag = 0);
35 
36  template <typename TParticle>
37  GrammageType getInteractionLength(TParticle const&) const;
38 
39  CrossSectionType getTabulatedCrossSection(Code, Code, HEPEnergyType) const;
40 
41  template <typename TParticle>
42  CrossSectionType getCrossSection(TParticle const&, Code) const;
43 
44  template <typename TView>
45  void doInteraction(TView&);
46 
47  bool canInteract(Code) const;
48 
49  void blob(int) {}
50 
51  static CrossSectionType getCrossSection(Code, Code, HEPEnergyType, int);
52 
53  private:
54  void readXSFile(boost::filesystem::path);
55 
56  // data members
57  default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("urqmd");
58  std::uniform_int_distribution<int> booleanDist_{0, 1};
59  int iflb_;
60  boost::multi_array<CrossSectionType, 3> xs_interp_support_table_;
61  };
62 
68  std::pair<int, int> convertToUrQMD(Code);
69  Code convertFromUrQMD(int vItyp, int vIso3);
70 
71 } // namespace corsika::urqmd
72 
73 #include <corsika/detail/modules/urqmd/UrQMD.inl>
Import and extend the phys::units package.
UrQMD(boost::filesystem::path const path=corsika_data("UrQMD/UrQMD-1.3.1-xs.dat"), int const retryFlag=0)
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
returns the full path of the file filename within the CORSIKA_DATA directory
Interface to particle properties.
Process describing the interaction of particles.
prng_type & getRandomStream(string_type const &streamName)