Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gphys / gmgaus.F
CommitLineData
fe4da5cc 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)
14C.
15C. ******************************************************************
16C. * *
17C * Compute multiple scattering angles for a particle *
18C. * with parameters VECT in common /GCTRAK/ *
19C. * in current medium described in common /GCMATE/ *
20C. * Output angles overwrite VECT *
21C. * *
22C. * ==>Called by : GMULTS *
23C. * Authors R.Brun, M.Maire, G.Lynch ********* *
24C. * *
25C. ******************************************************************
26C.
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