File tree 1 file changed +12
-10
lines changed 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,12 @@ import (
8
8
"math"
9
9
)
10
10
11
- type PtEtaPhiM [4 ]float64
11
+ type PtEtaPhiM struct {
12
+ P4 Vec4
13
+ }
12
14
13
15
func NewPtEtaPhiM (pt , eta , phi , m float64 ) PtEtaPhiM {
14
- return PtEtaPhiM ([ 4 ] float64 { pt , eta , phi , m })
16
+ return PtEtaPhiM { P4 : Vec4 { X : pt , Y : eta , Z : phi , T : m }}
15
17
}
16
18
17
19
func (p4 * PtEtaPhiM ) Clone () P4 {
@@ -20,19 +22,19 @@ func (p4 *PtEtaPhiM) Clone() P4 {
20
22
}
21
23
22
24
func (p4 * PtEtaPhiM ) Pt () float64 {
23
- return p4 [ 0 ]
25
+ return p4 . P4 . X
24
26
}
25
27
26
28
func (p4 * PtEtaPhiM ) Eta () float64 {
27
- return p4 [ 1 ]
29
+ return p4 . P4 . Y
28
30
}
29
31
30
32
func (p4 * PtEtaPhiM ) Phi () float64 {
31
- return p4 [ 2 ]
33
+ return p4 . P4 . Z
32
34
}
33
35
34
36
func (p4 * PtEtaPhiM ) M () float64 {
35
- return p4 [ 3 ]
37
+ return p4 . P4 . T
36
38
}
37
39
38
40
func (p4 * PtEtaPhiM ) E () float64 {
@@ -150,8 +152,8 @@ func (p4 *PtEtaPhiM) Pz() float64 {
150
152
}
151
153
152
154
func (p4 * PtEtaPhiM ) Set (p P4 ) {
153
- p4 [ 0 ] = p .Pt ()
154
- p4 [ 1 ] = p .Eta ()
155
- p4 [ 2 ] = p .Phi ()
156
- p4 [ 3 ] = p .M ()
155
+ p4 . P4 . X = p .Pt ()
156
+ p4 . P4 . Y = p .Eta ()
157
+ p4 . P4 . Z = p .Phi ()
158
+ p4 . P4 . T = p .M ()
157
159
}
You can’t perform that action at this time.
0 commit comments