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