Pion/
quark.rs

1#[derive(Debug,Copy,Clone)]
2 pub enum Quark{
3       Up,
4       Down,
5       Charm,
6       Strange,
7       Top,
8       Bottom,    
9 }
10 
11 #[derive(Debug,Copy,Clone)]
12pub enum AntiQuark{
13       Up,
14       Down,
15       Charm,
16       Strange,
17       Top,
18       Bottom, 
19 }
20 
21 
22 impl Quark{
23      
24pub  const fn rest_mass(&self)->f64{
25        match self {
26         Quark::Up      => 1.7f64,
27         Quark::Down    => 4.1f64,
28         Quark::Charm   => 1270f64,
29         Quark::Strange => 101f64,
30         Quark::Top     => 172000f64,
31         Quark::Bottom  => 41900f64,
32        }
33      }
34      
35 pub fn charge(&self)->f64 {
36      match self {
37         Quark::Up      => 2.0/3.0,
38         Quark::Down    => -1.0/3.0,
39         Quark::Charm   => 2.0/3.0,
40         Quark::Strange => -1.0/3.0,
41         Quark::Top     => 2.0/3.0,
42         Quark::Bottom  => -1.0/3.0,
43        }
44 }      
45 }
46 
47 impl AntiQuark{
48      
49pub const  fn rest_mass(&self)->f64{
50      match self {
51     AntiQuark::Up      => 1.7f64,
52     AntiQuark::Down    => 4.1f64,
53     AntiQuark::Charm   => 1270f64,
54     AntiQuark::Strange => 101f64,
55     AntiQuark::Top     => 172000f64,
56     AntiQuark::Bottom  => 41900f64,
57      }
58 }
59 
60 pub fn charge(&self)->f64 {
61      match self {
62         AntiQuark::Up      => 2.0/3.0,
63         AntiQuark::Down    => -1.0/3.0,
64         AntiQuark::Charm   => 2.0/3.0,
65         AntiQuark::Strange => -1.0/3.0,
66         AntiQuark::Top     => 2.0/3.0,
67         AntiQuark::Bottom  => -1.0/3.0,
68        }
69 }      
70 
71 }