Skip to content

Commit 6150869

Browse files
Fix type comparison in algorithm entry point
Had used wrong comparison - 'isa' instead of '<:'!
1 parent e5137ce commit 6150869

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/EEAlgorithm.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function ee_genkt_algorithm(particles::AbstractArray{T, 1}; p = 1, R = 4.0,
236236
R = 4.0
237237
end
238238

239-
if T == EEjet
239+
if T <: EEjet
240240
# recombination_particles will become part of the cluster sequence, so size it for
241241
# the starting particles and all N recombinations
242242
recombination_particles = copy(particles)
@@ -261,7 +261,7 @@ function ee_genkt_algorithm(particles::AbstractArray{T, 1}; p = 1, R = 4.0,
261261
end
262262

263263
"""
264-
_ee_genkt_algorithm(; particles::Vector{EEjet}, p = 1, R = 4.0,
264+
_ee_genkt_algorithm(; particles::Vector{EEjet{T}}, p = 1, R = 4.0,
265265
algorithm::JetAlgorithm.Algorithm = JetAlgorithm.Durham,
266266
recombine = +)
267267

src/PlainAlgo.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function plain_jet_reconstruct(particles::AbstractArray{T, 1}; p::Union{Real, No
230230
# Integer p if possible
231231
p = (round(p) == p) ? Int(p) : p
232232

233-
if T isa PseudoJet
233+
if T <: PseudoJet
234234
# recombination_particles will become part of the cluster sequence, so size it for
235235
# the starting particles and all N recombinations
236236
recombination_particles = copy(particles)
@@ -243,7 +243,7 @@ function plain_jet_reconstruct(particles::AbstractArray{T, 1}; p::Union{Real, No
243243
sizehint!(recombination_particles, length(particles) * 2)
244244
for i in eachindex(particles)
245245
push!(recombination_particles,
246-
PseudoJet(px(particles[i]), py(particles[i]), pz(particles[i]),
246+
PseudoJet{ParticleType}(px(particles[i]), py(particles[i]), pz(particles[i]),
247247
energy(particles[i])))
248248
end
249249
end
@@ -255,12 +255,12 @@ function plain_jet_reconstruct(particles::AbstractArray{T, 1}; p::Union{Real, No
255255
end
256256

257257
"""
258-
_plain_jet_reconstruct(; particles::Vector{PseudoJet}, p = -1, R = 1.0, recombine = +)
258+
_plain_jet_reconstruct(; particles::Vector{PseudoJet{T}}, p = -1, R = 1.0, recombine = +)
259259
260260
This is the internal implementation of jet reconstruction using the plain
261261
algorithm. It takes a vector of `particles` representing the input particles and
262262
reconstructs jets based on the specified parameters. Here the particles must be
263-
of type `PseudoJet`.
263+
of type `PseudoJet{T}`.
264264
265265
Users of the package should use the `plain_jet_reconstruct` function as their
266266
entry point to this jet reconstruction.

src/TiledAlgoLL.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function tiled_jet_reconstruct(particles::AbstractArray{T, 1}; p::Union{Real, No
374374
(p, algorithm) = get_algorithm_power_consistency(p = p, algorithm = algorithm)
375375

376376
# If we have PseudoJets, we can just call the main algorithm...
377-
if T isa PseudoJet
377+
if T <: PseudoJet
378378
# recombination_particles will become part of the cluster sequence, so size it for
379379
# the starting particles and all N recombinations
380380
recombination_particles = copy(particles)

0 commit comments

Comments
 (0)