-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreal.f
324 lines (290 loc) · 10.7 KB
/
real.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
subroutine setreal(p,rflav,amp2)
implicit none
include 'nlegborn.h'
include 'pwhg_st.h'
include 'pwhg_math.h'
include 'PhysPars.h'
c to use madgraph
include 'coupl.inc'
real * 8 p(0:3,nlegreal)
integer rflav(nlegreal)
real * 8 amp2,amp2_mad
cccccccccccccccccccccccccccccccc
c common bl. originally present in lh_readin, needed
c by my_setpara
c
c Common to lh_readin and printout
c
double precision alpha, gfermi, alfas
double precision mtMS,mbMS,mcMS,mtaMS!MSbar masses
double precision Vud !CKM matrix elements
common/values/ alpha,gfermi,alfas,
& mtMS,mbMS,mcMS,mtaMS,
& Vud
ccccccccccccccccccccccccccccccccc
cccccccccccccccccc
integer nleg
parameter (nleg=nlegreal)
real *8 krlab_ME_int(0:3,nleg),krlab_mad(0:3,nleg),ptemp(0:3)
integer rflav_ME_int(nleg)
integer rflav_loc(nleg)
real *8 ewcoupl
integer mu,ileg
integer three_ch(-6:6)
data three_ch /-2,1,-2,1,-2,1,0,-1,2,-1,2,-1,2/
real *8 ckm_b_s
integer chflag
common/cchflag/chflag
real *8 st_real_qq_reg,st_real_qg_reg
external st_real_qq_reg,st_real_qg_reg
real *8 dotp
external dotp
logical ini
data ini/.true./
save ini
logical mad_ME
parameter (mad_ME=.true.)
integer rflav_t(nleg)
ccccccccccccccccccccccccccccccccccccccc
c charge conjugation
c if ttype=-1, then rflav has been filled with tbar
c production flavours. Subroutines here work for t flavour.
c Therefore, invert the sign of local flavours. To avoid confusion,
c here I use rflav_t, since in this subroutine rflav_loc is used
c for another issue.
do ileg=1,nleg
rflav_t(ileg)= ttype *rflav(ileg)
enddo
ccccccccccccccccccccccccccccccccccccccc
c local copy of input variables (p->krlab_ME_int, rflav->rflav_loc)
c convert input flavour string into rflav_ME_int, needed by ME
c rflav_ME_int has only flavours -2,-1,0,1,2
do ileg=1,nleg
rflav_loc(ileg)=rflav_t(ileg)
rflav_ME_int(ileg)=rflav_t(ileg)
if(ileg.ne.3) then
if(abs(rflav_ME_int(ileg)).eq.3) then
rflav_ME_int(ileg)=sign(1,rflav_ME_int(ileg))
elseif(abs(rflav_ME_int(ileg)).eq.4) then
rflav_ME_int(ileg)=sign(1,rflav_ME_int(ileg)) *2
elseif(abs(rflav_ME_int(ileg)).eq.5) then
rflav_ME_int(ileg)=sign(1,rflav_ME_int(ileg))
endif
endif
do mu=0,3
krlab_ME_int(mu,ileg)=p(mu,ileg)
enddo
enddo
c check
if (abs(rflav_loc(3)).ne.6) then
write(*,*) 'real_ampsq: ERROR in flavor assignement'
call exit(1)
endif
c ew coupling
ewcoupl=4d0*pi*alphaem_pow/sthw2_pow
if(ini) then
write(*,*) 'ew coupl= ',ewcoupl
ini=.false.
endif
ccccccccccccccccccccccccccccccccccccccccccc
c >>> S CHANNEL <<<
ccccccccccccccccccccccccccccccccccccccccccc
if(rflav_loc(nleg).eq.0) then
c udx
if ((three_ch(rflav_loc(1)).eq.2).and.
#(three_ch(rflav_loc(2)).eq.1).and.
#(three_ch(rflav_loc(4)).eq.1)) then
ckm_b_s=
#CKM(abs(rflav_loc(1)),abs(rflav_loc(2)))**2
#* CKM(abs(rflav_loc(3)),abs(rflav_loc(4)))**2
c dxu
elseif ((three_ch(rflav_loc(1)).eq.1).and.
#(three_ch(rflav_loc(2)).eq.2).and.
#(three_ch(rflav_loc(4)).eq.1)) then
ckm_b_s=
#CKM(abs(rflav_loc(1)),abs(rflav_loc(2)))**2
#* CKM(abs(rflav_loc(3)),abs(rflav_loc(4)))**2
else
write(*,*) 'Error in fill_real, (s,1)'
call exit(1)
endif
elseif((rflav_loc(1).eq.0).or.(rflav_loc(2).eq.0)) then
c If rflav_loc(5) is not a gluon, sometimes an exchange is needed,
c since both madgraph and mcnlo subroutines assume an order of parton 4 and 5 id's.
c In particular, they assume that the 4th and 5th flavours are sorted INCREASINGLY.
c The only exception is for the process gu->tddx and ug->tddx.
c Therefore, reorder the 'ME_int' variables, if needed.
c !: WARNING
c In the s-channel, the BOX CAN call this subroutine with the wrong
c ordering ALSO FOR gu->tddx and ug->tddx. This ALWAYS happens.
c In these cases, perform a switch to call madgraph or mcnlo properly.
if((rflav_ME_int(1)+rflav_ME_int(2)).eq.2) then
if((rflav_ME_int(4).ne.1).or.(rflav_ME_int(5).ne.-1)) then
if((rflav_ME_int(4).ne.-1).or.(rflav_ME_int(5).ne.1))then
write(*,*) 'Error in fill_real'
write(*,*) 'Unrecognized ordering for gu/ug'
write(*,*) 'rflav_loc ',rflav_loc
write(*,*) 'rflav_ME_int ',rflav_ME_int
call exit(1)
else
c reorder momenta
do mu=0,3
ptemp(mu)=krlab_ME_int(mu,4)
krlab_ME_int(mu,4)=krlab_ME_int(mu,5)
krlab_ME_int(mu,5)=ptemp(mu)
enddo
c reorder the fundamental flavour assignment
ileg=rflav_ME_int(4)
rflav_ME_int(4)=rflav_ME_int(5)
rflav_ME_int(5)=ileg
c reorder also rflav_loc, since the ordering described above is assumed
c also by the if-sequence that fills CKM weight
ileg=rflav_loc(4)
rflav_loc(4)=rflav_loc(5)
rflav_loc(5)=ileg
endif
else
write(*,*) 'Normal ordering in gu/ug...!!!!'
call exit(1)
endif
else
if(rflav_ME_int(4).gt.rflav_ME_int(5)) then
c reorder momenta
do mu=0,3
ptemp(mu)=krlab_ME_int(mu,4)
krlab_ME_int(mu,4)=krlab_ME_int(mu,5)
krlab_ME_int(mu,5)=ptemp(mu)
enddo
c reorder the fundamental flavour assignment
ileg=rflav_ME_int(4)
rflav_ME_int(4)=rflav_ME_int(5)
rflav_ME_int(5)=ileg
c reorder also rflav_loc, since the ordering described above is assumed
c also by the if-sequence that fills CKM weight
ileg=rflav_loc(4)
rflav_loc(4)=rflav_loc(5)
rflav_loc(5)=ileg
endif
endif
if(rflav_loc(1).eq.0) then
c gdx -> tuxdx (s-channel)
if ((three_ch(rflav_loc(1)).eq.0).and.
#(three_ch(rflav_loc(2)).eq.1).and.
#(three_ch(rflav_loc(4)).eq.-2)) then
ckm_b_s=
#CKM(abs(rflav_loc(2)),abs(rflav_loc(4)))**2
#* CKM(abs(rflav_loc(3)),abs(rflav_loc(5)))**2
c gu -> tddx (s-channel)
elseif ((three_ch(rflav_loc(1)).eq.0).and.
#(three_ch(rflav_loc(2)).eq.2).and.
#(three_ch(rflav_loc(4)).eq.-1)) then
ckm_b_s=
#CKM(abs(rflav_loc(2)),abs(rflav_loc(4)))**2
#* CKM(abs(rflav_loc(3)),abs(rflav_loc(5)))**2
else
write(*,*) 'Error in fill_real, (s,2)',rflav
call exit(1)
endif
elseif(rflav_loc(2).eq.0) then
c dxg -> tuxdx (s-channel)
if ((three_ch(rflav_loc(1)).eq.1).and.
#(three_ch(rflav_loc(2)).eq.0).and.
#(three_ch(rflav_loc(4)).eq.-2)) then
ckm_b_s=
#CKM(abs(rflav_loc(1)),abs(rflav_loc(4)))**2
#* CKM(abs(rflav_loc(3)),abs(rflav_loc(5)))**2
c ug -> tddx (s-channel)
elseif ((three_ch(rflav_loc(1)).eq.2).and.
#(three_ch(rflav_loc(2)).eq.0).and.
#(three_ch(rflav_loc(4)).eq.-1)) then
ckm_b_s=
#CKM(abs(rflav_loc(1)),abs(rflav_loc(4)))**2
#* CKM(abs(rflav_loc(3)),abs(rflav_loc(5)))**2
else
write(*,*) 'Error in fill_real, (s,3)'
call exit(1)
endif
else
write(*,*) 'Error in fill_real, g in initial state'
call exit(1)
endif
else
write(*,*) 'problem in real_ampsq'
call exit(1)
endif
cccccccccccccccccccccccccccccccccccccccccccccc
if(mad_ME) then
c USING MADGRAPH SUBROUTINES
c assign krlab_mad, with momenta ordered as in mcnlo
do ileg=1,5
do mu=0,3
krlab_mad(mu,ileg)=krlab_ME_int(mu,ileg)
enddo
enddo
c to avoid bugs in HELAS, restore exact masslessness of incoming partons
krlab_mad(0,1)=dabs(krlab_mad(3,1))
krlab_mad(0,2)=dabs(krlab_mad(3,2))
c needed to check undecayed matrix elements
alfas=st_alpha
mtMS=sqrt(dotp(krlab_mad(0,3),krlab_mad(0,3)))
tmass=mtMS
twidth=0d0
wwidth=0d0
call my_setpara
if(three_ch(rflav_loc(1)).eq.0) then
c incoming gluon (leg 1)
c gdx -> tuxdx
if((three_ch(rflav_loc(2)).eq.1).and.
#(three_ch(rflav_loc(4)).eq.-2)) then
call Sgdx_tuxbx_S(krlab_mad,amp2_mad)
c gu -> tddx
elseif((three_ch(rflav_loc(2)).eq.2).and.
#(three_ch(rflav_loc(4)).eq.-1)) then
call Sgu_tdbx_S(krlab_mad,amp2_mad)
else
write(*,*) 'Wrong rflav in gq: ',rflav
call exit(1)
endif
elseif(three_ch(rflav_loc(2)).eq.0) then
c incoming gluon (leg 2)
c dxg -> tuxdx
if((three_ch(rflav_loc(1)).eq.1).and.
#(three_ch(rflav_loc(4)).eq.-2)) then
call Sdxg_tuxbx_S(krlab_mad,amp2_mad)
c ug -> tddx
elseif((three_ch(rflav_loc(1)).eq.2).and.
#(three_ch(rflav_loc(4)).eq.-1)) then
call Sug_tdbx_S(krlab_mad,amp2_mad)
else
write(*,*) 'Wrong rflav in qg: ',rflav_loc
call exit(1)
endif
elseif((three_ch(rflav_loc(1)).ne.0).and.
#(three_ch(rflav_loc(2)).ne.0))then
c born-like + outgoing gluon (i.e. as born)
c udx
if ((three_ch(rflav_loc(1)).eq.2).and.
#(three_ch(rflav_loc(2)).eq.1).and.
#(three_ch(rflav_loc(4)).eq.1)) then
call Sudx_tbxg(krlab_mad,amp2_mad)
c dxu
elseif ((three_ch(rflav_loc(1)).eq.1).and.
#(three_ch(rflav_loc(2)).eq.2).and.
#(three_ch(rflav_loc(4)).eq.1)) then
call Sdxu_tbxg(krlab_mad,amp2_mad)
else
write(*,*) 'Wrong rflav in qq: ',rflav_loc
call exit(1)
endif
else
write(*,*) 'Error in tdecay (real, sch)'
call exit(1)
endif
endif
ccccccccccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccc
c assign output
amp2_mad=amp2_mad *ckm_b_s
amp2=amp2_mad/(st_alpha/2./pi)
cccccccccccccccccccccc
end