5 * Revision 1.1.1.1 1995/10/24 10:21:23 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.21 by S.Giani
14 C. ******************************************************************
16 C. * Simulates photon-electron COMPTON scattering. *
18 C. * The scattered photon energy is sampled using the quantum- *
19 C. * mechanical KLEIN-NISHINA formula. For this, the random *
20 C. * number techniques of BUTCHER and MESSEL(NUC. PHYS.20(1960), *
21 C. * 15) are employed. *
23 C. * (1) Effects due to binding of atomic electrons are *
24 C. * ignored(recoil electron energy assumed large compared *
25 C. * with binding energy). *
27 C. * ==>Called by : GTGAMA *
28 C. * Authors G.Patrick, L.Urban ********* *
30 C. ******************************************************************
32 #include "geant321/gcphys.inc"
33 #include "geant321/gctrak.inc"
34 #include "geant321/gcking.inc"
35 #include "geant321/gconsp.inc"
36 #include "geant321/gccuts.inc"
41 C. ------------------------------------------------------------------
49 DSIG2 = 0.5*(1.-EMIN*EMIN)
52 C Decide which part of F(E)=1/E+E to sample from.
55 IF (DSIG1.LT.DSIGT*RNDM(1))THEN
57 C Sample from F2(E) distribution.
61 IF (EZERO.GE.(EZERO+1.)*RNDM(4))THEN
63 BRD = MAX(BRD,RNDM(5))
66 BR = EMIN+(1.-EMIN)*BRD
68 BR = EMIN*EXP(DSIG1*RNDM(2))
71 C Scattered photon energy.
75 C Calculate rejection function G(E).
77 T = EMASS*(1.-BR)/EGAM2
78 SINTH = MAX(0.,T*(2.-T))
79 REJ = 1.0-(BR*SINTH)/(1.+BR*BR)
80 IF (RNDM(3).GT.REJ) GO TO 10
82 C Successful sampling of scattered photon.
84 C CUTS ON ENERGY THRESHOLDS ?
87 IF((EGAM2.LE.CUTGAM).AND.(TEL.LE.CUTELE)) THEN
93 DESTEP = DESTEP + EGAM1
97 C Generate photon angles with respect to a Z-axis
98 C defined along the parent photon.
99 C PHI is generated isotropically
108 C Polar co-ordinates to momentum components.
110 PGAM(1) = EGAM2*SINTH*COSPHI
111 PGAM(2) = EGAM2*SINTH*SINPHI
112 PGAM(3) = EGAM2*COSTH
114 C Momentum vector of recoil electron.
120 GKIN(3,1) = EGAM1-PGAM(3)
128 C Rotate electron and scattered photon into GEANT system
130 CALL GFANG(VECT(4),COSTH,SINTH,COSPH,SINPH,ROTATE)
132 CALL GDROT(PGAM(1),COSTH,SINTH,COSPH,SINPH)
133 CALL GDROT(GKIN,COSTH,SINTH,COSPH,SINPH)
136 C Correct photon for energy lost and scattered angle
139 60 VECT(I+3) = PGAM(I)/EGAM2
147 IF((ICOMP.NE.1).OR.(TEL.LE.CUTELE)) THEN
149 DESTEP = DESTEP + TEL
152 C Update probabilities