5 * Revision 1.2 1996/11/06 12:53:21 ravndal
6 * Correct the rotation into the GEANT system
8 * Revision 1.1.1.1 1995/10/24 10:21:33 cernlib
12 #include "geant321/pilot.h"
13 *CMZ : 3.21/02 29/03/94 15.41.23 by S.Giani
17 C. ******************************************************************
19 C. * Generates COHERENT SCATTERING mechanism *
21 C. * ==>Called by : GTGAMA *
22 C. * Author G.Tromba, P.Bregant *
24 C. ******************************************************************
26 #include "geant321/gcbank.inc"
27 #include "geant321/gctrak.inc"
28 #include "geant321/gcphys.inc"
29 #include "geant321/gconsp.inc"
30 #include "geant321/gcking.inc"
31 #include "geant321/gcjloc.inc"
32 #include "geant321/gcmulo.inc"
37 C. ------------------------------------------------------------------
44 IF (Q(JRAYL+I).GT.0.9*BIG) THEN
50 C Extract a value for the momentum transfer according
51 C with the FORM FACTORS distribution.
53 IF (IEKBIN.LT.IMAX) THEN
55 A2MAX=GEKRT1*Q(JRAYL+NEK1+IEKBIN)+GEKRAT*Q(JRAYL+NEK1+IEKBIN+1)
57 A2MAX=Q(JRAYL+NEK1+IEKBIN)
63 IF (A2.LE.Q(JRAYL+I+NEK1)) THEN
70 GA2RAT =(A2-Q(JRAYL+NEK1+IE-1))/(Q(JRAYL+NEK1+IE)
71 + -Q(JRAYL+NEK1+IE-1))
72 QNEW = ELOW(IE-1)*(1.-GA2RAT)+ELOW(IE)*GA2RAT
74 GA2RAT = A2/Q(JRAYL+NEK1+IE)
75 QNEW = ELOW(IE)*GA2RAT
79 COSTH=1.-0.5*(QNEW*GEKIN1)**2
80 IF(RNDM(2).GT.0.5*(1.+COSTH**2)) GO TO 5
81 SINTH=SQRT((1.-COSTH)*(1.+COSTH))
83 C Extract PH (PHI unif. between 0 and 2PI)
89 C Set new VECT(I), i=4,5,6
90 VROT(1)=GEKIN*SINTH*COSPH
91 VROT(2)=GEKIN*SINTH*SINPH
94 C Rotate scattered photon into GEANT system
96 CALL GFANG(VECT(4),COSTH,SINTH,COSPH,SINPH,ROTATE)
97 IF (ROTATE) CALL GDROT(VROT,COSTH,SINTH,COSPH,SINPH)
99 VMROT=1./SQRT(VROT(1)*VROT(1)+VROT(2)*VROT(2)+VROT(3)*VROT(3))
100 VECT(4)=VROT(1)*VMROT
101 VECT(5)=VROT(2)*VMROT
102 VECT(6)=VROT(3)*VMROT
104 C Update probabilities