This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / cgpack / cghins.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:19:44  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.31  by  S.Giani
11 *-- Author :
12       SUBROUTINE CGHINS(CG,H,ISHAPE)
13 ************************************************************************
14 *                                                                      *
15 *     Name: CGHINS                                                     *
16 *     Author: E. Chernyaev                       Date:    04.08.88     *
17 *     Revised by: S.Giani                        Date:    24.04.91     *
18 *                                                                      *
19 *     Function: Add next CG-object to HIDE-structure                   *
20 *                                                                      *
21 *     References: CGHSIZ, CGHMOV                                       *
22 *                                                                      *
23 *     Input: CG(*) - CG-object                                         *
24 *             H(*) - HIDE-structure                                    *
25 *                                                                      *
26 *     Output: none                                                     *
27 *                                                                      *
28 *     Errors: none                                                     *
29 *                                                                      *
30 ************************************************************************
31 #include "geant321/cghpar.inc"
32 *SG
33 #include "geant321/gcgobj.inc"
34 *SG
35       REAL CG(*),H(*)
36 *-          P A R A M E T E R S   C H E C K
37       IF (H(KHSIZE)  .LE. 0.)   GOTO 999
38       CALL CGTSTR(CG,IREP)
39 *      IF (IREP .LT. 0) PRINT *, 'CGHINS: CG-structure test failed'
40       IF (IREP .LT. 0)          GOTO 999
41 *
42       NHSIZE = H(KHSIZE)
43       NT     = H(KHNT)
44       NXYZ   = H(KHNXYZ)
45       NFACE  = H(KHNFAC)
46       NEDGE  = H(KHNEDG)
47       CALL CGHSIZ(CG,NT,NVF,NVE,ISHAPE)
48       IF (NVF .EQ. 0)           GOTO 999
49       NX     = 3*(NXYZ + NVE*2)
50       NF     = (NFACE + NEDGE*2 + NVF + NVE*2)/I4SIZE + 1
51       NP     = (NVE*2*2)/I4SIZE + 1
52       NTOTAL = LHHEAD + NX + NF + NP
53 *           T E S T   S P A C E
54       IF (NTOTAL .LT. NHSIZE)   GOTO 100
55 *SG
56 *   Setting new number of words needed
57 *
58       NCLAS1=NTOTAL+1
59       KCGST=-8
60 *SG
61       H(KHNXYZ) = NXYZ + NVE*2
62       H(KHNFAC) = NFACE + NVF
63       H(KHNEDG) = NEDGE + NVE
64       GOTO 999
65 *
66   100 JXYZ1   = LHHEAD + NXYZ*3 + 1
67       JPOINT = JXYZ1 + NVE*2*3
68       JFACE  = 1
69 *SG
70 *   Resetting flag for size evaluation of Wire Structure
71 *
72       KCGST=0
73 *SG
74       CALL CGHMOV(CG,H,NVF,NVE,H(JXYZ1),H(JPOINT),H(JFACE))
75 *
76   999 RETURN
77       END