~maddevelopers/mg5amcnlo/3.0.2-alpha0

« back to all changes in this revision

Viewing changes to HELAS/jeexxx.F

Added Template and HELAS into bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine jeexxx(eb,ef,shlf,chlf,phi,nhb,nhf,nsf , jee)
 
2
c
 
3
c This subroutine computes an off-shell photon wavefunction emitted from
 
4
c the electron or positron beam, with a special care for the small angle
 
5
c region.  The momenta are measured in the laboratory frame, where the
 
6
c e- (e+) beam is along the positive (negative) z axis.
 
7
c
 
8
c input:
 
9
c       real    eb             : energy (gev)    of beam  e-/e+
 
10
c       real    ef             : energy (gev)    of final e-/e+
 
11
c       real    shlf           : sin(theta/2)    of final e-/e+
 
12
c       real    chlf           : cos(theta/2)    of final e-/e+
 
13
c       real    phi            : azimuthal angle of final e-/e+
 
14
c       integer nhb  = -1 or 1 : helicity        of beam  e-/e+
 
15
c       integer nhf  = -1 or 1 : helicity        of final e-/e+
 
16
c       integer nsf  = -1 or 1 : +1 for electron, -1 for positron
 
17
c
 
18
c output:
 
19
c       complex jee(6)         : off-shell photon          j^mu(<e|a|e>)
 
20
c     
 
21
      implicit none
 
22
      double complex jee(6),coeff
 
23
      double precision cs(2),eb,ef,shlf,chlf,phi,alpha,gal,hi,sf,sfh
 
24
      double precision x,me2,q2,rfp,rfm,snp,csp,rxc,c,s
 
25
      integer nhb,nhf,nsf
 
26
 
 
27
      double precision rZero, rHalf, rOne, rTwo, rFour, rOte
 
28
      double precision rPi, rIalph
 
29
      parameter( rZero = 0.0d0, rHalf = 0.5d0, rOne = 1.0d0 )
 
30
      parameter( rTwo = 2.0d0, rFour = 4.0d0, rOte = 128.9d0 )
 
31
      parameter( rPi = 3.14159265358979323846d0 )
 
32
      parameter( rIalph = 137.0359895d0 )
 
33
 
 
34
      double precision me
 
35
      parameter( me = 0.51099906d-3 )
 
36
 
 
37
#ifdef HELAS_CHECK
 
38
      double precision zero
 
39
      double precision epsi
 
40
      parameter( epsi = 1.0d-5 )
 
41
      integer stdo
 
42
      parameter( stdo = 6 )
 
43
#endif
 
44
c
 
45
#ifdef HELAS_CHECK
 
46
      if ( eb.le.rZero )
 
47
     &     write(stdo,*) ' helas-error : eb in jeexxx is not positive'
 
48
      if ( ef.le.rZero )
 
49
     &     write(stdo,*) ' helas-error : ef in jeexxx is not positive'
 
50
      if ( ef.gt.eb ) then
 
51
         write(stdo,*) ' helas-error : ef in jeexxx is greater than eb'
 
52
         write(stdo,*) '             : eb = ',eb,' : ef = ',ef
 
53
      endif
 
54
      if ( shlf.lt.rZero .or. shlf.gt.rOne ) then
 
55
         write(stdo,*) ' helas-error : shlf in jeexxx is improper'
 
56
         write(stdo,*) '               shlf = ',shlf
 
57
      endif
 
58
      if ( chlf.lt.rZero .or. chlf.gt.rOne ) then
 
59
         write(stdo,*) ' helas-error : chlf in jeexxx is improper'
 
60
         write(stdo,*) '               chlf = ',chlf
 
61
      endif
 
62
      zero = abs(shlf**2+chlf**2-rOne)
 
63
      if ( zero.gt.epsi ) then
 
64
         write(stdo,*)
 
65
     &        ' helas-error : shlf and chlf in jeexxx are inconsistent'
 
66
         write(stdo,*) '               shlf,chlf = ',shlf,chlf
 
