1 |
* |
2 |
* $Id: gpdcal.F,v 3.1.1.1 2002/07/11 16:02:14 cafagna Exp $ |
3 |
* |
4 |
* $Log: gpdcal.F,v $ |
5 |
* Revision 3.1.1.1 2002/07/11 16:02:14 cafagna |
6 |
* First GPAMELA release on CVS |
7 |
* |
8 |
* |
9 |
*CMZ : 2.03/00 31/10/2000 11.18.51 by Francesco Cafagna |
10 |
*CMZ : 2.02/00 10/10/2000 14.09.00 by Francesco Cafagna |
11 |
*CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola |
12 |
*CMZ : 2.00/00 29/02/2000 17.39.10 by Francesco Cafagna |
13 |
*CMZ : 1.02/00 10/02/2000 17.28.08 by Francesco Cafagna |
14 |
*CMZ : 1.01/00 21/05/96 17.33.38 by Francesco Cafagna |
15 |
*CMZ : 1.00/02 05/04/96 11.26.03 by Francesco Cafagna |
16 |
*-- Author : Francesco Cafagna 23/02/96 |
17 |
SUBROUTINE GPDCAL |
18 |
************************************************************************ |
19 |
* * |
20 |
* To perform CAL digitization * |
21 |
* * |
22 |
* Called by: GUDIGI * |
23 |
* Author: Francesco Cafagna, 23/02/96 12.50.38 * |
24 |
* * |
25 |
************************************************************************ |
26 |
#include "gcunit.inc" |
27 |
#include "gpphit.inc" |
28 |
PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3,NVOL1=2) |
29 |
#include "gprhit.inc" |
30 |
#include "gpcal.inc" |
31 |
#include "gpsed.inc" |
32 |
#include "gpkey.inc" |
33 |
#include "gpgeo.inc" |
34 |
*ml:21/02/02 |
35 |
#include "gpencal.inc" |
36 |
*end ml. |
37 |
* |
38 |
INTEGER IS,ID,NV,NVM,NNHM |
39 |
CHARACTER*4 CSET |
40 |
INTEGER NUMD1(NVOL1),NUMBV1(NVOL1,NHM) |
41 |
* |
42 |
* Vector zeroed |
43 |
* |
44 |
CALL VZERO(ICAPL ,NHMCAL) |
45 |
CALL VZERO(ICASI ,NHMCAL) |
46 |
CALL VZERO(ICAST ,NHMCAL) |
47 |
CALL VZERO(XCASI,NHMCAL) |
48 |
CALL VZERO(YCASI,NHMCAL) |
49 |
CALL VZERO(ZCASI,NHMCAL) |
50 |
CALL VZERO(IPARCAL,NHMCAL) |
51 |
CALL VZERO(ERCASI,NHMCAL) |
52 |
CALL VZERO(NUMD ,NVOL) |
53 |
CALL VZERO(NUMD1 ,NVOL1) |
54 |
c ml:16/4/2003 |
55 |
CALL VZERO(ICASTRIP,NHMCAL) |
56 |
CALL VZERO(ICAPLANE,NHMCAL) |
57 |
CALL VZERO(ICAMOD,NHMCAL) |
58 |
CALL VZERO(ENESTRIP,NHMCAL) |
59 |
c end 16/4/2003 |
60 |
* |
61 |
NV = NVOL |
62 |
NVM= NVMAX |
63 |
* |
64 |
* The tungsten plane case |
65 |
* |
66 |
IS = ISCAL |
67 |
ID = IDCASI |
68 |
IT = -1 |
69 |
CSET = 'CAL ' |
70 |
* |
71 |
* Check on the volume level |
72 |
* |
73 |
IF (NV.GT.NVM) THEN |
74 |
WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, |
75 |
+ IDRUN,IDEVT |
76 |
CALL GMAIL(1,0) |
77 |
GO TO 10 |
78 |
ENDIF |
79 |
CALL VZERO(VHITS,NH*NHM) |
80 |
CALL VZERO(ITRA ,NHM) |
81 |
NHITS = -1 |
82 |
* |
83 |
* Update the max number of hits to be retrived |
84 |
* |
85 |
NNHM = NHM |
86 |
IF(NNHM.LE.0) THEN |
87 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, |
88 |
+ IDRUN,IDEVT |
89 |
CALL GMAIL(1,0) |
90 |
GO TO 10 |
91 |
ENDIF |
92 |
CALL VZERO(NUMBV,NVOL*NHM) |
93 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
94 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
95 |
* |
96 |
* If there was a problem in GPRHIT then exit |
97 |
* |
98 |
IF(NHITS.LT.0) THEN |
99 |
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
100 |
+ IDRUN,IDEVT |
101 |
CALL GMAIL(1,0) |
102 |
GO TO 10 |
103 |
ENDIF |
104 |
* |
105 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
106 |
* |
107 |
* |
108 |
* Fill the CWN common |
109 |
* |
110 |
NTHCAL=0 |
111 |
DO I=1,NHITS |
112 |
NTHCAL=NTHCAL+1 |
113 |
ICASTRIP(NTHCAL)=VHITS(2,I) |
114 |
ICAPLANE(NTHCAL)=VHITS(1,I) |
115 |
ICAMOD(NTHCAL)=VHITS(3,I) |
116 |
ENESTRIP(NTHCAL)=VHITS(4,I) |
117 |
ENDDO |
118 |
cl DO I=1,NHITS |
119 |
cl NTHCAL = NTHCAL + 1 |
120 |
cl ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
121 |
cl ICASI(NTHCAL) = NUMBV((NVCAL-1),I) |
122 |
cl ICAST(NTHCAL) = NUMBV((NVCAL),I) |
123 |
cl XINCAL(NTHCAL) = VHITS(1,I) |
124 |
cl YINCAL(NTHCAL) = VHITS(2,I) |
125 |
cl ZINCAL(NTHCAL) = VHITS(3,I) |
126 |
cl ERELCAL(NTHCAL) = VHITS(4,I) |
127 |
c IPARCAL(NTHCAL) = VHITS(5,I) |
128 |
c P0CAL(NTHCAL) = VHITS(6,I) |
129 |
cl ENDDO |
130 |
c |
131 |
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
132 |
+ NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8) |
133 |
10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4, |
134 |
+ ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5, |
135 |
+ ', RUN=',I5,', EVT=',I8) |
136 |
10200 FORMAT(' GPDCAL: Error in GPRHIT: SET=',A4, |
137 |
+ ', DET=',A4,',NHITS=',I5,', NHMAX=',I5, |
138 |
+ ', RUN=',I5,', EVT=',I8) |
139 |
10 RETURN |
140 |
END |