CORSIKA
@c8_version@
The framework to simulate particle cascades for astroparticle physics
DummyStack.hpp
1
/*
2
* (c) Copyright 2018 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/core/ParticleProperties.hpp
>
12
#include <
corsika/framework/core/PhysicalUnits.hpp
>
13
#include <corsika/framework/geometry/PhysicalGeometry.hpp>
14
#include <
corsika/framework/stack/Stack.hpp
>
15
16
#include <string>
17
#include <tuple>
18
19
namespace
corsika::dummy_stack
{
20
30
struct
NoData
{
/* nothing */
31
int
nothing = 0;
32
};
33
34
template
<
typename
StackIteratorInterface>
35
struct
ParticleInterface
:
public
corsika::ParticleBase
<StackIteratorInterface> {
36
37
typedef
corsika::ParticleBase<StackIteratorInterface>
super_type
;
38
39
public
:
40
void
setParticleData(
const
std::tuple<NoData>&
/*v*/
) {}
41
void
setParticleData(super_type&
/*parent*/
,
const
std::tuple<NoData>&
/*v*/
) {}
42
43
std::string asString()
const
{
return
"dummy-data"
; }
44
45
// unfortunately we need those dummy getter
46
// for some more complex tests with "history"
47
HEPEnergyType
getEnergy()
const
{
return
0_GeV; }
48
MomentumVector
getMomentum()
const
{
49
return
MomentumVector
(
get_root_CoordinateSystem
(), {0_GeV, 0_GeV, 0_GeV});
50
}
51
Code getPID()
const
{
return
Code::Unknown; }
52
};
53
59
class
DummyStackImpl
{
60
61
public
:
62
DummyStackImpl
() =
default
;
63
64
DummyStackImpl
(
DummyStackImpl
const
&) =
default
;
65
66
DummyStackImpl
(
DummyStackImpl
&&) =
default
;
67
68
DummyStackImpl
& operator=(
DummyStackImpl
const
&) =
default
;
69
DummyStackImpl
& operator=(
DummyStackImpl
&&) =
default
;
70
71
void
init() { entries_ = 0; }
72
73
void
clear() { entries_ = 0; }
74
75
int
getSize()
const
{
return
entries_; }
76
int
getCapacity()
const
{
return
entries_; }
77
81
void
copy
(
const
int
/*i1*/
,
const
int
/*i2*/
) {}
82
83
void
swap(
const
int
,
const
int
) {}
84
85
void
incrementSize() { entries_++; }
86
void
decrementSize() { entries_--; }
87
88
int
getEntries()
const
{
return
entries_; }
89
void
setEntries(
int
entries = 0) { entries_ = entries; }
90
91
private
:
92
int
entries_ = 0;
93
94
};
// end class DummyStackImpl
95
96
typedef
Stack<DummyStackImpl, ParticleInterface>
DummyStack
;
97
98
}
// namespace corsika::dummy_stack
corsika::dummy_stack::ParticleInterface
Definition:
DummyStack.hpp:35
PhysicalUnits.hpp
Import and extend the phys::units package.
corsika::dummy_stack::DummyStackImpl
Memory implementation of the most simple (no-data) particle stack object.
Definition:
DummyStack.hpp:59
corsika::dummy_stack::DummyStackImpl::copy
void copy(const int, const int)
Function to copy particle at location i2 in stack to i1.
Definition:
DummyStack.hpp:81
corsika::Stack
The Stack class provides (and connects) the main particle data storage machinery. ...
Definition:
Stack.hpp:77
corsika::MomentumVector
Vector< hepmomentum_d > MomentumVector
A 3D vector defined in a specific coordinate system with units HEPMomentumType.
Definition:
PhysicalGeometry.hpp:26
corsika::get_root_CoordinateSystem
CoordinateSystemPtr const & get_root_CoordinateSystem()
this is the only way to create ONE unique root CS
Definition:
RootCoordinateSystem.hpp:30
corsika::dummy_stack::NoData
Example of a particle object on the stack, with NO DATA.
Definition:
DummyStack.hpp:30
Stack.hpp
Description of particle stacks.
phys::units::quantity< phys::units::hepenergy_d, double >
corsika::Vector
Definition:
CoordinateSystem.hpp:29
ParticleProperties.hpp
Interface to particle properties.
corsika::ParticleBase
The base class to define the readout of particle properties from a particle stack.
Definition:
ParticleBase.hpp:43
corsika::dummy_stack
Definition:
DummyStack.hpp:19
corsika
stack
DummyStack.hpp
Generated by
1.8.13