CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
InteractionModel.hpp
1 /*
2  * (c) Copyright 2022 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 <vector>
12 #include <utility>
13 #include <memory>
14 
15 #include <corsika/media/Environment.hpp>
16 #include <corsika/media/NuclearComposition.hpp>
18 #include <corsika/framework/utility/COMBoost.hpp>
21 #include <corsika/framework/random/RNGManager.hpp>
22 
23 namespace corsika::fluka {
31  public:
37  template <typename TEnvironment>
38  InteractionModel(TEnvironment const&);
39 
41  CrossSectionType getCrossSection(Code projectileId, Code targetId,
42  FourMomentum const& projectileP4,
43  FourMomentum const& targetP4) const;
44 
45  bool isValid(Code projectileID, Code targetID, HEPEnergyType sqrtS) const;
46  bool isValid(Code projectileID, int material, HEPEnergyType sqrtS) const;
47 
49  int getMaterialIndex(Code targetID) const;
50 
55  template <typename TSecondaryView>
56  void doInteraction(TSecondaryView& view, Code const projectileId, Code const targetId,
57  FourMomentum const& projectileP4, FourMomentum const& targetP4);
58 
59  private:
60  default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("fluka");
61  std::vector<std::pair<Code, int>> const
62  materials_;
63  std::shared_ptr<spdlog::logger> logger_ = get_logger("corsika_FLUKA_Interaction");
64  std::unique_ptr<double[]> cumsgx_;
65 
66  template <typename TEnvironment>
67  static std::vector<std::pair<Code, int>> genFlukaMaterials(TEnvironment const&);
68  };
69 
70  inline static int const iflxyz_ = 1;
71 } // namespace corsika::fluka
72 
73 #include <corsika/detail/modules/fluka/InteractionModel.inl>
This class exposes the (hadronic) interactions of FLUKA.
Import and extend the phys::units package.
std::shared_ptr< spdlog::logger > get_logger(std::string const &name, bool const defaultlog=false)
Get a smart pointer to an existing logger.
CrossSectionType getCrossSection(Code projectileId, Code targetId, FourMomentum const &projectileP4, FourMomentum const &targetP4) const
Return the cross-section of a given combination of projectile/target.
CORSIKA8 logging utilities.
Description of physical four-vectors.
Definition: FourVector.hpp:51
InteractionModel(TEnvironment const &)
Create a new InteractionModel.
int getMaterialIndex(Code targetID) const
convert target Code to FLUKA material number
void doInteraction(TSecondaryView &view, Code const projectileId, Code const targetId, FourMomentum const &projectileP4, FourMomentum const &targetP4)
Perform an interaction.
General FourVector object.
prng_type & getRandomStream(string_type const &streamName)