-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdvcs.f
294 lines (212 loc) · 6.24 KB
/
fdvcs.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
*CMZ : 13/07/2004 17.06.26 by H1 Saclay
*-- Author : Unknown 17/12/2003
* ---------------------------------
! real function fdvcs*8(x)
double precision function fdvcs(x)
* ---------------------------------
IMPLICIT REAL*8(A-H,O-Z)
include 'dvcs.common'
include 'forpaw.common'
double precision mp
PARAMETER (MXDIM = 50 )
DIMENSION X(MXDIM)
dimension res(100)
common /setting/ nset
common /tintin/ SIGN,bti,rti
common /counter1/ icountxq,icountt
C ------------------------------------------------------
common/dvcs_BOUNDS/xmin,xmax,qmin,qmax,tmin,tmax,
> phimin,phimax,pphimin,pphimax,thmin,thmax
logical Angle_Integ
common/dvcs_IN/spin,Z,A,s,tchar,xlaml,xlamp,
> Angle_Integ,iord,icount,nx,nq,IPRO
common/dvcs_OUT/res
common/dvcs_VAR/x_main,q_main,phi_main,t_main,ym_main
C ------------------------------------------------------
real elepi,EGAMR,sweight,srad,elepin,ehadi
common /RADGEN/ elepi,EGAMR,sweight,srad,elepin,ehadi
logical stFIXED_save
common /FIXED/ stFIXED_save
integer i_outrange
common/out_of_range/i_outrange
integer igen_exp
common /genexp/ igen_exp
logical first
data first /.true./
real shat,ytest,mel
real wmin_test
real smphibel
REAL sig_smphibel
fdvcs = 0.d0
icountxq = 1
icountt = 1
* X(1) -> x
* X(2) -> q
* X(3) -> t
* X(4) -> Egamma (ISR)
* X(5) -> phi
* X(6) -> pphi
* X(7) -> theta
cls>>
cls>> generate in linx,linq,lint
cls>>
if (igen_exp.eq.1) then
xx = dexp(X(1))
else
xx = X(1)
endif
if (igen_exp.eq.1) then
q = dexp(X(2))
else
q = X(2)
endif
t = X(3)
x_main = xx
q_main = q
t_main = t
if (Angle_Integ) then
phi =0.
pphi =0.
theta =0.
nset = 2
else
phi = X(5)
pphi = X(6)
theta = X(7)
endif
if (srad.eq.0.) then
egamr = 0.
else
egamr = sngl(X(4))
endif
phi_main = phi
xpi = datan(1.d0) * 4.0d0
C
C --- IN CASE OF RADGEN
C
C ---------------------------------------------
elepi = elepin
sweight = 1.
snew = s
if (srad.eq.1.) then
13 continue
elepi = elepin
call QED_ISR(sngl(s),elepi,EGAMR,sweight)
ccc if (elepi.lt.5.) goto 13 ! commented by s.f. 17 July 2013 (it was a loop!!!)
cc write(6,*) 'x4 eg we ',X(4),egamr,sweight
mp = 0.93827d0
elep = dble(elepi)
eproton = dble(ehadi)
if (stFIXED_save) then
snew = 2.0d0 * elep * mp + mp**2
else
snew = 4.0d0 * elep * eproton
endif
endif
weight = dble(sweight)
C ---------------------------------------------
i_outrange = 0
CLS>> NEW
ym_main = 0.93827d0
C ----- For dissociated proton :
IF (stIELAS.eq.0) THEN
call PXMASS (ym_main,ENHA)
ENDIF
mp = 0.93827d0
if (stIELAS.eq.1) then
t_min = -mp**2*x_main**2/(1.d0-x_main)
else
cep t_min = x_main*(ym_main**2-mp**2)/(1.d0-x_main)
t_min = -ym_main**2 * x_main/(1.d0-x_main) + mp**2 * x_main
endif
if (t_main.gt.t_min) i_outrange = 1
if (t_main.gt.t_min) then
ccc write(6,*) 'out of tmin',t_min,t_main
endif
if (t_main.gt.t_min) goto 999
xntp = sngl(x_main)
qntp = sngl(q_main)
phintp = sngl(phi_main)
tntp = sngl(t_main)
shat = sngl(snew)
ytest = qntp/(xntp*(shat - sngl(mp)**2))
wmin_test = 0.2*sqrt(qntp/xntp)
ccc print *,ym_main,wmin_test
cls if (sngl(ym_main).gt.wmin_test) then
cls i_outrange = 1
cls goto 999
cls endif
cc if ((ytest.gt.0.06301197).or.(ytest.lt.0.03544423)) then
if ((ytest.gt.0.99).or.(ytest.lt.0.)) then
i_outrange = 1
goto 999
endif
CLS>>
if (stFIXED_save) then
call calc_kinem2_fixed(ibad,ioutkin,isca)
else
call calc_kinem2(ibad,ioutkin,isca)
endif
cc print *,ioutkin
if (ioutkin.eq.1) goto 999
CLS>>
mel = 0.000511
if (qntp.lt.((mel**2*ytest**2)/(1.-ytest))) then
i_outrange = 1
goto 999
endif
ccc i_outrange = 0
phi_newcalc_0 = dble(calcphirb(1.,0))
phi_newcalc = dble(calcphirb(1.,1))
phibel_0=sngl(phi_newcalc_0)
phibel=sngl(phi_newcalc)
resoltest = 100*(phibel_0-phibel)/phibel_0
resol = real(resoltest)
phibelrec=real(phibel)
phibelgen=real(phibel_0)
ccc phi_newcalc_0 = 0.
ccc print *,phi_newcalc_0
c-------------------------------------
call dvcsob(spin,Z,A,nx,nq,icount,xx,q,snew,t,phi,pphi,
> theta,tchar,xlaml,xlamp,iord,res,phi_newcalc_0)
cc call dvcsob(spin,Z,A,nx,nq,icount,xx,q,snew,t,phi,pphi,
cc > theta,tchar,xlaml,xlamp,iord,res) ! S. Fazio August 2010
c-------------------------------------
icount = 2
if (i_outrange.eq.1) goto 999
if (ipro.eq.1) resu = res(4) ! BH
if (ipro.eq.2) resu = res(2) ! DVCS
if (ipro.eq.3) resu = res(3) ! INT
xint = 1.*res(3)
if ((xint+res(4)+res(2)).lt.0.) xint=0.
if (ipro.eq.4) resu = res(4)+res(2)+xint
if (ipro.eq.4)
+ resu = (res(4)+res(2))*
+ (1+0.2*(-1.D0*SIGN)*DCOS(phi_newcalc_0))
ccc print *,SIGN
ccc if (ipro.eq.4) resu = res(7) ! CA without TW3
if (ipro.eq.5) resu = res(11) ! SSA without TW3
ccc print *,resu
ccc write(6,*) 'the cross section is:' resu
if (resu.lt.0.d0) then
write(6,*) 'warning FDVCS<0'
i_outrange = 1
endif
if (i_outrange.eq.1) goto 999
if (igen_exp.eq.1) then
resu = resu * xx
resu = resu * q
endif
fdvcs = resu
fdvcs = fdvcs*weight
c write(6,*) X(1),X(2),X(3),fdvcs
c --- Fill histograms :
c CALL XHFILL(1,sqrt(q/XX),fdvcs) ! S. Fazio October 2010
CALL XHFILL(1,XX,fdvcs)
CALL XHFILL(2,q,fdvcs)
CALL XHFILL(3,t,fdvcs)
CALL XHFILL(4,dble(egamr),fdvcs)
999 continue
c write(6,*) 'test! :',x_main,q_main,t_main,fdvcs
return
end