@@ -214,7 +214,7 @@ add_step_to_history!(clusterseq::ClusterSequence, parent1, parent2, jetp_index,
214
214
end
215
215
216
216
"""
217
- inclusive_jets(clusterseq::ClusterSequence; ptmin = 0.0, T = LorentzVectorCyl)
217
+ inclusive_jets(clusterseq::ClusterSequence{U} ; ptmin = 0.0, T = LorentzVectorCyl) where {U}
218
218
219
219
Return all inclusive jets of a ClusterSequence with pt > ptmin.
220
220
@@ -234,16 +234,18 @@ It iterates over the clustering history and checks the transverse momentum of
234
234
each parent jet. If the transverse momentum is greater than or equal to `ptmin`,
235
235
the jet is added to the array of inclusive jets.
236
236
237
- Valid return types are `LorentzVectorCyl` and `PseudoJet` (N.B. this will evolve
238
- in the future to be any subtype of `FourMomemntumBase`; currently unrecognised types
239
- will return `LorentzVectorCyl`).
237
+ Valid return types are `LorentzVectorCyl` and the jet type of the input `clusterseq`
238
+ (`U` - either `PseudoJet` or `EEjet` depending which algorithm was used)
239
+ (N.B. this will evolve in the future to be any subtype of `FourMomentumBase`;
240
+ currently unrecognised types will return `LorentzVectorCyl`).
240
241
241
242
# Example
242
243
```julia
243
244
inclusive_jets(clusterseq; ptmin = 10.0)
244
245
```
245
246
"""
246
- function inclusive_jets (clusterseq:: ClusterSequence ; ptmin = 0.0 , T = LorentzVectorCyl)
247
+ function inclusive_jets (clusterseq:: ClusterSequence{U} ; ptmin = 0.0 ,
248
+ T = LorentzVectorCyl) where {U}
247
249
pt2min = ptmin * ptmin
248
250
jets_local = T[]
249
251
# sizehint!(jets_local, length(clusterseq.jets))
@@ -257,7 +259,7 @@ function inclusive_jets(clusterseq::ClusterSequence; ptmin = 0.0, T = LorentzVec
257
259
jet = clusterseq. jets[iparent_jet]
258
260
if pt2 (jet) >= pt2min
259
261
@debug " Added inclusive jet index $iparent_jet "
260
- if T == PseudoJet
262
+ if T == U
261
263
push! (jets_local, jet)
262
264
else
263
265
push! (jets_local,
@@ -269,7 +271,7 @@ function inclusive_jets(clusterseq::ClusterSequence; ptmin = 0.0, T = LorentzVec
269
271
end
270
272
271
273
"""
272
- exclusive_jets(clusterseq::ClusterSequence; dcut = nothing, njets = nothing, T = LorentzVectorCyl)
274
+ exclusive_jets(clusterseq::ClusterSequence{U} ; dcut = nothing, njets = nothing, T = LorentzVectorCyl) where {U}
273
275
274
276
Return all exclusive jets of a ClusterSequence, with either a specific number of
275
277
jets or a cut on the maximum distance parameter.
@@ -290,9 +292,10 @@ jets or a cut on the maximum distance parameter.
290
292
# Returns
291
293
- An array of `T` objects representing the exclusive jets.
292
294
293
- Valid return types are `LorentzVectorCyl` and `PseudoJet` (N.B. this will evolve
294
- in the future to be any subtype of `FourMomemntumBase`; currently unrecognised types
295
- will return `LorentzVectorCyl`)
295
+ Valid return types are `LorentzVectorCyl` and the jet type of the input `clusterseq`
296
+ (`U` - either `PseudoJet` or `EEjet` depending which algorithm was used)
297
+ (N.B. this will evolve in the future to be any subtype of `FourMomentumBase`;
298
+ currently unrecognised types will return `LorentzVectorCyl`).
296
299
297
300
# Exceptions
298
301
- `ArgumentError`: If neither `dcut` nor `njets` is provided.
@@ -307,8 +310,8 @@ exclusive_jets(clusterseq, dcut = 20.0)
307
310
exclusive_jets(clusterseq, njets = 3, T = PseudoJet)
308
311
```
309
312
"""
310
- function exclusive_jets (clusterseq:: ClusterSequence ; dcut = nothing , njets = nothing ,
311
- T = LorentzVectorCyl)
313
+ function exclusive_jets (clusterseq:: ClusterSequence{U} ; dcut = nothing , njets = nothing ,
314
+ T = LorentzVectorCyl) where {U}
312
315
if isnothing (dcut) && isnothing (njets)
313
316
throw (ArgumentError (" Must pass either a dcut or an njets value" ))
314
317
end
@@ -343,7 +346,7 @@ function exclusive_jets(clusterseq::ClusterSequence; dcut = nothing, njets = not
343
346
if (parent < stop_point && parent > 0 )
344
347
@debug " Added exclusive jet index $(clusterseq. history[parent]. jetp_index) "
345
348
jet = clusterseq. jets[clusterseq. history[parent]. jetp_index]
346
- if ( T == PseudoJet) || (T == EEjet)
349
+ if T == U
347
350
push! (excl_jets, jet)
348
351
else
349
352
push! (excl_jets,
0 commit comments