IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 2495a109 authored by ralfulrich's avatar ralfulrich
Browse files

also added getPDG getter to handle nuclear codes

parent ec81a214
No related branches found
No related tags found
1 merge request!337Resolve "Add kinetic energy getter for particles"
......@@ -193,6 +193,14 @@ namespace corsika::nuclear_stack {
(isNucleus() ? fmt::format("A={}, Z={}", getNuclearA(), getNuclearZ()) : "n/a"));
}
template <template <typename> class InnerParticleInterface,
typename StackIteratorInterface>
inline PDGCode NuclearParticleInterface<InnerParticleInterface,
StackIteratorInterface>::getPDG() const {
return (isNucleus() ? PDGCode(1000000000 + getNuclearZ() * 10000 + getNuclearA() * 10)
: super_type::getPDG());
}
template <template <typename> class InnerParticleInterface,
typename StackIteratorInterface>
inline void
......
......@@ -142,6 +142,11 @@ namespace corsika::nuclear_stack {
}
/// @}
/**
* Overwrite normal getPDG function with nuclear version
*/
PDGCode getPDG() const;
/**
* Overwrite normal setMomentum function with nuclear version
*/
......
......@@ -130,6 +130,8 @@ namespace corsika {
Code getPID() const {
return super_type::getStackData().getPID(super_type::getIndex());
}
//! Get PDG code
PDGCode getPDG() const { return get_PDG(getPID()); }
//! Get kinetic energy
HEPEnergyType getKineticEnergy() const {
return super_type::getStackData().getKineticEnergy(super_type::getIndex());
......
......@@ -394,7 +394,7 @@ int main(int argc, char** argv) {
Plane const obsPlane(showerCore, DirectionVector(rootCS, {0., 0., 1.}));
ObservationPlane observationLevel(obsPlane, DirectionVector(rootCS, {1., 0., 0.}));
// register the observation plane with the output
output.add("obsplane", observationLevel);
output.add("particles", observationLevel);
auto sequence =
make_sequence(stackInspect, hadronSequence, reset_particle_mass, decaySequence,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment