This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gpmwpc.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:11  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 GPMWPC (DETREP,HITREP,IOUT)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C     *     DETREP(1)=NUMBER OF WIRES                                  *
17 C     *           (2)=WIRE SPACING                                     *
18 C     *           (3)=SIN (ALPHA) (ALPHA=ANGLE OF THE NORMAL           *
19 C     *                            TO THE WIRE WITH RESPECT TO         *
20 C     *                            AXIS I)                             *
21 C     *           (4)=COS (ALPHA)                                      *
22 C     *           (5)=DISTANCE OF WIRE 1 FROM THE ORIGIN               *
23 C     *           (6)=GAP WIDTH                                        *
24 C     *                                                                *
25 C     *     HITREP(1)=X COORDINATE OF INTERSECTION                     *
26 C     *           (2)=Y COORDINATE                                     *
27 C     *           (3)=DX/DZ                                            *
28 C     *           (4)=DY/DZ                                            *
29 C     *                                                                *
30 C     *     IOUT(1)=WIRE NUMBER                                        *
31 C     *         (2)=CLUSTER SIZE                                       *
32 C.    *                                                                *
33 C.    *    ==>Called by : <USER>, GUDIGI                               *
34 C.    *       Authors    F.Carena, M.Hansroul  *********               *
35 C.    *                                                                *
36 C.    ******************************************************************
37 C.
38       DIMENSION HITREP(4), DETREP(6), IOUT(2)
39 C.
40 C.    ------------------------------------------------------------------
41 C.
42       IOUT(1) = - 1
43       SP     = DETREP(2)
44       IF (SP.EQ.0.)                                   GO TO 99
45 C
46       HG     = .5 * DETREP(6)
47       DX     = HG * HITREP(3)
48       DY     = HG * HITREP(4)
49       X1     = HITREP(1) - DX
50       X2     = HITREP(1) + DX
51       Y1     = HITREP(2) - DY
52       Y2     = HITREP(2) + DY
53       SA     = DETREP(3)
54       CA     = DETREP(4)
55       U1     = X1 * CA + Y1 * SA
56       U2     = X2 * CA + Y2 * SA
57       OR     = DETREP(5)
58       W1     = (U1 - OR) / SP + 1.5
59       W2     = (U2 - OR) / SP + 1.5
60 C
61       IW1    = W1
62       IW2    = W2
63       IWMIN  = MIN (IW1,IW2)
64       IWMAX  = MAX (IW1,IW2)
65       NWIR   = DETREP(1)
66       IF (IWMIN.GT.NWIR)                              GO TO 99
67       IF (IWMAX.LE.0)                                 GO TO 99
68 C
69       IWMIN  = MAX (1,IWMIN)
70       IWMAX  = MIN (NWIR,IWMAX)
71 C
72       IOUT(1) = IWMIN
73       IOUT(2) = IWMAX - IWMIN + 1
74 C
75   99  RETURN
76       END