1 |
* |
2 |
* $Id: gpdtof.F,v 3.2 2006/05/02 11:46:13 pam-ba Exp $ |
3 |
* |
4 |
* $Log: gpdtof.F,v $ |
5 |
* Revision 3.2 2006/05/02 11:46:13 pam-ba |
6 |
* TOF geometry and position updated and a new material, the mylar, added |
7 |
* |
8 |
* Revision 3.1.1.1 2002/07/11 16:02:01 cafagna |
9 |
* First GPAMELA release on CVS |
10 |
* |
11 |
* |
12 |
*CMZ : 2.01/00 06/03/2000 13.07.03 by Francesco Cafagna |
13 |
*CMZ : 2.00/00 25/02/2000 17.16.49 by Francesco Cafagna |
14 |
*CMZ : 1.02/00 22/10/99 16.17.58 by Francesco Cafagna |
15 |
*CMZ : 1.01/00 21/05/96 17.33.37 by Francesco Cafagna |
16 |
*CMZ : 1.00/02 04/04/96 16.08.24 by Francesco Cafagna |
17 |
*-- Author : Francesco Cafagna 23/02/96 |
18 |
SUBROUTINE GPDTOF |
19 |
************************************************************************ |
20 |
* * |
21 |
* To perform TOF digitization * |
22 |
* * |
23 |
* Called by: GUDIGI * |
24 |
* Author: Francesco Cafagna, 23/02/96 12.50.38 * |
25 |
* * |
26 |
************************************************************************ |
27 |
#include "gcunit.inc" |
28 |
#include "gpphit.inc" |
29 |
PARAMETER (NH=NHTOF,NHM=NHMTOF,NVOL=3) |
30 |
#include "gprhit.inc" |
31 |
#include "gptof.inc" |
32 |
#include "gpsed.inc" |
33 |
* |
34 |
INTEGER IS,ID,NV,NVM,NNHM,INDEX,NPLANE |
35 |
CHARACTER*4 CSET(4) |
36 |
DATA CSET/'S1 ','S2 ','S3A ','S4 '/ |
37 |
* |
38 |
* Vector zeroed |
39 |
* |
40 |
CALL VZERO(IPLTOF,NHM) |
41 |
CALL VZERO(IPADDLE,NHM) |
42 |
CALL VZERO(IPARTOF,NHM) |
43 |
CALL VZERO(XINTOF,NHM) |
44 |
CALL VZERO(YINTOF,NHM) |
45 |
CALL VZERO(ZINTOF,NHM) |
46 |
CALL VZERO(XOUTTOF,NHM) |
47 |
CALL VZERO(YOUTTOF,NHM) |
48 |
CALL VZERO(ZOUTTOF,NHM) |
49 |
CALL VZERO(ERELTOF,NHM) |
50 |
CALL VZERO(TIMETOF,NHM) |
51 |
CALL VZERO(PATHTOF,NHM) |
52 |
CALL VZERO(P0TOF,NHM) |
53 |
* |
54 |
CALL VZERO(NUMD ,NVOL) |
55 |
* |
56 |
* Start with tof top |
57 |
* |
58 |
NV = NVOL |
59 |
NVM= NVMAX |
60 |
IT = -1 |
61 |
NTHTOF = 0 |
62 |
INDEX = 0 |
63 |
cc DO II=1,7 |
64 |
DO II=1,4 |
65 |
DO III=1,2 |
66 |
IF(II.EQ.4.AND.III.EQ.2) GOTO 100 |
67 |
IS= II |
68 |
cc ID= 1 |
69 |
ID=III |
70 |
* |
71 |
* Check on the volume level |
72 |
* |
73 |
IF (NV.GT.NVM) THEN |
74 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, |
75 |
+ IDEVT |
76 |
CALL GMAIL(1,0) |
77 |
GO TO 10 |
78 |
ENDIF |
79 |
CALL VZERO(VHITS,NH*NHM) |
80 |
CALL VZERO(ITRA ,NHM) |
81 |
CALL VZERO(NUMBV,NVOL*NHM) |
82 |
NHITS = -1 |
83 |
CALL GPRHIT(CSET(II),CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, |
84 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
85 |
* |
86 |
* If there was a problem in GPRHIT then exit |
87 |
* |
88 |
IF(NHITS.LT.0) THEN |
89 |
WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, |
90 |
+ IDRUN,IDEVT |
91 |
CALL GMAIL(1,0) |
92 |
GO TO 10 |
93 |
ENDIF |
94 |
* |
95 |
* Fill the CWN common |
96 |
* |
97 |
CC NPLANE = II |
98 |
IF(III.EQ.1) NPLANE=2*II-1 |
99 |
IF(III.EQ.2) NPLANE=2*II |
100 |
NTHTOF = NHITS + NTHTOF |
101 |
DO I=1,NHITS |
102 |
INDEX = INDEX + 1 |
103 |
IPLTOF(INDEX) = NPLANE |
104 |
*ML: |
105 |
IPADDLE(INDEX) = NUMBV(NVTOF-1,I) |
106 |
IF(II.EQ.4.AND.III.EQ.1) THEN |
107 |
IPADDLE(INDEX)= NUMBV(NVS4,I) |
108 |
ENDIF |
109 |
*END ML. |
110 |
#if defined(GPAMELA_INTER) |
111 |
XAVTOF(INDEX) = VHITS(1,I) |
112 |
YAVTOF(INDEX) = VHITS(2,I) |
113 |
ZAVTOF(INDEX) = VHITS(3,I) |
114 |
XOUTTOF(INDEX) = VHITS(4,I) |
115 |
YOUTTOF(INDEX) = VHITS(5,I) |
116 |
ZOUTTOF(INDEX) = VHITS(6,I) |
117 |
XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) |
118 |
YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) |
119 |
ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) |
120 |
#endif |
121 |
#if !defined(GPAMELA_INTER) |
122 |
XINTOF(INDEX) = VHITS(1,I) |
123 |
YINTOF(INDEX) = VHITS(2,I) |
124 |
ZINTOF(INDEX) = VHITS(3,I) |
125 |
XOUTTOF(INDEX) = VHITS(4,I) |
126 |
YOUTTOF(INDEX) = VHITS(5,I) |
127 |
ZOUTTOF(INDEX) = VHITS(6,I) |
128 |
XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. |
129 |
YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. |
130 |
ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. |
131 |
#endif |
132 |
*ML: |
133 |
* ERELTOF(INDEX) = VHITS(7,I) |
134 |
ERELTOF(INDEX) = VHITS(7,I) |
135 |
TIMETOF(INDEX) = VHITS(8,I) |
136 |
PATHTOF(INDEX) = VHITS(9,I) |
137 |
IPARTOF(INDEX) = VHITS(10,I) |
138 |
* P0TOF (INDEX) = VHITS(11,I) |
139 |
P0TOF(INDEX) = VHITS(11,I) |
140 |
ENDDO |
141 |
100 CONTINUE |
142 |
ENDDO |
143 |
ENDDO |
144 |
* |
145 |
10000 FORMAT(' GPDTOF: VOLUME level too big: SET=',A4,', DET=',A4, |
146 |
+ ',NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
147 |
10100 FORMAT(' GPDTOF: MAX number of hits retrived: SET=',A4, |
148 |
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
149 |
+ ', RUN=',I5,', EVT=',I8) |
150 |
10200 FORMAT(' GPDTOF: Error in GPRHIT: SET=',A4, |
151 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
152 |
+ ', RUN=',I5,', EVT=',I8) |
153 |
10 RETURN |
154 |
END |