Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multiple algorithms to work with N2Tiled strategy #32

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/PlainAlgo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ which is already done for the two types above.
"""
function plain_jet_reconstruct(particles::Vector{T}; p = -1, R = 1.0, recombine = +, ptmin = 0.0) where T
# Integer p if possible
p = (round(p) == p) ? Int(p) : p
p = (round(p) == p) ? Int(p) : p

# We make sure these arrays are type stable - have seen issues where, depending on the values
# returned by the methods, they can become unstable and performance degrades
Expand Down
8 changes: 4 additions & 4 deletions src/TiledAlgoLL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ end


"""Initialise a tiled jet from a PseudoJet (using an index into our ClusterSequence)"""
tiledjet_set_jetinfo!(jet::TiledJet, clusterseq::ClusterSequence, jets_index, R2) = begin
tiledjet_set_jetinfo!(jet::TiledJet, clusterseq::ClusterSequence, jets_index, R2, p) = begin
@inbounds jet.eta = rapidity(clusterseq.jets[jets_index])
@inbounds jet.phi = phi_02pi(clusterseq.jets[jets_index])
@inbounds jet.kt2 = pt2(clusterseq.jets[jets_index]) > 1.e-300 ? 1.0 / pt2(clusterseq.jets[jets_index]) : 1.e300
@inbounds jet.kt2 = pt2(clusterseq.jets[jets_index]) > 1.e-300 ? pt2(clusterseq.jets[jets_index])^p : 1.e300
jet.jets_index = jets_index
# Initialise NN info as well
jet.NN_dist = R2
Expand Down Expand Up @@ -360,7 +360,7 @@ function tiled_jet_reconstruct(particles::Vector{PseudoJet}; p = -1, R = 1.0, re
tiledjets = similar(clusterseq.jets, TiledJet)
for ijet in eachindex(tiledjets)
tiledjets[ijet] = TiledJet(ijet)
tiledjet_set_jetinfo!(tiledjets[ijet], clusterseq, ijet, R2)
tiledjet_set_jetinfo!(tiledjets[ijet], clusterseq, ijet, R2, p)
end

# Now initalise all of the nearest neighbour tiles
Expand Down Expand Up @@ -400,7 +400,7 @@ function tiled_jet_reconstruct(particles::Vector{PseudoJet}; p = -1, R = 1.0, re
oldB = copy(jetB) # take a copy because we will need it...

tiledjet_remove_from_tiles!(clusterseq.tiling, jetB)
tiledjet_set_jetinfo!(jetB, clusterseq, nn, R2) # cause jetB to become _jets[nn]
tiledjet_set_jetinfo!(jetB, clusterseq, nn, R2, p) # cause jetB to become _jets[nn]
# (in addition, registers the jet in the tiling)
else
# Jet-beam recombination
Expand Down
5 changes: 4 additions & 1 deletion test/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
## Files

- `events.hepmc3.gz` - 100 Pythia 13TeV envents in HepMC3 format (compressed)
- Unzip to `evemts.hepmc3` for actual use

- `jet_collections_fastjet.json` - JSON output from running jet reconstruction using FastJet 3.4.1, with R=0.4 and p_t_min=5.0
- `jet_collections_fastjet_akt.json` - JSON output from running anti-kt jet reconstruction using FastJet 3.4.1, with R=0.4 and p_t_min=5.0
- `jet_collections_fastjet_ca.json` - JSON output from running Cambridge/Achen jet reconstruction using FastJet 3.4.1, with R=0.4 and p_t_min=5.0
- `jet_collections_fastjet_ikt.json` - JSON output from running inclusive-kt jet reconstruction using FastJet 3.4.1, with R=0.4 and p_t_min=5.0
Loading
Loading