@@ -24,107 +24,107 @@ py(::PtEtaPhiM, v) = pt(v) * sin(phi(v))
24
24
pz (:: PtEtaPhiM , v) = pt (v) * sinh (eta (v))
25
25
26
26
function energy (:: PtEtaPhiM , mom)
27
- return sqrt (px (mom)^ 2 + py (mom)^ 2 + pz (mom)^ 2 + invariant_mass2 (mom))
27
+ return sqrt (px (mom)^ 2 + py (mom)^ 2 + pz (mom)^ 2 + invariant_mass2 (mom))
28
28
end
29
29
30
30
@inline function spatial_magnitude2 (:: PtEtaPhiM , mom)
31
- return pt (mom)^ 2 * (1 + sinh (eta (mom))^ 2 )
31
+ return pt (mom)^ 2 * (1 + sinh (eta (mom))^ 2 )
32
32
end
33
33
34
34
@inline function spatial_magnitude (:: PtEtaPhiM , mom)
35
- return sqrt (spatial_magnitude2 (mom))
35
+ return sqrt (spatial_magnitude2 (mom))
36
36
end
37
37
38
38
@inline function mass2 (:: PtEtaPhiM , mom)
39
- return mass (mom)^ 2
39
+ return mass (mom)^ 2
40
40
end
41
41
42
42
@inline function boost_beta (:: PtEtaPhiM , mom)
43
- en = energy (mom)
44
- rho = spatial_magnitude (mom)
45
- if ! iszero (en)
46
- rho / en
47
- elseif iszero (rho)
48
- return zero (rho)
49
- else
50
- throw (
51
- ArgumentError (
52
- " There is no beta for a four-momentum with vanishing time/energy component"
53
- ),
54
- )
55
- end
43
+ en = energy (mom)
44
+ rho = spatial_magnitude (mom)
45
+ if ! iszero (en)
46
+ rho / en
47
+ elseif iszero (rho)
48
+ return zero (rho)
49
+ else
50
+ throw (
51
+ ArgumentError (
52
+ " There is no beta for a four-momentum with vanishing time/energy component"
53
+ ),
54
+ )
55
+ end
56
56
end
57
57
58
58
@inline function boost_gamma (:: PtEtaPhiM , mom)
59
- return inv (sqrt (one (energy (mom)) - boost_beta (mom)^ 2 ))
59
+ return inv (sqrt (one (energy (mom)) - boost_beta (mom)^ 2 ))
60
60
end
61
61
62
62
# #######################
63
63
# transverse coordinates
64
64
# #######################
65
65
66
66
@inline function pt2 (:: PtEtaPhiM , mom)
67
- return pt (mom)^ 2
67
+ return pt (mom)^ 2
68
68
end
69
69
70
70
@inline function mt2 (:: PtEtaPhiM , mom)
71
- return energy (mom)^ 2 - pz (mom)^ 2
71
+ return energy (mom)^ 2 - pz (mom)^ 2
72
72
end
73
73
74
74
function mt (:: PtEtaPhiM , mom)
75
- mT2 = mt2 (mom)
76
- if mT2 < zero (mT2)
77
- # add optional waring: negative transverse mass -> -sqrt(-mT2) is returned.
78
- - sqrt (- mT2)
79
- else
80
- sqrt (mT2)
81
- end
75
+ mT2 = mt2 (mom)
76
+ if mT2 < zero (mT2)
77
+ # add optional waring: negative transverse mass -> -sqrt(-mT2) is returned.
78
+ - sqrt (- mT2)
79
+ else
80
+ sqrt (mT2)
81
+ end
82
82
end
83
83
84
84
@inline function rapidity (:: PtEtaPhiM , mom)
85
- E = energy (mom)
86
- pz1 = pz (mom)
87
- return 0.5 * log ((E + pz1) / (E - pz1))
85
+ E = energy (mom)
86
+ pz1 = pz (mom)
87
+ return 0.5 * log ((E + pz1) / (E - pz1))
88
88
end
89
89
90
90
# ######################
91
91
# spherical coordinates
92
92
# ######################
93
93
94
94
@inline function polar_angle (:: PtEtaPhiM , mom)
95
- xcomp = px (mom)
96
- ycomp = py (mom)
97
- zcomp = pz (mom)
95
+ xcomp = px (mom)
96
+ ycomp = py (mom)
97
+ zcomp = pz (mom)
98
98
99
- return if iszero (xcomp) && iszero (ycomp) && iszero (zcomp)
100
- zero (xcomp)
101
- else
102
- atan (transverse_momentum (mom), zcomp)
103
- end
99
+ return if iszero (xcomp) && iszero (ycomp) && iszero (zcomp)
100
+ zero (xcomp)
101
+ else
102
+ atan (transverse_momentum (mom), zcomp)
103
+ end
104
104
end
105
105
106
106
@inline function cos_theta (:: PtEtaPhiM , mom)
107
- r = spatial_magnitude (mom)
108
- return iszero (r) ? one (px (mom)) : pz (mom) / r
107
+ r = spatial_magnitude (mom)
108
+ return iszero (r) ? one (px (mom)) : pz (mom) / r
109
109
end
110
110
111
111
function cos_phi (:: PtEtaPhiM , mom)
112
- pT = pt (mom)
113
- return iszero (pT) ? one (pT) : px (mom) / pT
112
+ pT = pt (mom)
113
+ return iszero (pT) ? one (pT) : px (mom) / pT
114
114
end
115
115
116
116
function sin_phi (:: PtEtaPhiM , mom)
117
- pT = pt (mom)
118
- return iszero (pT) ? zero (pT) : py (mom) / pT
117
+ pT = pt (mom)
118
+ return iszero (pT) ? zero (pT) : py (mom) / pT
119
119
end
120
120
121
121
# #######################
122
122
# light cone coordinates
123
123
# #######################
124
124
@inline function plus_component (:: PtEtaPhiM , mom)
125
- return 0.5 * (energy (mom) + pz (mom))
125
+ return 0.5 * (energy (mom) + pz (mom))
126
126
end
127
127
128
128
@inline function minus_component (:: PtEtaPhiM , mom)
129
- return 0.5 * (energy (mom) - pz (mom))
129
+ return 0.5 * (energy (mom) - pz (mom))
130
130
end
0 commit comments