CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
DecayProcess.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/DecayProcess.hpp> // for extra traits, method/interface checking
15 
16 namespace corsika {
17 
50  template <typename TDerived>
51  struct DecayProcess : BaseProcess<TDerived> {
52  public:
54 
55  template <typename TParticle>
56  InverseTimeType getInverseLifetime(TParticle const& particle) {
57 
58  // interface checking on TProcess1
59  static_assert(has_method_getLifetime_v<TDerived, TimeType, TParticle const&>,
60  "TDerived has no method with correct signature \"GrammageType "
61  "getInteractionLength(TParticle const&)\" required for "
62  "InteractionProcess<TDerived>. ");
63 
64  return 1. / getRef().getLifetime(particle);
65  }
66  };
67 
71  template <typename TProcess>
73  TProcess,
74  std::enable_if_t<std::is_base_of_v<DecayProcess<typename std::decay_t<TProcess>>,
75  typename std::decay_t<TProcess>>>>
76  : std::true_type {};
77 
80 } // namespace corsika
Import and extend the phys::units package.
STL namespace.
Each process in C8 must derive from BaseProcess.
Definition: BaseProcess.hpp:34
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
`, since they are used everywhere as integral part of the framework.
A traits marker to identify DecayProcess.
Process decribing the decay of particles.