Commit 44fcc6d6 authored by Juergen Reuter's avatar Juergen Reuter
Browse files

5059e63 Merge branch 'fix_ordering_recombination' into 'master'

parent 98850e87
......@@ -6399,41 +6399,45 @@ create a mask which is true only for those particles that pass the test.
logical :: keep_flv
reco_r0 = en1%photon_rec_r0
n1 = subevt_get_length (en1%pval)
if (n1 > 1) then
call msg_fatal ("Photon recombination is supported " // &
"only for single photons.")
end if
allocate (prt_gam0 (n1), mask1 (n1))
do i = 1, n1
prt_gam0(i) = subevt_get_prt (en1%pval, i)
end do
if (present (en0)) then
if (n1 == 0) then
subevt = en2%pval
else
if (n1 > 1) then
call msg_fatal ("Photon recombination is supported " // &
"only for single photons.")
end if
allocate (prt_gam0 (n1), mask1 (n1))
do i = 1, n1
en0%index = i
en0%prt1 = prt_gam0(i)
if (.not. prt_is_photon (en0%prt1)) &
call msg_fatal ("Photon recombination can only " // &
"be applied to photons.")
call eval_node_evaluate (en0)
mask1(i) = en0%lval
prt_gam0(i) = subevt_get_prt (en1%pval, i)
end do
else
mask1 = .true.
end if
do i = 1, subevt_get_length (en2%pval)
if (.not. prt_is_recombinable (subevt_get_prt (en2%pval, i))) then
call msg_fatal ("Only charged leptons and QCD partons " //&
"can be recombined with photons")
if (present (en0)) then
do i = 1, n1
en0%index = i
en0%prt1 = prt_gam0(i)
if (.not. prt_is_photon (en0%prt1)) &
call msg_fatal ("Photon recombination can only " // &
"be applied to photons.")
call eval_node_evaluate (en0)
mask1(i) = en0%lval
end do
else
mask1 = .true.
end if
end do
if (associated (en1%var_list)) then
keep_flv = en1%var_list%get_lval &
(var_str("?keep_flavors_when_recombining"))
else
keep_flv = .false.
do i = 1, subevt_get_length (en2%pval)
if (.not. prt_is_recombinable (subevt_get_prt (en2%pval, i))) then
call msg_fatal ("Only charged leptons and QCD partons " //&
"can be recombined with photons")
end if
end do
if (associated (en1%var_list)) then
keep_flv = en1%var_list%get_lval &
(var_str("?keep_flavors_when_recombining"))
else
keep_flv = .false.
end if
call subevt_recombine &
(subevt, en2%pval, prt_gam0(1), mask1(1), reco_r0, keep_flv)
end if
call subevt_recombine &
(subevt,en2%pval, prt_gam0(1), mask1(1), reco_r0, keep_flv)
end subroutine photon_recombination_pp
 
@ %def photon_recombination_pp
......
......@@ -4322,14 +4322,14 @@ that have been constructed by FastJet and its interface.
i_sortr = order (del_rij)
call subevt_reset (subevt, pl%n_active)
do i = 1, n
if (i == i_sortr(n)) then
if (del_rij (i_sortr (n)) <= reco_r0 .and. mask1) then
pdg_orig = prt_get_pdg (pl%prt (i_sortr (n)))
call prt_combine (prt_comb, prt, pl%prt(i_sortr (n)), ok)
if (i == i_sortr(1)) then
if (del_rij (i_sortr (1)) <= reco_r0 .and. mask1) then
pdg_orig = prt_get_pdg (pl%prt (i_sortr (1)))
call prt_combine (prt_comb, prt, pl%prt(i_sortr (1)), ok)
if (ok) then
subevt%prt(i_sortr (n)) = prt_comb
subevt%prt(i_sortr (1)) = prt_comb
if (keep_flv) call prt_set_pdg &
(subevt%prt(i_sortr (n)), pdg_orig)
(subevt%prt(i_sortr (1)), pdg_orig)
end if
end if
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment