1#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
2pub enum Charge {
3 Charged,
4 Positive,
5 Negative,
6 Neutral,
7 AllCharges,
8}
9
10#[allow(non_camel_case_types)]
11#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Default)]
12pub enum Particle {
13 #[default]
14 UnknownParticle,
15 Gamma,
16 Positron,
17 Electron,
18 Neutrino,
19 MuonPlus,
20 MuonMinus,
21 Pi0,
22 PiPlus,
23 PiMinus,
24 KLong,
25 KPlus,
26 KMinus,
27 Neutron,
28 Proton,
29 AntiProton,
30 KShort,
31 Eta,
32 Lambda,
33 SigmaPlus,
34 Sigma0,
35 SigmaMinus,
36 Xi0,
37 XiMinus,
38 OmegaMinus,
39 AntiNeutron,
40 AntiLambda,
41 AntiSigmaMinus,
42 AntiSigma0,
43 AntiSigmaPlus,
44 AntiXi0,
45 AntiXiPlus,
46 AntiOmegaPlus,
47 Deuteron,
48 Triton,
49 Helium,
50 Geantino,
51 He3,
52 GammaOptical,
53 Li6,
54 Li7,
55 Be7,
56 Be9,
57 B10,
58 B11,
59 C12,
60 N14,
61 O16,
62 F19,
63 Ne20,
64 Na23,
65 Mg24,
66 Al27,
67 Si28,
68 P31,
69 S32,
70 Cl35,
71 Ar36,
72 K39,
73 Ca40,
74 Sc45,
75 Ti48,
76 V51,
77 Cr52,
78 Mn55,
79 Fe56,
80 Co59,
81 Ni58,
82 Cu63,
83 Zn64,
84 Ge74,
85 Se80,
86 Kr84,
87 Sr88,
88 Zr90,
89 Mo98,
90 Pd106,
91 Cd114,
92 Sn120,
93 Xe132,
94 Ba138,
95 Ce140,
96 Sm152,
97 Dy164,
98 Yb174,
99 W184,
100 Pt194,
101 Au197,
102 Hg202,
103 Pb208,
104 U238,
105 Ta181,
106 Rho0,
107 RhoPlus,
108 RhoMinus,
109 omega,
110 phiMeson,
111 EtaPrime,
112 a0_980,
113 f0_980,
114 KStar_892_0,
115 KStar_892_Plus,
116 KStar_892_Minus,
117 AntiKStar_892_0,
118 K1_1400_Plus,
119 K1_1400_Minus,
120 b1_1235_Plus,
121 Sigma_1385_Minus,
122 Sigma_1385_0,
123 Sigma_1385_Plus,
124 Jpsi,
125 Eta_c,
126 Chi_c0,
127 Chi_c1,
128 Chi_c2,
129 Psi2s,
130 D0,
131 DPlus,
132 Dstar0,
133 DstarPlus,
134 Lambda_c,
135 AntiD0,
136 DMinus,
137 DstarMinus,
138 Sigma_cPlusPlus,
139 DeltaPlusPlus,
140}
141
142impl Particle {
143 pub fn is_unknown(&self) -> bool {
144 matches!(self, Self::UnknownParticle)
145 }
146
147 pub fn to_geant3(&self) -> usize {
148 match self {
149 Self::UnknownParticle => 0,
150 Self::Gamma => 1,
151 Self::Positron => 2,
152 Self::Electron => 3,
153 Self::Neutrino => 4,
154 Self::MuonPlus => 5,
155 Self::MuonMinus => 6,
156 Self::Pi0 => 7,
157 Self::PiPlus => 8,
158 Self::PiMinus => 9,
159 Self::KLong => 10,
160 Self::KPlus => 11,
161 Self::KMinus => 12,
162 Self::Neutron => 13,
163 Self::Proton => 14,
164 Self::AntiProton => 15,
165 Self::KShort => 16,
166 Self::Eta => 17,
167 Self::Lambda => 18,
168 Self::SigmaPlus => 19,
169 Self::Sigma0 => 20,
170 Self::SigmaMinus => 21,
171 Self::Xi0 => 22,
172 Self::XiMinus => 23,
173 Self::OmegaMinus => 24,
174 Self::AntiNeutron => 25,
175 Self::AntiLambda => 26,
176 Self::AntiSigmaMinus => 27,
177 Self::AntiSigma0 => 28,
178 Self::AntiSigmaPlus => 29,
179 Self::AntiXi0 => 30,
180 Self::AntiXiPlus => 31,
181 Self::AntiOmegaPlus => 32,
182 Self::Deuteron => 45,
183 Self::Triton => 46,
184 Self::Helium => 47,
185 Self::Geantino => 48,
186 Self::He3 => 49,
187 Self::GammaOptical => 50,
188 Self::Li6 => 61,
189 Self::Li7 => 62,
190 Self::Be7 => 63,
191 Self::Be9 => 64,
192 Self::B10 => 65,
193 Self::B11 => 66,
194 Self::C12 => 67,
195 Self::N14 => 68,
196 Self::O16 => 69,
197 Self::F19 => 70,
198 Self::Ne20 => 71,
199 Self::Na23 => 72,
200 Self::Mg24 => 73,
201 Self::Al27 => 74,
202 Self::Si28 => 75,
203 Self::P31 => 76,
204 Self::S32 => 77,
205 Self::Cl35 => 78,
206 Self::Ar36 => 79,
207 Self::K39 => 80,
208 Self::Ca40 => 81,
209 Self::Sc45 => 82,
210 Self::Ti48 => 83,
211 Self::V51 => 84,
212 Self::Cr52 => 85,
213 Self::Mn55 => 86,
214 Self::Fe56 => 87,
215 Self::Co59 => 88,
216 Self::Ni58 => 89,
217 Self::Cu63 => 90,
218 Self::Zn64 => 91,
219 Self::Ge74 => 92,
220 Self::Se80 => 93,
221 Self::Kr84 => 94,
222 Self::Sr88 => 95,
223 Self::Zr90 => 96,
224 Self::Mo98 => 97,
225 Self::Pd106 => 98,
226 Self::Cd114 => 99,
227 Self::Sn120 => 100,
228 Self::Xe132 => 101,
229 Self::Ba138 => 102,
230 Self::Ce140 => 103,
231 Self::Sm152 => 104,
232 Self::Dy164 => 105,
233 Self::Yb174 => 106,
234 Self::W184 => 107,
235 Self::Pt194 => 108,
236 Self::Au197 => 109,
237 Self::Hg202 => 110,
238 Self::Pb208 => 111,
239 Self::U238 => 112,
240 Self::Ta181 => 113,
241 Self::Rho0 => 44, Self::RhoPlus => 42, Self::RhoMinus => 43, Self::omega => 33, Self::phiMeson => 34, Self::EtaPrime => 35, Self::a0_980 => 163,
248 Self::f0_980 => 164,
249 Self::KStar_892_0 => 165,
250 Self::KStar_892_Plus => 166,
251 Self::KStar_892_Minus => 167,
252 Self::AntiKStar_892_0 => 168,
253 Self::K1_1400_Plus => 169,
254 Self::K1_1400_Minus => 170,
255 Self::b1_1235_Plus => 171,
256 Self::Sigma_1385_Minus => 172,
257 Self::Sigma_1385_0 => 173,
258 Self::Sigma_1385_Plus => 174,
259 Self::Jpsi => 183,
260 Self::Eta_c => 184,
261 Self::Chi_c0 => 185,
262 Self::Chi_c1 => 186,
263 Self::Chi_c2 => 187,
264 Self::Psi2s => 188,
265 Self::D0 => 189,
266 Self::DPlus => 190,
267 Self::Dstar0 => 191,
268 Self::DstarPlus => 192,
269 Self::Lambda_c => 193,
270 Self::AntiD0 => 194,
271 Self::DMinus => 195,
272 Self::DstarMinus => 196,
273 Self::Sigma_cPlusPlus => 197,
274 Self::DeltaPlusPlus => 182,
275 }
276 }
277 pub fn is_lepton(&self) -> bool {
278 matches!(
279 self,
280 Self::Electron | Self::Positron | Self::MuonPlus | Self::MuonMinus | Self::Neutrino
281 )
282 }
283
284 pub fn particle_type(&self) -> &str {
285 match self {
286 Self::UnknownParticle => "Unknown",
287 Self::Gamma => "Gamma",
288 Self::Positron => "Positron",
289 Self::Electron => "Electron",
290 Self::Neutrino => "Neutrino",
291 Self::MuonPlus => "Muon+",
292 Self::MuonMinus => "Muon-",
293 Self::Pi0 => "Pi0",
294 Self::PiPlus => "Pi+",
295 Self::PiMinus => "Pi-",
296 Self::KLong => "KLong",
297 Self::KPlus => "K+",
298 Self::KMinus => "K-",
299 Self::Neutron => "Neutron",
300 Self::Proton => "Proton",
301 Self::AntiProton => "AntiProton",
302 Self::KShort => "KShort",
303 Self::Eta => "Eta",
304 Self::Lambda => "Lambda",
305 Self::SigmaPlus => "Sigma+",
306 Self::Sigma0 => "Sigma0",
307 Self::SigmaMinus => "Sigma-",
308 Self::Xi0 => "Xi0",
309 Self::XiMinus => "Xi-",
310 Self::OmegaMinus => "Omega-",
311 Self::AntiNeutron => "AntiNeutron",
312 Self::AntiLambda => "AntiLambda",
313 Self::AntiSigmaMinus => "AntiSigma-",
314 Self::AntiSigma0 => "AntiSigma0",
315 Self::AntiSigmaPlus => "AntiSigma+",
316 Self::AntiXi0 => "AntiXi0",
317 Self::AntiXiPlus => "AntiXi+",
318 Self::AntiOmegaPlus => "AntiOmega+",
319 Self::Deuteron => "Deuteron",
320 Self::Triton => "Triton",
321 Self::Helium => "Helium",
322 Self::Geantino => "Geantino",
323 Self::He3 => "Helium-3",
324 Self::GammaOptical => "GammaOptical",
325 Self::Li6 => "Lithium-6",
326 Self::Li7 => "Lithium-7",
327 Self::Be7 => "Beryllium-7",
328 Self::Be9 => "Beryllium-9",
329 Self::B10 => "Boron-10",
330 Self::B11 => "Boron-11",
331 Self::C12 => "Carbon-12",
332 Self::N14 => "Nitrogen",
333 Self::O16 => "Oxygen",
334 Self::F19 => "Flourine",
335 Self::Ne20 => "Neon",
336 Self::Na23 => "Sodium",
337 Self::Mg24 => "Magnesium",
338 Self::Al27 => "Aluminum",
339 Self::Si28 => "Silicon",
340 Self::P31 => "Phosphorous",
341 Self::S32 => "Sulphur",
342 Self::Cl35 => "Chlorine",
343 Self::Ar36 => "Argon",
344 Self::K39 => "Potassium",
345 Self::Ca40 => "Calcium",
346 Self::Sc45 => "Scandium",
347 Self::Ti48 => "Titanium",
348 Self::V51 => "Vanadium",
349 Self::Cr52 => "Chromium",
350 Self::Mn55 => "Manganese",
351 Self::Fe56 => "Iron",
352 Self::Co59 => "Cobalt",
353 Self::Ni58 => "Nickel",
354 Self::Cu63 => "Copper",
355 Self::Zn64 => "Zinc",
356 Self::Ge74 => "Germanium",
357 Self::Se80 => "Selenium",
358 Self::Kr84 => "Krypton",
359 Self::Sr88 => "Strontium",
360 Self::Zr90 => "Zirconium",
361 Self::Mo98 => "Molybdenum",
362 Self::Pd106 => "Palladium",
363 Self::Cd114 => "Cadmium",
364 Self::Sn120 => "Tin",
365 Self::Xe132 => "Xenon",
366 Self::Ba138 => "Barium",
367 Self::Ce140 => "Cesium",
368 Self::Sm152 => "Samerium",
369 Self::Dy164 => "Dysprosium",
370 Self::Yb174 => "Ytterbium",
371 Self::W184 => "Tungsten",
372 Self::Pt194 => "Platinum",
373 Self::Au197 => "Gold",
374 Self::Hg202 => "Mercury",
375 Self::Pb208 => "Lead",
376 Self::U238 => "Uranium",
377 Self::Ta181 => "Tantalum",
378 Self::Rho0 => "Rho0",
379 Self::RhoPlus => "Rho+",
380 Self::RhoMinus => "Rho-",
381 Self::omega => "Omega",
382 Self::phiMeson => "Phi",
383 Self::EtaPrime => "EtaPrime",
384 Self::a0_980 => "a0(980)",
385 Self::f0_980 => "f0(980)",
386 Self::KStar_892_0 => "K*(892)0",
387 Self::KStar_892_Plus => "K*(892)+",
388 Self::KStar_892_Minus => "K*(892)-",
389 Self::AntiKStar_892_0 => "antiK*(892)0",
390 Self::K1_1400_Plus => "K1(1440)+",
391 Self::K1_1400_Minus => "K1(1440)-",
392 Self::b1_1235_Plus => "b1(1235)+",
393 Self::Sigma_1385_Minus => "Sigma(1385)-",
394 Self::Sigma_1385_0 => "Sigma(1385)0",
395 Self::Sigma_1385_Plus => "Sigma(1385)+",
396 Self::Jpsi => "Jpsi",
397 Self::Eta_c => "EtaC",
398 Self::Chi_c0 => "ChiC0",
399 Self::Chi_c1 => "ChiC1",
400 Self::Chi_c2 => "ChiC2",
401 Self::Psi2s => "Psi(2S)",
402 Self::D0 => "D0",
403 Self::DPlus => "D+",
404 Self::Dstar0 => "D*0",
405 Self::DstarPlus => "D*+",
406 Self::Lambda_c => "LambdaC",
407 Self::AntiD0 => "AntiD0",
408 Self::DMinus => "D-",
409 Self::DstarMinus => "D*-",
410 Self::Sigma_cPlusPlus => "SigmaC++",
411 Self::DeltaPlusPlus => "Delta++",
412 }
413 }
414
415 pub fn enum_string(&self) -> &str {
416 match self {
417 Self::UnknownParticle => "Unknown",
418 Self::Gamma => "Photon",
419 Self::Positron => "Positron",
420 Self::Electron => "Electron",
421 Self::Neutrino => "Neutrino",
422 Self::MuonPlus => "MuonPlus",
423 Self::MuonMinus => "MuonMinus",
424 Self::Pi0 => "Pi0",
425 Self::PiPlus => "PiPlus",
426 Self::PiMinus => "PiMinus",
427 Self::KLong => "KLong",
428 Self::KPlus => "KPlus",
429 Self::KMinus => "KMinus",
430 Self::Neutron => "Neutron",
431 Self::Proton => "Proton",
432 Self::AntiProton => "AntiProton",
433 Self::KShort => "KShort",
434 Self::Eta => "Eta",
435 Self::Lambda => "Lambda",
436 Self::SigmaPlus => "SigmaPlus",
437 Self::Sigma0 => "Sigma0",
438 Self::SigmaMinus => "SigmaMinus",
439 Self::Xi0 => "Xi0",
440 Self::XiMinus => "XiMinus",
441 Self::OmegaMinus => "OmegaMinus",
442 Self::AntiNeutron => "AntiNeutron",
443 Self::AntiLambda => "AntiLambda",
444 Self::AntiSigmaMinus => "AntiSigmaMinus",
445 Self::AntiSigma0 => "AntiSigma0",
446 Self::AntiSigmaPlus => "AntiSigmaPlus",
447 Self::AntiXi0 => "AntiXi0",
448 Self::AntiXiPlus => "AntiXiPlus",
449 Self::AntiOmegaPlus => "AntiOmegaPlus",
450 Self::Deuteron => "Deuteron",
451 Self::Triton => "Triton",
452 Self::Helium => "Helium",
453 Self::Geantino => "Geantino",
454 Self::He3 => "Helium-3",
455 Self::GammaOptical => "GammaOptical",
456 Self::Li6 => "Lithium-6",
457 Self::Li7 => "Lithium-7",
458 Self::Be7 => "Beryllium-7",
459 Self::Be9 => "Beryllium-9",
460 Self::B10 => "Boron-10",
461 Self::B11 => "Boron-11",
462 Self::C12 => "Carbon-12",
463 Self::N14 => "Nitrogen",
464 Self::O16 => "Oxygen",
465 Self::F19 => "Flourine",
466 Self::Ne20 => "Neon",
467 Self::Na23 => "Sodium",
468 Self::Mg24 => "Magnesium",
469 Self::Al27 => "Aluminum",
470 Self::Si28 => "Silicon",
471 Self::P31 => "Phosphorous",
472 Self::S32 => "Sulphur",
473 Self::Cl35 => "Chlorine",
474 Self::Ar36 => "Argon",
475 Self::K39 => "Potassium",
476 Self::Ca40 => "Calcium",
477 Self::Sc45 => "Scandium",
478 Self::Ti48 => "Titanium",
479 Self::V51 => "Vanadium",
480 Self::Cr52 => "Chromium",
481 Self::Mn55 => "Manganese",
482 Self::Fe56 => "Iron",
483 Self::Co59 => "Cobalt",
484 Self::Ni58 => "Nickel",
485 Self::Cu63 => "Copper",
486 Self::Zn64 => "Zinc",
487 Self::Ge74 => "Germanium",
488 Self::Se80 => "Selenium",
489 Self::Kr84 => "Krypton",
490 Self::Sr88 => "Strontium",
491 Self::Zr90 => "Zirconium",
492 Self::Mo98 => "Molybdenum",
493 Self::Pd106 => "Palladium",
494 Self::Cd114 => "Cadmium",
495 Self::Sn120 => "Tin",
496 Self::Xe132 => "Xenon",
497 Self::Ba138 => "Barium",
498 Self::Ce140 => "Cesium",
499 Self::Sm152 => "Samerium",
500 Self::Dy164 => "Dysprosium",
501 Self::Yb174 => "Ytterbium",
502 Self::W184 => "Tungsten",
503 Self::Pt194 => "Platinum",
504 Self::Au197 => "Gold",
505 Self::Hg202 => "Mercury",
506 Self::Pb208 => "Lead",
507 Self::U238 => "Uranium",
508 Self::Ta181 => "Tantalum",
509 Self::Rho0 => "Rho0",
510 Self::RhoPlus => "RhoPlus",
511 Self::RhoMinus => "RhoMinus",
512 Self::omega => "omega",
513 Self::phiMeson => "phiMeson",
514 Self::EtaPrime => "EtaPrime",
515 Self::a0_980 => "a0_980",
516 Self::f0_980 => "f0_980",
517 Self::KStar_892_0 => "KStar_892_0",
518 Self::KStar_892_Plus => "KStar_892_Plus",
519 Self::KStar_892_Minus => "KStar_892_Minus",
520 Self::AntiKStar_892_0 => "AntiKStar_892_0",
521 Self::K1_1400_Plus => "K1_1400_Plus",
522 Self::K1_1400_Minus => "K1_1400_Minus",
523 Self::b1_1235_Plus => "b1_1235_Plus",
524 Self::Sigma_1385_Minus => "Sigma_1385_Minus",
525 Self::Sigma_1385_0 => "Sigma_1385_0",
526 Self::Sigma_1385_Plus => "Sigma_1385_Plus",
527 Self::Jpsi => "Jpsi",
528 Self::Eta_c => "Eta_c",
529 Self::Chi_c0 => "Chi_c0",
530 Self::Chi_c1 => "Chi_c1",
531 Self::Chi_c2 => "Chi_c2",
532 Self::Psi2s => "Psi2s",
533 Self::D0 => "D0",
534 Self::DPlus => "DPlus",
535 Self::Dstar0 => "Dstar0",
536 Self::DstarPlus => "DstarPlus",
537 Self::Lambda_c => "Lambda_c",
538 Self::AntiD0 => "AntiD0",
539 Self::DMinus => "DMinus",
540 Self::DstarMinus => "DstarMinus",
541 Self::Sigma_cPlusPlus => "Sigma_cPlusPlus",
542 Self::DeltaPlusPlus => "DeltaPlusPlus",
543 }
544 }
545
546 pub fn evtgen_string(&self) -> &str {
547 match self {
548 Self::UnknownParticle => "Unknown",
549 Self::Gamma => "gamma",
550 Self::Positron => "e+",
551 Self::Electron => "e-",
552 Self::Neutrino => "nu_e",
553 Self::MuonPlus => "mu+",
554 Self::MuonMinus => "mu-",
555 Self::Pi0 => "pi0",
556 Self::PiPlus => "pi+",
557 Self::PiMinus => "pi-",
558 Self::KLong => "K_L0",
559 Self::KPlus => "K+",
560 Self::KMinus => "K-",
561 Self::Neutron => "n0",
562 Self::Proton => "p+",
563 Self::AntiProton => "anti-p-",
564 Self::KShort => "K_S0",
565 Self::Eta => "eta",
566 Self::Lambda => "Lambda0",
567 Self::SigmaPlus => "Sigma+",
568 Self::Sigma0 => "Sigma0",
569 Self::SigmaMinus => "Sigma-",
570 Self::Xi0 => "Xi0",
571 Self::XiMinus => "Xi-",
572 Self::OmegaMinus => "Omega-",
573 Self::AntiNeutron => "anti-n0",
574 Self::AntiLambda => "anti-Lambda0",
575 Self::AntiSigmaMinus => "anti-Sigma-",
576 Self::AntiSigma0 => "anti-Sigma0",
577 Self::AntiSigmaPlus => "anti-Sigma+",
578 Self::AntiXi0 => "anti-Xi0",
579 Self::AntiXiPlus => "anti-Xi+",
580 Self::AntiOmegaPlus => "anti-Omega+",
581 Self::Deuteron => "deuteron",
582 Self::Triton => "Triton", Self::Helium => "Helium", Self::Geantino => "geantino",
585 Self::He3 => "He3",
586 Self::GammaOptical => "gammaOptical",
587 Self::Li6 => "Lithium-6",
588 Self::Li7 => "Lithium-7",
589 Self::Be7 => "Beryllium-7",
590 Self::Be9 => "Beryllium-9",
591 Self::B10 => "Boron-10",
592 Self::B11 => "Boron-11",
593 Self::C12 => "Carbon-12",
594 Self::N14 => "Nitrogen",
595 Self::O16 => "Oxygen",
596 Self::F19 => "Flourine",
597 Self::Ne20 => "Neon",
598 Self::Na23 => "Sodium",
599 Self::Mg24 => "Magnesium",
600 Self::Al27 => "Aluminum",
601 Self::Si28 => "Silicon",
602 Self::P31 => "Phosphorous",
603 Self::S32 => "Sulphur",
604 Self::Cl35 => "Chlorine",
605 Self::Ar36 => "Argon",
606 Self::K39 => "Potassium",
607 Self::Ca40 => "Calcium",
608 Self::Sc45 => "Scandium",
609 Self::Ti48 => "Titanium",
610 Self::V51 => "Vanadium",
611 Self::Cr52 => "Chromium",
612 Self::Mn55 => "Manganese",
613 Self::Fe56 => "Iron",
614 Self::Co59 => "Cobalt",
615 Self::Ni58 => "Nickel",
616 Self::Cu63 => "Copper",
617 Self::Zn64 => "Zinc",
618 Self::Ge74 => "Germanium",
619 Self::Se80 => "Selenium",
620 Self::Kr84 => "Krypton",
621 Self::Sr88 => "Strontium",
622 Self::Zr90 => "Zirconium",
623 Self::Mo98 => "Molybdenum",
624 Self::Pd106 => "Palladium",
625 Self::Cd114 => "Cadmium",
626 Self::Sn120 => "Tin",
627 Self::Xe132 => "Xenon",
628 Self::Ba138 => "Barium",
629 Self::Ce140 => "Cesium",
630 Self::Sm152 => "Samerium",
631 Self::Dy164 => "Dysprosium",
632 Self::Yb174 => "Ytterbium",
633 Self::W184 => "Tungsten",
634 Self::Pt194 => "Platinum",
635 Self::Au197 => "Gold",
636 Self::Hg202 => "Mercury",
637 Self::Pb208 => "Lead",
638 Self::U238 => "Uranium",
639 Self::Ta181 => "Tantalum",
640 Self::Rho0 => "rho0",
641 Self::RhoPlus => "rho+",
642 Self::RhoMinus => "rho-",
643 Self::omega => "omega",
644 Self::phiMeson => "phi",
645 Self::EtaPrime => "eta'",
646 Self::a0_980 => "a_0",
647 Self::f0_980 => "f_0",
648 Self::KStar_892_0 => "K*0",
649 Self::KStar_892_Plus => "K*+",
650 Self::KStar_892_Minus => "K*-",
651 Self::AntiKStar_892_0 => "anti-K*0",
652 Self::K1_1400_Plus => "K'_1+",
653 Self::K1_1400_Minus => "K'_1-",
654 Self::b1_1235_Plus => "b_1+",
655 Self::Sigma_1385_Minus => "Sigma_1385_Minus",
656 Self::Sigma_1385_0 => "Sigma_1385_0",
657 Self::Sigma_1385_Plus => "Sigma_1385_Plus",
658 Self::Jpsi => "J/psi",
659 Self::Eta_c => "eta_c",
660 Self::Chi_c0 => "chi_c0",
661 Self::Chi_c1 => "chi_c1",
662 Self::Chi_c2 => "chi_c2",
663 Self::Psi2s => "psi(2S)",
664 Self::D0 => "D0",
665 Self::DPlus => "D+",
666 Self::Dstar0 => "D*0",
667 Self::DstarPlus => "D*+",
668 Self::Lambda_c => "Lambda_c0",
669 Self::AntiD0 => "anti-D0",
670 Self::DMinus => "D-",
671 Self::DstarMinus => "D*-",
672 Self::Sigma_cPlusPlus => "Sigma_c++",
673 Self::DeltaPlusPlus => "Delta++",
674 }
675 }
676
677 pub fn short_name(&self) -> &str {
678 match self {
679 Self::UnknownParticle => "x",
680 Self::Gamma => "g",
681 Self::Positron => "ep",
682 Self::Electron => "em",
683 Self::Neutrino => "nu",
684 Self::MuonPlus => "mup",
685 Self::MuonMinus => "mum",
686 Self::Pi0 => "pi0",
687 Self::PiPlus => "pip",
688 Self::PiMinus => "pim",
689 Self::KLong => "kl",
690 Self::KPlus => "kp",
691 Self::KMinus => "km",
692 Self::Neutron => "n",
693 Self::Proton => "prot",
694 Self::AntiProton => "antip",
695 Self::KShort => "ks",
696 Self::Eta => "eta",
697 Self::Lambda => "lamb",
698 Self::SigmaPlus => "sigp",
699 Self::Sigma0 => "sig0",
700 Self::SigmaMinus => "sigm",
701 Self::Xi0 => "xi0",
702 Self::XiMinus => "xim",
703 Self::OmegaMinus => "omegam",
704 Self::AntiNeutron => "antin",
705 Self::AntiLambda => "antilamb",
706 Self::AntiSigmaMinus => "antisigm",
707 Self::AntiSigma0 => "antisig0",
708 Self::AntiSigmaPlus => "antisigp",
709 Self::AntiXi0 => "antixi0",
710 Self::AntiXiPlus => "antixip",
711 Self::AntiOmegaPlus => "antiomegap",
712 Self::Deuteron => "d",
713 Self::Triton => "tri",
714 Self::Helium => "he",
715 Self::Geantino => "geant",
716 Self::He3 => "he3",
717 Self::GammaOptical => "gammaoptical",
718 Self::Li6 => "li6",
719 Self::Li7 => "li7",
720 Self::Be7 => "be7",
721 Self::Be9 => "be9",
722 Self::B10 => "b10",
723 Self::B11 => "b11",
724 Self::C12 => "c12",
725 Self::N14 => "n14",
726 Self::O16 => "o16",
727 Self::F19 => "f19",
728 Self::Ne20 => "ne20",
729 Self::Na23 => "na23",
730 Self::Mg24 => "mg24",
731 Self::Al27 => "al27",
732 Self::Si28 => "si28",
733 Self::P31 => "p31",
734 Self::S32 => "s32",
735 Self::Cl35 => "cl35",
736 Self::Ar36 => "ar36",
737 Self::K39 => "k39",
738 Self::Ca40 => "ca40",
739 Self::Sc45 => "sc45",
740 Self::Ti48 => "ti48",
741 Self::V51 => "v51",
742 Self::Cr52 => "cr52",
743 Self::Mn55 => "mn55",
744 Self::Fe56 => "fe56",
745 Self::Co59 => "co59",
746 Self::Ni58 => "ni58",
747 Self::Cu63 => "cu63",
748 Self::Zn64 => "zn64",
749 Self::Ge74 => "ge74",
750 Self::Se80 => "se80",
751 Self::Kr84 => "kr84",
752 Self::Sr88 => "sr88",
753 Self::Zr90 => "zr90",
754 Self::Mo98 => "mo98",
755 Self::Pd106 => "pd106",
756 Self::Cd114 => "cd114",
757 Self::Sn120 => "sn120",
758 Self::Xe132 => "xe132",
759 Self::Ba138 => "ba138",
760 Self::Ce140 => "ce140",
761 Self::Sm152 => "sm152",
762 Self::Dy164 => "dy164",
763 Self::Yb174 => "yb174",
764 Self::W184 => "w184",
765 Self::Pt194 => "pt194",
766 Self::Au197 => "au197",
767 Self::Hg202 => "hg202",
768 Self::Pb208 => "pb208",
769 Self::U238 => "u238",
770 Self::Ta181 => "ta181",
771 Self::Rho0 => "Rho0",
772 Self::RhoPlus => "RhoPlus",
773 Self::RhoMinus => "RhoMinus",
774 Self::omega => "omega",
775 Self::phiMeson => "phi",
776 Self::EtaPrime => "etapr",
777 Self::a0_980 => "a0_980",
778 Self::f0_980 => "f0_980",
779 Self::KStar_892_0 => "KStar_892_0",
780 Self::KStar_892_Plus => "KStar_892_Plus",
781 Self::KStar_892_Minus => "KStar_892_Minus",
782 Self::AntiKStar_892_0 => "AntiKStar_892_0",
783 Self::K1_1400_Plus => "K1_1400_Plus",
784 Self::K1_1400_Minus => "K1_1400_Minus",
785 Self::b1_1235_Plus => "b1_1235_Plus",
786 Self::Sigma_1385_Minus => "Sigma_1385_Minus",
787 Self::Sigma_1385_0 => "Sigma_1385_0",
788 Self::Sigma_1385_Plus => "Sigma_1385_Plus",
789 Self::Jpsi => "jpsi",
790 Self::Eta_c => "etac",
791 Self::Chi_c0 => "chic0",
792 Self::Chi_c1 => "chic1",
793 Self::Chi_c2 => "chic2",
794 Self::Psi2s => "psi2s",
795 Self::D0 => "d0",
796 Self::DPlus => "dp",
797 Self::Dstar0 => "ds0",
798 Self::DstarPlus => "dsp",
799 Self::Lambda_c => "lambc",
800 Self::AntiD0 => "antid0",
801 Self::DMinus => "dm",
802 Self::DstarMinus => "dsm",
803 Self::Sigma_cPlusPlus => "sigcpp",
804 Self::DeltaPlusPlus => "DeltaPlusPlus",
805 }
806 }
807
808 pub fn from_string(particle_name: &str) -> Self {
809 match particle_name {
810 "Photon" => Self::Gamma,
811 "Positron" => Self::Positron,
812 "Electron" => Self::Electron,
813 "Neutrino" => Self::Neutrino,
814 "Muon+" => Self::MuonPlus,
815 "Muon-" => Self::MuonMinus,
816 "Pi0" => Self::Pi0,
817 "Pi+" => Self::PiPlus,
818 "Pi-" => Self::PiMinus,
819 "KLong" => Self::KLong,
820 "K+" => Self::KPlus,
821 "K-" => Self::KMinus,
822 "Neutron" => Self::Neutron,
823 "Proton" => Self::Proton,
824 "AntiProton" => Self::AntiProton,
825 "KShort" => Self::KShort,
826 "Eta" => Self::Eta,
827 "Lambda" => Self::Lambda,
828 "Sigma+" => Self::SigmaPlus,
829 "Sigma0" => Self::Sigma0,
830 "Sigma-" => Self::SigmaMinus,
831 "Xi0" => Self::Xi0,
832 "Xi-" => Self::XiMinus,
833 "Omega-" => Self::OmegaMinus,
834 "AntiNeutron" => Self::AntiNeutron,
835 "AntiLambda" => Self::AntiLambda,
836 "AntiSigma-" => Self::AntiSigmaMinus,
837 "AntiSigma0" => Self::AntiSigma0,
838 "AntiSigma+" => Self::AntiSigmaPlus,
839 "AntiXi0" => Self::AntiXi0,
840 "AntiXi+" => Self::AntiXiPlus,
841 "AntiOmega+" => Self::AntiOmegaPlus,
842 "Deuteron" => Self::Deuteron,
843 "Triton" => Self::Triton,
844 "Helium" => Self::Helium,
845 "Geantino" => Self::Geantino,
846 "Helium-3" => Self::He3,
847 "GammaOptical" => Self::GammaOptical,
848 "Lithium-6" => Self::Li6,
849 "Lithium-7" => Self::Li7,
850 "Beryllium-7" => Self::Be7,
851 "Beryllium-9" => Self::Be9,
852 "Boron-10" => Self::B10,
853 "Boron-11" => Self::B11,
854 "Carbon" => Self::C12,
855 "Nitrogen" => Self::N14,
856 "Oxygen" => Self::O16,
857 "Flourine" => Self::F19,
858 "Neon" => Self::Ne20,
859 "Sodium" => Self::Na23,
860 "Magnesium" => Self::Mg24,
861 "Aluminum" => Self::Al27,
862 "Silicon" => Self::Si28,
863 "Phosphorous" => Self::P31,
864 "Sulfur" => Self::S32,
865 "Argon" => Self::Ar36,
866 "Potassium" => Self::K39,
867 "Calcium" => Self::Ca40,
868 "Scandium" => Self::Sc45,
869 "Titanium" => Self::Ti48,
870 "Vanadium" => Self::V51,
871 "Chromium" => Self::Cr52,
872 "Manganese" => Self::Mn55,
873 "Iron" => Self::Fe56,
874 "Cobalt" => Self::Co59,
875 "Nickel" => Self::Ni58,
876 "Copper" => Self::Cu63,
877 "Zinc" => Self::Zn64,
878 "Germanium" => Self::Ge74,
879 "Selenium" => Self::Se80,
880 "Krypton" => Self::Kr84,
881 "Strontium" => Self::Sr88,
882 "Zirconium" => Self::Zr90,
883 "Molybdenum" => Self::Mo98,
884 "Palladium" => Self::Pd106,
885 "Cadmium" => Self::Cd114,
886 "Tin" => Self::Sn120,
887 "Xenon" => Self::Xe132,
888 "Barium" => Self::Ba138,
889 "Cesium" => Self::Ce140,
890 "Samerium" => Self::Sm152,
891 "Dysprosium" => Self::Dy164,
892 "Ytterbium" => Self::Yb174,
893 "Tungsten" => Self::W184,
894 "Platinum" => Self::Pt194,
895 "Gold" => Self::Au197,
896 "Mercury" => Self::Hg202,
897 "Lead" => Self::Pb208,
898 "Uranium" => Self::U238,
899 "Tantalum" => Self::Ta181,
900 "Rho0" => Self::Rho0,
901 "Rho+" => Self::RhoPlus,
902 "Rho-" => Self::RhoMinus,
903 "Omega" => Self::omega,
904 "EtaPrime" => Self::EtaPrime,
905 "Phi" => Self::phiMeson,
906 "a0(980)" => Self::a0_980,
907 "f0(980)" => Self::f0_980,
908 "K*(892)0" => Self::KStar_892_0,
909 "K*(892)+" => Self::KStar_892_Plus,
910 "K*(892)-" => Self::KStar_892_Minus,
911 "antiK*(892)0" => Self::AntiKStar_892_0,
912 "K1(1400)+" => Self::K1_1400_Plus,
913 "K1(1400)-" => Self::K1_1400_Minus,
914 "b1(1235)+" => Self::b1_1235_Plus,
915 "Sigma(1385)+" => Self::Sigma_1385_Plus,
916 "Sigma(1385)0" => Self::Sigma_1385_0,
917 "Sigma(1385)-" => Self::Sigma_1385_Minus,
918 "Jpsi" => Self::Jpsi,
919 "EtaC" => Self::Eta_c,
920 "ChiC0" => Self::Chi_c0,
921 "ChiC1" => Self::Chi_c1,
922 "ChiC2" => Self::Chi_c2,
923 "Psi(2S)" => Self::Psi2s,
924 "D0" => Self::D0,
925 "AntiD0" => Self::AntiD0,
926 "D+" => Self::DPlus,
927 "D-" => Self::DMinus,
928 "D*0" => Self::Dstar0,
929 "D*+" => Self::DstarPlus,
930 "D*-" => Self::DstarMinus,
931 "LambdaC" => Self::Lambda_c,
932 "SigmaC++" => Self::Sigma_cPlusPlus,
933 "Delta++" => Self::DeltaPlusPlus,
934 _ => Self::UnknownParticle,
935 }
936 }
937
938 pub fn is_fixed_mass(&self) -> bool {
939 !matches!(
940 self,
941 Self::Rho0
942 | Self::RhoPlus
943 | Self::RhoMinus
944 | Self::omega
945 | Self::phiMeson
946 | Self::EtaPrime
947 | Self::a0_980
948 | Self::f0_980
949 | Self::KStar_892_0
950 | Self::KStar_892_Plus
951 | Self::KStar_892_Minus
952 | Self::AntiKStar_892_0
953 | Self::K1_1400_Plus
954 | Self::K1_1400_Minus
955 | Self::b1_1235_Plus
956 | Self::Sigma_1385_Minus
957 | Self::Sigma_1385_0
958 | Self::Sigma_1385_Plus
959 | Self::Eta_c
960 | Self::Chi_c0
961 | Self::DeltaPlusPlus
962 )
963 }
964
965 pub fn is_resonance(&self) -> bool {
966 if self.is_fixed_mass() {
967 return false;
968 }
969 !matches!(self, Self::UnknownParticle | Self::phiMeson | Self::omega)
970 }
971
972 pub fn is_detached_vertex(&self) -> bool {
973 matches!(
974 self,
975 Self::MuonPlus
976 | Self::MuonMinus
977 | Self::PiPlus
978 | Self::PiMinus
979 | Self::KShort
980 | Self::KLong
981 | Self::KPlus
982 | Self::KMinus
983 | Self::Neutron
984 | Self::Lambda
985 | Self::SigmaPlus
986 | Self::SigmaMinus
987 | Self::Xi0
988 | Self::XiMinus
989 | Self::OmegaMinus
990 | Self::AntiNeutron
991 | Self::AntiLambda
992 | Self::AntiSigmaMinus
993 | Self::AntiSigmaPlus
994 | Self::AntiXi0
995 | Self::AntiXiPlus
996 | Self::AntiOmegaPlus
997 | Self::Deuteron
998 | Self::Triton
999 | Self::Helium
1000 | Self::He3
1001 )
1002 }
1003
1004 pub fn particle_name_root(&self) -> &str {
1005 match self {
1006 Particle::UnknownParticle => "X",
1007 Particle::Gamma => "#gamma",
1008 Particle::Positron => "e^{#plus}",
1009 Particle::Electron => "e^{#minus}",
1010 Particle::Neutrino => "#nu",
1011 Particle::MuonPlus => "#mu^{#plus}",
1012 Particle::MuonMinus => "#mu^{#minus}",
1013 Particle::Pi0 => "#pi^{0}",
1014 Particle::PiPlus => "#pi^{#plus}",
1015 Particle::PiMinus => "#pi^{#minus}",
1016 Particle::KLong => "K^{0}_{L}",
1017 Particle::KPlus => "K^{#plus}",
1018 Particle::KMinus => "K^{#minus}",
1019 Particle::Neutron => "n",
1020 Particle::Proton => "p",
1021 Particle::AntiProton => "#bar{p}",
1022 Particle::KShort => "K^{0}_{S}",
1023 Particle::Eta => "#eta",
1024 Particle::Lambda => "#Lambda",
1025 Particle::SigmaPlus => "#Sigma^{#plus}",
1026 Particle::Sigma0 => "#Sigma^{0}",
1027 Particle::SigmaMinus => "#Sigma^{#minus}",
1028 Particle::Xi0 => "#Xi^{0}",
1029 Particle::XiMinus => "#Xi^{#minus}",
1030 Particle::OmegaMinus => "#Omega^{#minus}",
1031 Particle::AntiNeutron => "#bar{n}", Particle::AntiLambda => "#bar{#Lambda}", Particle::AntiSigmaMinus => "#bar{#Sigma}^{#minus}",
1034 Particle::AntiSigma0 => "#bar{#Sigma}^{0}",
1035 Particle::AntiSigmaPlus => "#bar{#Sigma}^{#plus}",
1036 Particle::AntiXi0 => "#bar{#Xi}^{0}",
1037 Particle::AntiXiPlus => "#bar{#Xi}^{#plus}",
1038 Particle::AntiOmegaPlus => "#bar{#Omega}^{#plus}",
1039 Particle::Deuteron => "d",
1040 Particle::Triton => "t",
1041 Particle::Helium => "He",
1042 Particle::Geantino => "geantino",
1043 Particle::He3 => "^{3}He",
1044 Particle::GammaOptical => "#gamma_{optical}",
1045 Particle::Li6 => "^{6}Li",
1046 Particle::Li7 => "^{7}Li",
1047 Particle::Be7 => "^{7}Be",
1048 Particle::Be9 => "^{9}Be",
1049 Particle::B10 => "^{10}B",
1050 Particle::B11 => "^{11}B",
1051 Particle::C12 => "^{12}C",
1052 Particle::N14 => "^{14}N",
1053 Particle::O16 => "^{16}O",
1054 Particle::F19 => "^{19}F",
1055 Particle::Ne20 => "^{20}Ne",
1056 Particle::Na23 => "^{23}Na",
1057 Particle::Mg24 => "^{23}Mg",
1058 Particle::Al27 => "^{27}Al",
1059 Particle::Si28 => "^{28}Si",
1060 Particle::P31 => "^{31}P",
1061 Particle::S32 => "^{32}S",
1062 Particle::Cl35 => "^{35}Cl",
1063 Particle::Ar36 => "^{36}Ar",
1064 Particle::K39 => "^{39}K",
1065 Particle::Ca40 => "^{40}Ca",
1066 Particle::Sc45 => "^{45}Sc",
1067 Particle::Ti48 => "^{48}Ti",
1068 Particle::V51 => "^{51}V",
1069 Particle::Cr52 => "^{52}Cr",
1070 Particle::Mn55 => "^{55}Mn",
1071 Particle::Fe56 => "^{56}Fe",
1072 Particle::Co59 => "^{59}Co",
1073 Particle::Ni58 => "^{58}Ni",
1074 Particle::Cu63 => "^{63}Cu",
1075 Particle::Zn64 => "^{64}Zn",
1076 Particle::Ge74 => "^{74}Ge",
1077 Particle::Se80 => "^{80}Se",
1078 Particle::Kr84 => "^{84}Kr",
1079 Particle::Sr88 => "^{88}Sr",
1080 Particle::Zr90 => "^{90}Zr",
1081 Particle::Mo98 => "^{98}Mo",
1082 Particle::Pd106 => "^{106}Pd",
1083 Particle::Cd114 => "^{114}Cd",
1084 Particle::Sn120 => "^{120}Sn",
1085 Particle::Xe132 => "^{132}Xe",
1086 Particle::Ba138 => "^{138}Ba",
1087 Particle::Ce140 => "^{140}Ce",
1088 Particle::Sm152 => "^{152}Sm",
1089 Particle::Dy164 => "^{164}Dy",
1090 Particle::Yb174 => "^{174}Yb",
1091 Particle::W184 => "^{184}W",
1092 Particle::Pt194 => "^{194}Pt",
1093 Particle::Au197 => "^{197}Au",
1094 Particle::Hg202 => "^{202}Hg",
1095 Particle::Pb208 => "^{208}Pb",
1096 Particle::U238 => "^{238}U",
1097 Particle::Ta181 => "^{181}Ta",
1098 Particle::Rho0 => "#rho^{0}",
1099 Particle::RhoPlus => "#rho^{#plus}",
1100 Particle::RhoMinus => "#rho^{#minus}",
1101 Particle::omega => "#omega",
1102 Particle::phiMeson => "#phi",
1103 Particle::EtaPrime => "#eta'",
1104 Particle::a0_980 => "a_{0}(980)",
1105 Particle::f0_980 => "f_{0}(980)",
1106 Particle::KStar_892_0 => "K*(892)^{0}",
1107 Particle::KStar_892_Plus => "K*(892)^{#plus}",
1108 Particle::KStar_892_Minus => "K*(892)^{#minus}",
1109 Particle::AntiKStar_892_0 => "#bar{K*}(892)^{0}",
1110 Particle::K1_1400_Plus => "K_{1}(1400)^{#plus}",
1111 Particle::K1_1400_Minus => "K_{1}(1400)^{#minus}",
1112 Particle::b1_1235_Plus => "b_{1}(1235)^{#plus}",
1113 Particle::Sigma_1385_Minus => "#Sigma(1385)^{#minus}",
1114 Particle::Sigma_1385_0 => "#Sigma(1385)^{0}",
1115 Particle::Sigma_1385_Plus => "#Sigma(1385)^{#plus}",
1116 Particle::Jpsi => "J/#psi",
1117 Particle::Eta_c => "#eta_{c}",
1118 Particle::Chi_c0 => "#chi_{c0}",
1119 Particle::Chi_c1 => "#chi_{c1}",
1120 Particle::Chi_c2 => "#chi_{c2}",
1121 Particle::Psi2s => "#psi(2S)",
1122 Particle::D0 => "D^{0}",
1123 Particle::DPlus => "D^{#plus}", Particle::Dstar0 => "D^{*0}",
1125 Particle::DstarPlus => "D^{*#plus}", Particle::Lambda_c => "#Lambda_{c}",
1127 Particle::AntiD0 => "#bar{D^{0}}",
1128 Particle::DMinus => "D^{#minus}", Particle::DstarMinus => "D^{*#minus}", Particle::Sigma_cPlusPlus => "#Sigma_{c}^{#plus#plus}", Particle::DeltaPlusPlus => "#Delta(1232)^{#plus#plus}",
1132 }
1133 }
1134
1135 pub fn particle_mass(&self) -> f64 {
1136 match self {
1137 Self::UnknownParticle => f64::MAX,
1138 Self::Gamma => 0.0,
1139 Self::Positron => 0.000510998928,
1140 Self::Electron => 0.000510998928,
1141 Self::Neutrino => 0.0,
1142 Self::MuonPlus => 0.1056583715,
1143 Self::MuonMinus => 0.1056583715,
1144 Self::Pi0 => 0.1349766,
1145 Self::PiPlus => 0.13957018,
1146 Self::PiMinus => 0.13957018,
1147 Self::KShort => 0.497614,
1148 Self::KLong => 0.497614,
1149 Self::KPlus => 0.493677,
1150 Self::KMinus => 0.493677,
1151 Self::Neutron => 0.939565379,
1152 Self::Proton => 0.938272046,
1153 Self::AntiProton => 0.938272046,
1154 Self::Eta => 0.547862,
1155 Self::Lambda => 1.115683,
1156 Self::SigmaPlus => 1.18937,
1157 Self::Sigma0 => 1.192642,
1158 Self::SigmaMinus => 1.197449,
1159 Self::Xi0 => 1.31486,
1160 Self::XiMinus => 1.32171,
1161 Self::OmegaMinus => 1.67245,
1162 Self::AntiNeutron => 0.939565379,
1163 Self::AntiLambda => 1.115683,
1164 Self::AntiSigmaMinus => 1.18937,
1165 Self::AntiSigma0 => 1.192642,
1166 Self::AntiSigmaPlus => 1.197449,
1167 Self::AntiXi0 => 1.31486,
1168 Self::AntiXiPlus => 1.32171,
1169 Self::AntiOmegaPlus => 1.67245,
1170 Self::Geantino => 0.0,
1171 Self::GammaOptical => 0.0,
1172 Self::Rho0 => 0.7690, Self::RhoPlus => 0.7665, Self::RhoMinus => 0.7665,
1175 Self::omega => 0.78265,
1176 Self::EtaPrime => 0.95778,
1177 Self::phiMeson => 1.019455,
1178 Self::a0_980 => 0.980,
1179 Self::f0_980 => 0.990,
1180 Self::KStar_892_0 => 0.89581, Self::KStar_892_Plus => 0.89166, Self::KStar_892_Minus => 0.89166, Self::AntiKStar_892_0 => 0.89581, Self::K1_1400_Plus => 1.403,
1185 Self::K1_1400_Minus => 1.403,
1186 Self::b1_1235_Plus => 1.2295,
1187 Self::Deuteron => 1.875612859, Self::Triton => 2.808921004, Self::Helium => 3.727379238, Self::He3 => 2.809413498,
1191 Self::Li6 => 5.60305,
1192 Self::Li7 => 6.53536,
1193 Self::Be7 => 6.53622,
1194 Self::Be9 => 8.39479,
1195 Self::B10 => 9.32699,
1196 Self::B11 => 10.25510,
1197 Self::C12 => 11.17793,
1198 Self::N14 => 13.04378,
1199 Self::O16 => 14.89917,
1200 Self::F19 => 17.69690,
1201 Self::Ne20 => 18.62284,
1202 Self::Na23 => 21.41483,
1203 Self::Mg24 => 22.34193,
1204 Self::Al27 => 25.13314,
1205 Self::Si28 => 26.06034,
1206 Self::P31 => 28.85188,
1207 Self::S32 => 29.78180,
1208 Self::Cl35 => 32.57328,
1209 Self::Ar36 => 33.50356,
1210 Self::K39 => 36.29447,
1211 Self::Ca40 => 37.22492,
1212 Self::Sc45 => 41.87617,
1213 Self::Ti48 => 44.66324,
1214 Self::V51 => 47.45401,
1215 Self::Cr52 => 48.38228,
1216 Self::Mn55 => 51.17447,
1217 Self::Fe56 => 52.10307,
1218 Self::Co59 => 54.89593,
1219 Self::Ni58 => 53.96644,
1220 Self::Cu63 => 58.61856,
1221 Self::Zn64 => 59.54963,
1222 Self::Ge74 => 68.85715,
1223 Self::Se80 => 74.44178,
1224 Self::Kr84 => 78.16309,
1225 Self::Sr88 => 81.88358,
1226 Self::Zr90 => 83.74571,
1227 Self::Mo98 => 91.19832,
1228 Self::Pd106 => 98.64997,
1229 Self::Cd114 => 106.10997,
1230 Self::Sn120 => 111.68821,
1231 Self::Xe132 => 122.86796,
1232 Self::Ba138 => 128.45793,
1233 Self::Ce140 => 130.32111,
1234 Self::Sm152 => 141.51236,
1235 Self::Dy164 => 152.69909,
1236 Self::Yb174 => 162.02245,
1237 Self::Ta181 => 180.94788,
1238 Self::W184 => 171.34924,
1239 Self::Pt194 => 180.67513,
1240 Self::Au197 => 183.47324,
1241 Self::Hg202 => 188.13451,
1242 Self::Pb208 => 193.72899, Self::U238 => 221.74295,
1244 Self::Sigma_1385_Minus => 1.3872,
1245 Self::Sigma_1385_0 => 1.3837,
1246 Self::Sigma_1385_Plus => 1.38280,
1247 Self::DeltaPlusPlus => 1.232,
1248 Self::Jpsi => 3.069916,
1249 Self::Eta_c => 2.9836,
1250 Self::Chi_c0 => 3.41475,
1251 Self::Chi_c1 => 3.51066,
1252 Self::Chi_c2 => 3.55620,
1253 Self::Psi2s => 3.686109,
1254 Self::D0 => 1.86484,
1255 Self::AntiD0 => 1.86484,
1256 Self::DPlus => 1.86961,
1257 Self::DMinus => 1.86961,
1258 Self::Dstar0 => 2.00685,
1259 Self::DstarPlus => 2.01026,
1260 Self::DstarMinus => 2.01026,
1261 Self::Lambda_c => 2.28646,
1262 Self::Sigma_cPlusPlus => 2.45397,
1263 }
1264 }
1265
1266 pub fn particle_charge(&self) -> isize {
1267 match self {
1268 Self::UnknownParticle => 0,
1269 Self::Gamma => 0,
1270 Self::Positron => 1,
1271 Self::Electron => -1,
1272 Self::Neutrino => 0,
1273 Self::MuonPlus => 1,
1274 Self::MuonMinus => -1,
1275 Self::Pi0 => 0,
1276 Self::PiPlus => 1,
1277 Self::PiMinus => -1,
1278 Self::KShort => 0,
1279 Self::KLong => 0,
1280 Self::KPlus => 1,
1281 Self::KMinus => -1,
1282 Self::Neutron => 0,
1283 Self::Proton => 1,
1284 Self::AntiProton => -1,
1285 Self::Eta => 0,
1286 Self::Lambda => 0,
1287 Self::SigmaPlus => 1,
1288 Self::Sigma0 => 0,
1289 Self::SigmaMinus => -1,
1290 Self::Xi0 => 0,
1291 Self::XiMinus => -1,
1292 Self::OmegaMinus => -1,
1293 Self::AntiNeutron => 0,
1294 Self::AntiLambda => 0,
1295 Self::AntiSigmaMinus => -1,
1296 Self::AntiSigma0 => 0,
1297 Self::AntiSigmaPlus => 1,
1298 Self::AntiXi0 => 0,
1299 Self::AntiXiPlus => 1,
1300 Self::AntiOmegaPlus => 1,
1301 Self::Geantino => 0,
1302 Self::GammaOptical => 0,
1303 Self::Rho0 => 0,
1304 Self::RhoPlus => 1,
1305 Self::RhoMinus => -1,
1306 Self::omega => 0,
1307 Self::EtaPrime => 0,
1308 Self::phiMeson => 0,
1309 Self::a0_980 => 0,
1310 Self::f0_980 => 0,
1311 Self::KStar_892_0 => 0,
1312 Self::KStar_892_Plus => 1,
1313 Self::KStar_892_Minus => -1,
1314 Self::AntiKStar_892_0 => 0,
1315 Self::K1_1400_Plus => 1,
1316 Self::K1_1400_Minus => -1,
1317 Self::b1_1235_Plus => 1,
1318 Self::Deuteron => 1,
1319 Self::Triton => 1,
1320 Self::Helium => 2,
1321 Self::He3 => 2,
1322 Self::Li6 => 3,
1323 Self::Li7 => 3,
1324 Self::Be7 => 4,
1325 Self::Be9 => 4,
1326 Self::B10 => 5,
1327 Self::B11 => 5,
1328 Self::C12 => 6,
1329 Self::N14 => 7,
1330 Self::O16 => 8,
1331 Self::F19 => 9,
1332 Self::Ne20 => 10,
1333 Self::Na23 => 11,
1334 Self::Mg24 => 12,
1335 Self::Al27 => 13,
1336 Self::Si28 => 14,
1337 Self::P31 => 15,
1338 Self::S32 => 16,
1339 Self::Cl35 => 17,
1340 Self::Ar36 => 18,
1341 Self::K39 => 19,
1342 Self::Ca40 => 20,
1343 Self::Sc45 => 21,
1344 Self::Ti48 => 22,
1345 Self::V51 => 23,
1346 Self::Cr52 => 24,
1347 Self::Mn55 => 25,
1348 Self::Fe56 => 26,
1349 Self::Co59 => 27,
1350 Self::Ni58 => 28,
1351 Self::Cu63 => 29,
1352 Self::Zn64 => 30,
1353 Self::Ge74 => 32,
1354 Self::Se80 => 34,
1355 Self::Kr84 => 36,
1356 Self::Sr88 => 38,
1357 Self::Zr90 => 40,
1358 Self::Mo98 => 42,
1359 Self::Pd106 => 46,
1360 Self::Cd114 => 48,
1361 Self::Sn120 => 50,
1362 Self::Xe132 => 54,
1363 Self::Ba138 => 56,
1364 Self::Ce140 => 58,
1365 Self::Sm152 => 62,
1366 Self::Dy164 => 66,
1367 Self::Yb174 => 70,
1368 Self::Ta181 => 73,
1369 Self::W184 => 74,
1370 Self::Pt194 => 78,
1371 Self::Au197 => 79,
1372 Self::Hg202 => 80,
1373 Self::Pb208 => 82,
1374 Self::U238 => 92,
1375 Self::Sigma_1385_Minus => -1,
1376 Self::Sigma_1385_0 => 0,
1377 Self::Sigma_1385_Plus => 1,
1378 Self::DeltaPlusPlus => 2,
1379 Self::Jpsi => 0,
1380 Self::Eta_c => 0,
1381 Self::Chi_c0 => 0,
1382 Self::Chi_c1 => 0,
1383 Self::Chi_c2 => 0,
1384 Self::Psi2s => 0,
1385 Self::D0 => 0,
1386 Self::AntiD0 => 0,
1387 Self::DPlus => 1,
1388 Self::DMinus => -1,
1389 Self::Dstar0 => 0,
1390 Self::DstarPlus => 1,
1391 Self::DstarMinus => -1,
1392 Self::Lambda_c => 1,
1393 Self::Sigma_cPlusPlus => 2,
1394 }
1395 }
1396
1397 pub fn to_pdg(&self) -> isize {
1398 match self {
1399 Self::UnknownParticle => 0,
1400 Self::Gamma => 22,
1401 Self::Positron => -11,
1402 Self::Electron => 11,
1403 Self::Neutrino => 121416,
1404 Self::MuonPlus => -13,
1405 Self::MuonMinus => 13,
1406 Self::Pi0 => 111,
1407 Self::PiPlus => 211,
1408 Self::PiMinus => -211,
1409 Self::KShort => 310,
1410 Self::KLong => 130,
1411 Self::KPlus => 321,
1412 Self::KMinus => -321,
1413 Self::Neutron => 2112,
1414 Self::Proton => 2212,
1415 Self::AntiProton => -2212,
1416 Self::Eta => 221,
1417 Self::Lambda => 3122,
1418 Self::SigmaPlus => 3222,
1419 Self::Sigma0 => 3212,
1420 Self::SigmaMinus => 3112,
1421 Self::Xi0 => 3322,
1422 Self::XiMinus => 3312,
1423 Self::OmegaMinus => 3334,
1424 Self::AntiNeutron => -2112,
1425 Self::AntiLambda => -3122,
1426 Self::AntiSigmaMinus => -3222,
1427 Self::AntiSigma0 => -3212,
1428 Self::AntiSigmaPlus => -3112,
1429 Self::AntiXi0 => -3322,
1430 Self::AntiXiPlus => -3312,
1431 Self::AntiOmegaPlus => -3334,
1432 Self::Geantino => 0,
1433 Self::GammaOptical => -22,
1434 Self::Rho0 => 113,
1435 Self::RhoPlus => 213,
1436 Self::RhoMinus => -213,
1437 Self::omega => 223,
1438 Self::EtaPrime => 331,
1439 Self::phiMeson => 333,
1440 Self::a0_980 => 9000110,
1441 Self::f0_980 => 9010221,
1442 Self::KStar_892_0 => 313,
1443 Self::AntiKStar_892_0 => -313,
1444 Self::KStar_892_Plus => 323,
1445 Self::KStar_892_Minus => -323,
1446 Self::K1_1400_Plus => 20323,
1447 Self::K1_1400_Minus => -20323,
1448 Self::b1_1235_Plus => 10213,
1449 Self::Sigma_1385_Minus => 3114,
1450 Self::Sigma_1385_0 => 3214,
1451 Self::Sigma_1385_Plus => 3224,
1452 Self::Deuteron => 1000010020,
1453 Self::Triton => 1000010030,
1454 Self::He3 => 1000020030,
1455 Self::Helium => 1000020040,
1456 Self::Li6 => 1000030060,
1457 Self::Li7 => 1000030070,
1458 Self::Be7 => 1000040070,
1459 Self::Be9 => 1000040090,
1460 Self::B10 => 1000050100,
1461 Self::B11 => 1000050110,
1462 Self::C12 => 1000060120,
1463 Self::N14 => 1000070140,
1464 Self::O16 => 1000080160,
1465 Self::F19 => 1000090190,
1466 Self::Ne20 => 1000100200,
1467 Self::Na23 => 1000110230,
1468 Self::Mg24 => 1000120240,
1469 Self::Al27 => 1000130270,
1470 Self::Si28 => 1000140280,
1471 Self::P31 => 1000150310,
1472 Self::S32 => 1000160320,
1473 Self::Cl35 => 1000170350,
1474 Self::Ar36 => 1000180360,
1475 Self::K39 => 1000190390,
1476 Self::Ca40 => 1000200400,
1477 Self::Sc45 => 1000210450,
1478 Self::Ti48 => 1000220480,
1479 Self::V51 => 1000230510,
1480 Self::Cr52 => 1000240520,
1481 Self::Mn55 => 1000250550,
1482 Self::Fe56 => 1000260560,
1483 Self::Co59 => 1000270590,
1484 Self::Ni58 => 1000280580,
1485 Self::Cu63 => 1000290630,
1486 Self::Zn64 => 1000300640,
1487 Self::Ge74 => 1000320740,
1488 Self::Se80 => 1000340800,
1489 Self::Kr84 => 1000360840,
1490 Self::Sr88 => 1000380880,
1491 Self::Zr90 => 1000400900,
1492 Self::Mo98 => 1000420980,
1493 Self::Pd106 => 1000461060,
1494 Self::Cd114 => 1000481140,
1495 Self::Sn120 => 1000501200,
1496 Self::Xe132 => 1000541320,
1497 Self::Ba138 => 1000561380,
1498 Self::Ce140 => 1000581400,
1499 Self::Sm152 => 1000621520,
1500 Self::Dy164 => 1000661640,
1501 Self::Yb174 => 1000701740,
1502 Self::Ta181 => 1000731810,
1503 Self::W184 => 1000741840,
1504 Self::Pt194 => 1000781940,
1505 Self::Au197 => 1000791970,
1506 Self::Hg202 => 1000802020,
1507 Self::Pb208 => 1000822080,
1508 Self::U238 => 1000922380,
1509 Self::DeltaPlusPlus => 2224,
1510 Self::Jpsi => 443,
1511 Self::Eta_c => 441,
1512 Self::Chi_c0 => 10441,
1513 Self::Chi_c1 => 20443,
1514 Self::Chi_c2 => 445,
1515 Self::Psi2s => 100443,
1516 Self::D0 => 421,
1517 Self::AntiD0 => -421,
1518 Self::DPlus => 411,
1519 Self::DMinus => -411,
1520 Self::Dstar0 => 423,
1521 Self::DstarPlus => 413,
1522 Self::DstarMinus => -413,
1523 Self::Lambda_c => 4122,
1524 Self::Sigma_cPlusPlus => 4222,
1525 }
1526 }
1527
1528 pub fn from_pdg(pdgid: isize) -> Self {
1529 match pdgid {
1530 0 => Self::UnknownParticle,
1531 22 => Self::Gamma,
1532 -11 => Self::Positron,
1533 11 => Self::Electron,
1534 121416 => Self::Neutrino,
1535 -13 => Self::MuonPlus,
1536 13 => Self::MuonMinus,
1537 111 => Self::Pi0,
1538 211 => Self::PiPlus,
1539 -211 => Self::PiMinus,
1540 310 => Self::KShort,
1541 130 => Self::KLong,
1542 321 => Self::KPlus,
1543 -321 => Self::KMinus,
1544 2112 => Self::Neutron,
1545 2212 => Self::Proton,
1546 -2212 => Self::AntiProton,
1547 221 => Self::Eta,
1548 3122 => Self::Lambda,
1549 3222 => Self::SigmaPlus,
1550 3212 => Self::Sigma0,
1551 3112 => Self::SigmaMinus,
1552 3322 => Self::Xi0,
1553 3312 => Self::XiMinus,
1554 3334 => Self::OmegaMinus,
1555 -2112 => Self::AntiNeutron,
1556 -3122 => Self::AntiLambda,
1557 -3222 => Self::AntiSigmaMinus,
1558 -3212 => Self::AntiSigma0,
1559 -3112 => Self::AntiSigmaPlus,
1560 -3322 => Self::AntiXi0,
1561 -3312 => Self::AntiXiPlus,
1562 -3334 => Self::AntiOmegaPlus,
1563 113 => Self::Rho0,
1564 213 => Self::RhoPlus,
1565 -213 => Self::RhoMinus,
1566 223 => Self::omega,
1567 331 => Self::EtaPrime,
1568 333 => Self::phiMeson,
1569 9000110 => Self::a0_980,
1570 9010221 => Self::f0_980,
1571 313 => Self::KStar_892_0,
1572 -313 => Self::AntiKStar_892_0,
1573 323 => Self::KStar_892_Plus,
1574 -323 => Self::KStar_892_Minus,
1575 20323 => Self::K1_1400_Plus,
1576 -20323 => Self::K1_1400_Minus,
1577 10213 => Self::b1_1235_Plus,
1578 3114 => Self::Sigma_1385_Minus,
1579 3214 => Self::Sigma_1385_0,
1580 3224 => Self::Sigma_1385_Plus,
1581 1000010020 => Self::Deuteron,
1582 1000010030 => Self::Triton,
1583 1000020030 => Self::He3,
1584 1000020040 => Self::Helium,
1585 1000030060 => Self::Li6,
1586 1000030070 => Self::Li7,
1587 1000040070 => Self::Be7,
1588 1000040090 => Self::Be9,
1589 1000050100 => Self::B10,
1590 1000050110 => Self::B11,
1591 1000060120 => Self::C12,
1592 1000070140 => Self::N14,
1593 1000080160 => Self::O16,
1594 1000090190 => Self::F19,
1595 1000100200 => Self::Ne20,
1596 1000110230 => Self::Na23,
1597 1000120240 => Self::Mg24,
1598 1000130270 => Self::Al27,
1599 1000140280 => Self::Si28,
1600 1000150310 => Self::P31,
1601 1000160320 => Self::S32,
1602 1000170350 => Self::Cl35,
1603 1000180360 => Self::Ar36,
1604 1000190390 => Self::K39,
1605 1000200400 => Self::Ca40,
1606 1000210450 => Self::Sc45,
1607 1000220480 => Self::Ti48,
1608 1000230510 => Self::V51,
1609 1000240520 => Self::Cr52,
1610 1000250550 => Self::Mn55,
1611 1000260560 => Self::Fe56,
1612 1000270590 => Self::Co59,
1613 1000280580 => Self::Ni58,
1614 1000290630 => Self::Cu63,
1615 1000300640 => Self::Zn64,
1616 1000320740 => Self::Ge74,
1617 1000340800 => Self::Se80,
1618 1000360840 => Self::Kr84,
1619 1000380880 => Self::Sr88,
1620 1000400900 => Self::Zr90,
1621 1000420980 => Self::Mo98,
1622 1000461060 => Self::Pd106,
1623 1000481140 => Self::Cd114,
1624 1000501200 => Self::Sn120,
1625 1000541320 => Self::Xe132,
1626 1000561380 => Self::Ba138,
1627 1000581400 => Self::Ce140,
1628 1000621520 => Self::Sm152,
1629 1000661640 => Self::Dy164,
1630 1000701740 => Self::Yb174,
1631 1000731810 => Self::Ta181,
1632 1000741840 => Self::W184,
1633 1000781940 => Self::Pt194,
1634 1000791970 => Self::Au197,
1635 1000802020 => Self::Hg202,
1636 1000822080 => Self::Pb208,
1637 1000922380 => Self::U238,
1638 2224 => Self::DeltaPlusPlus,
1639 443 => Self::Jpsi,
1640 441 => Self::Eta_c,
1641 10441 => Self::Chi_c0,
1642 20443 => Self::Chi_c1,
1643 445 => Self::Chi_c2,
1644 100443 => Self::Psi2s,
1645 421 => Self::D0,
1646 -421 => Self::AntiD0,
1647 411 => Self::DPlus,
1648 -411 => Self::DMinus,
1649 423 => Self::Dstar0,
1650 413 => Self::DstarPlus,
1651 -413 => Self::DstarMinus,
1652 4122 => Self::Lambda_c,
1653 4222 => Self::Sigma_cPlusPlus,
1654 _ => Self::UnknownParticle,
1655 }
1656 }
1657
1658 pub fn is_decaying_particle(&self) -> bool {
1659 matches!(
1660 self,
1661 Self::UnknownParticle
1662 | Self::Pi0
1663 | Self::KShort
1664 | Self::Eta
1665 | Self::Lambda
1666 | Self::SigmaPlus
1667 | Self::Sigma0
1668 | Self::SigmaMinus
1669 | Self::Xi0
1670 | Self::XiMinus
1671 | Self::OmegaMinus
1672 | Self::AntiLambda
1673 | Self::AntiSigmaMinus
1674 | Self::AntiSigma0
1675 | Self::AntiSigmaPlus
1676 | Self::AntiXi0
1677 | Self::AntiXiPlus
1678 | Self::AntiOmegaPlus
1679 | Self::Geantino
1680 | Self::GammaOptical
1681 | Self::Rho0
1682 | Self::RhoPlus
1683 | Self::RhoMinus
1684 | Self::omega
1685 | Self::phiMeson
1686 | Self::EtaPrime
1687 | Self::a0_980
1688 | Self::f0_980
1689 | Self::KStar_892_0
1690 | Self::KStar_892_Plus
1691 | Self::KStar_892_Minus
1692 | Self::AntiKStar_892_0
1693 | Self::K1_1400_Plus
1694 | Self::K1_1400_Minus
1695 | Self::b1_1235_Plus
1696 | Self::Sigma_1385_Minus
1697 | Self::Sigma_1385_0
1698 | Self::Sigma_1385_Plus
1699 | Self::Jpsi
1700 | Self::Eta_c
1701 | Self::Chi_c0
1702 | Self::Chi_c1
1703 | Self::Chi_c2
1704 | Self::Psi2s
1705 | Self::D0
1706 | Self::DPlus
1707 | Self::Dstar0
1708 | Self::DstarPlus
1709 | Self::Lambda_c
1710 | Self::AntiD0
1711 | Self::DMinus
1712 | Self::DstarMinus
1713 | Self::Sigma_cPlusPlus
1714 | Self::DeltaPlusPlus
1715 )
1716 }
1717
1718 pub fn is_final_state_particle(&self) -> bool {
1719 !self.is_decaying_particle()
1720 }
1721
1722 pub fn particle_multiplex_power(&self) -> Option<usize> {
1723 match self {
1724 Self::Gamma => Some(0),
1726 Self::Positron => Some(1),
1727 Self::Electron => Some(2),
1728 Self::Neutrino => Some(3),
1729 Self::MuonPlus => Some(4),
1730 Self::MuonMinus => Some(5),
1731 Self::Pi0 => Some(6),
1732 Self::PiPlus => Some(7),
1733 Self::PiMinus => Some(8),
1734 Self::KLong => Some(9),
1735 Self::KPlus => Some(10),
1736 Self::KMinus => Some(11),
1737 Self::Neutron => Some(12),
1738 Self::Proton => Some(13),
1739 Self::AntiProton => Some(14),
1740 Self::AntiNeutron => Some(15),
1741
1742 Self::KShort => Some(0),
1744 Self::Eta => Some(1),
1745 Self::Lambda => Some(2),
1746 Self::SigmaPlus => Some(3),
1747 Self::Sigma0 => Some(4),
1748 Self::SigmaMinus => Some(5),
1749 Self::Xi0 => Some(6),
1750 Self::XiMinus => Some(7),
1751 Self::OmegaMinus => Some(8),
1752 Self::AntiLambda => Some(9),
1753 Self::AntiSigmaMinus => Some(10),
1754 Self::AntiSigma0 => Some(11),
1755 Self::AntiSigmaPlus => Some(12),
1756 Self::AntiXi0 => Some(13),
1757 Self::AntiXiPlus => Some(14),
1758 Self::AntiOmegaPlus => Some(15),
1759 Self::Deuteron => Some(16),
1760 Self::Rho0 => Some(17),
1761 Self::RhoPlus => Some(18),
1762 Self::RhoMinus => Some(19),
1763 Self::omega => Some(20),
1764 Self::EtaPrime => Some(21),
1765 Self::phiMeson => Some(22),
1766 Self::a0_980 => Some(23),
1767 Self::f0_980 => Some(24),
1768 Self::KStar_892_0 => Some(25),
1769 Self::KStar_892_Plus => Some(26),
1770 Self::KStar_892_Minus => Some(27),
1771 Self::AntiKStar_892_0 => Some(28),
1772 Self::K1_1400_Plus => Some(29),
1773 Self::K1_1400_Minus => Some(30),
1774 Self::b1_1235_Plus => Some(31),
1775 Self::Sigma_1385_Minus => Some(32),
1776 Self::Sigma_1385_0 => Some(33),
1777 Self::Sigma_1385_Plus => Some(34),
1778 Self::DeltaPlusPlus => Some(35),
1779 Self::Jpsi => Some(36),
1780 Self::Eta_c => Some(37),
1781 Self::Chi_c0 => Some(38),
1782 Self::Chi_c1 => Some(39),
1783 Self::Chi_c2 => Some(40),
1784 Self::Psi2s => Some(41),
1785 Self::D0 => Some(42),
1786 Self::DPlus => Some(43),
1787 Self::Dstar0 => Some(44),
1788 Self::DstarPlus => Some(45),
1789 Self::Lambda_c => Some(46),
1790 Self::AntiD0 => Some(47),
1791 Self::DMinus => Some(48),
1792 Self::DstarMinus => Some(49),
1793 Self::Sigma_cPlusPlus => Some(50),
1794 _ => None,
1795 }
1796 }
1797
1798 pub fn from_multiplex_power(bit: usize, decaying: bool) -> Self {
1799 if !decaying {
1800 match bit {
1801 0 => Self::Gamma,
1802 1 => Self::Positron,
1803 2 => Self::Electron,
1804 3 => Self::Neutrino,
1805 4 => Self::MuonPlus,
1806 5 => Self::MuonMinus,
1807 6 => Self::Pi0,
1808 7 => Self::PiPlus,
1809 8 => Self::PiMinus,
1810 9 => Self::KLong,
1811 10 => Self::KPlus,
1812 11 => Self::KMinus,
1813 12 => Self::Neutron,
1814 13 => Self::Proton,
1815 14 => Self::AntiProton,
1816 15 => Self::AntiNeutron,
1817 _ => Self::UnknownParticle,
1818 }
1819 } else {
1820 match bit {
1821 0 => Self::KShort,
1822 1 => Self::Eta,
1823 2 => Self::Lambda,
1824 3 => Self::SigmaPlus,
1825 4 => Self::Sigma0,
1826 5 => Self::SigmaMinus,
1827 6 => Self::Xi0,
1828 7 => Self::XiMinus,
1829 8 => Self::OmegaMinus,
1830 9 => Self::AntiLambda,
1831 10 => Self::AntiSigmaMinus,
1832 11 => Self::AntiSigma0,
1833 12 => Self::AntiSigmaPlus,
1834 13 => Self::AntiXi0,
1835 14 => Self::AntiXiPlus,
1836 15 => Self::AntiOmegaPlus,
1837 16 => Self::Deuteron,
1838 17 => Self::Rho0,
1839 18 => Self::RhoPlus,
1840 19 => Self::RhoMinus,
1841 20 => Self::omega,
1842 21 => Self::EtaPrime,
1843 22 => Self::phiMeson,
1844 23 => Self::a0_980,
1845 24 => Self::f0_980,
1846 25 => Self::KStar_892_0,
1847 26 => Self::KStar_892_Plus,
1848 27 => Self::KStar_892_Minus,
1849 28 => Self::AntiKStar_892_0,
1850 29 => Self::K1_1400_Plus,
1851 30 => Self::K1_1400_Minus,
1852 31 => Self::b1_1235_Plus,
1853 32 => Self::Sigma_1385_Minus,
1854 33 => Self::Sigma_1385_0,
1855 34 => Self::Sigma_1385_Plus,
1856 35 => Self::DeltaPlusPlus,
1857 36 => Self::Jpsi,
1858 37 => Self::Eta_c,
1859 38 => Self::Chi_c0,
1860 39 => Self::Chi_c1,
1861 40 => Self::Chi_c2,
1862 41 => Self::Psi2s,
1863 42 => Self::D0,
1864 43 => Self::DPlus,
1865 44 => Self::Dstar0,
1866 45 => Self::DstarPlus,
1867 46 => Self::Lambda_c,
1868 47 => Self::AntiD0,
1869 48 => Self::DMinus,
1870 49 => Self::DstarMinus,
1871 50 => Self::Sigma_cPlusPlus,
1872 _ => Self::UnknownParticle,
1873 }
1874 }
1875 }
1876
1877 pub fn get_charge(&self) -> Charge {
1878 if self.is_unknown() {
1879 return Charge::AllCharges;
1880 }
1881 let charge_value = self.particle_charge();
1882 if charge_value == 0 {
1883 Charge::Neutral
1884 } else if charge_value > 0 {
1885 Charge::Positive
1886 } else if charge_value < 0 {
1887 Charge::Negative
1888 } else {
1889 Charge::AllCharges
1890 }
1891 }
1892
1893 pub fn id_track(charge: f64, mass: f64) -> Particle {
1894 let m_tol = 0.010;
1895 if charge > 0.1 {
1896 if (mass - Self::Triton.particle_mass()).abs() < m_tol {
1897 return Self::Triton;
1898 }
1899
1900 if (mass - Self::Deuteron.particle_mass()).abs() < m_tol {
1901 return Self::Deuteron;
1902 }
1903 if (mass - Self::Proton.particle_mass()).abs() < m_tol {
1904 return Self::Proton;
1905 }
1906 if (mass - Self::PiPlus.particle_mass()).abs() < m_tol {
1907 return Self::PiPlus;
1908 }
1909 if (mass - Self::KPlus.particle_mass()).abs() < m_tol {
1910 return Self::KPlus;
1911 }
1912 if (mass - Self::Positron.particle_mass()).abs() < m_tol {
1913 return Self::Positron;
1914 }
1915 if (mass - Self::MuonPlus.particle_mass()).abs() < m_tol {
1916 return Self::MuonPlus;
1917 }
1918 } else if charge < -0.1 {
1919 if (mass - Self::PiMinus.particle_mass()).abs() < m_tol {
1920 return Self::PiMinus;
1921 }
1922 if (mass - Self::KMinus.particle_mass()).abs() < m_tol {
1923 return Self::KMinus;
1924 }
1925 if (mass - Self::MuonMinus.particle_mass()).abs() < m_tol {
1926 return Self::MuonMinus;
1927 }
1928 if (mass - Self::Electron.particle_mass()).abs() < m_tol {
1929 return Self::Electron;
1930 }
1931 if (mass - Self::AntiProton.particle_mass()).abs() < m_tol {
1932 return Self::AntiProton;
1933 }
1934 } else {
1935 if (mass - Self::Gamma.particle_mass()).abs() < m_tol {
1936 return Self::Gamma;
1937 }
1938 if (mass - Self::Neutron.particle_mass()).abs() < m_tol {
1939 return Self::Neutron;
1940 }
1941 }
1942 Self::UnknownParticle
1943 }
1944}