67
      endif
 
68
      if ( phi.lt.rZero .or. phi.gt.rTwo*rPi ) then
 
69
         write(stdo,*)
 
70
     &   ' helas-warn  : phi in jeexxx does not lie on 0.0 thru 2.0*pi'
 
71
         write(stdo,*) 
 
72
     &   '             : phi = ',phi
 
73
      endif
 
74
      if ( abs(nhb).ne.1 ) then
 
75
         write(stdo,*) ' helas-error : nhb in jeexxx is not -1,1'
 
76
         write(stdo,*) '             : nhb = ',nhb
 
77
      endif
 
78
      if ( abs(nhf).ne.1 ) then
 
79
         write(stdo,*) ' helas-error : nhf in jeexxx is not -1,1'
 
80
         write(stdo,*) '             : nhf = ',nhf
 
81
      endif
 
82
      if ( abs(nsf).ne.1 ) then
 
83
         write(stdo,*) ' helas-error : nsf in jeexxx is not -1,1'
 
84
         write(stdo,*) '             : nsf = ',nsf
 
85
      endif
 
86
      if ( eb.lt.rOne ) then
 
87
         write(stdo,*)
 
88
     &   ' helas-warn  : use of jeexxx is not appropriate: eb too low'
 
89
         write(stdo,*)
 
90
     &   '             : eb = ',eb
 
91
      endif
 
92
#endif
 
93
 
 
94
      alpha = rOne/rOte
 
95
      gal = sqrt(alpha*rFour*rPi)
 
96
 
 
97
      hi = nhb
 
98
      sf = nsf
 
99
      sfh = nhb*nsf
 
100
      cs((3+nsf)/2) = shlf
 
101
      cs((3-nsf)/2) = chlf
 
102
c cs(1)=chlf and cs(2)=shlf for electron
 
103
c cs(1)=shlf and cs(2)=chlf for positron
 
104
      x = ef/eb
 
105
      me2 = me**2
 
106
      q2 = - rFour*cs(2)**2*(ef*eb-me2)
 
107
     &     + sf*(rOne-x)**2/x*(shlf+chlf)*(shlf-chlf)*me2
 
108
      rfp = (1+nsf)
 
109
      rfm = (1-nsf)
 
110
      snp = sin(phi)
 
111
      csp = cos(phi)
 
112
 
 
113
      if ( nhb.eq.nhf ) then
 
114
         rxc = rTwo*x/(rOne-x)*cs(1)**2
 
115
         coeff = gal*rTwo*eb*sqrt(x)*cs(2)/q2
 
116
     &          *(dcmplx( rfp )-rfm*dcmplx( csp, -snp*hi ))*rHalf
 
117
         jee(1) = dcmplx( rZero )
 
118
         jee(2) = coeff*dcmplx( (rOne+rxc)*csp, -sfh*snp )
 
119
         jee(3) = coeff*dcmplx( (rOne+rxc)*snp,  sfh*csp )
 
120
         jee(4) = coeff*(-sf*rxc/cs(1)*cs(2))
 
121
      else
 
122
         coeff = gal*me/q2/sqrt(x)
 
123
     &          *(dcmplx( rfp )+rfm*dcmplx( csp, snp*hi ))*rHalf*hi
 
124
         jee(1) = -coeff*(rOne+x)*cs(2)*dcmplx( csp , sfh*snp )
 
125
         jee(2) =  coeff*(rOne-x)*cs(1)
 
126
         jee(3) =  jee(2)*dcmplx( rZero, sfh )
 
127
         jee(4) =  jee(1)*sf*(rOne-x)/(rOne+x)
 
128
      endif
 
129
 
 
130
      c = (chlf+shlf)*(chlf-shlf)
 
131
      s = rTwo*chlf*shlf
 
132
 
 
133
      jee(5) = -eb*dcmplx( rOne-x, sf-x*c )
 
134
      jee(6) =  eb*x*s*dcmplx( csp, snp )
 
135
c
 
136
      return
 
137
      end