15 std::string codestring(
"");
25 is.setstate(std::ios::failbit);
33 if (quark < 1 || quark > 6) {
34 throw std::invalid_argument(
35 std::string(
"PdgCode::net_quark_number(): ") +
36 std::string(
"Quark number must be in [1..6], received ") +
37 std::to_string(quark));
80 if (quark > otherquark) {
93 int valence_quarks_required)
const {
95 return valence_quarks_required == 1 || valence_quarks_required == -1;
99 return valence_quarks_required == 1 || valence_quarks_required == 2;
102 return valence_quarks_required == -1 || valence_quarks_required == -2;
105 throw std::runtime_error(
"String fragment is neither baryon nor meson");
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
int antiparticle_sign() const
int baryon_number() const
int net_quark_number(const int quark) const
Returns the net number of quarks with given flavour number For public use, see strangeness(),...
struct smash::PdgCode::@0::@2 digits_
The single digits collection of the code.
std::string string() const
static PdgCode invalid()
PdgCode 0x0 is guaranteed not to be valid by the PDG standard, but it passes all tests here,...
bool contains_enough_valence_quarks(int valence_quarks_required) const
void set_from_string(const std::string &codestring)
Set the PDG code from the given string.
struct smash::PdgCode::@0::@4 nucleus_
Structure for the nuclei.
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
std::istream & operator>>(std::istream &is, PdgCode &code)
Sets the PDG code from the textual representation in the input stream.
thrown for invalid inputs