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