This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gphys / gmgaus.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:26  cernlib
6 * Geant
7 *
8 *
9 *    EX GMUL
10 #include "geant321/pilot.h"
11 *CMZ :  3.21/02 29/03/94  15.41.22  by  S.Giani
12 *-- Author :
13       SUBROUTINE GMGAUS(BETA2,DIN)
14 C.
15 C.    ******************************************************************
16 C.    *                                                                *
17 C     *       Compute multiple scattering angles for a particle        *
18 C.    *       with parameters VECT in common /GCTRAK/                  *
19 C.    *       in current medium described in common /GCMATE/           *
20 C.    *       Output angles overwrite VECT                             *
21 C.    *                                                                *
22 C.    *    ==>Called by : GMULTS                                       *
23 C.    *       Authors    R.Brun, M.Maire, G.Lynch  *********           *
24 C.    *                                                                *
25 C.    ******************************************************************
26 C.
27 #include "geant321/gctrak.inc"
28 #include "geant321/gcphys.inc"
29 #include "geant321/gcmulo.inc"
30 #include "geant321/gconsp.inc"
31       DIMENSION DIN(3),RNDM(3)
32 *
33 *     ------------------------------------------------------------------
34 *
35 * *** Computes mean deviation angles in radian
36 *
37 *     Scattering corresponding to OMEGA0 = 4E4 scatters and F=0.98.
38 *
39       SIGMA  = 2.557 * CHCMOL*SQRT(STMULS)/(GETOT*BETA2)
40 *
41       CALL GRNDM(RNDM,3)
42       PHI = TWOPI*RNDM(2)
43       THETA  = SIGMA*SQRT(-2.*LOG(RNDM(1)))
44       IF(RNDM(3).GT.0.5)THETA=-THETA
45       SINT   = SIN(THETA)
46       DIN(1) = SINT*SIN(PHI)
47       DIN(2) = SINT*COS(PHI)
48       DIN(3) = COS(THETA)
49 *
50       END