Particle Properties

group Particles

The properties of all particles are saved in static and flat arrays.

There is a enum corsika::Code to identify each particles, and each individual particles has its own static class, which can be used to retrieve its physical properties.

The properties of all elementary particles are accessible here. The data are taken from the Pythia ParticleData.xml file.

Particle data can be accessed via global function in namespace corsika, or via static classes for each particle type. These classes all have the interface (example for the class corsika::Electron):

static constexpr Code code{Code::Electron};
static constexpr Code anti_code{Code::Positron};
static constexpr HEPMassType mass{corsika::get_mass(code)};
static constexpr ElectricChargeType charge{corsika::get_charge(code)};
static constexpr int charge_number{corsika::get_charge_number(code)};
static constexpr std::string_view name{corsika::get_name(code)};
static constexpr bool is_nucleus{corsika::is_nucleus(code)};

The names, relations and properties of all particles known to CORSIKA 8 are listed below.

Typedefs

CodeIntType = int32_t std::underlying_type< Code >::type

The Code enum is the actual place to define CORSIKA 8 particle codes.

Specifically for PDG ids

using PDGCodeType = std::underlying_type<PDGCode>::type

Functions

int16_t constexpr get_charge_number(Code const)

electric charge in units of e

ElectricChargeType constexpr get_charge(Code const)

electric charge

HEPMassType constexpr get_mass(Code const)

mass

HEPEnergyType constexpr get_energy_threshold(Code const)

get energy threshold below which the particle is discarded, by default set to particle mass

void constexpr set_energy_threshold(Code const, HEPEnergyType const)

set energy threshold below which the particle is discarded

inline void set_energy_threshold(std::pair<Code const, HEPEnergyType const> p)
inline void set_energy_thresholds(std::unordered_map<Code const, HEPEnergyType const> const &eCuts)
PDGCode constexpr get_PDG(Code const)

Particle code according to PDG, “Monte Carlo Particle Numbering Scheme”.

std::string_view constexpr get_name(Code const)

name of the particle as string

TimeType constexpr get_lifetime(Code const)

lifetime

bool constexpr is_nucleus(Code const)

true iff the particle is a hard-coded nucleus or Code::Nucleus

bool constexpr is_hadron(Code const)

true iff particle is hadron

bool constexpr is_em(Code const)

true iff particle is electron, positron or gamma

bool constexpr is_muon(Code const)

true iff particle is mu+ or mu-

bool constexpr is_neutrino(Code const)

true iff particle is (anti-) neutrino

int constexpr get_nucleus_A(Code const)

returns A for hard-coded nucleus, otherwise 0

int constexpr get_nucleus_Z(Code const)

returns Z for hard-coded nucleus, otherwise 0

HEPMassType get_nucleus_mass(unsigned int const, unsigned int const)

returns mass of (A,Z) nucleus, disregarding binding energy

Code convert_from_PDG(PDGCode const)

convert PDG code to CORSIKA 8 internal code

std::initializer_list<Code> constexpr get_all_particles()
std::ostream &operator<<(std::ostream&, corsika::Code)

the output stream operator for human-readable particle codes