@@ -7,12 +7,7 @@ Validates clustering results and cluster sequence against FastJet C++ reference
77using jet matching to handle numerical precision differences.
88"""
99
10- # Include common test utilities
1110include (" common.jl" )
12- import JetReconstruction: pt, rapidity, PseudoJet
13-
14- using Test
15- using JetReconstruction
1611
1712# Reference outputs for R=0.8, beta=1.2, gamma=1.2
1813valencia_inclusive = ComparisonTestValencia (events_file_ee,
@@ -69,3 +64,34 @@ valencia_exclusive_d500_b1g1 = ComparisonTestValencia(events_file_ee,
6964 cs -> exclusive_jets (cs; dcut = 500.0 ),
7065 " exclusive dcut=500 beta=1.0 gamma=1.0 R=1.0" )
7166run_reco_test (valencia_exclusive_d500_b1g1)
67+
68+ # Bring required types/functions into scope for targeted unit tests
69+ using JetReconstruction: EERecoJet, PseudoJet, EEJet, ee_genkt_algorithm, dij_dist,
70+ valencia_distance
71+
72+ # Test dij_dist for Valencia algorithm
73+ @testset " dij_dist Valencia" begin
74+ # Minimal eereco with two reco jets; only nx,ny,nz,E2p are used by valencia_distance
75+ eereco = EERecoJet[EERecoJet (1 , 0 , Inf , Inf , 1.0 , 0.0 , 0.0 , 1.0 ),
76+ EERecoJet (2 , 0 , Inf , Inf , 0.0 , 1.0 , 0.0 , 2.0 )]
77+ dij = dij_dist (eereco, 1 , 2 , 1.0 , JetAlgorithm. Valencia, 0.8 )
78+ @test dij ≈ valencia_distance (eereco, 1 , 2 , 0.8 )
79+ end
80+
81+ # Test ee_genkt_algorithm for Valencia algorithm (covers β override and dij_factor selection)
82+ @testset " ee_genkt_algorithm Valencia" begin
83+ particles = [PseudoJet (1.0 , 0.0 , 0.0 , 1.0 )]
84+ cs = ee_genkt_algorithm (particles; algorithm = JetAlgorithm. Valencia, β = 1.2 , γ = 1.2 ,
85+ R = 0.8 )
86+ @test cs isa JetReconstruction. ClusterSequence
87+ end
88+
89+ # Test internal _ee_genkt_algorithm entry (touches StructArray init path too)
90+ @testset " _ee_genkt_algorithm Valencia dij_factor" begin
91+ # Ensure cluster_hist_index(i) == i for initial jets
92+ jets = [EEJet (1.0 , 0.0 , 0.0 , 1.0 ; cluster_hist_index = 1 )]
93+ cs = JetReconstruction. _ee_genkt_algorithm (particles = jets,
94+ algorithm = JetAlgorithm. Valencia, p = 1.2 ,
95+ R = 0.8 , γ = 1.2 )
96+ @test cs isa JetReconstruction. ClusterSequence
97+ end
0 commit comments