JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
mod_VHiggs.F90
Go to the documentation of this file.
1 !--YaofuZhou-----------------------------------------
2 module modvhiggs
3  use modparameters
4  use modmisc
5  implicit none
6  private
7 
8 
9  !----- notation for subroutines
10  public :: evalamp_vhiggs
11 
12 contains
13 
14 subroutine evalamp_vhiggs(id,helicity,MomExt,me2)
15  integer, intent(in) :: id(9)
16  real(8), intent(in) :: helicity(9)
17  real(8), intent(in) :: momext(1:4,1:9)
18  real(8), intent(out) :: me2
19  real(8) :: mass(3:5,1:2)
20  integer :: i
21  complex(8) amplitude, a_vv(1:4), amptest
22  integer :: idin(9)
23  real(8) :: helin(9)
24  real(8) :: pin(1:4,1:9)
25 
26  idin(:)=id(:)
27  helin(:)=helicity(:)
28  pin(:,:)=momext(:,:)
29  if(id(2).eq.convertlhe(pho_)) then
30  call swap(idin(1),idin(2))
31  call swap(helin(1),helin(2))
32  call swap(pin(:,1),pin(:,2))
33  endif
34  if(id(7).eq.convertlhe(pho_)) then
35  call swap(idin(6),idin(7))
36  call swap(helin(6),helin(7))
37  call swap(pin(:,6),pin(:,7))
38  endif
39 
40  do i=3,5
41  mass(i,1) = getmass(convertlhereverse(idin(i)))
42  mass(i,2) = getdecaywidth(convertlhereverse(idin(i)))
43  enddo
44 
45  a_vv(:)=czero
46  if(idin(1).ne.convertlhe(pho_) .and. idin(6).ne.convertlhe(pho_)) then
47  !print *,"Case1:"
48  a_vv(1)=matrixelement0(pin,mass,helin,idin,(/.false., .false./))
49  if(includegammastar) then
50  !print *,"Case2:"
51  a_vv(2) = matrixelement0(pin,mass,helin,idin,(/.false., .true./))
52  !print *,"Case3:"
53  a_vv(3) = matrixelement0(pin,mass,helin,idin,(/.true., .false./))
54  !print *,"Case4:"
55  a_vv(4) = matrixelement0(pin,mass,helin,idin,(/.true., .true./))
56  endif
57  else if(idin(1).eq.convertlhe(pho_) .and. idin(6).eq.convertlhe(pho_)) then
58  !print *,"Case5:"
59  a_vv(1)=matrixelement0(pin,mass,helin,idin,(/.true., .true./))
60  else if(idin(1).eq.convertlhe(pho_)) then
61  !print *,"Case6:"
62  a_vv(1)=matrixelement0(pin,mass,helin,idin,(/.true., .false./))
63  if(includegammastar) then
64  !print *,"Case7:"
65  a_vv(2) = matrixelement0(pin,mass,helin,idin,(/.true., .true./))
66  endif
67  else !if(idin(6).eq.convertLHE(Pho_)) then
68  !print *,"Case8:"
69  a_vv(1)=matrixelement0(pin,mass,helin,idin,(/.false., .true./))
70  if(includegammastar) then
71  !print *,"Case9:"
72  a_vv(2) = matrixelement0(pin,mass,helin,idin,(/.true., .true./))
73  endif
74  endif
75  amplitude = a_vv(1)+a_vv(2)+a_vv(3)+a_vv(4)
76 
77  ! XCHECK FROM DECAY ME
78  !print *,pin(:,1)
79  !print *,pin(:,2)
80  !print *,pin(:,6)
81  !print *,pin(:,7)
82  !print *,idin(1)
83  !print *,idin(2)
84  !print *,idin(3)
85  !print *,idin(4)
86  !print *,idin(6)
87  !print *,idin(7)
88  !print *,helin(1)
89  !print *,helin(2)
90  !print *,helin(6)
91  !print *,helin(7)
92  !print *,amplitude
93  !amptest = MATRIXELEMENT02(pin,mass,helin,idin)
94  !print *,amptest
95  !pause
96 
97  me2=dble(amplitude*dconjg(amplitude))
98  return
99 end subroutine evalamp_vhiggs
100 
101 !MATRIXELEMENT0.F
102 !VERSION 20160511
103  complex(8) function matrixelement0(MomExt,mass,helicity,id,useA)
104  implicit none
105  real(8), intent(in) :: momext(1:4,1:9)
106  real(8), intent(in) :: mass(3:5,1:2)
107  real(8), intent(in) :: helicity(9)
108  integer, intent(in) :: id(9)
109  logical, intent(in) :: usea(2)
110 
111  integer mu3,mu4
112  real(8) qq,q3_q3,q4_q4,q5_q5
113  complex(8) pvvx0p
114  complex(8) vcurrent1(4), acurrent1(4), current1(4), currentvp1(4)
115  complex(8) vcurrent2(4), acurrent2(4), current2(4), currentvp2(4)
116  complex(8) vpffcoupl(2,2)
117  complex(8) pol1(3,4), pol2(3,4)
118  complex(8) g_mu_nu(4,4), pp(4,4), epp(4,4)
119  complex(8) prop1, prop2, prop3
120  complex(8) prop_vp1, prop_vp2
121  complex(8) gffz, gffa, gffw
122  complex(8) gvvp, gvvs1, gvvs2
123  complex(8) ghz1_dyn,ghz2_dyn,ghz3_dyn,ghz4_dyn
124  complex(8) gvvpp, gvvps1, gvvps2
125  complex(8) ghzzp1_dyn,ghzzp2_dyn,ghzzp3_dyn,ghzzp4_dyn
126  complex(8) gvpvp, gvpvs1, gvpvs2
127  complex(8) ghzpz1_dyn,ghzpz2_dyn,ghzpz3_dyn,ghzpz4_dyn
128  complex(8) gvpvpp, gvpvps1, gvpvps2
129  complex(8) ghzpzp1_dyn,ghzpzp2_dyn,ghzpzp3_dyn,ghzpzp4_dyn
130 
132  if( &
133  (id(1).ne.convertlhe(pho_) .and. usea(1) .and. .not.includegammastar) .or. &
134  (id(6).ne.convertlhe(pho_) .and. usea(2) .and. .not.includegammastar) .or. &
135  ((id(1)+id(2)).ne.0 .and. id(1).ne.convertlhe(pho_) .and. usea(1)) .or. &
136  ((id(6)+id(7)).ne.0 .and. id(6).ne.convertlhe(pho_) .and. usea(2)) &
137  ) then
138  return
139  endif
140 
141  vcurrent1 = czero
142  acurrent1 = czero
143  vcurrent2 = czero
144  acurrent2 = czero
145  vpffcoupl=czero
146  currentvp1=czero
147  currentvp2=czero
148  prop_vp1=czero
149  prop_vp2=czero
150  ghzzp1_dyn = czero
151  ghzzp2_dyn = czero
152  ghzzp3_dyn = czero
153  ghzzp4_dyn = czero
154  ghzpz1_dyn = czero
155  ghzpz2_dyn = czero
156  ghzpz3_dyn = czero
157  ghzpz4_dyn = czero
158  ghzpzp1_dyn = czero
159  ghzpzp2_dyn = czero
160  ghzpzp3_dyn = czero
161  ghzpzp4_dyn = czero
162  gvvpp = czero
163  gvvps1 = czero
164  gvvps2 = czero
165  gvpvp = czero
166  gvpvs1 = czero
167  gvpvs2 = czero
168  gvpvpp = czero
169  gvpvps1 = czero
170  gvpvps2 = czero
171 
172  gffz = ci*2d0*dsqrt(couplzffsq) ! = sqrt(gwsq/(1.0_dp-xw))
173  gffa = -ci*dsqrt(couplaffsq) ! = sqrt(gwsq*xw)
174  gffw = ci*dsqrt(couplwffsq) ! = sqrt(gwsq/2.0_dp)
175 
176  qq = -scr(momext(:,3),momext(:,4))
177  if (id(1).eq.convertlhe(pho_) .and. usea(1)) then
178  q3_q3 = 0d0
179  else
180  q3_q3 = scr(momext(:,3),momext(:,3))
181  endif
182  if (id(6).eq.convertlhe(pho_) .and. usea(2)) then
183  q4_q4 = 0d0
184  else
185  q4_q4 = scr(momext(:,4),momext(:,4))
186  endif
187  q5_q5 = scr(momext(:,5),momext(:,5))
188  prop3 = propagator(dsqrt(q5_q5),mass(5,1),mass(5,2))
189 
190  if (includevprime) then
191  if(.not.usea(1)) then
192  vpffcoupl(1,1)=getvpffcoupling_vh(id(1), -1, ((id(1)+id(2)).ne.0))
193  vpffcoupl(1,2)=getvpffcoupling_vh(id(1), +1, ((id(1)+id(2)).ne.0))
194  endif
195  if(.not.usea(2)) then
196  vpffcoupl(2,1)=getvpffcoupling_vh(id(6), -1, ((id(6)+id(7)).ne.0))
197  vpffcoupl(2,2)=getvpffcoupling_vh(id(6), +1, ((id(6)+id(7)).ne.0))
198  endif
199  endif
200 
201 
202  if(.not.usea(1)) then
203  prop1 = propagator(dsqrt(q3_q3),mass(3,1),mass(3,2))
204  if(id(1).gt.0)then
205  call ffv(id(2), momext(:,2), helicity(2), id(1), momext(:,1), helicity(1), vcurrent1)
206  call ffa(id(2), momext(:,2), helicity(2), id(1), momext(:,1), helicity(1), acurrent1)
207  else
208  call ffv(id(1), momext(:,1), helicity(1), id(2), momext(:,2), helicity(2), vcurrent1)
209  call ffa(id(1), momext(:,1), helicity(1), id(2), momext(:,2), helicity(2), acurrent1)
210  endif
211 
212  ! Vpff current without the prefactor
213  if (includevprime) then
214  if((id(1)*helicity(1)).le.0d0)then
215  currentvp1=( &
216  vcurrent1*(vpffcoupl(1,1)+vpffcoupl(1,2))*0.5 - &
217  acurrent1*(vpffcoupl(1,1)-vpffcoupl(1,2))*0.5 &
218  )
219  else
220  currentvp1=( &
221  vcurrent1*vpffcoupl(1,2) &
222  )
223  endif
224  endif
225 
226  !WH
227  if((id(1)+id(2)).ne.0)then
228  if (includevprime) then
229  if (getmass(wppr_).ge.0d0) then
230  !print *,"Compute prop for Wppr"
231  prop_vp1 = propagator(dsqrt(q3_q3),getmass(wppr_),getdecaywidth(wppr_))
232  else
233  prop_vp1 = propagator(m_w,0d0,0d0)
234  endif
235  currentvp1 = currentvp1*gffw*ckmbare(id(1),id(2))
236  endif
237  if((id(1)*helicity(1)).le.0d0)then
238  current1=(vcurrent1-acurrent1)/2d0*gffw*ckmbare(id(1),id(2))
239  else
240  current1=0d0
241  endif
242  !ZH
243  else
244  if (includevprime) then
245  if (getmass(zpr_).ge.0d0) then
246  !print *,"Compute prop for Zpr"
247  prop_vp1 = propagator(dsqrt(q3_q3),getmass(zpr_),getdecaywidth(zpr_))
248  else
249  prop_vp1 = propagator(m_z,0d0,0d0)
250  endif
251  currentvp1 = currentvp1*gffz
252  endif
253  !e+ e- Z vertex for incoming states
254  if((abs(id(1)).eq.11).or.(abs(id(1)).eq.13).or.(abs(id(1)).eq.15))then
255  if((id(1)*helicity(1)).gt.0d0)then
256  current1=(0.5d0*t3lr - qlr*sitw**2) *vcurrent1 -(0.5d0*t3lr)*acurrent1
257  else
258  current1=(0.5d0*t3ll - qll*sitw**2) *vcurrent1 -(0.5d0*t3ll)*acurrent1
259  endif
260  current1=current1*gffz
261  !u u~ Z vertex for incoming states
262  else if((abs(id(1)).eq.2).or.(abs(id(1)).eq.4))then
263  if((id(1)*helicity(1)).gt.0d0)then
264  current1=(0.5d0*t3ur - qur*sitw**2) *vcurrent1 -(0.5d0*t3ur)*acurrent1
265  else
266  current1=(0.5d0*t3ul - qul*sitw**2) *vcurrent1 -(0.5d0*t3ul)*acurrent1
267  endif
268  current1=current1*gffz
269  !d d~ Z vertex for incoming states
270  else if((abs(id(1)).eq.1).or.(abs(id(1)).eq.3).or.(abs(id(1)).eq.5))then
271  if((id(1)*helicity(1)).gt.0d0)then
272  current1=(0.5d0*t3dr - qdr*sitw**2) *vcurrent1 -(0.5d0*t3dr)*acurrent1
273  else
274  current1=(0.5d0*t3dl - qdl*sitw**2) *vcurrent1 -(0.5d0*t3dl)*acurrent1
275  endif
276  current1=current1*gffz
277  else
278  current1=0d0
279  currentvp1=0d0
280  print *, "invalid incoming state"
281  endif
282  endif
283  else
284  if(abs(id(1)).eq.convertlhe(pho_)) then
285  prop1=cone
286  if((id(1)*helicity(1)).gt.0d0) then
287  call polarization_single(momext(:,3),+1,vcurrent1)
288  else
289  call polarization_single(momext(:,3),-1,vcurrent1)
290  endif
291  else
292  prop1 = propagator(dsqrt(q3_q3),0d0,0d0)
293  if(id(1).gt.0)then
294  call ffv(id(2), momext(:,2), helicity(2), id(1), momext(:,1), helicity(1), vcurrent1)
295  else
296  call ffv(id(1), momext(:,1), helicity(1), id(2), momext(:,2), helicity(2), vcurrent1)
297  endif
298  endif
299 
300  !ZH
301  if(abs(id(1)).eq.convertlhe(pho_))then
302  current1=vcurrent1
303  !e+ e- Z vertex for incoming states
304  else if((abs(id(1)).eq.11).or.(abs(id(1)).eq.13).or.(abs(id(1)).eq.15))then
305  if((id(1)*helicity(1)).gt.0d0)then
306  current1 = qlr*vcurrent1
307  else
308  current1 = qll*vcurrent1
309  endif
310  current1=current1*gffa
311  !u u~ Z vertex for incoming states
312  else if((abs(id(1)).eq.2).or.(abs(id(1)).eq.4))then
313  if((id(1)*helicity(1)).gt.0d0)then
314  current1 = qur*vcurrent1
315  else
316  current1 = qul*vcurrent1
317  endif
318  current1=current1*gffa
319  !d d~ Z vertex for incoming states
320  else if((abs(id(1)).eq.1).or.(abs(id(1)).eq.3).or.(abs(id(1)).eq.5))then
321  if((id(1)*helicity(1)).gt.0d0)then
322  current1 = qdr*vcurrent1
323  else
324  current1 = qdl*vcurrent1
325  endif
326  current1=current1*gffa
327  else
328  current1=0d0
329  print *, "invalid incoming state"
330  endif
331  endif
332 
333  if(.not.usea(2)) then
334  prop2 = propagator(dsqrt(q4_q4),mass(4,1),mass(4,2))
335 
336  if(id(6).gt.0)then
337  call ffv(id(6), momext(:,6), helicity(6), id(7), momext(:,7), helicity(7), vcurrent2)
338  call ffa(id(6), momext(:,6), helicity(6), id(7), momext(:,7), helicity(7), acurrent2)
339  else
340  call ffv(id(7), momext(:,7), helicity(7), id(6), momext(:,6), helicity(6), vcurrent2)
341  call ffa(id(7), momext(:,7), helicity(7), id(6), momext(:,6), helicity(6), acurrent2)
342  endif
343 
344  ! Vpff current without the prefactor
345  if (includevprime) then
346  if((id(6)*helicity(6)).le.0d0)then
347  currentvp2=( &
348  vcurrent2*(vpffcoupl(2,1)+vpffcoupl(2,2))*0.5 - &
349  acurrent2*(vpffcoupl(2,1)-vpffcoupl(2,2))*0.5 &
350  )
351  else
352  currentvp2=( &
353  vcurrent2*vpffcoupl(2,2) &
354  )
355  endif
356  endif
357 
358  !WH
359  if((id(6)+id(7)).ne.0)then
360  if (includevprime) then
361  if (getmass(wppr_).ge.0d0) then
362  prop_vp2 = propagator(dsqrt(q4_q4),getmass(wppr_),getdecaywidth(wppr_))
363  else
364  prop_vp2 = propagator(m_w,0d0,0d0)
365  endif
366  currentvp2 = currentvp2*gffw*ckmbare(id(6),id(7))
367  endif
368  if((id(6)*helicity(6)).le.0d0)then
369  current2=(vcurrent2-acurrent2)/2d0*gffw*ckm(id(6),id(7))
370  else
371  current2=0d0
372  endif
373  !ZH
374  else
375  if (includevprime) then
376  if (getmass(zpr_).ge.0d0) then
377  prop_vp2 = propagator(dsqrt(q4_q4),getmass(zpr_),getdecaywidth(zpr_))
378  else
379  prop_vp2 = propagator(m_z,0d0,0d0)
380  endif
381  currentvp2 = currentvp2*gffz
382  endif
383  !l+ l- Z vertex for final state
384  if((abs(id(6)).eq.11).or.(abs(id(6)).eq.13))then
385  if((id(6)*helicity(6)).gt.0d0)then
386  current2=(0.5d0*t3lr - qlr*sitw**2) *vcurrent2 -(0.5d0*t3lr)*acurrent2
387  else
388  current2=(0.5d0*t3ll - qll*sitw**2) *vcurrent2 -(0.5d0*t3ll)*acurrent2
389  endif
390  current2=current2*gffz*dsqrt(scale_alpha_z_ll)
391  !tau+ tau- Z vertex for final state
392  else if((abs(id(6)).eq.15))then
393  if((id(6)*helicity(6)).gt.0d0)then
394  current2=(0.5d0*t3lr - qlr*sitw**2) *vcurrent2 -(0.5d0*t3lr)*acurrent2
395  else
396  current2=(0.5d0*t3ll - qll*sitw**2) *vcurrent2 -(0.5d0*t3ll)*acurrent2
397  endif
398  current2=current2*gffz*dsqrt(scale_alpha_z_tt)
399  !u u~ Z vertex for final state
400  else if((abs(id(6)).eq.2).or.(abs(id(6)).eq.4))then
401  if((id(6)*helicity(6)).gt.0d0)then
402  current2=(0.5d0*t3ur - qur*sitw**2) *vcurrent2 -(0.5d0*t3ur)*acurrent2
403  else
404  current2=(0.5d0*t3ul - qul*sitw**2) *vcurrent2 -(0.5d0*t3ul)*acurrent2
405  endif
406  current2=current2*gffz*dsqrt(scale_alpha_z_uu)
407  !d d~ Z vertex for final state
408  else if((abs(id(6)).eq.1).or.(abs(id(6)).eq.3).or.(abs(id(6)).eq.5))then
409  if((id(6)*helicity(6)).gt.0d0)then
410  current2=(0.5d0*t3dr - qdr*sitw**2) *vcurrent2 -(0.5d0*t3dr)*acurrent2
411  else
412  current2=(0.5d0*t3dl - qdl*sitw**2) *vcurrent2 -(0.5d0*t3dl)*acurrent2
413  endif
414  current2=current2*gffz*dsqrt(scale_alpha_z_dd)
415  !nu nu~ Z vertex for final state
416  else if((abs(id(6)).eq.12).or.(abs(id(6)).eq.14).or.(abs(id(6)).eq.16))then
417  current2=(0.5d0*t3nl - qnl*sitw**2) *vcurrent2 -(0.5d0*t3nl)*acurrent2
418  current2=current2*gffz*dsqrt(scale_alpha_z_nn)
419  else
420  current2=0d0
421  currentvp2 = 0d0
422  print *, "invalid final state", id(6:7), helicity(6:7)
423  stop
424  endif
425  endif
426  else
427  if(abs(id(6)).eq.convertlhe(pho_)) then
428  prop2=cone
429  if((id(6)*helicity(6)).gt.0d0) then
430  call polarization_single(momext(:,4),+1,vcurrent2)
431  else
432  call polarization_single(momext(:,4),-1,vcurrent2)
433  endif
434  vcurrent2 = dconjg(vcurrent2)
435  else
436  prop2 = propagator(dsqrt(q4_q4),0d0,0d0)
437  if(id(6).gt.0)then
438  call ffv(id(6), momext(:,6), helicity(6), id(7), momext(:,7), helicity(7), vcurrent2)
439  else
440  call ffv(id(7), momext(:,7), helicity(7), id(6), momext(:,6), helicity(6), vcurrent2)
441  endif
442  endif
443 
444  !ZH
445  if(abs(id(6)).eq.convertlhe(pho_)) then
446  current2=vcurrent2
447  !l+ l- Z vertex for final state
448  else if((abs(id(6)).eq.11).or.(abs(id(6)).eq.13))then
449  if((id(6)*helicity(6)).gt.0d0)then
450  current2=qlr*vcurrent2
451  else
452  current2=qll*vcurrent2
453  endif
454  current2=current2*gffa*dsqrt(scale_alpha_z_ll)
455  !tau+ tau- Z vertex for final state
456  else if((abs(id(6)).eq.15))then
457  if((id(6)*helicity(6)).gt.0d0)then
458  current2=qlr*vcurrent2
459  else
460  current2=qll*vcurrent2
461  endif
462  current2=current2*gffa*dsqrt(scale_alpha_z_tt)
463  !u u~ Z vertex for final state
464  else if((abs(id(6)).eq.2).or.(abs(id(6)).eq.4))then
465  if((id(6)*helicity(6)).gt.0d0)then
466  current2=qur*vcurrent2
467  else
468  current2=qul*vcurrent2
469  endif
470  current2=current2*gffa*dsqrt(scale_alpha_z_uu)
471  !d d~ Z vertex for final state
472  else if((abs(id(6)).eq.1).or.(abs(id(6)).eq.3).or.(abs(id(6)).eq.5))then
473  if((id(6)*helicity(6)).gt.0d0)then
474  current2=qdr*vcurrent2
475  else
476  current2=qdl*vcurrent2
477  endif
478  current2=current2*gffa*dsqrt(scale_alpha_z_dd)
479  !nu nu~ Z vertex for final state
480  else if((abs(id(6)).eq.12).or.(abs(id(6)).eq.14).or.(abs(id(6)).eq.16))then
481  current2=qnl*vcurrent2
482  current2=current2*gffa*dsqrt(scale_alpha_z_nn)
483  else
484  current2=0d0
485  print *, "invalid final state", id(6:7), helicity(6:7)
486  stop
487  endif
488  endif
489 
490  if(.not.(usea(1) .and. abs(id(1)).eq.convertlhe(pho_))) then
491  current1 = -current1 + scrc(momext(:,3),current1)/q3_q3
492  currentvp1 = -currentvp1 + scrc(momext(:,3),currentvp1)/q3_q3
493  endif
494  if(.not.(usea(2) .and. abs(id(6)).eq.convertlhe(pho_))) then
495  current2 = -current2 + scrc(momext(:,4),current2)/q4_q4
496  currentvp2 = -currentvp2 + scrc(momext(:,4),currentvp2)/q4_q4
497  endif
498 
499  !print *,"current1=",current1
500  !print *,"currentVp1=",currentVp1
501  !print *,"PROP1=",PROP1
502  !print *,"PROP_Vp1=",PROP_Vp1
503  !print *,"current2=",current2
504  !print *,"currentVp2=",currentVp2
505  !print *,"PROP2=",PROP2
506  !print *,"PROP_Vp2=",PROP_Vp2
507 
508  current1 = current1*prop1
509  current2 = current2*prop2
510  currentvp1 = currentvp1*prop_vp1
511  currentvp2 = currentvp2*prop_vp2
512 
513 !XVV vertex
514  if(id(3).eq.convertlhe(wp_))then
515  call swap(q3_q3,q4_q4)
516  call swap(current1,current2)
517  call swap(currentvp1,currentvp2)
518  endif
519 
520  if(.not.usea(1) .and. .not.usea(2)) then
521  ghz1_dyn = hvvspinzerodynamiccoupling(1,q3_q3,q4_q4,q5_q5)
522  ghz2_dyn = hvvspinzerodynamiccoupling(2,q3_q3,q4_q4,q5_q5)
523  ghz3_dyn = hvvspinzerodynamiccoupling(3,q3_q3,q4_q4,q5_q5)
524  ghz4_dyn = hvvspinzerodynamiccoupling(4,q3_q3,q4_q4,q5_q5)
525 
526  if (includevprime) then
527  ghzzp1_dyn = hvvspinzerodynamiccoupling(12,q3_q3,q4_q4,q5_q5)
528  ghzzp2_dyn = hvvspinzerodynamiccoupling(13,q3_q3,q4_q4,q5_q5)
529  ghzzp3_dyn = hvvspinzerodynamiccoupling(14,q3_q3,q4_q4,q5_q5)
530  ghzzp4_dyn = hvvspinzerodynamiccoupling(15,q3_q3,q4_q4,q5_q5)
531 
532  ghzpz1_dyn = hvvspinzerodynamiccoupling(12,q4_q4,q3_q3,q5_q5)
533  ghzpz2_dyn = hvvspinzerodynamiccoupling(13,q4_q4,q3_q3,q5_q5)
534  ghzpz3_dyn = hvvspinzerodynamiccoupling(14,q4_q4,q3_q3,q5_q5)
535  ghzpz4_dyn = hvvspinzerodynamiccoupling(15,q4_q4,q3_q3,q5_q5)
536 
537  ghzpzp1_dyn = hvvspinzerodynamiccoupling(16,q3_q3,q4_q4,q5_q5)
538  ghzpzp2_dyn = hvvspinzerodynamiccoupling(17,q3_q3,q4_q4,q5_q5)
539  ghzpzp3_dyn = hvvspinzerodynamiccoupling(18,q3_q3,q4_q4,q5_q5)
540  ghzpzp4_dyn = hvvspinzerodynamiccoupling(19,q3_q3,q4_q4,q5_q5)
541  endif
542  else if(usea(1) .and. usea(2)) then
543  ghz1_dyn = czero
544  ghz2_dyn = hvvspinzerodynamiccoupling(9,q3_q3,q4_q4,q5_q5)
545  ghz3_dyn = hvvspinzerodynamiccoupling(10,q3_q3,q4_q4,q5_q5)
546  ghz4_dyn = hvvspinzerodynamiccoupling(11,q3_q3,q4_q4,q5_q5)
547  else if(usea(1)) then
548  ghz1_dyn = hvvspinzerodynamiccoupling(5,0d0,q3_q3,q5_q5)
549  ghz2_dyn = hvvspinzerodynamiccoupling(6,0d0,q3_q3,q5_q5)
550  ghz3_dyn = hvvspinzerodynamiccoupling(7,0d0,q3_q3,q5_q5)
551  ghz4_dyn = hvvspinzerodynamiccoupling(8,0d0,q3_q3,q5_q5)
552 
553  if (includevprime) then
554  ghzzp1_dyn = hvvspinzerodynamiccoupling(20,0d0,q3_q3,q5_q5)
555  ghzzp2_dyn = hvvspinzerodynamiccoupling(21,0d0,q3_q3,q5_q5)
556  ghzzp3_dyn = hvvspinzerodynamiccoupling(22,0d0,q3_q3,q5_q5)
557  ghzzp4_dyn = hvvspinzerodynamiccoupling(23,0d0,q3_q3,q5_q5)
558  endif
559  else !if(useA(2)) then
560  ghz1_dyn = hvvspinzerodynamiccoupling(5,0d0,q4_q4,q5_q5)
561  ghz2_dyn = hvvspinzerodynamiccoupling(6,0d0,q4_q4,q5_q5)
562  ghz3_dyn = hvvspinzerodynamiccoupling(7,0d0,q4_q4,q5_q5)
563  ghz4_dyn = hvvspinzerodynamiccoupling(8,0d0,q4_q4,q5_q5)
564 
565  if (includevprime) then
566  ghzpz1_dyn = hvvspinzerodynamiccoupling(20,0d0,q4_q4,q5_q5)
567  ghzpz2_dyn = hvvspinzerodynamiccoupling(21,0d0,q4_q4,q5_q5)
568  ghzpz3_dyn = hvvspinzerodynamiccoupling(22,0d0,q4_q4,q5_q5)
569  ghzpz4_dyn = hvvspinzerodynamiccoupling(23,0d0,q4_q4,q5_q5)
570  endif
571  endif
572 
573  gvvs1 = ghz1_dyn*(mass(3,1)**2) + qq * ( 2d0*ghz2_dyn + ghz3_dyn*qq/lambda**2 )
574  gvvs2 = -( 2d0*ghz2_dyn + ghz3_dyn*qq/lambda**2 )
575  gvvp = -2d0*ghz4_dyn
576 
577  if (includevprime) then
578  if(.not.usea(1) .and. .not.usea(2)) then
579  gvvps1 = ghzzp1_dyn*(mass(3,1)**2) + qq * ( 2d0*ghzzp2_dyn + ghzzp3_dyn*qq/lambda**2 )
580  gvvps2 = -( 2d0*ghzzp2_dyn + ghzzp3_dyn*qq/lambda**2 )
581  gvvpp = -2d0*ghzzp4_dyn
582 
583  gvpvs1 = ghzpz1_dyn*(mass(3,1)**2) + qq * ( 2d0*ghzpz2_dyn + ghzpz3_dyn*qq/lambda**2 )
584  gvpvs2 = -( 2d0*ghzpz2_dyn + ghzpz3_dyn*qq/lambda**2 )
585  gvpvp = -2d0*ghzpz4_dyn
586 
587  gvpvps1 = ghzpzp1_dyn*(mass(3,1)**2) + qq * ( 2d0*ghzpzp2_dyn + ghzpzp3_dyn*qq/lambda**2 )
588  gvpvps2 = -( 2d0*ghzpzp2_dyn + ghzpzp3_dyn*qq/lambda**2 )
589  gvpvpp = -2d0*ghzpzp4_dyn
590  else if (usea(1)) then
591  gvvps1 = ghzzp1_dyn*(mass(3,1)**2) + qq * ( 2d0*ghzzp2_dyn + ghzzp3_dyn*qq/lambda**2 )
592  gvvps2 = -( 2d0*ghzzp2_dyn + ghzzp3_dyn*qq/lambda**2 )
593  gvvpp = -2d0*ghzzp4_dyn
594  else! if (useA(2)) then
595  gvpvs1 = ghzpz1_dyn*(mass(3,1)**2) + qq * ( 2d0*ghzpz2_dyn + ghzpz3_dyn*qq/lambda**2 )
596  gvpvs2 = -( 2d0*ghzpz2_dyn + ghzpz3_dyn*qq/lambda**2 )
597  gvpvp = -2d0*ghzpz4_dyn
598  endif
599  endif
600 
601 
602  call vvs1(g_mu_nu)
603  call vvs2(momext(:,5),momext(:,5),pp)
604  if(id(3).eq.convertlhe(wp_))then
605  call vvp(momext(:,4),-momext(:,3),epp)
606  else
607  call vvp(-momext(:,3),momext(:,4),epp)
608  endif
609 
610 ! assemble everything and get iM
611  matrixelement0=(0d0,0d0)
612  do mu3=1,4
613  do mu4=1,4
615  current1(mu3)*current2(mu4)*( &
616  gvvs1*g_mu_nu(mu3,mu4) + &
617  gvvs2*pp(mu3,mu4) + &
618  gvvp *epp(mu3,mu4) &
619  ) &
620  + &
621  current1(mu3)*currentvp2(mu4)*( &
622  gvvps1*g_mu_nu(mu3,mu4) + &
623  gvvps2*pp(mu3,mu4) + &
624  gvvpp *epp(mu3,mu4) &
625  ) &
626  + &
627  currentvp1(mu3)*current2(mu4)*( &
628  gvpvs1*g_mu_nu(mu3,mu4) + &
629  gvpvs2*pp(mu3,mu4) + &
630  gvpvp *epp(mu3,mu4) &
631  ) &
632  + &
633  currentvp1(mu3)*currentvp2(mu4)*( &
634  gvpvps1*g_mu_nu(mu3,mu4) + &
635  gvpvps2*pp(mu3,mu4) + &
636  gvpvpp *epp(mu3,mu4) &
637  )
638  enddo !mu4
639  enddo !mu3
641 
642  if(h_dk.eqv..false.)then
644  else if(id(8).ne.not_a_particle_) then
646  *(kappa*ffs(id(8), momext(:,8), helicity(8), id(9), momext(:,9), helicity(9)) &
647  +kappa_tilde*ffp(id(8), momext(:,8), helicity(8), id(9), momext(:,9), helicity(9)))&
648  *(-ci/vev*getmass(convertlhereverse(id(8))))
649  else
651  endif
652 
653  !print *,"MATRIXELEMENT0=",MATRIXELEMENT0
654 
655  return
656  END function
657 
658 
659 
660 function getvpffcoupling_vh(pdgid, hel, useWp)
661 integer, intent(in) :: pdgid
662 integer, intent(in) :: hel
663 logical, intent(in) :: usewp
664 complex(8) :: getvpffcoupling_vh
665  getvpffcoupling_vh=vpffcoupling_pdg(pdgid,hel,usewp)
666  if(usewp) then
667  getvpffcoupling_vh = getvpffcoupling_vh / bl ! Bc of the couplings formalism from decay
668  else
670  endif
671 end function
672 
673 
674 !ANGLES.F
675 !VERSION 20130531
676 !
677 !A subroutine that calculates the polar and azimuthal angles of a
678 !given vector(4) in terms of their sin and cos, which will be
679 !returned by the array sincos(4).
680  subroutine angles(sincos, vector)
681  implicit none
682 ! real(8) Pi
683  real(8) Twopi, Fourpi, epsilon
684 ! parameter( Pi = 3.14159265358979323846d0 )
685  parameter( twopi = 2d0 * pi )
686  parameter( fourpi = 4d0 * pi )
687  parameter( epsilon = 1d-13 ) !a small quantity slightly above machine precision
688  real(8) sincos(4), vector(4), abs3p, phi
689 !sincos(1)=cos(theta)
690 !sincos(2)=sin(theta)
691 !sincos(3)=cos(phi)
692 !sincos(4)=sin(phi)
693 
694 !|3-momentum|
695  abs3p = dsqrt(vector(2)**2+vector(3)**2+vector(4)**2)
696 
697 !if |3-momentum|=0
698  if(abs3p.lt.epsilon)then
699  sincos(1)=1d0
700  sincos(2)=0d0
701  else
702  sincos(1)=vector(4)/abs3p
703  sincos(2)=dsqrt((1d0+sincos(1))*(1d0-sincos(1)))
704  endif
705 
706 !if colinear
707  if(dabs(vector(3)).lt.epsilon)then
708  phi=0d0
709  else
710  if(dabs(vector(2)).lt.epsilon)then
711  phi=(twopi/2d0)/2d0 * dsign(1d0,vector(3))
712  else
713  phi=datan(vector(3)/vector(2))
714  endif
715  endif
716 !shift phi so that 0 < phi < 2Pi
717  if(vector(2).lt.0d0)then
718  phi=phi+pi
719  endif
720  if(phi.lt.0d0)then
721  phi=phi+twopi
722  endif
723 ! print *,phi
724  sincos(3)=dcos(phi)
725  sincos(4)=dsin(phi)
726 
727  return
728  END subroutine angles
729 
730 !ANTISYMMETRIC2.F
731 !VERSION 20130702
732  subroutine antisymmetric2(p1,p2,epp)
733 
734  implicit none
735 ! real(8) Pi
736  real(8) Twopi, Fourpi, epsilon
737 ! parameter( Pi = 3.14159265358979323846d0 )
738  parameter( twopi = 2d0 * pi )
739  parameter( fourpi = 4d0 * pi )
740  parameter( epsilon = 1d-13 ) !a small quantity slightly above machine precision
741 
742  complex(8) p1(4), p2(4)
743  complex(8) epp(4,4)
744 ! real(8) ANTISYMMETRIC
745  integer i,j,k,l
746 
747 ! external ANTISYMMETRIC
748 
749 ! do i=1,4
750 ! do j=1,4
751  epp(i,j)=0d0
752 ! enddo
753 ! enddo
754 
755  do i=1,4
756  do j=1,4
757  do k=1,4
758  do l=1,4
759  epp(i,j)=epp(i,j)+antisymmetric(i,j,k,l)*p1(k)*p2(l)
760  enddo
761  enddo
762  enddo
763  enddo
764 
765  return
766  END subroutine antisymmetric2
767 
768 !ANTISYMMETRIC.F
769 !VERSION 20130618
770 
771 !returns the element of the rank-4 COVARIANT total antysymmetric
772 !tensor.
773 !ANTISYMMETRIC(0,1,2,3)=1.
774  real(8) function ANTISYMMETRIC(i,j,k,l)
775 
776  implicit none
777 ! include '../COMMON.INI'
778 
779  integer i,j,k,l
780 
781  antisymmetric=dble((i-j)*(i-k)*(i-l)*(j-k)*(j-l)*(k-l))/12d0
782 
783  return
784  END function antisymmetric
785 
786 !CONTRA_FIELD_TENSOR.F
787 !VERSION 20130630
788 
789 !in T_mu_nu(lambda, ^mu, ^nu) returns the contrvariant field tensors
790 !for given polarization vectors.
791  subroutine contra_field_tensor(POL, T_mu_nu)
792 
793  implicit none
794 ! real(8) Pi
795  real(8) Twopi, Fourpi, epsilon
796 ! parameter( Pi = 3.14159265358979323846d0 )
797  parameter( twopi = 2d0 * pi )
798  parameter( fourpi = 4d0 * pi )
799  parameter( epsilon = 1d-13 ) !a small quantity slightly above machine precision
800  complex(8) epep(4,4),emem(4,4),epe0(4,4),eme0(4,4),e0e0(4,4)
801  complex(8) epem(4,4),e0ep(4,4),e0em(4,4),emep(4,4)
802  complex(8) POL(3,4), T_mu_nu(5,4,4)
803 
804  call contra_outer(pol(1,:), pol(1,:), epep)
805  call contra_outer(pol(2,:), pol(2,:), emem)
806  call contra_outer(pol(1,:), pol(3,:), epe0)
807  call contra_outer(pol(3,:), pol(1,:), e0ep)
808  call contra_outer(pol(2,:), pol(3,:), eme0)
809  call contra_outer(pol(3,:), pol(2,:), e0em)
810  call contra_outer(pol(3,:), pol(3,:), e0e0)
811  call contra_outer(pol(1,:), pol(2,:), epem)
812  call contra_outer(pol(2,:), pol(1,:), emep)
813 
814 !lambda = +2
815  t_mu_nu(1,:,:)=epep
816 !lambda = -2
817  t_mu_nu(2,:,:)=emem
818 !lambda = +3
819  t_mu_nu(3,:,:)=(epe0+e0ep)/dsqrt(2d0)
820 !lambda = -3
821  t_mu_nu(4,:,:)=(eme0+e0em)/dsqrt(2d0)
822 !lambda = 0
823  t_mu_nu(5,:,:)=(epem+emep)/dsqrt(6d0) + e0e0/dsqrt(1.5d0)
824 
825 
826  return
827  END subroutine contra_field_tensor
828 
829 !CONTRA_OUTER.F
830 !VERSION 20130620
831 
832 !in pp(_mu, _nu) returns the CONTRAVARIANT tensor of
833 !p1 p2 outer product.
834  subroutine contra_outer(p1,p2,pp)
835 
836  implicit none
837 ! include '../COMMON.INI'
838  complex(8) p1(4), p2(4)
839  complex(8) pp(4,4)
840  integer mu, nu
841 
842  do mu=1,4
843  do nu=1,4
844  pp(mu,nu)=p1(mu)*p2(nu)
845  enddo
846  enddo
847 
848  return
849  END subroutine contra_outer
850 
851 !COVARIANT_FIELD_TENSOR.F
852 !VERSION 20130630
853 
854 !in T_mu_nu(lambda, _mu, _nu) returns the covariant field tensors
855 !for given polarization vectors.
856  subroutine covariant_field_tensor(POL, T_mu_nu)
857 
858  implicit none
859 ! real(8) Pi
860  real(8) Twopi, Fourpi, epsilon
861 ! parameter( Pi = 3.14159265358979323846d0 )
862  parameter( twopi = 2d0 * pi )
863  parameter( fourpi = 4d0 * pi )
864  parameter( epsilon = 1d-13 ) !a small quantity slightly above machine precision
865  complex(8) epep(4,4),emem(4,4),epe0(4,4),eme0(4,4),e0e0(4,4)
866  complex(8) epem(4,4),e0ep(4,4),e0em(4,4),emep(4,4)
867  complex(8) POL(3,4), T_mu_nu(5,4,4)
868 
869  call covariant_outer(pol(1,:), pol(1,:), epep)
870  call covariant_outer(pol(2,:), pol(2,:), emem)
871  call covariant_outer(pol(1,:), pol(3,:), epe0)
872  call covariant_outer(pol(3,:), pol(1,:), e0ep)
873  call covariant_outer(pol(2,:), pol(3,:), eme0)
874  call covariant_outer(pol(3,:), pol(2,:), e0em)
875  call covariant_outer(pol(3,:), pol(3,:), e0e0)
876  call covariant_outer(pol(1,:), pol(2,:), epem)
877  call covariant_outer(pol(2,:), pol(1,:), emep)
878 
879 !lambda = +2
880  t_mu_nu(1,:,:)=epep
881 !lambda = -2
882  t_mu_nu(2,:,:)=emem
883 !lambda = +3
884  t_mu_nu(3,:,:)=(epe0+e0ep)/dsqrt(2d0)
885 !lambda = -3
886  t_mu_nu(4,:,:)=(eme0+e0em)/dsqrt(2d0)
887 !lambda = 0
888  t_mu_nu(5,:,:)=(epem+emep)/dsqrt(6d0) + e0e0/dsqrt(1.5d0)
889 
890  return
891  END subroutine covariant_field_tensor
892 
893 !COVARIANT_OUTER.F
894 !VERSION 20130620
895 
896 !in pp(_mu, _nu) returns the COVARIANT tensor of p1 p2
897 !outer product.
898  subroutine covariant_outer(p1,p2,pp)
899 
900  implicit none
901 ! include '../COMMON.INI'
902  complex(8) p1(4), p2(4)
903  complex(8) pp(4,4)
904  integer mu, nu
905 
906  do mu=1,4
907  do nu=1,4
908  pp(mu,nu)=p1(mu)*p2(nu)
909  if( ( (mu.ne.1).and.(nu.eq.1) ).or. &
910  ( (mu.eq.1).and.(nu.ne.1) ) )then
911  pp(mu,nu)=-pp(mu,nu)
912  endif
913  enddo
914  enddo
915 
916  return
917  END subroutine covariant_outer
918 
919 !COVARIANT_VECTOR.F
920 !VERSION 20130703
921 
922 !returns the component of the COVARIANT vector for given 4-vector
923 !and Lorentz index.
924  complex(8) function covariant_vector(p,mu)
925 
926  implicit none
927 
928  complex(8) p(4)
929  integer mu
930 
931  if(mu.ne.1)then
932  covariant_vector = -p(mu)
933  else
934  covariant_vector = p(mu)
935  endif
936 
937  return
938  END function covariant_vector
939 
940 !FFP.A
941 !VERSION 20130522
942 
943 !returns i.Psi~(p1,s1).gamma5.Psi(p2,s2) for massless states
944  complex(8) function ffp(pdg_code1, p1, h1, pdg_code2, p2, h2)
945 
946  implicit none
947  real(8), parameter :: epsilon = 1d-13 !a small quantity slightly above machine precision
948 
949  real(8) p1(4), p2(4), h1, h2
950  integer pdg_code1, pdg_code2
951  real(8) sqrt_pp1dpp2
952 
953  if( ( dble(pdg_code1) *h1* dble(pdg_code2) *h2 ).gt.0d0)then
954  ffp=0d0
955 
956  else if( ( dabs( p1(1)+p1(4) ).lt.epsilon ).and. ( dabs( p2(1)+p2(4) ).lt.epsilon ) )then
957  ffp=0d0
958  else if( dabs( p1(1)+p1(4) ).lt.epsilon )then
959  ffp=-dsqrt(2d0*p1(1)*(p2(1)+p2(4)))
960  else if( dabs( p2(1)+p2(4) ).lt.epsilon )then
961  ffp= dsqrt(2d0*p2(1)*(p1(1)+p1(4)))
962  else
963  sqrt_pp1dpp2 = dsqrt((p1(1)+p1(4))/(p2(1)+p2(4)))
964  ffp=(p2(2)-(0d0,1d0)*p2(3))*sqrt_pp1dpp2- (p1(2)-(0d0,1d0)*p1(3))/sqrt_pp1dpp2
965  endif
966 
967  ffp=ffp*(0d0,-1d0)
968 
969  if( (dble(pdg_code1)*h1) .lt. 0d0)then
970  ffp=-dconjg(ffp)
971 
972  endif
973 
974  return
975  END function ffp
976 
977 !FFA.F
978 !VERSION 20130523
979 
980 !in Acurrent(4) returns Psi~(p1,s1).gamma^mu.gamma5.Psi(p2,s2) for massless
981 !states.
982  subroutine ffa(pdg_code1, p1, h1, pdg_code2, p2, h2, Acurrent)
983 
984  implicit none
985  real(8), parameter :: epsilon = 1d-13 !a small quantity slightly above machine precision
986 
987  real(8) p1(4), p2(4), h1, h2
988  integer pdg_code1, pdg_code2
989  real(8) sqrt_pp1Dpp2, sqrt_pp1Xpp2
990  complex(8) Acurrent(4)
991  integer mu
992 
993  acurrent = (0d0,0d0)
994 
995  if( ( dble(pdg_code1) *h1* dble(pdg_code2) *h2 ).lt.0d0)then
996  do mu=1,4
997  acurrent(mu)=0d0
998  enddo
999 
1000  else if( ( dabs( p1(1)+p1(4) ).lt.epsilon ).and. &
1001  ( dabs( p2(1)+p2(4) ).lt.epsilon ) )then
1002 
1003  acurrent(1)= 2d0*dsqrt(p1(1)*p2(1))
1004  acurrent(2)= 0d0
1005  acurrent(3)= 0d0
1006  acurrent(4)=-acurrent(1)
1007 
1008  else if( dabs( p1(1)+p1(4) ).lt.epsilon )then
1009 
1010  acurrent(1)= dsqrt( 2d0*p1(1) / ( p2(1)+p2(4) ) ) &
1011  *( p2(2) + (0d0,1d0)*p2(3) )
1012  acurrent(2)= dsqrt( 2d0*p1(1) * ( p2(1)+p2(4) ) )
1013  acurrent(3)= (0d0,1d0)*acurrent(2)
1014  acurrent(4)=-acurrent(1)
1015 
1016  else if( dabs( p2(1)+p2(4) ).lt.epsilon )then
1017 
1018  acurrent(1)= dsqrt( 2d0*p2(1) / ( p1(1)+p1(4) ) ) &
1019  *( p1(2) - (0d0,1d0)*p1(3) )
1020  acurrent(2)= dsqrt( 2d0*p2(1) * ( p1(1)+p1(4) ) )
1021  acurrent(3)=-(0d0,1d0)*acurrent(2)
1022  acurrent(4)=-acurrent(1)
1023 
1024  else
1025 
1026  sqrt_pp1dpp2= dsqrt( (p1(1)+p1(4)) / (p2(1)+p2(4)) )
1027  sqrt_pp1xpp2= dsqrt( (p1(1)+p1(4)) * (p2(1)+p2(4)) )
1028  acurrent(1)= sqrt_pp1xpp2 &
1029  +( p1(2) - (0d0,1d0)*p1(3) ) &
1030  *( p2(2) + (0d0,1d0)*p2(3) )/sqrt_pp1xpp2
1031  acurrent(2)= ( p1(2) - (0d0,1d0)*p1(3) )/sqrt_pp1dpp2 &
1032  +( p2(2) + (0d0,1d0)*p2(3) )*sqrt_pp1dpp2
1033  acurrent(3)= ( (0d0,1d0)*p1(2) + p1(3) )/sqrt_pp1dpp2 &
1034  -( (0d0,1d0)*p2(2) - p2(3) )*sqrt_pp1dpp2
1035  acurrent(4)=sqrt_pp1xpp2 &
1036  -( p1(2) - (0d0,1d0)*p1(3) ) &
1037  *( p2(2) + (0d0,1d0)*p2(3) )/sqrt_pp1xpp2
1038  endif
1039 
1040 ! print *, pdg_code1,h1,dble(pdg_code1)*h1,'!'
1041  if( (dble(pdg_code1)*h1) .lt. 0d0)then
1042 ! print *, Acurrent
1043  do mu=1,4
1044  acurrent(mu)=-dconjg(acurrent(mu))
1045  enddo
1046  endif
1047 
1048  return
1049  END subroutine ffa
1050 
1051 !FFS.F
1052 !VERSION 20130522
1053 
1054 !returns Psi~(p1,s1).Psi(p2,s2) for massless states
1055  complex(8) function ffs(pdg_code1, p1, h1, pdg_code2, p2, h2)
1057  implicit none
1058  real(8), parameter :: epsilon = 1d-13 !a small quantity slightly above machine precision
1059 
1060  real(8) p1(4), p2(4), h1, h2
1061  integer pdg_code1, pdg_code2
1062  real(8) sqrt_pp1dpp2
1063 
1064  ffs = (0d0,0d0)
1065 
1066  if( ( dble(pdg_code1) *h1* dble(pdg_code2) *h2 ).gt.0d0)then
1067  ffs=0d0
1068 
1069  else if( ( dabs( p1(1)+p1(4) ).lt.epsilon ).and. ( dabs( p2(1)+p2(4) ).lt.epsilon ) )then
1070  ffs=0d0
1071  else if( dabs( p1(1)+p1(4) ).lt.epsilon )then
1072  ffs=-dsqrt(2d0*p1(1)*(p2(1)+p2(4)))
1073  else if( dabs( p2(1)+p2(4) ).lt.epsilon )then
1074  ffs= dsqrt(2d0*p2(1)*(p1(1)+p1(4)))
1075  else
1076  sqrt_pp1dpp2 = dsqrt((p1(1)+p1(4))/(p2(1)+p2(4)))
1077  ffs=(p2(2)-(0d0,1d0)*p2(3))*sqrt_pp1dpp2- (p1(2)-(0d0,1d0)*p1(3))/sqrt_pp1dpp2
1078  endif
1079 
1080  if( (dble(pdg_code1)*h1) .lt. 0d0)then
1081  ffs=-dconjg(ffs)
1082 
1083  endif
1084 
1085  return
1086  END function ffs
1087 
1088 !FFV.F
1089 !VERSION 20130523
1090 
1091 !in Vcurrent(4) returns Psi~(p1,s1).gamma^mu.Psi(p2,s2) for massless
1092 !states.
1093  subroutine ffv(pdg_code1, p1, h1, pdg_code2, p2, h2, Vcurrent)
1095  implicit none
1096  real(8), parameter :: epsilon = 1d-13 !a small quantity slightly above machine precision
1097 
1098  real(8) p1(4), p2(4), h1, h2
1099  integer pdg_code1, pdg_code2
1100  real(8) sqrt_pp1Dpp2, sqrt_pp1Xpp2
1101  complex(8) Vcurrent(4)
1102  integer mu
1103 
1104  vcurrent = (0d0,0d0)
1105 
1106  if( ( dble(pdg_code1) *h1* dble(pdg_code2) *h2 ).lt.0d0)then
1107  do mu=1,4
1108  vcurrent(mu)=0d0
1109  enddo
1110 
1111  else if( ( dabs( p1(1)+p1(4) ).lt.epsilon ).and. ( dabs( p2(1)+p2(4) ).lt.epsilon ) )then
1112 
1113  vcurrent(1)= 2d0*dsqrt(p1(1)*p2(1))
1114  vcurrent(2)= 0d0
1115  vcurrent(3)= 0d0
1116  vcurrent(4)=-vcurrent(1)
1117 
1118  else if( dabs( p1(1)+p1(4) ).lt.epsilon )then
1119 
1120  vcurrent(1)= dsqrt( 2d0*p1(1) / ( p2(1)+p2(4) ) ) *( p2(2) + (0d0,1d0)*p2(3) )
1121  vcurrent(2)= dsqrt( 2d0*p1(1) * ( p2(1)+p2(4) ) )
1122  vcurrent(3)= (0d0,1d0)*vcurrent(2)
1123  vcurrent(4)=-vcurrent(1)
1124 
1125  else if( dabs( p2(1)+p2(4) ).lt.epsilon )then
1126 
1127  vcurrent(1)= dsqrt( 2d0*p2(1) / ( p1(1)+p1(4) ) ) *( p1(2) - (0d0,1d0)*p1(3) )
1128  vcurrent(2)= dsqrt( 2d0*p2(1) * ( p1(1)+p1(4) ) )
1129  vcurrent(3)=-(0d0,1d0)*vcurrent(2)
1130  vcurrent(4)=-vcurrent(1)
1131 
1132  else
1133 
1134  sqrt_pp1dpp2= dsqrt( (p1(1)+p1(4)) / (p2(1)+p2(4)) )
1135  sqrt_pp1xpp2= dsqrt( (p1(1)+p1(4)) * (p2(1)+p2(4)) )
1136  vcurrent(1)= sqrt_pp1xpp2 &
1137  +( p1(2) - (0d0,1d0)*p1(3) ) &
1138  *( p2(2) + (0d0,1d0)*p2(3) )/sqrt_pp1xpp2
1139  vcurrent(2)= ( p1(2) - (0d0,1d0)*p1(3) )/sqrt_pp1dpp2 &
1140  +( p2(2) + (0d0,1d0)*p2(3) )*sqrt_pp1dpp2
1141  vcurrent(3)= ( (0d0,1d0)*p1(2) + p1(3) )/sqrt_pp1dpp2 &
1142  -( (0d0,1d0)*p2(2) - p2(3) )*sqrt_pp1dpp2
1143  vcurrent(4)=sqrt_pp1xpp2 &
1144  -( p1(2) - (0d0,1d0)*p1(3) ) &
1145  *( p2(2) + (0d0,1d0)*p2(3) )/sqrt_pp1xpp2
1146  endif
1147 
1148  if( (dble(pdg_code1)*h1) .lt. 0d0)then
1149  do mu=1,4
1150  vcurrent(mu)=dconjg(vcurrent(mu))
1151  enddo
1152  endif
1153 
1154  return
1155  END subroutine ffv
1156 
1157 
1158 !INV_LORENTZ.F
1159 !VERSION 20130602
1160 !
1161 !A subroutine that performs a general inverse boost to a four vector
1162 !(vector) based on another four vector (boost). The primed and
1163 !unprimed frames have their axes in parallel to one another.
1164 !Rotation is not performed by this subroutine.
1165  subroutine inv_lorentz(vector, boost)
1167  implicit none
1168 
1169  real(8) vector(4), boost(4)
1170  real(8) lambda(4,4), vector_copy(4)
1171  real(8) beta(2:4), beta_sq, gamma
1172  integer i,j
1173 
1174  do i=2,4
1175  beta(i) = -boost(i)/boost(1)
1176  enddo
1177 
1178  beta_sq = beta(2)**2+beta(3)**2+beta(4)**2
1179 
1180  gamma = 1d0/dsqrt(1d0-beta_sq)
1181 
1182  lambda(1,1) = gamma
1183 
1184  do i=2,4
1185  lambda(1,i) = gamma*beta(i)
1186  lambda(i,1) = lambda(1,i)
1187  enddo
1188 
1189  do i=2,4
1190  do j=2,4
1191  lambda(i,j) = (gamma-1d0)*beta(i)*beta(j)/beta_sq + kronecker_delta(i,j)
1192  enddo
1193  enddo
1194 
1195 !apply boost to vector1
1196  vector_copy = vector
1197  vector = 0d0
1198  do i=1,4
1199  do j=1,4
1200  vector(i) = vector(i) + lambda(i,j)*vector_copy(j)
1201  enddo
1202  enddo
1203 
1204  return
1205  END subroutine inv_lorentz
1206 
1207 !KRONECKER_DELTA.F
1208 
1209 !KRONECKER_DELTA(i,j)
1210 !A function that returns 1 if i=j, and 0 otherwise.
1211  real(8) function KRONECKER_DELTA(i,j)
1212  integer i,j
1213  if(i.eq.j)then
1214  kronecker_delta = 1d0
1215  else
1216  kronecker_delta = 0d0
1217  endif
1218 
1219  return
1220  end function kronecker_delta
1221 
1222 !METRIC.F
1223 !VERSION 20130524
1224 
1225 !in METRIC returns the element of the Minkovski metric, with
1226 !signature (1,-1,-1,-1), for given (_mu, _nu) or given (^mu, ^nu).
1227  real(8) function metric(mu,nu)
1229  implicit none
1230  integer mu, nu
1231 
1232  if(mu.ne.nu)then
1233  metric=0d0
1234  else if(mu.eq.1)then
1235  metric=1d0
1236  else
1237  metric=-1d0
1238  endif
1239 
1240  return
1241  END function metric
1242 
1243 !`.F
1244 !VERSION 20130524
1245 
1246 !in POL(lambda,^mu) returns the polarization vectors for given
1247 !4-momentum p
1248  subroutine polarization(p, POL)
1250  implicit none
1251  real(8) p(4)
1252  complex(8) POL(3,4)
1253 
1254  call polarization_single(p,+1,pol(1,:))
1255  call polarization_single(p,-1,pol(2,:))
1256  call polarization_single(p, 0,pol(3,:))
1257 
1258  return
1259  END subroutine polarization
1260 
1261  subroutine polarization_single(p, lambda, POL)
1263  implicit none
1264  real(8) p(4), sincos(4), inv_mass, abs3p
1265  complex(8) POL(4)
1266  integer lambda
1267 
1268  pol(:)=czero
1269 
1270  call angles(sincos, p)
1271  !sincos(1)=cos(theta)
1272  !sincos(2)=sin(theta)
1273  !sincos(3)=cos(phi)
1274  !sincos(4)=sin(phi)
1275 
1276 !lambda = +1
1277  if(lambda.eq.1) then
1278  pol(1)= 0d0
1279  pol(2)= (sincos(3)*sincos(1)-(0d0,1d0)*sincos(4))/dsqrt(2d0)
1280  pol(3)= (sincos(4)*sincos(1)+(0d0,1d0)*sincos(3))/dsqrt(2d0)
1281  pol(4)= -sincos(2)/dsqrt(2d0)
1282 !lambda = -1
1283  else if(lambda.eq.-1) then
1284  pol(1)= 0d0
1285  pol(2)= (sincos(3)*sincos(1)+(0d0,1d0)*sincos(4))/dsqrt(2d0)
1286  pol(3)= (sincos(4)*sincos(1)-(0d0,1d0)*sincos(3))/dsqrt(2d0)
1287  pol(4)= -sincos(2)/dsqrt(2d0)
1288 !lambda = 0 (z)
1289  else if(lambda.eq.0) then
1290 !|3-momentum|
1291  abs3p = dsqrt(p(2)**2+p(3)**2+p(4)**2)
1292 !invariant mass
1293  inv_mass= dsqrt(p(1)**2-abs3p**2)
1294  pol(1)= abs3p/inv_mass
1295  pol(2)= sincos(3)*sincos(2)*p(1)/inv_mass
1296  pol(3)= sincos(4)*sincos(2)*p(1)/inv_mass
1297  pol(4)= sincos(1)*p(1)/inv_mass
1298 !lambda = 2 (vec{p-hat})
1299  else if(lambda.eq.2) then
1300  pol(1)= 0d0
1301  pol(2)= sincos(3)*sincos(2)
1302  pol(3)= sincos(4)*sincos(2)
1303  pol(4)= sincos(1)
1304 !lambda = -2 (-vec{p-hat})
1305  else if(lambda.eq.-2) then
1306  pol(1)= 0d0
1307  pol(2)= -sincos(3)*sincos(2)
1308  pol(3)= -sincos(4)*sincos(2)
1309  pol(4)= -sincos(1)
1310  endif
1311 
1312  return
1313  END subroutine polarization_single
1314 
1315 !POLARIZATIONA.F
1316 !VERSION 20130529
1317 
1318 !in POL(lambda,^mu) returns the photon polarization vectors for given
1319 !4-momentum p
1320  subroutine polarizationa(p, POL)
1322  implicit none
1323  real(8) p(4)
1324  complex(8) POL(2,4)
1325 
1326  call polarization_single(p,+1,pol(1,:))
1327  call polarization_single(p,-1,pol(2,:))
1328 
1329  return
1330  END subroutine polarizationa
1331 
1332 !POLARIZATIONX.F
1333 !VERSION 20130529
1334 
1335 !in POL(lambda,^mu) returns the polarization vectors for given
1336 !4-momentum p, with POL(L, ^mu) = (0, 0, 0, 1) when p is along the
1337 !Z direction.
1338  subroutine polarizationx(p, POL)
1340  implicit none
1341  real(8) p(4)
1342  complex(8) POL(3,4)
1343 
1344  call polarization_single(p,+1,pol(1,:))
1345  call polarization_single(p,-1,pol(2,:))
1346  call polarization_single(p,+2,pol(3,:))
1347 
1348  return
1349  END subroutine polarizationx
1350 !PROPAGATOR.F
1351 !VERSION 20130522
1352 !
1353 !PROPAGATOR() returns the generi!complex-valued propagator
1354 !without tensor structure (numerator), given mass, invariant mass
1355 !and width.
1356  complex(8) function propagator(inv_mass, mass, width)
1357  implicit none
1358 
1359  real(8) inv_mass, mass, width
1360 
1361 !not assuming auto-conversion
1362 ! PROPAGATOR = (0d0,1d0)/(dcmplx(inv_mass**2,0d0)
1363 ! & -dcmplx(mass**2,0d0)+
1364 ! & (0d0,1d0)*dcmplx(mass,0d0)*dcmplx(width,0d0))
1365 
1366 !assuming auto-conversion. works with gfortran
1367  !print *,"Called propagator with",inv_mass,mass,width
1368  if (mass.ge.0d0) then
1369  propagator = ci / ( inv_mass**2 - mass**2 + ci*mass*width )
1370  else
1371  propagator = ci / ( inv_mass**2 )
1372  endif
1373 ! print *, PROPAGATOR
1374 
1375  return
1376  END function propagator
1377 
1378 !VVP.F
1379 !VERSION 20130524
1380 
1381 !in epp(_mu, _nu) returns the
1382  subroutine vvp(p1,p2,epp)
1384  implicit none
1385  real(8) p1(4), p2(4)
1386  complex(8) epp(4,4)
1387 ! real(8) ANTISYMMETRIC
1388  integer i,j,k,l
1389 
1390 ! external ANTISYMMETRIC
1391 
1392  do i=1,4
1393  do j=1,4
1394  epp(i,j)=0d0
1395  enddo
1396  enddo
1397 
1398  do i=1,4
1399  do j=1,4
1400  do k=1,4
1401  do l=1,4
1402  epp(i,j)=epp(i,j)+antisymmetric(i,j,k,l)*p1(k)*p2(l)
1403  enddo
1404  enddo
1405  enddo
1406  enddo
1407 
1408  return
1409  END subroutine vvp
1410 
1411 !VVS1.F
1412 !VERSION 20130524
1413 
1414 !in g_mu_nu(_mu, _nu) returns the VVS1 4*4 tensor.
1415  subroutine vvs1(g_mu_nu)
1417  implicit none
1418  complex(8) g_mu_nu(4,4)
1419 
1420  g_mu_nu = 0d0
1421 
1422  g_mu_nu(1,1) = 1d0
1423  g_mu_nu(2,2) = -1d0
1424  g_mu_nu(3,3) = -1d0
1425  g_mu_nu(4,4) = -1d0
1426 
1427  return
1428  END subroutine vvs1
1429 
1430 !VVS2.F
1431 !VERSION 20130524
1432 
1433 !in pp(_mu, _nu) returns the tensor of p1_mu * p2_nu.
1434  subroutine vvs2(p1,p2,pp)
1436  implicit none
1437  real(8) p1(4), p2(4)
1438  complex(8) pp(4,4)
1439  integer mu, nu
1440 
1441  do mu=1,4
1442  do nu=1,4
1443  pp(mu,nu)=p1(mu)*p2(nu)
1444  if( ( (mu.ne.1).and.(nu.eq.1) ).or. &
1445  ( (mu.eq.1).and.(nu.ne.1) ) )then
1446  pp(mu,nu)=-pp(mu,nu)
1447  endif
1448  enddo
1449  enddo
1450 
1451  return
1452  END subroutine vvs2
1453 
1454  !-- generic functions below
1455  !- MCFM spinors in non-MCFM momentum convention
1456  subroutine spinoru2(n,p,za,zb,s)
1457  implicit none
1458  integer, intent(in) :: n
1459  real(8), intent(in) :: p(4,n)
1460  complex(8), intent(out) :: za(n,n), zb(n,n)
1461  real(8), intent(out) :: s(n,n)
1462  integer :: i,j
1463  complex(8) :: c23(n), f(n)
1464  real(8) :: rt(n)
1465 
1466  !---if one of the vectors happens to be zero this routine fails.
1467  do j=1,n
1468  za(j,j)=czero
1469  zb(j,j)=za(j,j)
1470 
1471  !-----positive energy case
1472  if (p(1,j) .gt. zero) then
1473  rt(j)=sqrt(abs(p(2,j)+p(1,j)))
1474  c23(j)=dcmplx(p(4,j),-p(3,j))
1475  f(j)=(one,zero)
1476  else
1477  !-----negative energy case
1478  rt(j)=sqrt(abs(-p(1,j)-p(2,j)))
1479  c23(j)=dcmplx(-p(4,j),p(3,j))
1480  f(j)=ci
1481  endif
1482  enddo
1483 
1484  do i=2,n
1485 
1486  do j=1,i-1
1487  s(i,j)=two*scr(p(:,i),p(:,j))
1488  za(i,j)=f(i)*f(j) * ( c23(i)*dcmplx(rt(j)/(rt(i)+1d-16))-c23(j)*dcmplx(rt(i)/(rt(j)+1d-16)) )
1489 
1490  if (abs(s(i,j)).lt.1d-5) then
1491  zb(i,j)=-(f(i)*f(j))**2*conjg(za(i,j))
1492  else
1493  zb(i,j)=-dcmplx(s(i,j))/(za(i,j)+1d-16)
1494  endif
1495 
1496  za(j,i)=-za(i,j)
1497  zb(j,i)=-zb(i,j)
1498  s(j,i)=s(i,j)
1499 
1500  enddo
1501 
1502  enddo
1503 
1504  return
1505 
1506  end subroutine spinoru2
1507 
1508 
1509 !!!!!!!!!!!!!!
1510 ! XCHECK MEs !
1511 !!!!!!!!!!!!!!
1512 
1513 !MATRIXELEMENT02.F
1514 !VERSION 20160924
1515 !complex(8) function MATRIXELEMENT02(p,mass,helicity,id)
1516 !use ModHiggs
1517 !implicit none
1518 !real(8), intent(in) :: p(1:4,1:9)
1519 !real(8), intent(in) :: mass(3:5,1:2)
1520 !real(8), intent(in) :: helicity(9)
1521 !integer, intent(in) :: id(9)
1522 
1523 !complex(dp) :: A_VV(1:4), propH
1524 !integer :: MY_IDUP(6:9),i3,i4,j,VVMode
1525 !real(dp) :: pUsed(4,6)
1526 !integer :: ordering(1:4),ordering_swap(1:4)
1527 
1528 !! Set the ids and momenta
1529 !MY_IDUP(:)=Not_a_particle_
1530 !pUsed(:,:)=zero
1531 !do j=1,4
1532 ! if(id(j) .ne. Not_a_particle_) then
1533 ! if(j.le.2) then
1534 ! MY_IDUP(j+5) = -convertLHEreverse(id(j))
1535 ! pUsed(:,j+2) = -p(:,j)
1536 ! else
1537 ! MY_IDUP(j+5) = convertLHEreverse(id(j+3))
1538 ! pUsed(:,j+2) = p(:,j+3)
1539 ! endif
1540 ! endif
1541 ! pUsed(:,1) = pUsed(:,1) + pUsed(:,j+2)
1542 !enddo
1543 !call getDecay_VVMode_Ordering(MY_IDUP, VVMode,ordering,ordering_swap)
1544 
1545 !! Set the helicities
1546 !if(id(1)*helicity(1).gt.0) then
1547 ! i3=2
1548 !else
1549 ! i3=1
1550 !endif
1551 !if(id(6)*helicity(6).gt.0) then
1552 ! i4=2
1553 !else
1554 ! i4=1
1555 !endif
1556 !if(ordering(1).eq.5 .or. ordering(2).eq.5) then
1557 ! call swap(i3,i4)
1558 !endif
1559 
1560 !A_VV(:) = 0d0
1561 !PROPH = PROPAGATOR(dsqrt(scr(p(:,5),p(:,5))),mass(5,1),mass(5,2))
1562 !call calcHelAmp2(ordering,VVMode,MY_IDUP,pUsed,i3,i4,A_VV(1))
1563 !if( (VVMode.eq.ZZMode) .and. includeGammaStar ) then
1564 ! call calcHelAmp2(ordering,ZgsMode,MY_IDUP,pUsed,i3,i4,A_VV(2))
1565 ! call calcHelAmp2(ordering,gsZMode,MY_IDUP,pUsed,i3,i4,A_VV(3))
1566 ! call calcHelAmp2(ordering,gsgsMode,MY_IDUP,pUsed,i3,i4,A_VV(4))
1567 !elseif( VVMode.eq.ZgMode .and. includeGammaStar ) then
1568 ! call calcHelAmp2(ordering,gsgMode,MY_IDUP,pUsed,i3,i4,A_VV(2))
1569 !endif
1570 !A_VV(:) = -A_VV(:) * propH
1571 
1572 !MATRIXELEMENT02 = A_VV(1)+A_VV(2)+A_VV(3)+A_VV(4)
1573 !return
1574 !END function
1575 
1576 !subroutine getDecay_VVMode_Ordering(MY_IDUP, VVMode,ordering,ordering_swap)
1577 ! implicit none
1578 ! integer, intent(in) :: MY_IDUP(6:9)
1579 ! integer, intent(out) :: VVMode,ordering(1:4),ordering_swap(1:4)
1580 ! integer :: idV(1:2)
1581 
1582 ! ordering=(/3,4,5,6/)
1583 ! idV(1)=CoupledVertex(MY_IDUP(6:7),-1)
1584 ! idV(2)=CoupledVertex(MY_IDUP(8:9),-1)
1585 ! if(MY_IDUP(6).eq.Pho_ .or. MY_IDUP(7).eq.Pho_) idV(1)=Pho_
1586 ! if(MY_IDUP(8).eq.Pho_ .or. MY_IDUP(9).eq.Pho_) idV(2)=Pho_
1587 ! if(convertLHE(MY_IDUP(6)).lt.0 .or. MY_IDUP(6).eq.Not_a_particle_) then
1588 ! call swap(ordering(1),ordering(2))
1589 ! endif
1590 ! if(convertLHE(MY_IDUP(8)).lt.0 .or. MY_IDUP(8).eq.Not_a_particle_) then
1591 ! call swap(ordering(3),ordering(4))
1592 ! endif
1593 ! if( &
1594 ! (idV(1).eq.Wm_ .and. idV(2).eq.Wp_) .or. &
1595 ! (idV(2).eq.Z0_ .and. idV(1).eq.Pho_) &
1596 ! ) then
1597 ! call swap(ordering(1),ordering(3))
1598 ! call swap(ordering(2),ordering(4))
1599 ! call swap(idV(1),idV(2))
1600 ! endif
1601 ! ordering_swap(:)=ordering(:)
1602 ! call swap(ordering_swap(1),ordering_swap(3))
1603 
1604 ! if(idV(1).eq.Z0_ .and. idV(2).eq.Z0_) then
1605 ! VVMode=ZZMode
1606 ! elseif(idV(1).eq.Z0_ .and. idV(2).eq.Pho_) then
1607 ! VVMode=ZgMode
1608 ! elseif(idV(1).eq.Pho_ .and. idV(2).eq.Pho_) then
1609 ! VVMode=ggMode
1610 ! elseif(idV(1).eq.Wp_ .and. idV(2).eq.Wm_) then
1611 ! VVMode=WWMode
1612 ! else
1613 ! print *,"idV=",idV
1614 ! call Error("Unsupported decay Modes")
1615 ! endif
1616 ! return
1617 !end subroutine
1618 
1619 
1620 SUBROUTINE matrixelement1(p,FermFlav,UnPolSqAmp)
1622 use modmisc
1623 implicit none
1624 complex(8) :: SME(1:3,-1:+1,-1:+1),HelAmp
1625 real(8) :: p(1:4,1:9),UnpolSqAmp,PreFac,IZis(-1:+1)
1626 real(8) :: qsq_V1,qsq_V2,qsq_V1V2,qsq_H
1627 complex(8) ghz1_dyn,ghz2_dyn,ghz3_dyn,ghz4_dyn
1628 complex(8) :: a1HVV,a2HVV,a3HVV,Prop
1629 integer :: ishel,fshel,FermFlav(1:6)! 12:IS, 34:ZDK, 56:HDK
1630 
1631  ! q1 qbar2 --> 3 --> 45 --> Z4-->f6 fbar7 + H5-->89
1632  call getsme(p,fermflav,sme)
1633  if( h_dk ) call error("Higgs decay not implemented")
1634 
1635  prop = (0d0,1d0)/(((p(1:4,4)+p(1:4,5)).dot.(p(1:4,4)+p(1:4,5))) -m_v**2 + (0d0,1d0)*m_v*ga_v )
1636  prefac = 4d0*pi*alpha_qed/4d0/sitw**2/(1d0-sitw**2) ! gets squared below
1637 
1638  ! initial state couplings
1639  if( isawdecay(decaymode1) ) then
1640  izis(+1) = br *ckm(fermflav(1),fermflav(2))
1641  izis(-1) = bl *ckm(fermflav(1),fermflav(2))
1642  elseif( isazdecay(decaymode1) .and. (abs(fermflav(1)).eq.2 .or. abs(fermflav(1)).eq.4) ) then
1643  izis(+1) = ar_qup
1644  izis(-1) = al_qup
1645  elseif( isazdecay(decaymode1) .and. (abs(fermflav(1)).eq.1 .or. abs(fermflav(1)).eq.3 .or. abs(fermflav(1)).eq.5) ) then
1646  izis(+1) = ar_qdn
1647  izis(-1) = al_qdn
1648  endif
1649 
1650 
1651  ! anomalous HVV couplings
1652  qsq_v1 = p(1:4,3).dot.p(1:4,3)
1653  qsq_v2 = p(1:4,4).dot.p(1:4,4)
1654  qsq_v1v2=-(p(1:4,3).dot.p(1:4,4))
1655  qsq_h = p(1:4,5).dot.p(1:4,5)
1656 
1657  ghz1_dyn = hvvspinzerodynamiccoupling(1,qsq_v1,qsq_v2,qsq_h)
1658  ghz2_dyn = hvvspinzerodynamiccoupling(2,qsq_v1,qsq_v2,qsq_h)
1659  ghz3_dyn = hvvspinzerodynamiccoupling(3,qsq_v1,qsq_v2,qsq_h)
1660  ghz4_dyn = hvvspinzerodynamiccoupling(4,qsq_v1,qsq_v2,qsq_h)
1661 
1662  a1hvv = ghz1_dyn*m_v**2 + qsq_v1v2*( 2d0*ghz2_dyn + ghz3_dyn*qsq_v1v2/lambda**2 )
1663  a2hvv =-2d0*ghz2_dyn - ghz3_dyn*qsq_v1v2/lambda**2
1664  a3hvv =-2d0*ghz4_dyn
1665 
1666  unpolsqamp = 0d0
1667  do ishel=-1,+1,2
1668  do fshel=-1,+1,2
1669  helamp = a3hvv * ( - izis(ishel)*sme(3,ishel,fshel) ) &
1670  + a2hvv * ( - izis(ishel)*sme(2,ishel,fshel) ) &
1671  + a1hvv * ( + izis(ishel)*sme(1,ishel,fshel) )
1672  helamp = helamp * prefac/vev * prop
1673  unpolsqamp = unpolsqamp + dreal( helamp*dconjg(helamp) )
1674  enddo
1675  enddo
1676  unpolsqamp = unpolsqamp * cf
1677 
1678 RETURN
1679 END SUBROUTINE
1680 
1681 SUBROUTINE getsme(p,FermFlav,SME)
1683 use modmisc
1684 implicit none
1685 complex(8) :: SME(1:3,-1:+1,-1:+1)
1686 real(8) :: sprod(9,9),p(1:4,1:9),IZfs(-1:+1)
1687 complex(8) :: za(9,9), zb(9,9),Prop
1688 integer :: FermFlav(1:6)
1689 
1690  call spinoru2(9,(/-p(1:4,1),-p(1:4,2),-p(1:4,1)-p(1:4,2),p(1:4,6)+p(1:4,7),p(1:4,8)+p(1:4,9),p(1:4,6),p(1:4,7),p(1:4,8),p(1:4,9)/),za,zb,sprod)
1691 
1692 
1693  ! Z-final state couplings
1694  if( isawdecay(decaymode1) ) then
1695  izfs(+1) = br *ckm(fermflav(3),fermflav(4))
1696  izfs(-1) = bl *ckm(fermflav(3),fermflav(4))
1697  elseif( abs(fermflav(3)).eq.11 .or. abs(fermflav(3)).eq.13 .or. abs(fermflav(3)).eq.15) then
1698  izfs(-1)=al_lep * dsqrt(scale_alpha_z_ll)
1699  izfs(+1)=ar_lep * dsqrt(scale_alpha_z_ll)
1700  elseif( abs(fermflav(3)).eq.12 .or. abs(fermflav(3)).eq.14 .or. abs(fermflav(3)).eq.16 ) then
1701  izfs(-1)=al_neu * dsqrt(scale_alpha_z_nn)
1702  izfs(+1)=ar_neu * dsqrt(scale_alpha_z_nn)
1703  elseif( abs(fermflav(3)).eq.2 .or. abs(fermflav(3)).eq.4 ) then
1704  izfs(-1)=al_qup * dsqrt(scale_alpha_z_uu)
1705  izfs(+1)=ar_qup * dsqrt(scale_alpha_z_uu)
1706  elseif( abs(fermflav(3)).eq.1 .or. abs(fermflav(3)).eq.3 .or. abs(fermflav(3)).eq.5 ) then
1707  izfs(-1)=al_qdn * dsqrt(scale_alpha_z_dd)
1708  izfs(+1)=ar_qdn * dsqrt(scale_alpha_z_dd)
1709  else
1710  call error("Wrong flavor in getSME",fermflav(3))
1711  endif
1712 
1713  sme(1,+1,+1) = -2*izfs(1)*za(1,7)*zb(2,6)
1714  sme(2,+1,+1) = izfs(1)*(za(1,6)*zb(2,6) + za(1,7)*zb(2,7))*(za(7,8)*zb(6,8) + za(7,9)*zb(6,9))
1715  sme(3,+1,+1) = ci*izfs(1)*(za(1,7)*(za(7,8)*zb(2,8) + za(7,9)*zb(2,9))*zb(6,7) + za(6,7)*zb(2,6)*(za(1,8)*zb(6,8) + za(1,9)*zb(6,9)))
1716  sme(1,+1,-1) = -2*izfs(-1)*za(1,6)*zb(2,7)
1717  sme(2,+1,-1) = izfs(-1)*(za(1,6)*zb(2,6) + za(1,7)*zb(2,7))*(za(6,8)*zb(7,8) + za(6,9)*zb(7,9))
1718  sme(3,+1,-1) = ci*izfs(-1)*(-(za(1,7)*zb(2,7)*(za(6,8)*zb(7,8) + za(6,9)*zb(7,9))) + za(1,6)*(za(6,8)*(-(zb(2,7)*zb(6,8)) + zb(2,6)*zb(7,8)) + zb(2,7)*(za(7,8)*zb(7,8) + za(7,9)*zb(7,9)) + za(6,9)*(-(zb(2,7)*zb(6,9)) + zb(2,6)*zb(7,9))))
1719  sme(1,-1,+1) = -2*izfs(1)*za(2,7)*zb(1,6)
1720  sme(2,-1,+1) = izfs(1)*(za(2,6)*zb(1,6) + za(2,7)*zb(1,7))*(za(7,8)*zb(6,8) + za(7,9)*zb(6,9))
1721  sme(3,-1,+1) = ci*izfs(1)*(za(2,7)*(za(7,8)*zb(1,8) + za(7,9)*zb(1,9))*zb(6,7) + za(6,7)*zb(1,6)*(za(2,8)*zb(6,8) + za(2,9)*zb(6,9)))
1722  sme(1,-1,-1) = -2*izfs(-1)*za(2,6)*zb(1,7)
1723  sme(2,-1,-1) = izfs(-1)*(za(2,6)*zb(1,6) + za(2,7)*zb(1,7))*(za(6,8)*zb(7,8) + za(6,9)*zb(7,9))
1724  sme(3,-1,-1) = -(ci*izfs(-1)*(za(2,6)*(za(6,8)*zb(1,8) + za(6,9)*zb(1,9))*zb(6,7) + za(6,7)*zb(1,7)*(za(2,8)*zb(7,8) + za(2,9)*zb(7,9))))
1725 
1726  prop = (0d0,1d0)/(2*(p(1:4,6).dot.p(1:4,7)) - m_v**2 + (0d0,1d0)*m_v*ga_v )
1727  sme(:,:,:) = sme(:,:,:) * prop
1728 
1729 RETURN
1730 END SUBROUTINE
1731 
1732 
1733 
1734 
1735 end module modvhiggs
1736 !!--YaofuZhou-----------------------------------------
modparameters::includegammastar
logical, public includegammastar
Definition: mod_Parameters.F90:213
modparameters::vev
real(8), public vev
Definition: mod_Parameters.F90:249
modvhiggs::polarization_single
subroutine polarization_single(p, lambda, POL)
Definition: mod_VHiggs.F90:1262
modvhiggs::evalamp_vhiggs
subroutine, public evalamp_vhiggs(id, helicity, MomExt, me2)
Definition: mod_VHiggs.F90:15
modparameters::hvvspinzerodynamiccoupling
complex(8) function hvvspinzerodynamiccoupling(index, sWplus, sWminus, sWW, tryWWcoupl)
Definition: mod_Parameters.F90:1161
modvhiggs::angles
subroutine angles(sincos, vector)
Definition: mod_VHiggs.F90:681
modvhiggs::ffa
subroutine ffa(pdg_code1, p1, h1, pdg_code2, p2, h2, Acurrent)
Definition: mod_VHiggs.F90:983
modparameters::ckm
real(8) function ckm(id1in, id2in)
Definition: mod_Parameters.F90:1593
modparameters::qul
real(8), parameter, public qul
Definition: mod_Parameters.F90:1036
modvhiggs::ffp
complex(8) function ffp(pdg_code1, p1, h1, pdg_code2, p2, h2)
Definition: mod_VHiggs.F90:945
modparameters::t3ll
real(8), parameter, public t3ll
Definition: mod_Parameters.F90:1024
modparameters::cf
real(dp), parameter, public cf
Definition: mod_Parameters.F90:1017
modparameters::convertlhereverse
integer function convertlhereverse(Part)
Definition: mod_Parameters.F90:1711
modparameters::sitw
real(8), public sitw
Definition: mod_Parameters.F90:254
modmisc::error
subroutine error(Message, ErrNum)
Definition: mod_Misc.F90:366
modparameters::couplaffsq
real(dp), public couplaffsq
Definition: mod_Parameters.F90:1081
modparameters::getmass
real(8) function getmass(Part)
Definition: mod_Parameters.F90:2021
modparameters::includevprime
logical, public includevprime
Definition: mod_Parameters.F90:214
modvhiggs::polarization
subroutine polarization(p, POL)
Definition: mod_VHiggs.F90:1249
modvhiggs::contra_outer
subroutine contra_outer(p1, p2, pp)
Definition: mod_VHiggs.F90:835
modparameters::ci
complex(8), parameter, public ci
Definition: mod_Parameters.F90:88
modparameters::lambda
real(8), parameter, public lambda
Definition: mod_Parameters.F90:354
modparameters::t3dl
real(8), parameter, public t3dl
Definition: mod_Parameters.F90:1030
modvhiggs::vvs1
subroutine vvs1(g_mu_nu)
Definition: mod_VHiggs.F90:1416
modvhiggs::spinoru2
subroutine spinoru2(n, p, za, zb, s)
Definition: mod_VHiggs.F90:1457
modvhiggs::covariant_outer
subroutine covariant_outer(p1, p2, pp)
Definition: mod_VHiggs.F90:899
modparameters::h_dk
logical, public h_dk
Definition: mod_Parameters.F90:180
modvhiggs::vvs2
subroutine vvs2(p1, p2, pp)
Definition: mod_VHiggs.F90:1435
modparameters::ar_qdn
real(8), public ar_qdn
Definition: mod_Parameters.F90:1064
modparameters::ckmbare
real(8) function ckmbare(id1in, id2in)
Definition: mod_Parameters.F90:1563
modvhiggs::matrixelement1
subroutine matrixelement1(p, FermFlav, UnPolSqAmp)
Definition: mod_VHiggs.F90:1621
modparameters::scale_alpha_z_ll
real(8), public scale_alpha_z_ll
Definition: mod_Parameters.F90:329
modparameters::bl
real(8), public bl
Definition: mod_Parameters.F90:1066
modparameters::kappa
complex(8), public kappa
Definition: mod_Parameters.F90:882
modparameters::ar_neu
real(8), public ar_neu
Definition: mod_Parameters.F90:1060
modparameters::couplwffsq
real(dp), public couplwffsq
Definition: mod_Parameters.F90:1078
modmisc::scrc
double complex function scrc(p1, p2)
Definition: mod_Misc.F90:142
modparameters::al_qdn
real(8), public al_qdn
Definition: mod_Parameters.F90:1065
modvhiggs::matrixelement0
complex(8) function matrixelement0(MomExt, mass, helicity, id, useA)
Definition: mod_VHiggs.F90:104
modparameters::isawdecay
logical function isawdecay(DKMode)
Definition: mod_Parameters.F90:2278
modparameters::ar_lep
real(8), public ar_lep
Definition: mod_Parameters.F90:1058
modparameters::czero
complex(8), parameter, public czero
Definition: mod_Parameters.F90:86
modparameters::t3ul
real(8), parameter, public t3ul
Definition: mod_Parameters.F90:1028
modparameters::couplzffsq
real(dp), public couplzffsq
Definition: mod_Parameters.F90:1079
modparameters::cone
complex(8), parameter, public cone
Definition: mod_Parameters.F90:87
modparameters::vpffcoupling_pdg
complex(8) function vpffcoupling_pdg(pdgid, hel, useWp)
Definition: mod_Parameters.F90:1498
modparameters::kappa_tilde
complex(8), public kappa_tilde
Definition: mod_Parameters.F90:883
modparameters::qdl
real(8), parameter, public qdl
Definition: mod_Parameters.F90:1038
modparameters::m_w
real(8), public m_w
Definition: mod_Parameters.F90:228
modparameters::qnl
real(8), parameter, public qnl
Definition: mod_Parameters.F90:1034
modparameters::scale_alpha_z_tt
real(8), public scale_alpha_z_tt
Definition: mod_Parameters.F90:330
modparameters::m_v
real(8), public m_v
Definition: mod_Parameters.F90:78
modparameters::t3nl
real(8), parameter, public t3nl
Definition: mod_Parameters.F90:1026
modparameters::al_qup
real(8), public al_qup
Definition: mod_Parameters.F90:1063
modparameters::alpha_qed
real(8), public alpha_qed
Definition: mod_Parameters.F90:248
modparameters::ga_v
real(8), public ga_v
Definition: mod_Parameters.F90:78
modvhiggs::polarizationx
subroutine polarizationx(p, POL)
Definition: mod_VHiggs.F90:1339
modvhiggs::covariant_vector
complex(8) function covariant_vector(p, mu)
Definition: mod_VHiggs.F90:925
modparameters::getdecaywidth
real(8) function getdecaywidth(Part)
Definition: mod_Parameters.F90:2074
modvhiggs::ffs
complex(8) function ffs(pdg_code1, p1, h1, pdg_code2, p2, h2)
Definition: mod_VHiggs.F90:1056
modparameters
Definition: mod_Parameters.F90:1
modparameters::scale_alpha_z_nn
real(8), public scale_alpha_z_nn
Definition: mod_Parameters.F90:331
modparameters::t3lr
real(8), parameter, public t3lr
Definition: mod_Parameters.F90:1025
modmisc
Definition: mod_Misc.F90:1
modparameters::wppr_
integer, target, public wppr_
Definition: mod_Parameters.F90:1103
modvhiggs::covariant_field_tensor
subroutine covariant_field_tensor(POL, T_mu_nu)
Definition: mod_VHiggs.F90:857
modparameters::convertlhe
integer function convertlhe(Part)
Definition: mod_Parameters.F90:1798
modvhiggs::vvp
subroutine vvp(p1, p2, epp)
Definition: mod_VHiggs.F90:1383
modparameters::scale_alpha_z_dd
real(8), public scale_alpha_z_dd
Definition: mod_Parameters.F90:328
modparameters::qur
real(8), parameter, public qur
Definition: mod_Parameters.F90:1037
modvhiggs
Definition: mod_VHiggs.F90:2
modparameters::br
real(8), public br
Definition: mod_Parameters.F90:1067
modparameters::m_z
real(8), public m_z
Definition: mod_Parameters.F90:226
modvhiggs::inv_lorentz
subroutine inv_lorentz(vector, boost)
Definition: mod_VHiggs.F90:1166
modvhiggs::contra_field_tensor
subroutine contra_field_tensor(POL, T_mu_nu)
Definition: mod_VHiggs.F90:792
modparameters::zpr_
integer, target, public zpr_
Definition: mod_Parameters.F90:1101
modparameters::qlr
real(8), parameter, public qlr
Definition: mod_Parameters.F90:1033
modvhiggs::antisymmetric2
subroutine antisymmetric2(p1, p2, epp)
Definition: mod_VHiggs.F90:733
modparameters::wp_
integer, target, public wp_
Definition: mod_Parameters.F90:1096
modparameters::t3dr
real(8), parameter, public t3dr
Definition: mod_Parameters.F90:1031
modvhiggs::polarizationa
subroutine polarizationa(p, POL)
Definition: mod_VHiggs.F90:1321
modmisc::scr
double precision function scr(p1, p2)
Definition: mod_Misc.F90:135
modvhiggs::metric
real(8) function metric(mu, nu)
Definition: mod_VHiggs.F90:1228
modparameters::qll
real(8), parameter, public qll
Definition: mod_Parameters.F90:1032
modparameters::scale_alpha_z_uu
real(8), public scale_alpha_z_uu
Definition: mod_Parameters.F90:327
modparameters::t3ur
real(8), parameter, public t3ur
Definition: mod_Parameters.F90:1029
modparameters::not_a_particle_
integer, parameter, public not_a_particle_
Definition: mod_Parameters.F90:1121
modparameters::isazdecay
logical function isazdecay(DKMode)
Definition: mod_Parameters.F90:2243
modparameters::decaymode1
integer, public decaymode1
Definition: mod_Parameters.F90:17
modparameters::al_lep
real(8), public al_lep
Definition: mod_Parameters.F90:1059
modvhiggs::antisymmetric
real(8) function antisymmetric(i, j, k, l)
Definition: mod_VHiggs.F90:775
modvhiggs::propagator
complex(8) function propagator(inv_mass, mass, width)
Definition: mod_VHiggs.F90:1357
modvhiggs::getsme
subroutine getsme(p, FermFlav, SME)
Definition: mod_VHiggs.F90:1682
modvhiggs::getvpffcoupling_vh
complex(8) function getvpffcoupling_vh(pdgid, hel, useWp)
Definition: mod_VHiggs.F90:661
modparameters::pho_
integer, target, public pho_
Definition: mod_Parameters.F90:1094
modparameters::qdr
real(8), parameter, public qdr
Definition: mod_Parameters.F90:1039
modvhiggs::kronecker_delta
real(8) function kronecker_delta(i, j)
Definition: mod_VHiggs.F90:1212
modvhiggs::ffv
subroutine ffv(pdg_code1, p1, h1, pdg_code2, p2, h2, Vcurrent)
Definition: mod_VHiggs.F90:1094
modmisc::swap
Definition: mod_Misc.F90:5
modparameters::al_neu
real(8), public al_neu
Definition: mod_Parameters.F90:1061
modparameters::ar_qup
real(8), public ar_qup
Definition: mod_Parameters.F90:1062