1 |
* |
* |
2 |
* $Id: gpdcal.F,v 3.3 2005/06/21 02:42:03 cafagna Exp $ |
* $Id: gpdcal.F,v 3.5 2006/05/11 00:15:34 cafagna Exp $ |
3 |
* |
* |
4 |
* $Log: gpdcal.F,v $ |
* $Log: gpdcal.F,v $ |
5 |
|
* Revision 3.5 2006/05/11 00:15:34 cafagna |
6 |
|
* A bug in hits retrival for calorimeter |
7 |
|
* |
8 |
|
* Revision 3.4 2005/07/25 11:53:20 cafagna |
9 |
|
* Several updates. See history for details |
10 |
|
* |
11 |
* Revision 3.3 2005/06/21 02:42:03 cafagna |
* Revision 3.3 2005/06/21 02:42:03 cafagna |
12 |
* Major modification to the geometry and to the random number chain |
* Major modification to the geometry and to the random number chain |
13 |
* |
* |
36 |
* * |
* * |
37 |
************************************************************************ |
************************************************************************ |
38 |
#include "gcunit.inc" |
#include "gcunit.inc" |
39 |
|
#include "gcflag.inc" |
40 |
#include "gpphit.inc" |
#include "gpphit.inc" |
41 |
PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3,NVOL1=2) |
PARAMETER (NH1=NHCALI,NHM1=NHMCALI,NVOL1=2) |
42 |
|
PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3) |
43 |
#include "gprhit.inc" |
#include "gprhit.inc" |
44 |
#include "gpcal.inc" |
#include "gpcal.inc" |
45 |
#include "gpsed.inc" |
#include "gpsed.inc" |
51 |
* |
* |
52 |
INTEGER IS,ID,NV,NVM,NNHM |
INTEGER IS,ID,NV,NVM,NNHM |
53 |
CHARACTER*4 CSET |
CHARACTER*4 CSET |
54 |
INTEGER NUMD1(NVOL1),NUMBV1(NVOL1,NHM) |
INTEGER ITRA1(NHM1),NUMD1(NVOL1),NUMBV1(NVOL1,NHM1) |
55 |
|
REAL VHITS1(NH1,NHM1) |
56 |
* |
* |
57 |
* Vector zeroed |
* Vector zeroed |
58 |
* |
* |
67 |
CALL VZERO(NUMD ,NVOL) |
CALL VZERO(NUMD ,NVOL) |
68 |
CALL VZERO(NUMD1 ,NVOL1) |
CALL VZERO(NUMD1 ,NVOL1) |
69 |
c ml:16/4/2003 |
c ml:16/4/2003 |
70 |
CALL VZERO(ICASTRIP,NHMCAL) |
CALL VZERO(ICASTRIP,NHMCALI) |
71 |
CALL VZERO(ICAPLANE,NHMCAL) |
CALL VZERO(ICAPLANE,NHMCALI) |
72 |
CALL VZERO(ICAMOD,NHMCAL) |
CALL VZERO(ICAMOD,NHMCALI) |
73 |
CALL VZERO(ENESTRIP,NHMCAL) |
CALL VZERO(ENESTRIP,NHMCALI) |
74 |
c end 16/4/2003 |
c end 16/4/2003 |
75 |
* |
* |
|
NV = NVOL |
|
|
NVM= NVMAX |
|
76 |
* |
* |
77 |
* The tungsten plane case |
* The tungsten plane case |
78 |
* |
* |
79 |
|
NV = NVOL |
80 |
|
NVM= NVMAX |
81 |
IS = ISCAL |
IS = ISCAL |
82 |
ID = IDCAST |
ID = IDCAST |
83 |
IT = -1 |
IT = -1 |
98 |
* Update the max number of hits to be retrived |
* Update the max number of hits to be retrived |
99 |
* |
* |
100 |
NNHM = NHM |
NNHM = NHM |
101 |
IF(NNHM.LE.0) THEN |
c$$$ IF(NNHM.LE.0) THEN |
102 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, |
c$$$ WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, |
103 |
+ IDRUN,IDEVT |
c$$$ + IDRUN,IDEVT |
104 |
CALL GMAIL(1,0) |
c$$$ CALL GMAIL(1,0) |
105 |
GO TO 10 |
c$$$ GO TO 10 |
106 |
ENDIF |
c$$$ ENDIF |
107 |
CALL VZERO(NUMBV,NVOL*NHM) |
CALL VZERO(NUMBV,NVOL*NHM) |
108 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
109 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
114 |
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, |
115 |
+ IDRUN,IDEVT |
+ IDRUN,IDEVT |
116 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
117 |
GO TO 10 |
ELSE |
|
ENDIF |
|
118 |
* |
* |
119 |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
* >>>>>>>>>>>>>>>>>>>>>> DIGI action |
120 |
* |
* |
121 |
* |
* |
122 |
* Fill the CWN common |
* Fill the CWN common |
123 |
* |
* |
124 |
NTHCAL=0 |
NTHCAL=0 |
125 |
DO I=1,NHITS |
DO I=1,NHITS |
126 |
NTHCAL = NTHCAL + 1 |
NTHCAL = NTHCAL + 1 |
127 |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) |
128 |
ICASI(NTHCAL) = NUMBV((NVCAL-1),I) |
ICASI(NTHCAL) = NUMBV((NVCAL-1),I) |
129 |
ICAST(NTHCAL) = NUMBV((NVCAL),I) |
ICAST(NTHCAL) = NUMBV((NVCAL),I) |
130 |
XINCAL(NTHCAL) = VHITS(1,I) |
XINCAL(NTHCAL) = VHITS(1,I) |
131 |
YINCAL(NTHCAL) = VHITS(2,I) |
YINCAL(NTHCAL) = VHITS(2,I) |
132 |
ZINCAL(NTHCAL) = VHITS(3,I) |
ZINCAL(NTHCAL) = VHITS(3,I) |
133 |
ERELCAL(NTHCAL) = VHITS(4,I) |
ERELCAL(NTHCAL) = VHITS(4,I) |
134 |
c IPARCAL(NTHCAL) = VHITS(5,I) |
c IPARCAL(NTHCAL) = VHITS(5,I) |
135 |
c P0CAL(NTHCAL) = VHITS(6,I) |
c P0CAL(NTHCAL) = VHITS(6,I) |
136 |
ENDDO |
ENDDO |
137 |
|
ENDIF |
138 |
C |
C |
139 |
C The energy released per strip |
C The energy released per strip |
140 |
C |
C |
147 |
ID = IDCASI |
ID = IDCASI |
148 |
IT = -1 |
IT = -1 |
149 |
CSET = 'CAL ' |
CSET = 'CAL ' |
150 |
* |
* |
151 |
* Check on the volume level |
* Check on the volume level |
152 |
* |
* |
153 |
IF (NV.GT.NVM) THEN |
IF (NV.GT.NVM) THEN |
156 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
157 |
GO TO 10 |
GO TO 10 |
158 |
ENDIF |
ENDIF |
159 |
CALL VZERO(VHITS,NH*NHM) |
CALL VZERO(VHITS1,NH1*NHM1) |
160 |
CALL VZERO(ITRA ,NHM) |
CALL VZERO(ITRA1 ,NHM1) |
161 |
NHITS = -1 |
NHITS = -1 |
162 |
* |
* |
163 |
* Update the max number of hits to be retrived |
* Update the max number of hits to be retrived |
164 |
* |
* |
165 |
NNHM = NHM |
NNHM = NHM1 |
166 |
IF(NNHM.LE.0) THEN |
IF(NNHM.LE.0) THEN |
167 |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM, |
WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM, |
168 |
+ IDRUN,IDEVT |
+ IDRUN,IDEVT |
169 |
CALL GMAIL(1,0) |
CALL GMAIL(1,0) |
170 |
GO TO 10 |
GO TO 10 |
171 |
ENDIF |
ENDIF |
172 |
CALL VZERO(NUMBV,NVOL*NHM) |
CALL VZERO(NUMBV1,NVOL1*NHM1) |
173 |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, |
CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL1,NH1,NNHM,1, |
174 |
+ IT,NUMD,ITRA,NUMBV,VHITS,NHITS) |
+ IT,NUMD1,ITRA1,NUMBV1,VHITS1,NHITS) |
175 |
* |
* |
176 |
* If there was a problem in GPRHIT then exit |
* If there was a problem in GPRHIT then exit |
177 |
* |
* |
191 |
NTHCALI=0 |
NTHCALI=0 |
192 |
DO I=1,NHITS |
DO I=1,NHITS |
193 |
NTHCALI=NTHCALI+1 |
NTHCALI=NTHCALI+1 |
194 |
ICASTRIP(NTHCALI)=NUMBV(NVCALI,I) |
ICASTRIP(NTHCALI)=NUMBV1(NVCALI,I) |
195 |
ICAPLANE(NTHCALI)=NUMBV((NVCALI-1),I) |
ICAPLANE(NTHCALI)=NUMBV1((NVCALI-1),I) |
196 |
ICAMOD(NTHCALI)=VHITS(1,I) |
ICAMOD(NTHCALI)=VHITS1(1,I) |
197 |
ENESTRIP(NTHCALI)=VHITS(2,I) |
ENESTRIP(NTHCALI)=VHITS1(2,I) |
198 |
ENDDO |
ENDDO |
199 |
c |
c |
200 |
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |
10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,', |