Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gpdrif.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:21:10 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 GPDRIF (DETREP,HITREP,IOUT)
13C.
14C. ******************************************************************
15C. * *
16C * DETREP(1)=NUMBER OF WIRES *
17C * (2)=WIRE SPACING *
18C * (3)=SIN (ALPHA) (ALPHA=ANGLE OF THE NORMAL *
19C * TO THE WIRE WITH RESPECT TO *
20C * AXIS I) *
21C * (4)=COS (ALPHA) *
22C * (5)=DISTANCE OF WIRE 1 FROM THE ORIGIN *
23C * (6)=DRIFT VELOCITY (CM/NSEC) *
24C * *
25C * HITREP(1)=X COORDINATE OF INTERSECTION *
26C * (2)=Y COORDINATE *
27C * *
28C * IOUT(1)=WIRE NUMBER *
29C * (2)=DRIFT TIME (SIGNED TO AVOID RIGHT/LEFT AMBIGUITY) *
30C. * *
31C. * ==>Called by : <USER>, GUDIGI *
32C. * Authors F.Carena, M.Hansroul ********* *
33C. * *
34C. ******************************************************************
35C.
36 DIMENSION HITREP(2), DETREP(6), IOUT(2)
37C.
38C. ------------------------------------------------------------------
39C.
40 IOUT(1) = - 1
41 SP = DETREP(2)
42 DV = DETREP(6)
43 IF (SP.EQ.0.) GO TO 99
44 IF (DV.EQ.0.) GO TO 99
45C
46 X = HITREP(1)
47 Y = HITREP(2)
48 SA = DETREP(3)
49 CA = DETREP(4)
50 U = X * CA + Y * SA
51 OR = DETREP(5)
52 W = (U - OR) / SP + 1.5
53C
54 IW = W
55 NWIR = DETREP(1)
56 IF (IW.GT.NWIR) GO TO 99
57 IF (IW.LE.0) GO TO 99
58C
59 DIST = U - OR - (IW - 1) * SP
60 TDRIF = DIST / DV
61C
62 IOUT(1) = IW
63 IOUT(2) = TDRIF
64C
65 99 RETURN
66 END