~maddevelopers/mg5amcnlo/3.0.2-alpha0

« back to all changes in this revision

Viewing changes to HELAS/jioxxx.F

Added Template and HELAS into bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine jioxxx(fi,fo,gc,vmass,vwidth , jio)
 
2
c
 
3
c This subroutine computes an off-shell vector current from an external
 
4
c fermion pair.  The vector boson propagator is given in Feynman gauge
 
5
c for a massless vector and in unitary gauge for a massive vector.
 
6
c
 
7
c input:
 
8
c       complex fi(6)          : flow-in  fermion                   |fi>
 
9
c       complex fo(6)          : flow-out fermion                   <fo|
 
10
c       complex gc(2)          : coupling constants                  gvf
 
11
c       real    vmass          : mass  of OUTPUT vector v
 
12
c       real    vwidth         : width of OUTPUT vector v
 
13
c
 
14
c output:
 
15
c       complex jio(6)         : vector current          j^mu(<fo|v|fi>)
 
16
c     
 
17
      implicit none
 
18
      double complex fi(6),fo(6),gc(2),jio(6),c0,c1,c2,c3,cs,d
 
19
      double precision q(0:3),vmass,vwidth,q2,vm2
 
20
      double complex cm2 ! mass**2- I Gamma mass (Fabio)
 
21
 
 
22
 
 
23
      double precision rZero, rOne
 
24
      parameter( rZero = 0.0d0, rOne = 1.0d0 )
 
25
      double complex cImag, cZero
 
26
      parameter( cImag = ( 0.0d0, 1.0d0 ), cZero = ( 0.0d0, 0.0d0 ) )
 
27
 
 
28
#ifdef HELAS_CHECK
 
29
      integer stdo
 
30
      parameter( stdo = 6 )
 
31
#endif
 
32
c
 
33
#ifdef HELAS_CHECK
 
34
      if ( abs(fi(1))+abs(fi(2))+abs(fi(3))+abs(fi(4)).eq.rZero ) then
 
35
         write(stdo,*) ' helas-warn  : fi in jioxxx is zero spinor'
 
36
      endif
 
37
      if ( abs(fi(5))+abs(fi(6)).eq.rZero ) then
 
38
         write(stdo,*)
 
39
     &        ' helas-error : fi in jioxxx has zero momentum'
 
40
      endif
 
41
      if ( abs(fo(1))+abs(fo(2))+abs(fo(3))+abs(fo(4)).eq.rZero ) then
 
42
         write(stdo,*) ' helas-warn  : fo in jioxxx is zero spinor'
 
43
      endif
 
44
      if ( abs(fo(5))+abs(fo(6)).eq.rZero ) then
 
45
         write(stdo,*)
 
46
     &        ' helas-error : fo in jioxxx has zero momentum'
 
47
      endif
 
48
      if ( gc(1).eq.cZero .and. gc(2).eq.cZero ) then
 
49
         write(stdo,*) ' helas-error : gc in jioxxx is zero coupling'
 
50
      endif
 
51
      if ( vmass.lt.rZero ) then
 
52
         write(stdo,*) ' helas-error : vmass in jioxxx is negative'
 
53
         write(stdo,*) '             : vmass = ',vmass
 
54
      endif
 
55
      if ( vwidth.lt.rZero ) then
 
56
         write(stdo,*) ' helas-error : vwidth in jioxxx is negative'
 
57
         write(stdo,*) '             : vwidth = ',vwidth
 
58
      endif
 
59
#endif
 
60
 
 
61
      jio(5) = fo(5)-fi(5)
 
62
      jio(6) = fo(6)-fi(6)
 
63
 
 
64
      q(0) = dble( jio(5))
 
65
      q(1) = dble( jio(6))
 
66
      q(2) = dimag(jio(6))
 
67
      q(3) = dimag(jio(5))
 
68
      q2 = q(0)**2-(q(1)**2+q(2)**2+q(3)**2)
 
69
      vm2 = vmass**2
 
70
 
 
71
#ifdef HELAS_CHECK
 
72
      if ( abs(jio(5))+abs(jio(6)).eq.rZero ) then
 
73
         write(stdo,*)
 
74
     &        ' helas-error : jio in jioxxx has zero momentum'
 
75
      endif
 
76
      if ( vwidth.eq.rZero .and. q2.eq.vm2 ) then
 
77
         write(stdo,*)
 
78
     &        ' helas-error : jio in jioxxx is on vmass pole'
 
