]> git.uio.no Git - u/mrichter/AliRoot.git/blame - GEANT321/cgpack/cgsize.F
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / cgpack / cgsize.F
CommitLineData
fe4da5cc 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.32 by S.Giani
11*-- Author :
12 FUNCTION CGSIZE(N,NFATYP,NFAC,NEDG)
13************************************************************************
14* *
15* Name: CGSIZE *
16* Author: E. Chernyaev Date: 20.03.88 *
17* Revised: *
18* *
19* Function: Compute size of CG-object *
20* *
21* References: none *
22* *
23* Input: N - max size of CG-object *
24* NFATYP - number of different face type *
25* NFAC(*) - number of faces of given type *
26* NEDG(*) - number of edges in face of given type *
27* *
28* Output: CGSIZE - CG-object size (= 0, if error in parameters) *
29* *
30* Errors: none *
31* *
32************************************************************************
33#include "geant321/cggpar.inc"
34 INTEGER NFAC(*),NEDG(*)
35*-
36 CGSIZE = 0.
37 IF (N .LE. 1) GOTO 999
38 IF (NFATYP .LE. 0) GOTO 999
39 NEED = LCGHEA
40 DO 100 I=1,NFATYP
41 IF (NFAC(I).LT.0 .OR. NEDG(I).LT.3) GOTO 999
42 NEED = NEED + NFAC(I)*(LCGFAC + NEDG(I)*LCGEDG)
43 100 CONTINUE
44 IF (NEED .EQ. LCGHEA) GOTO 999
45 IF (N-NEED .LT. 0) CGSIZE = N - NEED
46 IF (N-NEED .GE. 0) CGSIZE = NEED
47 999 RETURN
48 END