5 * Revision 1.1.1.1 1995/10/24 10:19:48 cernlib
9 #include "sys/CERNLIB_machine.h"
11 *CMZ : 3.21/02 29/03/94 15.41.18 by S.Giani
14 * Correction cradle for version 3.15 of the GEANT Programme
15 * and history of the evolution of 3.16.
20 * Only corrections flagged by "Introduced in the 3.15 correction
21 * cradle" are applied to 3.15. All the other comments refer
22 * to modifications which will appear in the 3.16 version of
25 ********************************************************************
29 * Release of the 3.11 correction cradle.
33 * Correction in GBRELE and GRANGI. Thanks to F.Carminati.
34 * Introduced in the 3.15 correction cradle.
38 * Release of the 3.10/00 correction cradle.
42 * Correction in FKDECA and HADEVV to permit the correct
43 * treatment of charmed particles decay. Thanks to
44 * A.Ferrari. Introduced in the 3.15 correction cradle.
46 * Correction in FKDRES to avoid a loop. Thanks to
47 * B.Slater and A.Ferrari. Introduced in the 3.15 correction
52 * Correction in GDRAW to update current pointer to IN
53 * bank. Correction in GGPPAR to compute the internal
54 * parameters of a TRAP with negative parameters. Thanks
55 * to S.Banerjee. Introduced in the 3.15 correction cradle.
59 * Correction in GTNEUT, GTHADR, to allow hadronic decay
60 * in the vacuum. Thanks to R.Jones. Introduced in the
61 * 3.15 correction cradle.
65 * Correction in GNSLWD to avoid numerical problem. Thanks
66 * to A.Parri. Introduced in the 3.15 correction cradle.
70 * Release of the 3.09/00 correction cradle.
74 * Correction in GNOCTU, thanks to M.Nessi. Introduced in
75 * the 3.15 correction cradle.
79 * Correction in EVENTV to protect square root of a negative
80 * number. Thanks to B.Slater and A.Ferrari. Introduced in
81 * the 3.15 correction cradle.
85 * New tratment for thin layer, mainly gas, of dE/dx
86 * introduced. Thanks to V.Grishin, S.Kotelnikov,
87 * K.Lassila-Perini and P.Nevski.
89 * All bit manipulation functions replaced by Military
90 * Standard functions. Thanks to F.Carminati.
94 * Correction in FLUFIN in order to avoid 0 mechanism
95 * number when IHADR=2. Thanks to P.Bloch. Introduced
96 * in the 3.15 correction cradle.
98 * Correction in GSROTM, NROTM updated when the bank is
99 * pushed. Thanks to M.Maire. Introduced in the 3.15
102 * Correction in ERTRGO. Thanks to E.Nagy. Introduced
103 * in the 3.15 correction cradle.
107 * Release of version 3.08 of the correction cradle.
109 * New version of the FLUKA interface introduced. New
110 * model for energy straggling introduced (Ermilova&
111 * Checkin) and synchrotron radiation. Thanks to K.
112 * Lassila-Perini, A.Ferrari&P.Sala et al. and I.
113 * Gavrilenko. Please see the documentation for more
116 * New routine GFANG introduced. It finds the angles
117 * Theta and Phi which are used to rotate a vector in
118 * the master system of the other. Thanks to F.Carminati
120 * New rotine GVROT introduced. It will rotate in full
121 * double precision a vector in the reference system of
122 * another one. Thanks to F.Carminati
124 * Corrections in GRIN/GFIN to calculate correctly the
125 * number of rotation matrixes. Thanks to M.Maire.
126 * Introduced in the 3.15 correction cradle.
128 * Correction in FLUFIN to pass antiprotons to FLUKA when
129 * they are 'stopping'. Thanks to A.Ferrari. Introduced in
130 * the 3.15 correction cradle.
135 * Corrections in FLUFIN to pass stopping antiprotons,
136 * antineutrons and pions to FLUKA for annihilation. The
137 * other hadrons are either decayed or (neutral particles)
138 * passed to GHEISHA/GHSTOP.
142 * Correction in FDNOPT to properly initialise an
143 * array. Thanks to K.Lassila-Perini. Introduced in
144 * the 3.15 correction cradle.
148 * New routine from Laszlo Urban for the tracking of
149 * ions, GTHION. Ions now have to be given particle
150 * type 8. Thanks to L.Urban.
154 * Addition in GPPERP, the sphere has been added. Thanks
157 * Old Hadrin/Nucrin interface deleted. HADR 3 flag has
158 * no meaning any more. Warning message introduced in
159 * GPHYSI, when IHADR=3 then reset it to 1 and use GHEISHA.
160 * Thanks to F.Carminati.
162 * Tatina code eliminated from GEANT. Thanks to F.Carminati.
164 * Small changes in GSCHIT to avoid integer/floating
165 * conversions and to speed-up the code. Thanks to
170 * Correction in the GPOISS routine to avoid overflows.
171 * Thanks to S.Qian. Introduced in the 3.15 correction
176 * Correction in GNSPHR to avoid floating point overflow.
177 * Thanks to S.Ljungfelt. Introduced in the 3.15 correction
182 * Correction in GEAMON to extend the field for CPU
183 * time. Thanks to R.Brun. Introduced in the 3.15
188 * Release of version 3.07 of the correction cradle.
190 * Corrections in GZINIT, GPHYSI and GDSHOW. The
191 * working space is now allocated via calls to
192 * GWORK. GWORK has been modified and it only
193 * increases the working space, it never reduces it.
194 * Thanks to M.Corden. Introduced in the 3.15
199 * Correction in GFIN/GFOUT to avoid spurious error
200 * message. Thanks to M.Maire.
204 * Correction in GLTRAC to improve the precision of
205 * the calculation of the kinetic energy. Thanks to
206 * C.Zeitnitz. Introduced in the 3.15 correction
209 * Correction in GTRACK to avoid output overflow in
210 * format statement. Thanks to M.Corden. Introduced
211 * in the 3.15 correction cradle.
213 * Correction in GDXYZ to obtain the correct line color
214 * for a track. Thanks to M.Corden. Introduced in the
215 * 3.15 correction cradle.
219 * New treatment of the photoelectric effect introduced.
220 * Thanks to J.Chwastowski. Please see documentation for
225 * Changes in GKGEOM to avoid warnings with the new
226 * version of KUIP. Thanks to A.Nathaniel. Introduced
227 * in the 3.15 correction cradle.
229 * Changes in GSDVN2 to support division of spheres
230 * in PHI with initial offset. Thanks to F.Carminati.
232 * Changes in GMEDIV and GNSPHR to correct precision
233 * problems. Thanks to F.Carminati.
235 * Introduction of the Cerenkov effect. Thanks to
236 * R.Jones. Please see documentation for more
241 * Changes in GSDVN to support division in PHI (axis
242 * N. 3) of the sphere. Thanks to F.Carminati.
244 * Changes in GDRAWS to partially support the drawing
245 * of parts of sphere. Thanks to F.Carminati.
249 * Release of version 3.06 of the correction cradle.
253 * Correction in GXINT for compatibility with the KUIP
254 * installed with version 93a of the CERN Program Library.
255 * Thanks to R.Jones. Introduced in the 3.15 correction
260 * Correction in GMUNU. Only GHEISHA used to handle the
261 * interaction irrespective of the value of IHADR. Thanks
262 * to K.Lassila-Perini and G.Battistoni. Introduced in the
263 * 3.15 correction cradle.
265 * Corrections in GGPPAR to handle a tube with negative
266 * parameters positioned into a tubes in the general case.
267 * Thanks to F.Carminati.
271 * Correction in FLUFIN to make sure that just neutrons
272 * are passed to GHEISHA. Thanks to K.Lassila. Introduced
273 * in the 3.15 correction cradle.
277 * Option Q(uiet) introduced in GRIN/GROUT. Thanks to
280 * New version of GRKUTA protected against 0 fields and
281 * improved for precision. Introduced in the 3.15 correction
282 * cradle. Thanks to W.Manner.
286 * IQ(JRUNG+29) set to the event sequence number of the
287 * last generated event in GTRIGC. Thanks to M.Maire.
291 * Call to LUPART replaced with LU1ENT in GLUDKY. LUPART
292 * was an obsolete routine deleted from JETSET 7.3
293 * library. Thanks to R.Gomes.
297 * Release of the version 3.05/00 of the correction
300 * Corrections in GRANGI to account for the use of the
301 * ERAN card. Thanks to P.Gumplinger. Introduced in the
302 * 3.15 correction cradle.
306 * Correction in GDRAWS for very thin CTUBes. Thanks to
307 * M.Guidal. Introduced in the 3.15 correction cradle.
309 * New version of GRKUTA introduced. It will limit the
310 * number of iterations and cut steps to prevent looping.
311 * Thanks to V.Perevotchikov. Introduced in the 3.15
316 * Correction in GGDSPE to allow repeated division of
317 * tubes along R. Thanks to M.Maire. Introduced in the
318 * 3.15 correction cradle.
322 * Correction in GNPCON when the particle is slightly
323 * outside of the last plane in Z. It could happen for
324 * precision problems. Thank to C.Georgiopoulos.
325 * Introduced in the 3.15 correction cradle.
327 * Quiet option introduced in GFIN and GFOUT to suppress
328 * printing. Thanks to A.Eisner.
330 * Correction in the header of GFIN, GFOUT. Thanks to
333 * Correction to GSNEXT. It now checks the values of the
334 * input list. Repeated values or values which are not
335 * within the allowed limits are ignored and a warning
336 * message is printed. Thanks to F.Luehring.
340 * Modification in GSVOLU. A warning is printed if the same
341 * volume name is repeated twice. Thanks to V.Perevoztchikov.
345 * Print statement in GSKING replaced by a WRITE(CHMAIL
346 * Thanks to F.Carminati.
350 * Correction in GDRAY to increase the precision of
351 * the angle calculation. Thanks to F.Malek.
352 * Introduced in the 3.15 correction cradle.
356 * Release of version 3.04 of the correction cradle.
358 * Corrections in FEREVV and HADEVV. Thanks to A.Ferrari.
359 * Introduced in the 3.15 correction cradle.
363 * Release of version 3.03 of the correction cradle.
367 * Correction in GFIN and GFOUT to handle correctly
368 * ZEBRA error conditions. Thanks to H.Uijterwaal.
369 * Introduced in the 3.15 correction cradle.
371 * Correction in GDECAY to improve precision of rotation
372 * of secondaries. Thanks to F.Carminati. Introduced in
373 * the 3.15 correction cradle.
375 * Correction in FEREVV to avoid square root of negative
376 * number. Thanks to A.Ferrari. Introduced in the 3.15
379 * Correction in GDRAW to avoid error when traversing the
380 * tree. Thanks to F.Carminati. Included in the 3.15
385 * Correction in GXPICT, added definition of a character
386 * variable. Thanks to F.Carminati. Introduced in the 3.15
391 * Corrections in ERPRDOC, EUFILV and ERTEST to change
392 * Hollerith in characters for GEANE. Thanks to V.Innocente.
393 * Introduced in the 3.15 correction cradle.
397 * Correction in NUCREL to avoid square root of negative
398 * numbers. Thanks to A.Ferrari. Introduced in the 3.15
403 * Correction in GMEDIA. INFR not set going up the tree to
404 * avoid problem with user calls of GMEDIA during tracking.
405 * Thanks to S.Banerjee. Introduced in the 3.15 correction
410 * Correction in GRANGI to avoid interpolation of DE/DX
411 * beyond 10GeV. Thanks to V.Innocente. Introduced in the
412 * 3.15 correction cradle.
416 * Correction in GBRELA. Auxiliary integration point for
417 * muon dedx table was wrong. Thanks to V.Innocente.
418 * Introduced in the 3.15 correction cradle.
422 * Release of version 3.02 of the correction cradle.
424 * Correction in GMEDIA, GTMEDI: JVIN not properly
425 * initialised. Thanks to F.Carminati. Introduced in
426 * the 3.15 correction cradle.
428 * Release of version 3.01 of the correction cradle.
430 * Correction to GSDVN for a mistype. Thanks to H.Plothow.
431 * Introduced in the 3.15 correction cradle.
433 * Small mod to GSNGTR for the CRAY. Function DSIGN changed
434 * to SIGN. Thanks to F.Carminati. Introduced in the 3.15
437 * Release of version 3.00 of the correction cradle.
439 * Correction in GDECAY. When IDCAY=2 the routine does not
440 * produce secondaries. Thanks to R.Jones. Introduced in
441 * the 3.15 correction cradle.
443 * Corrections in GFIN, GFOUT. Thanks to B.Cole. Introduced
444 * in the 3.15 correction cradle.
448 * Correction in GMEDIV, GMEDIA, GINVOL, GTMEDI to
449 * improve precision and prevent blocking of volumes.
450 * Thanks to F.Carminati, R.Jones. Introduced in the
451 * 3.15 correction cradle.
455 * GDLADY and GDMISS routines introduced. Thanks to
458 * Correction in GXDRAW for the coordinates of the
459 * drawing of the GIRL. Thanks to F.Carminati.
460 * Introduced in the 3.15 correction cradle.
462 * Correction in GPHSIG, typing mistake in a formula.
463 * Thanks to M.Fanti. Introduced in the 3.15 correction
468 * Corrections in GSDVN, GGPPAR, GGDPAR, GMEDIV, GCENT,
469 * GSDVN2, GSDVT, GSDVT2 to allow the division of a TRAP
470 * along y. Thanks to F.Carminati. Introduced in the 3.15
473 * Corrections in GNPGO1 for precision problems. Thanks
474 * to K.Lassila. Introduced in the 3.15 correction
477 * Corrections in GGDPAR, GSDVN for the z division of a
478 * Polygone. Thanks to F.Carminati. Introduced in the
479 * 3.15 correction cradle.
483 * Correction in GSDVT for the division of a parallepiped.
484 * Thanks to Y.Fisiak. Introduced in the 3.15 correction
487 * Correction in GRKUTA. Helix is used if angle of
488 * curvature is too large. In this case step is anyway
489 * smaller than STMIN which is under user control.
490 * Thanks to H.Plothow and V.Perevotchikov. Introduced
491 * in the 3.15 correction cradle.
495 * Correction in GKRZ and CDF for the command RZ/FILE.
496 * Record lenght fixed at 1024 in GRFILE cannot be
497 * Changed by the user. Thanks to H.Plothow. Introduced
498 * in the 3.15 correction cradle.
500 * Corrections in GTMEDI, GMEDIA and GINVOL for the case
501 * of 'MANY' volumes. Uncleared blocking words found in
502 * the tree. Thanks to H.Plothow. Introduced in the 3.15
507 * Correction in GNSPHR. The PHI limits were used
508 * incorrectly in calculating the distance to the
509 * sphere. This was slowing down calculation but still
510 * giving correct results. Thanks to J.Stepanek.
511 * Introduced in the 3.15 correction cradle.
515 * Correction in GGORDQ. Incorrect counting of volumes
516 * in case of phi ordering and phi division spanning
517 * across 0 degrees. Thanks to L.Roberts and F.Carminati.
518 * Introduced in the 3.15 correction cradle.
522 * Version 2.00 of the correction cradle released
525 * Correction in GDRELP and GDRELM. The shell corrections
526 * where underestimated due to a wrong factor introduced
527 * translating the original formula from ev to Gev. Thanks
528 * to A.Ferrari and K.Lassila-Perini. Introduced in the
529 * 3.15 correction cradle.
533 * Correction in GCENT in case of general trapezoid sliced
534 * in z in a local development structure.
535 * Thanks to S.Chekhtman. Introduced in the 3.15 correction
538 * Correction in GHEISH. Time of flight correctly initialised
539 * for particles with number > 48. Thanks to A.Eisner.
540 * Introduced in the 3.15 correction cradle.
544 * Correction in GGPPAR for boxes with negative parameters
545 * in traps. The current code supports correctly boxes with
546 * one, two or three negative parameters positioned in a trap
547 * not necessarily in the centre. The trap must not be twisted
548 * and the ALP1 and ALP2 angles (PAR(7) and PAR(11)) must be
549 * equal. This facility must be used with care because the
550 * algorithm first maximises Z, then Y and then X. The result
551 * may be not quite what is expected in all cases, and the
552 * user is invited to check carefully the result. Thanks to
553 * H.Plothow. Introduced in the 3.15 correction cradle.
557 * Correction in GINVOL, GTMEDI and GMEDIA to handle correctly
558 * the GSNEAR case when LIST(1)=1 and LIST(2)=0, that is when
559 * all the volume are separated inside a mother. Optimisation
560 * of the routine in case a large number of objects are
561 * positioned at the same level and GUNEAR is used. Thanks to
562 * R.Jones, M.Lefebvre and M.Pieri. Introduced in the 3.15
567 * Correction in GTNEXT. When the currents step brings
568 * the particle on the surface of the next volume, signal
569 * IGNEXT=1 to GTxxxx to 'push' into the next volume.
570 * This is a genuine bug and some volumes may be lost
571 * due to this. Thanks to M.Maire. Introduced in the 3.15
576 * Corrections to the precision in GNOPG1, GNCONE, GNOCON.
577 * Thanks to R.Jones. Introduced in the 3.15 correction
582 * Correction in the printout of GTRACK when max number
583 * of steps is reached. Event number and random numbers are
584 * printed out as well. Thanks to M.Maire. Introduced in the
585 * 3.15 correction cradle.
589 * Correction in PIMABS for HPUX only. If variable NT is
590 * saved then the routine compiles correctly, otherwise
591 * not. Thanks to F.Carminati. Introduced in the 3.15
594 * Correction in NIZL. All local variable are saved now.
595 * Thanks to F.Carminati. Introduced in the 3.15 correction
600 * Correction in CDF and in GKDRAW. Minimum angle for the
601 * drawing is 0 and not 1. Thanks to H.Plothow. Introduced
602 * in the 3.15 correction cradle.
604 * Minor update of GXFZ, a character length has been set
605 * to 4 to keep KUIP happy. Thanks to F.Carminati. Introduced
606 * in the 3.15 correction cradle.
610 * Corrections in GXFZ. Now the array LUNITS is properly
611 * updated when a file is closed.
613 * Correction in GBRSGE, GBRSGM. Save statement introduced.
614 * Thanks to L.Roberts. Introduced in the 3.15 correction
617 * Correction in GINVOL for many volumes. Thanks to S.Giani
618 * and R.Jones. Introduced in the 3.15 correction cradle.
620 * Correction in GMCOUL to prevent a division by 0. Thanks
621 * to M.Maire. Introduced in the 3.15 correction cradle.
625 * Correction in GSNGTR. Double precision variables removed
626 * in case of 64 bits machines. Thanks to E.Boehm. Introduced
627 * in the 3.15 correction cradle.
629 * Correction in the SROTM command. The lower limit for
630 * PHI3 is really 0. and not 1. Thanks to E.Boehm. Introduced
631 * in the 3.15 correction cradle.
635 * New version of GRKUTA. In fact this is the 3.14 version
636 * with the multiple steps algorithm of 3.15 introduced.
637 * If the bending angle in one step is too big, then the
638 * integration is done in several steps rather than in
639 * one. The IMPLICIT REAL*8 in the cradle is to avoid
640 * problems with the CRAY in the absence of PATCHY delayed
641 * control cards. Thanks to V.Perevotchikov. Introduced in
642 * the 3.15 correction cradle.
646 * Sequence GCONSP changed for 32 bits machines. All
647 * constants are suffixed with D0 to avoid truncations.
648 * Thanks to F.Carminati. Introduced in the 3.15 correction
653 * Version 1.00 of the correction cradle released
657 * Correction in GHFNUC: TNNUC variable was undefined.
658 * Thanks to B.Lund-Jensen.
659 * Introduced in the 3.15 correction cradle.
663 * Correction in TWOCLU to avoid infinite looping in some
664 * pathological cases. Thanks to L.Roberts.
665 * Introduced in the 3.15 correction cradle.
669 * Correction in GNPGO1. Constants changed to double
670 * precision to avoid problems on the IBM. Thanks to
672 * Introduced in the 3.15 correction cradle.
676 * Correction in GXINT to obtain the correct time in
677 * the monitoring routine when running interactively
678 * on IBM/VM. Thanks to F.Carminati.
679 * Introduced in the 3.15 correction cradle.
683 * Correction in GMULTS. A particle going exactly along
684 * the negative direction of the Z axis could be rotated
685 * of 180 degrees after multiple scattering. Thanks to
687 * Introduced in the 3.15 correction cradle.
691 * Correction in GXDRAW. The arguments of DHEAD were
692 * fetched with the wrong order. Thanks to F.Videbaek.
693 * Introduced in the 3.15 correction cradle.
695 * Correction in GPHYSI. Variable NUMOLD is now reset to
696 * zero. This may affect people running interactively and
697 * using the command PHYSI. Thanks to F.Videbaek.
698 * Introduced in the 3.15 correction cradle.