79
         write(stdo,*)
 
80
     &        '             : q     = ',q(0),q(1),q(2),q(3)
 
81
         write(stdo,*)
 
82
     &        '             : abs(q)= ',sqrt(abs(q2))
 
83
         jio(1) = cZero
 
84
         jio(2) = cZero
 
85
         jio(3) = cZero
 
86
         jio(4) = cZero
 
87
         return
 
88
      endif
 
89
#endif
 
90
 
 
91
      if ( vmass.ne.rZero ) then
 
92
 
 
93
         d = rOne/dcmplx( q2-vm2, vmass*vwidth )
 
94
c     For the running width, use below instead of the above d.
 
95
c     d = rOne/dcmplx( q2-vm2, max(vwidth*q2/vmass,rZero) )
 
96
 
 
97
 
 
98
         if ( gc(2).ne.cZero ) then
 
99
            c0 =  gc(1)*( fo(3)*fi(1)+fo(4)*fi(2))
 
100
     &           +gc(2)*( fo(1)*fi(3)+fo(2)*fi(4))
 
101
            c1 = -gc(1)*( fo(3)*fi(2)+fo(4)*fi(1))
 
102
     &           +gc(2)*( fo(1)*fi(4)+fo(2)*fi(3))
 
103
            c2 =( gc(1)*( fo(3)*fi(2)-fo(4)*fi(1))
 
104
     &           +gc(2)*(-fo(1)*fi(4)+fo(2)*fi(3)))*cImag
 
105
            c3 =  gc(1)*(-fo(3)*fi(1)+fo(4)*fi(2))
 
106
     &           +gc(2)*( fo(1)*fi(3)-fo(2)*fi(4))
 
107
         else
 
108
            d = d*gc(1)
 
109
            c0 =   fo(3)*fi(1)+fo(4)*fi(2)
 
110
            c1 =  -fo(3)*fi(2)-fo(4)*fi(1)
 
111
            c2 = ( fo(3)*fi(2)-fo(4)*fi(1))*cImag
 
112
            c3 =  -fo(3)*fi(1)+fo(4)*fi(2)
 
113
         end if
 
114
 
 
115
c     Fabio's implementation of the fixed width
 
116
         cm2=dcmplx( vm2, -vmass*vwidth )
 
117
c     cs = (q(0)*c0-q(1)*c1-q(2)*c2-q(3)*c3)/vm2
 
118
         cs = (q(0)*c0-q(1)*c1-q(2)*c2-q(3)*c3)/cm2
 
119
         jio(1) = (c0-cs*q(0))*d
 
120
         jio(2) = (c1-cs*q(1))*d
 
121
         jio(3) = (c2-cs*q(2))*d
 
122
         jio(4) = (c3-cs*q(3))*d
 
123
 
 
124
      else
 
125
 
 
126
         d = dcmplx( rOne/q2, rZero )
 
127
         if ( gc(2).ne.cZero ) then
 
128
            jio(1) = ( gc(1)*( fo(3)*fi(1)+fo(4)*fi(2))
 
129
     &                +gc(2)*( fo(1)*fi(3)+fo(2)*fi(4)) )*d
 
130
            jio(2) = (-gc(1)*( fo(3)*fi(2)+fo(4)*fi(1))
 
131
     &                +gc(2)*( fo(1)*fi(4)+fo(2)*fi(3)) )*d
 
132
            jio(3) = ( gc(1)*( fo(3)*fi(2)-fo(4)*fi(1))
 
133
     &                +gc(2)*(-fo(1)*fi(4)+fo(2)*fi(3)))
 
134
     &               *d*cImag
 
135
            jio(4) = ( gc(1)*(-fo(3)*fi(1)+fo(4)*fi(2))
 
136
     &                +gc(2)*( fo(1)*fi(3)-fo(2)*fi(4)) )*d
 
137
         else
 
138
            d = d*gc(1)
 
139
            jio(1) =  ( fo(3)*fi(1)+fo(4)*fi(2))*d
 
140
            jio(2) = -( fo(3)*fi(2)+fo(4)*fi(1))*d
 
141
            jio(3) =  ( fo(3)*fi(2)-fo(4)*fi(1))*d*cImag
 
142
            jio(4) =  (-fo(3)*fi(1)+fo(4)*fi(2))*d
 
143
         end if
 
144
 
 
145
      end if
 
146
c
 
147
      return
 
148
      end