@@ -194,18 +194,24 @@ end
194194
195195Perform pp jet reconstruction using the plain algorithm.
196196
197+ The power value maps to specific pp jet reconstruction algorithms, but can be
198+ omitted when the algorithm implies the power value to use. It must be specified
199+ for the `GenKt` algorithm.
200+
197201# Arguments
198202- `particles::AbstractVector{T}`: A vector of particles used for jet
199203 reconstruction, any array of particles, which supports suitable 4-vector
200204 methods, viz. pt2(), phi(), rapidity(), px(), py(), pz(), energy(), can be
201205 used for each element.
202206- `algorithm::JetAlgorithm.Algorithm`: The jet algorithm to use.
203- - `p::Union{Real, Nothing} = nothing`: The power value used for jet reconstruction.
204- Must be specified for GenKt algorithm. Other algorithms will ignore this value.
207+ - `p::Union{Real, Nothing} = nothing`: The power value used for jet
208+ reconstruction. Must be specified for GenKt algorithm. Other algorithms will
209+ ignore this value.
205210- `R = 1.0`: The radius parameter used for jet reconstruction.
206211- `recombine::Function = addjets`: The recombination function used to combine
207212 particles into a new jet.
208- - `preprocess::Function = nothing`: A function to preprocess the input particles.
213+ - `preprocess::Function = nothing`: A function to preprocess the input
214+ particles.
209215
210216**Note** for the `particles` argument, the 4-vector methods need to exist in the
211217JetReconstruction package namespace.
@@ -214,12 +220,13 @@ This code will use the `k_t` algorithm types, operating in `(rapidity, φ)`
214220space.
215221
216222# Returns
217- - `Vector{PseudoJet}`: A vector of reconstructed jets.
223+ - `clusterseq`: The resulting `ClusterSequence` object representing the
224+ reconstructed jets.
218225
219226# Example
220227```julia
221- jets = plain_jet_reconstruct(particles; algorithm = JetAlgorithm.GenKt, p = -1, R = 0.4)
222228jets = plain_jet_reconstruct(particles; algorithm = JetAlgorithm.Kt, R = 1.0)
229+ jets = plain_jet_reconstruct(particles; algorithm = JetAlgorithm.GenKt, p = -0.5, R = 0.4)
223230```
224231"""
225232function plain_jet_reconstruct (particles:: AbstractVector{T} ;
@@ -260,45 +267,40 @@ function plain_jet_reconstruct(particles::AbstractVector{T};
260267 end
261268
262269 # Now call the actual reconstruction method, tuned for our internal EDM
263- _plain_jet_reconstruct (recombination_particles; algorithm = algorithm, p = p, R = R,
264- recombine = recombine)
270+ _plain_jet_reconstruct! (recombination_particles; algorithm = algorithm, p = p, R = R,
271+ recombine = recombine)
265272end
266273
267274"""
268- _plain_jet_reconstruct(particles::AbstractVector{PseudoJet};
275+ _plain_jet_reconstruct! (particles::AbstractVector{PseudoJet};
269276 algorithm::JetAlgorithm.Algorithm, p::Real, R = 1.0,
270277 recombine = addjets)
271278
272279This is the internal implementation of jet reconstruction using the plain
273- algorithm. It takes a vector of `particles` representing the input particles and
274- reconstructs jets based on the specified parameters. Here the particles must be
275- of type `PseudoJet`.
280+ algorithm. It takes a vector of `PseudoJet` `particles` representing the input
281+ particles and reconstructs jets based on the specified parameters.
276282
277283Users of the package should use the `plain_jet_reconstruct` function as their
278284entry point to this jet reconstruction.
279285
280- The power value maps to specific pp jet reconstruction algorithms: -1 = AntiKt,
281- 0 = Cambridge/Aachen, 1 = Inclusive Kt. Floating point values are allowed for
282- generalised k_t algorithm. The algorithm parameter must be consistent with the
283- power parameter.
284-
285286# Arguments
286- - `particles::AbstractVector{PseudoJet}`: A vector of `PseudoJet` objects
287- representing the input particles.
287+ - `particles::AbstractVector{PseudoJet}`: A vector of `PseudoJet` particles used
288+ as input for jet reconstruction. This vector must supply the correct
289+ `cluster_hist_index` values and will be *mutated* as part of the returned
290+ `ClusterSequence`.
288291- `algorithm::JetAlgorithm.Algorithm`: The jet reconstruction algorithm to use.
289- - `p::Real`: The power to which the transverse momentum (`pt`) of each particle is
290- raised.
292+ - `p::Real`: The power to which the transverse momentum (`pt`) of each particle
293+ is raised.
291294- `R = 1.0`: The jet radius parameter.
292- - `recombine`: The recombination function used to merge two jets. Default is `+`
293- (additive recombination).
295+ - `recombine = addjets`: The recombination scheme to use.
294296
295297# Returns
296298- `clusterseq`: The resulting `ClusterSequence` object representing the
297299 reconstructed jets.
298300"""
299- function _plain_jet_reconstruct (particles:: AbstractVector{PseudoJet} ;
300- algorithm:: JetAlgorithm.Algorithm , p:: Real , R = 1.0 ,
301- recombine = addjets)
301+ function _plain_jet_reconstruct! (particles:: AbstractVector{PseudoJet} ;
302+ algorithm:: JetAlgorithm.Algorithm , p:: Real , R = 1.0 ,
303+ recombine = addjets)
302304 # Bounds
303305 N:: Int = length (particles)
304306 # Parameters
@@ -319,9 +321,6 @@ function _plain_jet_reconstruct(particles::AbstractVector{PseudoJet};
319321
320322 # Setup the initial history and get the total energy
321323 history, Qtot = initial_history (particles)
322- # Current implementation mutates the particles vector, so need to copy it
323- # for the cluster sequence (there is too much copying happening, so this
324- # needs to be rethought and reoptimised)
325324 clusterseq = ClusterSequence (algorithm, p, R, RecoStrategy. N2Plain, particles, history,
326325 Qtot)
327326
0 commit comments