CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
Particle Properties

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

Classes

struct  corsika::full_name
 tag class for get_name() More...
 

Functions

int16_t constexpr corsika::get_charge_number (Code const)
 electric charge in units of e
 
ElectricChargeType constexpr corsika::get_charge (Code const)
 electric charge
 
HEPMassType constexpr corsika::get_mass (Code const)
 mass
 
HEPEnergyType corsika::get_kinetic_energy_propagation_threshold (Code const)
 Get the kinetic energy propagation threshold. More...
 
void corsika::set_kinetic_energy_propagation_threshold (Code const, HEPEnergyType const)
 Set the kinetic energy propagation threshold object.
 
HEPEnergyType corsika::get_energy_production_threshold (Code const)
 Get the particle production energy threshold. More...
 
void corsika::set_energy_production_threshold (Code const, HEPEnergyType const)
 Set the particle production energy threshold in total energies.
 
PDGCode constexpr corsika::get_PDG (Code const)
 Particle code according to PDG, "Monte Carlo Particle Numbering Scheme".
 
PDGCode constexpr corsika::get_PDG (unsigned int const A, unsigned int const Z)
 
std::string_view constexpr corsika::get_name (Code const)
 name of the particle as string
 
std::string corsika::get_name (Code, full_name)
 get name of particle, including (A,Z) for nuclei
 
TimeType constexpr corsika::get_lifetime (Code const)
 lifetime
 
bool constexpr corsika::is_hadron (Code const)
 true if particle is hadron
 
bool constexpr corsika::is_em (Code const)
 true if particle is electron, positron or photon
 
bool constexpr corsika::is_muon (Code const)
 true if particle is mu+ or mu-
 
bool constexpr corsika::is_neutrino (Code const)
 true if particle is (anti-) neutrino
 
bool constexpr corsika::is_charged (Code const)
 true if particle is charged
 
Code constexpr corsika::get_nucleus_code (size_t const A, size_t const Z)
 Creates the Code for a nucleus of type 10LZZZAAAI. More...
 
bool constexpr corsika::is_nucleus (Code const)
 Checks if Code corresponds to a nucleus. More...
 
size_t constexpr corsika::get_nucleus_A (Code const)
 Get the mass number A for nucleus. More...
 
size_t constexpr corsika::get_nucleus_Z (Code const)
 Get the charge number Z for nucleus. More...
 
HEPMassType constexpr corsika::get_nucleus_mass (Code const code)
 Calculates the mass of nucleus. More...
 
HEPMassType constexpr corsika::get_nucleus_mass (unsigned int const A, unsigned int const Z)
 Calculates the mass of nucleus. More...
 
std::string corsika::get_nucleus_name (Code const code)
 Get the nucleus name. More...
 
Code corsika::convert_from_PDG (PDGCode const)
 convert PDG code to CORSIKA 8 internal code. More...
 
std::initializer_list< Code > constexpr corsika::get_all_particles ()
 Returns list of all non-nuclei particles. More...
 
std::ostream & corsika::operator<< (std::ostream &, corsika::Code)
 Code output operator. More...
 

Detailed Description

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

There is a enum corsika::Code to identify each particle, and each individual particle 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.

Note on energy threshold on particle production as well as particle propagation. The functions:

HEPEnergyType constexpr get_energy_production_threshold(Code const);
void constexpr set_energy_production_threshold(Code const, HEPEnergyType const);

can be used to tune the transition where explicit production of new particles, e.g. in Bremsstrahlung, is simulated versus a continuous handling of low-energy particles as generic energy losses. The default value for all particle types is 1 MeV.

Furthermore, the functions:

HEPEnergyType constexpr get_kinetic_energy_propagation_threshold(Code const);
void constexpr set_kinetic_energy_propagation_threshold(Code const, HEPEnergyType
const);

are used to discard low energy particle during tracking. The default value for all particle types is 1 GeV.

Function Documentation

◆ convert_from_PDG()

Code corsika::convert_from_PDG ( PDGCode  const)

convert PDG code to CORSIKA 8 internal code.

Returns
Code internal code.

◆ get_all_particles()

std::initializer_list<Code> constexpr corsika::get_all_particles ( )

Returns list of all non-nuclei particles.

Returns
std::initializer_list<Code> constexpr

◆ get_energy_production_threshold()

HEPEnergyType corsika::get_energy_production_threshold ( Code  const)

Get the particle production energy threshold.

The (total) energy below which a particle is only handled stoachastically (no production below this energy). This is for example important for stochastic discrete Bremsstrahlung versus low-energy Bremsstrahlung as part of continuous energy losses.

◆ get_kinetic_energy_propagation_threshold()

HEPEnergyType corsika::get_kinetic_energy_propagation_threshold ( Code  const)

Get the kinetic energy propagation threshold.

Particles are tracked only above the kinetic energy propagation threshold. Below this, they are discarded and removed. Sensible default values must be configured for a simulation.

◆ get_nucleus_A()

size_t constexpr corsika::get_nucleus_A ( Code  const)

Get the mass number A for nucleus.

Returns
int size of nucleus.returns A for hard-coded nucleus, otherwise 0

◆ get_nucleus_code()

Code constexpr corsika::get_nucleus_code ( size_t const  A,
size_t const  Z 
)

Creates the Code for a nucleus of type 10LZZZAAAI.

Returns
internal nucleus Code

◆ get_nucleus_mass() [1/2]

HEPMassType constexpr corsika::get_nucleus_mass ( Code const  code)

Calculates the mass of nucleus.

Returns
HEPMassType the mass of (A,Z) nucleus, disregarding binding energy.

◆ get_nucleus_mass() [2/2]

HEPMassType constexpr corsika::get_nucleus_mass ( unsigned int const  A,
unsigned int const  Z 
)

Calculates the mass of nucleus.

Returns
HEPMassType the mass of (A,Z) nucleus, disregarding binding energy.

◆ get_nucleus_name()

std::string corsika::get_nucleus_name ( Code const  code)
inline

Get the nucleus name.

Parameters
code
Returns
std::string_view

◆ get_nucleus_Z()

size_t constexpr corsika::get_nucleus_Z ( Code  const)

Get the charge number Z for nucleus.

Returns
int charge of nucleus.returns Z for hard-coded nucleus, otherwise 0

◆ is_nucleus()

bool constexpr corsika::is_nucleus ( Code  const)

Checks if Code corresponds to a nucleus.

Returns
true if nucleus.
false if not nucleus.

◆ operator<<()

std::ostream& corsika::operator<< ( std::ostream &  ,
corsika::Code   
)

Code output operator.

The output stream operator for human-readable particle codes.

Returns
std::ostream&