5 * Revision 1.3 1997/06/20 18:32:55 japost
6 * A summary of the problem buf fix and its original report:
8 * ------------------------------------------------------------------------------
9 * From: Shawn McKee - (313) 764-4395 <mckee@pooh.physics.lsa.umich.edu>
10 * Subject: RE: Problem with FLUKA interface
11 * Date: Thu, 12 Jun 97 18:09:31 METDST
14 * I have seen this error with FLUKA. I traced it to
15 * the following statement:
17 * IF (RNDEVT .GE. SINE/FSIG) THEN
19 * Apparently FSIG (for this event) was not initialized
20 * properly (it is 0.0). My fix was to insert a check
21 * on FSIG in the FLUFIN routine source.
23 * ------------------------------------------------------------------------------
24 * From: pniemine@estwm0.wm.estec.esa.nl
25 * Subject: Problem with FLUKA interface - cern.heplib #5667
26 * Date: Thu, 12 Jun 97 17:21:14 METDST
28 * In trying to run a GEANT program with FLUKA interface in our VMS-AXP (Alpha)
29 * cluster, I get the following error message (originating from FLUFIN) once
30 * a hadronic interaction is to be simulated:
32 * arithmetic trap, floating/decimal divide by zero
33 * ------------------------------------------------------------------------------
35 * Revision 1.2 1996/02/27 14:12:57 ravndal
36 * Correction for overstopped antiprotons
38 * Revision 1.1.1.1 1995/10/24 10:19:53 cernlib
42 #include "geant321/pilot.h"
43 *CMZ : 3.21/02 19/05/94 13.35.12 by S.Ravndal
44 *FCA : 05/01/99 09:47:25 by Federico Carminati
45 * Added Xi- to the list of particles that are forced
49 #include "geant321/gcbank.inc"
50 #include "geant321/gccuts.inc"
51 #include "geant321/gcjloc.inc"
52 #include "geant321/gcflag.inc"
53 #include "geant321/gckine.inc"
54 #include "geant321/gcking.inc"
55 #include "geant321/gcmate.inc"
56 #include "geant321/gcphys.inc"
57 #include "geant321/gctrak.inc"
58 #include "geant321/gsecti.inc"
59 #include "geant321/gctmed.inc"
60 #include "geant321/gcunit.inc"
61 #include "geant321/dimpar.inc"
63 #if !defined(CERNLIB_SINGLE)
64 #include "geant321/finuct.inc"
66 #include "geant321/finuc.inc"
68 #if !defined(CERNLIB_SINGLE)
69 DOUBLE PRECISION AOCMBM, AMSS , ZTAR, RHO , ZLIN, ZLEL, ZLRAD,
72 COMMON / FKMAPA / AOCMBM (MXXMDF), AMSS (MXXMDF), ZTAR (MXXMDF),
73 + RHO (MXXMDF), ZLIN (MXXMDF), ZLEL (MXXMDF),
74 + ZLRAD (MXXMDF), ZUL (MXXMDF), MEDIUM (MXXRGN),
75 + MULFLG (MXXMDF),IFCOMP(MXXMDF), MSSNUM (MXXMDF),
76 + NREGS, NMATF, MTBSNM
77 #if !defined(CERNLIB_SINGLE)
78 #include "geant321/part2t.inc"
80 #include "geant321/part2.inc"
81 #if !defined(CERNLIB_SINGLE)
82 #include "geant321/comcont.inc"
84 #include "geant321/comcon.inc"
85 #if !defined(CERNLIB_SINGLE)
86 #include "geant321/fheavyt.inc"
88 #include "geant321/fheavy.inc"
89 #include "geant321/paprop.inc"
90 #if !defined(CERNLIB_SINGLE)
91 #include "geant321/papropt.inc"
93 #include "geant321/gfkdis.inc"
94 #if !defined(CERNLIB_SINGLE)
95 DOUBLE PRECISION POO,EKE,TXI,TYI,TZI,AMM,WE,ONE,PGEANT,DMOD
98 DIMENSION IGTOFL(49),IFLTOG(39),IHVTOG(6),ZSAMP(50)
99 DATA IGTOFL / 0, 0, 0, 0, 0, 0,23,13,14,12, 15,16, 8, 1, 2,19, 0,
100 +17,21,22, 20, 34, 36, 38, 9,18, 31, 32, 33, 35, 37, 39, 17*0/
102 DATA IFLTOG /14,15, 3, 2, 4, 4, 1,13,25, 5, 6,10, 8, 9,11,12,18,
103 +26,16,21, 19,20, 7, 7*0, 27, 28, 29, 22, 30, 23, 31, 24, 32/
104 DATA IHVTOG /13,14,45,46,49,47/
110 * o also xi- are forced to decay
111 * o Neutral particles are sent to GHSTOP
112 * o pi+ and K+/K- are forced to decay
113 * o pi-, antiprotons and antineutrons are sent to FLUKA
114 * for annihilation (not here but later in this routine)
116 + (GEKIN.EQ.0..AND.ITRTYP.EQ.3.AND.IPART.NE.25)) THEN
120 ELSE IF (GEKIN.EQ.0..AND.
121 + (IPART.EQ.8.OR.IPART.EQ.12.OR.IPART.EQ.11.OR.IPART.EQ.23)) THEN
129 IF (IFINIT(5) .EQ. 0) CALL FLINIT
138 DMOD = ONE/SQRT(TXI**2+TYI**2+TZI**2)
144 NCOMP = ABS (Q(JMA+11))
148 * Antiprotons, antineutrons and pi- are sent to
149 * eventv for annihilation
151 + (IPART.EQ.15.OR.IPART.EQ.9.OR.IPART.EQ.25)) THEN
160 ZSAMP(I+1) = ZSAMP(I) + Q(JMIXT+NCOMP+I)
163 ZCONT=ZSAMP(NCOMP+1)*RNDM(1)
165 IF(ZCONT.LE.ZSAMP(I+1)) GO TO 30
171 ZTAR(1) = Q(JMIXT+NCOMP+I)
172 RHO(1) = Q(JMIXT+2*NCOMP+I)*DENS
175 POO=SQRT(EKE*(EKE+2*AM(IJ)))
176 CALL EVENTV(IJ,POO,EKE,TXI,TYI,TZI,WE,1)
180 ELSE IF (GEKIN.LE.CUTHAD .AND. ITRTYP.EQ.4) THEN
181 DESTEP = DESTEP + GEKIN
198 IF ( RNDEVT .GE. SRAT) THEN
199 IF (GEKIN .GT. 0.02) THEN
200 POO=SQRT(EKE*(EKE+2*AM(IJ)))
207 CALL NUCREL(IJ,POO,EKE,TXI,TYI,TZI,AMM,WE)
212 IF(RCONT.LE.CABELX(I)) GO TO 50
216 CALL NUCREL(IJ,POO,EKE,TXI,TYI,TZI,ONE*Q(JMIXT+I),WE)
222 DESTEP = DESTEP + GETOT
225 IF (GEKIN .GT. 0.02) THEN
226 POO=SQRT(EKE*(EKE+2*AM(IJ)))
228 IF ((IJ.EQ.2 .OR. IJ.EQ.9 .OR. IJ.EQ.14 .OR. IJ.EQ.16)
229 + .AND. GEKIN .GT. 0.0) THEN
230 POO=SQRT(EKE*(EKE+2*AM(IJ)))
246 IF(RCONT.LE.CABINX(I)) GO TO 70
252 ZTAR(1) = Q(JMIXT+NCOMP+I)
253 RHO(1) = Q(JMIXT+2*NCOMP+I)*DENS
255 CALL EVENTV(IJ,POO,EKE,TXI,TYI,TZI,WE,1)
258 80 IF(NP.EQ.1.AND.NPHEAV.EQ.0.AND.KPART(1).EQ.IJ) THEN
262 VECT(7)=SQRT(TKI(1)*(TKI(1)+2*AMASS))
267 NSTAK1 = MIN(NP,MXGKIN-NGKINE)
268 IF(NP.GT.NSTAK1) THEN
269 WRITE(CHMAIL,10000) NP-NSTAK1
274 IF (KPART(K) .EQ. 24 .OR. KPART(K) .EQ. 25) THEN
277 IF (RNDM(1) .GT. 0.5) KPART(K) = 12
279 IGEPAR = IFLTOG(KPART(K))
280 JPA = LQ(JPART-IGEPAR)
282 PGEANT = SQRT(TKI(K)*(TKI(K)+2*AGEMAS))
283 GKIN(1,NGKINE)=CXR(K)*PGEANT
284 GKIN(2,NGKINE)=CYR(K)*PGEANT
285 GKIN(3,NGKINE)=CZR(K)*PGEANT
286 GKIN(4,NGKINE)=TKI(K)+AGEMAS
287 GKIN(5,NGKINE)=IGEPAR
289 GPOS(1,NGKINE) = VECT(1)
290 GPOS(2,NGKINE) = VECT(2)
291 GPOS(3,NGKINE) = VECT(3)
294 NSTAK2 = MIN(NPHEAV,MXGKIN-NGKINE)
295 IF(NPHEAV.GT.NSTAK2) THEN
296 WRITE(CHMAIL,10100) NPHEAV-NSTAK2
301 IGEPAR = IHVTOG(KHEAVY(K))
302 JPA = LQ(JPART-IGEPAR)
304 PGEANT = SQRT(TKHEAV(K)*(TKHEAV(K)+2*AGEMAS))
305 GKIN(1,NGKINE)=CXHEAV(K)*PGEANT
306 GKIN(2,NGKINE)=CYHEAV(K)*PGEANT
307 GKIN(3,NGKINE)=CZHEAV(K)*PGEANT
308 GKIN(4,NGKINE)=TKHEAV(K)+AGEMAS
309 GKIN(5,NGKINE)=IGEPAR
311 GPOS(1,NGKINE) = VECT(1)
312 GPOS(2,NGKINE) = VECT(2)
313 GPOS(3,NGKINE) = VECT(3)
319 ZINTHA = GARNDM(DUMMY)
322 10000 FORMAT(' **** FLUFIN: Stack overflow, ',I6,' particles lost')
323 10100 FORMAT(' **** FLUFIN: Stack overflow, ',I6,
324 +' heavy particles lost')