CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
SetupStack.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 
11 #include <corsika/framework/stack/CombinedStack.hpp>
12 #include <corsika/stack/GeometryNodeStackExtension.hpp>
13 #include <corsika/stack/VectorStack.hpp>
14 #include <corsika/stack/WeightStackExtension.hpp>
15 #include <corsika/stack/history/HistorySecondaryProducer.hpp>
16 #include <corsika/stack/history/HistoryStackExtension.hpp>
17 #include <corsika/media/Environment.hpp>
18 #include <corsika/media/IMagneticFieldModel.hpp>
19 #include <corsika/media/IMediumModel.hpp>
20 #include <corsika/media/IMediumPropertyModel.hpp>
21 
22 namespace corsika {
23 
24  namespace setup::detail {
25  template <typename TEnvironment>
27  private:
28  using env_type = TEnvironment;
29 
30  // ------------------------------------------
31  // add geometry node data to stack. This is fundamentally needed
32  // for robust tracking through multiple volumes.
33 
34  // the GeometryNode stack needs to know the type of geometry-nodes from the
35  // environment:
36 
37  template <typename TStackIter>
38  using SetupGeometryDataInterface =
40 
41  // combine particle data stack with geometry information for tracking
42  template <typename TStackIter>
44  CombinedParticleInterface<VectorStack::pi_type, SetupGeometryDataInterface,
45  TStackIter>;
46 
47  using StackWithGeometry =
51 
52  template <class T>
53  using StackWithGeometry_PI_type = typename StackWithGeometry::template pi_type<T>;
54 
55  // ------------------------------------------
56  // add weight data to stack. This is fundamentally needed
57  // for thinning.
58 
59  // the "pure" weight stack (interface)
60  template <typename TStackIter>
61  using SetupWeightDataInterface =
63 
64  // combine geometry-node-vector data stack with weight information for tracking
65  template <typename TStackIter>
67  CombinedParticleInterface<StackWithGeometry_PI_type, SetupWeightDataInterface,
68  TStackIter>;
69 
70  public:
71  // the combined stack data: particle + geometry + weight
72  using StackWithWeight =
74  StackWithWeightInterface, DefaultSecondaryProducer>;
75 
76  private:
77  template <typename T>
78  using StackWithWeight_PI_type = typename StackWithWeight::template pi_type<T>;
79 
80  // ------------------------------------------
81  // Add [OPTIONAL] history data to stack, too.
82  // This keeps the entire lineage of particles in memory.
83 
84  template <typename TStackIter>
86  CombinedParticleInterface<StackWithWeight_PI_type,
87  history::HistoryEventDataInterface, TStackIter>;
88 
89  public:
90  using StackWithHistory =
94  };
95 
96  } // namespace setup::detail
97 
98 } // namespace corsika
Describe "particle weights" on a Stack.
definition of stack-data object to store geometry information
definition of stack-data object to store history information this is vector with shared_ptr<TEvent>, where TEvent is a free template parameter for customization.
The Stack class provides (and connects) the main particle data storage machinery. ...
Definition: Stack.hpp:77
CombinedParticleInterface can be used to combine the data of several StackData objects.
TStackData stack_data_type
this is the type of the user-provided data structure
Definition: Stack.hpp:82
Describe "volume node" data on a Stack.
`, since they are used everywhere as integral part of the framework.
definition of stack-data object to store geometry information.
Class to handle the generation of new secondaries.