17#include "marley/Error.hh"
18#include "marley/TargetAtom.hh"
19#include "marley/marley_utils.hh"
26 pdg_ = marley_utils::get_nucleus_pid(
Z,
A );
31 return marley_utils::get_particle_Z(
pdg_ );
35 return marley_utils::get_particle_A(
pdg_ );
39 return marley_utils::get_particle_symbol(
pdg_ );
43 int A = marley_utils::get_particle_A(
pdg_ );
45 + std::to_string(
pdg_ ) +
" encountered upon construction of"
46 +
" a marley::TargetAtom object." );
Base class for all exceptions thrown by MARLEY functions.
int A() const
Returns the mass number of the target atom.
int pdg() const
Returns the nuclear PDG code of the target atom.
int pdg_
PDG code for the nucleus of the target atom.
std::string to_string() const
Converts the PDG code to a string representation (e.g., "40Ar")
void check_pdg_validity() const
Helper function for the constructors. Checks the atom's PDG code for validity.
TargetAtom(int pdg)
Create a TargetAtom object from an integer PDG code.
int Z() const
Returns the proton number of the target atom.