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