1 |
* |
* |
2 |
* $Id$ |
* $Id: gpdtof.F,v 3.1.1.1 2002/07/11 16:02:01 cafagna Exp $ |
3 |
|
* |
4 |
|
* $Log: gpdtof.F,v $ |
5 |
|
* Revision 3.1.1.1 2002/07/11 16:02:01 cafagna |
6 |
|
* First GPAMELA release on CVS |
7 |
* |
* |
|
* $Log$ |
|
8 |
* |
* |
9 |
*CMZ : 2.01/00 06/03/2000 13.07.03 by Francesco Cafagna |
*CMZ : 2.01/00 06/03/2000 13.07.03 by Francesco Cafagna |
10 |
*CMZ : 2.00/00 25/02/2000 17.16.49 by Francesco Cafagna |
*CMZ : 2.00/00 25/02/2000 17.16.49 by Francesco Cafagna |
29 |
#include "gpsed.inc" |
#include "gpsed.inc" |
30 |
* |
* |
31 |
INTEGER IS,ID,NV,NVM,NNHM,INDEX,NPLANE |
INTEGER IS,ID,NV,NVM,NNHM,INDEX,NPLANE |
32 |
CHARACTER*4 CSET(7) |
CHARACTER*4 CSET(4) |
33 |
DATA CSET/'S11 ','S12 ','S21 ','S22 ','S31 ','S32 ','S4 '/ |
DATA CSET/'S1 ','S2 ','S3A ','S4 '/ |
34 |
* |
* |
35 |
* Vector zeroed |
* Vector zeroed |
36 |
* |
* |
47 |
CALL VZERO(TIMETOF,NHM) |
CALL VZERO(TIMETOF,NHM) |
48 |
CALL VZERO(PATHTOF,NHM) |
CALL VZERO(PATHTOF,NHM) |
49 |
CALL VZERO(P0TOF,NHM) |
CALL VZERO(P0TOF,NHM) |
50 |
* |
* |
51 |
CALL VZERO(NUMD ,NVOL) |
CALL VZERO(NUMD ,NVOL) |
52 |
* |
* |
53 |
* Start with tof top |
* Start with tof top |
57 |
IT = -1 |
IT = -1 |
58 |
NTHTOF = 0 |
NTHTOF = 0 |
59 |
INDEX = 0 |
INDEX = 0 |
60 |
DO II=1,7 |
cc DO II=1,7 |
61 |
IS= II |
DO II=1,4 |
62 |
ID= 1 |
DO III=1,2 |
63 |
* |
IF(II.EQ.4.AND.III.EQ.2) GOTO 100 |
64 |
|
IS= II |
65 |
|
cc ID= 1 |
66 |
|
ID=III |
67 |
|
* |
68 |
* Check on the volume level |
* Check on the volume level |
69 |
* |
* |
70 |
IF (NV.GT.NVM) THEN |
IF (NV.GT.NVM) THEN |
71 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, |
72 |
+ IDEVT |
+ IDEVT |
73 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
74 |
GO TO 10 |
GO TO 10 |
75 |
ENDIF |
ENDIF |
76 |
CALL VZERO(VHITS,NH*NHM) |
CALL VZERO(VHITS,NH*NHM) |
77 |
CALL VZERO(ITRA ,NHM) |
CALL VZERO(ITRA ,NHM) |
78 |
CALL VZERO(NUMBV,NVOL*NHM) |
CALL VZERO(NUMBV,NVOL*NHM) |
79 |
NHITS = -1 |
NHITS = -1 |
80 |
CALL GPRHIT(CSET(II),CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, |
CALL GPRHIT(CSET(II),CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, |
81 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
82 |
* |
* |
83 |
* If there was a problem in GPRHIT then exit |
* If there was a problem in GPRHIT then exit |
84 |
* |
* |
85 |
IF(NHITS.LT.0) THEN |
IF(NHITS.LT.0) THEN |
86 |
WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, |
WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, |
87 |
+ IDRUN,IDEVT |
+ IDRUN,IDEVT |
88 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
89 |
GO TO 10 |
GO TO 10 |
90 |
ENDIF |
ENDIF |
91 |
* |
* |
92 |
* Fill the CWN common |
* Fill the CWN common |
93 |
* |
* |
94 |
NPLANE = II |
CC NPLANE = II |
95 |
NTHTOF = NHITS + NTHTOF |
IF(III.EQ.1) NPLANE=2*II-1 |
96 |
DO I=1,NHITS |
IF(III.EQ.2) NPLANE=2*II |
97 |
INDEX = INDEX + 1 |
NTHTOF = NHITS + NTHTOF |
98 |
IPLTOF(INDEX) = NPLANE |
DO I=1,NHITS |
99 |
|
INDEX = INDEX + 1 |
100 |
|
IPLTOF(INDEX) = NPLANE |
101 |
*ML: |
*ML: |
102 |
IPADDLE(INDEX) = NUMBV(NVTOF,I) |
IPADDLE(INDEX) = NUMBV(NVTOF-1,I) |
103 |
IF(II.EQ.7) THEN |
IF(II.EQ.4.AND.III.EQ.1) THEN |
104 |
IPADDLE(INDEX) = NUMBV(NVS4,I) |
IPADDLE(INDEX)= NUMBV(NVS4,I) |
105 |
ENDIF |
ENDIF |
106 |
*END ML. |
*END ML. |
107 |
#if defined(GPAMELA_INTER) |
#if defined(GPAMELA_INTER) |
108 |
XAVTOF(INDEX) = VHITS(1,I) |
XAVTOF(INDEX) = VHITS(1,I) |
109 |
YAVTOF(INDEX) = VHITS(2,I) |
YAVTOF(INDEX) = VHITS(2,I) |
110 |
ZAVTOF(INDEX) = VHITS(3,I) |
ZAVTOF(INDEX) = VHITS(3,I) |
111 |
XOUTTOF(INDEX) = VHITS(4,I) |
XOUTTOF(INDEX) = VHITS(4,I) |
112 |
YOUTTOF(INDEX) = VHITS(5,I) |
YOUTTOF(INDEX) = VHITS(5,I) |
113 |
ZOUTTOF(INDEX) = VHITS(6,I) |
ZOUTTOF(INDEX) = VHITS(6,I) |
114 |
XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) |
XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) |
115 |
YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) |
YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) |
116 |
ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) |
ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) |
117 |
#endif |
#endif |
118 |
#if !defined(GPAMELA_INTER) |
#if !defined(GPAMELA_INTER) |
119 |
XINTOF(INDEX) = VHITS(1,I) |
XINTOF(INDEX) = VHITS(1,I) |
120 |
YINTOF(INDEX) = VHITS(2,I) |
YINTOF(INDEX) = VHITS(2,I) |
121 |
ZINTOF(INDEX) = VHITS(3,I) |
ZINTOF(INDEX) = VHITS(3,I) |
122 |
XOUTTOF(INDEX) = VHITS(4,I) |
XOUTTOF(INDEX) = VHITS(4,I) |
123 |
YOUTTOF(INDEX) = VHITS(5,I) |
YOUTTOF(INDEX) = VHITS(5,I) |
124 |
ZOUTTOF(INDEX) = VHITS(6,I) |
ZOUTTOF(INDEX) = VHITS(6,I) |
125 |
XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. |
XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. |
126 |
YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. |
YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. |
127 |
ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. |
ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. |
128 |
#endif |
#endif |
129 |
*ML: |
*ML: |
130 |
* ERELTOF(INDEX) = VHITS(7,I) |
* ERELTOF(INDEX) = VHITS(7,I) |
131 |
ERELTOF(INDEX) = VHITS(11,I) |
ERELTOF(INDEX) = VHITS(11,I) |
132 |
TIMETOF(INDEX) = VHITS(8,I) |
TIMETOF(INDEX) = VHITS(8,I) |
133 |
PATHTOF(INDEX) = VHITS(9,I) |
PATHTOF(INDEX) = VHITS(9,I) |
134 |
IPARTOF(INDEX) = VHITS(10,I) |
IPARTOF(INDEX) = VHITS(10,I) |
135 |
* P0TOF (INDEX) = VHITS(11,I) |
* P0TOF (INDEX) = VHITS(11,I) |
136 |
P0TOF(INDEX) = VHITS(7,I) |
P0TOF(INDEX) = VHITS(7,I) |
137 |
|
ENDDO |
138 |
|
100 CONTINUE |
139 |
ENDDO |
ENDDO |
140 |
ENDDO |
ENDDO |
141 |
* |
* |