Skip to content

Commit 75eea28

Browse files
committed
Add back alg isa JetAlgorithm.Algorithm check for now
1 parent 21059e7 commit 75eea28

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/EEAlgorithm.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Beam index `j==0` returns a large sentinel. For Valencia we use the full
3030
Valencia metric (independent of `dij_factor`).
3131
"""
3232
@inline function dij_dist(eereco, i, j, dij_factor, algorithm, invR2)
33+
if !(algorithm isa JetAlgorithm.Algorithm)
34+
throw(ArgumentError("algorithm must be a JetAlgorithm.Algorithm"))
35+
end
3336
j == 0 && return large_dij
3437
@inbounds begin
3538
if algorithm == JetAlgorithm.Valencia
@@ -129,8 +132,7 @@ function get_angular_nearest_neighbours!(eereco, algorithm, dij_factor, p, invR2
129132
if algorithm == JetAlgorithm.Valencia
130133
eereco.dijdist[i] = valencia_distance(eereco, i, eereco[i].nni, invR2)
131134
else
132-
eereco.dijdist[i] = dij_dist(eereco, i, eereco[i].nni, dij_factor, algorithm,
133-
invR2)
135+
eereco.dijdist[i] = dij_dist(eereco, i, eereco[i].nni, dij_factor, algorithm, invR2)
134136
end
135137
end
136138
# For the EEKt and Valencia algorithms, we need to check the beam distance as well
@@ -258,7 +260,7 @@ Base.@propagate_inbounds @inline function fill_reco_array!(eereco, particles, in
258260
@inbounds for i in eachindex(particles)
259261
eereco.index[i] = i
260262
eereco.nni[i] = 0
261-
eereco.nndist[i] = inv(invR2) # R^2 as initial sentinel for angular algorithms
263+
eereco.nndist[i] = inv(invR2) # R^2 as initial sentinel for angular algorithms
262264
# eereco.dijdist[i] = UNDEF # Does not need to be initialised
263265
eereco.nx[i] = nx(particles[i])
264266
eereco.ny[i] = ny(particles[i])
@@ -269,11 +271,11 @@ Base.@propagate_inbounds @inline function fill_reco_array!(eereco, particles, in
269271
end
270272

271273
Base.@propagate_inbounds @inline function insert_new_jet!(eereco, i, newjet_k, invR2,
272-
merged_jet, p)
274+
merged_jet, p)
273275
@inbounds begin
274276
eereco.index[i] = newjet_k
275277
eereco.nni[i] = 0
276-
eereco.nndist[i] = inv(invR2)
278+
eereco.nndist[i] = inv(invR2)
277279
eereco.nx[i] = nx(merged_jet)
278280
eereco.ny[i] = ny(merged_jet)
279281
eereco.nz[i] = nz(merged_jet)
@@ -397,8 +399,7 @@ function ee_genkt_algorithm(particles::AbstractVector{T}; algorithm::JetAlgorith
397399
invR2 = inv(R * R)
398400
# Now call the unified implementation with conditional logic.
399401
return _ee_genkt_algorithm(particles = recombination_particles, p = p, R = R,
400-
invR2 = invR2, algorithm = algorithm, recombine = recombine,
401-
γ = γ)
402+
invR2 = invR2, algorithm = algorithm, recombine = recombine, γ = γ)
402403
end
403404

404405
"""
@@ -434,8 +435,7 @@ entry point to this jet reconstruction.
434435
"""
435436
function _ee_genkt_algorithm(; particles::AbstractVector{EEJet},
436437
algorithm::JetAlgorithm.Algorithm, p::Real, R::Real,
437-
invR2::Union{Real, Nothing} = nothing, recombine = addjets,
438-
γ::Real = 1.0,
438+
invR2::Union{Real, Nothing} = nothing, recombine = addjets, γ::Real = 1.0,
439439
beta::Union{Real, Nothing} = nothing)
440440
# Bounds
441441
N::Int = length(particles)

0 commit comments

Comments
 (0)