5 * Revision 1.1.1.1 1995/10/24 10:21:39 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.25 by S.Giani
12 FUNCTION GSTREN (GAMMA,ECUT,STEP)
13 C. ******************************************************************
15 C. * Simulation of energy loss straggling in thin layers. *
16 C. * Sampling is done from the tables which are prepared *
19 C. * ==> Called by : GTELEC, GTHADR, GTMUON *
20 C. * Authors : K. Lassila-Perini, I. Gavrilenko *
22 C. ******************************************************************
23 #include "geant321/gcbank.inc"
24 #include "geant321/gcjloc.inc"
25 #include "geant321/gcmate.inc"
26 #include "geant321/gcstra.inc"
28 DIMENSION ANGL(200),RNDM(2)
30 * Reading the tables, if the medium has not changed
35 IF(STEP.LE.0.) GO TO 90
37 * Interpolate the tables for the current gamma-factor
39 IF(GAML.GT.GAMLOG(21)) THEN
41 ANGL(J)=Q(JTSTCO+J*21)
46 IF(GAML.LE.GAMLOG(I)) THEN
47 DGG = (GAML-GAMLOG(I-1))/(GAMLOG(I)-GAMLOG(I-1))
55 ANGL(K) = Q(JTSTCO+(K-1)*21+IP-1)*DG1+
56 + Q(JTSTCO+(K-1)*21+IP )*DGG
60 * The sampling from the tables
72 R = LOG(RNDM(1)*DAN+ANMIN)
76 ELSEIF(R.LT.ANGL(K)) THEN
82 IF(K2-K1.GT.1 ) GO TO 60
84 E = Q(JTSTEN+K2)+(R-ANGL(K2))*
85 + (Q(JTSTEN+K1)-Q(JTSTEN+K2))/(ANGL(K1)-ANGL(K2))
89 * *** Total energy calculation
93 90 GSTREN = GSTLOC*1.E-9