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 
13 #include <corsika/framework/random/RNGManager.hpp>
15 
16 #include <tuple>
17 
18 namespace corsika::sophia {
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  [[maybe_unused]] Code const projectile, [[maybe_unused]] Code const target,
67  [[maybe_unused]] FourMomentum const& projectileP4,
68  [[maybe_unused]] FourMomentum const& targetP4) const {
69  CORSIKA_LOGGER_ERROR(logger_, "cross section not implemented in SOPHIA!");
70  return CrossSectionType::zero();
71  }
83  template <typename TSecondaries>
84  void doInteraction(TSecondaries& view, Code const projectile, Code const target,
85  FourMomentum const& projectileP4, FourMomentum const& targetP4);
86 
87  private:
88  HEPEnergyType constexpr getMinEnergyCoM() const { return minEnergyCoM_; }
89  HEPEnergyType constexpr getMaxEnergyCoM() const { return maxEnergyCoM_; }
90 
91  // hard model limits
92  static HEPEnergyType constexpr minEnergyCoM_ = 1.079166345 * 1e9 * electronvolt;
93  static HEPEnergyType constexpr maxEnergyCoM_ = 1.e6 * 1e9 * electronvolt;
94 
95  default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("sophia");
96 
97  // data members
98  int count_ = 0;
99  bool sophia_listing_;
100 
101  std::shared_ptr<spdlog::logger> logger_ =
102  get_logger("corsika_sophia_InteractionModel");
103  };
104 
105 } // namespace corsika::sophia
106 
107 #include <corsika/detail/modules/sophia/InteractionModel.inl>
void doInteraction(TSecondaries &view, Code const projectile, Code const target, FourMomentum const &projectileP4, FourMomentum const &targetP4)
In this function SOPHIA is called to produce one event.
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.
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
static constexpr quantity zero()
We need a "zero" of each type – for comparisons, to initialize running totals, etc.
Definition: quantity.hpp:359
void setVerbose(bool const flag)
Set the Verbose flag.
Interface to particle properties.
CrossSectionType getCrossSection([[maybe_unused]] Code const projectile, [[maybe_unused]] Code const target, [[maybe_unused]] FourMomentum const &projectileP4, [[maybe_unused]] FourMomentum const &targetP4) const
Returns inelastic (production) cross section.
Provides the SOPHIA photon-nucleon interaction model.
General FourVector object.
prng_type & getRandomStream(string_type const &streamName)