1 |
* |
* |
2 |
* $Id$ |
* $Id: gpdtof.F,v 3.3 2006/05/02 18:00:11 cafagna Exp $ |
3 |
|
* |
4 |
|
* $Log: gpdtof.F,v $ |
5 |
|
* Revision 3.3 2006/05/02 18:00:11 cafagna |
6 |
|
* Bugs fixed in TOF set definition, TOF hit back to the original naming scheme |
7 |
|
* |
8 |
|
* Revision 3.2 2006/05/02 11:46:13 pam-ba |
9 |
|
* TOF geometry and position updated and a new material, the mylar, added |
10 |
|
* |
11 |
|
* Revision 3.1.1.1 2002/07/11 16:02:01 cafagna |
12 |
|
* First GPAMELA release on CVS |
13 |
* |
* |
|
* $Log$ |
|
14 |
* |
* |
15 |
*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 |
16 |
*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 |
35 |
#include "gpsed.inc" |
#include "gpsed.inc" |
36 |
* |
* |
37 |
INTEGER IS,ID,NV,NVM,NNHM,INDEX,NPLANE |
INTEGER IS,ID,NV,NVM,NNHM,INDEX,NPLANE |
38 |
CHARACTER*4 CSET(7) |
CHARACTER*4 CSET(4) |
39 |
DATA CSET/'S11 ','S12 ','S21 ','S22 ','S31 ','S32 ','S4 '/ |
DATA CSET/'S1 ','S2 ','S3 ','S4 '/ |
40 |
* |
* |
41 |
* Vector zeroed |
* Vector zeroed |
42 |
* |
* |
53 |
CALL VZERO(TIMETOF,NHM) |
CALL VZERO(TIMETOF,NHM) |
54 |
CALL VZERO(PATHTOF,NHM) |
CALL VZERO(PATHTOF,NHM) |
55 |
CALL VZERO(P0TOF,NHM) |
CALL VZERO(P0TOF,NHM) |
56 |
* |
* |
57 |
CALL VZERO(NUMD ,NVOL) |
CALL VZERO(NUMD ,NVOL) |
58 |
* |
* |
59 |
* Start with tof top |
* Start with tof top |
63 |
IT = -1 |
IT = -1 |
64 |
NTHTOF = 0 |
NTHTOF = 0 |
65 |
INDEX = 0 |
INDEX = 0 |
66 |
DO II=1,7 |
cc DO II=1,7 |
67 |
IS= II |
DO II=1,4 |
68 |
ID= 1 |
DO III=1,2 |
69 |
* |
IF(II.EQ.4.AND.III.EQ.2) GOTO 100 |
70 |
|
IS= II |
71 |
|
cc ID= 1 |
72 |
|
ID=III |
73 |
|
* |
74 |
* Check on the volume level |
* Check on the volume level |
75 |
* |
* |
76 |
IF (NV.GT.NVM) THEN |
IF (NV.GT.NVM) THEN |
77 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN, |
78 |
+ IDEVT |
+ IDEVT |
79 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
80 |
GO TO 10 |
GO TO 10 |
81 |
ENDIF |
ENDIF |
82 |
CALL VZERO(VHITS,NH*NHM) |
CALL VZERO(VHITS,NH*NHM) |
83 |
CALL VZERO(ITRA ,NHM) |
CALL VZERO(ITRA ,NHM) |
84 |
CALL VZERO(NUMBV,NVOL*NHM) |
CALL VZERO(NUMBV,NVOL*NHM) |
85 |
NHITS = -1 |
NHITS = -1 |
86 |
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, |
87 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
88 |
* |
* |
89 |
* If there was a problem in GPRHIT then exit |
* If there was a problem in GPRHIT then exit |
90 |
* |
* |
91 |
IF(NHITS.LT.0) THEN |
IF(NHITS.LT.0) THEN |
92 |
WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, |
WRITE(CHMAIL,10200) CSET(IS),CNSED(IS,ID),NHITS,NHM, |
93 |
+ IDRUN,IDEVT |
+ IDRUN,IDEVT |
94 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
95 |
GO TO 10 |
GO TO 10 |
96 |
ENDIF |
ENDIF |
97 |
* |
* |
98 |
* Fill the CWN common |
* Fill the CWN common |
99 |
* |
* |
100 |
NPLANE = II |
CC NPLANE = II |
101 |
NTHTOF = NHITS + NTHTOF |
IF(III.EQ.1) NPLANE=2*II-1 |
102 |
DO I=1,NHITS |
IF(III.EQ.2) NPLANE=2*II |
103 |
INDEX = INDEX + 1 |
NTHTOF = NHITS + NTHTOF |
104 |
IPLTOF(INDEX) = NPLANE |
DO I=1,NHITS |
105 |
|
INDEX = INDEX + 1 |
106 |
|
IPLTOF(INDEX) = NPLANE |
107 |
*ML: |
*ML: |
108 |
IPADDLE(INDEX) = NUMBV(NVTOF,I) |
IPADDLE(INDEX) = NUMBV(NVTOF-1,I) |
109 |
IF(II.EQ.7) THEN |
IF(II.EQ.4.AND.III.EQ.1) THEN |
110 |
IPADDLE(INDEX) = NUMBV(NVS4,I) |
IPADDLE(INDEX)= NUMBV(NVS4,I) |
111 |
ENDIF |
ENDIF |
112 |
*END ML. |
*END ML. |
113 |
#if defined(GPAMELA_INTER) |
#if defined(GPAMELA_INTER) |
114 |
XAVTOF(INDEX) = VHITS(1,I) |
XAVTOF(INDEX) = VHITS(1,I) |
115 |
YAVTOF(INDEX) = VHITS(2,I) |
YAVTOF(INDEX) = VHITS(2,I) |
116 |
ZAVTOF(INDEX) = VHITS(3,I) |
ZAVTOF(INDEX) = VHITS(3,I) |
117 |
XOUTTOF(INDEX) = VHITS(4,I) |
XOUTTOF(INDEX) = VHITS(4,I) |
118 |
YOUTTOF(INDEX) = VHITS(5,I) |
YOUTTOF(INDEX) = VHITS(5,I) |
119 |
ZOUTTOF(INDEX) = VHITS(6,I) |
ZOUTTOF(INDEX) = VHITS(6,I) |
120 |
XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) |
XINTOF(INDEX) = 2*XAVTOF(INDEX) - XOUTTOF(INDEX) |
121 |
YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) |
YINTOF(INDEX) = 2*YAVTOF(INDEX) - YOUTTOF(INDEX) |
122 |
ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) |
ZINTOF(INDEX) = 2*ZAVTOF(INDEX) - ZOUTTOF(INDEX) |
123 |
#endif |
#endif |
124 |
#if !defined(GPAMELA_INTER) |
#if !defined(GPAMELA_INTER) |
125 |
XINTOF(INDEX) = VHITS(1,I) |
XINTOF(INDEX) = VHITS(1,I) |
126 |
YINTOF(INDEX) = VHITS(2,I) |
YINTOF(INDEX) = VHITS(2,I) |
127 |
ZINTOF(INDEX) = VHITS(3,I) |
ZINTOF(INDEX) = VHITS(3,I) |
128 |
XOUTTOF(INDEX) = VHITS(4,I) |
XOUTTOF(INDEX) = VHITS(4,I) |
129 |
YOUTTOF(INDEX) = VHITS(5,I) |
YOUTTOF(INDEX) = VHITS(5,I) |
130 |
ZOUTTOF(INDEX) = VHITS(6,I) |
ZOUTTOF(INDEX) = VHITS(6,I) |
131 |
XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. |
XAVTOF(INDEX) = (XINTOF(INDEX)+XOUTTOF(INDEX))/2. |
132 |
YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. |
YAVTOF(INDEX) = (YINTOF(INDEX)+YOUTTOF(INDEX))/2. |
133 |
ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. |
ZAVTOF(INDEX) = (ZINTOF(INDEX)+ZOUTTOF(INDEX))/2. |
134 |
#endif |
#endif |
135 |
*ML: |
*ML: |
136 |
* ERELTOF(INDEX) = VHITS(7,I) |
* ERELTOF(INDEX) = VHITS(7,I) |
137 |
ERELTOF(INDEX) = VHITS(11,I) |
ERELTOF(INDEX) = VHITS(7,I) |
138 |
TIMETOF(INDEX) = VHITS(8,I) |
TIMETOF(INDEX) = VHITS(8,I) |
139 |
PATHTOF(INDEX) = VHITS(9,I) |
PATHTOF(INDEX) = VHITS(9,I) |
140 |
IPARTOF(INDEX) = VHITS(10,I) |
IPARTOF(INDEX) = VHITS(10,I) |
141 |
* P0TOF (INDEX) = VHITS(11,I) |
* P0TOF (INDEX) = VHITS(11,I) |
142 |
P0TOF(INDEX) = VHITS(7,I) |
P0TOF(INDEX) = VHITS(11,I) |
143 |
|
ENDDO |
144 |
|
100 CONTINUE |
145 |
ENDDO |
ENDDO |
146 |
ENDDO |
ENDDO |
147 |
* |
* |