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>
26
class
StackGenerator
{
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 =
39
typename
node::MakeGeometryDataInterface<TStackIter, env_type>::type
;
40
41
// combine particle data stack with geometry information for tracking
42
template
<
typename
TStackIter>
43
using
StackWithGeometryInterface
=
44
CombinedParticleInterface
<VectorStack::pi_type, SetupGeometryDataInterface,
45
TStackIter>;
46
47
using
StackWithGeometry
=
48
CombinedStack
<
typename
VectorStack::stack_data_type
,
49
node::GeometryData<env_type>
,
StackWithGeometryInterface
,
50
DefaultSecondaryProducer
>;
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 =
62
typename
weights::MakeWeightDataInterface<TStackIter>::type
;
63
64
// combine geometry-node-vector data stack with weight information for tracking
65
template
<
typename
TStackIter>
66
using
StackWithWeightInterface
=
67
CombinedParticleInterface
<StackWithGeometry_PI_type, SetupWeightDataInterface,
68
TStackIter>;
69
70
public
:
71
// the combined stack data: particle + geometry + weight
72
using
StackWithWeight
=
73
CombinedStack
<
typename
StackWithGeometry::stack_data_type
,
weights::WeightData
,
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>
85
using
StackWithHistoryInterface
=
86
CombinedParticleInterface
<StackWithWeight_PI_type,
87
history::HistoryEventDataInterface, TStackIter>;
88
89
public
:
90
using
StackWithHistory
=
91
CombinedStack
<
typename
StackWithWeight::stack_data_type
,
92
history::HistoryEventData
,
StackWithHistoryInterface
,
93
history::HistorySecondaryProducer
>;
94
};
95
96
}
// namespace setup::detail
97
98
}
// namespace corsika
corsika::weights::WeightDataInterface
Describe "particle weights" on a Stack.
Definition:
WeightStackExtension.hpp:33
corsika::node::GeometryData
definition of stack-data object to store geometry information
Definition:
GeometryNodeStackExtension.hpp:73
corsika::history::HistorySecondaryProducer
Definition:
StackIteratorInterface.hpp:17
corsika::history::HistoryData
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.
Definition:
HistoryStackExtension.hpp:28
corsika::Stack
The Stack class provides (and connects) the main particle data storage machinery. ...
Definition:
Stack.hpp:77
corsika::CombinedParticleInterface
CombinedParticleInterface can be used to combine the data of several StackData objects.
Definition:
CombinedStack.hpp:39
corsika::Stack::stack_data_type
TStackData stack_data_type
this is the type of the user-provided data structure
Definition:
Stack.hpp:82
corsika::node::GeometryDataInterface
Describe "volume node" data on a Stack.
Definition:
GeometryNodeStackExtension.hpp:33
corsika
`, since they are used everywhere as integral part of the framework.
Definition:
BoundaryCrossingProcess.hpp:14
corsika::weights::WeightData
definition of stack-data object to store geometry information.
Definition:
WeightStackExtension.hpp:58
corsika::DefaultSecondaryProducer
Class to handle the generation of new secondaries.
Definition:
DefaultSecondaryProducer.hpp:20
corsika::setup::detail::StackGenerator
Definition:
SetupStack.hpp:26
corsika
detail
setup
SetupStack.hpp
Generated by
1.8.13