1 gaskelld 1.1 real*8 function peerho(vertex,main)
2
3 * Purpose:
4 * This routine calculates p(e,e'rho)p cross sections using my attempt
5 * to code in the form used in PYTHIA with modifications implmented
6 * in the HERMES Monte Carlo by Patricia Liebing (Thanks Patty!)
7 *
8 *
9 * variables:
10 * input:
11 * omega !energy of virtual photon (MeV)
12 * theta_pq !angle between pi and q (rad)
13 * Q2_g !4-momentum of virtual photon, squared (GeV/c)^2
14 * epsilon !epsilon (dimensionless)
15 *
16 * output:
17 * sigma_eerho !d3sigma/dEe'dOmegae'Omegapi (microbarn/MeV/sr^2)
18
19 implicit none
20 include 'simulate.inc'
21
22 gaskelld 1.1 record /event_main/ main
23 record /event/ vertex
24
25 * NOTE: when we refer to the center of mass system, it always refers to the
26 * photon-NUCLEON center of mass, not the photon-NUCLEUS! The model gives
27 * the cross section in the photon-nucleon center of mass frame.
28
29 real*8 sigma_eerho !final cross section (returned as peepi)
30 real*8 sig219,sig,factor
31 real*8 sigt !components of dsigma/dt
32 real*8 s5lab !dsigma/dE_e/dOmega_e/dOmega_rho (in some lab)
33 c real*8 efer !energy of target particle
34 real*8 epsi !epsilon of virtual photon
35 real*8 gtpr !gamma_t prime.
36 real*8 tcos,tsin !cos/sin of theta between ppi and q
37 real*8 tfcos,tfsin !cos/sin of theta between pfermi and q
38 real*8 bstar,bstarx,bstary,bstarz,gstar !beta/gamma of C.M. system in lab
39 real*8 ppix,ppiy,ppiz !pion momentum in lab.
40 real*8 thetacm,phicm !C.M. scattering angles
41 real*8 costcm,costo2cm
42 real*8 sintcm,sinto2cm
43 gaskelld 1.1 real*8 ppicm,ppicmx,ppicmy,ppicmz,epicm !pion E,p in C.M.
44 real*8 qstar,qstarx,qstary,qstarz,nustar !c.m. photon momentum/energy
45 real*8 zero
46
47 real*8 s,t,Q2_g !t,s, Q2 in (GeV/c)**2
48 real*8 tmin, tprime, cdeltatau,brho
49 real*8 nu !equivilent photon energy (MeV)
50
51 real*8 sig0,R
52
53 real*8 new_x_x,new_x_y,new_x_z
54 real*8 new_y_x,new_y_y,new_y_z
55 real*8 new_z_x,new_z_y,new_z_z
56 real*8 dummy,p_new_x,p_new_y,phiqn
57 real*8 davesig,phipq,cospq,sinpq
58 real*8 square_root,dp_dcos_num,dp_dcos_den,dp_dcos
59 real*8 dp_dphi_num,dp_dphi_den,dp_dphi
60 real*8 dt_dcos_lab,dt_dphi_lab,psign
61 real*8 dpxdphi,dpydphi,dpxdcos,dpydcos,dpzdcos,dpzdphi
62 real*8 dpxnewdphi,dpynewdphi,dpxnewdcos,dpynewdcos
63 real*8 dpznewdphi,dpznewdcos
64 gaskelld 1.1 real*8 dphicmdphi,dphicmdcos
65 real*8 jacobian
66
67 real*8 pbeam,beam_newx,beam_newy,beam_newz
68 real*8 pbeamcmx,pbeamcmy,pbeamcmz,ebeamcm,pbeamcm
69 real*8 ppicm_newx,ppicm_newy,ppicm_newz
70
71 real*8 dEcmdcos,dEcmdphi,dcoscmdcos,dcoscmdphi
72 real*8 qx,qy,qz,px,py,pz
73
74
75 * Initialize some stuff.
76 Q2_g = vertex.Q2/1000000.
77 phipq = main.phi_pq
78 cospq = cos(phipq)
79 sinpq = sin(phipq)
80
81 * calculate energy of initial (struck) nucleon, using the same assumptions that
82 * go into calculating the pion angle/momentum (in event.f). For A>1, the struck
83 * nucleon is off shell, the 2nd nucleon (always a neutron) is on shell, and has
84 * p = -p_fermi, and any additional nucleons are at rest.
85 gaskelld 1.1
86 efer = sqrt(pfer**2+targ.Mtar_struck**2)
87 if(doing_deutpi.or.doing_hepi) then
88 efer = targ.M-sqrt(Mn2+pfer**2)
89 if(doing_hepi)efer=efer-mp
90 c mtar_offshell = sqrt(efer**2-pfer**2)
91 endif
92
93
94 * calculate some kinematical variables
95 * f's and fer indicate fermi momenta, s, star or cm CM system
96
97 tcos = vertex.up.x*vertex.uq.x+vertex.up.y*vertex.uq.y+vertex.up.z*vertex.uq.z
98 if(tcos-1..gt.0..and.tcos-1..lt.1.d-8)tcos=1.0
99 tsin=sqrt(1.-tcos**2)
100
101 tfcos = pferx*vertex.uq.x+pfery*vertex.uq.y+pferz*vertex.uq.z
102 if(tfcos-1..gt.0..and.tfcos-1..lt.1.d-8)tfcos=1.0
103 tfsin=sqrt(1.-tfcos**2)
104
105 epsi = 1./(1.+2*(1.+vertex.nu**2/vertex.Q2)*tan(vertex.e.theta/2.)**2)
106 gaskelld 1.1
107 s = (vertex.nu+efer)**2-(vertex.q+pfer*tfcos)**2-(pfer*tfsin)**2
108 nu = (s-(efer**2-pfer**2))/2./(efer-pfer*tfcos) !equiv pho energy(MeV)
109
110 s = s/1.d6 !CONVERT TO (GeV)**2
111 main.w = sqrt(s)
112
113 t = vertex.Q2-Mrho2+2.*vertex.nu*vertex.p.E-2.*vertex.p.P*vertex.q*tcos
114 t = t/1.d6 !CONVERT TO (GeV/c)**2
115 main.t = t
116
117
118 * Calculate velocity of PHOTON-NUCLEON C.M. system in the lab frame. Use beta
119 * and gamma of the cm system (bstar and gstar) to transform particles into
120 * c.m. frame. Define z along the direction of q, and x to be along the
121 * direction of the pion momentum perpendicular to q.
122 * DJG: Get pfer components in the lab "q" system
123
124 * JRA:The transformation is calculated starting in the coord. system used
125 * in the fpi/nucpi replay (see event.f), where x=right, y=down, z=along beam.
126 * We must convert from SIMC coords to these first.
127 gaskelld 1.1 qx = -vertex.uq.y !'right'
128 qy = vertex.uq.x !'down'
129 qz = vertex.uq.z
130 px = -pfery
131 py = pferx
132 pz = pferz
133
134 dummy=sqrt((qx**2+qy**2)*(qx**2+qy**2+qz**2))
135 new_x_x = -qx*qz/dummy
136 new_x_y = -qy*qz/dummy
137 new_x_z = (qx**2 + qy**2)/dummy
138
139 dummy = sqrt(qx**2 + qy**2)
140 new_y_x = qy/dummy
141 new_y_y = -qx/dummy
142 new_y_z = 0.0
143
144 p_new_x = pfer*(px*new_x_x + py*new_x_y + pz*new_x_z)
145 p_new_y = pfer*(px*new_y_x + py*new_y_y + pz*new_y_z)
146
147 if(p_new_x.eq.0.)then
148 gaskelld 1.1 phiqn=0.
149 else
150 phiqn = atan2(p_new_y,p_new_x)
151 endif
152 if(phiqn.lt.0.)phiqn = phiqn+2.*pi
153
154 * get beam in "q" system.
155
156 pbeam = sqrt(vertex.Ein**2-me**2)
157 beam_newx = pbeam*new_x_z
158 beam_newy = pbeam*new_y_z
159 beam_newz = pbeam*vertex.uq.z
160
161 bstar=sqrt((vertex.q+pfer*tfcos)**2+(pfer*tfsin)**2)/(efer+vertex.nu)
162 gstar=1./sqrt(1. - bstar**2)
163
164 bstarz = (vertex.q+pfer*tfcos)/(efer+vertex.nu)
165 bstarx = p_new_x/(efer+vertex.nu)
166 bstary = p_new_y/(efer+vertex.nu)
167
168 * DJG: Boost virtual photon to CM.
169 gaskelld 1.1
170 zero =0.d0
171 call loren(gstar,bstarx,bstary,bstarz,vertex.nu,
172 > zero,zero,vertex.q,nustar,qstarx,qstary,qstarz,qstar)
173
174 * DJG: Boost pion to CM.
175
176 ppiz = vertex.p.P*tcos
177 ppix = vertex.p.P*tsin*cospq
178 ppiy = vertex.p.P*tsin*sinpq
179 call loren(gstar,bstarx,bstary,bstarz,vertex.p.E,
180 > ppix,ppiy,ppiz,epicm,ppicmx,ppicmy,ppicmz,ppicm)
181 thetacm = acos((ppicmx*qstarx+ppicmy*qstary+ppicmz*qstarz)/ppicm/qstar)
182 main.pcm = ppicm
183
184 * DJG Boost the beam to CM.
185
186 call loren(gstar,bstarx,bstary,bstarz,vertex.Ein,beam_newx,
187 > beam_newy,beam_newz,ebeamcm,pbeamcmx,pbeamcmy,pbeamcmz,pbeamcm)
188
189 * Thetacm is defined as angle between ppicm and qstar.
190 gaskelld 1.1 * To get phicm, we need out of plane angle relative to scattering plane
191 * (plane defined by pbeamcm and qcm). For stationary target, this plane
192 * does not change. In general, the new coordinate system is defined such
193 * that the new y direction is given by (qcm x pbeamcm) and the new x
194 * is given by (qcm x pbeamcm) x qcm.
195
196 dummy = sqrt((qstary*pbeamcmz-qstarz*pbeamcmy)**2+
197 > (qstarz*pbeamcmx-qstarx*pbeamcmz)**2
198 > +(qstarx*pbeamcmy-qstary*pbeamcmx)**2)
199 new_y_x = (qstary*pbeamcmz-qstarz*pbeamcmy)/dummy
200 new_y_y = (qstarz*pbeamcmx-qstarx*pbeamcmz)/dummy
201 new_y_z = (qstarx*pbeamcmy-qstary*pbeamcmx)/dummy
202
203 dummy = sqrt((new_y_y*qstarz-new_y_z*qstary)**2
204 > +(new_y_z*qstarx-new_y_x*qstarz)**2
205 > +(new_y_x*qstary-new_y_y*qstarx)**2)
206 new_x_x = (new_y_y*qstarz-new_y_z*qstary)/dummy
207 new_x_y = (new_y_z*qstarx-new_y_x*qstarz)/dummy
208 new_x_z = (new_y_x*qstary-new_y_y*qstarx)/dummy
209
210 new_z_x = qstarx/qstar
211 gaskelld 1.1 new_z_y = qstary/qstar
212 new_z_z = qstarz/qstar
213
214 ppicm_newx = ppicmx*new_x_x + ppicmy*new_x_y + ppicmz*new_x_z
215 ppicm_newy = ppicmx*new_y_x + ppicmy*new_y_y + ppicmz*new_y_z
216 ppicm_newz = ppicmx*new_z_x + ppicmy*new_z_y + ppicmz*new_z_z
217
218 sintcm = sin(thetacm)
219 costcm = cos(thetacm)
220 sinto2cm = sin(thetacm/2.)
221 costo2cm = cos(thetacm/2.)
222 phicm = atan2(ppicm_newy,ppicm_newx)
223 if(phicm.lt.0.) phicm = 2.*3.141592654+phicm
224
225 main.thetacm = thetacm
226 main.phicm = phicm
227
228 ! DJG need tprime and tmin here
229 ! DJG Need an overall minus sign since we calculate -t above.
230
231 tmin = -( ((-Q2_g-mrho2/1.d6-(targ.mtar_struck/1000.)**2+
232 gaskelld 1.1 1 (targ.mtar_struck/1000.)**2)/(2.*sqrt(s)))**2-
233 2 ((qstar-ppicm)/1000.)**2 )
234
235
236 tprime = abs(t-tmin)
237 ! Put in some W dependence from photoproduction data
|