Skip to content

Commit 8b3f1f4

Browse files
Fix types for EEJet
1 parent 6e14453 commit 8b3f1f4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/EEAlgorithm.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ function _ee_genkt_algorithm(; particles::Vector{EEjet}, p = 1, R = 4.0,
273273
# R squared
274274
R2 = R^2
275275

276+
# Numerical type?
277+
ParticleType = typeof(particles[1].E)
278+
276279
# Constant factor for the dij metric and the beam distance function
277280
if algorithm == JetAlgorithm.Durham
278281
dij_factor = 2.0
@@ -289,7 +292,7 @@ function _ee_genkt_algorithm(; particles::Vector{EEjet}, p = 1, R = 4.0,
289292
# For optimised reconstruction generate an SoA containing the necessary
290293
# jet information and populate it accordingly
291294
# We need N slots for this array
292-
eereco = StructArray{EERecoJet}(undef, N)
295+
eereco = StructArray{EERecoJet{ParticleType}}(undef, N)
293296
fill_reco_array!(eereco, particles, R2, p)
294297

295298
# Setup the initial history and get the total energy

src/EEjet.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ mutable struct EEjet{T <: Real} <: FourMomentum
2727
_cluster_hist_index::Int
2828
end
2929

30-
function EEjet(px::T, py::T, pz::T, E::T, _cluster_hist_index::Int) where {T <: Real}
30+
function EEjet(px::T, py::T, pz::T, E::T, _cluster_hist_index::Integer) where {T <: Real}
3131
@muladd p2 = px * px + py * py + pz * pz
3232
inv_p = @fastmath 1.0 / sqrt(p2)
3333
EEjet{T}(px, py, pz, E, p2, inv_p, _cluster_hist_index)
3434
end
3535

36-
EEjet(px::T, py::T, pz::T, E::T) where {T <: Real} = EEjet{T}(px, py, pz, E, 0)
36+
EEjet(px::T, py::T, pz::T, E::T) where {T <: Real} = EEjet(px, py, pz, E, 0)
3737

3838
EEjet(pj::PseudoJet) = EEjet(px(pj), py(pj), pz(pj), energy(pj), cluster_hist_index(pj))
3939

0 commit comments

Comments
 (0)