33const large_distance = 16.0 # = 4^2
44const large_dij = 1.0e6
55
6+ using Infiltrator
7+
68"""
79 angular_distance(eereco, i, j) -> Float64
810
@@ -242,11 +244,12 @@ function ee_genkt_algorithm(particles::AbstractArray{T, 1}; p = 1, R = 4.0,
242244 recombination_particles = copy (particles)
243245 sizehint! (recombination_particles, length (particles) * 2 )
244246 else
245- recombination_particles = EEjet[]
247+ ParticleType = typeof (px (particles[1 ]))
248+ recombination_particles = EEjet{ParticleType}[]
246249 sizehint! (recombination_particles, length (particles) * 2 )
247250 for i in eachindex (particles)
248251 push! (recombination_particles,
249- EEjet (px (particles[i]), py (particles[i]), pz (particles[i]),
252+ EEjet {ParticleType} (px (particles[i]), py (particles[i]), pz (particles[i]),
250253 energy (particles[i])))
251254 end
252255 end
264267
265268This function is the actual implementation of the e+e- jet clustering algorithm.
266269"""
267- function _ee_genkt_algorithm (; particles:: Vector{EEjet} , p = 1 , R = 4.0 ,
270+ function _ee_genkt_algorithm (; particles:: Vector{EEjet{T} } , p = 1 , R = 4.0 ,
268271 algorithm:: JetAlgorithm.Algorithm = JetAlgorithm. Durham,
269- recombine = + )
272+ recombine = + ) where {T <: Real }
270273 # Bounds
271274 N:: Int = length (particles)
272275
@@ -298,7 +301,7 @@ function _ee_genkt_algorithm(; particles::Vector{EEjet}, p = 1, R = 4.0,
298301 # Setup the initial history and get the total energy
299302 history, Qtot = initial_history (particles)
300303
301- clusterseq = ClusterSequence (algorithm, p, R, RecoStrategy. N2Plain, particles, history,
304+ clusterseq = ClusterSequence {EEjet{ParticleType}} (algorithm, p, R, RecoStrategy. N2Plain, particles, history,
302305 Qtot)
303306
304307 # Run over initial pairs of jets to find nearest neighbours
@@ -307,6 +310,8 @@ function _ee_genkt_algorithm(; particles::Vector{EEjet}, p = 1, R = 4.0,
307310 # Only for debugging purposes...
308311 # ee_check_consistency(clusterseq, clusterseq_index, N, nndist, nndij, nni, "Start")
309312
313+ # @infiltrate
314+
310315 # Now we can start the main loop
311316 iter = 0
312317 while N != 0
0 commit comments