CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
StackProcess.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/StackProcess.hpp> // for extra traits, method/interface checking
15 
16 namespace corsika {
17 
53  template <typename TDerived>
54  class StackProcess : public BaseProcess<TDerived> {
55  private:
56  protected:
57  public:
58  StackProcess() = delete;
59  StackProcess(const unsigned int nStep)
60  : nStep_(nStep) {}
61 
62  static bool const is_stack_process = true;
63 
65  int getStep() const { return iStep_; }
66 
69  bool checkStep() { return !((++iStep_) % nStep_); }
70 
71  private:
76  unsigned int nStep_ = 0;
77  unsigned long int iStep_ = 0;
79  };
80 
84  template <typename TProcess>
86  TProcess,
87  std::enable_if_t<std::is_base_of_v<StackProcess<typename std::decay_t<TProcess>>,
88  typename std::decay_t<TProcess>>>>
89  : std::true_type {};
90 
92 
93 } // namespace corsika
Import and extend the phys::units package.
STL namespace.
Each process in C8 must derive from BaseProcess.
Definition: BaseProcess.hpp:34
A traits marker to identify StackProcess.
`, since they are used everywhere as integral part of the framework.
int getStep() const
return the current Cascade step counter
bool checkStep()
check if current step is where StackProcess should be executed, this also increases the internal step...
Process to act on the entire particle stack.