12 #include <corsika/framework/geometry/RootCoordinateSystem.hpp> 13 #include <corsika/framework/geometry/Vector.hpp> 15 #include <corsika/modules/sibyll/ParticleConversion.hpp> 17 #include <sibyll2.3d.hpp> 28 void clear() { s_plist_.np = 0; }
29 unsigned int getSize()
const {
return s_plist_.np; }
30 unsigned int getCapacity()
const {
return 8000; }
32 void setId(
const unsigned int i,
const int v) { s_plist_.llist[i] = v; }
34 s_plist_.p[3][i] = v / 1_GeV;
36 void setMass(
const unsigned int i,
const HEPMassType v) {
37 s_plist_.p[4][i] = v / 1_GeV;
39 void setMomentum(
const unsigned int i,
const MomentumVector& v) {
41 for (
int idx = 0; idx < 3; ++idx) s_plist_.p[idx][i] = tmp[idx] / 1_GeV;
44 int getId(
const unsigned int i)
const {
return s_plist_.llist[i]; }
45 HEPEnergyType getEnergy(
const int i)
const {
return s_plist_.p[3][i] * 1_GeV; }
46 HEPEnergyType getMass(
const unsigned int i)
const {
return s_plist_.p[4][i] * 1_GeV; }
47 MomentumVector getMomentum(
const unsigned int i)
const {
50 s_plist_.p[0][i] * 1_GeV, s_plist_.p[1][i] * 1_GeV, s_plist_.p[2][i] * 1_GeV};
54 void copy(
const unsigned int i1,
const unsigned int i2) {
55 s_plist_.llist[i2] = s_plist_.llist[i1];
56 for (
unsigned int i = 0; i < 5; ++i) s_plist_.p[i][i2] = s_plist_.p[i][i1];
59 void swap(
const unsigned int i1,
const unsigned int i2) {
60 std::swap(s_plist_.llist[i1], s_plist_.llist[i2]);
61 for (
unsigned int i = 0; i < 5; ++i)
62 std::swap(s_plist_.p[i][i1], s_plist_.p[i][i2]);
65 void incrementSize() { s_plist_.np++; }
66 void decrementSize() {
67 if (s_plist_.np > 0) { s_plist_.np--; }
71 template <
typename TStackIterator>
78 void setParticleData(
const int vID,
const HEPEnergyType vE,
const MomentumVector& vP,
95 void setEnergy(
const HEPEnergyType v) { getStackData().setEnergy(getIndex(), v); }
97 HEPEnergyType getEnergy()
const {
return getStackData().getEnergy(getIndex()); }
99 bool hasDecayed()
const {
return abs(getStackData().getId(getIndex())) > 100; }
101 void setMass(
const HEPMassType v) { getStackData().setMass(getIndex(), v); }
103 HEPEnergyType getMass()
const {
return getStackData().getMass(getIndex()); }
105 void setPID(
const int v) { getStackData().setId(getIndex(), v); }
107 corsika::sibyll::SibyllCode getPID()
const {
108 return static_cast<corsika::sibyll::SibyllCode
>(getStackData().getId(getIndex()));
111 MomentumVector getMomentum()
const {
return getStackData().getMomentum(getIndex()); }
113 void setMomentum(
const MomentumVector& v) {
114 getStackData().setMomentum(getIndex(), v);
quantity< D, X > constexpr abs(quantity< D, X > const &x)
absolute value.
Import and extend the phys::units package.
The Stack class provides (and connects) the main particle data storage machinery. ...
Vector< hepmomentum_d > MomentumVector
A 3D vector defined in a specific coordinate system with units HEPMomentumType.
CoordinateSystemPtr const & get_root_CoordinateSystem()
this is the only way to create ONE unique root CS
Description of particle stacks.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.
The base class to define the readout of particle properties from a particle stack.
QuantityVector< TDimension > const & getComponents() const