]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/shaker/luradk.f
Syntax problems on HP-UX corrected
[u/mrichter/AliRoot.git] / PHOS / shaker / luradk.f
CommitLineData
fe4da5cc 1*CMZ : 17/07/98 15.44.35 by Federico Carminati
2*-- Author :
3C*********************************************************************
4
5 SUBROUTINE LURADK(ECM,MK,PAK,THEK,PHIK,ALPK)
6
7C...Purpose: to generate initial state photon radiation.
8*KEEP,LUDAT1.
9 COMMON /LUDAT1/ MSTU(200),PARU(200),MSTJ(200),PARJ(200)
10 SAVE /LUDAT1/
11*KEND.
12
13C...Function: cumulative hard photon spectrum in QFD case.
14 FXK(XX)=2.*LOG(XX)+PARJ(161)*LOG(1.-XX)+PARJ(162)*XX+
15 &PARJ(163)*LOG((XX-SZM)**2+SZW**2)+PARJ(164)*ATAN((XX-SZM)/SZW)
16
17C...Determine whether radiative photon or not.
18 MK=0
19 PAK=0.
20 IF(PARJ(160).LT.RLU(0)) RETURN
21 MK=1
22
23C...Photon energy range. Find photon momentum in QED case.
24 XKL=PARJ(135)
25 XKU=MIN(PARJ(136),1.-(2.*PARJ(127)/ECM)**2)
26 IF(MSTJ(102).LE.1) THEN
27 100 XK=1./(1.+(1./XKL-1.)*((1./XKU-1.)/(1./XKL-1.))**RLU(0))
28 IF(1.+(1.-XK)**2.LT.2.*RLU(0)) GOTO 100
29
30C...Ditto in QFD case, by numerical inversion of integrated spectrum.
31 ELSE
32 SZM=1.-(PARJ(123)/ECM)**2
33 SZW=PARJ(123)*PARJ(124)/ECM**2
34 FXKL=FXK(XKL)
35 FXKU=FXK(XKU)
36 FXKD=1E-4*(FXKU-FXKL)
37 FXKR=FXKL+RLU(0)*(FXKU-FXKL)
38 NXK=0
39 110 NXK=NXK+1
40 XK=0.5*(XKL+XKU)
41 FXKV=FXK(XK)
42 IF(FXKV.GT.FXKR) THEN
43 XKU=XK
44 FXKU=FXKV
45 ELSE
46 XKL=XK
47 FXKL=FXKV
48 ENDIF
49 IF(NXK.LT.15.AND.FXKU-FXKL.GT.FXKD) GOTO 110
50 XK=XKL+(XKU-XKL)*(FXKR-FXKL)/(FXKU-FXKL)
51 ENDIF
52 PAK=0.5*ECM*XK
53
54C...Photon polar and azimuthal angle.
55 PME=2.*(ULMASS(11)/ECM)**2
56 120 CTHM=PME*(2./PME)**RLU(0)
57 IF(1.-(XK**2*CTHM*(1.-0.5*CTHM)+2.*(1.-XK)*PME/MAX(PME,
58 &CTHM*(1.-0.5*CTHM)))/(1.+(1.-XK)**2).LT.RLU(0)) GOTO 120
59 CTHE=1.-CTHM
60 IF(RLU(0).GT.0.5) CTHE=-CTHE
61 STHE=SQRT(MAX(0.,(CTHM-PME)*(2.-CTHM)))
62 THEK=ULANGL(CTHE,STHE)
63 PHIK=PARU(2)*RLU(0)
64
65C...Rotation angle for hadronic system.
66 SGN=1.
67 IF(0.5*(2.-XK*(1.-CTHE))**2/((2.-XK)**2+(XK*CTHE)**2).GT.
68 &RLU(0)) SGN=-1.
69 ALPK=ASIN(SGN*STHE*(XK-SGN*(2.*SQRT(1.-XK)-2.+XK)*CTHE)/
70 &(2.-XK*(1.-SGN*CTHE)))
71
72 RETURN
73 END