Skip to content

Commit be15df8

Browse files
Formatting!
1 parent 5ac85d7 commit be15df8

File tree

6 files changed

+37
-29
lines changed

6 files changed

+37
-29
lines changed

src/ClusterSequence.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,13 @@ ClusterSequence(algorithm::JetAlgorithm.Algorithm, p::Real, R::Float64, strategy
148148
Qtot)
149149
end
150150

151-
ClusterSequence{T}(algorithm::JetAlgorithm.Algorithm, p::Real, R::Float64, strategy::RecoStrategy.Strategy, jets::Vector{T}, history, Qtot) where {T <: FourMomentum} = begin
151+
function ClusterSequence{T}(algorithm::JetAlgorithm.Algorithm, p::Real, R::Float64,
152+
strategy::RecoStrategy.Strategy, jets::Vector{T}, history,
153+
Qtot) where {T <: FourMomentum}
152154
ClusterSequence{T}(algorithm, Float64(p), R, strategy, jets, length(jets), history,
153155
Qtot)
154156
end
155157

156-
157158
"""
158159
add_step_to_history!(clusterseq::ClusterSequence, parent1, parent2, jetp_index, dij)
159160

src/EEAlgorithm.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function ee_genkt_algorithm(particles::AbstractArray{T, 1}; p = 1, R = 4.0,
248248
for i in eachindex(particles)
249249
push!(recombination_particles,
250250
EEjet{ParticleType}(px(particles[i]), py(particles[i]), pz(particles[i]),
251-
energy(particles[i])))
251+
energy(particles[i])))
252252
end
253253
end
254254

@@ -299,8 +299,9 @@ function _ee_genkt_algorithm(; particles::Vector{EEjet{T}}, p = 1, R = 4.0,
299299
# Setup the initial history and get the total energy
300300
history, Qtot = initial_history(particles)
301301

302-
clusterseq = ClusterSequence{EEjet{ParticleType}}(algorithm, p, R, RecoStrategy.N2Plain, particles, history,
303-
Qtot)
302+
clusterseq = ClusterSequence{EEjet{ParticleType}}(algorithm, p, R, RecoStrategy.N2Plain,
303+
particles, history,
304+
Qtot)
304305

305306
# Run over initial pairs of jets to find nearest neighbours
306307
get_angular_nearest_neighbours!(eereco, algorithm, dij_factor)

src/EEjet.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ mutable struct EEjet{T <: Real} <: FourMomentum
2727
_cluster_hist_index::Int
2828
end
2929

30-
3130
"""
3231
Base.eltype(::Type{EEjet{T}}) where T
3332
3433
Return the element type of the `EEjet` struct.
3534
"""
36-
Base.eltype(::Type{EEjet{T}}) where T = T
37-
35+
Base.eltype(::Type{EEjet{T}}) where {T} = T
3836

3937
"""
4038
EEjet(px::T, py::T, pz::T, E::T, _cluster_hist_index::Integer) where {T <: Real}
@@ -106,8 +104,8 @@ Constructs an `EEjet` object with conversion of the given momentum components
106104
An `EEjet` object with the momentum components and energy parametrised to type
107105
`U`.
108106
"""
109-
EEjet{U}(px::T, py::T, pz::T, E::T) where {T <: Real, U <: Real} = EEjet(U(px), U(py), U(pz), U(E), 0)
110-
107+
EEjet{U}(px::T, py::T, pz::T, E::T) where {T <: Real, U <: Real} = EEjet(U(px), U(py),
108+
U(pz), U(E), 0)
111109

112110
"""
113111
EEjet(pj::PseudoJet) -> EEjet
@@ -122,7 +120,6 @@ Constructs an `EEjet` object from a given `PseudoJet` object `pj`.
122120
"""
123121
EEjet(pj::PseudoJet) = EEjet(px(pj), py(pj), pz(pj), energy(pj), cluster_hist_index(pj))
124122

125-
126123
p2(eej::EEjet) = eej._p2
127124
pt2(eej::EEjet) = eej.px^2 + eej.py^2
128125
const kt2 = pt2

src/PlainAlgo.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ generalised k_t algorithm.
281281
"""
282282
function _plain_jet_reconstruct(; particles::Vector{PseudoJet{T}}, p = -1, R = 1.0,
283283
algorithm::JetAlgorithm.Algorithm = JetAlgorithm.AntiKt,
284-
recombine = +) where T <: Real
284+
recombine = +) where {T <: Real}
285285
# Bounds
286286
N::Int = length(particles)
287287
# Parameters
@@ -308,8 +308,10 @@ function _plain_jet_reconstruct(; particles::Vector{PseudoJet{T}}, p = -1, R = 1
308308
# Current implementation mutates the particles vector, so need to copy it
309309
# for the cluster sequence (there is too much copying happening, so this
310310
# needs to be rethought and reoptimised)
311-
clusterseq = ClusterSequence{PseudoJet{ParticleType}}(algorithm, p, R, RecoStrategy.N2Plain, particles, history,
312-
Qtot)
311+
clusterseq = ClusterSequence{PseudoJet{ParticleType}}(algorithm, p, R,
312+
RecoStrategy.N2Plain, particles,
313+
history,
314+
Qtot)
313315

314316
# Initialize nearest neighbours
315317
@simd for i in 1:N

src/Pseudojet.jl

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ end
5353
5454
Return the element type of the `PseudoJet` struct.
5555
"""
56-
Base.eltype(::Type{PseudoJet{T}}) where T = T
56+
Base.eltype(::Type{PseudoJet{T}}) where {T} = T
5757

5858
"""
5959
PseudoJet(px::T, py::T, pz::T, E::T,
@@ -75,10 +75,10 @@ history index.
7575
A `PseudoJet` object.
7676
"""
7777
PseudoJet(px::T, py::T, pz::T, E::T,
78-
_cluster_hist_index::Int,
79-
pt2::T) where {T <: Real} = PseudoJet{T}(px,
80-
py, pz, E, _cluster_hist_index,
81-
pt2, 1.0 / pt2, _invalid_rap, _invalid_phi)
78+
_cluster_hist_index::Int,
79+
pt2::T) where {T <: Real} = PseudoJet{T}(px,
80+
py, pz, E, _cluster_hist_index,
81+
pt2, 1.0 / pt2, _invalid_rap, _invalid_phi)
8282

8383
"""
8484
PseudoJet{T}(px::T, py::T, pz::T, E::T,
@@ -100,10 +100,10 @@ and energy and history index.
100100
A `PseudoJet` object.
101101
"""
102102
PseudoJet{T}(px::T, py::T, pz::T, E::T,
103-
_cluster_hist_index::Int,
104-
pt2::T) where {T <: Real} = PseudoJet{T}(px,
105-
py, pz, E, _cluster_hist_index,
106-
pt2, 1.0 / pt2, _invalid_rap, _invalid_phi)
103+
_cluster_hist_index::Int,
104+
pt2::T) where {T <: Real} = PseudoJet{T}(px,
105+
py, pz, E, _cluster_hist_index,
106+
pt2, 1.0 / pt2, _invalid_rap, _invalid_phi)
107107

108108
"""
109109
PseudoJet(px::T, py::T, pz::T, E::T) where T <: Real
@@ -125,8 +125,12 @@ pz::T, E::T) where {T <: Real} = PseudoJet(px, py, pz, E, 0, px^2 + py^2)
125125
"""
126126
PseudoJet{U}(px::T, py::T, pz::T, E::T) where T <: Real, U <: Real
127127
"""
128-
PseudoJet{U}(px::T, py::T, pz::T, E::T) where {T <: Real, U <: Real} = PseudoJet{U}(U(px), U(py), U(pz), U(E), 0, U(px^2 + py^2))
129-
128+
PseudoJet{U}(px::T, py::T, pz::T, E::T) where {T <: Real, U <: Real} = PseudoJet{U}(U(px),
129+
U(py),
130+
U(pz),
131+
U(E), 0,
132+
U(px^2 +
133+
py^2))
130134

131135
import Base.show
132136
"""

src/TiledAlgoLL.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ function tiled_jet_reconstruct(particles::AbstractArray{T, 1}; p::Union{Real, No
385385
sizehint!(recombination_particles, length(particles) * 2)
386386
for i in eachindex(particles)
387387
push!(recombination_particles,
388-
PseudoJet{ParticleType}(px(particles[i]), py(particles[i]), pz(particles[i]),
389-
energy(particles[i])))
388+
PseudoJet{ParticleType}(px(particles[i]), py(particles[i]),
389+
pz(particles[i]),
390+
energy(particles[i])))
390391
end
391392
end
392393

@@ -424,7 +425,7 @@ tiled_jet_reconstruct(particles::Vector{PseudoJet}; p = 1, R = 1.0, recombine =
424425
"""
425426
function _tiled_jet_reconstruct(particles::Vector{PseudoJet{T}}; p::Real = -1, R = 1.0,
426427
algorithm::JetAlgorithm.Algorithm = JetAlgorithm.AntiKt,
427-
recombine = +) where T <: Real
428+
recombine = +) where {T <: Real}
428429
# Bounds
429430
N::Int = length(particles)
430431

@@ -468,7 +469,9 @@ function _tiled_jet_reconstruct(particles::Vector{PseudoJet{T}}; p::Real = -1, R
468469
tiling = Tiling(setup_tiling(_eta, R))
469470

470471
# ClusterSequence is the struct that holds the state of the reconstruction
471-
clusterseq = ClusterSequence{PseudoJet{ParticleType}}(algorithm, p, R, RecoStrategy.N2Tiled, jets, history, Qtot)
472+
clusterseq = ClusterSequence{PseudoJet{ParticleType}}(algorithm, p, R,
473+
RecoStrategy.N2Tiled, jets,
474+
history, Qtot)
472475

473476
# Tiled jets is a structure that has additional variables for tracking which tile a jet is in
474477
tiledjets = similar(clusterseq.jets, TiledJet)

0 commit comments

Comments
 (0)