Make also lib directory if missing when making libraries
[u/mrichter/AliRoot.git] / ITS / AliITSf.F
CommitLineData
fe4da5cc 1*CMZ : 22/02/99 17.57.04 by Federico Carminati
2*CMZ : 2.03/01 10/09/98 11.48.45 by Roberto Barbera
3*CMZ : 2.00/05 25/05/98 14.39.00 by Federico Carminati
4*CMZ : 2.00/04 22/05/98 09.37.53 by Roberto Barbera (Catania)
5*CMZ : 2.00/02 24/04/98 13.35.44 by Federico Carminati
6*CMZ : 2.00/01 22/04/98 19.18.39 by Federico Carminati
7*CMZ : 1.05/06 24/10/95 14.00.47 by Nick van Eijndhoven (RUU/CERN)
8*CMZ : 1.05/00 10/12/92 16.45.55 by Nick van Eijndhoven (RUU/CERN)
9*-- Author : Nick van Eijndhoven (CERN) 24/09/90
10 SUBROUTINE ITS_GEO4(IVERS,IDTMED)
11C
12C *** DEFINITION OF THE GEOMETRY OF THE ITS ***
13C *** RB APR-1990 CATANIA ***
14C
15C CALLED BY : SXGEOM
16C ORIGIN : ROBERTO BARBERA
17C
18#undef CERNLIB_GEANT321_GCONSP_INC
19#include "geant321/gconsp.inc"
20*KEND.
21 DIMENSION IDTMED(*)
22C
23 DIMENSION IDROTM(5250)
24C
25 CHARACTER*4 NATRA(8),NATRA1(16),NATRA2(6),NATRA3(6),NATRA4(16)
26C
27 REAL*8 BIGA,BIGB,BIGA1,BIGB1
28 REAL*8 COEFFA,COEFFB,COEFFC
29 REAL*8 XCC1,YCC1,XCC2,YCC2
30C
31 DIMENSION DITS(3),DBUS(3),DCHI(3)
32 DIMENSION DSUP(3),DTUB(3),DWAT(3)
33 DIMENSION DCEI(3),DFRA(10)
34 DIMENSION DAL1(3),DAL2(3),DKAP(3)
35 DIMENSION DPCB(3),DCOP(3),DCER(3),DSIL(3)
36 DIMENSION DPLA(3),DEPX(3)
37 DIMENSION DGH(15)
38 DIMENSION XX(13),YY(13),XBEG(12),YBEG(12),XEND(12),YEND(12)
39 DIMENSION DARC(5),XARC(12),YARC(12),RARC(12)
40 DIMENSION DTRA(3),DTRA1(3),DTRA2(3),DTRA3(3),DTRA4(3)
41 DIMENSION XTRA(8),YTRA(8),ZTRA(8)
42 DIMENSION XTRA1(6),YTRA1(6),ZTRA1(6)
43 DIMENSION DCONE(5),DTUBE(3),DPGON(10)
44 DIMENSION DBOX1(3),DBOX2(3),DSRV(3),DELA(3)
45C
46 DATA NATRA/'TR01','TR02','TR03','TR04','TR05','TR06','TR07',
47 $ 'TR08'/
48 DATA NATRA1/'TR11','TR12','TR13','TR14','TR15','TR16','TR17',
49 $ 'TR18','TR19','TR20','TR21','TR22','TR23','TR24',
50 $ 'TR25','TR26'/
51 DATA NATRA2/'TR31','TR32','TR33','TR34','TR35','TR36'/
52 DATA NATRA3/'TR41','TR42','TR43','TR44','TR45','TR46'/
53 DATA NATRA4/'TR51','TR52','TR53','TR54','TR55','TR56','TR57',
54 $ 'TR58','TR59','TR60','TR61','TR62','TR63','TR64',
55 $ 'TR65','TR66'/
56C
57 DATA XX/0.,0.,-4.824,-4.833,-22.167,-22.585,-28.070,-27.626,
58 $ -38.139,-19.749,-13.449,-14.726,0./
59 DATA YY/0.,34.028,34.064,32.594,29.984,30.914,29.180,27.777,
60 $ 22.522,-7.918,-4.769,-2.216,0./
61 DATA XBEG/0.,-0.497,-4.827,-5.425,-22.395,-23.009,-27.919,
62 $ -28.161,-37.859,-19.337,-13.673,-13.773/
63 DATA YBEG/0.430,34.032,33.564,32.505,30.493,30.781,28.702,
64 $ 27.509,22.058,-7.711,-4.322,-2.073/
65 DATA XEND/0.,-4.323,-4.830,-21.643,-22.395,-27.593,-27.807,
66 $ -37.655,-19.988,-13.897,-14.294,-0.425/
67 DATA YEND/33.531,34.060,33.192,30.064,30.493,29.330,28.347,
68 $ 22.764,-7.523,-4.992,-3.077,-0.064/
69 DATA XARC/-19.560,-14.120,-13.669,-0.500,-0.500,-4.327,-5.529,
70 $ -21.746,-22.858,-27.442,-28.474,-37.431/
71 DATA YARC/-7.264,-4.545,-2.765,0.431,33.531,33.560,33.197,
72 $ 30.756,30.304,28.854,28.136,22.316/
73 DATA RARC/0.5,0.5,0.7,0.5,0.5,0.5,0.7,0.7,0.5,0.5,0.7,0.5/
74C
75 DATA RR,TTETA,PPHI,GTETA/4.08332,63.,-27.,89.4/ ! 89.4 = 90.-0.6
76C
77C --- Define ghost volume containing the whole ITS and fill it with air
78C or vacuum
79C
80 DGH(1)=0.
81 DGH(2)=360.
82 DGH(3)=4.
83 DGH(4)=-70.
84 DGH(5)=49.999
85 DGH(6)=49.999
86 DGH(7)=-25.
87 DGH(8)=3.
88 DGH(9)=49.999
89 DGH(10)=25.
90 DGH(11)=3.
91 DGH(12)=49.999
92 DGH(13)=70.
93 DGH(14)=49.999
94 DGH(15)=49.999
95 CALL GSVOLU('ITSV','PCON',IDTMED(276),DGH,15,IOUT)
96C
97C --- Place the ghost volume in its mother volume (ALIC) and make it
98C invisible
99C
100 CALL GSPOS('ITSV',1,'ALIC',0.,0.,0.,0,'ONLY')
101 CALL GSATT('ITSV','SEEN',0)
102C
103C ************************************************************************
104C * *
105C * P I X E L S *
106C * =========== *
107C * *
108C ************************************************************************
109C
110C GOTO 2345 ! skip ITS layer no. 1 and 2
111C
112C --- Define ghost volume containing the Pixel Detectors and fill it with air
113C or vacuum
114C
115 XXM=(49.999-3.)/(70.-25.)
116 DGH(1)=0.
117 DGH(2)=360.
118 DGH(3)=4.
119 DGH(4)=-25.-(9.-3.01)/XXM
120 DGH(5)=9.
121 DGH(6)=9.
122 DGH(7)=-25.
123 DGH(8)=3.01
124 DGH(9)=9.
125 DGH(10)=25.
126 DGH(11)=3.01
127 DGH(12)=9.
128 DGH(13)=25.+(9.-3.01)/XXM
129 DGH(14)=9.
130 DGH(15)=9.
131 CALL GSVOLU('IT12','PCON',IDTMED(276),DGH,15,IOUT)
132C
133C --- Place the ghost volume in its mother volume (ITSV) and make it
134C invisible
135C
136 CALL GSPOS('IT12',1,'ITSV',0.,0.,0.,0,'ONLY')
137 CALL GSATT('IT12','SEEN',0)
138C
139C --- Define a ghost volume containing a single element of layer #1
140C and fill it with air or vacuum
141C
142 DBOX1(1)=0.005+0.01+0.0075
143 DBOX1(2)=0.79
144 DBOX1(3)=12.67
145 CALL GSVOLU('IPV1','BOX ',IDTMED(204),DBOX1,3,IOUT)
146C
147C --- Divide each element of layer #1 in three ladders along the beam direction
148C
149 CALL GSDVN('IPB1','IPV1',3,3)
150C
151C --- Make the ghost volumes invisible
152C
153 CALL GSATT('IPV1','SEEN',0)
154 CALL GSATT('IPB1','SEEN',0)
155C
156C --- Define a volume containing the chip of pixels (silicon, layer #1)
157C
158 DCHI(1)=0.005
159 DCHI(2)=0.79
160 DCHI(3)=DBOX1(3)/3.
161 CALL GSVOLU('ICH1','BOX ',IDTMED(201),DCHI,3,IOUT)
162C
163C --- Define a volume containing the bus of pixels (silicon, layer #1)
164C
165 DBUS(1)=0.01
166 DBUS(2)=0.64
167 DBUS(3)=4.19
168 CALL GSVOLU('IBU1','BOX ',IDTMED(202),DBUS,3,IOUT)
169C
170C --- Define a volume containing the sensitive part of pixels
171C (silicon, layer #1)
172C
173 DITS(1)=0.0075
174 DITS(2)=0.64
175 DITS(3)=4.19
176 CALL GSVOLU('ITS1','BOX ',IDTMED(200),DITS,3,IOUT)
177C
178C --- Place the chip into its mother (IPB1)
179C
180 XPOS=DBOX1(1)-DCHI(1)
181 YPOS=0.
182 ZPOS=0.
183 CALL GSPOS('ICH1',1,'IPB1',XPOS,YPOS,ZPOS,0,'ONLY')
184C
185C --- Place the sensitive volume into its mother (IPB1)
186C
187 XPOS=DBOX1(1)-2.*DCHI(1)-DITS(1)
188 YPOS=DCHI(2)-DITS(2)
189 ZPOS=-(DCHI(3)-DITS(3))
190 CALL GSPOS('ITS1',1,'IPB1',XPOS,YPOS,ZPOS,0,'ONLY')
191C
192C --- Place the bus into its mother (IPB1)
193C
194 XPOS=DBOX1(1)-2.*DCHI(1)-2.*DITS(1)-DBUS(1)
195 YPOS=DCHI(2)-DBUS(2)
196 ZPOS=-(DCHI(3)-DBUS(3))
197 CALL GSPOS('IBU1',1,'IPB1',XPOS,YPOS,ZPOS,0,'ONLY')
198C
199C --- Define a ghost volume containing a single element of layer #2
200C and fill it with air or vacuum
201C
202 DBOX2(1)=0.005+0.01+0.0075
203 DBOX2(2)=0.79
204 DBOX2(3)=16.91
205 CALL GSVOLU('IPV2','BOX ',IDTMED(204),DBOX2,3,IOUT)
206C
207C --- Divide each element of layer #2 in four ladders along the beam direction
208C
209 CALL GSDVN('IPB2','IPV2',4,3)
210C
211C --- Make the ghost volumes invisible
212C
213 CALL GSATT('IPV2','SEEN',0)
214 CALL GSATT('IPB2','SEEN',0)
215C
216C --- Define a volume containing the chip of pixels (silicon, layer #2)
217C
218 DCHI(1)=0.005
219 DCHI(2)=0.79
220 DCHI(3)=DBOX2(3)/4.
221 CALL GSVOLU('ICH2','BOX ',IDTMED(201),DCHI,3,IOUT)
222C
223C --- Define a volume containing the bus of pixels (silicon, layer #2)
224C
225 DBUS(1)=0.01
226 DBUS(2)=0.64
227 DBUS(3)=4.19
228 CALL GSVOLU('IBU2','BOX ',IDTMED(202),DBUS,3,IOUT)
229C
230C --- Define a volume containing the sensitive part of pixels
231C (silicon, layer #2)
232C
233 DITS(1)=0.0075
234 DITS(2)=0.64
235 DITS(3)=4.19
236 CALL GSVOLU('ITS2','BOX ',IDTMED(200),DITS,3,IOUT)
237C
238C --- Place the chip into its mother (IPB2)
239C
240 XPOS=DBOX1(1)-2.*DBUS(1)-2.*DITS(1)-DCHI(1)
241 YPOS=0.
242 ZPOS=0.
243 CALL GSPOS('ICH2',1,'IPB2',XPOS,YPOS,ZPOS,0,'ONLY')
244C
245C --- Place the sensitive volume into its mother (IPB2)
246C
247 XPOS=DBOX1(1)-2.*DBUS(1)-DITS(1)
248 YPOS=-(DCHI(2)-DITS(2))
249 ZPOS=-(DCHI(3)-DITS(3))
250 CALL GSPOS('ITS2',1,'IPB2',XPOS,YPOS,ZPOS,0,'ONLY')
251C
252C --- Place the bus into its mother (IPB2)
253C
254 XPOS=DBOX1(1)-DBUS(1)
255 YPOS=-(DCHI(2)-DBUS(2))
256 ZPOS=-(DCHI(3)-DBUS(3))
257 CALL GSPOS('IBU2',1,'IPB2',XPOS,YPOS,ZPOS,0,'ONLY')
258C
259C --- Define a generic segment of an element of the mechanical support
260C
261 DSUP(1)=0.
262 DSUP(2)=0.
263 DSUP(3)=0.
264 CALL GSVOLU('SPIX','BOX ',IDTMED(203),DSUP,0,IOUT)
265C
266C --- Define a generic arc of an element of the mechanical support
267C
268 DARC(1)=0.
269 DARC(2)=0.
270 DARC(3)=0.
271 CALL GSVOLU('SARC','TUBS',IDTMED(203),DARC,0,IOUT)
272C
273C --- Define the mechanical supports of layers #1 and #2 and place the
274C elements of the layers in it
275C
276 JBOX1=0 ! counter over the number of elements of layer #1 (1-20)
277 JBOX2=0 ! counter over the number of elements of layer #2 (1-40)
278C
279 DO I=1,10 ! number of carbon fiber supports (see sketch)
280C
281C --- Place part # 1-2 (see sketch)
282C
283 OFFSET1=-27.
284 DSUP(1)=0.01
285 DSUP(2)=SQRT((XEND(1)-XBEG(1))*(XEND(1)-XBEG(1))+
286 $ (YEND(1)-YBEG(1))*(YEND(1)-YBEG(1)))/20.
287 DSUP(3)=25.
288 XCC=(XX(1)+XX(2))/20.
289 YCC=(YY(1)+YY(2))/20.
290 XCCC=(XBEG(1)+XEND(1))/20.
291 YCCC=(YBEG(1)+YEND(1))/20.
292 IF(XX(1).EQ.XX(2)) THEN
293 OFFSET2=0.
294 ELSE
295 OFFSET2=ATG(YY(2)-YY(1),XX(2)-XX(1))*RADDEG-90.
296 ENDIF
297 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
298 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
299 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
300 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
301 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
302 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
303 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
304 ZPOS=0.
305 ATHETA12=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
306 CALL SXSROT(IDROTM(1100+(I-1)*13+1),90.,ATHETA12,90.,
307 $ 90.+ATHETA12,0.,0.)
308 CALL GSPOSP('SPIX',(I-1)*13+1,'IT12',XPOS,YPOS,ZPOS,IDROTM(
309 $ 1100+(I-1)*13+1),'ONLY',DSUP,3)
310C
311C --- Place part # 2-3 (see sketch)
312C
313 OFFSET1=-27.
314 DSUP(1)=0.01
315 DSUP(2)=SQRT((XEND(2)-XBEG(2))*(XEND(2)-XBEG(2))+
316 $ (YEND(2)-YBEG(2))*(YEND(2)-YBEG(2)))/20.
317 DSUP(3)=25.
318 XCC=(XX(2)+XX(3))/20.
319 YCC=(YY(2)+YY(3))/20.
320 XCCC=(XBEG(2)+XEND(2))/20.
321 YCCC=(YBEG(2)+YEND(2))/20.
322 IF(XX(2).EQ.XX(3)) THEN
323 OFFSET2=0.
324 ELSE
325 OFFSET2=ATG(YY(3)-YY(2),XX(3)-XX(2))*RADDEG-90.
326 ENDIF
327 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
328 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
329 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
330 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
331 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
332 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
333 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
334 ZPOS=0.
335 ATHETA23=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
336 CALL SXSROT(IDROTM(1100+(I-1)*13+2),90.,ATHETA23,90.,
337 $ 90.+ATHETA23,0.,0.)
338 CALL GSPOSP('SPIX',(I-1)*13+2,'IT12',XPOS,YPOS,ZPOS,IDROTM(
339 $ 1100+(I-1)*13+2),'ONLY',DSUP,3)
340C
341C --- Place an element of layer #2
342C
343 BIGA=(YY(3)-YY(2))/(XX(3)-XX(2))
344 BIGB=(XX(3)*YY(2)-XX(2)*YY(3))/(XX(3)-XX(2))/10.
345 COEFFA=(BIGA*BIGA+1.)
346 COEFFB=(BIGA*BIGB-BIGA*YCC-XCC)
347 COEFFC=(XCC*XCC+YCC*YCC-2.*YCC*BIGB+BIGB*BIGB-0.04713*0.04713)
348 XCC1=(-COEFFB+SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
349 YCC1=BIGA*XCC1+BIGB
350 BIGA1=-1./BIGA
351 BIGB1=(XCC1/BIGA+YCC1)
352 COEFFA=(BIGA1*BIGA1+1.)
353 COEFFB=(BIGA1*BIGB1-BIGA1*YCC1-XCC1)
354 COEFFC=(XCC1*XCC1+YCC1*YCC1-2.*YCC1*BIGB1+BIGB1*BIGB1-
355 $ (DSUP(1)+DBOX2(1))*(DSUP(1)+DBOX2(1)))
356 XCC2=(-COEFFB+SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
357 YCC2=BIGA1*XCC2+BIGB1
358 XPOS1=XCC2*COS(APHI)-YCC2*SIN(APHI)+XZERO
359 YPOS1=XCC2*SIN(APHI)+YCC2*COS(APHI)+YZERO
360 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
361 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
362 ZPOS=0.
363 JBOX2=JBOX2+1
364 CALL GSPOS('IPV2',JBOX2,'IT12',XPOS,YPOS,ZPOS,IDROTM(
365 $ 1100+(I-1)*13+2),'ONLY')
366C
367C --- Place part # 3-4 (see sketch)
368C
369 OFFSET1=-27.
370 DSUP(1)=0.01
371 DSUP(2)=SQRT((XEND(3)-XBEG(3))*(XEND(3)-XBEG(3))+
372 $ (YEND(3)-YBEG(3))*(YEND(3)-YBEG(3)))/20.
373 DSUP(3)=25.
374 XCC=(XX(2)+XX(3))/20.
375 YCC=(YY(2)+YY(3))/20.
376 XCCC=(XBEG(3)+XEND(3))/20.
377 YCCC=(YBEG(3)+YEND(3))/20.
378 IF(XX(3).EQ.XX(4)) THEN
379 OFFSET2=0.
380 ELSE
381 OFFSET2=ATG(YY(4)-YY(3),XX(4)-XX(3))*RADDEG-90.
382 ENDIF
383 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
384 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
385 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
386 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
387 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
388 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
389 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
390 ZPOS=0.
391 ATHETA34=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
392 CALL SXSROT(IDROTM(1100+(I-1)*13+3),90.,ATHETA34,90.,
393 $ 90.+ATHETA34,0.,0.)
394 CALL GSPOSP('SPIX',(I-1)*13+3,'IT12',XPOS,YPOS,ZPOS,IDROTM(
395 $ 1100+(I-1)*13+3),'ONLY',DSUP,3)
396C
397C --- Place part # 4-5 (see sketch)
398C
399 OFFSET1=-27.
400 DSUP(1)=0.01
401 DSUP(2)=SQRT((XEND(4)-XBEG(4))*(XEND(4)-XBEG(4))+
402 $ (YEND(4)-YBEG(4))*(YEND(4)-YBEG(4)))/20.
403 DSUP(3)=25.
404 XCC=(XX(4)+XX(5))/20.
405 YCC=(YY(4)+YY(5))/20.
406 XCCC=(XBEG(4)+XEND(4))/20.
407 YCCC=(YBEG(4)+YEND(4))/20.
408 IF(XX(4).EQ.XX(5)) THEN
409 OFFSET2=0.
410 ELSE
411 OFFSET2=ATG(YY(5)-YY(4),XX(5)-XX(4))*RADDEG-90.
412 ENDIF
413 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
414 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
415 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
416 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
417 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
418 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
419 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
420 ZPOS=0.
421 ATHETA45=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
422 CALL SXSROT(IDROTM(1100+(I-1)*13+4),90.,ATHETA45,90.,
423 $ 90.+ATHETA45,0.,0.)
424 CALL GSPOSP('SPIX',(I-1)*13+4,'IT12',XPOS,YPOS,ZPOS,IDROTM(
425 $ 1100+(I-1)*13+4),'ONLY',DSUP,3)
426C
427C --- Place an element of layer #2
428C
429 BIGA=(YY(5)-YY(4))/(XX(5)-XX(4))
430 BIGB=(XX(5)*YY(4)-XX(4)*YY(5))/(XX(5)-XX(4))/10.
431 COEFFA=(BIGA*BIGA+1.)
432 COEFFB=(BIGA*BIGB-BIGA*YCC-XCC)
433 COEFFC=(XCC*XCC+YCC*YCC-2.*YCC*BIGB+BIGB*BIGB-0.*0.)
434 XCC1=XCCC
435 YCC1=YCCC
436 BIGA1=-1./BIGA
437 BIGB1=(XCC1/BIGA+YCC1)
438 COEFFA=(BIGA1*BIGA1+1.)
439 COEFFB=(BIGA1*BIGB1-BIGA1*YCC1-XCC1)
440 COEFFC=(XCC1*XCC1+YCC1*YCC1-2.*YCC1*BIGB1+BIGB1*BIGB1-
441 $ (DSUP(1)+DBOX2(1))*(DSUP(1)+DBOX2(1)))
442 XCC2=(-COEFFB-SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
443 YCC2=BIGA1*XCC2+BIGB1
444 XPOS1=XCC2*COS(APHI)-YCC2*SIN(APHI)+XZERO
445 YPOS1=XCC2*SIN(APHI)+YCC2*COS(APHI)+YZERO
446 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
447 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
448 ZPOS=0.
449 JBOX2=JBOX2+1
450 CALL GSPOS('IPV2',JBOX2,'IT12',XPOS,YPOS,ZPOS,IDROTM(
451 $ 1100+(I-1)*13+4),'ONLY')
452C
453C --- Place part # 5-6 (see sketch)
454C
455 OFFSET1=-27.
456 DSUP(1)=0.01
457 DSUP(2)=SQRT((XEND(5)-XBEG(5))*(XEND(5)-XBEG(5))+
458 $ (YEND(5)-YBEG(5))*(YEND(5)-YBEG(5)))/20.
459 DSUP(3)=25.
460 XCC=(XX(5)+XX(6))/20.
461 YCC=(YY(5)+YY(6))/20.
462 XCCC=(XBEG(5)+XEND(5))/20.
463 YCCC=(YBEG(5)+YEND(5))/20.
464 IF(XX(5).EQ.XX(6)) THEN
465 OFFSET2=0.
466 ELSE
467 OFFSET2=ATG(YY(6)-YY(5),XX(6)-XX(5))*RADDEG-90.
468 ENDIF
469 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
470 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
471 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
472 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
473 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
474 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
475 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
476 ZPOS=0.
477 ATHETA56=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
478 CALL SXSROT(IDROTM(1100+(I-1)*13+5),90.,ATHETA56,90.,
479 $ 90.+ATHETA56,0.,0.)
480 CALL GSPOSP('SPIX',(I-1)*13+5,'IT12',XPOS,YPOS,ZPOS,IDROTM(
481 $ 1100+(I-1)*13+5),'ONLY',DSUP,3)
482C
483C --- Place part # 6-7 (see sketch)
484C
485 OFFSET1=-27.
486 DSUP(1)=0.01
487 DSUP(2)=SQRT((XEND(6)-XBEG(6))*(XEND(6)-XBEG(6))+
488 $ (YEND(6)-YBEG(6))*(YEND(6)-YBEG(6)))/20.
489 DSUP(3)=25.
490 XCC=(XX(6)+XX(7))/20.
491 YCC=(YY(6)+YY(7))/20.
492 XCCC=(XBEG(6)+XEND(6))/20.
493 YCCC=(YBEG(6)+YEND(6))/20.
494 IF(XX(6).EQ.XX(7)) THEN
495 OFFSET2=0.
496 ELSE
497 OFFSET2=ATG(YY(7)-YY(6),XX(7)-XX(6))*RADDEG-90.
498 ENDIF
499 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
500 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
501 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
502 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
503 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
504 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
505 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
506 ZPOS=0.
507 ATHETA67=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
508 CALL SXSROT(IDROTM(1100+(I-1)*13+6),90.,ATHETA67,90.,
509 $ 90.+ATHETA67,0.,0.)
510 CALL GSPOSP('SPIX',(I-1)*13+6,'IT12',XPOS,YPOS,ZPOS,IDROTM(
511 $ 1100+(I-1)*13+6),'ONLY',DSUP,3)
512C
513C --- Place an element of layer #2
514C
515 BIGA=(YY(7)-YY(6))/(XX(7)-XX(6))
516 BIGB=(XX(7)*YY(6)-XX(6)*YY(7))/(XX(7)-XX(6))/10.
517 COEFFA=(BIGA*BIGA+1.)
518 COEFFB=(BIGA*BIGB-BIGA*YCC-XCC)
519 COEFFC=(XCC*XCC+YCC*YCC-2.*YCC*BIGB+BIGB*BIGB-0.*0.)
520 XCC1=XCCC
521 YCC1=YCCC
522 BIGA1=-1./BIGA
523 BIGB1=(XCC1/BIGA+YCC1)
524 COEFFA=(BIGA1*BIGA1+1.)
525 COEFFB=(BIGA1*BIGB1-BIGA1*YCC1-XCC1)
526 COEFFC=(XCC1*XCC1+YCC1*YCC1-2.*YCC1*BIGB1+BIGB1*BIGB1-
527 $ (DSUP(1)+DBOX2(1))*(DSUP(1)+DBOX2(1)))
528 XCC2=(-COEFFB-DSQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
529 YCC2=BIGA1*XCC2+BIGB1
530 XPOS1=XCC2*COS(APHI)-YCC2*SIN(APHI)+XZERO
531 YPOS1=XCC2*SIN(APHI)+YCC2*COS(APHI)+YZERO
532 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
533 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
534 ZPOS=0.
535 JBOX2=JBOX2+1
536 CALL GSPOS('IPV2',JBOX2,'IT12',XPOS,YPOS,ZPOS,IDROTM(
537 $ 1100+(I-1)*13+6),'ONLY')
538C
539C --- Place part # 7-8 (see sketch)
540C
541 OFFSET1=-27.
542 DSUP(1)=0.01
543 DSUP(2)=SQRT((XEND(7)-XBEG(7))*(XEND(7)-XBEG(7))+
544 $ (YEND(7)-YBEG(7))*(YEND(7)-YBEG(7)))/20.
545 DSUP(3)=25.
546 XCC=(XX(7)+XX(8))/20.
547 YCC=(YY(7)+YY(8))/20.
548 XCCC=(XBEG(7)+XEND(7))/20.
549 YCCC=(YBEG(7)+YEND(7))/20.
550 IF(XX(7).EQ.XX(8)) THEN
551 OFFSET2=0.
552 ELSE
553 OFFSET2=ATG(YY(8)-YY(7),XX(8)-XX(7))*RADDEG-90.
554 ENDIF
555 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
556 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
557 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
558 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
559 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
560 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
561 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
562 ZPOS=0.
563 ATHETA78=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
564 CALL SXSROT(IDROTM(1100+(I-1)*13+7),90.,ATHETA78,90.,
565 $ 90.+ATHETA78,0.,0.)
566 CALL GSPOSP('SPIX',(I-1)*13+7,'IT12',XPOS,YPOS,ZPOS,IDROTM(
567 $ 1100+(I-1)*13+7),'ONLY',DSUP,3)
568C
569C --- Place part # 8-9 (see sketch)
570C
571 OFFSET1=-27.
572 DSUP(1)=0.01
573 DSUP(2)=SQRT((XEND(8)-XBEG(8))*(XEND(8)-XBEG(8))+
574 $ (YEND(8)-YBEG(8))*(YEND(8)-YBEG(8)))/20.
575 DSUP(3)=25.
576 XCC=(XX(8)+XX(9))/20.
577 YCC=(YY(8)+YY(9))/20.
578 XCCC=(XBEG(8)+XEND(8))/20.
579 YCCC=(YBEG(8)+YEND(8))/20.
580 IF(XX(2).EQ.XX(3)) THEN
581 OFFSET2=0.
582 ELSE
583 OFFSET2=ATG(YY(9)-YY(8),XX(9)-XX(8))*RADDEG-90.
584 ENDIF
585 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
586 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
587 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
588 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
589 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
590 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
591 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
592 ZPOS=0.
593 ATHETA89=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
594 CALL SXSROT(IDROTM(1100+(I-1)*13+8),90.,ATHETA89,90.,
595 $ 90.+ATHETA89,0.,0.)
596 CALL GSPOSP('SPIX',(I-1)*13+8,'IT12',XPOS,YPOS,ZPOS,IDROTM(
597 $ 1100+(I-1)*13+8),'ONLY',DSUP,3)
598C
599C --- Place an element of layer #2
600C
601 BIGA=(YY(9)-YY(8))/(XX(9)-XX(8))
602 BIGB=(XX(9)*YY(8)-XX(8)*YY(9))/(XX(9)-XX(8))/10.
603 COEFFA=(BIGA*BIGA+1.)
604 COEFFB=(BIGA*BIGB-BIGA*YCC-XCC)
605 COEFFC=(XCC*XCC+YCC*YCC-2.*YCC*BIGB+BIGB*BIGB-0.23564*0.23564)
606 XCC1=(-COEFFB-SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
607 YCC1=BIGA*XCC1+BIGB
608 BIGA1=-1./BIGA
609 BIGB1=(XCC1/BIGA+YCC1)
610 COEFFA=(BIGA1*BIGA1+1.)
611 COEFFB=(BIGA1*BIGB1-BIGA1*YCC1-XCC1)
612 COEFFC=(XCC1*XCC1+YCC1*YCC1-2.*YCC1*BIGB1+BIGB1*BIGB1-
613 $ (DSUP(1)+DBOX2(1))*(DSUP(1)+DBOX2(1)))
614 XCC2=(-COEFFB-SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
615 YCC2=BIGA1*XCC2+BIGB1
616 XPOS1=XCC2*COS(APHI)-YCC2*SIN(APHI)+XZERO
617 YPOS1=XCC2*SIN(APHI)+YCC2*COS(APHI)+YZERO
618 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
619 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
620 ZPOS=0.
621 JBOX2=JBOX2+1
622 CALL GSPOS('IPV2',JBOX2,'IT12',XPOS,YPOS,ZPOS,IDROTM(
623 $ 1100+(I-1)*13+8),'ONLY')
624C
625C --- Place part # 9-10 (see sketch)
626C
627 OFFSET1=-27.
628 DSUP(1)=0.01
629 DSUP(2)=SQRT((XEND(9)-XBEG(9))*(XEND(9)-XBEG(9))+
630 $ (YEND(9)-YBEG(9))*(YEND(9)-YBEG(9)))/20.
631 DSUP(3)=25.
632 XCC=(XX(9)+XX(10))/20.
633 YCC=(YY(9)+YY(10))/20.
634 XCCC=(XBEG(9)+XEND(9))/20.
635 YCCC=(YBEG(9)+YEND(9))/20.
636 IF(XX(9).EQ.XX(10)) THEN
637 OFFSET2=0.
638 ELSE
639 OFFSET2=ATG(YY(10)-YY(9),XX(10)-XX(9))*RADDEG-90.
640 ENDIF
641 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
642 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
643 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
644 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
645 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
646 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
647 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
648 ZPOS=0.
649 ATHETA910=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
650 CALL SXSROT(IDROTM(1100+(I-1)*13+9),90.,ATHETA910,90.,
651 $ 90.+ATHETA910,0.,0.)
652 CALL GSPOSP('SPIX',(I-1)*13+9,'IT12',XPOS,YPOS,ZPOS,IDROTM(
653 $ 1100+(I-1)*13+9),'ONLY',DSUP,3)
654C
655C --- Place part # 12-13 (see sketch)
656C
657 OFFSET1=-27.
658 DSUP(1)=0.01
659 DSUP(2)=SQRT((XEND(12)-XBEG(12))*(XEND(12)-XBEG(12))+
660 $ (YEND(12)-YBEG(12))*(YEND(12)-YBEG(12)))/20.
661 DSUP(3)=25.
662 XCC=(XX(12)+XX(13))/20.
663 YCC=(YY(12)+YY(13))/20.
664 XCCC=(XBEG(12)+XEND(12))/20.
665 YCCC=(YBEG(12)+YEND(12))/20.
666 IF(XX(12).EQ.XX(13)) THEN
667 OFFSET2=0.
668 ELSE
669 OFFSET2=ATG(YY(13)-YY(12),XX(13)-XX(12))*RADDEG-90.
670 ENDIF
671 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
672 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
673 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
674 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
675 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
676 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
677 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
678 ZPOS=0.
679 ATHETA1213=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
680 CALL SXSROT(IDROTM(1100+(I-1)*13+12),270.,ATHETA1213,90.,
681 $ 270.+ATHETA1213,0.,0.)
682 CALL GSPOSP('SPIX',(I-1)*13+12,'IT12',XPOS,YPOS,ZPOS,IDROTM(
683 $ 1100+(I-1)*13+12),'ONLY',DSUP,3)
684C
685C --- Place an element of layer #1
686C
687 BIGA=(YY(13)-YY(12))/(XX(13)-XX(12))
688 BIGB=(XX(13)*YY(12)-XX(12)*YY(13))/(XX(13)-XX(12))/10.
689 COEFFA=(BIGA*BIGA+1.)
690 COEFFB=(BIGA*BIGB-BIGA*YCC-XCC)
691 COEFFC=(XCC*XCC+YCC*YCC-2.*YCC*BIGB+BIGB*BIGB-0.12567*0.12567)
692 XCC1=(-COEFFB+SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
693 YCC1=BIGA*XCC1+BIGB
694 BIGA1=-1./BIGA
695 BIGB1=(XCC1/BIGA+YCC1)
696 COEFFA=(BIGA1*BIGA1+1.)
697 COEFFB=(BIGA1*BIGB1-BIGA1*YCC1-XCC1)
698 COEFFC=(XCC1*XCC1+YCC1*YCC1-2.*YCC1*BIGB1+BIGB1*BIGB1-
699 $ (DSUP(1)+DBOX1(1))*(DSUP(1)+DBOX1(1)))
700 XCC2=(-COEFFB+SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
701 YCC2=BIGA1*XCC2+BIGB1
702 XPOS1=XCC2*COS(APHI)-YCC2*SIN(APHI)+XZERO
703 YPOS1=XCC2*SIN(APHI)+YCC2*COS(APHI)+YZERO
704 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
705 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
706 ZPOS=0.
707 JBOX1=JBOX1+1
708 CALL GSPOS('IPV1',JBOX1,'IT12',XPOS,YPOS,ZPOS,IDROTM(
709 $ 1100+(I-1)*13+12),'ONLY')
710C
711C --- Place part # 11-12 (see sketch)
712C
713 OFFSET1=-27.
714 DSUP(1)=0.01
715 DSUP(2)=SQRT((XEND(11)-XBEG(11))*(XEND(11)-XBEG(11))+
716 $ (YEND(11)-YBEG(11))*(YEND(11)-YBEG(11)))/20.
717 DSUP(3)=25.
718 XCC=(XX(11)+XX(12))/20.
719 YCC=(YY(11)+YY(12))/20.
720 XCCC=(XBEG(11)+XEND(11))/20.
721 YCCC=(YBEG(11)+YEND(11))/20.
722 IF(XX(11).EQ.XX(12)) THEN
723 OFFSET2=0.
724 ELSE
725 OFFSET2=ATG(YY(12)-YY(11),XX(12)-XX(11))*RADDEG-90.
726 ENDIF
727 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
728 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
729 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
730 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
731 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
732 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
733 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
734 ZPOS=0.
735 ATHETA1112=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
736 CALL SXSROT(IDROTM(1100+(I-1)*13+11),90.,ATHETA1112,90.,
737 $ 90.+ATHETA1112,0.,0.)
738 CALL GSPOSP('SPIX',(I-1)*13+11,'IT12',XPOS,YPOS,ZPOS,IDROTM(
739 $ 1100+(I-1)*13+11),'ONLY',DSUP,3)
740C
741C --- Place part # 10-11 (see sketch)
742C
743 OFFSET1=-27.
744 DSUP(1)=0.01
745 DSUP(2)=SQRT((XEND(10)-XBEG(10))*(XEND(10)-XBEG(10))+
746 $ (YEND(10)-YBEG(10))*(YEND(10)-YBEG(10)))/20.
747 DSUP(3)=25.
748 XCC=(XX(10)+XX(11))/20.
749 YCC=(YY(10)+YY(11))/20.
750 XCCC=(XBEG(10)+XEND(10))/20.
751 YCCC=(YBEG(10)+YEND(10))/20.
752 IF(XX(10).EQ.XX(11)) THEN
753 OFFSET2=0.
754 ELSE
755 OFFSET2=ATG(YY(11)-YY(10),XX(11)-XX(10))*RADDEG-90.
756 ENDIF
757 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
758 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
759 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
760 XPOS1=XCCC*COS(APHI)-YCCC*SIN(APHI)+XZERO
761 YPOS1=XCCC*SIN(APHI)+YCCC*COS(APHI)+YZERO
762 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
763 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
764 ZPOS=0.
765 ATHETA1011=FLOAT(I-1)*36.+OFFSET1+OFFSET2-GTETA
766 CALL SXSROT(IDROTM(1100+(I-1)*13+10),270.,ATHETA1011,90.,
767 $ 270.+ATHETA1011,0.,0.)
768 CALL GSPOSP('SPIX',(I-1)*13+10,'IT12',XPOS,YPOS,ZPOS,IDROTM(
769 $ 1100+(I-1)*13+10),'ONLY',DSUP,3)
770C
771C --- Place an element of layer #1
772C
773 BIGA=(YY(11)-YY(10))/(XX(11)-XX(10))
774 BIGB=(XX(11)*YY(10)-XX(10)*YY(11))/(XX(11)-XX(10))/10.
775 COEFFA=(BIGA*BIGA+1.)
776 COEFFB=(BIGA*BIGB-BIGA*YCC-XCC)
777 COEFFC=(XCC*XCC+YCC*YCC-2.*YCC*BIGB+BIGB*BIGB-0.001*0.001)
778 XCC1=(-COEFFB-SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
779 YCC1=BIGA*XCC1+BIGB
780 BIGA1=-1./BIGA
781 BIGB1=(XCC1/BIGA+YCC1)
782 COEFFA=(BIGA1*BIGA1+1.)
783 COEFFB=(BIGA1*BIGB1-BIGA1*YCC1-XCC1)
784 COEFFC=(XCC1*XCC1+YCC1*YCC1-2.*YCC1*BIGB1+BIGB1*BIGB1-
785 $ (DSUP(1)+DBOX1(1))*(DSUP(1)+DBOX1(1)))
786 XCC2=(-COEFFB+SQRT(COEFFB*COEFFB-COEFFA*COEFFC))/COEFFA
787 YCC2=BIGA1*XCC2+BIGB1
788 XPOS1=XCC2*COS(APHI)-YCC2*SIN(APHI)+XZERO
789 YPOS1=XCC2*SIN(APHI)+YCC2*COS(APHI)+YZERO
790 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
791 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
792 ZPOS=0.
793 JBOX1=JBOX1+1
794 CALL GSPOS('IPV1',JBOX1,'IT12',XPOS,YPOS,ZPOS,IDROTM(
795 $ 1100+(I-1)*13+10),'ONLY')
796C
797C --- Place arc # 5 (between part 1-2 and part 2-3) (see sketch)
798C
799 DARC(1)=RARC(5)/10.-0.02
800 DARC(2)=RARC(5)/10.
801 DARC(3)=25.
802 DARC(4)=ATHETA12+90.-FLOAT(I-1)*(360./10.)
803 DARC(5)=ATHETA23+90.-FLOAT(I-1)*(360./10.)
804 XCC=XARC(5)/10.
805 YCC=YARC(5)/10.
806 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
807 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
808 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
809 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
810 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
811 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
812 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
813 ZPOS=0.
814 CALL GSPOSP('SARC',(I-1)*13+5,'IT12',XPOS,YPOS,ZPOS,IDROTM(
815 $ 1100+(I-1)*13+5),'ONLY',DARC,5)
816C
817C --- Place arc # 6 (between part 2-3 and part 3-4) (see sketch)
818C
819 DARC(1)=RARC(6)/10.-0.02
820 DARC(2)=RARC(6)/10.
821 DARC(3)=25.
822 DARC(4)=ATHETA23-FLOAT(I-1)*(360./10.)
823 DARC(5)=ATHETA34-FLOAT(I-1)*(360./10.)
824 XCC=XARC(6)/10.
825 YCC=YARC(6)/10.
826 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
827 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
828 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
829 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
830 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
831 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
832 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
833 ZPOS=0.
834 CALL GSPOSP('SARC',(I-1)*13+6,'IT12',XPOS,YPOS,ZPOS,IDROTM(
835 $ 1100+(I-1)*13+6),'ONLY',DARC,5)
836C
837C --- Place arc # 7 (between part 3-4 and part 4-5) (see sketch)
838C
839 DARC(1)=RARC(7)/10.-0.02
840 DARC(2)=RARC(7)/10.
841 DARC(3)=25.
842 DARC(4)=ATHETA45+90.-FLOAT(I-1)*(360./10.)
843 DARC(5)=ATHETA34+90.-FLOAT(I-1)*(360./10.)
844 XCC=XARC(7)/10.
845 YCC=YARC(7)/10.
846 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
847 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
848 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
849 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
850 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
851 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
852 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
853 ZPOS=0.
854 CALL GSPOSP('SARC',(I-1)*13+7,'IT12',XPOS,YPOS,ZPOS,IDROTM(
855 $ 1100+(I-1)*13+7),'ONLY',DARC,5)
856C
857C --- Place arc # 8 (between part 4-5 and part 5-6) (see sketch)
858C
859 DARC(1)=RARC(8)/10.-0.02
860 DARC(2)=RARC(8)/10.
861 DARC(3)=25.
862 DARC(4)=ATHETA56+180.-FLOAT(I-1)*(360./10.)
863 DARC(5)=ATHETA45+180.-FLOAT(I-1)*(360./10.)
864 XCC=XARC(8)/10.
865 YCC=YARC(8)/10.
866 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
867 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
868 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
869 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
870 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
871 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
872 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
873 ZPOS=0.
874 CALL GSPOSP('SARC',(I-1)*13+8,'IT12',XPOS,YPOS,ZPOS,IDROTM(
875 $ 1100+(I-1)*13+8),'ONLY',DARC,5)
876C
877C --- Place arc # 9 (between part 5-6 and part 6-7) (see sketch)
878C
879 DARC(1)=RARC(9)/10.-0.02
880 DARC(2)=RARC(9)/10.
881 DARC(3)=25.
882 DARC(4)=ATHETA56-90.-FLOAT(I-1)*(360./10.)
883 DARC(5)=ATHETA67-90.-FLOAT(I-1)*(360./10.)
884 XCC=XARC(9)/10.
885 YCC=YARC(9)/10.
886 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
887 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
888 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
889 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
890 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
891 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
892 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
893 ZPOS=0.
894 CALL GSPOSP('SARC',(I-1)*13+9,'IT12',XPOS,YPOS,ZPOS,IDROTM(
895 $ 1100+(I-1)*13+9),'ONLY',DARC,5)
896C
897C --- Place arc # 10 (between part 6-7 and part 7-8) (see sketch)
898C
899 DARC(1)=RARC(10)/10.-0.02
900 DARC(2)=RARC(10)/10.
901 DARC(3)=25.
902 DARC(4)=ATHETA67-FLOAT(I-1)*(360./10.)
903 DARC(5)=ATHETA78-FLOAT(I-1)*(360./10.)
904 XCC=XARC(10)/10.
905 YCC=YARC(10)/10.
906 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
907 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
908 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
909 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
910 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
911 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
912 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
913 ZPOS=0.
914 CALL GSPOSP('SARC',(I-1)*13+10,'IT12',XPOS,YPOS,ZPOS,IDROTM(
915 $ 1100+(I-1)*13+10),'ONLY',DARC,5)
916C
917C --- Place arc # 11 (between part 7-8 and part 8-9) (see sketch)
918C
919 DARC(1)=RARC(11)/10.-0.02
920 DARC(2)=RARC(11)/10.
921 DARC(3)=25.
922 DARC(4)=ATHETA89-90.-FLOAT(I-1)*(360./10.)
923 DARC(5)=ATHETA78-90.-FLOAT(I-1)*(360./10.)
924 XCC=XARC(11)/10.
925 YCC=YARC(11)/10.
926 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
927 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
928 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
929 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
930 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
931 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
932 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
933 ZPOS=0.
934 CALL GSPOSP('SARC',(I-1)*13+11,'IT12',XPOS,YPOS,ZPOS,IDROTM(
935 $ 1100+(I-1)*13+11),'ONLY',DARC,5)
936C
937C --- Place arc # 12 (between part 8-9 and part 9-10) (see sketch)
938C
939 DARC(1)=RARC(12)/10.-0.02
940 DARC(2)=RARC(12)/10.
941 DARC(3)=25.
942 DARC(4)=ATHETA89-FLOAT(I-1)*(360./10.)
943 DARC(5)=ATHETA910-FLOAT(I-1)*(360./10.)
944 XCC=XARC(12)/10.
945 YCC=YARC(12)/10.
946 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
947 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
948 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
949 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
950 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
951 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
952 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
953 ZPOS=0.
954 CALL GSPOSP('SARC',(I-1)*13+12,'IT12',XPOS,YPOS,ZPOS,IDROTM(
955 $ 1100+(I-1)*13+12),'ONLY',DARC,5)
956C
957C --- Place arc # 1 (between part 9-10 and part 10-11) (see sketch)
958C
959 DARC(1)=RARC(1)/10.-0.02
960 DARC(2)=RARC(1)/10.
961 DARC(3)=25.
962 DARC(4)=ATHETA1011+10.-FLOAT(I-1)*(360./10.)
963 DARC(5)=ATHETA910-120.-FLOAT(I-1)*(360./10.)
964 XCC=XARC(1)/10.
965 YCC=YARC(1)/10.
966 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
967 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
968 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
969 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
970 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
971 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
972 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
973 ZPOS=0.
974 CALL GSPOSP('SARC',(I-1)*13+1,'IT12',XPOS,YPOS,ZPOS,IDROTM(
975 $ 1100+(I-1)*13+1),'ONLY',DARC,5)
976C
977C --- Place arc # 2 (between part 10-11 and part 11-12) (see sketch)
978C
979 DARC(1)=RARC(2)/10.-0.02
980 DARC(2)=RARC(2)/10.
981 DARC(3)=25.
982 DARC(4)=ATHETA1011-FLOAT(I-1)*(360./10.)
983 DARC(5)=ATHETA1112+45.-FLOAT(I-1)*(360./10.)
984 XCC=XARC(2)/10.
985 YCC=YARC(2)/10.
986 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
987 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
988 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
989 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
990 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
991 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
992 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
993 ZPOS=0.
994 CALL GSPOSP('SARC',(I-1)*13+2,'IT12',XPOS,YPOS,ZPOS,IDROTM(
995 $ 1100+(I-1)*13+2),'ONLY',DARC,5)
996C
997C --- Place arc # 3 (between part 11-12 and part 12-13) (see sketch)
998C
999 DARC(1)=RARC(3)/10.-0.02
1000 DARC(2)=RARC(3)/10.
1001 DARC(3)=25.
1002 DARC(4)=ATHETA1213+115.-FLOAT(I-1)*(360./10.)
1003 DARC(5)=ATHETA1112+115.-FLOAT(I-1)*(360./10.)
1004 XCC=XARC(3)/10.
1005 YCC=YARC(3)/10.
1006 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
1007 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
1008 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
1009 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
1010 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
1011 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
1012 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
1013 ZPOS=0.
1014 CALL GSPOSP('SARC',(I-1)*13+3,'IT12',XPOS,YPOS,ZPOS,IDROTM(
1015 $ 1100+(I-1)*13+3),'ONLY',DARC,5)
1016C
1017C --- Place arc # 4 (between part 12-13 and part 1-2) (see sketch)
1018C
1019 DARC(1)=RARC(4)/10.-0.02
1020 DARC(2)=RARC(4)/10.
1021 DARC(3)=25.
1022 DARC(4)=ATHETA1213-FLOAT(I-1)*(360./10.)
1023 DARC(5)=ATHETA12-FLOAT(I-1)*(360./10.)
1024 XCC=XARC(4)/10.
1025 YCC=YARC(4)/10.
1026 APHI=(PPHI+FLOAT(I-1)*36.)*DEGRAD
1027 XZERO=RR*COS((TTETA+FLOAT(I-1)*36.)*DEGRAD)
1028 YZERO=RR*SIN((TTETA+FLOAT(I-1)*36.)*DEGRAD)
1029 XPOS1=XCC*COS(APHI)-YCC*SIN(APHI)+XZERO
1030 YPOS1=XCC*SIN(APHI)+YCC*COS(APHI)+YZERO
1031 XPOS=XPOS1*COS(GTETA*DEGRAD)+YPOS1*SIN(GTETA*DEGRAD)
1032 YPOS=-XPOS1*SIN(GTETA*DEGRAD)+YPOS1*COS(GTETA*DEGRAD)
1033 ZPOS=0.
1034 CALL GSPOSP('SARC',(I-1)*13+4,'IT12',XPOS,YPOS,ZPOS,IDROTM(
1035 $ 1100+(I-1)*13+4),'ONLY',DARC,5)
1036C
1037 END DO
10382345 CONTINUE
1039C
1040C ************************************************************************
1041C * *
1042C * D R I F T S *
1043C * =========== *
1044C * *
1045C ************************************************************************
1046C
1047C --- Define a ghost volume containing the Silicon Drift Detectors
1048C (layer #3 and #4) and fill it with air or vacuum
1049C
1050 XXM=(49.999-3.)/(70.-25.)
1051 DGH(1)=0.
1052 DGH(2)=360.
1053 DGH(3)=4.
1054 DGH(4)=-25.-(9.-3.01)/XXM-(9.01-9.)/XXM-(27.-9.01)/XXM
1055 DGH(5)=27.
1056 DGH(6)=27.
1057 DGH(7)=-25.-(9.-3.01)/XXM-(9.01-9.)/XXM
1058 DGH(8)=9.01
1059 DGH(9)=27.
1060 DGH(10)=25.+(9.-3.01)/XXM+(9.01-9.)/XXM
1061 DGH(11)=9.01
1062 DGH(12)=27.
1063 DGH(13)=25.+(9.-3.01)/XXM+(9.01-9.)/XXM+(27.-9.01)/XXM
1064 DGH(14)=27.
1065 DGH(15)=27.
1066 CALL GSVOLU('IT34','PCON',IDTMED(276),DGH,15,IOUT)
1067C
1068C --- Place the ghost volume in its mother volume (ITSV) and make it
1069C invisible
1070C
1071 CALL GSPOS('IT34',1,'ITSV',0.,0.,0.,0,'ONLY')
1072 CALL GSATT('IT34','SEEN',0)
1073C
1074C --- Layer #3
1075C
1076C GOTO 3456 ! skip ITS layer no. 3
1077C
1078C --- Define a ghost volume containing a single ladder of layer #3 (with the
1079C smaller lenght of ribs) and fill it with air or vacuum
1080C
1081 DBOX1(1)=0.5+(0.0172+0.03+0.0252+0.04+0.003)
1082 DBOX1(2)=3.85 ! the widest element is the sensitive element
1083 DBOX1(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1084 CALL GSVOLU('IDV1','BOX ',IDTMED(229),DBOX1,3,IOUT)
1085C
1086C --- Make the ghost volume invisible
1087C
1088 CALL GSATT('IDV1','SEEN',0)
1089C
1090C --- Define a volume containing the sensitive part of drifts
1091C (silicon, layer #3)
1092C
1093 DITS(1)=0.0172 ! see material budget report by G. Feofilov
1094 DITS(2)=3.85
1095 DITS(3)=4.35
1096 CALL GSVOLU('ITS3','BOX ',IDTMED(225),DITS,3,IOUT)
1097C
1098C --- Define the part of the (smaller) rib between two sensitive parts made of
1099C carbon (layer #3)
1100C
1101 DSUP(1)=0.5-DITS(1)
1102 DSUP(2)=0.01
1103 DSUP(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1104 CALL GSVOLU('IR11','BOX ',IDTMED(228),DSUP,3,IOUT)
1105C
1106C --- Define the first part of the (smaller) rib between two sensitive parts
1107C made of aluminum (layer #3)
1108C
1109 DAL1(1)=0.5-DITS(1)
1110 DAL1(2)=0.00096/2.
1111 DAL1(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1112 CALL GSVOLU('IR12','BOX ',IDTMED(231),DAL1,3,IOUT)
1113C
1114C --- Define the part of the (smaller) rib between two sensitive parts made of
1115C kapton (layer #3)
1116C
1117 DKAP(1)=0.5-DITS(1)
1118 DKAP(2)=0.0317/2.
1119 DKAP(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1120 CALL GSVOLU('IR13','BOX ',IDTMED(237),DKAP,3,IOUT)
1121C
1122C --- Define the second part of the (smaller) rib between two sensitive parts
1123C made of aluminum (layer #3)
1124C
1125 DAL2(1)=0.5-DITS(1)
1126 DAL2(2)=0.0027/2.
1127 DAL2(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1128 CALL GSVOLU('IR14','BOX ',IDTMED(231),DAL2,3,IOUT)
1129C
1130C --- Define the part of the (smaller) rib between two sensitive parts
1131C made of silicon (the electronics) (layer #3)
1132C
1133 DCHI(1)=0.5-DITS(1)
1134 DCHI(2)=0.0071/2.
1135 DCHI(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1136 CALL GSVOLU('IR15','BOX ',IDTMED(226),DAL2,3,IOUT)
1137C
1138C --- Define the part of the (smaller) rib between two sensitive parts
1139C made of water (the cooler) (layer #3)
1140C
1141 DWAT(1)=0.5-DITS(1)
1142 DWAT(2)=0.0093/2.
1143 DWAT(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1144 CALL GSVOLU('IR16','BOX ',IDTMED(232),DWAT,3,IOUT)
1145C
1146C --- Define the third part of the (smaller) rib between two sensitive parts
1147C made of aluminum (the cooling tubes) (layer #3)
1148C
1149 DTUB(1)=0.5-DITS(1)
1150 DTUB(2)=0.00134/2.
1151 DTUB(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1152 CALL GSVOLU('IR17','BOX ',IDTMED(231),DTUB,3,IOUT)
1153C
1154C --- Define the part of the end-ladder stuff made of PCB (layer #3)
1155C
1156 DPCB(1)=0.03 ! twice the foreseen thickness
1157 DPCB(2)=3.5
1158 DPCB(3)=7.5
1159 CALL GSVOLU('IEL1','BOX ',IDTMED(234),DPCB,3,IOUT)
1160C
1161C --- Define the part of the end-ladder stuff made of copper (layer #3)
1162C
1163 DCOP(1)=0.0252 ! twice the foreseen thickness
1164 DCOP(2)=3.5
1165 DCOP(3)=7.5
1166 CALL GSVOLU('IEL2','BOX ',IDTMED(235),DCOP,3,IOUT)
1167C
1168C --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1169C
1170 DCER(1)=0.04 ! twice the foreseen thickness
1171 DCER(2)=3.5
1172 DCER(3)=7.5
1173 CALL GSVOLU('IEL3','BOX ',IDTMED(236),DCER,3,IOUT)
1174C
1175C --- Define the part of the end-ladder stuff made of silicon (layer #3)
1176C
1177 DSIL(1)=0.003 ! twice the foreseen thickness
1178 DSIL(2)=3.5
1179 DSIL(3)=7.5
1180 CALL GSVOLU('IEL4','BOX ',IDTMED(227),DSIL,3,IOUT)
1181C
1182C --- Place the sensitive part of the drifts (smaller ribs) into its mother
1183C (IDV1)
1184C
1185 YPOS=0.
1186 DO J=1,5 ! odd elements are up and even elements are down
1187 IF(J.EQ.1) THEN
1188 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1189 $ DITS(1)
1190 ZPOS=0.-DITS(3)+1.-2.*DITS(3)-0.1-DITS(3)
1191 ELSE IF(J.EQ.2) THEN
1192 XPOS=-DBOX1(1)+DITS(1)
1193 ZPOS=0.-DITS(3)+1.-DITS(3)
1194 ELSE IF(J.EQ.3) THEN
1195 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1196 $ DITS(1)
1197 ZPOS=0.
1198 ELSE IF(J.EQ.4) THEN
1199 XPOS=-DBOX1(1)+DITS(1)
1200 ZPOS=0.+DITS(3)-1.+DITS(3)
1201 ELSE IF(J.EQ.5) THEN
1202 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1203 $ DITS(1)
1204 ZPOS=0.+DITS(3)-1.+2.*DITS(3)+0.1+DITS(3)
1205 ENDIF
1206 CALL GSPOS('ITS3',J,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1207 END DO
1208C
1209C --- Place the smaller ribs into their mother (IDV1)
1210C
1211C --- Right ribs (just a matter of convention)
1212C
1213 XPOS=0.5-DBOX1(1)+DITS(1)
1214 ZPOS=0.
1215C
1216C --- Carbon
1217C
1218 YPOS=2.81
1219 CALL GSPOS('IR11',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1220C
1221C --- Aluminum #1
1222C
1223 YPOS=2.81+DSUP(2)+DAL1(2)
1224 CALL GSPOS('IR12',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1225C
1226C --- Kapton
1227C
1228 YPOS=2.81+DSUP(2)+2.*DAL1(2)+DKAP(2)
1229 CALL GSPOS('IR13',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1230C
1231C --- Aluminum #2
1232C
1233 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2)
1234 CALL GSPOS('IR14',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1235C
1236C --- Silicon (chip)
1237C
1238 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2)
1239 CALL GSPOS('IR15',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1240C
1241C --- Water
1242C
1243 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1244 $DWAT(2)
1245 CALL GSPOS('IR16',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1246C
1247C --- Aluminum #3
1248C
1249 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1250 $2.*DWAT(2)+DTUB(2)
1251 CALL GSPOS('IR17',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1252C
1253C --- Right ribs (just a matter of convention)
1254C
1255C --- Carbon
1256C
1257 YPOS=-2.81
1258 CALL GSPOS('IR11',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1259C
1260C --- Aluminum #1
1261C
1262 YPOS=-(2.81+DSUP(2)+DAL1(2))
1263 CALL GSPOS('IR12',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1264C
1265C --- Kapton
1266C
1267 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+DKAP(2))
1268 CALL GSPOS('IR13',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1269C
1270C --- Aluminum #2
1271C
1272 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2))
1273 CALL GSPOS('IR14',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1274C
1275C --- Silicon (chip)
1276C
1277 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2))
1278 CALL GSPOS('IR15',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1279C
1280C --- Water
1281C
1282 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1283 $DWAT(2))
1284 CALL GSPOS('IR16',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1285C
1286C --- Aluminum #3
1287C
1288 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1289 $2.*DWAT(2)+DTUB(2))
1290 CALL GSPOS('IR17',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1291C
1292C --- Place the end-ladder stuff into its mother (IDV1)
1293C
1294C
1295C --- Negative-Z end-ladder
1296C
1297 YPOS=0.
1298 ZPOS=-(8.7*5.-2.*1.+2.*0.1)/2.-7.5
1299C
1300C --- PCB
1301C
1302 XPOS=DBOX1(1)-DPCB(1)
1303 CALL GSPOS('IEL1',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1304C
1305C --- Copper
1306C
1307 XPOS=DBOX1(1)-2.*DPCB(1)-DCOP(1)
1308 CALL GSPOS('IEL2',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1309C
1310C --- Ceramics
1311C
1312 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
1313 CALL GSPOS('IEL3',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1314C
1315C --- Silicon (bus)
1316C
1317 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
1318 CALL GSPOS('IEL4',1,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1319C
1320C --- Positive-Z end-ladder
1321C
1322 YPOS=0.
1323 ZPOS=(8.7*5.-2.*1.+2.*0.1)/2.+7.5
1324C
1325C --- PCB
1326C
1327 XPOS=DBOX1(1)-DPCB(1)
1328 CALL GSPOS('IEL1',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1329C
1330C --- Copper
1331C
1332 XPOS=DBOX1(1)-2.*DPCB(1)-DCOP(1)
1333 CALL GSPOS('IEL2',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1334C
1335C --- Ceramics
1336C
1337 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
1338 CALL GSPOS('IEL3',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1339C
1340C --- Silicon (bus)
1341C
1342 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
1343 CALL GSPOS('IEL4',2,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1344C
1345C --- Define a ghost volume containing a single ladder of layer #3 (with the
1346C larger lenght of ribs) and fill it with air or vacuum
1347C
1348 DBOX2(1)=0.65+(0.0172+0.03+0.0252+0.04+0.003)
1349 DBOX2(2)=3.85 ! the widest element is the sensitive element
1350 DBOX2(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1351 CALL GSVOLU('IDV2','BOX ',IDTMED(229),DBOX2,3,IOUT)
1352C
1353C --- Make the ghost volume invisible
1354C
1355 CALL GSATT('IDV2','SEEN',0)
1356C
1357C --- Define the part of the (larger) rib between two sensitive parts made of
1358C carbon (layer #3)
1359C
1360 DSUP(1)=0.65-DITS(1)
1361 DSUP(2)=0.01
1362 DSUP(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1363 CALL GSVOLU('IR21','BOX ',IDTMED(228),DSUP,3,IOUT)
1364C
1365C --- Define the first part of the (larger) rib between two sensitive parts
1366C made of aluminum (layer #3)
1367C
1368 DAL1(1)=0.65-DITS(1)
1369 DAL1(2)=0.00096/2.
1370 DAL1(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1371 CALL GSVOLU('IR22','BOX ',IDTMED(231),DAL1,3,IOUT)
1372C
1373C --- Define the part of the (larger) rib between two sensitive parts made of
1374C kapton (layer #3)
1375C
1376 DKAP(1)=0.65-DITS(1)
1377 DKAP(2)=0.0317/2.
1378 DKAP(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1379 CALL GSVOLU('IR23','BOX ',IDTMED(237),DKAP,3,IOUT)
1380C
1381C --- Define the second part of the (larger) rib between two sensitive parts
1382C made of aluminum (layer #3)
1383C
1384 DAL2(1)=0.65-DITS(1)
1385 DAL2(2)=0.0027/2.
1386 DAL2(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1387 CALL GSVOLU('IR24','BOX ',IDTMED(231),DAL2,3,IOUT)
1388C
1389C --- Define the part of the (larger) rib between two sensitive parts
1390C made of silicon (the electronics) (layer #3)
1391C
1392 DCHI(1)=0.65-DITS(1)
1393 DCHI(2)=0.0071/2.
1394 DCHI(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1395 CALL GSVOLU('IR25','BOX ',IDTMED(226),DAL2,3,IOUT)
1396C
1397C --- Define the part of the (larger) rib between two sensitive parts
1398C made of water (the cooler) (layer #3)
1399C
1400 DWAT(1)=0.65-DITS(1)
1401 DWAT(2)=0.0093/2.
1402 DWAT(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1403 CALL GSVOLU('IR26','BOX ',IDTMED(232),DWAT,3,IOUT)
1404C
1405C --- Define the third part of the (larger) rib between two sensitive parts
1406C made of aluminum (the cooling tubes) (layer #3)
1407C
1408 DTUB(1)=0.65-DITS(1)
1409 DTUB(2)=0.00134/2.
1410 DTUB(3)=(8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1411 CALL GSVOLU('IR27','BOX ',IDTMED(231),DTUB,3,IOUT)
1412C
1413C --- Place the sensitive part of the drifts (smaller ribs) into its mother
1414C (IDV2)
1415C
1416 YPOS=0.
1417 DO J=1,5 ! odd element are up and even elements are down
1418 IF(J.EQ.1) THEN
1419 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1420 $ DITS(1)
1421 ZPOS=0.-DITS(3)+1.-2.*DITS(3)-0.1-DITS(3)
1422 ELSE IF(J.EQ.2) THEN
1423 XPOS=-DBOX2(1)+DITS(1)
1424 ZPOS=0.-DITS(3)+1.-DITS(3)
1425 ELSE IF(J.EQ.3) THEN
1426 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1427 $ DITS(1)
1428 ZPOS=0.
1429 ELSE IF(J.EQ.4) THEN
1430 XPOS=-DBOX2(1)+DITS(1)
1431 ZPOS=0.+DITS(3)-1.+DITS(3)
1432 ELSE IF(J.EQ.5) THEN
1433 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1434 $ DITS(1)
1435 ZPOS=0.+DITS(3)-1.+2.*DITS(3)+0.1+DITS(3)
1436 ENDIF
1437 CALL GSPOS('ITS3',J,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1438 END DO
1439C
1440C --- Place the larger ribs into their mother (IDV2)
1441C
1442C
1443C --- Right ribs (just a matter of convention)
1444C
1445 XPOS=0.65-DBOX2(1)+DITS(1)
1446 ZPOS=0.
1447C
1448C --- Carbon
1449C
1450 YPOS=2.81
1451 CALL GSPOS('IR21',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1452C
1453C --- Aluminum #1
1454C
1455 YPOS=2.81+DSUP(2)+DAL1(2)
1456 CALL GSPOS('IR22',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1457C
1458C --- Kapton
1459C
1460 YPOS=2.81+DSUP(2)+2.*DAL1(2)+DKAP(2)
1461 CALL GSPOS('IR23',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1462C
1463C --- Aluminum #2
1464C
1465 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2)
1466 CALL GSPOS('IR24',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1467C
1468C --- Silicon (chip)
1469C
1470 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2)
1471 CALL GSPOS('IR25',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1472C
1473C --- Water
1474C
1475 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1476 $DWAT(2)
1477 CALL GSPOS('IR26',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1478C
1479C --- Aluminum #3
1480C
1481 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1482 $2.*DWAT(2)+DTUB(2)
1483 CALL GSPOS('IR27',1,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1484C
1485C --- Right ribs (just a matter of convention)
1486C
1487C --- Carbon
1488C
1489 YPOS=-2.81
1490 CALL GSPOS('IR21',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1491C
1492C --- Aluminum #1
1493C
1494 YPOS=-(2.81+DSUP(2)+DAL1(2))
1495 CALL GSPOS('IR22',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1496C
1497C --- Kapton
1498C
1499 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+DKAP(2))
1500 CALL GSPOS('IR23',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1501C
1502C --- Aluminum #2
1503C
1504 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2))
1505 CALL GSPOS('IR24',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1506C
1507C --- Silicon (chip)
1508C
1509 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2))
1510 CALL GSPOS('IR25',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1511C
1512C --- Water
1513C
1514 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1515 $DWAT(2))
1516 CALL GSPOS('IR26',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1517C
1518C --- Aluminum #3
1519C
1520 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1521 $2.*DWAT(2)+DTUB(2))
1522 CALL GSPOS('IR27',2,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1523C
1524C --- Place the end-ladder stuff into its mother (IDV1)
1525C
1526C
1527C --- Negative-Z end-ladder
1528C
1529 YPOS=0.
1530 ZPOS=-(8.7*5.-2.*1.+2.*0.1)/2.-7.5
1531C
1532C --- PCB
1533C
1534 XPOS=DBOX2(1)-DPCB(1)
1535 CALL GSPOS('IEL1',3,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1536C
1537C --- Copper
1538C
1539 XPOS=DBOX2(1)-2.*DPCB(1)-DCOP(1)
1540 CALL GSPOS('IEL2',3,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1541C
1542C --- Ceramics
1543C
1544 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
1545 CALL GSPOS('IEL3',3,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1546C
1547C --- Silicon (bus)
1548C
1549 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
1550 CALL GSPOS('IEL4',3,'IDV1',XPOS,YPOS,ZPOS,0,'ONLY')
1551C
1552C --- Positive-Z end-ladder
1553C
1554 YOS=0.
1555 ZPOS=(8.7*5.-2.*1.+2.*0.1)/2.+7.5
1556C
1557C --- PCB
1558C
1559 XPOS=DBOX2(1)-DPCB(1)
1560 CALL GSPOS('IEL1',4,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1561C
1562C --- Copper
1563C
1564 XPOS=DBOX2(1)-2.*DPCB(1)-DCOP(1)
1565 CALL GSPOS('IEL2',4,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1566C
1567C --- Ceramics
1568C
1569 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
1570 CALL GSPOS('IEL3',4,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1571C
1572C --- Silicon (bus)
1573C
1574 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
1575 CALL GSPOS('IEL4',4,'IDV2',XPOS,YPOS,ZPOS,0,'ONLY')
1576C
1577C --- Place the ghost volumes containing the drift ladders of layer #3 in their
1578C mother volume (IT34)
1579C Odd elements have large ribs and even elements have small ribs
1580C
1581 DO I=1,12
1582 ATHETA=FLOAT(I-1)*(360./12.)
1583 CALL SXSROT(IDROTM(1300+I),90.,ATHETA,90.,90.+ATHETA,0.,0.)
1584 IF(MOD(I,2).EQ.0) THEN
1585 RZERO=(14.5+13.5)/2.
1586 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/12.)
1587 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/12.)
1588 ZPOS=0.
1589 CALL GSPOS('IDV1',I,'IT34',XPOS,YPOS,ZPOS,IDROTM(1300+I),
1590 $ 'ONLY')
1591 ELSE
1592 RZERO=(14.5+13.2)/2.
1593 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/12.)
1594 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/12.)
1595 ZPOS=0.
1596 CALL GSPOS('IDV2',I,'IT34',XPOS,YPOS,ZPOS,IDROTM(1300+I),
1597 $ 'ONLY')
1598 ENDIF
1599 ENDDO
1600C
16013456 CONTINUE
1602C
1603C --- Layer #4
1604C
1605C GOTO 4567 ! skip ITS layer no. 4
1606C
1607C --- Define a ghost volume containing a single ladder of layer #4 (with the
1608C smaller lenght of ribs) and fill it with air or vacuum
1609C
1610 DBOX1(1)=0.5+(0.0172+0.03+0.0252+0.04+0.003)
1611 DBOX1(2)=3.5 ! the widest element is the end-ladder stuff
1612 DBOX1(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1613 CALL GSVOLU('IDV3','BOX ',IDTMED(229),DBOX1,3,IOUT)
1614C
1615C --- Make the ghost volume invisible
1616C
1617 CALL GSATT('IDV3','SEEN',0)
1618C
1619C --- Define a volume containing the sensitive part of drifts
1620C (silicon, layer #4)
1621C
1622 DITS(1)=0.0172 ! see material budget report by G. Feofilov
1623 DITS(2)=3.125
1624 DITS(3)=4.35
1625 CALL GSVOLU('ITS4','BOX ',IDTMED(225),DITS,3,IOUT)
1626C
1627C --- Define the part of the (smaller) rib between two sensitive parts made of
1628C carbon (layer #4)
1629C
1630 DSUP(1)=0.5-DITS(1)
1631 DSUP(2)=0.01
1632 DSUP(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1633 CALL GSVOLU('IR31','BOX ',IDTMED(228),DSUP,3,IOUT)
1634C
1635C --- Define the first part of the (smaller) rib between two sensitive parts
1636C made of aluminum (layer #4)
1637C
1638 DAL1(1)=0.5-DITS(1)
1639 DAL1(2)=0.00096/2.
1640 DAL1(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1641 CALL GSVOLU('IR32','BOX ',IDTMED(231),DAL1,3,IOUT)
1642C
1643C --- Define the part of the (smaller) rib between two sensitive parts made of
1644C kapton (layer #4)
1645C
1646 DKAP(1)=0.5-DITS(1)
1647 DKAP(2)=0.0317/2.
1648 DKAP(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1649 CALL GSVOLU('IR33','BOX ',IDTMED(237),DKAP,3,IOUT)
1650C
1651C --- Define the second part of the (smaller) rib between two sensitive parts
1652C made of aluminum (layer #4)
1653C
1654 DAL2(1)=0.5-DITS(1)
1655 DAL2(2)=0.0027/2.
1656 DAL2(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1657 CALL GSVOLU('IR34','BOX ',IDTMED(231),DAL2,3,IOUT)
1658C
1659C --- Define the part of the (smaller) rib between two sensitive parts
1660C made of silicon (the electronics) (layer #4)
1661C
1662 DCHI(1)=0.5-DITS(1)
1663 DCHI(2)=0.0071/2.
1664 DCHI(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1665 CALL GSVOLU('IR35','BOX ',IDTMED(226),DAL2,3,IOUT)
1666C
1667C --- Define the part of the (smaller) rib between two sensitive parts
1668C made of water (the cooler) (layer #4)
1669C
1670 DWAT(1)=0.5-DITS(1)
1671 DWAT(2)=0.0093/2.
1672 DWAT(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1673 CALL GSVOLU('IR36','BOX ',IDTMED(232),DWAT,3,IOUT)
1674C
1675C --- Define the third part of the (smaller) rib between two sensitive parts
1676C made of aluminum (the cooling tubes) (layer #4)
1677C
1678 DTUB(1)=0.5-DITS(1)
1679 DTUB(2)=0.00134/2.
1680 DTUB(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1681 CALL GSVOLU('IR37','BOX ',IDTMED(231),DTUB,3,IOUT)
1682C
1683C --- Define the part of the end-ladder stuff made of PCB (layer #4)
1684C
1685 DPCB(1)=0.03 ! twice the foreseen thickness
1686 DPCB(2)=3.5
1687 DPCB(3)=7.5
1688 CALL GSVOLU('IEL5','BOX ',IDTMED(234),DPCB,3,IOUT)
1689C
1690C --- Define the part of the end-ladder stuff made of copper (layer #4)
1691C
1692 DCOP(1)=0.0252 ! twice the foreseen thickness
1693 DCOP(2)=3.5
1694 DCOP(3)=7.5
1695 CALL GSVOLU('IEL6','BOX ',IDTMED(235),DCOP,3,IOUT)
1696C
1697C --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1698C
1699 DCER(1)=0.04 ! twice the foreseen thickness
1700 DCER(2)=3.5
1701 DCER(3)=7.5
1702 CALL GSVOLU('IEL7','BOX ',IDTMED(236),DCER,3,IOUT)
1703C
1704C --- Define the part of the end-ladder stuff made of silicon (layer #4)
1705C
1706 DSIL(1)=0.003 ! twice the foreseen thickness
1707 DSIL(2)=3.5
1708 DSIL(3)=7.5
1709 CALL GSVOLU('IEL8','BOX ',IDTMED(227),DSIL,3,IOUT)
1710C
1711C --- Place the sensitive part of the drifts (smaller ribs) into its mother
1712C (IDV3)
1713C
1714 YPOS=0.
1715 DO J=1,7 ! odd elements are down and even elements are up
1716 IF(J.EQ.1) THEN
1717 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1718 $ DITS(1)
1719 ZPOS=0.-DITS(3)+0.7-2.*DITS(3)-0.-2.*DITS(3)+1.3-DITS(3)
1720 ELSE IF(J.EQ.2) THEN
1721 XPOS=-DBOX1(1)+DITS(1)
1722 ZPOS=0.-DITS(3)+0.7-2.*DITS(3)-0.-DITS(3)
1723 ELSE IF(J.EQ.3) THEN
1724 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1725 $ DITS(1)
1726 ZPOS=0.-DITS(3)+0.7-DITS(3)
1727 ELSE IF(J.EQ.4) THEN
1728 XPOS=-DBOX1(1)+DITS(1)
1729 ZPOS=0.
1730 ELSE IF(J.EQ.5) THEN
1731 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1732 $ DITS(1)
1733 ZPOS=0.+DITS(3)-0.7+DITS(3)
1734 ELSE IF(J.EQ.6) THEN
1735 XPOS=-DBOX1(1)+DITS(1)
1736 ZPOS=0.+DITS(3)-0.7+2.*DITS(3)+0.+DITS(3)
1737 ELSE IF(J.EQ.7) THEN
1738 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1739 $ DITS(1)
1740 ZPOS=0.+DITS(3)-0.7+2.*DITS(3)+0.+2.*DITS(3)-1.3+DITS(3)
1741 ENDIF
1742 CALL GSPOS('ITS4',J,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1743 END DO
1744C
1745C --- Place the smaller ribs into their mother (IDV3)
1746C
1747C --- Right ribs (just a matter of convention)
1748C
1749 XPOS=0.5-DBOX1(1)+DITS(1)
1750 ZPOS=0.
1751C
1752C --- Carbon
1753C
1754 YPOS=2.81
1755 CALL GSPOS('IR31',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1756C
1757C --- Aluminum #1
1758C
1759 YPOS=2.81+DSUP(2)+DAL1(2)
1760 CALL GSPOS('IR32',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1761C
1762C --- Kapton
1763C
1764 YPOS=2.81+DSUP(2)+2.*DAL1(2)+DKAP(2)
1765 CALL GSPOS('IR33',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1766C
1767C --- Aluminum #2
1768C
1769 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2)
1770 CALL GSPOS('IR34',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1771C
1772C --- Silicon (chip)
1773C
1774 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2)
1775 CALL GSPOS('IR35',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1776C
1777C --- Water
1778C
1779 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1780 $DWAT(2)
1781 CALL GSPOS('IR36',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1782C
1783C --- Aluminum #3
1784C
1785 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1786 $2.*DWAT(2)+DTUB(2)
1787 CALL GSPOS('IR37',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1788C
1789C --- Right ribs (just a matter of convention)
1790C
1791C --- Carbon
1792C
1793 YPOS=-2.81
1794 CALL GSPOS('IR31',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1795C
1796C --- Aluminum #1
1797C
1798 YPOS=-(2.81+DSUP(2)+DAL1(2))
1799 CALL GSPOS('IR32',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1800C
1801C --- Kapton
1802C
1803 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+DKAP(2))
1804 CALL GSPOS('IR33',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1805C
1806C --- Aluminum #2
1807C
1808 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2))
1809 CALL GSPOS('IR34',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1810C
1811C --- Silicon (chip)
1812C
1813 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2))
1814 CALL GSPOS('IR35',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1815C
1816C --- Water
1817C
1818 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1819 $DWAT(2))
1820 CALL GSPOS('IR36',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1821C
1822C --- Aluminum #3
1823C
1824 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
1825 $2.*DWAT(2)+DTUB(2))
1826 CALL GSPOS('IR37',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1827C
1828C --- Place the end-ladder stuff into its mother (IDV1)
1829C
1830C
1831C --- Negative-Z end-ladder
1832C
1833 YPOS=0.
1834 ZPOS=-(8.7*7.-2.*0.7-2.*1.3)/2.-7.5
1835C
1836C --- PCB
1837C
1838 XPOS=DBOX1(1)-DPCB(1)
1839 CALL GSPOS('IEL5',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1840C
1841C --- Copper
1842C
1843 XPOS=DBOX1(1)-2.*DPCB(1)-DCOP(1)
1844 CALL GSPOS('IEL6',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1845C
1846C --- Ceramics
1847C
1848 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
1849 CALL GSPOS('IEL7',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1850C
1851C --- Silicon (bus)
1852C
1853 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
1854 CALL GSPOS('IEL8',1,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1855C
1856C --- Positive-Z end-ladder
1857C
1858 YPOS=0.
1859 ZPOS=(8.7*7.-2.*0.7-2.*1.3)/2.+7.5
1860C
1861C --- PCB
1862C
1863 XPOS=DBOX1(1)-DPCB(1)
1864 CALL GSPOS('IEL5',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1865C
1866C --- Copper
1867C
1868 XPOS=DBOX1(1)-2.*DPCB(1)-DCOP(1)
1869 CALL GSPOS('IEL6',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1870C
1871C --- Ceramics
1872C
1873 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
1874 CALL GSPOS('IEL7',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1875C
1876C --- Silicon (bus)
1877C
1878 XPOS=DBOX1(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
1879 CALL GSPOS('IEL8',2,'IDV3',XPOS,YPOS,ZPOS,0,'ONLY')
1880C
1881C --- Define a ghost volume containing a single ladder of layer #4 (with the
1882C larger lenght of ribs) and fill it with air or vacuum
1883C
1884 DBOX2(1)=0.65+(0.0172+0.03+0.0252+0.04+0.003)
1885 DBOX2(2)=3.5 ! the widest element is the end-ladder stuff
1886 DBOX2(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1887 CALL GSVOLU('IDV4','BOX ',IDTMED(229),DBOX2,3,IOUT)
1888C
1889C --- Make the ghost volume invisible
1890C
1891 CALL GSATT('IDV4','SEEN',0)
1892C
1893C --- Define the part of the (larger) rib between two sensitive parts made of
1894C carbon (layer #4)
1895C
1896 DSUP(1)=0.65-DITS(1)
1897 DSUP(2)=0.01
1898 DSUP(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1899 CALL GSVOLU('IR41','BOX ',IDTMED(228),DSUP,3,IOUT)
1900C
1901C --- Define the first part of the (larger) rib between two sensitive parts
1902C made of aluminum (layer #4)
1903C
1904 DAL1(1)=0.65-DITS(1)
1905 DAL1(2)=0.00096/2.
1906 DAL1(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1907 CALL GSVOLU('IR42','BOX ',IDTMED(231),DAL1,3,IOUT)
1908C
1909C --- Define the part of the (larger) rib between two sensitive parts made of
1910C kapton (layer #4)
1911C
1912 DKAP(1)=0.65-DITS(1)
1913 DKAP(2)=0.0317/2.
1914 DKAP(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1915 CALL GSVOLU('IR43','BOX ',IDTMED(237),DKAP,3,IOUT)
1916C
1917C --- Define the second part of the (larger) rib between two sensitive parts
1918C made of aluminum (layer #4)
1919C
1920 DAL2(1)=0.65-DITS(1)
1921 DAL2(2)=0.0027/2.
1922 DAL2(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1923 CALL GSVOLU('IR44','BOX ',IDTMED(231),DAL2,3,IOUT)
1924C
1925C --- Define the part of the (larger) rib between two sensitive parts
1926C made of silicon (the electronics) (layer #4)
1927C
1928 DCHI(1)=0.65-DITS(1)
1929 DCHI(2)=0.0071/2.
1930 DCHI(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1931 CALL GSVOLU('IR45','BOX ',IDTMED(226),DAL2,3,IOUT)
1932C
1933C --- Define the part of the (larger) rib between two sensitive parts
1934C made of water (the cooler) (layer #4)
1935C
1936 DWAT(1)=0.65-DITS(1)
1937 DWAT(2)=0.0093/2.
1938 DWAT(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1939 CALL GSVOLU('IR46','BOX ',IDTMED(232),DWAT,3,IOUT)
1940C
1941C --- Define the third part of the (larger) rib between two sensitive parts
1942C made of aluminum (the cooling tubes) (layer #4)
1943C
1944 DTUB(1)=0.65-DITS(1)
1945 DTUB(2)=0.00134/2.
1946 DTUB(3)=(8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5 ! 7.5 cm is the lenght of the end-ladder module
1947 CALL GSVOLU('IR47','BOX ',IDTMED(231),DTUB,3,IOUT)
1948C
1949C --- Place the sensitive part of the drifts (smaller ribs) into its mother
1950C (IDV4)
1951C
1952 YPOS=0.
1953 DO J=1,7 ! odd elements are down and even elements are up
1954 IF(J.EQ.1) THEN
1955 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1956 $ DITS(1)
1957 ZPOS=0.-DITS(3)+0.7-2.*DITS(3)-0.-2.*DITS(3)+1.3-DITS(3)
1958 ELSE IF(J.EQ.2) THEN
1959 XPOS=-DBOX2(1)+DITS(1)
1960 ZPOS=0.-DITS(3)+0.7-2.*DITS(3)-0.-DITS(3)
1961 ELSE IF(J.EQ.3) THEN
1962 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1963 $ DITS(1)
1964 ZPOS=0.-DITS(3)+0.7-DITS(3)
1965 ELSE IF(J.EQ.4) THEN
1966 XPOS=-DBOX2(1)+DITS(1)
1967 ZPOS=0.
1968 ELSE IF(J.EQ.5) THEN
1969 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1970 $ DITS(1)
1971 ZPOS=0.+DITS(3)-0.7+DITS(3)
1972 ELSE IF(J.EQ.6) THEN
1973 XPOS=-DBOX2(1)+DITS(1)
1974 ZPOS=0.+DITS(3)-0.7+2.*DITS(3)+0.+DITS(3)
1975 ELSE IF(J.EQ.7) THEN
1976 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-2.*DSIL(1)-
1977 $ DITS(1)
1978 ZPOS=0.+DITS(3)-0.7+2.*DITS(3)+0.+2.*DITS(3)-1.3+DITS(3)
1979 ENDIF
1980 CALL GSPOS('ITS4',J,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
1981 END DO
1982C
1983C --- Place the larger ribs into their mother (IDV4)
1984C
1985C
1986C --- Right ribs (just a matter of convention)
1987C
1988 XPOS=0.65-DBOX2(1)+DITS(1)
1989 ZPOS=0.
1990C
1991C --- Carbon
1992C
1993 YPOS=2.81
1994 CALL GSPOS('IR41',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
1995C
1996C --- Aluminum #1
1997C
1998 YPOS=2.81+DSUP(2)+DAL1(2)
1999 CALL GSPOS('IR42',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2000C
2001C --- Kapton
2002C
2003 YPOS=2.81+DSUP(2)+2.*DAL1(2)+DKAP(2)
2004 CALL GSPOS('IR43',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2005C
2006C --- Aluminum #2
2007C
2008 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2)
2009 CALL GSPOS('IR44',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2010C
2011C --- Silicon (chip)
2012C
2013 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2)
2014 CALL GSPOS('IR45',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2015C
2016C --- Water
2017C
2018 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
2019 $DWAT(2)
2020 CALL GSPOS('IR46',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2021C
2022C --- Aluminum #3
2023C
2024 YPOS=2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
2025 $2.*DWAT(2)+DTUB(2)
2026 CALL GSPOS('IR47',1,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2027C
2028C --- Right ribs (just a matter of convention)
2029C
2030C --- Carbon
2031C
2032 YPOS=-2.81
2033 CALL GSPOS('IR41',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2034C
2035C --- Aluminum #1
2036C
2037 YPOS=-(2.81+DSUP(2)+DAL1(2))
2038 CALL GSPOS('IR42',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2039C
2040C --- Kapton
2041C
2042 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+DKAP(2))
2043 CALL GSPOS('IR43',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2044C
2045C --- Aluminum #2
2046C
2047 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+DAL2(2))
2048 CALL GSPOS('IR44',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2049C
2050C --- Silicon (chip)
2051C
2052 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+DCHI(2))
2053 CALL GSPOS('IR45',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2054C
2055C --- Water
2056C
2057 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
2058 $DWAT(2))
2059 CALL GSPOS('IR46',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2060C
2061C --- Aluminum #3
2062C
2063 YPOS=-(2.81+DSUP(2)+2.*DAL1(2)+2.*DKAP(2)+2.*DAL2(2)+2.*DCHI(2)+
2064 $2.*DWAT(2)+DTUB(2))
2065 CALL GSPOS('IR47',2,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2066C
2067C --- Place the end-ladder stuff into its mother (IDV1)
2068C
2069C
2070C --- Negative-Z end-ladder
2071C
2072 YPOS=0.
2073 ZPOS=-(8.7*7.-2.*0.7-2.*1.3)/2.-7.5
2074C
2075C --- PCB
2076C
2077 XPOS=DBOX2(1)-DPCB(1)
2078 CALL GSPOS('IEL5',3,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2079C
2080C --- Copper
2081C
2082 XPOS=DBOX2(1)-2.*DPCB(1)-DCOP(1)
2083 CALL GSPOS('IEL6',3,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2084C
2085C --- Ceramics
2086C
2087 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
2088 CALL GSPOS('IEL7',3,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2089C
2090C --- Silicon (bus)
2091C
2092 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
2093 CALL GSPOS('IEL8',3,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2094C
2095C --- Positive-Z end-ladder
2096C
2097 YOS=0.
2098 ZPOS=(8.7*7.-2.*0.7-2.*1.3)/2.+7.5
2099C
2100C --- PCB
2101C
2102 XPOS=DBOX2(1)-DPCB(1)
2103 CALL GSPOS('IEL5',4,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2104C
2105C --- Copper
2106C
2107 XPOS=DBOX2(1)-2.*DPCB(1)-DCOP(1)
2108 CALL GSPOS('IEL6',4,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2109C
2110C --- Ceramics
2111C
2112 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-DCER(1)
2113 CALL GSPOS('IEL7',4,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2114C
2115C --- Silicon (bus)
2116C
2117 XPOS=DBOX2(1)-2.*DPCB(1)-2.*DCOP(1)-2.*DCER(1)-DSIL(1)
2118 CALL GSPOS('IEL8',4,'IDV4',XPOS,YPOS,ZPOS,0,'ONLY')
2119C
2120C --- Place the ghost volumes containing the drift ladders of layer #4 in their
2121C mother volume (IT34)
2122C Odd elements have large ribs and even elements have small ribs
2123C
2124 DO I=1,24
2125 ATHETA=FLOAT(I-1)*(360./24.)
2126 CALL SXSROT(IDROTM(1400+I),90.,ATHETA,90.,90.+ATHETA,0.,0.)
2127 IF(MOD(I,2).EQ.0) THEN
2128 RZERO=(24.0+23.0)/2.
2129 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/24.)
2130 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/24.)
2131 ZPOS=0.
2132 CALL GSPOS('IDV3',I,'IT34',XPOS,YPOS,ZPOS,IDROTM(1400+I),
2133 $ 'ONLY')
2134 ELSE
2135 RZERO=(24.0+22.8)/2.
2136 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/24.)
2137 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/24.)
2138 ZPOS=0.
2139 CALL GSPOS('IDV4',I,'IT34',XPOS,YPOS,ZPOS,IDROTM(1400+I),
2140 $ 'ONLY')
2141 ENDIF
2142 ENDDO
2143C
21444567 CONTINUE
2145C
2146C ************************************************************************
2147C * *
2148C * S T R I P S *
2149C * =========== *
2150C * *
2151C ************************************************************************
2152C
2153C
2154C --- Define SSD with the 35+39 lay-out
2155C
2156 IF(IVERS.EQ.40 .OR. IVERS.EQ.41 .OR. IVERS.EQ.42) THEN
2157C
2158C --- Define ghost volume containing the Strip Detectors and fill it with air
2159C or vacuum
2160C
2161 XXM=(49.999-3.)/(70.-25.)
2162 DGH(1)=0.
2163 DGH(2)=360.
2164 DGH(3)=4.
2165 DGH(4)=-25.-(9.-3.01)/XXM-(9.01-9.)/XXM-(27.-9.01)/XXM-
2166 $ (37.-27)/XXM-(49.998-37.)/XXM
2167 DGH(5)=49.998
2168 DGH(6)=49.998
2169 DGH(7)=-25.-(9.-3.01)/XXM-(9.01-9.)/XXM-(27.-9.01)/XXM-
2170 $ (37.-27)/XXM
2171 DGH(8)=37.
2172 DGH(9)=49.998
2173 DGH(10)=25.+(9.-3.01)/XXM+(9.01-9.)/XXM+(27.-9.01)/XXM+
2174 $ (37.-27)/XXM
2175 DGH(11)=37.
2176 DGH(12)=49.998
2177 DGH(13)=25.+(9.-3.01)/XXM+(9.01-9.)/XXM+(27.-9.01)/XXM+
2178 $ (37.-27)/XXM+(49.998-37.)/XXM
2179 DGH(14)=49.998
2180 DGH(15)=49.998
2181 CALL GSVOLU('IT56','PCON',IDTMED(276),DGH,15,IOUT)
2182 CALL GSPOS('IT56',1,'ITSV',0.,0.,0.,0,'ONLY')
2183 CALL GSATT('IT56','SEEN',0)
2184C
2185C --- Layer #5
2186C
2187C GOTO 5678 ! skip ITS layer no. 5
2188C
2189C --- Define a ghost volume containing a single ladder of layer #5 and fill
2190C it with air or vacuum
2191C
2192 DBOX1(1)=(0.0600+2.*0.0150)/2.
2193 DBOX1(2)=3.75
2194 DBOX1(3)=90.22/2.
2195 CALL GSVOLU('ISV1','BOX ',IDTMED(254),DBOX1,3,IOUT)
2196C
2197C --- Make the ghost volume invisible
2198C
2199 CALL GSATT('ISV1','SEEN',0)
2200C
2201C --- Define a ghost volume containing the electronics and cooling of
2202C a single ladder of layer #5 and fill it with air or vacuum
2203C
2204 DSRV(1)=(0.47+(SQRT(3.)/2.)*4.2+0.05)/2.
2205 DSRV(2)=3.75
2206 DSRV(3)=90.22/2.
2207 CALL GSVOLU('SSV1','BOX ',IDTMED(254),DSRV,3,IOUT)
2208C
2209C --- Make the ghost volume invisible
2210C
2211 CALL GSATT('SSV1','SEEN',0)
2212C
2213C --- Define a ghost volume containing the end-ladder stuff of
2214C a single ladder of layer #5 and fill it with air or vacuum
2215C
2216 DELA(1)=2.
2217 DELA(2)=3.5
2218 DELA(3)=4.0
2219 CALL GSVOLU('ELL5','BOX ',IDTMED(254),DELA,3,IOUT)
2220C
2221C --- Make the ghost volume invisible
2222C
2223 CALL GSATT('ELL5','SEEN',0)
2224C
2225C --- Define a volume containing the sensitive part of the strips
2226C (silicon, layer #5)
2227C
2228 DITS(1)=0.0150
2229 DITS(2)=3.75
2230 DITS(3)=2.1
2231 CALL GSVOLU('ITS5','BOX ',IDTMED(250),DITS,3,IOUT)
2232C
2233C --- Define a volume containing the electronics of the strips
2234C (silicon, layer #5)
2235C
2236 DCHI(1)=0.02
2237 DCHI(2)=3.4
2238 DCHI(3)=0.525
2239 CALL GSVOLU('SCH5','BOX ',IDTMED(251),DCHI,3,IOUT)
2240C
2241C --- Define the cooling tubes (aluminum, layer #5)
2242C
2243 DTUB(1)=0.09
2244 DTUB(2)=DTUB(1)+0.01
2245 DTUB(3)=90.22/2.
2246 CALL GSVOLU('STB5','TUBE',IDTMED(256),DTUB,3,IOUT)
2247C
2248C --- Define the cooling fluid (water or freon, layer #5)
2249C
2250 DWAT(1)=0.
2251 DWAT(2)=0.09
2252 DWAT(3)=90.22/2.
2253 CALL GSVOLU('SWT5','TUBE',IDTMED(257),DWAT,3,IOUT) ! water
2254C CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2255C
2256C --- Define the (triangular) element of the heat bridge (carbon, layer #5)
2257C
2258 DFRA(1)=120.
2259 DFRA(2)=360.
2260 DFRA(3)=3.
2261 DFRA(4)=2.
2262 DFRA(5)=-0.015
2263 DFRA(6)=4.2*SQRT(3.)/6.
2264 DFRA(7)=DFRA(6)+0.03
2265 DFRA(8)=0.015
2266 DFRA(9)=DFRA(6)
2267 DFRA(10)=DFRA(7)
2268 CALL GSVOLU('SFR5','PGON',IDTMED(253),DFRA,10,IOUT)
2269C
2270C --- Define the element connecting the triangles of the heat bridge
2271C (carbon, layer #5)
2272C
2273 DCEI(1)=0.
2274 DCEI(2)=0.03
2275 DCEI(3)=90.22/2.
2276 CALL GSVOLU('SCE5','TUBE',IDTMED(253),DCEI,3,IOUT)
2277C
2278C --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2279C (layer #5)
2280C
2281 DPLA(1)=(10./(8.*7.))/2.
2282 DPLA(2)=3.5
2283 DPLA(3)=4.
2284 CALL GSVOLU('EPL5','BOX ',IDTMED(263),DPLA,3,IOUT)
2285C
2286C --- Define the part of the end-ladder stuff made of copper (layer #5)
2287C
2288 DCOP(1)=(2./(8.*7.))/2.
2289 DCOP(2)=3.5
2290 DCOP(3)=4.
2291 CALL GSVOLU('ECU5','BOX ',IDTMED(260),DCOP,3,IOUT)
2292C
2293C --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2294C
2295 DEPX(1)=(30./(8.*7.))/2.
2296 DEPX(2)=3.5
2297 DEPX(3)=4.
2298 CALL GSVOLU('EPX5','BOX ',IDTMED(263),DEPX,3,IOUT)
2299C
2300C --- Define the part of the end-ladder stuff made of silicon (bus)
2301C (layer #5)
2302C
2303 DSIL(1)=(20./(8.*7.))/2.
2304 DSIL(2)=3.5
2305 DSIL(3)=4.
2306 CALL GSVOLU('ESI5','BOX ',IDTMED(252),DSIL,3,IOUT)
2307C
2308C --- Place the end-ladder stuff into its mother (ELL5)
2309C
2310 SEP=(4.-2.*(DPLA(1)+DCOP(1)+DEPX(1)+DSIL(1)))/3.
2311 YPOS=0.
2312 ZPOS=0.
2313C
2314C --- Plastic
2315C
2316 XPOS=-DELA(1)+DPLA(1)
2317 CALL GSPOS('EPL5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2318C
2319C --- Copper
2320C
2321 XPOS=-DELA(1)+2.*DPLA(1)+SEP+DCOP(1)
2322 CALL GSPOS('ECU5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2323C
2324C --- Epoxy
2325C
2326 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+DEPX(1)
2327 CALL GSPOS('EPX5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2328C
2329C --- Silicon (bus)
2330C
2331 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+2.*DEPX(1)+
2332 $ SEP+DSIL(1)
2333 CALL GSPOS('ESI5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2334C
2335C --- Place the sensitive part of the strips into its mother (ISV1)
2336C
2337 YPOS=0.
2338 DO J=1,23
2339 IF(MOD(J,2).EQ.0) THEN
2340 XPOS=DBOX1(1)-DITS(1)
2341 ELSE
2342 XPOS=-DBOX1(1)+DITS(1)
2343 ENDIF
2344 ZPOS=(-11.+FLOAT(J-1))*3.91
2345 CALL GSPOS('ITS5',J,'ISV1',XPOS,YPOS,ZPOS,0,'ONLY')
2346 END DO
2347C
2348C --- Place the electronics of the strips into its mother (SSV1)
2349C
2350 YPOS=0.
2351 DO J=1,23
2352 IF(MOD(J,2).EQ.0) THEN
2353 XPOS=-DSRV(1)+0.28
2354 ELSE
2355 XPOS=-DSRV(1)+0.28-2.*DITS(1)-0.03
2356 ENDIF
2357 ZPOS=(-11.+FLOAT(J-1))*3.91+0.85
2358 CALL GSPOS('SCH5',J,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2359 END DO
2360C
2361C --- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2362C
2363 XPOS=-DSRV(1)+0.41
2364 ZPOS=0.
2365C
2366C --- Left tube (just a matter of convention)
2367C
2368 YPOS=-2.25-0.1
2369 CALL GSPOS('STB5',1,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2370 CALL GSPOS('SWT5',1,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2371C
2372C --- Right tube (just a matter of convention)
2373C
2374 YPOS=2.25+0.1
2375 CALL GSPOS('STB5',2,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2376 CALL GSPOS('SWT5',2,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2377C
2378C --- Place the heat bridge elements into their mother (SSV1)
2379C
2380 XPOS=-DSRV(1)+0.47+(SQRT(3.)/6.)*4.2
2381 YPOS=0.
2382 DO J=1,24
2383 ZPOS=(-11.+FLOAT(J-1))*3.91-4.2/2.
2384 CALL GSPOS('SFR5',J,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2385 END DO
2386C
2387C --- Place the elements connecting the triangles of the heat bridge
2388C into their mother (SSV1)
2389C
2390 ZPOS=0.
2391C
2392C --- Left element (just a matter of convention)
2393C
2394 XPOS=-DSRV(1)+0.47
2395 YPOS=-(2.1+0.015)
2396 CALL GSPOS('SCE5',1,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2397C
2398C --- Right element
2399C
2400 XPOS=-DSRV(1)+0.47
2401 YPOS=2.1+0.015
2402 CALL GSPOS('SCE5',2,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2403C
2404C --- Top element
2405C
2406 XPOS=-DSRV(1)+0.47+(SQRT(3.)/2.)*4.2+0.015
2407 YPOS=0.
2408 CALL GSPOS('SCE5',3,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2409C
2410C --- Place the ghost volumes containing the strip ladders (ISV1),
2411C electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2412C their mother volume (IT56)
2413C
2414 OFFSET1=ATG(0.9,40.)
2415 OFFSET2=5.2
2416 RZERO=40.+DBOX1(1)
2417 RUNO=40.+2.*DBOX1(1)+DSRV(1)
2418 RTWO=40.+2.*DBOX1(1)+DELA(1)
2419 DO I=1,35
2420 ATHETA=TWOPI*FLOAT(I-1)*RADDEG/35.+OFFSET2
2421 CALL SXSROT(IDROTM(1500+I),90.,ATHETA,90.,90.+ATHETA,0.,0.)
2422C
2423C --- Strip ladders
2424C
2425 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/35.+OFFSET1)
2426 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/35.+OFFSET1)
2427 ZPOS=0.
2428 CALL GSPOS('ISV1',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
2429 $ 'ONLY')
2430C
2431C --- Electronics/cooling
2432C
2433 XPOS=RUNO*COS(TWOPI*FLOAT(I-1)/35.+OFFSET1)
2434 YPOS=RUNO*SIN(TWOPI*FLOAT(I-1)/35.+OFFSET1)
2435 ZPOS=0.
2436 CALL GSPOS('SSV1',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
2437 $ 'ONLY')
2438C
2439C --- End-ladders (nagative-Z and positive-Z)
2440C
2441 XPOS=RTWO*COS(TWOPI*FLOAT(I-1)/35.+OFFSET1)
2442 YPOS=RTWO*SIN(TWOPI*FLOAT(I-1)/35.+OFFSET1)
2443 ZPOS=-(DBOX1(3)+DELA(3)+6.)
2444 CALL GSPOS('ELL5',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
2445 $ 'ONLY')
2446 ZPOS=DBOX1(3)+DELA(3)+6.
2447 CALL GSPOS('ELL5',I+35,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
2448 $ 'ONLY')
2449 END DO
2450C
24515678 CONTINUE
2452C
2453C --- Layer #6
2454C
2455C GOTO 5778 ! skip ITS layer no. 6
2456C
2457C --- Define a ghost volume containing a single ladder of layer #6 and fill
2458C it with air or vacuum
2459C
2460 DBOX2(1)=(0.0600+2.*0.0150)/2.
2461 DBOX2(2)=3.75
2462 DBOX2(3)=101.95/2.
2463 CALL GSVOLU('ISV2','BOX ',IDTMED(254),DBOX2,3,IOUT)
2464C
2465C --- Make the ghost volume invisible
2466C
2467 CALL GSATT('ISV2','SEEN',0)
2468C
2469C --- Define a ghost volume containing the electronics and cooling of
2470C a single ladder of layer #6 and fill it with air or vacuum
2471C
2472 DSRV(1)=(0.47+(SQRT(3.)/2.)*4.2+0.05)/2.
2473 DSRV(2)=3.75
2474 DSRV(3)=101.95/2.
2475 CALL GSVOLU('SSV2','BOX ',IDTMED(254), DSRV,3,IOUT)
2476C
2477C --- Make the ghost volume invisible
2478C
2479 CALL GSATT('SSV2','SEEN',0)
2480C
2481C --- Define a ghost volume containing the end-ladder stuff of
2482C a single ladder of layer #6 and fill it with air or vacuum
2483C
2484 DELA(1)=2.
2485 DELA(2)=3.5
2486 DELA(3)=4.0
2487 CALL GSVOLU('ELL6','BOX ',IDTMED(254),DELA,3,IOUT)
2488C
2489C --- Make the ghost volume invisible
2490C
2491 CALL GSATT('ELL6','SEEN',0)
2492C
2493C --- Define a volume containing the sensitive part of the strips
2494C (silicon, layer #6)
2495C
2496 DITS(1)=0.0150
2497 DITS(2)=3.75
2498 DITS(3)=2.1
2499 CALL GSVOLU('ITS6','BOX ',IDTMED(250),DITS,3,IOUT)
2500C
2501C --- Define a volume containing the electronics of the strips
2502C (silicon, layer #6)
2503C
2504 DCHI(1)=0.02
2505 DCHI(2)=3.4
2506 DCHI(3)=0.525
2507 CALL GSVOLU('SCH6','BOX ',IDTMED(251),DCHI,3,IOUT)
2508C
2509C --- Define the cooling tubes (aluminum, layer #6)
2510C
2511 DTUB(1)=0.09
2512 DTUB(2)=DTUB(1)+0.01
2513 DTUB(3)=101.95/2.
2514 CALL GSVOLU('STB6','TUBE',IDTMED(256),DTUB,3,IOUT)
2515C
2516C --- Define the cooling fluid (water or freon, layer #6)
2517C
2518 DWAT(1)=0.
2519 DWAT(2)=0.09
2520 DWAT(3)=101.95/2.
2521 CALL GSVOLU('SWT6','TUBE',IDTMED(257),DWAT,3,IOUT) ! water
2522C CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2523C
2524C --- Define the (triangular) element of the heat bridge (carbon, layer #6)
2525C
2526 DFRA(1)=120.
2527 DFRA(2)=360.
2528 DFRA(3)=3.
2529 DFRA(4)=2.
2530 DFRA(5)=-0.015
2531 DFRA(6)=4.2*SQRT(3.)/6.
2532 DFRA(7)=DFRA(6)+0.03
2533 DFRA(8)=0.015
2534 DFRA(9)=DFRA(6)
2535 DFRA(10)=DFRA(7)
2536 CALL GSVOLU('SFR6','PGON',IDTMED(253),DFRA,10,IOUT)
2537C
2538C --- Define the element connecting the triangles of the heat bridge
2539C (carbon, layer #6)
2540C
2541 DCEI(1)=0.
2542 DCEI(2)=0.03
2543 DCEI(3)=101.95/2.
2544 CALL GSVOLU('SCE6','TUBE',IDTMED(253),DCEI,3,IOUT)
2545C
2546C --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2547C (layer #6)
2548C
2549 DPLA(1)=(10./(8.*7.))/2.
2550 DPLA(2)=3.5
2551 DPLA(3)=4.
2552 CALL GSVOLU('EPL6','BOX ',IDTMED(263),DPLA,3,IOUT)
2553C
2554C --- Define the part of the end-ladder stuff made of copper (layer #6)
2555C
2556 DCOP(1)=(2./(8.*7.))/2.
2557 DCOP(2)=3.5
2558 DCOP(3)=4.
2559 CALL GSVOLU('ECU6','BOX ',IDTMED(260),DCOP,3,IOUT)
2560C
2561C --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2562C
2563 DEPX(1)=(30./(8.*7.))/2.
2564 DEPX(2)=3.5
2565 DEPX(3)=4.
2566 CALL GSVOLU('EPX6','BOX ',IDTMED(263),DEPX,3,IOUT)
2567C
2568C --- Define the part of the end-ladder stuff made of silicon (bus)
2569C (layer #6)
2570C
2571 DSIL(1)=(20./(8.*7.))/2.
2572 DSIL(2)=3.5
2573 DSIL(3)=4.
2574 CALL GSVOLU('ESI6','BOX ',IDTMED(252),DSIL,3,IOUT)
2575C
2576C --- Place the end-ladder stuff into its mother (ELL5)
2577C
2578 SEP=(4.-2.*(DPLA(1)+DCOP(1)+DEPX(1)+DSIL(1)))/3.
2579 YPOS=0.
2580 ZPOS=0.
2581C
2582C --- Plastic
2583C
2584 XPOS=-DELA(1)+DPLA(1)
2585 CALL GSPOS('EPL6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
2586C
2587C --- Copper
2588C
2589 XPOS=-DELA(1)+2.*DPLA(1)+SEP+DCOP(1)
2590 CALL GSPOS('ECU6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
2591C
2592C --- Epoxy
2593C
2594 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+DEPX(1)
2595 CALL GSPOS('EPX6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
2596C
2597C --- Silicon (bus)
2598C
2599 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+2.*DEPX(1)+
2600 $ SEP+DSIL(1)
2601 CALL GSPOS('ESI6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
2602C
2603C --- Place the sensitive part of the strips into its mother (ISV2)
2604C
2605 YPOS=0.
2606 DO J=1,26
2607 IF(MOD(J,2).EQ.0) THEN
2608 XPOS=DBOX2(1)-DITS(1)
2609 ELSE
2610 XPOS=-DBOX2(1)+DITS(1)
2611 ENDIF
2612 ZPOS=(-12.+FLOAT(J-1))*3.91-1.96
2613 CALL GSPOS('ITS6',J,'ISV2',XPOS,YPOS,ZPOS,0,'ONLY')
2614 END DO
2615C
2616C --- Place the electronics of the strips into its mother (SSV2)
2617C
2618 YPOS=0.
2619 DO J=1,26
2620 IF(MOD(J,2).EQ.0) THEN
2621 XPOS=-DSRV(1)+0.28
2622 ELSE
2623 XPOS=-DSRV(1)+0.28-2.*DITS(1)-0.03
2624 ENDIF
2625 ZPOS=(-12.+FLOAT(J-1))*3.91-1.96+0.85
2626 CALL GSPOS('SCH5',J,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2627 END DO
2628C
2629C --- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2630C
2631 XPOS=-DSRV(1)+0.41
2632 ZPOS=0.
2633C
2634C --- Left tube (just a matter of convention)
2635C
2636 YPOS=-2.25-0.1
2637 CALL GSPOS('STB6',1,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2638 CALL GSPOS('SWT6',1,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2639C
2640C --- Right tube (just a matter of convention)
2641C
2642 YPOS=2.25+0.1
2643 CALL GSPOS('STB6',2,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2644 CALL GSPOS('SWT6',2,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2645C
2646C --- Place the heat bridge elements into their mother (SSV2)
2647C
2648 XPOS=-DSRV(1)+0.47+(SQRT(3.)/6.)*4.2
2649 YPOS=0.
2650 DO J=1,27
2651 ZPOS=(-12.+FLOAT(J-1))*3.91-1.96-4.2/2.
2652 CALL GSPOS('SFR6',J,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2653 END DO
2654C
2655C --- Place the elements connecting the triangles of the heat bridge
2656C into their mother (SSV2)
2657C
2658 ZPOS=0.
2659C
2660C --- Left element (just a matter of convention)
2661C
2662 XPOS=-DSRV(1)+0.47
2663 YPOS=-(2.1+0.015)
2664 CALL GSPOS('SCE6',1,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2665C
2666C --- Right element
2667C
2668 XPOS=-DSRV(1)+0.47
2669 YPOS=2.1+0.015
2670 CALL GSPOS('SCE6',2,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2671C
2672C --- Top element
2673C
2674 XPOS=-DSRV(1)+0.47+(SQRT(3.)/2.)*4.2+0.015
2675 YPOS=0.
2676 CALL GSPOS('SCE6',3,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
2677C
2678C --- Place the ghost volumes containing the strip ladders (ISV2),
2679C electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2680C their mother volume (IT56)
2681C
2682 OFFSET1=ATG(1.0,45.)
2683 OFFSET2=5.2
2684 RZERO=45.+DBOX2(1)
2685 RUNO=45.+2.*DBOX2(1)+DSRV(1)
2686 RTWO=45.+2.*DBOX2(1)+DELA(1)
2687 DO I=1,39
2688 ATHETA=TWOPI*FLOAT(I-1)*RADDEG/39.+OFFSET2
2689 CALL SXSROT(IDROTM(1600+I),90.,ATHETA,90.,90.+ATHETA,0.,0.)
2690C
2691C --- Strip ladders
2692C
2693 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/39.+OFFSET1)
2694 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/39.+OFFSET1)
2695 ZPOS=0.
2696 CALL GSPOS('ISV2',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
2697 $ 'ONLY')
2698C
2699C --- Electronics/cooling
2700C
2701 XPOS=RUNO*COS(TWOPI*FLOAT(I-1)/39.+OFFSET1)
2702 YPOS=RUNO*SIN(TWOPI*FLOAT(I-1)/39.+OFFSET1)
2703 ZPOS=0.
2704 CALL GSPOS('SSV2',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
2705 $ 'ONLY')
2706C
2707C --- End-ladders (nagative-Z and positive-Z)
2708C
2709 XPOS=RTWO*COS(TWOPI*FLOAT(I-1)/39.+OFFSET1)
2710 YPOS=RTWO*SIN(TWOPI*FLOAT(I-1)/39.+OFFSET1)
2711 ZPOS=-(DBOX2(3)+DELA(3)+6.)
2712 CALL GSPOS('ELL6',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
2713 $ 'ONLY')
2714 ZPOS=DBOX2(3)+DELA(3)+6.
2715 CALL GSPOS('ELL6',I+39,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
2716 $ 'ONLY')
2717 END DO
2718C
27195778 CONTINUE
2720C
2721 ENDIF
2722C
2723C --- Define SSD with the 32+36 lay-out
2724C
2725 IF(IVERS.EQ.43 .OR. IVERS.EQ.44 .OR. IVERS.EQ.45) THEN
2726C
2727C --- Define ghost volume containing the Strip Detectors and fill it with air
2728C or vacuum
2729C
2730 XXM=(49.999-3.)/(70.-25.)
2731 DGH(1)=0.
2732 DGH(2)=360.
2733 DGH(3)=4.
2734 DGH(4)=-25.-(9.-3.01)/XXM-(9.01-9.)/XXM-(27.-9.01)/XXM-
2735 $ (36.-27)/XXM-(49.998-36.)/XXM
2736 DGH(5)=49.998
2737 DGH(6)=49.998
2738 DGH(7)=-25.-(9.-3.01)/XXM-(9.01-9.)/XXM-(27.-9.01)/XXM-
2739 $ (36.-27)/XXM
2740 DGH(8)=36.
2741 DGH(9)=49.998
2742 DGH(10)=25.+(9.-3.01)/XXM+(9.01-9.)/XXM+(27.-9.01)/XXM+
2743 $ (36.-27)/XXM
2744 DGH(11)=36.
2745 DGH(12)=49.998
2746 DGH(13)=25.+(9.-3.01)/XXM+(9.01-9.)/XXM+(27.-9.01)/XXM+
2747 $ (36.-27)/XXM+(49.998-36.)/XXM
2748 DGH(14)=49.998
2749 DGH(15)=49.998
2750 CALL GSVOLU('IT56','PCON',IDTMED(276),DGH,15,IOUT)
2751 CALL GSPOS('IT56',1,'ITSV',0.,0.,0.,0,'ONLY')
2752 CALL GSATT('IT56','SEEN',0)
2753C
2754C --- Layer #5
2755C
2756C GOTO 6678 ! skip ITS layer no. 5
2757C
2758C --- Define a ghost volume containing a single ladder of layer #5 and fill
2759C it with air or vacuum
2760C
2761 DBOX1(1)=(0.0600+2.*0.0150)/2.
2762 DBOX1(2)=3.75
2763 DBOX1(3)=86.31/2.
2764 CALL GSVOLU('ISV1','BOX ',IDTMED(254),DBOX1,3,IOUT)
2765C
2766C --- Make the ghost volume invisible
2767C
2768 CALL GSATT('ISV1','SEEN',0)
2769C
2770C --- Define a ghost volume containing the electronics and cooling of
2771C a single ladder of layer #5 and fill it with air or vacuum
2772C
2773 DSRV(1)=(0.47+(SQRT(3.)/2.)*4.2+0.05)/2.
2774 DSRV(2)=3.75
2775 DSRV(3)=86.31/2.
2776 CALL GSVOLU('SSV1','BOX ',IDTMED(254),DSRV,3,IOUT)
2777C
2778C --- Make the ghost volume invisible
2779C
2780 CALL GSATT('SSV1','SEEN',0)
2781C
2782C --- Define a ghost volume containing the end-ladder stuff of
2783C a single ladder of layer #5 and fill it with air or vacuum
2784C
2785 DELA(1)=2.
2786 DELA(2)=3.5
2787 DELA(3)=4.0
2788 CALL GSVOLU('ELL5','BOX ',IDTMED(254),DELA,3,IOUT)
2789C
2790C --- Make the ghost volume invisible
2791C
2792 CALL GSATT('ELL5','SEEN',0)
2793C
2794C --- Define a volume containing the sensitive part of the strips
2795C (silicon, layer #5)
2796C
2797 DITS(1)=0.0150
2798 DITS(2)=3.75
2799 DITS(3)=2.1
2800 CALL GSVOLU('ITS5','BOX ',IDTMED(250),DITS,3,IOUT)
2801C
2802C --- Define a volume containing the electronics of the strips
2803C (silicon, layer #5)
2804C
2805 DCHI(1)=0.02
2806 DCHI(2)=3.4
2807 DCHI(3)=0.525
2808 CALL GSVOLU('SCH5','BOX ',IDTMED(251),DCHI,3,IOUT)
2809C
2810C --- Define the cooling tubes (aluminum, layer #5)
2811C
2812 DTUB(1)=0.09
2813 DTUB(2)=DTUB(1)+0.01
2814 DTUB(3)=86.31/2.
2815 CALL GSVOLU('STB5','TUBE',IDTMED(256),DTUB,3,IOUT)
2816C
2817C --- Define the cooling fluid (water or freon, layer #5)
2818C
2819 DWAT(1)=0.
2820 DWAT(2)=0.09
2821 DWAT(3)=86.31/2.
2822 CALL GSVOLU('SWT5','TUBE',IDTMED(257),DWAT,3,IOUT) ! water
2823C CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2824C
2825C --- Define the (triangular) element of the heat bridge (carbon, layer #5)
2826C
2827 DFRA(1)=120.
2828 DFRA(2)=360.
2829 DFRA(3)=3.
2830 DFRA(4)=2.
2831 DFRA(5)=-0.015
2832 DFRA(6)=4.2*SQRT(3.)/6.
2833 DFRA(7)=DFRA(6)+0.03
2834 DFRA(8)=0.015
2835 DFRA(9)=DFRA(6)
2836 DFRA(10)=DFRA(7)
2837 CALL GSVOLU('SFR5','PGON',IDTMED(253),DFRA,10,IOUT)
2838C
2839C --- Define the element connecting the triangles of the heat bridge
2840C (carbon, layer #5)
2841C
2842 DCEI(1)=0.
2843 DCEI(2)=0.03
2844 DCEI(3)=86.31/2.
2845 CALL GSVOLU('SCE5','TUBE',IDTMED(253),DCEI,3,IOUT)
2846C
2847C --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2848C (layer #5)
2849C
2850 DPLA(1)=(10./(8.*7.))/2.
2851 DPLA(2)=3.5
2852 DPLA(3)=4.
2853 CALL GSVOLU('EPL5','BOX ',IDTMED(263),DPLA,3,IOUT)
2854C
2855C --- Define the part of the end-ladder stuff made of copper (layer #5)
2856C
2857 DCOP(1)=(2./(8.*7.))/2.
2858 DCOP(2)=3.5
2859 DCOP(3)=4.
2860 CALL GSVOLU('ECU5','BOX ',IDTMED(260),DCOP,3,IOUT)
2861C
2862C --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2863C
2864 DEPX(1)=(30./(8.*7.))/2.
2865 DEPX(2)=3.5
2866 DEPX(3)=4.
2867 CALL GSVOLU('EPX5','BOX ',IDTMED(263),DEPX,3,IOUT)
2868C
2869C --- Define the part of the end-ladder stuff made of silicon (bus)
2870C (layer #5)
2871C
2872 DSIL(1)=(20./(8.*7.))/2.
2873 DSIL(2)=3.5
2874 DSIL(3)=4.
2875 CALL GSVOLU('ESI5','BOX ',IDTMED(252),DSIL,3,IOUT)
2876C
2877C --- Place the end-ladder stuff into its mother (ELL5)
2878C
2879 SEP=(4.-2.*(DPLA(1)+DCOP(1)+DEPX(1)+DSIL(1)))/3.
2880 YPOS=0.
2881 ZPOS=0.
2882C
2883C --- Plastic
2884C
2885 XPOS=-DELA(1)+DPLA(1)
2886 CALL GSPOS('EPL5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2887C
2888C --- Copper
2889C
2890 XPOS=-DELA(1)+2.*DPLA(1)+SEP+DCOP(1)
2891 CALL GSPOS('ECU5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2892C
2893C --- Epoxy
2894C
2895 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+DEPX(1)
2896 CALL GSPOS('EPX5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2897C
2898C --- Silicon (bus)
2899C
2900 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+2.*DEPX(1)+
2901 $ SEP+DSIL(1)
2902 CALL GSPOS('ESI5',1,'ELL5',XPOS,YPOS,ZPOS,0,'ONLY')
2903C
2904C --- Place the sensitive part of the strips into its mother (ISV1)
2905C
2906 YPOS=0.
2907 DO J=1,22
2908 IF(MOD(J,2).EQ.0) THEN
2909 XPOS=DBOX1(1)-DITS(1)
2910 ELSE
2911 XPOS=-DBOX1(1)+DITS(1)
2912 ENDIF
2913 ZPOS=(-10.+FLOAT(J-1))*3.91-1.96
2914 CALL GSPOS('ITS5',J,'ISV1',XPOS,YPOS,ZPOS,0,'ONLY')
2915 END DO
2916C
2917C --- Place the electronics of the strips into its mother (SSV1)
2918C
2919 YPOS=0.
2920 DO J=1,22
2921 IF(MOD(J,2).EQ.0) THEN
2922 XPOS=-DSRV(1)+0.28
2923 ELSE
2924 XPOS=-DSRV(1)+0.28-2.*DITS(1)-0.03
2925 ENDIF
2926 ZPOS=(-10.+FLOAT(J-1))*3.91-1.96+0.85
2927 CALL GSPOS('SCH5',J,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2928 END DO
2929C
2930C --- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2931C
2932 XPOS=-DSRV(1)+0.41
2933 ZPOS=0.
2934C
2935C --- Left tube (just a matter of convention)
2936C
2937 YPOS=-2.25-0.1
2938 CALL GSPOS('STB5',1,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2939 CALL GSPOS('SWT5',1,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2940C
2941C --- Right tube (just a matter of convention)
2942C
2943 YPOS=2.25+0.1
2944 CALL GSPOS('STB5',2,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2945 CALL GSPOS('SWT5',2,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2946C
2947C --- Place the heat bridge elements into their mother (SSV1)
2948C
2949 XPOS=-DSRV(1)+0.47+(SQRT(3.)/6.)*4.2
2950 YPOS=0.
2951 DO J=1,23
2952 ZPOS=(-10.+FLOAT(J-1))*3.91-1.96-4.2/2.
2953 CALL GSPOS('SFR5',J,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2954 END DO
2955C
2956C --- Place the elements connecting the triangles of the heat bridge
2957C into their mother (SSV1)
2958C
2959 ZPOS=0.
2960C
2961C --- Left element (just a matter of convention)
2962C
2963 XPOS=-DSRV(1)+0.47
2964 YPOS=-(2.1+0.015)
2965 CALL GSPOS('SCE5',1,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2966C
2967C --- Right element
2968C
2969 XPOS=-DSRV(1)+0.47
2970 YPOS=2.1+0.015
2971 CALL GSPOS('SCE5',2,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2972C
2973C --- Top element
2974C
2975 XPOS=-DSRV(1)+0.47+(SQRT(3.)/2.)*4.2+0.015
2976 YPOS=0.
2977 CALL GSPOS('SCE5',3,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
2978C
2979C --- Place the ghost volumes containing the strip ladders (ISV1),
2980C electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2981C their mother volume (IT56)
2982C
2983 OFFSET1=ATG(0.8,36.6)
2984 OFFSET2=5.2
2985 RZERO=36.6+DBOX1(1)
2986 RUNO=36.6+2.*DBOX1(1)+DSRV(1)
2987 RTWO=36.6+2.*DBOX1(1)+DELA(1)
2988 DO I=1,32
2989 ATHETA=TWOPI*FLOAT(I-1)*RADDEG/32.+OFFSET2
2990 CALL SXSROT(IDROTM(1500+I),90.,ATHETA,90.,90.+ATHETA,0.,0.)
2991C
2992C --- Strip ladders
2993C
2994 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/32.+OFFSET1)
2995 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/32.+OFFSET1)
2996 ZPOS=0.
2997 CALL GSPOS('ISV1',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
2998 $ 'ONLY')
2999C
3000C --- Electronics/cooling
3001C
3002 XPOS=RUNO*COS(TWOPI*FLOAT(I-1)/32.+OFFSET1)
3003 YPOS=RUNO*SIN(TWOPI*FLOAT(I-1)/32.+OFFSET1)
3004 ZPOS=0.
3005 CALL GSPOS('SSV1',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
3006 $ 'ONLY')
3007C
3008C --- End-ladders (nagative-Z and positive-Z)
3009C
3010 XPOS=RTWO*COS(TWOPI*FLOAT(I-1)/32.+OFFSET1)
3011 YPOS=RTWO*SIN(TWOPI*FLOAT(I-1)/32.+OFFSET1)
3012 ZPOS=-(DBOX1(3)+DELA(3)+6.)
3013 CALL GSPOS('ELL5',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
3014 $ 'ONLY')
3015 ZPOS=DBOX1(3)+DELA(3)+6.
3016 CALL GSPOS('ELL5',I+35,'IT56',XPOS,YPOS,ZPOS,IDROTM(1500+I),
3017 $ 'ONLY')
3018 END DO
3019C
30206678 CONTINUE
3021C
3022C --- Layer #6
3023C
3024C GOTO 6778 ! skip ITS layer no. 6
3025C
3026C --- Define a ghost volume containing a single ladder of layer #6 and fill
3027C it with air or vacuum
3028C
3029 DBOX2(1)=(0.0600+2.*0.0150)/2.
3030 DBOX2(2)=3.75
3031 DBOX2(3)=94.13/2.
3032 CALL GSVOLU('ISV2','BOX ',IDTMED(254),DBOX2,3,IOUT)
3033C
3034C --- Make the ghost volume invisible
3035C
3036 CALL GSATT('ISV2','SEEN',0)
3037C
3038C --- Define a ghost volume containing the electronics and cooling of
3039C a single ladder of layer #6 and fill it with air or vacuum
3040C
3041 DSRV(1)=(0.47+(SQRT(3.)/2.)*4.2+0.05)/2.
3042 DSRV(2)=3.75
3043 DSRV(3)=94.13/2.
3044 CALL GSVOLU('SSV2','BOX ',IDTMED(254),DSRV,3,IOUT)
3045C
3046C --- Make the ghost volume invisible
3047C
3048 CALL GSATT('SSV2','SEEN',0)
3049C
3050C --- Define a ghost volume containing the end-ladder stuff of
3051C a single ladder of layer #6 and fill it with air or vacuum
3052C
3053 DELA(1)=2.
3054 DELA(2)=3.5
3055 DELA(3)=4.0
3056 CALL GSVOLU('ELL6','BOX ',IDTMED(254),DELA,3,IOUT)
3057C
3058C --- Make the ghost volume invisible
3059C
3060 CALL GSATT('ELL6','SEEN',0)
3061C
3062C --- Define a volume containing the sensitive part of the strips
3063C (silicon, layer #6)
3064C
3065 DITS(1)=0.0150
3066 DITS(2)=3.75
3067 DITS(3)=2.1
3068 CALL GSVOLU('ITS6','BOX ',IDTMED(250),DITS,3,IOUT)
3069C
3070C --- Define a volume containing the electronics of the strips
3071C (silicon, layer #6)
3072C
3073 DCHI(1)=0.02
3074 DCHI(2)=3.4
3075 DCHI(3)=0.525
3076 CALL GSVOLU('SCH6','BOX ',IDTMED(251),DCHI,3,IOUT)
3077C
3078C --- Define the cooling tubes (aluminum, layer #6)
3079C
3080 DTUB(1)=0.09
3081 DTUB(2)=DTUB(1)+0.01
3082 DTUB(3)=94.13/2.
3083 CALL GSVOLU('STB6','TUBE',IDTMED(256),DTUB,3,IOUT)
3084C
3085C --- Define the cooling fluid (water or freon, layer #6)
3086C
3087 DWAT(1)=0.
3088 DWAT(2)=0.09
3089 DWAT(3)=94.13/2.
3090 CALL GSVOLU('SWT6','TUBE',IDTMED(257),DWAT,3,IOUT) ! water
3091C CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3092C
3093C --- Define the (triangular) element of the heat bridge (carbon, layer #6)
3094C
3095 DFRA(1)=120.
3096 DFRA(2)=360.
3097 DFRA(3)=3.
3098 DFRA(4)=2.
3099 DFRA(5)=-0.015
3100 DFRA(6)=4.2*SQRT(3.)/6.
3101 DFRA(7)=DFRA(6)+0.03
3102 DFRA(8)=0.015
3103 DFRA(9)=DFRA(6)
3104 DFRA(10)=DFRA(7)
3105 CALL GSVOLU('SFR6','PGON',IDTMED(253),DFRA,10,IOUT)
3106C
3107C --- Define the element connecting the triangles of the heat bridge
3108C (carbon, layer #6)
3109C
3110 DCEI(1)=0.
3111 DCEI(2)=0.03
3112 DCEI(3)=94.13/2.
3113 CALL GSVOLU('SCE6','TUBE',IDTMED(253),DCEI,3,IOUT)
3114C
3115C --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3116C (layer #6)
3117C
3118 DPLA(1)=(10./(8.*7.))/2.
3119 DPLA(2)=3.5
3120 DPLA(3)=4.
3121 CALL GSVOLU('EPL6','BOX ',IDTMED(263),DPLA,3,IOUT)
3122C
3123C --- Define the part of the end-ladder stuff made of copper (layer #6)
3124C
3125 DCOP(1)=(2./(8.*7.))/2.
3126 DCOP(2)=3.5
3127 DCOP(3)=4.
3128 CALL GSVOLU('ECU6','BOX ',IDTMED(260),DCOP,3,IOUT)
3129C
3130C --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3131C
3132 DEPX(1)=(30./(8.*7.))/2.
3133 DEPX(2)=3.5
3134 DEPX(3)=4.
3135 CALL GSVOLU('EPX6','BOX ',IDTMED(263),DEPX,3,IOUT)
3136C
3137C --- Define the part of the end-ladder stuff made of silicon (bus)
3138C (layer #6)
3139C
3140 DSIL(1)=(20./(8.*7.))/2.
3141 DSIL(2)=3.5
3142 DSIL(3)=4.
3143 CALL GSVOLU('ESI6','BOX ',IDTMED(252),DSIL,3,IOUT)
3144C
3145C --- Place the end-ladder stuff into its mother (ELL5)
3146C
3147 SEP=(4.-2.*(DPLA(1)+DCOP(1)+DEPX(1)+DSIL(1)))/3.
3148 YPOS=0.
3149 ZPOS=0.
3150C
3151C --- Plastic
3152C
3153 XPOS=-DELA(1)+DPLA(1)
3154 CALL GSPOS('EPL6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
3155C
3156C --- Copper
3157C
3158 XPOS=-DELA(1)+2.*DPLA(1)+SEP+DCOP(1)
3159 CALL GSPOS('ECU6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
3160C
3161C --- Epoxy
3162C
3163 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+DEPX(1)
3164 CALL GSPOS('EPX6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
3165C
3166C --- Silicon (bus)
3167C
3168 XPOS=-DELA(1)+2.*DPLA(1)+SEP+2.*DCOP(1)+SEP+2.*DEPX(1)+
3169 $ SEP+DSIL(1)
3170 CALL GSPOS('ESI6',1,'ELL6',XPOS,YPOS,ZPOS,0,'ONLY')
3171C
3172C --- Place the sensitive part of the strips into its mother (ISV2)
3173C
3174 YPOS=0.
3175 DO J=1,24
3176 IF(MOD(J,2).EQ.0) THEN
3177 XPOS=-DBOX2(1)+DITS(1)
3178 ELSE
3179 XPOS=DBOX2(1)-DITS(1)
3180 ENDIF
3181 ZPOS=(-11.+FLOAT(J-1))*3.91-1.96
3182 CALL GSPOS('ITS6',J,'ISV2',XPOS,YPOS,ZPOS,0,'ONLY')
3183 END DO
3184C
3185C --- Place the electronics of the strips into its mother (SSV2)
3186C
3187 YPOS=0.
3188 DO J=1,24
3189 IF(MOD(J,2).EQ.0) THEN
3190 XPOS=-DSRV(1)+0.28-2.*DITS(1)-0.03
3191 ELSE
3192 XPOS=-DSRV(1)+0.28
3193 ENDIF
3194 ZPOS=(-11.+FLOAT(J-1))*3.91-1.96+0.85
3195 CALL GSPOS('SCH5',J,'SSV1',XPOS,YPOS,ZPOS,0,'ONLY')
3196 END DO
3197C
3198C --- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3199C
3200 XPOS=-DSRV(1)+0.41
3201 ZPOS=0.
3202C
3203C --- Left tube (just a matter of convention)
3204C
3205 YPOS=-2.25-0.1
3206 CALL GSPOS('STB6',1,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3207 CALL GSPOS('SWT6',1,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3208C
3209C --- Right tube (just a matter of convention)
3210C
3211 YPOS=2.25+0.1
3212 CALL GSPOS('STB6',2,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3213 CALL GSPOS('SWT6',2,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3214C
3215C --- Place the heat bridge elements into their mother (SSV2)
3216C
3217 XPOS=-DSRV(1)+0.47+(SQRT(3.)/6.)*4.2
3218 YPOS=0.
3219 DO J=1,25
3220 ZPOS=(-11.+FLOAT(J-1))*3.91-1.96-4.2/2.
3221 CALL GSPOS('SFR6',J,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3222 END DO
3223C
3224C --- Place the elements connecting the triangles of the heat bridge
3225C into their mother (SSV2)
3226C
3227 ZPOS=0.
3228C
3229C --- Left element (just a matter of convention)
3230C
3231 XPOS=-DSRV(1)+0.47
3232 YPOS=-(2.1+0.015)
3233 CALL GSPOS('SCE6',1,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3234C
3235C --- Right element
3236C
3237 XPOS=-DSRV(1)+0.47
3238 YPOS=2.1+0.015
3239 CALL GSPOS('SCE6',2,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3240C
3241C --- Top element
3242C
3243 XPOS=-DSRV(1)+0.47+(SQRT(3.)/2.)*4.2+0.015
3244 YPOS=0.
3245 CALL GSPOS('SCE6',3,'SSV2',XPOS,YPOS,ZPOS,0,'ONLY')
3246C
3247C --- Place the ghost volumes containing the strip ladders (ISV2),
3248C electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3249C their mother volume (IT56)
3250C
3251 OFFSET1=ATG(0.9,41.2)
3252 OFFSET2=5.2
3253 RZERO=41.2+DBOX2(1)
3254 RUNO=41.2+2.*DBOX2(1)+DSRV(1)
3255 RTWO=41.2+2.*DBOX2(1)+DELA(1)
3256 DO I=1,36
3257 ATHETA=TWOPI*FLOAT(I-1)*RADDEG/36.+OFFSET2
3258 CALL SXSROT(IDROTM(1600+I),90.,ATHETA,90.,90.+ATHETA,0.,0.)
3259C
3260C --- Strip ladders
3261C
3262 XPOS=RZERO*COS(TWOPI*FLOAT(I-1)/36.+OFFSET1)
3263 YPOS=RZERO*SIN(TWOPI*FLOAT(I-1)/36.+OFFSET1)
3264 ZPOS=0.
3265 CALL GSPOS('ISV2',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
3266 $ 'ONLY')
3267C
3268C --- Electronics/cooling
3269C
3270 XPOS=RUNO*COS(TWOPI*FLOAT(I-1)/36.+OFFSET1)
3271 YPOS=RUNO*SIN(TWOPI*FLOAT(I-1)/36.+OFFSET1)
3272 ZPOS=0.
3273 CALL GSPOS('SSV2',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
3274 $ 'ONLY')
3275C
3276C --- End-ladders (nagative-Z and positive-Z)
3277C
3278 XPOS=RTWO*COS(TWOPI*FLOAT(I-1)/36.+OFFSET1)
3279 YPOS=RTWO*SIN(TWOPI*FLOAT(I-1)/36.+OFFSET1)
3280 ZPOS=-(DBOX2(3)+DELA(3)+6.)
3281 CALL GSPOS('ELL6',I,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
3282 $ 'ONLY')
3283 ZPOS=DBOX2(3)+DELA(3)+6.
3284 CALL GSPOS('ELL6',I+39,'IT56',XPOS,YPOS,ZPOS,IDROTM(1600+I),
3285 $ 'ONLY')
3286 END DO
3287C
32886778 CONTINUE
3289C
3290 ENDIF
3291C
3292C ************************************************************************
3293C * *
3294C * E N D - C A P S A N D F R A M E S *
3295C * ========================================= *
3296C * *
3297C ************************************************************************
3298C
3299C --- Define a dummy cylinder for multiple scattering tests
3300C
3301C GOTO 7890 ! skip dummy cylinder for multiple scattering tests
3302C
3303C DITS(1)=49.
3304C DITS(2)=DITS(1)+0.1
3305C DITS(3)=60.3
3306C CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3307C CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3308C7890 CONTINUE
3309C
3310C --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3311C
3312 IF(IVERS.EQ.40 .OR. IVERS.EQ.43) THEN
3313C
3314C GOTO 8901 ! skip outer wall
3315C
3316 DITS(1)=49.9
3317 DITS(2)=DITS(1)+0.06926
3318 DITS(3)=62.7+2.*DPCB(3)-10.5 ! old value 60.3
3319 CALL GSVOLU('ITSG','TUBE',IDTMED(275),DITS,3,I)
3320 CALL GSPOS('ITSG',1,'ITSV',0.,0.,0.,0,'ONLY')
3321 ELSE
3322 GOTO 8901
3323 ENDIF
33248901 CONTINUE
3325C
3326C --- The frame between the end-caps (octagonal lay-out) ---
3327C
3328C GOTO 9012 ! skip octagonal frame
3329C
3330 IF(IVERS.EQ.41) THEN
3331C
3332 RZERO=34.0
3333 DTRA(1)=0.92
3334 DTRA(2)=1.0
3335 DTRA(3)=50.5+2.*DPCB(3)-10.5
3336 DTRA1(1)=0.92
3337 DTRA1(2)=1.0
3338 DTRA1(3)=SQRT(DTRA(3)*DTRA(3)+(55.4*55.4-50.5*50.5))/2.
3339 ANGLE=360./8.
3340 OFFSET=ANGLE/2.
3341 DO I=1,8
3342 XTRA(I)=RZERO*COS(FLOAT(I-1)*ANGLE*DEGRAD)
3343 YTRA(I)=RZERO*SIN(FLOAT(I-1)*ANGLE*DEGRAD)
3344 ZTRA(I)=0.
3345 CALL GSVOLU(NATRA(I),'TUBE',IDTMED(275),DTRA,3,IOUT)
3346 CALL GSPOS(NATRA(I),1,'ITSV',XTRA(I),YTRA(I),ZTRA(I),0,
3347 $ 'ONLY')
3348 END DO
3349C
3350 ATHETA=22.5
3351 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3352 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3353 $ RADDEG
3354 APHI2=180.-APHI1
3355 XPOS=(XTRA(1)+XTRA(2))/2.
3356 YPOS=(YTRA(1)+YTRA(2))/2.
3357 ZPOS=DTRA(3)/2.
3358 CALL GSVOLU(NATRA1(1),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3359 CALL SXSROT(IDROTM(5101),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3360 $ ,90.+ATHETA)
3361 CALL GSPOS(NATRA1(1),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5101),'ONLY'
3362 $ )
3363 ZPOS=-DTRA(3)/2.
3364 CALL GSVOLU(NATRA1(2),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3365 CALL SXSROT(IDROTM(5102),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3366 $ ,90.+ATHETA)
3367 CALL GSPOS(NATRA1(2),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5102),'ONLY'
3368 $ )
3369C
3370 ATHETA=67.5
3371 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3372 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3373 $ RADDEG
3374 APHI1=180.-APHI2
3375 XPOS=(XTRA(2)+XTRA(3))/2.
3376 YPOS=(YTRA(2)+YTRA(3))/2.
3377 ZPOS=DTRA(3)/2.
3378 CALL GSVOLU(NATRA1(3),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3379 CALL SXSROT(IDROTM(5103),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3380 $ ,90.+ATHETA)
3381 CALL GSPOS(NATRA1(3),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5103),'ONLY'
3382 $ )
3383 ZPOS=-DTRA(3)/2.
3384 CALL GSVOLU(NATRA1(4),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3385 CALL SXSROT(IDROTM(5104),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3386 $ ,90.+ATHETA)
3387 CALL GSPOS(NATRA1(4),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5104),'ONLY'
3388 $ )
3389C
3390 ATHETA=112.5
3391 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3392 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3393 $ RADDEG
3394 APHI2=180.-APHI1
3395 XPOS=(XTRA(3)+XTRA(4))/2.
3396 YPOS=(YTRA(3)+YTRA(4))/2.
3397 ZPOS=DTRA(3)/2.
3398 CALL GSVOLU(NATRA1(5),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3399 CALL SXSROT(IDROTM(5105),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3400 $ ,90.+ATHETA)
3401 CALL GSPOS(NATRA1(5),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5105),'ONLY'
3402 $ )
3403 ZPOS=-DTRA(3)/2.
3404 CALL GSVOLU(NATRA1(6),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3405 CALL SXSROT(IDROTM(5106),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3406 $ ,90.+ATHETA)
3407 CALL GSPOS(NATRA1(6),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5106),'ONLY'
3408 $ )
3409C
3410 ATHETA=157.5
3411 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3412 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3413 $ RADDEG
3414 APHI1=180.-APHI2
3415 XPOS=(XTRA(4)+XTRA(5))/2.
3416 YPOS=(YTRA(4)+YTRA(5))/2.
3417 ZPOS=DTRA(3)/2.
3418 CALL GSVOLU(NATRA1(7),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3419 CALL SXSROT(IDROTM(5107),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3420 $ ,90.+ATHETA)
3421 CALL GSPOS(NATRA1(7),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5107),'ONLY'
3422 $ )
3423 ZPOS=-DTRA(3)/2.
3424 CALL GSVOLU(NATRA1(8),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3425 CALL SXSROT(IDROTM(5108),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3426 $ ,90.+ATHETA)
3427 CALL GSPOS(NATRA1(8),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5108),'ONLY'
3428 $ )
3429C
3430 ATHETA=22.5
3431 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3432 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3433 $ RADDEG
3434 APHI1=180.-APHI2
3435 XPOS=(XTRA(5)+XTRA(6))/2.
3436 YPOS=(YTRA(5)+YTRA(6))/2.
3437 ZPOS=DTRA(3)/2.
3438 CALL GSVOLU(NATRA1(9),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3439 CALL SXSROT(IDROTM(5109),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3440 $ ,90.+ATHETA)
3441 CALL GSPOS(NATRA1(9),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5109),'ONLY'
3442 $ )
3443 ZPOS=-DTRA(3)/2.
3444 CALL GSVOLU(NATRA1(10),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3445 CALL SXSROT(IDROTM(5110),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3446 $ ,90.+ATHETA)
3447 CALL GSPOS(NATRA1(10),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5110)
3448 $ ,'ONLY')
3449C
3450 ATHETA=67.5
3451 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3452 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3453 $ RADDEG
3454 APHI2=180.-APHI1
3455 XPOS=(XTRA(6)+XTRA(7))/2.
3456 YPOS=(YTRA(6)+YTRA(7))/2.
3457 ZPOS=DTRA(3)/2.
3458 CALL GSVOLU(NATRA1(11),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3459 CALL SXSROT(IDROTM(5111),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3460 $ ,90.+ATHETA)
3461 CALL GSPOS(NATRA1(11),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5111)
3462 $ ,'ONLY')
3463 ZPOS=-DTRA(3)/2.
3464 CALL GSVOLU(NATRA1(12),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3465 CALL SXSROT(IDROTM(5112),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3466 $ ,90.+ATHETA)
3467 CALL GSPOS(NATRA1(12),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5112)
3468 $ ,'ONLY')
3469C
3470 ATHETA=112.5
3471 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3472 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3473 $ RADDEG
3474 APHI1=180.-APHI2
3475 XPOS=(XTRA(7)+XTRA(8))/2.
3476 YPOS=(YTRA(7)+YTRA(8))/2.
3477 ZPOS=DTRA(3)/2.
3478 CALL GSVOLU(NATRA1(13),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3479 CALL SXSROT(IDROTM(5113),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3480 $ ,90.+ATHETA)
3481 CALL GSPOS(NATRA1(13),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5113)
3482 $ ,'ONLY')
3483 ZPOS=-DTRA(3)/2.
3484 CALL GSVOLU(NATRA1(14),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3485 CALL SXSROT(IDROTM(5114),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3486 $ ,90.+ATHETA)
3487 CALL GSPOS(NATRA1(14),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5114)
3488 $ ,'ONLY')
3489C
3490 ATHETA=157.5
3491 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3492 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3493 $ RADDEG
3494 APHI2=180.-APHI1
3495 XPOS=(XTRA(8)+XTRA(1))/2.
3496 YPOS=(YTRA(8)+YTRA(1))/2.
3497 ZPOS=DTRA(3)/2.
3498 CALL GSVOLU(NATRA1(15),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3499 CALL SXSROT(IDROTM(5115),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3500 $ ,90.+ATHETA)
3501 CALL GSPOS(NATRA1(15),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5115)
3502 $ ,'ONLY')
3503 ZPOS=-DTRA(3)/2.
3504 CALL GSVOLU(NATRA1(16),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3505 CALL SXSROT(IDROTM(5116),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3506 $ ,90.+ATHETA)
3507 CALL GSPOS(NATRA1(16),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5116)
3508 $ ,'ONLY')
3509C
3510C
3511 ELSEIF(IVERS.EQ.44) THEN
3512C
3513C
3514 RZERO=34.0
3515 DTRA(1)=0.92
3516 DTRA(2)=1.0
3517 DTRA(3)=50.5+2.*DPCB(3)-10.5
3518 DTRA1(1)=0.92
3519 DTRA1(2)=1.0
3520 DTRA1(3)=SQRT(DTRA(3)*DTRA(3)+(55.4*55.4-50.5*50.5))/2.
3521 ANGLE=360./8.
3522 OFFSET=ANGLE/2.
3523 DO I=1,8
3524 XTRA(I)=RZERO*COS(FLOAT(I-1)*ANGLE*DEGRAD)
3525 YTRA(I)=RZERO*SIN(FLOAT(I-1)*ANGLE*DEGRAD)
3526 ZTRA(I)=0.
3527 CALL GSVOLU(NATRA(I),'TUBE',IDTMED(275),DTRA,3,IOUT)
3528 CALL GSPOS(NATRA(I),1,'ITSV',XTRA(I),YTRA(I),ZTRA(I),0,
3529 $ 'ONLY')
3530 END DO
3531C
3532 ATHETA=22.5
3533 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3534 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3535 $ RADDEG
3536 APHI2=180.-APHI1
3537 XPOS=(XTRA(1)+XTRA(2))/2.
3538 YPOS=(YTRA(1)+YTRA(2))/2.
3539 ZPOS=DTRA(3)/2.
3540 CALL GSVOLU(NATRA1(1),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3541 CALL SXSROT(IDROTM(5101),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3542 $ ,90.+ATHETA)
3543 CALL GSPOS(NATRA1(1),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5101),'ONLY'
3544 $ )
3545 ZPOS=-DTRA(3)/2.
3546 CALL GSVOLU(NATRA1(2),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3547 CALL SXSROT(IDROTM(5102),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3548 $ ,90.+ATHETA)
3549 CALL GSPOS(NATRA1(2),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5102),'ONLY'
3550 $ )
3551C
3552 ATHETA=67.5
3553 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3554 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3555 $ RADDEG
3556 APHI1=180.-APHI2
3557 XPOS=(XTRA(2)+XTRA(3))/2.
3558 YPOS=(YTRA(2)+YTRA(3))/2.
3559 ZPOS=DTRA(3)/2.
3560 CALL GSVOLU(NATRA1(3),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3561 CALL SXSROT(IDROTM(5103),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3562 $ ,90.+ATHETA)
3563 CALL GSPOS(NATRA1(3),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5103),'ONLY'
3564 $ )
3565 ZPOS=-DTRA(3)/2.
3566 CALL GSVOLU(NATRA1(4),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3567 CALL SXSROT(IDROTM(5104),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3568 $ ,90.+ATHETA)
3569 CALL GSPOS(NATRA1(4),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5104),'ONLY'
3570 $ )
3571C
3572 ATHETA=112.5
3573 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3574 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3575 $ RADDEG
3576 APHI2=180.-APHI1
3577 XPOS=(XTRA(3)+XTRA(4))/2.
3578 YPOS=(YTRA(3)+YTRA(4))/2.
3579 ZPOS=DTRA(3)/2.
3580 CALL GSVOLU(NATRA1(5),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3581 CALL SXSROT(IDROTM(5105),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3582 $ ,90.+ATHETA)
3583 CALL GSPOS(NATRA1(5),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5105),'ONLY'
3584 $ )
3585 ZPOS=-DTRA(3)/2.
3586 CALL GSVOLU(NATRA1(6),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3587 CALL SXSROT(IDROTM(5106),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3588 $ ,90.+ATHETA)
3589 CALL GSPOS(NATRA1(6),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5106),'ONLY'
3590 $ )
3591C
3592 ATHETA=157.5
3593 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3594 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3595 $ RADDEG
3596 APHI1=180.-APHI2
3597 XPOS=(XTRA(4)+XTRA(5))/2.
3598 YPOS=(YTRA(4)+YTRA(5))/2.
3599 ZPOS=DTRA(3)/2.
3600 CALL GSVOLU(NATRA1(7),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3601 CALL SXSROT(IDROTM(5107),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3602 $ ,90.+ATHETA)
3603 CALL GSPOS(NATRA1(7),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5107),'ONLY'
3604 $ )
3605 ZPOS=-DTRA(3)/2.
3606 CALL GSVOLU(NATRA1(8),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3607 CALL SXSROT(IDROTM(5108),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3608 $ ,90.+ATHETA)
3609 CALL GSPOS(NATRA1(8),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5108),'ONLY'
3610 $ )
3611C
3612 ATHETA=22.5
3613 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3614 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3615 $ RADDEG
3616 APHI1=180.-APHI2
3617 XPOS=(XTRA(5)+XTRA(6))/2.
3618 YPOS=(YTRA(5)+YTRA(6))/2.
3619 ZPOS=DTRA(3)/2.
3620 CALL GSVOLU(NATRA1(9),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3621 CALL SXSROT(IDROTM(5109),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3622 $ ,90.+ATHETA)
3623 CALL GSPOS(NATRA1(9),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5109),'ONLY'
3624 $ )
3625 ZPOS=-DTRA(3)/2.
3626 CALL GSVOLU(NATRA1(10),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3627 CALL SXSROT(IDROTM(5110),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3628 $ ,90.+ATHETA)
3629 CALL GSPOS(NATRA1(10),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5110)
3630 $ ,'ONLY')
3631C
3632 ATHETA=67.5
3633 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3634 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3635 $ RADDEG
3636 APHI2=180.-APHI1
3637 XPOS=(XTRA(6)+XTRA(7))/2.
3638 YPOS=(YTRA(6)+YTRA(7))/2.
3639 ZPOS=DTRA(3)/2.
3640 CALL GSVOLU(NATRA1(11),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3641 CALL SXSROT(IDROTM(5111),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3642 $ ,90.+ATHETA)
3643 CALL GSPOS(NATRA1(11),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5111)
3644 $ ,'ONLY')
3645 ZPOS=-DTRA(3)/2.
3646 CALL GSVOLU(NATRA1(12),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3647 CALL SXSROT(IDROTM(5112),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3648 $ ,90.+ATHETA)
3649 CALL GSPOS(NATRA1(12),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5112)
3650 $ ,'ONLY')
3651C
3652 ATHETA=112.5
3653 APHI2=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3654 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3655 $ RADDEG
3656 APHI1=180.-APHI2
3657 XPOS=(XTRA(7)+XTRA(8))/2.
3658 YPOS=(YTRA(7)+YTRA(8))/2.
3659 ZPOS=DTRA(3)/2.
3660 CALL GSVOLU(NATRA1(13),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3661 CALL SXSROT(IDROTM(5113),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3662 $ ,90.+ATHETA)
3663 CALL GSPOS(NATRA1(13),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5113)
3664 $ ,'ONLY')
3665 ZPOS=-DTRA(3)/2.
3666 CALL GSVOLU(NATRA1(14),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3667 CALL SXSROT(IDROTM(5114),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3668 $ ,90.+ATHETA)
3669 CALL GSPOS(NATRA1(14),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5114)
3670 $ ,'ONLY')
3671C
3672 ATHETA=157.5
3673 APHI1=ACOS(DTRA(3)/SQRT(DTRA(3)*DTRA(3)+
3674 $ ((50.5/COS(28.*DEGRAD))*(50.5/COS(28.*DEGRAD))-50.5*50.5)))*
3675 $ RADDEG
3676 APHI2=180.-APHI1
3677 XPOS=(XTRA(8)+XTRA(1))/2.
3678 YPOS=(YTRA(8)+YTRA(1))/2.
3679 ZPOS=DTRA(3)/2.
3680 CALL GSVOLU(NATRA1(15),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3681 CALL SXSROT(IDROTM(5115),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3682 $ ,90.+ATHETA)
3683 CALL GSPOS(NATRA1(15),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5115)
3684 $ ,'ONLY')
3685 ZPOS=-DTRA(3)/2.
3686 CALL GSVOLU(NATRA1(16),'TUBE',IDTMED(275),DTRA1,3,IOUT)
3687 CALL SXSROT(IDROTM(5116),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3688 $ ,90.+ATHETA)
3689 CALL GSPOS(NATRA1(16),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5116)
3690 $ ,'ONLY')
3691 ELSE
3692 GOTO 9012
3693 ENDIF
3694C
36959012 CONTINUE
3696C
3697C
3698C --- The frame between the end-caps (hexagonal lay-out) ---
3699C
3700C GOTO 9123 ! skip hexagonal frame
3701C
3702 IF(IVERS.EQ.42) THEN
3703C
3704 RZERO=33.5
3705 DTRA2(1)=0.92
3706 DTRA2(2)=1.0
3707 DTRA2(3)=50.+2.*DPCB(3)-10.5
3708 DTRA3(1)=0.92
3709 DTRA3(2)=1.0
3710 DTRA3(3)=16.75
3711 DTRA4(1)=0.92
3712 DTRA4(2)=1.0
3713 DTRA4(3)=SQRT(DTRA2(3)*DTRA2(3)+(59.9*59.9-50.*50.))/2.
3714 ANGLE=360./6.
3715 OFFSET=ANGLE/2.
3716 DO I=1,6
3717 XTRA1(I)=RZERO*COS((FLOAT(I-1)*ANGLE+OFFSET)*DEGRAD)
3718 YTRA1(I)=RZERO*SIN((FLOAT(I-1)*ANGLE+OFFSET)*DEGRAD)
3719 ZTRA1(I)=0.
3720 CALL GSVOLU(NATRA2(I),'TUBE',IDTMED(275),DTRA2,3,IOUT)
3721 CALL GSPOS(NATRA2(I),1,'ITSV',XTRA1(I),YTRA1(I),ZTRA1(I)
3722 $ ,0,'ONLY')
3723 END DO
3724C
3725 ATHETA=60.
3726 APHI=90.
3727 XPOS=(XTRA1(1)+XTRA1(2))/2.
3728 YPOS=(YTRA1(1)+YTRA1(2))/2.
3729 ZPOS=0.
3730 CALL GSVOLU(NATRA3(1),'TUBE',IDTMED(275),DTRA3,3,IOUT)
3731 CALL SXSROT(IDROTM(5201),90.,ATHETA,90.+APHI,90.+ATHETA,APHI,90.
3732 $ +ATHETA)
3733 CALL GSPOS(NATRA3(1),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5201),'ONLY'
3734 $ )
3735C
3736 ATHETA=120.
3737 APHI=90.
3738 XPOS=(XTRA1(2)+XTRA1(3))/2.
3739 YPOS=(YTRA1(2)+YTRA1(3))/2.
3740 ZPOS=0.
3741 CALL GSVOLU(NATRA3(2),'TUBE',IDTMED(275),DTRA3,3,IOUT)
3742 CALL SXSROT(IDROTM(5202),90.,ATHETA,90.+APHI,90.+ATHETA,APHI,90.
3743 $ +ATHETA)
3744 CALL GSPOS(NATRA3(2),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5202),'ONLY'
3745 $ )
3746C
3747 ATHETA=180.
3748 APHI=90.
3749 XPOS=(XTRA1(3)+XTRA1(4))/2.
3750 YPOS=(YTRA1(3)+YTRA1(4))/2.
3751 ZPOS=0.
3752 CALL GSVOLU(NATRA3(3),'TUBE',IDTMED(275),DTRA3,3,IOUT)
3753 CALL SXSROT(IDROTM(5203),90.,ATHETA,90.+APHI,90.+ATHETA,APHI,90.
3754 $ +ATHETA)
3755 CALL GSPOS(NATRA3(3),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5203),'ONLY'
3756 $ )
3757C
3758 ATHETA=60.
3759 APHI=90.
3760 XPOS=(XTRA1(4)+XTRA1(5))/2.
3761 YPOS=(YTRA1(4)+YTRA1(5))/2.
3762 ZPOS=0.
3763 CALL GSVOLU(NATRA3(4),'TUBE',IDTMED(275),DTRA3,3,IOUT)
3764 CALL SXSROT(IDROTM(5204),90.,ATHETA,90.+APHI,90.+ATHETA,APHI,90.
3765 $ +ATHETA)
3766 CALL GSPOS(NATRA3(4),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5204),'ONLY'
3767 $ )
3768C
3769 ATHETA=120.
3770 APHI=90.
3771 XPOS=(XTRA1(5)+XTRA1(6))/2.
3772 YPOS=(YTRA1(5)+YTRA1(6))/2.
3773 ZPOS=0.
3774 CALL GSVOLU(NATRA3(5),'TUBE',IDTMED(275),DTRA3,3,IOUT)
3775 CALL SXSROT(IDROTM(5205),90.,ATHETA,90.+APHI,90.+ATHETA,APHI,90.
3776 $ +ATHETA)
3777 CALL GSPOS(NATRA3(5),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5205),'ONLY'
3778 $ )
3779C
3780 ATHETA=180.
3781 APHI=90.
3782 XPOS=(XTRA1(6)+XTRA1(1))/2.
3783 YPOS=(YTRA1(6)+YTRA1(1))/2.
3784 ZPOS=0.
3785 CALL GSVOLU(NATRA3(6),'TUBE',IDTMED(275),DTRA3,3,IOUT)
3786 CALL SXSROT(IDROTM(5206),90.,ATHETA,90.+APHI,90.+ATHETA,APHI,90.
3787 $ +ATHETA)
3788 CALL GSPOS(NATRA3(6),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5206),'ONLY'
3789 $ )
3790C
3791 ATHETA=60.
3792 APHI2=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3793 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3794 $ RADDEG
3795 APHI1=180.-APHI2
3796 XPOS=(XTRA1(1)+XTRA1(2))/2.
3797 YPOS=(YTRA1(1)+YTRA1(2))/2.
3798 ZPOS=DTRA2(3)/2.
3799 CALL GSVOLU(NATRA4(1),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3800 CALL SXSROT(IDROTM(5211),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3801 $ ,90.+ATHETA)
3802 CALL GSPOS(NATRA4(1),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5211),'ONLY'
3803 $ )
3804 ZPOS=-DTRA2(3)/2.
3805 CALL GSVOLU(NATRA4(2),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3806 CALL SXSROT(IDROTM(5212),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3807 $ ,90.+ATHETA)
3808 CALL GSPOS(NATRA4(2),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5212),'ONLY'
3809 $ )
3810C
3811 ATHETA=120.
3812 APHI1=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3813 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3814 $ RADDEG
3815 APHI2=180.-APHI1
3816 XPOS=(XTRA1(2)+XTRA1(3))/2.
3817 YPOS=(YTRA1(2)+YTRA1(3))/2.
3818 ZPOS=DTRA2(3)/2.
3819 CALL GSVOLU(NATRA4(3),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3820 CALL SXSROT(IDROTM(5213),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3821 $ ,90.+ATHETA)
3822 CALL GSPOS(NATRA4(3),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5213),'ONLY'
3823 $ )
3824 ZPOS=-DTRA2(3)/2.
3825 CALL GSVOLU(NATRA4(4),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3826 CALL SXSROT(IDROTM(5214),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3827 $ ,90.+ATHETA)
3828 CALL GSPOS(NATRA4(4),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5214),'ONLY'
3829 $ )
3830C
3831 ATHETA=180.
3832 APHI2=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3833 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3834 $ RADDEG
3835 APHI1=180.-APHI2
3836 XPOS=(XTRA1(3)+XTRA1(4))/2.
3837 YPOS=(YTRA1(3)+YTRA1(4))/2.
3838 ZPOS=DTRA2(3)/2.
3839 CALL GSVOLU(NATRA4(5),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3840 CALL SXSROT(IDROTM(5215),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3841 $ ,90.+ATHETA)
3842 CALL GSPOS(NATRA4(5),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5215),'ONLY'
3843 $ )
3844 ZPOS=-DTRA2(3)/2.
3845 CALL GSVOLU(NATRA4(6),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3846 CALL SXSROT(IDROTM(5216),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3847 $ ,90.+ATHETA)
3848 CALL GSPOS(NATRA4(6),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5216),'ONLY'
3849 $ )
3850 ATHETA=180.
3851 APHI1=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3852 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3853 $ RADDEG
3854 APHI2=180.-APHI1
3855 XPOS=(XTRA1(3)+XTRA1(4))/2.
3856 YPOS=(YTRA1(3)+YTRA1(4))/2.
3857 ZPOS=DTRA2(3)/2.
3858 CALL GSVOLU(NATRA4(7),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3859 CALL SXSROT(IDROTM(5217),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3860 $ ,90.+ATHETA)
3861 CALL GSPOS(NATRA4(7),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5217),'ONLY'
3862 $ )
3863 ZPOS=-DTRA2(3)/2.
3864 CALL GSVOLU(NATRA4(8),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3865 CALL SXSROT(IDROTM(5218),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3866 $ ,90.+ATHETA)
3867 CALL GSPOS(NATRA4(8),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5218),'ONLY'
3868 $ )
3869C
3870 ATHETA=60.
3871 APHI2=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3872 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3873 $ RADDEG
3874 APHI1=180.-APHI2
3875 XPOS=(XTRA1(4)+XTRA1(5))/2.
3876 YPOS=(YTRA1(4)+YTRA1(5))/2.
3877 ZPOS=DTRA2(3)/2.
3878 CALL GSVOLU(NATRA4(9),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3879 CALL SXSROT(IDROTM(5219),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3880 $ ,90.+ATHETA)
3881 CALL GSPOS(NATRA4(9),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5219),'ONLY'
3882 $ )
3883 ZPOS=-DTRA2(3)/2.
3884 CALL GSVOLU(NATRA4(10),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3885 CALL SXSROT(IDROTM(5220),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3886 $ ,90.+ATHETA)
3887 CALL GSPOS(NATRA4(10),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5220)
3888 $ ,'ONLY')
3889C
3890 ATHETA=120.
3891 APHI1=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3892 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3893 $ RADDEG
3894 APHI2=180.-APHI1
3895 XPOS=(XTRA1(5)+XTRA1(6))/2.
3896 YPOS=(YTRA1(5)+YTRA1(6))/2.
3897 ZPOS=DTRA2(3)/2.
3898 CALL GSVOLU(NATRA4(11),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3899 CALL SXSROT(IDROTM(5221),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3900 $ ,90.+ATHETA)
3901 CALL GSPOS(NATRA4(11),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5221)
3902 $ ,'ONLY')
3903 ZPOS=-DTRA2(3)/2.
3904 CALL GSVOLU(NATRA4(12),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3905 CALL SXSROT(IDROTM(5222),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3906 $ ,90.+ATHETA)
3907 CALL GSPOS(NATRA4(12),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5222)
3908 $ ,'ONLY')
3909C
3910 ATHETA=180.
3911 APHI2=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3912 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3913 $ RADDEG
3914 APHI1=180.-APHI2
3915 XPOS=(XTRA1(6)+XTRA1(1))/2.
3916 YPOS=(YTRA1(6)+YTRA1(1))/2.
3917 ZPOS=DTRA2(3)/2.
3918 CALL GSVOLU(NATRA4(13),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3919 CALL SXSROT(IDROTM(5223),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3920 $ ,90.+ATHETA)
3921 CALL GSPOS(NATRA4(13),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5223)
3922 $ ,'ONLY')
3923 ZPOS=-DTRA2(3)/2.
3924 CALL GSVOLU(NATRA4(14),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3925 CALL SXSROT(IDROTM(5224),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3926 $ ,90.+ATHETA)
3927 CALL GSPOS(NATRA4(14),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5224)
3928 $ ,'ONLY')
3929 ATHETA=180.
3930 APHI1=ACOS(DTRA2(3)/SQRT(DTRA2(3)*DTRA2(3)+
3931 $ ((50./COS(34.*DEGRAD))*(50./COS(34.*DEGRAD))-50.*50.)))*
3932 $ RADDEG
3933 APHI2=180.-APHI1
3934 XPOS=(XTRA1(6)+XTRA1(1))/2.
3935 YPOS=(YTRA1(6)+YTRA1(1))/2.
3936 ZPOS=DTRA2(3)/2.
3937 CALL GSVOLU(NATRA4(15),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3938 CALL SXSROT(IDROTM(5225),90.,ATHETA,90.+APHI1,90.+ATHETA,APHI1
3939 $ ,90.+ATHETA)
3940 CALL GSPOS(NATRA4(15),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5225)
3941 $ ,'ONLY')
3942 ZPOS=-DTRA2(3)/2.
3943 CALL GSVOLU(NATRA4(16),'TUBE',IDTMED(275),DTRA4,3,IOUT)
3944 CALL SXSROT(IDROTM(5226),90.,ATHETA,90.+APHI2,90.+ATHETA,APHI2
3945 $ ,90.+ATHETA)
3946 CALL GSPOS(NATRA4(16),1,'ITSV',XPOS,YPOS,ZPOS,IDROTM(5226)
3947 $ ,'ONLY')
3948
3949C
3950C
3951 ELSEIF(IVERS.EQ.45) THEN
3952C
3953C
3954 RZERO=33.5
3955 DTRA2(1)=0.92
3956 DTRA2(2)=1.0
3957 DTRA2(3)=50.+2.*DPCB(3)-10.5
3958 DTRA3