CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
Interaction.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/random/RNGManager.hpp>
14 #include <corsika/framework/process/InteractionProcess.hpp>
15 #include <corsika/modules/pythia8/Pythia8.hpp>
16 
17 #include <tuple>
18 
19 namespace corsika::pythia8 {
20 
21  class Interaction : public InteractionProcess<Interaction>, public Pythia8::Pythia {
22 
23  public:
24  Interaction(const bool print_listing = false);
25  ~Interaction();
26 
27  void setStable(std::vector<Code> const&);
28  void setUnstable(const Code);
29  void setStable(const Code);
30 
31  bool isValidCoMEnergy(HEPEnergyType ecm) { return (10_GeV < ecm) && (ecm < 1_PeV); }
32 
33  bool canInteract(const Code);
34  void configureLabFrameCollision(const Code, const Code, const HEPEnergyType);
35 
36  std::tuple<CrossSectionType, CrossSectionType> getCrossSection(
37  const Code BeamId, const Code TargetId, const HEPEnergyType CoMenergy);
38 
39  template <typename TParticle>
40  GrammageType getInteractionLength(TParticle const&);
41 
46  template <typename TView>
47  void doInteraction(TView&);
48 
49  private:
50  default_prng_type& RNG_ = RNGManager<>::getInstance().getRandomStream("pythia");
51  Pythia8::SigmaTotal sigma_;
52  const bool internalDecays_ = true;
53  int count_ = 0;
54  bool print_listing_ = false;
55  };
56 
57 } // namespace corsika::pythia8
58 
59 #include <corsika/detail/modules/pythia8/Interaction.inl>
Import and extend the phys::units package.
void doInteraction(TView &)
In this function PYTHIA is called to produce one event.
Interface to particle properties.
Process describing the interaction of particles.
prng_type & getRandomStream(string_type const &streamName)