GCC Code Coverage Report


Directory: ./
File: src/iguana/algorithms/TypeDefs.h
Date: 2025-01-06 17:10:42
Exec Total Coverage
Lines: 0 0 100.0%
Functions: 0 0 -%
Branches: 0 0 -%

Line Branch Exec Source
1 /// @file
2 /// @brief Type definitions for common objects used in algorithms
3 #pragma once
4
5 #include <string>
6 #include <unordered_map>
7
8 namespace iguana {
9
10 /// Vector element type
11 using vector_element_t = double;
12
13 /// 3-momentum type
14 struct Momentum3 {
15 /// @f$x@f$-component
16 vector_element_t px;
17 /// @f$y@f$-component
18 vector_element_t py;
19 /// @f$z@f$-component
20 vector_element_t pz;
21 };
22
23 /// 4-momentum type
24 struct Momentum4 {
25 /// @f$x@f$-component
26 vector_element_t px;
27 /// @f$y@f$-component
28 vector_element_t py;
29 /// @f$z@f$-component
30 vector_element_t pz;
31 /// @f$E@f$-component
32 vector_element_t E;
33 };
34
35 /// Light-weight namespace for particle constants
36 namespace particle {
37 // clang-format off
38
39 /// PDG codes
40 enum PDG {
41 electron = 11,
42 photon = 22,
43 proton = 2212,
44 antiproton = -2212,
45 neutron = 2112,
46 antineutron = -2112,
47 pi_plus = 211,
48 pi_minus = -211,
49 kaon_plus = 321,
50 kaon_minus = -321
51 };
52
53 /// Particle names
54 const std::unordered_map<PDG, std::string> name{
55 { electron, "electron" },
56 { photon, "photon" },
57 { proton, "proton" },
58 { antiproton, "antiproton" },
59 { neutron, "neutron" },
60 { antineutron, "antineutron" },
61 { pi_plus, "pi_plus" },
62 { pi_minus, "pi_minus" },
63 { kaon_plus, "kaon_plus" },
64 { kaon_minus, "kaon_minus" }
65 };
66
67 /// Particle titles
68 const std::unordered_map<PDG, std::string> title{
69 { electron, "e^{-}" },
70 { photon, "#gamma" },
71 { proton, "p" },
72 { antiproton, "#bar{p}" },
73 { neutron, "n" },
74 { antineutron, "#bar{n}" },
75 { pi_plus, "#pi^{+}" },
76 { pi_minus, "#pi^{-}" },
77 { kaon_plus, "K^{+}" },
78 { kaon_minus, "K^{-}" }
79 };
80
81 /// Particle mass in GeV
82 const std::unordered_map<PDG, double> mass{
83 { electron, 0.000511 },
84 { photon, 0.0 },
85 { proton, 0.938272 },
86 { antiproton, 0.938272 },
87 { neutron, 0.939565 },
88 { antineutron, 0.939565 },
89 { pi_plus, 0.139570 },
90 { pi_minus, 0.139570 },
91 { kaon_plus, 0.493677 },
92 { kaon_minus, 0.493677 }
93 };
94
95 // clang-format on
96 }
97
98 }
99