]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GEANT321/ghits/gfdeth.F
This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gfdeth.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:09  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.20  by  S.Giani
11 *-- Author :
12       SUBROUTINE GFDETH(IUSET,IUDET,NH,NAMESH,NBITSH,ORIG,FACT)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *   Returns hit parameters for detector IUDET of set IUSET.      *
17 C.    *                                                                *
18 C.    *             Input parameters                                   *
19 C.    * IUSET     user set identifier                                  *
20 C.    * IUDET     user detector identifier                             *
21 C.    *                                                                *
22 C.    *             Output parameters                                  *
23 C.    * NH        number of elements per hit                           *
24 C.    * NAMESH    the NH variable names for the hit elements           *
25 C.    * NBITSH    the NH bit numbers for packing the variable values   *
26 C.    * ORIG      The quantity packed in the structure JHITS for the   *
27 C.    *           Ith variable is a  positive integer with NBITSH(I)   *
28 C.    *           bits and such that                                   *
29 C.    * FACT      IVAR(I) = (VAR(I)+ORIG(I))*FACT(I)                   *
30 C.    *                                                                *
31 C.    *    ==>Called by : <USER>                                       *
32 C.    *       Author    R.Brun ,M.Maire *********                      *
33 C.    *                                                                *
34 C.    ******************************************************************
35 C.
36 #include "geant321/gcbank.inc"
37 #include "geant321/gcunit.inc"
38       DIMENSION NBITSH(1),ORIG(1),FACT(1)
39       CHARACTER*4 IUSET,IUDET,NAMESH(1)
40 C.
41 C.    ------------------------------------------------------------------
42 C.
43       IF(JSET.LE.0)GO TO 90
44       NSET=IQ(JSET-1)
45       IF(NSET.LE.0)GO TO 90
46       CALL GLOOK(IUSET,IQ(JSET+1),NSET,ISET)
47       IF(ISET.LE.0)GO TO 90
48       JS=LQ(JSET-ISET)
49       NDET=IQ(JS-1)
50       IF(NDET.LE.0)GO TO 90
51       CALL GLOOK(IUDET,IQ(JS+1),NDET,IDET)
52       IF(IDET.LE.0)GO TO 95
53       JD=LQ(JS-IDET)
54       JDH=LQ(JD-1)
55       NH=IQ(JD+4)
56 C
57       IF(NH.GT.0)THEN
58          DO 10 I=1,NH
59             CALL UHTOC(IQ(JDH+4*I-3),4,NAMESH(I),4)
60             NBITSH(I)=IQ(JDH+4*I-2)
61             ORIG(I)  = Q(JDH+4*I-1)
62             FACT(I)  = Q(JDH+4*I )
63   10     CONTINUE
64       ENDIF
65       GO TO 99
66 C
67 C              Error
68 C
69    90 WRITE (CHMAIL, 1000) IUSET
70       CALL GMAIL(0,0)
71  1000 FORMAT (' ***** GFDETH ERROR SET ',A4,' NOT FOUND')
72       GO TO 99
73    95 WRITE (CHMAIL, 2000) IUSET,IUDET
74       CALL GMAIL(0,0)
75  2000 FORMAT (' ***** GFDETH ERROR FOR SET ',A4,
76      + ' DETECTOR ',A4,' NOT FOUND')
77 C
78   99  RETURN
79       END