@@ -220,20 +220,6 @@ function set_nearest_neighbours!(tiling::Tiling,
220220 return nothing
221221end
222222
223- function set_nearest_neighbours! (clusterseq:: ClusterSequence ,
224- tiling:: Tiling ,
225- tiledjets:: Vector{TiledJet} )
226- NNs = similar (clusterseq. jets, TiledJet)
227- diJ = similar (clusterseq. jets, Float64)
228-
229- set_nearest_neighbours! (tiling,
230- tiledjets,
231- NNs,
232- diJ)
233-
234- NNs, diJ
235- end
236-
237223"""
238224 do_iB_recombination_step!(clusterseq::ClusterSequence, jet_i, diB)
239225
@@ -361,31 +347,9 @@ function tiled_jet_reconstruct(particles::AbstractVector{T};
361347 # Get consistent algorithm power
362348 p = get_algorithm_power (p = p, algorithm = algorithm)
363349
364- if isnothing (preprocess)
365- if T == PseudoJet
366- # If we don't have a preprocessor, we just need to copy to our own
367- # PseudoJet objects
368- recombination_particles = copy (particles)
369- sizehint! (recombination_particles, length (particles) * 2 )
370- else
371- # We assume a constructor for PseudoJet that can ingest the appropriate
372- # type of particle
373- recombination_particles = PseudoJet[]
374- sizehint! (recombination_particles, length (particles) * 2 )
375- for (i, particle) in enumerate (particles)
376- push! (recombination_particles, PseudoJet (particle; cluster_hist_index = i))
377- end
378- end
379- else
380- # We have a preprocessor function that we need to call to modify the
381- # input particles
382- recombination_particles = PseudoJet[]
383- sizehint! (recombination_particles, length (particles) * 2 )
384- for (i, particle) in enumerate (particles)
385- push! (recombination_particles,
386- preprocess (particle, PseudoJet; cluster_hist_index = i))
387- end
388- end
350+ recombination_particles = construct_reco_jets (particles,
351+ PseudoJet,
352+ preprocess)
389353
390354 _tiled_jet_reconstruct! (recombination_particles; algorithm = algorithm, p = p, R = R,
391355 recombine = recombine)
@@ -454,9 +418,7 @@ function _tiled_jet_reconstruct!(particles::AbstractVector{PseudoJet};
454418 tiledjets = scratch. tiledjets
455419
456420 if isnothing (history_buffer)
457- # Preserve the owning path's eager complete-history allocation. This is
458- # especially important on Julia < 1.11, where initial_history!'s
459- # no-shrink size hint is intentionally unavailable.
421+ # Preserve the owning path's eager complete-history allocation.
460422 history_buffer = Vector {HistoryElement} (undef, N)
461423 sizehint! (history_buffer, 2 * N)
462424 end
@@ -631,9 +593,9 @@ function _n2tiled_reconstruct_with_workspace!(workspace::N2TiledWorkspace,
631593 resolved_power = get_algorithm_power (p = p,
632594 algorithm = algorithm)
633595
634- jets = prepare_recombination_jets ! (workspace,
635- particles,
636- preprocess = preprocess)
596+ jets = construct_reco_jets ! (workspace. jets ,
597+ particles,
598+ preprocess)
637599
638600 return _tiled_jet_reconstruct! (jets;
639601 algorithm = algorithm,
0 commit comments