1 ///////////////////////////////////////////////////////////////////////////////
3 // Inner Traking System version 4 //
7 <img src="picts/AliITSv4Class.gif">
10 <font size=+2 color=red>
11 <p>The responsible person for this module is
12 <a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
18 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliCallf77.h"
29 # define its_geo4 its_geo4_
30 extern "C" void type_of_call its_geo4(Int_t&, Int_t*);
34 //_____________________________________________________________________________
35 AliITSv4::AliITSv4() : AliITS()
38 // Default constructor for the ITS
43 //_____________________________________________________________________________
44 AliITSv4::AliITSv4(const char *name, const char *title)
48 // Standard constructor
53 //_____________________________________________________________________________
54 void AliITSv4::CreateGeometry()
57 // Create geometry for its version 4
59 AliMC* pMC = AliMC::GetMC();
61 Int_t ivers=4*10+fMinorVersion;
62 its_geo4(ivers, gAlice->Idtmed());
64 // *** DEFINITION OF THE GEOMETRY OF THE ITS ***
65 // *** RB APR-1990 CATANIA ***
66 // ORIGIN : ROBERTO BARBERA
68 Float_t xx[13] = { 0.,0.,-4.824,-4.833,-22.167,-22.585,-28.07,-27.626,
69 -38.139,-19.749,-13.449,-14.726,0. };
70 Float_t yy[13] = { 0.,34.028,34.064,
71 32.594,29.984,30.914,29.18,27.777,22.522,-7.918,-4.769,-2.216,0. };
72 Float_t xbeg[12] = { 0.,-.497,-4.827,-5.425,-22.395,-23.009,-27.919,
73 -28.161,-37.859,-19.337,-13.673,-13.773 };
74 Float_t ybeg[12] = { .43,34.032,33.564,
75 32.505,30.493,30.781,28.702,27.509,22.058,-7.711,-4.322,-2.073 };
76 Float_t xend[12] = { 0.,-4.323,-4.83,-21.643,-22.395,-27.593,-27.807,
77 -37.655,-19.988,-13.897,-14.294,-.425 };
78 Float_t yend[12] = { 33.531,34.06,33.192,
79 30.064,30.493,29.33,28.347,22.764,-7.523,-4.992,-3.077,-.064 };
80 Float_t xarc[12] = { -19.56,-14.12,-13.669,-.5,-.5,-4.327,-5.529,-21.746,
81 -22.858,-27.442,-28.474,-37.431 };
82 Float_t yarc[12] = { -7.264,-4.545,-2.765,
83 .431,33.531,33.56,33.197,30.756,30.304,28.854,28.136,22.316 };
84 Float_t rarc[12] = { .5,.5,.7,.5,.5,.5,.7,.7,.5,.5,.7,.5 };
90 static Double_t biga, bigb;
91 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],
92 atheta1213, dbus[3], dtub[3], dwat[3], depx[3], dits[3], atheta1112, atheta1011, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
93 static Double_t biga1, bigb1;
94 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3], dtra4[3], dbox1[3], dbox2[3];
96 Float_t xtra1[6], ytra1[6], ztra1[6];
100 Float_t angle, dcone[5], dtube[3], dpgon[10];
101 Float_t rzero, xzero, yzero;
102 static Double_t coeffa, coeffb, coeffc;
104 Float_t atheta, offset;
105 Float_t offset1, offset2, dgh[15];
106 extern Double_t atg_(Float_t *, real *);
107 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56, atheta67, atheta78, atheta89, yos, xxm, dal1[3], dal2[3];
109 static Double_t xcc1, ycc1, xcc2, ycc2;
112 Int_t *idtmed = gAlice->Idtmed();
114 #define natra_ref(a_0,a_1) &natra[(a_1)*4 + a_0 - 4]
115 #define natra1_ref(a_0,a_1) &natra1[(a_1)*4 + a_0 - 4]
116 #define natra2_ref(a_0,a_1) &natra2[(a_1)*4 + a_0 - 4]
117 #define natra3_ref(a_0,a_1) &natra3[(a_1)*4 + a_0 - 4]
118 #define natra4_ref(a_0,a_1) &natra4[(a_1)*4 + a_0 - 4]
121 // --- Define ghost volume containing the whole ITS and fill it with air
140 geant->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
142 // --- Place the ghost volume in its mother volume (ALIC) and make it
145 geant->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
146 geant->Gsatt("ITSV", "SEEN", 0);
148 //************************************************************************
153 //************************************************************************
155 // GOTO 2345 ! skip ITS layer no. 1 and 2
157 //--- Define ghost volume containing the Pixel Detectors and fill it with air
160 xxm = 1.0444222222222224;
164 dgh[3] = -25. - 5.9900000000000002 / xxm;
173 dgh[12] = 5.9900000000000002 / xxm + 25.;
176 geant->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
178 // --- Place the ghost volume in its mother volume (ITSV) and make it
181 geant->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
182 geant->Gsatt("IT12", "SEEN", 0);
184 // --- Define a ghost volume containing a single element of layer #1
185 // and fill it with air or vacuum
187 dbox1[0] = .022499999999999999;
190 geant->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
193 //--- Divide each element of layer #1 in three ladders along the beam direction
195 geant->Gsdvn("IPB1", "IPV1", 3, 3);
197 // --- Make the ghost volumes invisible
199 geant->Gsatt("IPV1", "SEEN", 0);
200 geant->Gsatt("IPB1", "SEEN", 0);
202 // --- Define a volume containing the chip of pixels (silicon, layer #1)
206 dchi[2] = dbox1[2] / 3.;
207 geant->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
209 // --- Define a volume containing the bus of pixels (silicon, layer #1)
214 geant->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
216 // --- Define a volume containing the sensitive part of pixels
217 // (silicon, layer #1)
222 geant->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
224 // --- Place the chip into its mother (IPB1)
226 xpos = dbox1[0] - dchi[0];
229 geant->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
231 // --- Place the sensitive volume into its mother (IPB1)
233 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
234 ypos = dchi[1] - dits[1];
235 zpos = -(dchi[2] - dits[2]);
236 geant->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
238 // --- Place the bus into its mother (IPB1)
240 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
241 ypos = dchi[1] - dbus[1];
242 zpos = -(dchi[2] - dbus[2]);
243 geant->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
245 // --- Define a ghost volume containing a single element of layer #2
246 // and fill it with air or vacuum
248 dbox2[0] = .022499999999999999;
251 geant->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
254 //--- Divide each element of layer #2 in four ladders along the beam direction
256 geant->Gsdvn("IPB2", "IPV2", 4, 3);
258 // --- Make the ghost volumes invisible
260 geant->Gsatt("IPV2", "SEEN", 0);
261 geant->Gsatt("IPB2", "SEEN", 0);
263 // --- Define a volume containing the chip of pixels (silicon, layer #2)
267 dchi[2] = dbox2[2] / 4.;
268 geant->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
270 // --- Define a volume containing the bus of pixels (silicon, layer #2)
275 geant->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
277 // --- Define a volume containing the sensitive part of pixels
278 // (silicon, layer #2)
283 geant->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
285 // --- Place the chip into its mother (IPB2)
287 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
290 geant->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
292 // --- Place the sensitive volume into its mother (IPB2)
294 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
295 ypos = -(dchi[1] - dits[1]);
296 zpos = -(dchi[2] - dits[2]);
297 geant->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
299 // --- Place the bus into its mother (IPB2)
301 xpos = dbox1[0] - dbus[0];
302 ypos = -(dchi[1] - dbus[1]);
303 zpos = -(dchi[2] - dbus[2]);
304 geant->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
306 // --- Define a generic segment of an element of the mechanical support
311 geant->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
313 // --- Define a generic arc of an element of the mechanical support
318 geant->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
320 // --- Define the mechanical supports of layers #1 and #2 and place the
321 // elements of the layers in it
324 // counter over the number of elements of layer #1 (
327 // counter over the number of elements of layer #2 (
328 for (i = 1; i <= 10; ++i) {
330 // --- Place part # 1-2 (see sketch)
332 // number of carbon fiber supports (see sketch)
335 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
337 xcc = (xx[0] + xx[1]) / 20.;
338 ycc = (yy[0] + yy[1]) / 20.;
339 xccc = (xbeg[0] + xend[0]) / 20.;
340 yccc = (ybeg[0] + yend[0]) / 20.;
341 if (xx[0] == xx[1]) {
345 offset2 = atg_(&yy[1] - yy[0], &r2) * raddeg - 90.;
347 aphi = (pphi + (i-1) * 36.) * degrad;
348 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
349 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
350 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
351 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
352 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
353 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
355 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
356 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
357 geant->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
359 // --- Place part # 2-3 (see sketch)
363 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
365 xcc = (xx[1] + xx[2]) / 20.;
366 ycc = (yy[1] + yy[2]) / 20.;
367 xccc = (xbeg[1] + xend[1]) / 20.;
368 yccc = (ybeg[1] + yend[1]) / 20.;
369 if (xx[1] == xx[2]) {
373 offset2 = atg_(&yy[2] - yy[1], &r2) * raddeg - 90.;
375 aphi = (pphi + (i-1) * 36.) * degrad;
376 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
377 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
378 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
379 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
380 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
381 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
383 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
384 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
385 geant->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
387 // --- Place an element of layer #2
389 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
390 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
391 coeffa = biga * biga + 1.;
392 coeffb = biga * bigb - biga * ycc - xcc;
393 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0022212369;
394 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
395 ycc1 = biga * xcc1 + bigb;
397 bigb1 = xcc1 / biga + ycc1;
398 coeffa = biga1 * biga1 + 1.;
399 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
400 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
401 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
402 ycc2 = biga1 * xcc2 + bigb1;
403 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
404 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
405 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
406 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
409 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
411 // --- Place part # 3-4 (see sketch)
415 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
417 xcc = (xx[1] + xx[2]) / 20.;
418 ycc = (yy[1] + yy[2]) / 20.;
419 xccc = (xbeg[2] + xend[2]) / 20.;
420 yccc = (ybeg[2] + yend[2]) / 20.;
421 if (xx[2] == xx[3]) {
425 offset2 = atg_(&yy[3] - yy[2], &r2) * raddeg - 90.;
427 aphi = (pphi + (i-1) * 36.) * degrad;
428 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
429 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
430 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
431 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
432 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
433 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
435 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
436 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
437 geant->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
439 // --- Place part # 4-5 (see sketch)
443 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
445 xcc = (xx[3] + xx[4]) / 20.;
446 ycc = (yy[3] + yy[4]) / 20.;
447 xccc = (xbeg[3] + xend[3]) / 20.;
448 yccc = (ybeg[3] + yend[3]) / 20.;
449 if (xx[3] == xx[4]) {
453 offset2 = atg_(&yy[4] - yy[3], &r2) * raddeg - 90.;
455 aphi = (pphi + (i-1) * 36.) * degrad;
456 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
457 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
458 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
459 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
460 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
461 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
463 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
464 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
465 geant->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
467 // --- Place an element of layer #2
469 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
470 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
471 coeffa = biga * biga + 1.;
472 coeffb = biga * bigb - biga * ycc - xcc;
473 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb + 0.;
477 bigb1 = xcc1 / biga + ycc1;
478 coeffa = biga1 * biga1 + 1.;
479 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
480 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
481 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
482 ycc2 = biga1 * xcc2 + bigb1;
483 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
484 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
485 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
486 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
489 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
491 // --- Place part # 5-6 (see sketch)
495 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
497 xcc = (xx[4] + xx[5]) / 20.;
498 ycc = (yy[4] + yy[5]) / 20.;
499 xccc = (xbeg[4] + xend[4]) / 20.;
500 yccc = (ybeg[4] + yend[4]) / 20.;
501 if (xx[4] == xx[5]) {
505 offset2 = atg_(&yy[5] - yy[4], &r2) * raddeg - 90.;
507 aphi = (pphi + (i-1) * 36.) * degrad;
508 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
509 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
510 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
511 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
512 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
513 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
515 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
516 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
517 geant->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
519 // --- Place part # 6-7 (see sketch)
523 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
525 xcc = (xx[5] + xx[6]) / 20.;
526 ycc = (yy[5] + yy[6]) / 20.;
527 xccc = (xbeg[5] + xend[5]) / 20.;
528 yccc = (ybeg[5] + yend[5]) / 20.;
529 if (xx[5] == xx[6]) {
533 offset2 = atg_(&yy[6] - yy[5], &r2) * raddeg - 90.;
535 aphi = (pphi + (i-1) * 36.) * degrad;
536 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
537 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
538 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
539 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
540 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
541 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
543 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
544 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
545 geant->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
547 // --- Place an element of layer #2
549 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
550 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
551 coeffa = biga * biga + 1.;
552 coeffb = biga * bigb - biga * ycc - xcc;
553 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb + 0.;
557 bigb1 = xcc1 / biga + ycc1;
558 coeffa = biga1 * biga1 + 1.;
559 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
560 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
561 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
562 ycc2 = biga1 * xcc2 + bigb1;
563 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
564 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
565 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
566 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
569 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
571 // --- Place part # 7-8 (see sketch)
575 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
577 xcc = (xx[6] + xx[7]) / 20.;
578 ycc = (yy[6] + yy[7]) / 20.;
579 xccc = (xbeg[6] + xend[6]) / 20.;
580 yccc = (ybeg[6] + yend[6]) / 20.;
581 if (xx[6] == xx[7]) {
585 offset2 = atg_(&yy[7] - yy[6], &r2) * raddeg - 90.;
587 aphi = (pphi + (i-1) * 36.) * degrad;
588 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
589 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
590 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
591 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
592 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
593 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
595 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
596 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
597 geant->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
599 // --- Place part # 8-9 (see sketch)
603 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
605 xcc = (xx[7] + xx[8]) / 20.;
606 ycc = (yy[7] + yy[8]) / 20.;
607 xccc = (xbeg[7] + xend[7]) / 20.;
608 yccc = (ybeg[7] + yend[7]) / 20.;
609 if (xx[1] == xx[2]) {
613 offset2 = atg_(&yy[8] - yy[7], &r2) * raddeg - 90.;
615 aphi = (pphi + (i-1) * 36.) * degrad;
616 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
617 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
618 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
619 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
620 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
621 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
623 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
624 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
625 geant->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
627 // --- Place an element of layer #2
629 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
630 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
631 coeffa = biga * biga + 1.;
632 coeffb = biga * bigb - biga * ycc - xcc;
633 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .055526209599999994;
634 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
635 ycc1 = biga * xcc1 + bigb;
637 bigb1 = xcc1 / biga + ycc1;
638 coeffa = biga1 * biga1 + 1.;
639 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
640 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
641 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
642 ycc2 = biga1 * xcc2 + bigb1;
643 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
644 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
645 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
646 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
649 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
651 // --- Place part # 9-10 (see sketch)
655 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
657 xcc = (xx[8] + xx[9]) / 20.;
658 ycc = (yy[8] + yy[9]) / 20.;
659 xccc = (xbeg[8] + xend[8]) / 20.;
660 yccc = (ybeg[8] + yend[8]) / 20.;
661 if (xx[8] == xx[9]) {
665 offset2 = atg_(&yy[9] - yy[8], &r2) * raddeg - 90.;
667 aphi = (pphi + (i-1) * 36.) * degrad;
668 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
669 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
670 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
671 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
672 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
673 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
675 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
676 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
677 geant->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
679 // --- Place part # 12-13 (see sketch)
683 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
685 xcc = (xx[11] + xx[12]) / 20.;
686 ycc = (yy[11] + yy[12]) / 20.;
687 xccc = (xbeg[11] + xend[11]) / 20.;
688 yccc = (ybeg[11] + yend[11]) / 20.;
689 if (xx[11] == xx[12]) {
692 r2 = xx[12] - xx[11];
693 offset2 = atg_(&yy[12] - yy[11], &r2) * raddeg - 90.;
695 aphi = (pphi + (i-1) * 36.) * degrad;
696 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
697 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
698 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
699 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
700 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
701 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
703 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
704 AliMatrix(idrotm[(i-1) * 13 + 1111], 270., atheta1213, 90., atheta1213 + 270., 0., 0.);
705 geant->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
707 // --- Place an element of layer #1
709 biga = (yy[12] - yy[11]) / (xx[12] - xx[11]);
710 bigb = (xx[12] * yy[11] - xx[11] * yy[12]) / (xx[12] - xx[11]) / 10.;
711 coeffa = biga * biga + 1.;
712 coeffb = biga * bigb - biga * ycc - xcc;
713 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .015792948900000003;
714 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
715 ycc1 = biga * xcc1 + bigb;
717 bigb1 = xcc1 / biga + ycc1;
718 coeffa = biga1 * biga1 + 1.;
719 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
720 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
721 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
722 ycc2 = biga1 * xcc2 + bigb1;
723 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
724 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
725 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
726 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
729 geant->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY");
731 // --- Place part # 11-12 (see sketch)
735 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
737 xcc = (xx[10] + xx[11]) / 20.;
738 ycc = (yy[10] + yy[11]) / 20.;
739 xccc = (xbeg[10] + xend[10]) / 20.;
740 yccc = (ybeg[10] + yend[10]) / 20.;
741 if (xx[10] == xx[11]) {
744 r2 = xx[11] - xx[10];
745 offset2 = atg_(&yy[11] - yy[10], &r2) * raddeg - 90.;
747 aphi = (pphi + (i-1) * 36.) * degrad;
748 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
749 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
750 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
751 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
752 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
753 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
755 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
756 AliMatrix(idrotm[(i-1) * 13 + 1110], 90., atheta1112, 90.,atheta1112 + 90., 0., 0.);
757 geant->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
759 // --- Place part # 10-11 (see sketch)
763 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
765 xcc = (xx[9] + xx[10]) / 20.;
766 ycc = (yy[9] + yy[10]) / 20.;
767 xccc = (xbeg[9] + xend[9]) / 20.;
768 yccc = (ybeg[9] + yend[9]) / 20.;
769 if (xx[9] == xx[10]) {
773 offset2 = atg_(&yy[10] - yy[9], &r2) * raddeg - 90.;
775 aphi = (pphi + (i-1) * 36.) * degrad;
776 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
777 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
778 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
779 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
780 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
781 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
783 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
784 AliMatrix(idrotm[(i-1) * 13 + 1109], 270., atheta1011, 90., atheta1011 + 270., 0., 0.);
785 geant->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
787 // --- Place an element of layer #1
789 biga = (yy[10] - yy[9]) / (xx[10] - xx[9]);
790 bigb = (xx[10] * yy[9] - xx[9] * yy[10]) / (xx[10] - xx[9]) / 10.;
791 coeffa = biga * biga + 1.;
792 coeffb = biga * bigb - biga * ycc - xcc;
793 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 9.9999999999999995e-7;
794 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
795 ycc1 = biga * xcc1 + bigb;
797 bigb1 = xcc1 / biga + ycc1;
798 coeffa = biga1 * biga1 + 1.;
799 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
800 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
801 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
802 ycc2 = biga1 * xcc2 + bigb1;
803 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
804 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
805 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
806 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
809 geant->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY");
811 // --- Place arc # 5 (between part 1-2 and part 2-3) (see sketch)
813 darc[0] = rarc[4] / 10. - .02;
814 darc[1] = rarc[4] / 10.;
816 darc[3] = atheta12 + 90. - (i-1) * 36.;
817 darc[4] = atheta23 + 90. - (i-1) * 36.;
820 aphi = (pphi + (i-1) * 36.) * degrad;
821 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
822 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
823 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
824 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
825 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
826 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
828 geant->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
830 // --- Place arc # 6 (between part 2-3 and part 3-4) (see sketch)
832 darc[0] = rarc[5] / 10. - .02;
833 darc[1] = rarc[5] / 10.;
835 darc[3] = atheta23 - (i-1) * 36.;
836 darc[4] = atheta34 - (i-1) * 36.;
839 aphi = (pphi + (i-1) * 36.) * degrad;
840 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
841 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
842 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
843 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
844 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
845 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
847 geant->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
849 // --- Place arc # 7 (between part 3-4 and part 4-5) (see sketch)
851 darc[0] = rarc[6] / 10. - .02;
852 darc[1] = rarc[6] / 10.;
854 darc[3] = atheta45 + 90. - (i-1) * 36.;
855 darc[4] = atheta34 + 90. - (i-1) * 36.;
858 aphi = (pphi + (i-1) * 36.) * degrad;
859 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
860 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
861 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
862 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
863 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
864 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
866 geant->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
868 // --- Place arc # 8 (between part 4-5 and part 5-6) (see sketch)
870 darc[0] = rarc[7] / 10. - .02;
871 darc[1] = rarc[7] / 10.;
873 darc[3] = atheta56 + 180. - (i-1) * 36.;
874 darc[4] = atheta45 + 180. - (i-1) * 36.;
877 aphi = (pphi + (i-1) * 36.) * degrad;
878 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
879 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
880 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
881 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
882 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
883 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
885 geant->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
887 // --- Place arc # 9 (between part 5-6 and part 6-7) (see sketch)
889 darc[0] = rarc[8] / 10. - .02;
890 darc[1] = rarc[8] / 10.;
892 darc[3] = atheta56 - 90. - (i-1) * 36.;
893 darc[4] = atheta67 - 90. - (i-1) * 36.;
896 aphi = (pphi + (i-1) * 36.) * degrad;
897 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
898 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
899 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
900 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
901 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
902 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
904 geant->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
906 // --- Place arc # 10 (between part 6-7 and part 7-8) (see sketch)
908 darc[0] = rarc[9] / 10. - .02;
909 darc[1] = rarc[9] / 10.;
911 darc[3] = atheta67 - (i-1) * 36.;
912 darc[4] = atheta78 - (i-1) * 36.;
915 aphi = (pphi + (i-1) * 36.) * degrad;
916 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
917 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
918 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
919 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
920 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
921 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
923 geant->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
925 // --- Place arc # 11 (between part 7-8 and part 8-9) (see sketch)
927 darc[0] = rarc[10] / 10. - .02;
928 darc[1] = rarc[10] / 10.;
930 darc[3] = atheta89 - 90. - (i-1) * 36.;
931 darc[4] = atheta78 - 90. - (i-1) * 36.;
932 xcc = xarc[10] / 10.;
933 ycc = yarc[10] / 10.;
934 aphi = (pphi + (i-1) * 36.) * degrad;
935 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
936 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
937 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
938 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
939 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
940 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
942 geant->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
944 // --- Place arc # 12 (between part 8-9 and part 9-10) (see sketch)
946 darc[0] = rarc[11] / 10. - .02;
947 darc[1] = rarc[11] / 10.;
949 darc[3] = atheta89 - (i-1) * 36.;
950 darc[4] = atheta910 - (i-1) * 36.;
951 xcc = xarc[11] / 10.;
952 ycc = yarc[11] / 10.;
953 aphi = (pphi + (i-1) * 36.) * degrad;
954 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
955 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
956 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
957 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
958 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
959 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
961 geant->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
963 // --- Place arc # 1 (between part 9-10 and part 10-11) (see sketch)
965 darc[0] = rarc[0] / 10. - .02;
966 darc[1] = rarc[0] / 10.;
968 darc[3] = atheta1011 + 10. - (i-1) * 36.;
969 darc[4] = atheta910 - 120. - (i-1) * 36.;
972 aphi = (pphi + (i-1) * 36.) * degrad;
973 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
974 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
975 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
976 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
977 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
978 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
980 geant->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
982 // --- Place arc # 2 (between part 10-11 and part 11-12) (see sketch)
984 darc[0] = rarc[1] / 10. - .02;
985 darc[1] = rarc[1] / 10.;
987 darc[3] = atheta1011 - (i-1) * 36.;
988 darc[4] = atheta1112 + 45. - (i-1) * 36.;
991 aphi = (pphi + (i-1) * 36.) * degrad;
992 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
993 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
994 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
995 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
996 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
997 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
999 geant->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1001 // --- Place arc # 3 (between part 11-12 and part 12-13) (see sketch)
1003 darc[0] = rarc[2] / 10. - .02;
1004 darc[1] = rarc[2] / 10.;
1006 darc[3] = atheta1213 + 115. - (i-1) * 36.;
1007 darc[4] = atheta1112 + 115. - (i-1) * 36.;
1008 xcc = xarc[2] / 10.;
1009 ycc = yarc[2] / 10.;
1010 aphi = (pphi + (i-1) * 36.) * degrad;
1011 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1012 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1013 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1014 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1015 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1016 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1018 geant->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1020 // --- Place arc # 4 (between part 12-13 and part 1-2) (see sketch)
1022 darc[0] = rarc[3] / 10. - .02;
1023 darc[1] = rarc[3] / 10.;
1025 darc[3] = atheta1213 - (i-1) * 36.;
1026 darc[4] = atheta12 - (i-1) * 36.;
1027 xcc = xarc[3] / 10.;
1028 ycc = yarc[3] / 10.;
1029 aphi = (pphi + (i-1) * 36.) * degrad;
1030 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1031 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1032 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1033 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1034 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1035 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1037 geant->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1041 //************************************************************************
1046 //************************************************************************
1048 // --- Define a ghost volume containing the Silicon Drift Detectors
1049 // (layer #3 and #4) and fill it with air or vacuum
1051 xxm = 1.0444222222222224;
1055 dgh[3] = -25. - 5.9900000000000002 / xxm -
1056 .0099999999999997868 / xxm - 17.990000000000002 / xxm;
1059 dgh[6] = -25. - 5.9900000000000002 / xxm - .0099999999999997868 / xxm;
1062 dgh[9] = 5.9900000000000002 / xxm + 25. + .0099999999999997868 / xxm;
1065 dgh[12] = 5.9900000000000002 / xxm + 25. +
1066 .0099999999999997868 / xxm + 17.990000000000002 / xxm;
1069 geant->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1071 // --- Place the ghost volume in its mother volume (ITSV) and make it
1074 geant->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1075 geant->Gsatt("IT34", "SEEN", 0);
1079 // GOTO 3456 ! skip ITS layer no. 3
1081 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1082 // smaller lenght of ribs) and fill it with air or vacuum
1084 dbox1[0] = .61539999999999995;
1086 // the widest element is the sensitive element
1087 dbox1[2] = 35.850000000000001;
1088 // 7.5 cm is the lenght
1089 geant->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1091 // --- Make the ghost volume invisible
1093 geant->Gsatt("IDV1", "SEEN", 0);
1095 // --- Define a volume containing the sensitive part of drifts
1096 // (silicon, layer #3)
1099 // see material budget report by G. Feofilov
1102 geant->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1104 //--- Define the part of the (smaller) rib between two sensitive parts made of
1105 // carbon (layer #3)
1107 dsup[0] = .5 - dits[0];
1109 dsup[2] = 35.850000000000001;
1110 // 7.5 cm is the lenght
1111 geant->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1113 //--- Define the first part of the (smaller) rib between two sensitive parts
1114 // made of aluminum (layer #3)
1116 dal1[0] = .5 - dits[0];
1117 dal1[1] = 4.8000000000000001e-4;
1118 dal1[2] = 35.850000000000001;
1119 // 7.5 cm is the lenght
1120 geant->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1122 //--- Define the part of the (smaller) rib between two sensitive parts made of
1123 // kapton (layer #3)
1125 dkap[0] = .5 - dits[0];
1127 dkap[2] = 35.850000000000001;
1128 // 7.5 cm is the lenght
1129 geant->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1131 //--- Define the second part of the (smaller) rib between two sensitive parts
1132 // made of aluminum (layer #3)
1134 dal2[0] = .5 - dits[0];
1135 dal2[1] = .0013500000000000001;
1136 dal2[2] = 35.850000000000001;
1137 // 7.5 cm is the lenght
1138 geant->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1140 // --- Define the part of the (smaller) rib between two sensitive parts
1141 // made of silicon (the electronics) (layer #3)
1143 dchi[0] = .5 - dits[0];
1144 dchi[1] = .0035500000000000002;
1145 dchi[2] = 35.850000000000001;
1146 // 7.5 cm is the lenght
1147 geant->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1149 // --- Define the part of the (smaller) rib between two sensitive parts
1150 // made of water (the cooler) (layer #3)
1152 dwat[0] = .5 - dits[0];
1153 dwat[1] = .0046499999999999996;
1154 dwat[2] = 35.850000000000001;
1155 // 7.5 cm is the lenght
1156 geant->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1158 //--- Define the third part of the (smaller) rib between two sensitive parts
1159 // made of aluminum (the cooling tubes) (layer #3)
1161 dtub[0] = .5 - dits[0];
1162 dtub[1] = 6.7000000000000002e-4;
1163 dtub[2] = 35.850000000000001;
1164 // 7.5 cm is the lenght
1165 geant->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1167 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1170 // twice the foreseen thickness
1173 geant->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1175 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1178 // twice the foreseen thickness
1181 geant->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1183 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1187 // twice the foreseen thickness
1190 geant->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1192 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1195 // twice the foreseen thickness
1198 geant->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1200 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1204 for (j = 1; j <= 5; ++j) {
1205 // odd elements are up and even elements are down
1207 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1208 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1209 } else if (j == 2) {
1210 xpos = -dbox1[0] + dits[0];
1211 zpos = 0. - dits[2] + 1. - dits[2];
1212 } else if (j == 3) {
1213 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1215 } else if (j == 4) {
1216 xpos = -dbox1[0] + dits[0];
1217 zpos = dits[2] + 0. - 1. + dits[2];
1218 } else if (j == 5) {
1219 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1220 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1222 geant->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1225 // --- Place the smaller ribs into their mother (IDV1)
1227 // --- Right ribs (just a matter of convention)
1229 xpos = .5 - dbox1[0] + dits[0];
1235 geant->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1239 ypos = dsup[1] + 2.81 + dal1[1];
1240 geant->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1244 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1245 geant->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1249 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1250 geant->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1252 // --- Silicon (chip)
1254 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1255 geant->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1259 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1260 geant->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1264 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1266 geant->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1268 // --- Right ribs (just a matter of convention)
1273 geant->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1277 ypos = -(dsup[1] + 2.81 + dal1[1]);
1278 geant->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1282 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1283 geant->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1287 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1289 geant->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1291 // --- Silicon (chip)
1293 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1294 2. + dal2[1] * 2. + dchi[1]);
1295 geant->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1299 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1300 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1301 geant->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1305 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1306 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1307 geant->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1309 // --- Place the end-ladder stuff into its mother (IDV1)
1312 // --- Negative-Z end-ladder
1315 zpos = -28.350000000000001;
1319 xpos = dbox1[0] - dpcb[0];
1320 geant->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1324 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1325 geant->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1329 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1330 geant->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1332 // --- Silicon (bus)
1334 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1335 geant->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1337 // --- Positive-Z end-ladder
1340 zpos = 28.350000000000001;
1344 xpos = dbox1[0] - dpcb[0];
1345 geant->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1349 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1350 geant->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1354 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1355 geant->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1357 // --- Silicon (bus)
1359 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1360 geant->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1362 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1363 // larger lenght of ribs) and fill it with air or vacuum
1365 dbox2[0] = .76540000000000008;
1367 // the widest element is the sensitive element
1368 dbox2[2] = 35.850000000000001;
1369 // 7.5 cm is the lenght
1370 geant->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1372 // --- Make the ghost volume invisible
1374 geant->Gsatt("IDV2", "SEEN", 0);
1376 //--- Define the part of the (larger) rib between two sensitive parts madeof
1377 // carbon (layer #3)
1379 dsup[0] = .65 - dits[0];
1381 dsup[2] = 35.850000000000001;
1382 // 7.5 cm is the lenght
1383 geant->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1385 //--- Define the first part of the (larger) rib between two sensitive parts
1386 // made of aluminum (layer #3)
1388 dal1[0] = .65 - dits[0];
1389 dal1[1] = 4.8000000000000001e-4;
1390 dal1[2] = 35.850000000000001;
1391 // 7.5 cm is the lenght
1392 geant->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1394 //--- Define the part of the (larger) rib between two sensitive parts madeof
1395 // kapton (layer #3)
1397 dkap[0] = .65 - dits[0];
1399 dkap[2] = 35.850000000000001;
1400 // 7.5 cm is the lenght
1401 geant->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1403 //--- Define the second part of the (larger) rib between two sensitive parts
1404 // made of aluminum (layer #3)
1406 dal2[0] = .65 - dits[0];
1407 dal2[1] = .0013500000000000001;
1408 dal2[2] = 35.850000000000001;
1409 // 7.5 cm is the lenght
1410 geant->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1412 // --- Define the part of the (larger) rib between two sensitive parts
1413 // made of silicon (the electronics) (layer #3)
1415 dchi[0] = .65 - dits[0];
1416 dchi[1] = .0035500000000000002;
1417 dchi[2] = 35.850000000000001;
1418 // 7.5 cm is the lenght
1419 geant->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1421 // --- Define the part of the (larger) rib between two sensitive parts
1422 // made of water (the cooler) (layer #3)
1424 dwat[0] = .65 - dits[0];
1425 dwat[1] = .0046499999999999996;
1426 dwat[2] = 35.850000000000001;
1427 // 7.5 cm is the lenght
1428 geant->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1430 //--- Define the third part of the (larger) rib between two sensitive parts
1431 // made of aluminum (the cooling tubes) (layer #3)
1433 dtub[0] = .65 - dits[0];
1434 dtub[1] = 6.7000000000000002e-4;
1435 dtub[2] = 35.850000000000001;
1436 // 7.5 cm is the lenght
1437 geant->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1439 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1443 for (j = 1; j <= 5; ++j) {
1444 // odd element are up and even elements are down
1446 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1447 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1448 } else if (j == 2) {
1449 xpos = -dbox2[0] + dits[0];
1450 zpos = 0. - dits[2] + 1. - dits[2];
1451 } else if (j == 3) {
1452 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1454 } else if (j == 4) {
1455 xpos = -dbox2[0] + dits[0];
1456 zpos = dits[2] + 0. - 1. + dits[2];
1457 } else if (j == 5) {
1458 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1459 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1461 geant->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1464 // --- Place the larger ribs into their mother (IDV2)
1467 // --- Right ribs (just a matter of convention)
1469 xpos = .65 - dbox2[0] + dits[0];
1475 geant->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1479 ypos = dsup[1] + 2.81 + dal1[1];
1480 geant->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1484 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1485 geant->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1489 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1490 geant->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1492 // --- Silicon (chip)
1494 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1495 geant->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1499 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1500 geant->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1504 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1506 geant->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1508 // --- Right ribs (just a matter of convention)
1513 geant->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1517 ypos = -(dsup[1] + 2.81 + dal1[1]);
1518 geant->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1522 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1523 geant->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1527 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1529 geant->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1531 // --- Silicon (chip)
1533 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1534 2. + dal2[1] * 2. + dchi[1]);
1535 geant->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1539 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1540 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1541 geant->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1545 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1546 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1547 geant->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1549 // --- Place the end-ladder stuff into its mother (IDV1)
1552 // --- Negative-Z end-ladder
1555 zpos = -28.350000000000001;
1559 xpos = dbox2[0] - dpcb[0];
1560 geant->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1564 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1565 geant->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1569 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1570 geant->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1572 // --- Silicon (bus)
1574 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1575 geant->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1577 // --- Positive-Z end-ladder
1580 zpos = 28.350000000000001;
1584 xpos = dbox2[0] - dpcb[0];
1585 geant->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1589 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1590 geant->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1594 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1595 geant->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1597 // --- Silicon (bus)
1599 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1600 geant->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1602 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1603 // mother volume (IT34)
1604 // Odd elements have large ribs and even elements have small ribs
1606 for (i = 1; i <= 12; ++i) {
1607 atheta = (i-1) * 30.;
1608 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1611 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1612 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1614 geant->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1617 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1618 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1620 geant->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1627 // GOTO 4567 ! skip ITS layer no. 4
1629 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1630 // smaller lenght of ribs) and fill it with air or vacuum
1632 dbox1[0] = .61539999999999995;
1634 // the widest element is the end-ladder stuff
1635 dbox1[2] = 43.449999999999996;
1636 // 7.5 cm is the lenght
1637 geant->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1639 // --- Make the ghost volume invisible
1641 geant->Gsatt("IDV3", "SEEN", 0);
1643 // --- Define a volume containing the sensitive part of drifts
1644 // (silicon, layer #4)
1647 // see material budget report by G. Feofilov
1650 geant->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1652 //--- Define the part of the (smaller) rib between two sensitive parts made of
1653 // carbon (layer #4)
1655 dsup[0] = .5 - dits[0];
1657 dsup[2] = 43.449999999999996;
1658 // 7.5 cm is the lengh
1659 geant->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1661 //--- Define the first part of the (smaller) rib between two sensitive parts
1662 // made of aluminum (layer #4)
1664 dal1[0] = .5 - dits[0];
1665 dal1[1] = 4.8000000000000001e-4;
1666 dal1[2] = 43.449999999999996;
1667 // 7.5 cm is the lengh
1668 geant->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1670 //--- Define the part of the (smaller) rib between two sensitive parts made of
1671 // kapton (layer #4)
1673 dkap[0] = .5 - dits[0];
1675 dkap[2] = 43.449999999999996;
1676 // 7.5 cm is the lengh
1677 geant->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1679 //--- Define the second part of the (smaller) rib between two sensitive parts
1680 // made of aluminum (layer #4)
1682 dal2[0] = .5 - dits[0];
1683 dal2[1] = .0013500000000000001;
1684 dal2[2] = 43.449999999999996;
1685 // 7.5 cm is the lengh
1686 geant->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1688 // --- Define the part of the (smaller) rib between two sensitive parts
1689 // made of silicon (the electronics) (layer #4)
1691 dchi[0] = .5 - dits[0];
1692 dchi[1] = .0035500000000000002;
1693 dchi[2] = 43.449999999999996;
1694 // 7.5 cm is the lengh
1695 geant->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1697 // --- Define the part of the (smaller) rib between two sensitive parts
1698 // made of water (the cooler) (layer #4)
1700 dwat[0] = .5 - dits[0];
1701 dwat[1] = .0046499999999999996;
1702 dwat[2] = 43.449999999999996;
1703 // 7.5 cm is the lenght
1704 geant->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1706 //--- Define the third part of the (smaller) rib between two sensitive parts
1707 // made of aluminum (the cooling tubes) (layer #4)
1709 dtub[0] = .5 - dits[0];
1710 dtub[1] = 6.7000000000000002e-4;
1711 dtub[2] = 43.449999999999996;
1712 // 7.5 cm is the lengh
1713 geant->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1715 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1718 // twice the foreseen thickness
1721 geant->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1723 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1726 // twice the foreseen thickness
1729 geant->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1731 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1735 // twice the foreseen thickness
1738 geant->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1740 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1743 // twice the foreseen thickness
1746 geant->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1748 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1752 for (j = 1; j <= 7; ++j) {
1753 // odd elements are down and even elements are up
1755 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1756 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1757 } else if (j == 2) {
1758 xpos = -dbox1[0] + dits[0];
1759 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1760 } else if (j == 3) {
1761 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1762 zpos = 0. - dits[2] + .7 - dits[2];
1763 } else if (j == 4) {
1764 xpos = -dbox1[0] + dits[0];
1766 } else if (j == 5) {
1767 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1768 zpos = dits[2] + 0. - .7 + dits[2];
1769 } else if (j == 6) {
1770 xpos = -dbox1[0] + dits[0];
1771 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1772 } else if (j == 7) {
1773 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1774 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1776 geant->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1779 // --- Place the smaller ribs into their mother (IDV3)
1781 // --- Right ribs (just a matter of convention)
1783 xpos = .5 - dbox1[0] + dits[0];
1789 geant->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1793 ypos = dsup[1] + 2.81 + dal1[1];
1794 geant->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1798 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1799 geant->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1803 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1804 geant->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1806 // --- Silicon (chip)
1808 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1809 geant->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1813 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1814 geant->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1818 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1820 geant->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1822 // --- Right ribs (just a matter of convention)
1827 geant->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1831 ypos = -(dsup[1] + 2.81 + dal1[1]);
1832 geant->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1836 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1837 geant->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1841 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1842 geant->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1844 // --- Silicon (chip)
1846 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1847 geant->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1851 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1852 geant->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1856 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1857 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1858 geant->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1860 // --- Place the end-ladder stuff into its mother (IDV1)
1863 // --- Negative-Z end-ladder
1866 zpos = -35.949999999999996;
1870 xpos = dbox1[0] - dpcb[0];
1871 geant->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1875 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1876 geant->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1880 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1881 geant->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1883 // --- Silicon (bus)
1885 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1886 geant->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1888 // --- Positive-Z end-ladder
1891 zpos = 35.949999999999996;
1895 xpos = dbox1[0] - dpcb[0];
1896 geant->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1900 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1901 geant->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1905 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1906 geant->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1908 // --- Silicon (bus)
1910 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1911 geant->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1913 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1914 // larger lenght of ribs) and fill it with air or vacuum
1916 dbox2[0] = .76540000000000008;
1918 // the widest element is the end-ladder stuff
1919 dbox2[2] = 43.449999999999996;
1920 // 7.5 cm is the lenght
1921 geant->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
1923 // --- Make the ghost volume invisible
1925 geant->Gsatt("IDV4", "SEEN", 0);
1927 //--- Define the part of the (larger) rib between two sensitive parts madeof
1928 // carbon (layer #4)
1930 dsup[0] = .65 - dits[0];
1932 dsup[2] = 43.449999999999996;
1933 // 7.5 cm is the lengh
1934 geant->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
1936 //--- Define the first part of the (larger) rib between two sensitive parts
1937 // made of aluminum (layer #4)
1939 dal1[0] = .65 - dits[0];
1940 dal1[1] = 4.8000000000000001e-4;
1941 dal1[2] = 43.449999999999996;
1942 // 7.5 cm is the lengh
1943 geant->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
1945 //--- Define the part of the (larger) rib between two sensitive parts madeof
1946 // kapton (layer #4)
1948 dkap[0] = .65 - dits[0];
1950 dkap[2] = 43.449999999999996;
1951 // 7.5 cm is the lengh
1952 geant->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
1954 //--- Define the second part of the (larger) rib between two sensitive parts
1955 // made of aluminum (layer #4)
1957 dal2[0] = .65 - dits[0];
1958 dal2[1] = .0013500000000000001;
1959 dal2[2] = 43.449999999999996;
1960 // 7.5 cm is the lengh
1961 geant->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
1963 // --- Define the part of the (larger) rib between two sensitive parts
1964 // made of silicon (the electronics) (layer #4)
1966 dchi[0] = .65 - dits[0];
1967 dchi[1] = .0035500000000000002;
1968 dchi[2] = 43.449999999999996;
1969 // 7.5 cm is the lengh
1970 geant->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
1972 // --- Define the part of the (larger) rib between two sensitive parts
1973 // made of water (the cooler) (layer #4)
1975 dwat[0] = .65 - dits[0];
1976 dwat[1] = .0046499999999999996;
1977 dwat[2] = 43.449999999999996;
1978 // 7.5 cm is the lengh
1979 geant->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
1981 //--- Define the third part of the (larger) rib between two sensitive parts
1982 // made of aluminum (the cooling tubes) (layer #4)
1984 dtub[0] = .65 - dits[0];
1985 dtub[1] = 6.7000000000000002e-4;
1986 dtub[2] = 43.449999999999996;
1987 // 7.5 cm is the lengh
1988 geant->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
1990 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1994 for (j = 1; j <= 7; ++j) {
1995 // odd elements are down and even elements are up
1997 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1998 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1999 } else if (j == 2) {
2000 xpos = -dbox2[0] + dits[0];
2001 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2002 } else if (j == 3) {
2003 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2004 zpos = 0. - dits[2] + .7 - dits[2];
2005 } else if (j == 4) {
2006 xpos = -dbox2[0] + dits[0];
2008 } else if (j == 5) {
2009 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2010 zpos = dits[2] + 0. - .7 + dits[2];
2011 } else if (j == 6) {
2012 xpos = -dbox2[0] + dits[0];
2013 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2014 } else if (j == 7) {
2015 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2016 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2018 geant->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2021 // --- Place the larger ribs into their mother (IDV4)
2024 // --- Right ribs (just a matter of convention)
2026 xpos = .65 - dbox2[0] + dits[0];
2032 geant->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2036 ypos = dsup[1] + 2.81 + dal1[1];
2037 geant->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2041 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2042 geant->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2046 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2047 geant->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2049 // --- Silicon (chip)
2051 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2052 geant->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2056 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2057 geant->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2061 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2063 geant->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2065 // --- Right ribs (just a matter of convention)
2070 geant->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2074 ypos = -(dsup[1] + 2.81 + dal1[1]);
2075 geant->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2079 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2080 geant->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2084 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2086 geant->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2088 // --- Silicon (chip)
2090 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2091 2. + dal2[1] * 2. + dchi[1]);
2092 geant->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2096 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2097 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2098 geant->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2102 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2103 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2104 geant->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2106 // --- Place the end-ladder stuff into its mother (IDV1)
2109 // --- Negative-Z end-ladder
2112 zpos = -35.949999999999996;
2116 xpos = dbox2[0] - dpcb[0];
2117 geant->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2121 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2122 geant->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2126 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2127 geant->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2129 // --- Silicon (bus)
2131 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2132 geant->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2134 // --- Positive-Z end-ladder
2137 zpos = 35.949999999999996;
2141 xpos = dbox2[0] - dpcb[0];
2142 geant->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2146 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2147 geant->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2151 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2152 geant->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2154 // --- Silicon (bus)
2156 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2157 geant->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2159 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2160 // mother volume (IT34)
2161 // Odd elements have large ribs and even elements have small ribs
2163 for (i = 1; i <= 24; ++i) {
2164 atheta = (i-1) * 15.;
2165 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2168 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2169 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2171 geant->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2173 rzero = 23.399999999999999;
2174 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2175 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2177 geant->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2182 //************************************************************************
2187 //************************************************************************
2189 // --- Define SSD with the 35+39 lay-out
2191 if (fMinorVersion == 0 || fMinorVersion == 1 || fMinorVersion ==2) {
2193 //--- Define ghost volume containing the Strip Detectors and fill it with air
2196 xxm = 1.0444222222222224;
2200 dgh[3] = -25. - 5.9900000000000002 / xxm -
2201 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 10. / xxm - 12.997999999999998 / xxm;
2204 dgh[6] = -25. - 5.9900000000000002 / xxm -
2205 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 10. / xxm;
2208 dgh[9] = 5.9900000000000002 / xxm + 25. +
2209 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 10. / xxm;
2212 dgh[12] = 5.9900000000000002 / xxm + 25. +
2213 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 10. / xxm + 12.997999999999998 / xxm;
2216 geant->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2217 geant->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2218 geant->Gsatt("IT56", "SEEN", 0);
2222 // GOTO 5678 ! skip ITS layer no. 5
2224 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2225 // it with air or vacuum
2227 dbox1[0] = .044999999999999998;
2229 dbox1[2] = 45.109999999999999;
2230 geant->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2232 // --- Make the ghost volume invisible
2234 geant->Gsatt("ISV1", "SEEN", 0);
2236 // --- Define a ghost volume containing the electronics and cooling of
2237 // a single ladder of layer #5 and fill it with air or vacuum
2239 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2241 dsrv[2] = 45.109999999999999;
2242 geant->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2244 // --- Make the ghost volume invisible
2246 geant->Gsatt("SSV1", "SEEN", 0);
2248 // --- Define a ghost volume containing the end-ladder stuff of
2249 // a single ladder of layer #5 and fill it with air or vacuum
2254 geant->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2256 // --- Make the ghost volume invisible
2258 geant->Gsatt("ELL5", "SEEN", 0);
2260 // --- Define a volume containing the sensitive part of the strips
2261 // (silicon, layer #5)
2266 geant->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2268 // --- Define a volume containing the electronics of the strips
2269 // (silicon, layer #5)
2274 geant->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2276 // --- Define the cooling tubes (aluminum, layer #5)
2279 dtub[1] = dtub[0] + .01;
2280 dtub[2] = 45.109999999999999;
2281 geant->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2283 // --- Define the cooling fluid (water or freon, layer #5)
2287 dwat[2] = 45.109999999999999;
2288 geant->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2289 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2291 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2299 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2300 dfra[6] = dfra[5] + .03;
2304 geant->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2306 // --- Define the element connecting the triangles of the heat bridge
2307 // (carbon, layer #5)
2311 dcei[2] = 45.109999999999999;
2312 geant->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2314 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2317 dpla[0] = .089285714285714288;
2320 geant->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2322 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2324 dcop[0] = .017857142857142856;
2327 geant->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2329 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2331 depx[0] = .26785714285714285;
2334 geant->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2336 // --- Define the part of the end-ladder stuff made of silicon (bus)
2339 dsil[0] = .17857142857142858;
2342 geant->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2344 // --- Place the end-ladder stuff into its mother (ELL5)
2346 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2352 xpos = -dela[0] + dpla[0];
2353 geant->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2357 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2358 geant->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2362 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2363 geant->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2365 // --- Silicon (bus)
2367 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2368 geant->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2370 // --- Place the sensitive part of the strips into its mother (ISV1)
2373 for (j = 1; j <= 23; ++j) {
2374 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2375 else xpos = -dbox1[0] + dits[0];
2376 zpos = ((j - 1) - 11.) * 3.91;
2377 geant->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2380 // --- Place the electronics of the strips into its mother (SSV1)
2383 for (j = 1; j <= 23; ++j) {
2384 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2385 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2386 zpos = ((j - 1) - 11.) * 3.91 + .85;
2387 geant->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2390 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2392 xpos = -dsrv[0] + .41;
2395 // --- Left tube (just a matter of convention)
2397 ypos = -2.3500000000000001;
2398 geant->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2399 geant->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2401 // --- Right tube (just a matter of convention)
2403 ypos = 2.3500000000000001;
2404 geant->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2405 geant->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2407 // --- Place the heat bridge elements into their mother (SSV1)
2409 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2411 for (j = 1; j <= 24; ++j) {
2412 zpos = ((j - 1) - 11.) * 3.91 - 2.1000000000000001;
2413 geant->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2416 // --- Place the elements connecting the triangles of the heat bridge
2417 // into their mother (SSV1)
2421 // --- Left element (just a matter of convention)
2423 xpos = -dsrv[0] + .47;
2424 ypos = -2.1150000000000002;
2425 geant->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2427 // --- Right element
2429 xpos = -dsrv[0] + .47;
2430 ypos = 2.1150000000000002;
2431 geant->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2435 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2437 geant->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2439 // --- Place the ghost volumes containing the strip ladders (ISV1),
2440 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2441 // their mother volume (IT56)
2443 offset1 = atg_(.9, 40.);
2445 rzero = dbox1[0] + 40.;
2446 runo = dbox1[0] * 2. + 40. + dsrv[0];
2447 rtwo = dbox1[0] * 2. + 40. + dela[0];
2448 for (i = 1; i <= 35; ++i) {
2449 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2450 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2452 // --- Strip ladders
2454 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2455 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2457 geant->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2459 // --- Electronics/cooling
2461 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2462 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2464 geant->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2466 // --- End-ladders (nagative-Z and positive-Z)
2468 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2469 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2470 zpos = -(dbox1[2] + dela[2] + 6.);
2471 geant->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2472 zpos = dbox1[2] + dela[2] + 6.;
2473 geant->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2479 // GOTO 5778 ! skip ITS layer no. 6
2481 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2482 // it with air or vacuum
2484 dbox2[0] = .044999999999999998;
2486 dbox2[2] = 50.975000000000001;
2487 geant->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2489 // --- Make the ghost volume invisible
2491 geant->Gsatt("ISV2", "SEEN", 0);
2493 // --- Define a ghost volume containing the electronics and cooling of
2494 // a single ladder of layer #6 and fill it with air or vacuum
2496 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2498 dsrv[2] = 50.975000000000001;
2499 geant->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2501 // --- Make the ghost volume invisible
2503 geant->Gsatt("SSV2", "SEEN", 0);
2505 // --- Define a ghost volume containing the end-ladder stuff of
2506 // a single ladder of layer #6 and fill it with air or vacuum
2511 geant->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2513 // --- Make the ghost volume invisible
2515 geant->Gsatt("ELL6", "SEEN", 0);
2517 // --- Define a volume containing the sensitive part of the strips
2518 // (silicon, layer #6)
2523 geant->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2525 // --- Define a volume containing the electronics of the strips
2526 // (silicon, layer #6)
2531 geant->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2533 // --- Define the cooling tubes (aluminum, layer #6)
2536 dtub[1] = dtub[0] + .01;
2537 dtub[2] = 50.975000000000001;
2538 geant->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2540 // --- Define the cooling fluid (water or freon, layer #6)
2544 dwat[2] = 50.975000000000001;
2545 geant->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2546 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2548 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2556 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2557 dfra[6] = dfra[5] + .03;
2561 geant->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2563 // --- Define the element connecting the triangles of the heat bridge
2564 // (carbon, layer #6)
2568 dcei[2] = 50.975000000000001;
2569 geant->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2571 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2574 dpla[0] = .089285714285714288;
2577 geant->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2579 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2581 dcop[0] = .017857142857142856;
2584 geant->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2586 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2588 depx[0] = .26785714285714285;
2591 geant->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2593 // --- Define the part of the end-ladder stuff made of silicon (bus)
2596 dsil[0] = .17857142857142858;
2599 geant->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2601 // --- Place the end-ladder stuff into its mother (ELL5)
2603 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2609 xpos = -dela[0] + dpla[0];
2610 geant->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2614 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2615 geant->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2619 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2620 geant->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2622 // --- Silicon (bus)
2624 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2625 geant->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2627 // --- Place the sensitive part of the strips into its mother (ISV2)
2630 for (j = 1; j <= 26; ++j) {
2631 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2632 else xpos = -dbox2[0] + dits[0];
2633 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2634 geant->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2637 // --- Place the electronics of the strips into its mother (SSV2)
2640 for (j = 1; j <= 26; ++j) {
2641 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2642 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2643 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2644 geant->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2647 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2649 xpos = -dsrv[0] + .41;
2652 // --- Left tube (just a matter of convention)
2654 ypos = -2.3500000000000001;
2655 geant->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2656 geant->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2658 // --- Right tube (just a matter of convention)
2660 ypos = 2.3500000000000001;
2661 geant->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2662 geant->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2664 // --- Place the heat bridge elements into their mother (SSV2)
2666 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2668 for (j = 1; j <= 27; ++j) {
2669 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 2.1000000000000001;
2670 geant->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2673 // --- Place the elements connecting the triangles of the heat bridge
2674 // into their mother (SSV2)
2678 // --- Left element (just a matter of convention)
2680 xpos = -dsrv[0] + .47;
2681 ypos = -2.1150000000000002;
2682 geant->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2684 // --- Right element
2686 xpos = -dsrv[0] + .47;
2687 ypos = 2.1150000000000002;
2688 geant->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2692 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2694 geant->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2696 // --- Place the ghost volumes containing the strip ladders (ISV2),
2697 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2698 // their mother volume (IT56)
2700 offset1 = atg_(1., 45.);
2702 rzero = dbox2[0] + 45.;
2703 runo = dbox2[0] * 2. + 45. + dsrv[0];
2704 rtwo = dbox2[0] * 2. + 45. + dela[0];
2705 for (i = 1; i <= 39; ++i) {
2706 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2707 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2709 // --- Strip ladders
2711 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2712 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2714 geant->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2716 // --- Electronics/cooling
2718 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2719 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2721 geant->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2723 // --- End-ladders (nagative-Z and positive-Z)
2725 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2726 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2727 zpos = -(dbox2[2] + dela[2] + 6.);
2728 geant->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2729 zpos = dbox2[2] + dela[2] + 6.;
2730 geant->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2736 // --- Define SSD with the 32+36 lay-out
2738 if (fMinorVersion == 3 || fMinorVersion == 4 || fMinorVersion == 5) {
2740 //--- Define ghost volume containing the Strip Detectors and fill it with air
2743 xxm = 1.0444222222222224;
2747 dgh[3] = -25. - 5.9900000000000002 / xxm -
2748 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 9. / xxm - 13.997999999999998 / xxm;
2751 dgh[6] = -25. - 5.9900000000000002 / xxm -
2752 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 9. / xxm;
2755 dgh[9] = 5.9900000000000002 / xxm + 25. +
2756 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 9. / xxm;
2759 dgh[12] = 5.9900000000000002 / xxm + 25. +
2760 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 9. / xxm + 13.997999999999998 / xxm;
2763 geant->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2764 geant->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2765 geant->Gsatt("IT56", "SEEN", 0);
2769 // GOTO 6678 ! skip ITS layer no. 5
2771 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2772 // it with air or vacuum
2774 dbox1[0] = .044999999999999998;
2776 dbox1[2] = 43.155000000000001;
2777 geant->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2779 // --- Make the ghost volume invisible
2781 geant->Gsatt("ISV1", "SEEN", 0);
2783 // --- Define a ghost volume containing the electronics and cooling of
2784 // a single ladder of layer #5 and fill it with air or vacuum
2786 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2788 dsrv[2] = 43.155000000000001;
2789 geant->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2791 // --- Make the ghost volume invisible
2793 geant->Gsatt("SSV1", "SEEN", 0);
2795 // --- Define a ghost volume containing the end-ladder stuff of
2796 // a single ladder of layer #5 and fill it with air or vacuum
2801 geant->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2803 // --- Make the ghost volume invisible
2805 geant->Gsatt("ELL5", "SEEN", 0);
2807 // --- Define a volume containing the sensitive part of the strips
2808 // (silicon, layer #5)
2813 geant->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2815 // --- Define a volume containing the electronics of the strips
2816 // (silicon, layer #5)
2821 geant->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2823 // --- Define the cooling tubes (aluminum, layer #5)
2826 dtub[1] = dtub[0] + .01;
2827 dtub[2] = 43.155000000000001;
2828 geant->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2830 // --- Define the cooling fluid (water or freon, layer #5)
2834 dwat[2] = 43.155000000000001;
2835 geant->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2836 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2838 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2846 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2847 dfra[6] = dfra[5] + .03;
2851 geant->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2853 // --- Define the element connecting the triangles of the heat bridge
2854 // (carbon, layer #5)
2858 dcei[2] = 43.155000000000001;
2859 geant->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2861 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2864 dpla[0] = .089285714285714288;
2867 geant->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2869 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2871 dcop[0] = .017857142857142856;
2874 geant->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2876 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2878 depx[0] = .26785714285714285;
2881 geant->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2883 // --- Define the part of the end-ladder stuff made of silicon (bus)
2886 dsil[0] = .17857142857142858;
2889 geant->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2891 // --- Place the end-ladder stuff into its mother (ELL5)
2893 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2899 xpos = -dela[0] + dpla[0];
2900 geant->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2904 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2905 geant->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2909 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2910 geant->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2912 // --- Silicon (bus)
2914 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2915 geant->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2917 // --- Place the sensitive part of the strips into its mother (ISV1)
2920 for (j = 1; j <= 22; ++j) {
2921 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2922 else xpos = -dbox1[0] + dits[0];
2923 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
2924 geant->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2927 // --- Place the electronics of the strips into its mother (SSV1)
2930 for (j = 1; j <= 22; ++j) {
2931 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2932 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2933 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
2934 geant->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2937 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2939 xpos = -dsrv[0] + .41;
2942 // --- Left tube (just a matter of convention)
2944 ypos = -2.3500000000000001;
2945 geant->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2946 geant->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2948 // --- Right tube (just a matter of convention)
2950 ypos = 2.3500000000000001;
2951 geant->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2952 geant->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2954 // --- Place the heat bridge elements into their mother (SSV1)
2956 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2958 for (j = 1; j <= 23; ++j) {
2959 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 2.1000000000000001;
2960 geant->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2963 // --- Place the elements connecting the triangles of the heat bridge
2964 // into their mother (SSV1)
2968 // --- Left element (just a matter of convention)
2970 xpos = -dsrv[0] + .47;
2971 ypos = -2.1150000000000002;
2972 geant->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2974 // --- Right element
2976 xpos = -dsrv[0] + .47;
2977 ypos = 2.1150000000000002;
2978 geant->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2982 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2984 geant->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2986 // --- Place the ghost volumes containing the strip ladders (ISV1),
2987 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2988 // their mother volume (IT56)
2990 offset1 = atg_(.8, 36.6);
2992 rzero = dbox1[0] + 36.6;
2993 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
2994 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
2995 for (i = 1; i <= 32; ++i) {
2996 atheta = (i-1) * twopi * raddeg / 32. + offset2;
2997 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2999 // --- Strip ladders
3001 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3002 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3004 geant->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3006 // --- Electronics/cooling
3008 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3009 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3011 geant->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3013 // --- End-ladders (nagative-Z and positive-Z)
3015 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3016 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3017 zpos = -(dbox1[2] + dela[2] + 6.);
3018 geant->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3019 zpos = dbox1[2] + dela[2] + 6.;
3020 geant->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3026 // GOTO 6778 ! skip ITS layer no. 6
3028 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3029 // it with air or vacuum
3031 dbox2[0] = .044999999999999998;
3033 dbox2[2] = 47.064999999999998;
3034 geant->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3036 // --- Make the ghost volume invisible
3038 geant->Gsatt("ISV2", "SEEN", 0);
3040 // --- Define a ghost volume containing the electronics and cooling of
3041 // a single ladder of layer #6 and fill it with air or vacuum
3043 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3045 dsrv[2] = 47.064999999999998;
3046 geant->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3048 // --- Make the ghost volume invisible
3050 geant->Gsatt("SSV2", "SEEN", 0);
3052 // --- Define a ghost volume containing the end-ladder stuff of
3053 // a single ladder of layer #6 and fill it with air or vacuum
3058 geant->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3060 // --- Make the ghost volume invisible
3062 geant->Gsatt("ELL6", "SEEN", 0);
3064 // --- Define a volume containing the sensitive part of the strips
3065 // (silicon, layer #6)
3070 geant->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3072 // --- Define a volume containing the electronics of the strips
3073 // (silicon, layer #6)
3078 geant->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3080 // --- Define the cooling tubes (aluminum, layer #6)
3083 dtub[1] = dtub[0] + .01;
3084 dtub[2] = 47.064999999999998;
3085 geant->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3087 // --- Define the cooling fluid (water or freon, layer #6)
3091 dwat[2] = 47.064999999999998;
3092 geant->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3093 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3095 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3103 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3104 dfra[6] = dfra[5] + .03;
3108 geant->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3110 // --- Define the element connecting the triangles of the heat bridge
3111 // (carbon, layer #6)
3115 dcei[2] = 47.064999999999998;
3116 geant->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3118 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3121 dpla[0] = .089285714285714288;
3124 geant->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3126 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3128 dcop[0] = .017857142857142856;
3131 geant->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3133 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3135 depx[0] = .26785714285714285;
3138 geant->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3140 // --- Define the part of the end-ladder stuff made of silicon (bus)
3143 dsil[0] = .17857142857142858;
3146 geant->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3148 // --- Place the end-ladder stuff into its mother (ELL5)
3150 sep= (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3156 xpos = -dela[0] + dpla[0];
3157 geant->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3161 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3162 geant->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3166 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3167 geant->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3169 // --- Silicon (bus)
3171 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3172 geant->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3174 // --- Place the sensitive part of the strips into its mother (ISV2)
3177 for (j = 1; j <= 24; ++j) {
3178 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3179 else xpos = dbox2[0] - dits[0];
3180 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3181 geant->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3184 // --- Place the electronics of the strips into its mother (SSV2)
3187 for (j = 1; j <= 24; ++j) {
3188 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3189 else xpos = -dsrv[0] + .28;
3190 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3191 geant->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3194 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3196 xpos = -dsrv[0] + .41;
3199 // --- Left tube (just a matter of convention)
3201 ypos = -2.3500000000000001;
3202 geant->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3203 geant->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3205 // --- Right tube (just a matter of convention)
3207 ypos = 2.3500000000000001;
3208 geant->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3209 geant->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3211 // --- Place the heat bridge elements into their mother (SSV2)
3213 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3215 for (j = 1; j <= 25; ++j) {
3216 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 2.1000000000000001;
3217 geant->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3220 // --- Place the elements connecting the triangles of the heat bridge
3221 // into their mother (SSV2)
3225 // --- Left element (just a matter of convention)
3227 xpos = -dsrv[0] + .47;
3228 ypos = -2.1150000000000002;
3229 geant->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3231 // --- Right element
3233 xpos = -dsrv[0] + .47;
3234 ypos = 2.1150000000000002;
3235 geant->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3239 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3241 geant->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3243 // --- Place the ghost volumes containing the strip ladders (ISV2),
3244 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3245 // their mother volume (IT56)
3247 offset1 = atg_(.9, 41.2);
3249 rzero = dbox2[0] + 41.2;
3250 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3251 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3252 for (i = 1; i <= 36; ++i) {
3253 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3254 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3256 // --- Strip ladders
3258 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3259 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3261 geant->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3263 // --- Electronics/cooling
3265 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3266 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3268 geant->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3270 // --- End-ladders (nagative-Z and positive-Z)
3272 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3273 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3274 zpos = -(dbox2[2] + dela[2] + 6.);
3275 geant->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3276 zpos = dbox2[2] + dela[2] + 6.;
3277 geant->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3283 //************************************************************************
3285 //* E N D - C A P S A N D F R A M E S *
3286 //* ========================================= *
3288 //************************************************************************
3290 // --- Define a dummy cylinder for multiple scattering tests
3292 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3295 // DITS(2)=DITS(1)+0.1
3297 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3298 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3301 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3303 if (fMinorVersion == 0 || fMinorVersion == 3) {
3305 // GOTO 8901 ! skip outer wall
3308 dits[1] = dits[0] + .06926;
3309 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3311 geant->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3312 geant->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3317 // --- The frame between the end-caps (octagonal lay-out) ---
3319 // GOTO 9012 ! skip octagonal frame
3321 if (fMinorVersion == 1) {
3326 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3329 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + 518.90999999999985) / 2.;
3331 offset = angle / 2.;
3332 for (i = 1; i <= 8; ++i) {
3333 xtra[i - 1] = rzero * TMath::Cos((i-1) * angle * degrad);
3334 ytra[i - 1] = rzero * TMath::Sin((i-1) * angle * degrad);
3336 geant->Gsvolu(natra_ref(0, i), "TUBE", idtmed[274], dtra, 3);
3337 geant->Gspos(natra_ref(0, i), 1, "ITSV", xtra[i - 1], ytra[i - 1], ztra[i - 1], 0, "ONLY");
3341 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3342 - 2550.25))) * raddeg;
3343 aphi2 = 180. - aphi1;
3344 xpos = (xtra[0] + xtra[1]) / 2.;
3345 ypos = (ytra[0] + ytra[1]) / 2.;
3346 zpos = dtra[2] / 2.;
3347 geant->Gsvolu(natra1_ref(0, 1), "TUBE", idtmed[274], dtra1, 3);
3350 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3351 geant->Gspos(natra1_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3352 zpos = -dtra[2] / 2.;
3353 geant->Gsvolu(natra1_ref(0, 2), "TUBE", idtmed[274], dtra1, 3);
3356 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3357 geant->Gspos(natra1_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3360 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3361 - 2550.25))) * raddeg;
3362 aphi1 = 180. - aphi2;
3363 xpos = (xtra[1] + xtra[2]) / 2.;
3364 ypos = (ytra[1] + ytra[2]) / 2.;
3365 zpos = dtra[2] / 2.;
3366 geant->Gsvolu(natra1_ref(0, 3), "TUBE", idtmed[274], dtra1, 3);
3369 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3370 geant->Gspos(natra1_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3371 zpos = -dtra[2] / 2.;
3372 geant->Gsvolu(natra1_ref(0, 4), "TUBE", idtmed[274], dtra1, 3);
3375 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3376 geant->Gspos(natra1_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3379 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3380 - 2550.25))) * raddeg;
3381 aphi2 = 180. - aphi1;
3382 xpos = (xtra[2] + xtra[3]) / 2.;
3383 ypos = (ytra[2] + ytra[3]) / 2.;
3384 zpos = dtra[2] / 2.;
3385 geant->Gsvolu(natra1_ref(0, 5), "TUBE", idtmed[274], dtra1, 3);
3388 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3389 geant->Gspos(natra1_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3390 zpos = -dtra[2] / 2.;
3391 geant->Gsvolu(natra1_ref(0, 6), "TUBE", idtmed[274], dtra1, 3);
3394 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3395 geant->Gspos(natra1_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3398 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3399 - 2550.25))) * raddeg;
3400 aphi1 = 180. - aphi2;
3401 xpos = (xtra[3] + xtra[4]) / 2.;
3402 ypos = (ytra[3] + ytra[4]) / 2.;
3403 zpos = dtra[2] / 2.;
3404 geant->Gsvolu(natra1_ref(0, 7), "TUBE", idtmed[274], dtra1, 3);
3407 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3408 geant->Gspos(natra1_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3409 zpos = -dtra[2] / 2.;
3410 geant->Gsvolu(natra1_ref(0, 8), "TUBE", idtmed[274], dtra1, 3);
3413 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3414 geant->Gspos(natra1_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3417 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3418 - 2550.25))) * raddeg;
3419 aphi1 = 180. - aphi2;
3420 xpos = (xtra[4] + xtra[5]) / 2.;
3421 ypos = (ytra[4] + ytra[5]) / 2.;
3422 zpos = dtra[2] / 2.;
3423 geant->Gsvolu(natra1_ref(0, 9), "TUBE", idtmed[274], dtra1, 3);
3426 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3427 geant->Gspos(natra1_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3428 zpos = -dtra[2] / 2.;
3429 geant->Gsvolu(natra1_ref(0, 10), "TUBE", idtmed[274], dtra1, 3);
3432 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3433 geant->Gspos(natra1_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3436 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3437 - 2550.25))) * raddeg;
3438 aphi2 = 180. - aphi1;
3439 xpos = (xtra[5] + xtra[6]) / 2.;
3440 ypos = (ytra[5] + ytra[6]) / 2.;
3441 zpos = dtra[2] / 2.;
3442 geant->Gsvolu(natra1_ref(0, 11), "TUBE", idtmed[274], dtra1, 3);
3445 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3446 geant->Gspos(natra1_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3447 zpos = -dtra[2] / 2.;
3448 geant->Gsvolu(natra1_ref(0, 12), "TUBE", idtmed[274], dtra1, 3);
3451 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3452 geant->Gspos(natra1_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3455 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3456 - 2550.25))) * raddeg;
3457 aphi1 = 180. - aphi2;
3458 xpos = (xtra[6] + xtra[7]) / 2.;
3459 ypos = (ytra[6] + ytra[7]) / 2.;
3460 zpos = dtra[2] / 2.;
3461 geant->Gsvolu(natra1_ref(0, 13), "TUBE", idtmed[274], dtra1, 3);
3464 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3465 geant->Gspos(natra1_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3466 zpos = -dtra[2] / 2.;
3467 geant->Gsvolu(natra1_ref(0, 14), "TUBE", idtmed[274], dtra1, 3);
3470 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3471 geant->Gspos(natra1_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3474 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3475 - 2550.25))) * raddeg;
3476 aphi2 = 180. - aphi1;
3477 xpos = (xtra[7] + xtra[0]) / 2.;
3478 ypos = (ytra[7] + ytra[0]) / 2.;
3479 zpos = dtra[2] / 2.;
3480 geant->Gsvolu(natra1_ref(0, 15), "TUBE", idtmed[274], dtra1, 3);
3483 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3484 geant->Gspos(natra1_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3485 zpos = -dtra[2] / 2.;
3486 geant->Gsvolu(natra1_ref(0, 16), "TUBE", idtmed[274], dtra1, 3);
3489 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3490 geant->Gspos(natra1_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3493 } else if (fMinorVersion == 4) {
3499 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3502 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + 518.91) / 2.;
3504 offset = angle / 2.;
3505 for (i = 1; i <= 8; ++i) {
3506 xtra[i - 1] = rzero * TMath::Cos((i-1) * angle * degrad);
3507 ytra[i - 1] = rzero * TMath::Sin((i-1) * angle * degrad);
3509 geant->Gsvolu(natra_ref(0, i), "TUBE", idtmed[274], dtra, 3);
3510 geant->Gspos(natra_ref(0, i), 1, "ITSV", xtra[i - 1], ytra[i - 1], ztra[i - 1], 0, "ONLY");
3514 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3515 - 2550.25))) * raddeg;
3516 aphi2 = 180. - aphi1;
3517 xpos = (xtra[0] + xtra[1]) / 2.;
3518 ypos = (ytra[0] + ytra[1]) / 2.;
3519 zpos = dtra[2] / 2.;
3520 geant->Gsvolu(natra1_ref(0, 1), "TUBE", idtmed[274], dtra1, 3);
3523 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3524 geant->Gspos(natra1_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3525 zpos = -dtra[2] / 2.;
3526 geant->Gsvolu(natra1_ref(0, 2), "TUBE", idtmed[274], dtra1, 3);
3529 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3530 geant->Gspos(natra1_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3533 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3534 - 2550.25))) * raddeg;
3535 aphi1 = 180. - aphi2;
3536 xpos = (xtra[1] + xtra[2]) / 2.;
3537 ypos = (ytra[1] + ytra[2]) / 2.;
3538 zpos = dtra[2] / 2.;
3539 geant->Gsvolu(natra1_ref(0, 3), "TUBE", idtmed[274], dtra1, 3);
3542 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3543 geant->Gspos(natra1_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3544 zpos = -dtra[2] / 2.;
3545 geant->Gsvolu(natra1_ref(0, 4), "TUBE", idtmed[274], dtra1, 3);
3548 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3549 geant->Gspos(natra1_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3552 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3553 - 2550.25))) * raddeg;
3554 aphi2 = 180. - aphi1;
3555 xpos = (xtra[2] + xtra[3]) / 2.;
3556 ypos = (ytra[2] + ytra[3]) / 2.;
3557 zpos = dtra[2] / 2.;
3558 geant->Gsvolu(natra1_ref(0, 5), "TUBE", idtmed[274], dtra1, 3);
3561 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3562 geant->Gspos(natra1_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3563 zpos = -dtra[2] / 2.;
3564 geant->Gsvolu(natra1_ref(0, 6), "TUBE", idtmed[274], dtra1, 3);
3567 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3568 geant->Gspos(natra1_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3571 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3572 - 2550.25))) * raddeg;
3573 aphi1 = 180. - aphi2;
3574 xpos = (xtra[3] + xtra[4]) / 2.;
3575 ypos = (ytra[3] + ytra[4]) / 2.;
3576 zpos = dtra[2] / 2.;
3577 geant->Gsvolu(natra1_ref(0, 7), "TUBE", idtmed[274], dtra1, 3);
3580 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3581 geant->Gspos(natra1_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3582 zpos = -dtra[2] / 2.;
3583 geant->Gsvolu(natra1_ref(0, 8), "TUBE", idtmed[274], dtra1, 3);
3586 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3587 geant->Gspos(natra1_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3590 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3591 - 2550.25))) * raddeg;
3592 aphi1 = 180. - aphi2;
3593 xpos = (xtra[4] + xtra[5]) / 2.;
3594 ypos = (ytra[4] + ytra[5]) / 2.;
3595 zpos = dtra[2] / 2.;
3596 geant->Gsvolu(natra1_ref(0, 9), "TUBE", idtmed[274], dtra1, 3);
3599 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3600 geant->Gspos(natra1_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3601 zpos = -dtra[2] / 2.;
3602 geant->Gsvolu(natra1_ref(0, 10), "TUBE", idtmed[274], dtra1, 3);
3605 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3606 geant->Gspos(natra1_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3609 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3610 - 2550.25))) * raddeg;
3611 aphi2 = 180. - aphi1;
3612 xpos = (xtra[5] + xtra[6]) / 2.;
3613 ypos = (ytra[5] + ytra[6]) / 2.;
3614 zpos = dtra[2] / 2.;
3615 geant->Gsvolu(natra1_ref(0, 11), "TUBE", idtmed[274], dtra1, 3);
3618 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3619 geant->Gspos(natra1_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3620 zpos = -dtra[2] / 2.;
3621 geant->Gsvolu(natra1_ref(0, 12), "TUBE", idtmed[274], dtra1, 3);
3624 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3625 geant->Gspos(natra1_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3628 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3629 - 2550.25))) * raddeg;
3630 aphi1 = 180. - aphi2;
3631 xpos = (xtra[6] + xtra[7]) / 2.;
3632 ypos = (ytra[6] + ytra[7]) / 2.;
3633 zpos = dtra[2] / 2.;
3634 geant->Gsvolu(natra1_ref(0, 13), "TUBE", idtmed[274], dtra1, 3);
3637 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3638 geant->Gspos(natra1_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3639 zpos = -dtra[2] / 2.;
3640 geant->Gsvolu(natra1_ref(0, 14), "TUBE", idtmed[274], dtra1, 3);
3643 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3644 geant->Gspos(natra1_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3647 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3648 - 2550.25))) * raddeg;
3649 aphi2 = 180. - aphi1;
3650 xpos = (xtra[7] + xtra[0]) / 2.;
3651 ypos = (ytra[7] + ytra[0]) / 2.;
3652 zpos = dtra[2] / 2.;
3653 geant->Gsvolu(natra1_ref(0, 15), "TUBE", idtmed[274], dtra1, 3);
3656 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3657 geant->Gspos(natra1_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3658 zpos = -dtra[2] / 2.;
3659 geant->Gsvolu(natra1_ref(0, 16), "TUBE", idtmed[274], dtra1, 3);
3662 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3663 geant->Gspos(natra1_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3670 // --- The frame between the end-caps (hexagonal lay-out) ---
3672 // GOTO 9123 ! skip hexagonal frame
3674 if (fMinorVersion == 2) {
3679 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3685 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + 1088.0099999999998) / 2.;
3687 offset = angle / 2.;
3688 for (i = 1; i <= 6; ++i) {
3689 xtra1[i - 1] = rzero * TMath::Cos(((i-1) * angle + offset) *degrad);
3690 ytra1[i - 1] = rzero * TMath::Sin(((i-1) * angle + offset) *degrad);
3692 geant->Gsvolu(natra2_ref(0, i), "TUBE", idtmed[274], dtra2, 3);
3693 geant->Gspos(natra2_ref(0, i), 1, "ITSV", xtra1[i - 1], ytra1[i - 1], ztra1[i - 1], 0, "ONLY");
3698 xpos = (xtra1[0] + xtra1[1]) / 2.;
3699 ypos = (ytra1[0] + ytra1[1]) / 2.;
3701 geant->Gsvolu(natra3_ref(0, 1), "TUBE", idtmed[274], dtra3, 3);
3704 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3705 geant->Gspos(natra3_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3709 xpos = (xtra1[1] + xtra1[2]) / 2.;
3710 ypos = (ytra1[1] + ytra1[2]) / 2.;
3712 geant->Gsvolu(natra3_ref(0, 2), "TUBE", idtmed[274], dtra3, 3);
3715 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3716 geant->Gspos(natra3_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3720 xpos = (xtra1[2] + xtra1[3]) / 2.;
3721 ypos = (ytra1[2] + ytra1[3]) / 2.;
3723 geant->Gsvolu(natra3_ref(0, 3), "TUBE", idtmed[274], dtra3, 3);
3726 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3727 geant->Gspos(natra3_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3731 xpos = (xtra1[3] + xtra1[4]) / 2.;
3732 ypos = (ytra1[3] + ytra1[4]) / 2.;
3734 geant->Gsvolu(natra3_ref(0, 4), "TUBE", idtmed[274], dtra3, 3);
3737 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3738 geant->Gspos(natra3_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3742 xpos = (xtra1[4] + xtra1[5]) / 2.;
3743 ypos = (ytra1[4] + ytra1[5]) / 2.;
3745 geant->Gsvolu(natra3_ref(0, 5), "TUBE", idtmed[274], dtra3, 3);
3748 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3749 geant->Gspos(natra3_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3753 xpos = (xtra1[5] + xtra1[0]) / 2.;
3754 ypos = (ytra1[5] + ytra1[0]) / 2.;
3756 geant->Gsvolu(natra3_ref(0, 6), "TUBE", idtmed[274], dtra3, 3);
3759 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3760 geant->Gspos(natra3_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3763 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3764 - 2500.))) * raddeg;
3765 aphi1 = 180. - aphi2;
3766 xpos = (xtra1[0] + xtra1[1]) / 2.;
3767 ypos = (ytra1[0] + ytra1[1]) / 2.;
3768 zpos = dtra2[2] / 2.;
3769 geant->Gsvolu(natra4_ref(0, 1), "TUBE", idtmed[274], dtra4, 3);
3772 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3773 geant->Gspos(natra4_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3774 zpos = -dtra2[2] / 2.;
3775 geant->Gsvolu(natra4_ref(0, 2), "TUBE", idtmed[274], dtra4, 3);
3778 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3779 geant->Gspos(natra4_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3782 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3783 - 2500.))) * raddeg;
3784 aphi2 = 180. - aphi1;
3785 xpos = (xtra1[1] + xtra1[2]) / 2.;
3786 ypos = (ytra1[1] + ytra1[2]) / 2.;
3787 zpos = dtra2[2] / 2.;
3788 geant->Gsvolu(natra4_ref(0, 3), "TUBE", idtmed[274], dtra4, 3);
3791 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3792 geant->Gspos(natra4_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3793 zpos = -dtra2[2] / 2.;
3794 geant->Gsvolu(natra4_ref(0, 4), "TUBE", idtmed[274], dtra4, 3);
3797 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3798 geant->Gspos(natra4_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3801 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3802 - 2500.))) * raddeg;
3803 aphi1 = 180. - aphi2;
3804 xpos = (xtra1[2] + xtra1[3]) / 2.;
3805 ypos = (ytra1[2] + ytra1[3]) / 2.;
3806 zpos = dtra2[2] / 2.;
3807 geant->Gsvolu(natra4_ref(0, 5), "TUBE", idtmed[274], dtra4, 3);
3810 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3811 geant->Gspos(natra4_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3812 zpos = -dtra2[2] / 2.;
3813 geant->Gsvolu(natra4_ref(0, 6), "TUBE", idtmed[274], dtra4, 3);
3816 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3817 geant->Gspos(natra4_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3819 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3820 - 2500.))) * raddeg;
3821 aphi2 = 180. - aphi1;
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, 7), "TUBE", idtmed[274], dtra4, 3);
3828 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3829 geant->Gspos(natra4_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
3830 zpos = -dtra2[2] / 2.;
3831 geant->Gsvolu(natra4_ref(0, 8), "TUBE", idtmed[274], dtra4, 3);
3834 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3835 geant->Gspos(natra4_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
3838 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3839 - 2500.))) * raddeg;
3840 aphi1 = 180. - aphi2;
3841 xpos = (xtra1[3] + xtra1[4]) / 2.;
3842 ypos = (ytra1[3] + ytra1[4]) / 2.;
3843 zpos = dtra2[2] / 2.;
3844 geant->Gsvolu(natra4_ref(0, 9), "TUBE", idtmed[274], dtra4, 3);
3847 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3848 geant->Gspos(natra4_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
3849 zpos = -dtra2[2] / 2.;
3850 geant->Gsvolu(natra4_ref(0, 10), "TUBE", idtmed[274], dtra4, 3);
3853 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3854 geant->Gspos(natra4_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
3857 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3858 - 2500.))) * raddeg;
3859 aphi2 = 180. - aphi1;
3860 xpos = (xtra1[4] + xtra1[5]) / 2.;
3861 ypos = (ytra1[4] + ytra1[5]) / 2.;
3862 zpos = dtra2[2] / 2.;
3863 geant->Gsvolu(natra4_ref(0, 11), "TUBE", idtmed[274], dtra4, 3);
3866 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3867 geant->Gspos(natra4_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
3868 zpos = -dtra2[2] / 2.;
3869 geant->Gsvolu(natra4_ref(0, 12), "TUBE", idtmed[274], dtra4, 3);
3872 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3873 geant->Gspos(natra4_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
3876 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3877 - 2500.))) * raddeg;
3878 aphi1 = 180. - aphi2;
3879 xpos = (xtra1[5] + xtra1[0]) / 2.;
3880 ypos = (ytra1[5] + ytra1[0]) / 2.;
3881 zpos = dtra2[2] / 2.;
3882 geant->Gsvolu(natra4_ref(0, 13), "TUBE", idtmed[274], dtra4, 3);
3885 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3886 geant->Gspos(natra4_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
3887 zpos = -dtra2[2] / 2.;
3888 geant->Gsvolu(natra4_ref(0, 14), "TUBE", idtmed[274], dtra4, 3);
3891 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3892 geant->Gspos(natra4_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
3894 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3895 - 2500.))) * raddeg;
3896 aphi2 = 180. - aphi1;
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, 15), "TUBE", idtmed[274], dtra4, 3);
3903 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3904 geant->Gspos(natra4_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
3905 zpos = -dtra2[2] / 2.;
3906 geant->Gsvolu(natra4_ref(0, 16), "TUBE", idtmed[274], dtra4, 3);
3909 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3910 geant->Gspos(natra4_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
3913 } else if (fMinorVersion == 5) {
3919 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3925 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + 1088.0099999999998) / 2.;
3927 offset = angle / 2.;
3928 for (i = 1; i <= 6; ++i) {
3929 xtra1[i - 1] = rzero * TMath::Cos(((i-1) * angle + offset) *degrad);
3930 ytra1[i - 1] = rzero * TMath::Sin(((i-1) * angle + offset) *degrad);
3932 geant->Gsvolu(natra2_ref(0, i), "TUBE", idtmed[274], dtra2, 3);
3933 geant->Gspos(natra2_ref(0, i), 1, "ITSV", xtra1[i - 1], ytra1[i - 1], ztra1[i - 1], 0, "ONLY");
3938 xpos = (xtra1[0] + xtra1[1]) / 2.;
3939 ypos = (ytra1[0] + ytra1[1]) / 2.;
3941 geant->Gsvolu(natra3_ref(0, 1), "TUBE", idtmed[274], dtra3, 3);
3944 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3945 geant->Gspos(natra3_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3949 xpos = (xtra1[1] + xtra1[2]) / 2.;
3950 ypos = (ytra1[1] + ytra1[2]) / 2.;
3952 geant->Gsvolu(natra3_ref(0, 2), "TUBE", idtmed[274], dtra3, 3);
3955 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3956 geant->Gspos(natra3_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3960 xpos = (xtra1[2] + xtra1[3]) / 2.;
3961 ypos = (ytra1[2] + ytra1[3]) / 2.;
3963 geant->Gsvolu(natra3_ref(0, 3), "TUBE", idtmed[274], dtra3, 3);
3966 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3967 geant->Gspos(natra3_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3971 xpos = (xtra1[3] + xtra1[4]) / 2.;
3972 ypos = (ytra1[3] + ytra1[4]) / 2.;
3974 geant->Gsvolu(natra3_ref(0, 4), "TUBE", idtmed[274], dtra3, 3);
3977 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3978 geant->Gspos(natra3_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3982 xpos = (xtra1[4] + xtra1[5]) / 2.;
3983 ypos = (ytra1[4] + ytra1[5]) / 2.;
3985 geant->Gsvolu(natra3_ref(0, 5), "TUBE", idtmed[274], dtra3, 3);
3988 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3989 geant->Gspos(natra3_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3993 xpos = (xtra1[5] + xtra1[0]) / 2.;
3994 ypos = (ytra1[5] + ytra1[0]) / 2.;
3996 geant->Gsvolu(natra3_ref(0, 6), "TUBE", idtmed[274], dtra3, 3);
3999 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4000 geant->Gspos(natra3_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4003 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4004 - 2500.))) * raddeg;
4005 aphi1 = 180. - aphi2;
4006 xpos = (xtra1[0] + xtra1[1]) / 2.;
4007 ypos = (ytra1[0] + ytra1[1]) / 2.;
4008 zpos = dtra2[2] / 2.;
4009 geant->Gsvolu(natra4_ref(0, 1), "TUBE", idtmed[274], dtra4, 3);
4012 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4013 geant->Gspos(natra4_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4014 zpos = -dtra2[2] / 2.;
4015 geant->Gsvolu(natra4_ref(0, 2), "TUBE", idtmed[274], dtra4, 3);
4018 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4019 geant->Gspos(natra4_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4022 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4023 - 2500.))) * raddeg;
4024 aphi2 = 180. - aphi1;
4025 xpos = (xtra1[1] + xtra1[2]) / 2.;
4026 ypos = (ytra1[1] + ytra1[2]) / 2.;
4027 zpos = dtra2[2] / 2.;
4028 geant->Gsvolu(natra4_ref(0, 3), "TUBE", idtmed[274], dtra4, 3);
4031 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4032 geant->Gspos(natra4_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4033 zpos = -dtra2[2] / 2.;
4034 geant->Gsvolu(natra4_ref(0, 4), "TUBE", idtmed[274], dtra4, 3);
4037 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4038 geant->Gspos(natra4_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4041 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4042 - 2500.))) * raddeg;
4043 aphi1 = 180. - aphi2;
4044 xpos = (xtra1[2] + xtra1[3]) / 2.;
4045 ypos = (ytra1[2] + ytra1[3]) / 2.;
4046 zpos = dtra2[2] / 2.;
4047 geant->Gsvolu(natra4_ref(0, 5), "TUBE", idtmed[274], dtra4, 3);
4050 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4051 geant->Gspos(natra4_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4052 zpos = -dtra2[2] / 2.;
4053 geant->Gsvolu(natra4_ref(0, 6), "TUBE", idtmed[274], dtra4, 3);
4056 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4057 geant->Gspos(natra4_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4059 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4060 - 2500.))) * raddeg;
4061 aphi2 = 180. - aphi1;
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, 7), "TUBE", idtmed[274], dtra4, 3);
4068 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4069 geant->Gspos(natra4_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4070 zpos = -dtra2[2] / 2.;
4071 geant->Gsvolu(natra4_ref(0, 8), "TUBE", idtmed[274], dtra4, 3);
4074 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4075 geant->Gspos(natra4_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4078 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4079 - 2500.))) * raddeg;
4080 aphi1 = 180. - aphi2;
4081 xpos = (xtra1[3] + xtra1[4]) / 2.;
4082 ypos = (ytra1[3] + ytra1[4]) / 2.;
4083 zpos = dtra2[2] / 2.;
4084 geant->Gsvolu(natra4_ref(0, 9), "TUBE", idtmed[274], dtra4, 3);
4087 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4088 geant->Gspos(natra4_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4089 zpos = -dtra2[2] / 2.;
4090 geant->Gsvolu(natra4_ref(0, 10), "TUBE", idtmed[274], dtra4, 3);
4093 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4094 geant->Gspos(natra4_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4097 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4098 - 2500.))) * raddeg;
4099 aphi2 = 180. - aphi1;
4100 xpos = (xtra1[4] + xtra1[5]) / 2.;
4101 ypos = (ytra1[4] + ytra1[5]) / 2.;
4102 zpos = dtra2[2] / 2.;
4103 geant->Gsvolu(natra4_ref(0, 11), "TUBE", idtmed[274], dtra4, 3);
4106 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4107 geant->Gspos(natra4_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4108 zpos = -dtra2[2] / 2.;
4109 geant->Gsvolu(natra4_ref(0, 12), "TUBE", idtmed[274], dtra4, 3);
4112 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4113 geant->Gspos(natra4_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4116 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4117 - 2500.))) * raddeg;
4118 aphi1 = 180. - aphi2;
4119 xpos = (xtra1[5] + xtra1[0]) / 2.;
4120 ypos = (ytra1[5] + ytra1[0]) / 2.;
4121 zpos = dtra2[2] / 2.;
4122 geant->Gsvolu(natra4_ref(0, 13), "TUBE", idtmed[274], dtra4, 3);
4125 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4126 geant->Gspos(natra4_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4127 zpos = -dtra2[2] / 2.;
4128 geant->Gsvolu(natra4_ref(0, 14), "TUBE", idtmed[274], dtra4, 3);
4131 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4132 geant->Gspos(natra4_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4134 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4135 - 2500.))) * raddeg;
4136 aphi2 = 180. - aphi1;
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, 15), "TUBE", idtmed[274], dtra4, 3);
4143 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4144 geant->Gspos(natra4_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4145 zpos = -dtra2[2] / 2.;
4146 geant->Gsvolu(natra4_ref(0, 16), "TUBE", idtmed[274], dtra4, 3);
4149 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4150 geant->Gspos(natra4_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4156 // --- Define the end-caps
4158 // GOTO 9234 ! skip both end-caps
4160 // --- Define the Z>0 end-cap
4162 // GOTO 9345 ! skip the Z>0 end-cap
4167 dcone[3] = 46.899999999999999;
4168 dcone[4] = .02 / TMath::Cos(.78539816339744828) + 46.899999999999999;
4171 zpos = dpcb[2] * 2. + 45.899999999999999 - 10.5;
4172 // end-ladder electro
4173 geant->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4175 geant->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4177 dtube[0] = .02 / TMath::Cos(.78539816339744828) +
4180 // In the Simonetti's drawings 52. In the TP 50.
4184 zpos = dpcb[2] * 2. + 62.799999999999997 - 10.5;
4185 // end-ladder electro
4186 geant->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4188 geant->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4192 dtube[2] = 1.3400000000000001;
4195 zpos = dpcb[2] * 2. + 21.59 - 10.5;
4197 geant->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4199 geant->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4205 dpgon[4] = dpcb[2] * 2. + 22.93 - 10.5;
4206 // end-ladder electron
4209 dpgon[7] = dpcb[2] * 2. + 29.149999999999999 - 10.5;
4210 // end-ladder electronics
4216 geant->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4217 geant->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4223 dpgon[4] = dpcb[2] * 2. + 35.649999999999999 - 10.5;
4227 dpgon[7] = dpcb[2] * 2. + 37.149999999999999 - 10.5;
4234 geant->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4235 geant->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4237 if (fMinorVersion == 0 || fMinorVersion == 1 || fMinorVersion ==2) {
4239 dpgon[0] = offset2 + 5.1428571428571432;
4243 dpgon[4] = dpcb[2] * 2. + 52.350000000000001 - 10.5;
4247 dpgon[7] = dpcb[2] * 2. + 53.850000000000001 - 10.5;
4254 geant->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4255 geant->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4257 dpgon[0] = offset2 + 4.615384615384615;
4261 dpgon[4] = dpcb[2] * 2. + 57.350000000000001 - 10.5;
4265 dpgon[7] = dpcb[2] * 2. + 58.850000000000001 - 10.5;
4272 geant->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4273 geant->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4275 if (fMinorVersion == 3 || fMinorVersion == 4 || fMinorVersion == 5) {
4277 dpgon[0] = offset2 + 5.625;
4281 dpgon[4] = 52.350000000000001 - 3.3999999999999986 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4282 // end-ladder electronics
4285 dpgon[7] = 53.850000000000001 - 3.3999999999999986 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4286 // end-ladder electr
4292 geant->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4293 geant->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4295 dpgon[0] = offset2 + 5.;
4299 dpgon[4] = 57.350000000000001 - 3.7999999999999972 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4300 // end-ladder electronics
4303 dpgon[7] = 58.850000000000001 - 3.7999999999999972 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4304 // end-ladder electr
4310 geant->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4311 geant->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4316 // --- Define the Z<0 end-cap
4318 // GOTO 9456 ! skip the Z<0 end-cap
4321 dcone[1] = 46.899999999999999;
4322 dcone[2] = .02 / TMath::Cos(.78539816339744828) + 46.899999999999999;
4327 zpos = -45.899999999999999 - dpcb[2] * 2. + 10.5;
4328 // end-ladder electr
4329 geant->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4331 geant->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4333 dtube[0] = .02 / TMath::Cos(.78539816339744828) +
4336 // In the Simonetti's drawings 52. In the TP 50.
4340 zpos = -62.799999999999997 - dpcb[2] * 2. + 10.5;
4341 // end-ladder electr
4342 geant->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4344 geant->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4348 dtube[2] = 1.3400000000000001;
4351 zpos = -21.59 - dpcb[2] * 2. + 10.5;
4353 geant->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4355 geant->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4361 dpgon[4] = -29.149999999999999 - dpcb[2] * 2. + 10.5;
4362 // end-ladder electronics
4365 dpgon[7] = -22.93 - dpcb[2] * 2. + 10.5;
4366 // end-ladder electro
4372 geant->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4373 geant->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4379 dpgon[4] = -37.149999999999999 - dpcb[2] * 2. + 10.5;
4383 dpgon[7] = -35.649999999999999 - dpcb[2] * 2. + 10.5;
4390 geant->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4391 geant->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4393 if (fMinorVersion == 0 || fMinorVersion == 1 || fMinorVersion ==2) {
4395 dpgon[0] = offset2 + 5.1428571428571432;
4399 dpgon[4] = -52.350000000000001 - dpcb[2] * 2. + 10.5;
4403 dpgon[7] = -53.850000000000001 - dpcb[2] * 2. + 10.5;
4410 geant->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4411 geant->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4413 dpgon[0] = offset2 + 4.615384615384615;
4417 dpgon[4] = -57.350000000000001 - dpcb[2] * 2. + 10.5;
4421 dpgon[7] = -58.850000000000001 - dpcb[2] * 2. + 10.5;
4428 geant->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4429 geant->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4431 if (fMinorVersion == 3 || fMinorVersion == 4 || fMinorVersion == 5) {
4433 dpgon[0] = offset2 + 5.625;
4437 dpgon[4] = 3.4 / TMath::Tan(.78539816339744828) - 52.35 - dpcb[2] * 2. + 10.5;
4438 // end-ladder electronics
4441 dpgon[7] = 3.4 / TMath::Tan(.78539816339744828) - 53.85 - dpcb[2] * 2. + 10.5;
4442 // end-ladder electr
4448 geant->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4449 geant->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4451 dpgon[0] = offset2 + 5.;
4455 dpgon[4] = 3.8 / TMath::Tan(.78539816339744828) - 57.35 - dpcb[2] * 2. + 10.5;
4456 // end-ladder electronics
4459 dpgon[7] = 3.8 / TMath::Tan(.78539816339744828) - 58.85 - dpcb[2] * 2. + 10.5;
4460 // end-ladder electr
4466 geant->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4467 geant->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4473 // --- Outputs the geometry tree in the EUCLID/CAD format
4476 geant->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4479 // --- Outputs the geometry tree in the EUCLID/CAD format
4482 pMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4486 //_____________________________________________________________________________
4487 void AliITSv4::CreateMaterials()
4490 // Create Materials for ITS
4492 AliITS::CreateMaterials();
4495 //_____________________________________________________________________________
4496 void AliITSv4::Init()
4499 // Initialise ITS after it has been created
4501 AliMC* pMC = AliMC::GetMC();
4502 fIdSens1=pMC->VolId("ITS1");
4503 fIdSens2=pMC->VolId("ITS2");
4504 fIdSens3=pMC->VolId("ITS3");
4505 fIdSens4=pMC->VolId("ITS4");
4506 fIdSens5=pMC->VolId("ITS5");
4507 fIdSens6=pMC->VolId("ITS6");
4510 //_____________________________________________________________________________
4511 void AliITSv4::StepManager()
4514 // Called at every step in the ITS
4519 Float_t position[3];
4520 Float_t momentum[4];
4521 TClonesArray &lhits = *fHits;
4522 AliMC* pMC = AliMC::GetMC();
4524 if(pMC->TrackCharge() && pMC->Edep()) {
4526 // Only entering charged tracks
4527 if((id=pMC->CurrentVol(0,copy))==fIdSens1) {
4529 id=pMC->CurrentVolOff(1,0,copy);
4531 id=pMC->CurrentVolOff(2,0,copy);
4533 } else if(id==fIdSens2) {
4535 id=pMC->CurrentVolOff(1,0,copy);
4537 id=pMC->CurrentVolOff(2,0,copy);
4539 } else if(id==fIdSens3) {
4542 id=pMC->CurrentVolOff(1,0,copy);
4544 } else if(id==fIdSens4) {
4547 id=pMC->CurrentVolOff(1,0,copy);
4549 } else if(id==fIdSens5) {
4552 id=pMC->CurrentVolOff(1,0,copy);
4554 } else if(id==fIdSens6) {
4557 id=pMC->CurrentVolOff(1,0,copy);
4560 pMC->TrackPosition(position);
4561 pMC->TrackMomentum(momentum);
4562 hits[0]=position[0];
4563 hits[1]=position[1];
4564 hits[2]=position[2];
4565 hits[3]=momentum[0]*momentum[3];
4566 hits[4]=momentum[1]*momentum[3];
4567 hits[5]=momentum[2]*momentum[3];
4568 hits[6]=pMC->Edep();
4569 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);