-
Notifications
You must be signed in to change notification settings - Fork 0
/
sigvirtual.f
89 lines (86 loc) · 2.66 KB
/
sigvirtual.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
subroutine sigvirtual(virt_arr)
implicit none
include 'nlegborn.h'
include 'pwhg_flst.h'
include 'pwhg_kn.h'
include 'pwhg_br.h'
include 'pwhg_flg.h'
real * 8 virt_arr(maxprocborn)
integer equivto(maxprocborn)
real * 8 equivcoef(maxprocborn)
integer nmomset
parameter (nmomset=10)
real * 8 pborn(0:3,nlegborn,nmomset),cprop
real * 8 virtual(nmomset,maxprocborn)
integer iborn,ibornpr,mu,nu,k,j,iret
logical ini
data ini/.true./
save ini,equivto,equivcoef
logical pwhg_isfinite
external pwhg_isfinite
if(ini) then
do iborn=1,flst_nborn
equivto(iborn)=-1
enddo
if(flg_smartsig) then
call randomsave
call fillmomenta(nlegborn,nmomset,kn_masses,pborn)
do iborn=1,flst_nborn
do j=1,nmomset
call setvirtual(pborn(0,1,j),flst_born(1,iborn),
# virtual(j,iborn))
c check if virtual(j,iborn) is finite
if (.not.pwhg_isfinite(virtual(j,iborn)))
# virtual(j,iborn)=0d0
enddo
call compare_vecsv(nmomset,iborn,virtual,ibornpr,
# cprop,iret)
if(iret.eq.0) then
equivto(iborn)=ibornpr
equivcoef(iborn)=1
elseif(iret.eq.1) then
equivto(iborn)=ibornpr
equivcoef(iborn)=cprop
endif
enddo
call randomrestore
endif
ini=.false.
endif
do iborn=1,flst_nborn
if(equivto(iborn).lt.0) then
call setvirtual(kn_cmpborn,flst_born(1,iborn),
# virt_arr(iborn))
c check if virt_arr(iborn) is finite
if (.not.pwhg_isfinite(virt_arr(iborn)))
# virt_arr(iborn)=0d0
virt_arr(iborn)=virt_arr(iborn)/(2*kn_sborn)
else
virt_arr(iborn)=virt_arr(equivto(iborn))*equivcoef(iborn)
endif
enddo
end
subroutine compare_vecsv(nmomset,iborn,res,ibornpr,cprop,iret)
implicit none
real * 8 ep
parameter (ep=1d-12)
integer nmomset,iborn,ibornpr,iret,j,k
real * 8 res(nmomset,iborn),cprop,rat
do j=1,iborn-1
rat=res(1,iborn)/res(1,j)
do k=1,nmomset
if(abs(1-res(k,iborn)/res(k,j)/rat).gt.ep) goto 10
enddo
if(abs(1-rat).lt.ep) then
iret=0
cprop=1
else
iret=1
cprop=rat
endif
ibornpr=j
return
10 continue
enddo
iret=-1
end