This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gdtr5.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:28  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.27  by  S.Giani
11 *-- Author :
12       SUBROUTINE GDTR5(JM)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Build one level of optimized tree                        *
17 C.    *                                                                *
18 C.    *       JM = mother node (input)                                 *
19 C.    *                                                                *
20 C.    *    ==>Called by : GDTR6                                        *
21 C.    *       Author : P.Zanarini   *********                          *
22 C.    *                                                                *
23 C.    ******************************************************************
24 C.
25 #include "geant321/gcbank.inc"
26 #include "geant321/gcdraw.inc"
27 C.
28 C.    ------------------------------------------------------------------
29 C.
30       JM1=IQ(JSCA+JM)
31       JX=IQ(JXON+JM)
32       JX1=IQ(JSCA+JX)
33 C
34 C             Copy multiplicity from non-optimized to optimized tree
35 C
36       IF (IQ(JDVM+JM).GT.0) THEN
37          IQ(JDUP1+JM1)=-IQ(JDVM+JM)
38       ELSE
39 ***     IQ(JDUP1+JM1)=IQ(JDUP+JM)*IQ(JPSM+JM)
40          IQ(JDUP1+JM1)=IQ(JDUP+JM)
41       ENDIF
42 C
43       IF (JX.EQ.0) THEN
44          IQ(JXON1+JM1)=0
45       ELSE
46          IQ(JXON1+JM1)=JX1
47          LXON=IQ(JNAM+JX)
48          IQ(JNAM1+JX1)=LXON
49          IQ(JMOT1+JX1)=JM1
50          LBRO=IQ(JBRO+JX)
51    10    IF (LBRO.EQ.0) GO TO 20
52          IF (IQ(JDUP+LBRO).NE.0) THEN
53             LBRO1=IQ(JSCA+LBRO)
54             LXON=IQ(JNAM+LBRO)
55             IQ(JBRO1+JX1)=LBRO1
56             IQ(JNAM1+LBRO1)=LXON
57             IQ(JMOT1+LBRO1)=JM1
58             JX1=LBRO1
59          ENDIF
60          LBRO=IQ(JBRO+LBRO)
61          GO TO 10
62    20    CONTINUE
63          IQ(JBRO1+JX1)=0
64       ENDIF
65       END