5 * Revision 1.1.1.1 1995/10/24 10:21:37 cernlib
9 #include "geant321/pilot.h"
10 #if defined(CERNLIB_ASHO)
11 *CMZ : 3.21/02 29/03/94 15.41.25 by S.Giani
13 SUBROUTINE GDIFMG(DEL)
15 #include "geant321/gccuts.inc"
16 #include "geant321/gcasho.inc"
17 C-----------------------------------------------------------------------
18 C This program calculates the final distribution coef-
19 C ficients until the integral S is more or equal to L2.
20 C In case of S < L2 or miscalculations due to FORTRAN
21 C limits DONE = FALSE.
22 C-----------------------------------------------------------------------
23 C Update history: 10-08-93
25 C-----------------------------------------------------------------------
26 REAL BN(50),BNA(50),L2
30 C-----------------------------------------------------------------------
31 C Initialization steps
32 C-----------------------------------------------------------------------
36 BN(K) = BOSC(K)*IOSC(K)
37 BNA(K) = BN(K)*(AOSC(K) - 1.)
38 XX = XX + AOSC(K)*BOSC(K)
43 CMGO(1) = EXP(-CORMAX)
44 CMGO(2) = CMGO(1)*BNA(1)
45 Z = Z-(CMGO(1)+CMGO(2))*EXP(CORR)
46 C-----------------------------------------------------------------------
47 C Calculation of the current Ci
48 C-----------------------------------------------------------------------
57 CMGO(NMGO) = CMGO(NMGO - 1)*BNA(1)
62 IF(MOD(J+1,IOSC(K)).EQ.0) THEN
71 CMGO(NMGO) = CMGO(NMGO) + X*CMGO(M)
73 CMGO(NMGO) = CMGO(NMGO)/(NMGO-1)
74 Z = Z - CMGO(NMGO)*EXP(CORR)
78 50 IF (FLMAX.EQ.1) THEN
79 DEL = (NMGO-1)*EOSC(1)
81 DEL = (NMGO-1)*EOSC(1)*L2/RNDM
83 IF (DEL.GE.DCUTE*1E6) DEL = DCUTE*1E6