33include (" common.jl" )
44
55function main ()
6- # A few unit tests
7- @testset " Algorithm/power consistency" begin
8- @test JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. AntiKt,
9- p = - 1 )
10- @test JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. CA,
11- p = 0 )
12- @test JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. Kt,
13- p = 1 )
6+ # Algorithm/power consistency checks
7+ include (" test-algpower-consistency.jl" )
148
15- @test JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. AntiKt,
16- p = nothing )
17- @test JetReconstruction. check_algorithm_power_consistency (algorithm = nothing ,
18- p = - 1 )
19-
20- @test_throws ArgumentError JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. AntiKt,
21- p = 0 )
22- @test_throws ArgumentError JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. Kt,
23- p = 1.5 )
24-
25- @test JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. GenKt,
26- p = 1.5 )
27- @test JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. GenKt,
28- p = - 0.5 )
29-
30- @test_throws ArgumentError JetReconstruction. check_algorithm_power_consistency (algorithm = JetAlgorithm. GenKt,
31- p = nothing )
32- end
9+ # jet_reconstruct() interface check
10+ include (" test-jet_reconstruct-interface.jl" )
3311
3412 # New test structure, factorised tests for pp and e+e-
3513 include (" test-pp-reconstruction.jl" )
@@ -39,8 +17,7 @@ function main()
3917 include (" test-selection.jl" )
4018
4119 # Compare inputting data in PseudoJet with using a LorentzVector
42- do_test_compare_types (RecoStrategy. N2Plain, algname = pp_algorithms[- 1 ], power = - 1 )
43- do_test_compare_types (RecoStrategy. N2Tiled, algname = pp_algorithms[- 1 ], power = - 1 )
20+ include (" test-compare-types.jl" )
4421
4522 # Check jet constituents
4623 include (" test-constituents.jl" )
@@ -58,61 +35,6 @@ function main()
5835 include (" test-aqua.jl" )
5936end
6037
61- function do_test_compare_types (strategy:: RecoStrategy.Strategy ;
62- algname = " Unknown" ,
63- ptmin:: Float64 = 5.0 ,
64- distance:: Float64 = 0.4 ,
65- power:: Integer = - 1 )
66-
67- # Strategy
68- if (strategy == RecoStrategy. N2Plain)
69- jet_reconstruction = plain_jet_reconstruct
70- strategy_name = " N2Plain"
71- elseif (strategy == RecoStrategy. N2Tiled)
72- jet_reconstruction = tiled_jet_reconstruct
73- strategy_name = " N2Tiled"
74- else
75- throw (ErrorException (" Strategy not yet implemented" ))
76- end
77-
78- # Now run our jet reconstruction...
79- # From PseudoJets
80- events:: Vector{Vector{PseudoJet}} = read_final_state_particles (events_file_pp)
81- jet_collection = FinalJets[]
82- for (ievt, event) in enumerate (events)
83- finaljets = final_jets (inclusive_jets (jet_reconstruction (event, R = distance,
84- p = power), ptmin = ptmin))
85- sort_jets! (finaljets)
86- push! (jet_collection, FinalJets (ievt, finaljets))
87- end
88-
89- # From LorentzVector
90- events_lv:: Vector{Vector{LorentzVector}} = read_final_state_particles (events_file_pp;
91- T = LorentzVector)
92- jet_collection_lv = FinalJets[]
93- for (ievt, event) in enumerate (events_lv)
94- finaljets = final_jets (inclusive_jets (jet_reconstruction (event, R = distance,
95- p = power), ptmin = ptmin))
96- sort_jets! (finaljets)
97- push! (jet_collection_lv, FinalJets (ievt, finaljets))
98- end
99-
100- @testset " Jet Reconstruction Compare PseudoJet and LorentzVector, Strategy $strategy_name , Algorithm $algname " begin
101- # Here we test that inputting LorentzVector gave the same results as PseudoJets
102- for (ievt, (event, event_lv)) in enumerate (zip (jet_collection, jet_collection_lv))
103- @testset " Event $(ievt) " begin
104- @test size (event. jets) == size (event_lv. jets)
105- # Test each jet in turn
106- for (jet, jet_lv) in zip (event. jets, event_lv. jets)
107- @test jet. rap≈ jet_lv. rap atol= 1e-7
108- @test jet. phi≈ jet_lv. phi atol= 1e-7
109- @test jet. pt≈ jet_lv. pt rtol= 1e-6
110- end
111- end
112- end
113- end
114- end
115-
11638logger = ConsoleLogger (stdout , Logging. Warn)
11739global_logger (logger)
11840main ()
0 commit comments