Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gphys / gphal3.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:21:29 cernlib
6* Geant
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.22 by S.Giani
11*-- Author :
12 FUNCTION GPHAL3(BET)
13C.
14C. ******************************************************************
15C. * *
16C. * Generates Photoelectron Angular ditribution from L3 shell *
17C. * *
18C. * ==>CALLED BY : GPHOT *
19C. * AUTHOR : J. Chwastowski *
20C. * *
21C. ******************************************************************
22C.
23 DOUBLE PRECISION SAUT1,SAUT2,SAUT3,SAUT4,SAUT5,SAUT6,SAUT7
24 DOUBLE PRECISION S1,S2,S3,S4,S5,S6,S7,BETVAL,AMAJOR
25 DOUBLE PRECISION COST,SIN2T,X,XI,XI2,XI3,ANOR,DRN
26 DOUBLE PRECISION GAMA,G1,G2,G3,G4,G5,BETA,B1
27 PARAMETER(BETMAX=0.999998)
28 PARAMETER (ONE=1,HALF=ONE/2)
29 DIMENSION BETVAL(13),AMAJOR(13),RAN(2)
30 DATA BETVAL / 0.0101,0.101,0.2,0.401,0.601
31 + ,0.701,0.801,0.901,0.9901,0.99901
32 + ,0.999901,0.9999901,0.99999901 /
33 DATA AMAJOR / 2.05,2.2,2.3,2.4,2.5,2.6,2.81
34 + ,3.8,15.,54.,176.,560.,1800. /
35 DATA ANOR / 0.0 /
36 BETA = MIN(BET,BETMAX)
37 B1 = ONE-BETA
38 G2 = ONE/((ONE-BETA)*(ONE+BETA))
39 GAMA = SQRT(G2)
40 G3 = G2*GAMA
41 G4 = G2**2
42 G5 = G4*GAMA
43 G1 = GAMA-ONE
44 DO 10 I = 1,13
45 IF(BETA.LE.BETVAL(I)) THEN
46 ANOR = AMAJOR(I)*G5
47 GO TO 20
48 ENDIF
49 10 CONTINUE
50 20 CONTINUE
51 ANOR = ONE/ANOR
52 S1 = -HALF*GAMA*(3*GAMA-ONE)
53 S2 = G2*(3*G2-ONE)
54 S3 = G3*(G3-3*G2+2*GAMA+ONE)
55 S4 = HALF*G4*G1*(GAMA-2)
56 S5 = 2*(GAMA+ONE)
57 S6 = GAMA*(3*GAMA-ONE)*(GAMA+ONE)
58 S7 = G2*(G2-1)
59 GPHAL3 = 0.0
60 30 CONTINUE
61 CALL GRNDM(RAN,2)
62 DRN = 2*RAN(1)
63 COST = (DRN-B1)/(DRN*BETA+B1)
64 X = ONE-BETA*COST
65 SIN2T = (ONE-COST)*(ONE+COST)
66 XI = ONE/X
67 XI2 = XI**2
68 XI3 = XI**3
69 SAUT1 = S1*XI2
70 SAUT2 = S2*XI
71 SAUT3 = S3
72 SAUT4 = S4*X
73 SAUT5 = S5*XI3-S6*XI2-S7*XI
74 SAUT6 = SAUT5*SIN2T
75 SAUT7 = (SAUT1+SAUT2+SAUT3+SAUT4+SAUT6)*ANOR
76 IF(RAN(2).GT.SAUT7) GO TO 30
77 GPHAL3 = COST
78 END