1 |
* |
2 |
* $Id: gpdtrd.F,v 3.1.1.1 2002/07/11 16:02:01 cafagna Exp $ |
3 |
* |
4 |
* $Log: gpdtrd.F,v $ |
5 |
* Revision 3.1.1.1 2002/07/11 16:02:01 cafagna |
6 |
* First GPAMELA release on CVS |
7 |
* |
8 |
* |
9 |
*CMZ : 3.00/00 08/02/2002 17.36.53 by Unknown |
10 |
*CMZ : 2.01/00 08/03/2000 18.34.57 by Unknown |
11 |
*CMZ : 2.00/00 25/02/2000 15.46.40 by Francesco Cafagna |
12 |
*CMZ : 1.02/00 22/10/99 16.17.58 by Francesco Cafagna |
13 |
*CMZ : 1.01/00 21/05/96 17.33.37 by Francesco Cafagna |
14 |
*CMZ : 1.00/02 04/04/96 16.08.24 by Francesco Cafagna |
15 |
*-- Author : Francesco Cafagna 23/02/96 |
16 |
SUBROUTINE GPDTRD |
17 |
************************************************************************ |
18 |
* * |
19 |
* To perform TRD digitization * |
20 |
* * |
21 |
* Called by: GUDIGI * |
22 |
* Author: Francesco Cafagna, 23/02/96 12.50.38 * |
23 |
* * |
24 |
************************************************************************ |
25 |
#include "gcunit.inc" |
26 |
#include "gpphit.inc" |
27 |
PARAMETER (NH=NHTRD,NHM=NHMTRD,NVOL=5) |
28 |
#include "gprhit.inc" |
29 |
#include "gptrd.inc" |
30 |
#include "gpsed.inc" |
31 |
* |
32 |
INTEGER IS,ID,NV,NVM,NNHM |
33 |
CHARACTER*4 CSET |
34 |
* |
35 |
* |
36 |
* Vector zeroed |
37 |
* |
38 |
CALL VZERO(ITRBS,NHMTRD) |
39 |
*ML: |
40 |
CALL VZERO(ITRSO,NHMTRD) |
41 |
* CALL VZERO(ITRSI,NHMTRD) |
42 |
*END ML. |
43 |
#if defined(GPAMELA_INTER) |
44 |
CALL VZERO(XAVTRD,NHMTRD) |
45 |
CALL VZERO(YAVTRD,NHMTRD) |
46 |
CALL VZERO(ZAVTRD,NHMTRD) |
47 |
#endif |
48 |
#if !defined(GPAMELA_INTER) |
49 |
CALL VZERO(XINTRD,NHMTRD) |
50 |
CALL VZERO(YINTRD,NHMTRD) |
51 |
CALL VZERO(ZINTRD,NHMTRD) |
52 |
#endif |
53 |
CALL VZERO(XOUTTRD,NHMTRD) |
54 |
CALL VZERO(YOUTTRD,NHMTRD) |
55 |
CALL VZERO(ZOUTTRD,NHMTRD) |
56 |
CALL VZERO(ERELTRD,NHMTRD) |
57 |
CALL VZERO(PATHTRD,NHMTRD) |
58 |
CALL VZERO(P0TRD,NHMTRD) |
59 |
CALL VZERO(IPARTRD,NHMTRD) |
60 |
CALL VZERO(ETRTRD,NHMTRD) |
61 |
CALL VZERO(NTRTRD,NHMTRD) |
62 |
CALL VZERO(ELOSTRD,NHMTRD) |
63 |
CALL VZERO(NUMD ,NVOL) |
64 |
C ML: |
65 |
#if defined(GPAMELA_GARFIELD) |
66 |
CALL VZERO(EGARTRD,NHMTRD) |
67 |
CALL VZERO(NGARTRD,NHMTRD) |
68 |
#endif |
69 |
C END ML. |
70 |
* |
71 |
* Starting from the TOP |
72 |
* |
73 |
NV = NVOL |
74 |
NVM= NVMAX |
75 |
IS = ISTRD |
76 |
ID = IDTRSO |
77 |
CSET = 'TRD ' |
78 |
IT = -1 |
79 |
* |
80 |
* Check on the volume level |
81 |
* |
82 |
IF (NV.GT.NVM) THEN |
83 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, |
84 |
+ IDRUN,IDEVT |
85 |
CALL GMAIL(1,0) |
86 |
GO TO 10 |
87 |
ENDIF |
88 |
CALL VZERO(VHITS,NH*NHM) |
89 |
CALL VZERO(ITRA ,NHM) |
90 |
CALL VZERO(NUMBV,NVOL*NHM) |
91 |
NHITS = -1 |
92 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1, |
93 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
94 |
* |
95 |
* If there was a problem in GPRHIT then exit |
96 |
* |
97 |
IF(NHITS.LT.0) THEN |
98 |
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
99 |
+ IDRUN,IDEVT |
100 |
CALL GMAIL(1,0) |
101 |
NTHTRD = -NHITS |
102 |
GO TO 10 |
103 |
ENDIF |
104 |
* |
105 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
106 |
* |
107 |
* |
108 |
* Fill the CWN common |
109 |
* |
110 |
NTHTRD = NHITS |
111 |
DO I=1,NHITS |
112 |
ITRBS(I) = NUMBV((NVTRD-2),I) |
113 |
*ML: |
114 |
* ITRBS(I) = NUMBV((NVTRD-2),I) |
115 |
* ITRSO(I) = NUMBV((NVTRD-1),I) |
116 |
ITRSI(I) = NUMBV((NVTRD-1),I) |
117 |
*END ML. |
118 |
#if defined(GPAMELA_INTER) |
119 |
XAVTRD(I) = VHITS(1,I) |
120 |
YAVTRD(I) = VHITS(2,I) |
121 |
ZAVTRD(I) = VHITS(3,I) |
122 |
XOUTTRD(I) = VHITS(4,I) |
123 |
YOUTTRD(I) = VHITS(5,I) |
124 |
ZOUTTRD(I) = VHITS(6,I) |
125 |
XINTRD(I) = 2*XAVTRD(I) - XOUTTRD(I) |
126 |
YINTRD(I) = 2*YAVTRD(I) - YOUTTRD(I) |
127 |
ZINTRD(I) = 2*ZAVTRD(I) - ZOUTTRD(I) |
128 |
#endif |
129 |
#if !defined(GPAMELA_INTER) |
130 |
XINTRD(I) = VHITS(1,I) |
131 |
YINTRD(I) = VHITS(2,I) |
132 |
ZINTRD(I) = VHITS(3,I) |
133 |
XOUTTRD(I) = VHITS(4,I) |
134 |
YOUTTRD(I) = VHITS(5,I) |
135 |
ZOUTTRD(I) = VHITS(6,I) |
136 |
XAVTRD(I) = (XINTRD(I)+XOUTTRD(I))/2. |
137 |
YAVTRD(I) = (YINTRD(I)+YOUTTRD(I))/2. |
138 |
ZAVTRD(I) = (ZINTRD(I)+ZOUTTRD(I))/2. |
139 |
#endif |
140 |
C ERELTRD(I) = VHITS(7,I) |
141 |
ELOSTRD(I) = VHITS(7,I) |
142 |
PATHTRD(I) = VHITS(8,I) |
143 |
IPARTRD(I) = VHITS(9,I) |
144 |
P0TRD(I) = VHITS(10,I) |
145 |
ETRTRD(I) = VHITS(11,I) |
146 |
NTRTRD(I) = VHITS(12,I) |
147 |
C ML: |
148 |
#if defined(GPAMELA_GARFIELD) |
149 |
ERELTRD(I) = VHITS(11,I)+VHITS(13,I) |
150 |
C EGARTRD(I) = VHITS(11,I) |
151 |
C NGARTRD(I) = VHITS(12,I) |
152 |
EGARTRD(I) = VHITS(13,I) |
153 |
NGARTRD(I) = VHITS(14,I) |
154 |
C PRINT*,'EGARTRD,NGARTRD=',EGARTRD(I),NGARTRD(I),I |
155 |
C PRINT*,'PATHTRD=',VHITS(8,I) |
156 |
#endif |
157 |
C END ML. |
158 |
ENDDO |
159 |
* |
160 |
10000 FORMAT(' GPDTRD: VOLUME level too big: SET=',A4,', DET=',A4, |
161 |
+ ',NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
162 |
10100 FORMAT(' GPDTRD: MAX number of hits retrived: SET=',A4, |
163 |
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
164 |
+ ', RUN=',I5,', EVT=',I8) |
165 |
10200 FORMAT(' GPDTRD: Error in GPRHIT: SET=',A4, |
166 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
167 |
+ ', RUN=',I5,', EVT=',I8) |
168 |
10 RETURN |
169 |
END |