Skip to content

Commit 7684560

Browse files
Rename CommonJetStructs to CommonJet
This source has a lot more in it than just struct definitions, so the name was misleading. Fix a minor inconsistency in the cross constructors for PseudoJet and EEJet.
1 parent ddc9c3d commit 7684560

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

src/JetReconstruction.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ mass(p::LorentzVectorCyl) = LorentzVectorHEP.mass(p)
4949
const max_allowable_R = 1000.0
5050

5151
# Pseudojet and EEJet types
52-
include("CommonJetStructs.jl")
52+
include("CommonJet.jl")
5353
include("PseudoJet.jl")
5454
include("EEJet.jl")
5555
include("JetUtils.jl")

src/JetUtils.jl

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
# Functions that create each jet type from the other need to be defined here,
44
# after the structs are defined.
55
"""
6-
PseudoJet(jet::EEJet)
6+
PseudoJet(jet::EEJet; cluster_hist_index::Int=0)
77
8-
Constructs a `PseudoJet` object from an `EEJet` object, with the same four
9-
momentum and cluster history index.
8+
Constructs a `PseudoJet` from an `EEJet`.
9+
10+
# Details
11+
12+
The `cluster_hist_index` is set to the value of the `cluster_hist_index` of the
13+
EEJet if `0` is passed. Otherwise it is set to the value, `>0`, passed in.
1014
"""
11-
function PseudoJet(eej::EEJet)
15+
function PseudoJet(eej::EEJet; cluster_hist_index::Int = 0)
16+
cluster_hist_index = cluster_hist_index == 0 ? eej._cluster_hist_index :
17+
cluster_hist_index
1218
PseudoJet(px(eej), py(eej), pz(eej), energy(eej);
13-
cluster_hist_index = cluster_hist_index(eej))
19+
cluster_hist_index = cluster_hist_index)
1420
end
1521

1622
"""
@@ -24,10 +30,10 @@ The `cluster_hist_index` is set to the value of the `cluster_hist_index` of the
2430
PseudoJet if `0` is passed. Otherwise it is set to the value, `>0`, passed in.
2531
"""
2632
function EEJet(jet::PseudoJet; cluster_hist_index::Int = 0)
27-
new_cluster_hist_index = cluster_hist_index == 0 ? jet._cluster_hist_index :
28-
cluster_hist_index
33+
cluster_hist_index = cluster_hist_index == 0 ? jet._cluster_hist_index :
34+
cluster_hist_index
2935
EEJet(px(jet), py(jet), pz(jet), energy(jet);
30-
cluster_hist_index = new_cluster_hist_index)
36+
cluster_hist_index = cluster_hist_index)
3137
end
3238

3339
# Functions to convert jets to types from other packages

0 commit comments

Comments
 (0)