-
Notifications
You must be signed in to change notification settings - Fork 10
fix GenKt not recognized as pp algorithm #119
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1ba4bad
fix GenKt not recognized as pp algorithm
m-fila 1ae59ac
add test for GenKt, rename reference fastjet GenKt file
m-fila b09d8bb
delete obsolete testing function
m-fila a904f6c
move test parameters to constants
m-fila 378f520
allow GenKt in `exclusive_jets`
m-fila 1c081c1
test exclusive jets with different power
m-fila a6fb970
fix exclusive jets algorithm power check
m-fila 6196918
fix format
m-fila 76e70dc
fix test file comment, remove obsolete const, remove test verbosity
m-fila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# File: test/test_test-selection.jl | ||
|
||
include("common.jl") | ||
const test_cone_size = 0.4 | ||
|
||
""" Helper function to test exclusive jets selection with given algorithm power argument.""" | ||
function test_exclusive_jets_power(event, algo; p = nothing, should_throw::Bool) | ||
test_cone_size = 0.4 | ||
test_strategy = RecoStrategy.Best | ||
test_njets = 4 | ||
|
||
@testset "Exclusive jets selection: alg=$(algo) p=$(p)" begin | ||
cluster_seq = JetReconstruction.jet_reconstruct(event; algorithm = algo, p = p, | ||
R = test_cone_size, | ||
strategy = test_strategy) | ||
if should_throw | ||
@test_throws ArgumentError begin | ||
JetReconstruction.exclusive_jets(cluster_seq; njets = test_njets) | ||
end | ||
else | ||
@test JetReconstruction.exclusive_jets(cluster_seq; njets = test_njets) isa Any | ||
end | ||
end | ||
end | ||
|
||
@testset "Exclusive jets selection algorithm power requirements" verbose=true begin | ||
pp_event = first(JetReconstruction.read_final_state_particles(events_file_pp)) | ||
ee_event = first(JetReconstruction.read_final_state_particles(events_file_ee)) | ||
|
||
# Tests for pp_event | ||
test_exclusive_jets_power(pp_event, JetAlgorithm.GenKt; p = -1.0, | ||
should_throw = true) | ||
test_exclusive_jets_power(pp_event, JetAlgorithm.GenKt; p = 1.0, | ||
should_throw = false) | ||
test_exclusive_jets_power(pp_event, JetAlgorithm.AntiKt; should_throw = true) | ||
for alg in [JetAlgorithm.CA, JetAlgorithm.Kt] | ||
test_exclusive_jets_power(pp_event, alg; should_throw = false) | ||
end | ||
|
||
# Tests for ee_event | ||
test_exclusive_jets_power(ee_event, JetAlgorithm.EEKt; p = -1.0, | ||
should_throw = true) | ||
test_exclusive_jets_power(ee_event, JetAlgorithm.EEKt; p = 1.0, | ||
should_throw = false) | ||
test_exclusive_jets_power(ee_event, JetAlgorithm.Durham; should_throw = false) | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filename is wrong.
The comment should describe better the aim of these tests of exclusive jet selection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, must be some stupid IDE extension 😅