14 #include <corsika/framework/geometry/Point.hpp> 15 #include <corsika/framework/geometry/Vector.hpp> 16 #include <corsika/framework/geometry/PhysicalGeometry.hpp> 17 #include <corsika/stack/VectorStack.hpp> 42 template <
template <
typename>
class InnerParticleInterface,
43 typename StackIteratorInterface>
45 :
public InnerParticleInterface<StackIteratorInterface> {
47 typedef InnerParticleInterface<StackIteratorInterface> super_type;
51 unsigned short,
unsigned short>
52 nuclear_particle_data_type;
54 typedef std::tuple<Code,
MomentumVector, Point, TimeType,
unsigned short,
56 nuclear_particle_data_momentum_type;
78 void setParticleData(super_type& p,
typename super_type::particle_data_type
const& v);
86 void setParticleData(super_type& p, nuclear_particle_data_type
const& v);
93 void setParticleData(
typename super_type::particle_data_momentum_type
const& v);
109 typename super_type::particle_data_momentum_type
const& v);
117 void setParticleData(super_type& p, nuclear_particle_data_momentum_type
const& v);
119 std::string asString()
const;
125 void setNuclearA(
const unsigned short vA) {
126 super_type::getStackData().setNuclearA(super_type::getIndex(), vA);
128 void setNuclearZ(
const unsigned short vZ) {
129 super_type::getStackData().setNuclearZ(super_type::getIndex(), vZ);
137 int getNuclearA()
const {
138 return super_type::getStackData().getNuclearA(super_type::getIndex());
140 int getNuclearZ()
const {
141 return super_type::getStackData().getNuclearZ(super_type::getIndex());
190 int getNucleusRef()
const {
191 return super_type::getStackData().getNucleusRef(super_type::getIndex());
195 void setNucleusRef(
const int vR) {
196 super_type::getStackData().setNucleusRef(super_type::getIndex(), vR);
199 bool isNucleus()
const {
200 return super_type::getStackData().isNucleus(super_type::getIndex());
216 template <
typename InnerStackImpl>
219 typedef InnerStackImpl super_type;
222 typedef std::vector<int> nucleus_ref_type;
223 typedef std::vector<unsigned short> nuclear_a_type;
224 typedef std::vector<unsigned short> nuclear_z_type;
238 void init() { super_type::init(); }
240 void dump() { super_type::dump(); }
244 unsigned int getSize()
const {
return nucleusRef_.size(); }
246 unsigned int getCapacity()
const {
return nucleusRef_.capacity(); }
248 void setNuclearA(
const unsigned int i,
const unsigned short vA) {
249 nuclearA_[getNucleusRef(i)] = vA;
252 void setNuclearZ(
const unsigned int i,
const unsigned short vZ) {
253 nuclearZ_[getNucleusRef(i)] = vZ;
256 void setNucleusRef(
const unsigned int i,
const int v) { nucleusRef_[i] = v; }
258 int getNuclearA(
const unsigned int i)
const {
return nuclearA_[getNucleusRef(i)]; }
260 int getNuclearZ(
const unsigned int i)
const {
return nuclearZ_[getNucleusRef(i)]; }
264 int getNucleusNextRef();
266 int getNucleusRef(
const unsigned int i)
const;
268 bool isNucleus(
const unsigned int i)
const {
return nucleusRef_[i] >= 0; }
273 void copy(
const unsigned int i1,
const unsigned int i2);
277 void swap(
const unsigned int i1,
const unsigned int i2);
279 void incrementSize();
281 void decrementSize();
286 nucleus_ref_type nucleusRef_;
287 nuclear_a_type nuclearA_;
288 nuclear_z_type nuclearZ_;
292 template <
typename TInnerStack,
template <
typename>
typename PI_>
297 template <
typename TStackIter>
307 #include <corsika/detail/stack/NuclearStackExtension.inl>
Import and extend the phys::units package.
The Stack class provides (and connects) the main particle data storage machinery. ...
HEPEnergyType getEnergy() const
Overwrite normal getEnergy function with nuclear version.
Vector< hepmomentum_d > MomentumVector
A 3D vector defined in a specific coordinate system with units HEPMomentumType.
PDGCode getPDG() const
Overwrite normal getPDG function with nuclear version.
MomentumVector getMomentum() const
Overwrite normal getMomentum function with nuclear version.
Description of particle stacks.
VelocityVector getVelocity() const
Overwrite normal getVelocity function with nuclear version.
Define ParticleInterface for NuclearStackExtension Stack derived from ParticleInterface of Inner stac...
void setEnergy(HEPEnergyType const &e)
Overwrite normal getEnergy function with nuclear version.
HEPMassType getMass() const
Overwrite normal getMass function with nuclear version.
Vector< dimensionless_d > DirectionVector
A 3D vector defined in a specific coordinate system with no units.
void setParticleData(typename super_type::particle_data_type const &v)
Interface to particle properties.
ElectricChargeType getCharge() const
Overwrite normal getParticleCharge function with nuclear version.
int16_t getChargeNumber() const
Overwirte normal getChargeNumber function with nuclear version.
void setMomentum(MomentumVector const &v)
Overwrite normal setMomentum function with nuclear version.