]> git.uio.no Git - u/mrichter/AliRoot.git/blame - GEANT321/ghits/gcdrif.F
Minor corrections after big transformer changes
[u/mrichter/AliRoot.git] / GEANT321 / ghits / gcdrif.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:21:08 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 GCDRIF (RADD,ZMIN,ZMAX,DETREP,HITREP,IOUT)
13C.
14C. **************************************************************************
15C. * *
16C. * Digitisation of Drift- Chambers *
17C. * -------------------------------- *
18C. * *
19C. * Digitisation routine for a cylindrical drift chamber. *
20C. * RADD radius of cylinder in cm *
21C. * ZMIN z of lower end of cylinder *
22C. * ZMAX z of upper end of " *
23C. * DETREP(1) number of wires *
24C. * DETREP(2) wire spacing in PHI (radians) *
25C. * DETREP(3) cosine of wire angle *
26C. * DETREP(4) sine of wire angle (signed like dphi/dz) *
27C. * DETREP(5) dphi/dz along wire *
28C. * DETREP(6) phi of point with z=0 on wire 1 *
29C. * DETREP(7) drift velocity (cm/nsec) *
30C. * DETREP(8) quantity describing the drift angle *
31C. * if.ne.0 ==> user routine GUDTIM *
32C. * HITREP(1) phi coordinate of intersection *
33C. * HITREP(2) z coordinate *
34C. * HITREP(3) dphi/dr *
35C. * HITREP(4) dz/dr *
36C. * IOUT(1) wire number (1..NWI with increasing phi) (-1 for *
37C. * bad DETREP parameters) *
38C. * IOUT(2) drift time (nsec) (+/- for phi(hit)>/< phi(wire) *
39C. * IOUT(3) digitised current division information (rel. pos. *
40C. * along wire of charge) (per mille) *
41C. * IOUT(4) amount of charge deposited to wire *
42C. * Coordinate systems along wire *
43C. * I. Charge I. *
44C. * . | . *
45C. * | . | *
46C. * ========================================= SENSE WIRE *
47C. * ...................................................> Z (cm) *
48C. * Z Z. Z. *
49C. * L *
50C. * ...............................................> X (arbitrary scale) *
51C. * 0 X. L *
52C. * X. (L-X.) *
53C. * The scaling used is such that L . 1000. *
54C. * Knowing the position Z. of the deposit of charge, *
55C. * Z.-ZL *
56C. * X. = L *
57C. * . ..... *
58C. * Z.-ZL *
59C. * This information is stored into IOUT(3). *
60C. * Routine to calculate the error on the current division *
61C. * information as obtained by "GCDRIFT". *
62C. * ICD digitized current division information *
63C. * (0 ... 1000) *
64C. * ERP variance of Gaussian distributed pedestral errors *
65C. * on the measured pulse heights relative to the sum *
66C. * of the pulse heights *
67C. * ERS variance of Gaussian distributed slope errors on *
68C. * the measured pulse heights relative to the each *
69C. * pulse heights *
70C. * Here we assume that X. has been determined by measuring *
71C. * the pulse heights I., I. with some statistical errors. *
72C. * X. is then given by the formula *
73C. * X. = L . I./I. with I. . I.+I. *
74C. * and its error is determined by *
75C. * .X. = -(X./I.) .I. + (L-X./I.) .I. *
76C. * with the errors on measuring the pulse heights *
77C. * .I. = .. + ...I. *
78C. * .I. = .. + ...I. *
79C. * .., .. are of dimension (I) and represent the "pedestral" *
80C. * errors; *
81C. * .., .. are the "slope" errors. *
82C. * All are assumed to be distributed independently (no *
83C. * correlations), randomly and Gaussian around zero. This gives *
84C. * the final result *
85C. * .. .. X.(L-X.) *
86C. * .X. = - .. X. + .. (L-X.) + (..-..) ........ *
87C. * I. I. L *
88C. * .................. ................. *
89C. * "pedestal" "slope" *
90C. * In GCDERR, the X. derived from GCDRIF is set to *
91C. * X. = X. + .X. (but 0 . X. . L) *
92C. * using ERP ..... variance for ./I. , ../I. distributions *
93C. * ERS ..... variance for .., .. distributions. *
94C. * *
95C. * ==>Called by : <USER>, GUDIGI *
96C. * Author D.Mitaroff ********* *
97C. * *
98C. **************************************************************************
99C.
100 DIMENSION DETREP(8), HITREP(4), IOUT(4)
101#include "geant321/gconsp.inc"
102C.
103C. -----------------------------------------------------------------
104C.
105 ZREL = 1000.
106 IOUT(1) = -1
107 NWI = DETREP(1)
108 WSP = DETREP(2)
109 DVL = DETREP(7)
110 IF (WSP .EQ. 0.) GOTO 99
111 IF (DVL .EQ. 0.) GOTO 99
112C
113C---- CALCULATE WIRE NUMBER.
114 FI = HITREP(1)
115 ZZ = HITREP(2)
116 FI0 = DETREP(6) + ZZ * DETREP(5)
117 DFI = FI - FI0
118 10 IF (DFI .GE. 0.) GOTO 11
119 DFI = DFI + TWOPI
120 GOTO 10
121 11 IF (DFI .LT. TWOPI) GOTO 12
122 DFI = DFI - TWOPI
123 GOTO 11
124 12 IW = DFI / WSP + 0.5
125 DIS = DFI - IW * WSP
126 IF (IW .EQ. NWI) IW = 0
127 IOUT(1) = IW + 1
128C
129C---- CALCULATE DRIFT TIME.
130 DIS = DIS * RADD * DETREP(3)
131 IF ( DETREP(8) .NE. 0. ) GOTO 2
132 IOUT(2) = DIS / DVL
133 GOTO 3
134C
135C---- DRIFT TIME BY USER ROUTINE.
136 2 IOUT(2) = GUDTIM (DETREP,HITREP,IW+1,DIS)
137C
138C---- CALCULATE CURRENT DIVISION INFORMATION.
139 3 Z0 = ZZ + DIS * DETREP(4)
140 IF (Z0 .LT. ZMIN) Z0 = ZMIN
141 IF (Z0 .GT. ZMAX) Z0 = ZMAX
142 IOUT(3) = ZREL * (Z0 - ZMIN) / (ZMAX - ZMIN)
143 IOUT(4) = 0
144C.
145 99 RETURN
146 END