/[PAMELA software]/gpamela/gpcal/gpdcal.F
ViewVC logotype

Contents of /gpamela/gpcal/gpdcal.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3.3 - (show annotations) (download)
Tue Jun 21 02:42:03 2005 UTC (19 years, 5 months ago) by cafagna
Branch: MAIN
CVS Tags: v4r2
Changes since 3.2: +74 -18 lines
Major modification to the geometry and to the random number chain

1 *
2 * $Id: gpdcal.F,v 3.2 2003/12/17 11:32:48 pamela Exp $
3 *
4 * $Log: gpdcal.F,v $
5 * Revision 3.2 2003/12/17 11:32:48 pamela
6 * CALO SIMULATION COMPLETED: geometry and special tracking parameters updated and simulation checked by a comparison with the Trieste's standalone Monte Carlo simulation
7 *
8 * Revision 3.1.1.1 2002/07/11 16:02:14 cafagna
9 * First GPAMELA release on CVS
10 *
11 *
12 *CMZ : 2.03/00 31/10/2000 11.18.51 by Francesco Cafagna
13 *CMZ : 2.02/00 10/10/2000 14.09.00 by Francesco Cafagna
14 *CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola
15 *CMZ : 2.00/00 29/02/2000 17.39.10 by Francesco Cafagna
16 *CMZ : 1.02/00 10/02/2000 17.28.08 by Francesco Cafagna
17 *CMZ : 1.01/00 21/05/96 17.33.38 by Francesco Cafagna
18 *CMZ : 1.00/02 05/04/96 11.26.03 by Francesco Cafagna
19 *-- Author : Francesco Cafagna 23/02/96
20 SUBROUTINE GPDCAL
21 ************************************************************************
22 * *
23 * To perform CAL digitization *
24 * *
25 * Called by: GUDIGI *
26 * Author: Francesco Cafagna, 23/02/96 12.50.38 *
27 * *
28 ************************************************************************
29 #include "gcunit.inc"
30 #include "gpphit.inc"
31 PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3,NVOL1=2)
32 #include "gprhit.inc"
33 #include "gpcal.inc"
34 #include "gpsed.inc"
35 #include "gpkey.inc"
36 #include "gpgeo.inc"
37 *ml:21/02/02
38 #include "gpencal.inc"
39 *end ml.
40 *
41 INTEGER IS,ID,NV,NVM,NNHM
42 CHARACTER*4 CSET
43 INTEGER NUMD1(NVOL1),NUMBV1(NVOL1,NHM)
44 *
45 * Vector zeroed
46 *
47 CALL VZERO(ICAPL ,NHMCAL)
48 CALL VZERO(ICASI ,NHMCAL)
49 CALL VZERO(ICAST ,NHMCAL)
50 CALL VZERO(XCASI,NHMCAL)
51 CALL VZERO(YCASI,NHMCAL)
52 CALL VZERO(ZCASI,NHMCAL)
53 CALL VZERO(IPARCAL,NHMCAL)
54 CALL VZERO(ERCASI,NHMCAL)
55 CALL VZERO(NUMD ,NVOL)
56 CALL VZERO(NUMD1 ,NVOL1)
57 c ml:16/4/2003
58 CALL VZERO(ICASTRIP,NHMCAL)
59 CALL VZERO(ICAPLANE,NHMCAL)
60 CALL VZERO(ICAMOD,NHMCAL)
61 CALL VZERO(ENESTRIP,NHMCAL)
62 c end 16/4/2003
63 *
64 NV = NVOL
65 NVM= NVMAX
66 *
67 * The tungsten plane case
68 *
69 IS = ISCAL
70 ID = IDCAST
71 IT = -1
72 CSET = 'CAL '
73 *
74 * Check on the volume level
75 *
76 IF (NV.GT.NVM) THEN
77 WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX,
78 + IDRUN,IDEVT
79 CALL GMAIL(1,0)
80 GO TO 10
81 ENDIF
82 CALL VZERO(VHITS,NH*NHM)
83 CALL VZERO(ITRA ,NHM)
84 NHITS = -1
85 *
86 * Update the max number of hits to be retrived
87 *
88 NNHM = NHM
89 IF(NNHM.LE.0) THEN
90 WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM,
91 + IDRUN,IDEVT
92 CALL GMAIL(1,0)
93 GO TO 10
94 ENDIF
95 CALL VZERO(NUMBV,NVOL*NHM)
96 CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1,
97 + IT,NUMD,ITRA,NUMBV,VHITS,NHITS)
98 *
99 * If there was a problem in GPRHIT then exit
100 *
101 IF(NHITS.LT.0) THEN
102 WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM,
103 + IDRUN,IDEVT
104 CALL GMAIL(1,0)
105 GO TO 10
106 ENDIF
107 *
108 * >>>>>>>>>>>>>>>>>>>>>> DIGI action
109 *
110 *
111 * Fill the CWN common
112 *
113 NTHCAL=0
114 DO I=1,NHITS
115 NTHCAL = NTHCAL + 1
116 ICAPL(NTHCAL) = NUMBV((NVCAL-2),I)
117 ICASI(NTHCAL) = NUMBV((NVCAL-1),I)
118 ICAST(NTHCAL) = NUMBV((NVCAL),I)
119 XINCAL(NTHCAL) = VHITS(1,I)
120 YINCAL(NTHCAL) = VHITS(2,I)
121 ZINCAL(NTHCAL) = VHITS(3,I)
122 ERELCAL(NTHCAL) = VHITS(4,I)
123 c IPARCAL(NTHCAL) = VHITS(5,I)
124 c P0CAL(NTHCAL) = VHITS(6,I)
125 ENDDO
126 C
127 C The energy released per strip
128 C
129 NV = NVOL1
130 NVM= NVMAX
131 *
132 * The tungsten plane case
133 *
134 IS = ISCAL
135 ID = IDCASI
136 IT = -1
137 CSET = 'CAL '
138 *
139 * Check on the volume level
140 *
141 IF (NV.GT.NVM) THEN
142 WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX,
143 + IDRUN,IDEVT
144 CALL GMAIL(1,0)
145 GO TO 10
146 ENDIF
147 CALL VZERO(VHITS,NH*NHM)
148 CALL VZERO(ITRA ,NHM)
149 NHITS = -1
150 *
151 * Update the max number of hits to be retrived
152 *
153 NNHM = NHM
154 IF(NNHM.LE.0) THEN
155 WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM,
156 + IDRUN,IDEVT
157 CALL GMAIL(1,0)
158 GO TO 10
159 ENDIF
160 CALL VZERO(NUMBV,NVOL*NHM)
161 CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1,
162 + IT,NUMD,ITRA,NUMBV,VHITS,NHITS)
163 *
164 * If there was a problem in GPRHIT then exit
165 *
166 IF(NHITS.LT.0) THEN
167 WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM,
168 + IDRUN,IDEVT
169 CALL GMAIL(1,0)
170 GO TO 10
171 ENDIF
172 *
173 * >>>>>>>>>>>>>>>>>>>>>> DIGI action
174 *
175 *
176 * Fill the CWN common
177 *
178 c
179 DO I=1,NHITS
180 NTHCALI=NTHCALI+1
181 ICASTRIP(NTHCALI)=NUMBV(NVCALI,I)
182 ICAPLANE(NTHCALI)=NUMBV((NVCALI-1),I)
183 ICAMOD(NTHCALI)=VHITS(1,I)
184 ENESTRIP(NTHCALI)=VHITS(2,I)
185 ENDDO
186 c
187 10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,',
188 + NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8)
189 10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4,
190 + ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5,
191 + ', RUN=',I5,', EVT=',I8)
192 10200 FORMAT(' GPDCAL: Error in GPRHIT: SET=',A4,
193 + ', DET=',A4,',NHITS=',I5,', NHMAX=',I5,
194 + ', RUN=',I5,', EVT=',I8)
195 10 RETURN
196 END

  ViewVC Help
Powered by ViewVC 1.1.23