CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
InteractionProcess.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 
14 #include <corsika/detail/framework/process/InteractionProcess.hpp> // for extra traits, method/interface checking
15 
16 namespace corsika {
17 
51  template <typename TDerived>
52  class InteractionProcess : public BaseProcess<TDerived> {
53 
54  public:
56 
57  template <typename TParticle>
58  InverseGrammageType getInverseInteractionLength(TParticle const& particle) {
59 
60  // interface checking on TProcess1
61  static_assert(
62  has_method_getInteractionLength_v<TDerived, GrammageType, TParticle const&>,
63  "TDerived has no method with correct signature \"GrammageType "
64  "getInteractionLength(TParticle const&)\" required for "
65  "InteractionProcess<TDerived>. ");
66 
67  return 1. / ref().getInteractionLength(particle);
68  }
69  };
70 
74  template <typename TProcess>
76  TProcess, std::enable_if_t<
77  std::is_base_of_v<InteractionProcess<typename std::decay_t<TProcess>>,
78  typename std::decay_t<TProcess>>>>
79  : std::true_type {};
80 
83 } // namespace corsika
Import and extend the phys::units package.
A traits marker to identify InteractionProcess.
STL namespace.
Each process in C8 must derive from BaseProcess.
Definition: BaseProcess.hpp:33
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
The cascade namespace assembles all objects needed to simulate full particles cascades.
Process describing the interaction of particles.