pub struct ParticleID(/* private fields */);
Expand description
Particle ID according to the Monte Carlo Particle Numbering Scheme
Implementations§
Source§impl ParticleID
impl ParticleID
Sourcepub const fn latex_symbol(&self) -> Option<&'static str>
pub const fn latex_symbol(&self) -> Option<&'static str>
Particle symbol in LaTeX format
Sourcepub const fn id(self) -> i32
pub const fn id(self) -> i32
Get the corresponding integer
§Example
use particle_id::sm_elementary_particles::*;
assert_eq!(photon.id(), 22);
Sourcepub const fn anti(self) -> Self
pub const fn anti(self) -> Self
Get the corresponding anti-particle
§Example
use particle_id::sm_elementary_particles::*;
assert_eq!(positron.anti(), electron);
assert_eq!(electron.anti(), positron);
Sourcepub const fn abs(self) -> Self
pub const fn abs(self) -> Self
Get the corresponding particle for an anti-particle
If not used on an anti-particle, returns the particle itself
§Example
use particle_id::sm_elementary_particles::*;
assert_eq!(positron.abs(), electron);
assert_eq!(electron.abs(), electron);
Sourcepub const fn is_anti_particle(&self) -> bool
pub const fn is_anti_particle(&self) -> bool
Check if this is an anti-particle
§Example
use particle_id::sm_elementary_particles::*;
assert!(!electron.is_anti_particle());
assert!(positron.is_anti_particle());
Sourcepub const fn is_gauge_boson(&self) -> bool
pub const fn is_gauge_boson(&self) -> bool
Check if this is a gauge boson
§Example
use particle_id::sm_elementary_particles::*;
assert!(photon.is_gauge_boson());
assert!(!electron.is_gauge_boson());
assert!(!Higgs.is_gauge_boson());
Sourcepub const fn is_quark(&self) -> bool
pub const fn is_quark(&self) -> bool
Check if this is a quark
Note that anti-quarks are not treated as quarks! Use abs()
if you want to include both quarks and anti-quarks.
§Example
use particle_id::sm_elementary_particles::*;
assert!(top.is_quark());
assert!(!anti_top.is_quark());
assert!(anti_top.abs().is_quark());
assert!(anti_top.anti().is_quark());
Sourcepub const fn is_anti_quark(&self) -> bool
pub const fn is_anti_quark(&self) -> bool
Check if this is an anti-quark
§Example
use particle_id::sm_elementary_particles::*;
assert!(!top.is_anti_quark());
assert!(anti_top.is_anti_quark());
Sourcepub const fn is_lepton(&self) -> bool
pub const fn is_lepton(&self) -> bool
Check if this is a lepton
Note that anti-leptons are not treated as leptons! Use abs()
if you want to include both leptons and anti-leptons.
Both charged leptons and neutrinos are included.
§Example
use particle_id::sm_elementary_particles::*;
assert!(muon.is_lepton());
assert!(!anti_muon.is_lepton());
assert!(anti_muon.abs().is_lepton());
assert!(anti_muon.anti().is_lepton());
Sourcepub const fn is_anti_lepton(&self) -> bool
pub const fn is_anti_lepton(&self) -> bool
Check if this is an anti-lepton
§Example
use particle_id::sm_elementary_particles::*;
assert!(!muon.is_anti_lepton());
assert!(anti_muon.is_anti_lepton());
Sourcepub const fn is_neutrino(&self) -> bool
pub const fn is_neutrino(&self) -> bool
Check if this is a neutrino
Note that anti-neutrinos are not treated as neutrinos! Use abs()
if you want to include both neutrinos and anti-neutrinos.
§Example
use particle_id::sm_elementary_particles::*;
assert!(muon_neutrino.is_neutrino());
assert!(!muon_anti_neutrino.is_neutrino());
Sourcepub const fn is_anti_neutrino(&self) -> bool
pub const fn is_anti_neutrino(&self) -> bool
Check if this is an anti-neutrino
§Example
use particle_id::sm_elementary_particles::*;
assert!(!muon_neutrino.is_anti_neutrino());
assert!(muon_anti_neutrino.is_anti_neutrino());
Sourcepub const fn is_charged_lepton(&self) -> bool
pub const fn is_charged_lepton(&self) -> bool
Check if this is a charged lepton
Note that anti-leptons are not treated as leptons! Use abs()
if you want to include both leptons and anti-leptons.
§Example
use particle_id::sm_elementary_particles::*;
assert!(muon.is_charged_lepton());
assert!(!electron_neutrino.is_charged_lepton());
Sourcepub const fn is_charged_anti_lepton(&self) -> bool
pub const fn is_charged_anti_lepton(&self) -> bool
Check if this is a charged anti-lepton
§Example
use particle_id::sm_elementary_particles::*;
assert!(!muon.is_charged_anti_lepton());
assert!(anti_muon.is_charged_anti_lepton());
Trait Implementations§
Source§impl Clone for ParticleID
impl Clone for ParticleID
Source§fn clone(&self) -> ParticleID
fn clone(&self) -> ParticleID
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more