Skip to content

Commit 589f5fa

Browse files
mattleblancgraeme-a-stewart
authored andcommitted
A couple more tweaks to docstrings, cleaning up tests
1 parent 60fef1e commit 589f5fa

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/EEAlgorithm.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ end
316316
"""
317317
ee_genkt_algorithm(particles::AbstractVector{T}; algorithm::JetAlgorithm.Algorithm,
318318
p::Union{Real, Nothing} = nothing, R = 4.0, recombine = addjets,
319-
preprocess = nothing, γ::Real = 1.0) where {T}
319+
preprocess = nothing, γ::Real = 1.0, β::Union{Real, Nothing} = nothing) where {T}
320320
321321
Run an e+e- reconstruction algorithm on a set of initial particles.
322322
@@ -332,6 +332,8 @@ Run an e+e- reconstruction algorithm on a set of initial particles.
332332
- `recombine`: The recombination scheme to use.
333333
- `preprocess`: Preprocessing function for input particles.
334334
- `γ::Real = 1.0`: The angular exponent parameter for Valencia algorithm. Ignored for other algorithms.
335+
- `β::Union{Real, Nothing} = nothing`: Optional alias for the Valencia energy exponent; if provided for
336+
Valencia it overrides `p`.
335337
336338
# Returns
337339
- The result of the jet clustering as a `ClusterSequence` object.
@@ -344,7 +346,7 @@ itself, and call the actual reconstruction method `_ee_genkt_algorithm!`.
344346
345347
If the algorithm is Durham, `R` is nominally set to 4.
346348
If the algorithm is EEkt, power `p` must be specified.
347-
If the algorithm is Valencia, both `p` (β) and `γ` should be specified.
349+
If the algorithm is Valencia, you can provide `p` (β) and `γ`, or pass `β` explicitly to override `p`.
348350
"""
349351
function ee_genkt_algorithm(particles::AbstractVector{T}; algorithm::JetAlgorithm.Algorithm,
350352
p::Union{Real, Nothing} = nothing, R = 4.0, recombine = addjets,
@@ -401,9 +403,10 @@ function ee_genkt_algorithm(particles::AbstractVector{T}; algorithm::JetAlgorith
401403
end
402404

403405
"""
404-
_ee_genkt_algorithm!(particles::AbstractVector{EEJet};
406+
_ee_genkt_algorithm(particles::AbstractVector{EEJet};
405407
algorithm::JetAlgorithm.Algorithm, p::Real, R = 4.0,
406-
recombine = addjets, γ::Real = 1.0)
408+
recombine = addjets, γ::Real = 1.0,
409+
beta::Union{Real, Nothing} = nothing)
407410
408411
This function is the internal implementation of the e+e- jet clustering
409412
algorithm. It takes a vector of `EEJet` `particles` representing the input
@@ -413,7 +416,7 @@ Users of the package should use the `ee_genkt_algorithm` function as their
413416
entry point to this jet reconstruction.
414417
415418
# Arguments
416-
- `particles::AbstractVector{EEJet}`: A vector of `EEJet` particles used
419+
- `particles::AbstractVector{EEJet}`: A vector of `EEJet` particles used
417420
as input for jet reconstruction. This vector must supply the correct
418421
`cluster_hist_index` values and will be *mutated* as part of the returned
419422
`ClusterSequence`.
@@ -422,6 +425,9 @@ entry point to this jet reconstruction.
422425
is raised.
423426
- `R = 4.0`: The jet radius parameter.
424427
- `recombine = addjets`: The recombination function used to merge two jets.
428+
- `γ::Real = 1.0`: Angular exponent for the Valencia beam metric (ignored for other algorithms).
429+
- `beta::Union{Real, Nothing} = nothing`: Optional alias for the Valencia energy exponent (β).
430+
When provided with `algorithm == JetAlgorithm.Valencia`, it overrides `p`.
425431
426432
# Returns
427433
- `clusterseq`: The resulting `ClusterSequence` object representing the

test/_common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using StructArrays
1414

1515
using JetReconstruction: EERecoJet,
1616
fill_reco_array!, insert_new_jet!, copy_to_slot!,
17-
dij_dist, valencia_distance, valencia_distance_inv
17+
dij_dist, valencia_distance
1818

1919
logger = ConsoleLogger(stdout, Logging.Warn)
2020
global_logger(logger)

test/test-valencia.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ end
8080
eereco = EERecoJet[EERecoJet(1, 0, Inf, Inf, 1.0, 0.0, 0.0, 9.0),
8181
EERecoJet(2, 0, Inf, Inf, 1.0, 0.0, 0.0, 4.0)]
8282
R = 2.0
83-
invR2 = inv(R * R)
84-
@test valencia_distance_inv(eereco, 1, 2, invR2) == 0.0
83+
@test valencia_distance(eereco, 1, 2, R) == 0.0
8584
@test valencia_distance(eereco, 1, 2, R) == 0.0
8685
end
8786

0 commit comments

Comments
 (0)