]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GEANT321/gdraw/gdrvol.F
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gdrvol.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:27  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 GDRVOL(N,NNAME,NNUMB,NRS,UTHET,UPHI,UPSI,UU0,UV0,SU,SV)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Draws the object NNAME(N),NNUMB(N) with its contents.    *
17 C.    *       The parameters UTHET,UPHI,...,SV are the same of GDRAW.  *
18 C.    *       NNAME(1),...,NNAME(N) contain the volume names and       *
19 C.    *       NNUMB(1),...,NNUMB(N) the volume numbers defining the    *
20 C.    *       path to go from the top volume to the one to be drawn.   *
21 C.    *                                                                *
22 C.    *       This routine differs from GDRAW in the following :       *
23 C.    *       - the object to be drawn is identified by a full path,   *
24 C.    *         giving so the possibility to draw a particular copy    *
25 C.    *         or division of a volume, or even a volume that has     *
26 C.    *         more than one mother in the geometry tree              *
27 C.    *       - the object can be drawn either with respect to the     *
28 C.    *         MAster Reference System (NRS=0) or with respect to its *
29 C.    *         Daugther Reference System; in the first case it is     *
30 C.    *         drawn where it stands in the real world, while in      *
31 C.    *         the second one it is drawn like GDRAW would do         *
32 C.    *       - in this latter case, track and hit points will be      *
33 C.    *         drawn with respect to the DRS of the volume last       *
34 C.    *         drawn by this routine, and not with respect to the     *
35 C.    *         MARS as it done normally; to reset to the normal       *
36 C.    *         case a call with NRS=0 or N=0 is required              *
37 C.    *                                                                *
38 C.    *    ==>Called by : <USER>, <GXINT>                              *
39 C.    *       Author : P.Zanarini    **********                        *
40 C.    *                                                                *
41 C.    ******************************************************************
42 C.
43 #include "geant321/gcvolu.inc"
44 #include "geant321/gcdraw.inc"
45       DIMENSION NNAME(15),NNUMB(15),GR0(10),GT0(3)
46       CHARACTER*4 NAME
47       SAVE GR0,GT0
48 C
49       DATA GR0/1.,0.,0.,0.,1.,0.,0.,0.,1.,0./
50       DATA GT0/0.,0.,0./
51 C.
52 C.    ------------------------------------------------------------------
53 C.
54       IF (N.EQ.0) THEN
55 C
56 C             Restore unitary transformation in /GCDRAW/
57 C
58          DO 10 I=1,3
59    10    GTRAN0(I)=GT0(I)
60          DO 20 I=1,10
61    20    GRMAT0(I)=GR0(I)
62          GO TO 999
63 C
64       ENDIF
65 C
66       IF (N.GT.15.OR.N.LT.1) GO TO 999
67 C
68 C             Save /GCVOLU/ if necessary
69 C
70       IFCVOL=0
71       IF (NLEVEL.GT.0) THEN
72          CALL GSCVOL
73          IFCVOL=1
74       ENDIF
75 C
76 C             Force GLVOLU to recompute the path
77 C
78       NLEVEL=0
79       CALL GLVOLU(N,NNAME,NNUMB,IER)
80       IF (IER.NE.0) GO TO 90
81 C
82       IF (NRS.EQ.0) THEN
83 C
84 C             Store unitary transformation in /GCDRAW/
85 C
86          DO 30 I=1,3
87    30    GTRAN0(I)=GT0(I)
88          DO 40 I=1,10
89    40    GRMAT0(I)=GR0(I)
90 C
91       ELSE
92 C
93 C             Store N-th level transformation in /GCDRAW/
94 C
95          DO 50 I=1,3
96    50    GTRAN0(I)=GTRAN(I,N)
97          DO 60 I=1,10
98    60    GRMAT0(I)=GRMAT(I,N)
99 C
100 C             Replace N-th level transformation with the unitary one
101 C
102          DO 70 I=1,3
103    70    GTRAN(I,N)=GT0(I)
104          DO 80 I=1,10
105    80    GRMAT(I,N)=GR0(I)
106 C
107       ENDIF
108 C
109 C             NLEVEL < 0 to inform GDRAW that GSCVOL has already been ca
110 C
111       IF (IFCVOL.EQ.1) NLEVEL=-NLEVEL
112 C
113       IDRNUM=1
114       CALL UHTOC(NNAME(N),4,NAME,4)
115       CALL GDRAW(NAME,UTHET,UPHI,UPSI,UU0,UV0,SU,SV)
116       IDRNUM=0
117 C
118    90 CONTINUE
119       IF (IFCVOL.EQ.1) THEN
120          CALL GFCVOL
121       ELSE
122          NLEVEL=0
123       ENDIF
124   999 RETURN
125       END