1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // Inner Traking System version 3 //
23 // This class contains the base procedures for the Inner Tracking System //
25 // Authors: R. Barbera, A. Morsch.
29 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
30 // WORK with the geometry or module classes or any analysis classes. You are
31 // strongly encouraged to uses AliITSv5.
34 ///////////////////////////////////////////////////////////////////////////////
39 #include "AliITShit.h"
48 //_____________________________________________________________________________
49 AliITSv3::AliITSv3() : AliITS(){
51 // Default constructor for ITS
56 //_____________________________________________________________________________
57 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
59 // Standard constructor for ITS
64 //_____________________________________________________________________________
65 void AliITSv3::CreateGeometry(){
67 // Create ITS geometry for version 3
72 const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
73 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
75 const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
76 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
78 const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
79 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
81 const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
82 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
84 const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
85 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
87 const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
88 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
90 const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
91 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
93 const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
94 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
96 const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
97 0.5,0.7,0.5,0.7,0.5,0.5 };
98 const Float_t rr = 4.064516;
99 const Float_t tteta = 63.00;
100 const Float_t pphi = -35.00;
101 const Float_t gteta = 87.78;
102 const Double_t degrad = kPI/180.;
103 const Double_t raddeg = 180./kPI;
104 const Double_t twopi = 2*kPI;
107 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
108 dfra[10], dcer[3], dkap[3], dpla[3],
109 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
110 atheta1011, dbus[3], dtub[3], dwat[3],
111 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
112 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
113 Double_t biga1, bigb1;
114 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
115 dtra1[3], dtra2[3], dtra3[3],
116 dtra4[3], dbox1[3], dbox2[3];
118 Float_t xtra1[6], ytra1[6], ztra1[6];
120 Float_t xpos1, ypos1;
122 Float_t angle, dcone[5], dtube[3], dpgon[10];
123 Float_t rzero, xzero, yzero;
124 Double_t coeffa, coeffb, coeffc;
126 Float_t atheta, offset;
127 Float_t offset1, offset2, dgh[15];
128 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
129 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
132 Double_t xcc1, ycc1, xcc2, ycc2;
134 const char natra[][5] ={ "TR01","TR02","TR03","TR04",
135 "TR05","TR06","TR07","TR08"};
136 const char natra1[][5] ={"TR11","TR12","TR13","TR14",
137 "TR15","TR16","TR17","TR18",
138 "TR19","TR20","TR21","TR22",
139 "TR23","TR24","TR25","TR26"};
140 const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
141 const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
142 const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
143 "TR57","TR58","TR59","TR60","TR61","TR62",
144 "TR63","TR64","TR65","TR66"};
146 Int_t *idtmed = fIdtmed->GetArray()-199;
148 // --- Define a ghost volume containing the whole ITS and fill it with air
166 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
168 // --- Place the ghost volume in its mother volume (ALIC) and make it
171 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
172 gMC->Gsatt("ITSV", "SEEN", 0);
174 //************************************************************************
179 //************************************************************************
181 // GOTO 2345 ! skip ITS layer no. 1 and 2
183 // --- Define a ghost volume containing the Silicon Pixel Detectors
184 // (layer #1 and #2) and fill it with air or vacuum
186 xxm = (49.999-3)/(70-25);
190 dgh[3] = -25.-(9.-3.01)/xxm;
199 dgh[12] = 25+(9-3.01)/xxm;
202 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
204 // --- Place the ghost volume in its mother volume (ITSV) and make it
207 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
208 gMC->Gsatt("IT12", "SEEN", 0);
210 // --- Define a ghost volume containing a single element of layer #1
211 // and fill it with air or vacuum
213 dbox1[0] = 0.005+0.01+0.0075;
216 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
218 //--Divide each element of layer #1 in three ladders along the beam direction
220 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
222 // --- Make the ghost volumes invisible
224 gMC->Gsatt("IPV1", "SEEN", 0);
225 gMC->Gsatt("IPB1", "SEEN", 0);
227 // --- Define a volume containing the chip of pixels (silicon, layer #1)
231 dchi[2] = dbox1[2] / 3.;
232 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
234 // --- Define a volume containing the bus of pixels (silicon, layer #1)
239 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
241 // --- Define a volume containing the sensitive part of pixels
242 // (silicon, layer #1)
247 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
249 // --- Place the chip into its mother (IPB1)
251 xpos = dbox1[0] - dchi[0];
254 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
256 // --- Place the sensitive volume into its mother (IPB1)
258 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
259 ypos = dchi[1] - dits[1];
260 zpos = -(dchi[2] - dits[2]);
261 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
263 // --- Place the bus into its mother (IPB1)
265 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
266 ypos = dchi[1] - dbus[1];
267 zpos = -(dchi[2] - dbus[2]);
268 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
270 // --- Define a ghost volume containing a single element of layer #2
271 // and fill it with air or vacuum
273 dbox2[0] = 0.005+0.01+0.0075;
276 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
278 //--Divide each element of layer #2 in four ladders along the beam direction
280 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
282 // --- Make the ghost volumes invisible
284 gMC->Gsatt("IPV2", "SEEN", 0);
285 gMC->Gsatt("IPB2", "SEEN", 0);
287 // --- Define a volume containing the chip of pixels (silicon, layer #2)
291 dchi[2] = dbox2[2] / 4.;
292 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
294 // --- Define a volume containing the bus of pixels (silicon, layer #2)
299 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
301 // --- Define a volume containing the sensitive part of pixels
302 // (silicon, layer #2)
307 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
309 // --- Place the chip into its mother (IPB2)
311 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
314 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
316 // --- Place the sensitive volume into its mother (IPB2)
318 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
319 ypos = -(dchi[1] - dits[1]);
320 zpos = -(dchi[2] - dits[2]);
321 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
323 // --- Place the bus into its mother (IPB2)
325 xpos = dbox1[0] - dbus[0];
326 ypos = -(dchi[1] - dbus[1]);
327 zpos = -(dchi[2] - dbus[2]);
328 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
330 // --- Define a generic segment of an element of the mechanical support
335 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
337 // --- Define a generic arc of an element of the mechanical support
342 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
344 // --- Define the mechanical supports of layers #1 and #2 and place the
345 // elements of the layers in it
348 // counter over the number of elements of layer #1 (
351 // counter over the number of elements of layer #2 (
352 for (i = 1; i <= 10; ++i) {
354 // --- Place part # 1-2 (see sketch)
356 // number of carbon fiber supports (see sketch)
359 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
360 (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
362 xcc = ( xx[0] + xx[1]) / 20.;
363 ycc = ( yy[0] + yy[1]) / 20.;
364 xccc = (xbeg[0] + xend[0]) / 20.;
365 yccc = (ybeg[0] + yend[0]) / 20.;
366 if (xx[0] == xx[1]) {
371 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
372 } // end if xx[0] == xx[1]
373 aphi = (pphi + (i-1) * 36.) * degrad;
374 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
375 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
376 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
377 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
378 xpos = xpos1 * TMath::Cos(gteta * degrad) +
379 ypos1 * TMath::Sin(gteta *degrad);
380 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
381 ypos1 * TMath::Cos(gteta * degrad);
383 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
384 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
385 atheta12 + 90., 0., 0.);
386 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
387 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
389 // --- Place part # 2-3 (see sketch)
393 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
394 (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
396 xcc = ( xx[1] + xx[2]) / 20.;
397 ycc = ( yy[1] + yy[2]) / 20.;
398 xccc = (xbeg[1] + xend[1]) / 20.;
399 yccc = (ybeg[1] + yend[1]) / 20.;
400 if (xx[1] == xx[2]) {
405 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
406 } // end if xx[1] == xx[2]
407 aphi = (pphi + (i-1) * 36.) * degrad;
408 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
409 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
410 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
411 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
412 xpos = xpos1 * TMath::Cos(gteta * degrad) +
413 ypos1 * TMath::Sin(gteta * degrad);
414 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
415 ypos1 * TMath::Cos(gteta * degrad);
417 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
418 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
419 atheta23 + 90., 0., 0.);
420 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
421 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
423 // --- Place an element of layer #2
425 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
426 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
427 coeffa = biga * biga + 1.;
428 coeffb = biga * bigb - biga * ycc - xcc;
429 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
430 bigb * bigb - 0.08964*0.08964;
431 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
433 ycc1 = biga * xcc1 + bigb;
435 bigb1 = xcc1 / biga + ycc1;
436 coeffa = biga1 * biga1 + 1.;
437 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
438 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
439 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
440 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
442 ycc2 = biga1 * xcc2 + bigb1;
443 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
444 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
445 xpos = xpos1 * TMath::Cos(gteta * degrad) +
446 ypos1 * TMath::Sin(gteta *degrad);
447 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
448 ypos1 * TMath::Cos(gteta * degrad);
451 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
452 idrotm[(i-1) * 13 + 1101], "ONLY");
454 // --- Place part # 3-4 (see sketch)
458 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
459 (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
461 xcc = (xx[1] + xx[2]) / 20.;
462 ycc = (yy[1] + yy[2]) / 20.;
463 xccc = (xbeg[2] + xend[2]) / 20.;
464 yccc = (ybeg[2] + yend[2]) / 20.;
465 if (xx[2] == xx[3]) {
470 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
471 } // end if xx[2] == xx[3]
472 aphi = (pphi + (i-1) * 36.) * degrad;
473 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
474 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
475 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
476 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
477 xpos = xpos1 * TMath::Cos(gteta * degrad) +
478 ypos1 * TMath::Sin(gteta *degrad);
479 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
480 ypos1 * TMath::Cos(gteta * degrad);
482 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
483 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
484 atheta34 + 90., 0., 0.);
485 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
486 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
488 // --- Place part # 4-5 (see sketch)
492 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
493 (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
495 xcc = ( xx[3] + xx[4]) / 20.;
496 ycc = ( yy[3] + yy[4]) / 20.;
497 xccc = (xbeg[3] + xend[3]) / 20.;
498 yccc = (ybeg[3] + yend[3]) / 20.;
499 if (xx[3] == xx[4]) {
504 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
505 } // end if xx[3] == xx[4]
506 aphi = (pphi + (i-1) * 36.) * degrad;
507 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
508 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
509 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
510 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
511 xpos = xpos1 * TMath::Cos(gteta * degrad) +
512 ypos1 * TMath::Sin(gteta *degrad);
513 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
514 ypos1 * TMath::Cos(gteta * degrad);
516 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
517 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
518 atheta45 + 90., 0., 0.);
519 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
520 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
522 // --- Place an element of layer #2
524 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
525 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
526 coeffa = biga * biga + 1.;
527 coeffb = biga * bigb - biga * ycc - xcc;
528 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
529 bigb * bigb - .014285030400000001;
530 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
532 ycc1 = biga * xcc1 + bigb;
534 bigb1 = xcc1 / biga + ycc1;
535 coeffa = biga1 * biga1 + 1.;
536 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
537 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
538 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
539 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
541 ycc2 = biga1 * xcc2 + bigb1;
542 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
543 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
544 xpos = xpos1 * TMath::Cos(gteta * degrad) +
545 ypos1 * TMath::Sin(gteta *degrad);
546 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
547 ypos1 * TMath::Cos(gteta * degrad);
550 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
551 idrotm[(i-1) * 13 + 1103], "ONLY");
553 // --- Place part # 5-6 (see sketch)
557 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
558 (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
560 xcc = (xx[4] + xx[5]) / 20.;
561 ycc = (yy[4] + yy[5]) / 20.;
562 xccc = (xbeg[4] + xend[4]) / 20.;
563 yccc = (ybeg[4] + yend[4]) / 20.;
564 if (xx[4] == xx[5]) {
569 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
571 aphi = (pphi + (i-1) * 36.) * degrad;
572 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
573 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
574 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
575 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
576 xpos = xpos1 * TMath::Cos(gteta * degrad) +
577 ypos1 * TMath::Sin(gteta *degrad);
578 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
579 ypos1 * TMath::Cos(gteta * degrad);
581 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
582 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
583 atheta56 + 90., 0., 0.);
584 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
585 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
587 // --- Place part # 6-7 (see sketch)
591 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
592 (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
594 xcc = (xx[5] + xx[6]) / 20.;
595 ycc = (yy[5] + yy[6]) / 20.;
596 xccc = (xbeg[5] + xend[5]) / 20.;
597 yccc = (ybeg[5] + yend[5]) / 20.;
598 if (xx[5] == xx[6]) {
603 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
604 } // end if xx[5] == xx[6]
605 aphi = (pphi + (i-1) * 36.) * degrad;
606 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
607 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
608 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
609 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
610 xpos = xpos1 * TMath::Cos(gteta * degrad) +
611 ypos1 * TMath::Sin(gteta *degrad);
612 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
613 ypos1 * TMath::Cos(gteta * degrad);
615 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
616 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
617 atheta67 + 90., 0., 0.);
618 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
619 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
621 // --- Place an element of layer #2
623 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
624 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
625 coeffa = biga * biga + 1.;
626 coeffb = biga * bigb - biga * ycc - xcc;
627 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
628 bigb * bigb - .014285030400000001;
629 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
631 ycc1 = biga * xcc1 + bigb;
633 bigb1 = xcc1 / biga + ycc1;
634 coeffa = biga1 * biga1 + 1.;
635 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
636 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
637 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
638 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
640 ycc2 = biga1 * xcc2 + bigb1;
641 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
642 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
643 xpos = xpos1 * TMath::Cos(gteta * degrad) +
644 ypos1 * TMath::Sin(gteta *degrad);
645 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
646 ypos1 * TMath::Cos(gteta * degrad);
649 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
650 idrotm[(i-1) * 13 + 1105], "ONLY");
652 // --- Place part # 7-8 (see sketch)
656 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
657 (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
659 xcc = (xx[6] + xx[7]) / 20.;
660 ycc = (yy[6] + yy[7]) / 20.;
661 xccc = (xbeg[6] + xend[6]) / 20.;
662 yccc = (ybeg[6] + yend[6]) / 20.;
663 if (xx[6] == xx[7]) {
668 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
670 aphi = (pphi + (i-1) * 36.) * degrad;
671 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
672 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
673 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
674 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
675 xpos = xpos1 * TMath::Cos(gteta * degrad) +
676 ypos1 * TMath::Sin(gteta *degrad);
677 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
678 ypos1 * TMath::Cos(gteta * degrad);
680 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
681 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
682 atheta78 + 90., 0., 0.);
683 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
684 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
686 // --- Place part # 8-9 (see sketch)
690 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
691 (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
693 xcc = (xx[7] + xx[8]) / 20.;
694 ycc = (yy[7] + yy[8]) / 20.;
695 xccc = (xbeg[7] + xend[7]) / 20.;
696 yccc = (ybeg[7] + yend[7]) / 20.;
697 if (xx[1] == xx[2]) {
702 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
704 aphi = (pphi + (i-1) * 36.) * degrad;
705 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
706 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
707 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
708 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
709 xpos = xpos1 * TMath::Cos(gteta * degrad) +
710 ypos1 * TMath::Sin(gteta *degrad);
711 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
712 ypos1 * TMath::Cos(gteta * degrad);
714 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
715 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
716 atheta89 + 90., 0., 0.);
717 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
718 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
720 // --- Place an element of layer #2
722 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
723 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
724 coeffa = biga * biga + 1.;
725 coeffb = biga * bigb - biga * ycc - xcc;
726 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
727 bigb * bigb - .014285030400000001;
728 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
730 ycc1 = biga * xcc1 + bigb;
732 bigb1 = xcc1 / biga + ycc1;
733 coeffa = biga1 * biga1 + 1.;
734 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
735 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
736 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
737 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
739 ycc2 = biga1 * xcc2 + bigb1;
740 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
741 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
742 xpos = xpos1 * TMath::Cos(gteta * degrad) +
743 ypos1 * TMath::Sin(gteta *degrad);
744 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
745 ypos1 * TMath::Cos(gteta * degrad);
748 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
749 idrotm[(i-1) * 13 + 1107], "ONLY");
751 // --- Place part # 9-10 (see sketch)
755 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
756 (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
758 xcc = (xx[8] + xx[9]) / 20.;
759 ycc = (yy[8] + yy[9]) / 20.;
760 xccc = (xbeg[8] + xend[8]) / 20.;
761 yccc = (ybeg[8] + yend[8]) / 20.;
762 if (xx[8] == xx[9]) {
767 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
769 aphi = (pphi + (i-1) * 36.) * degrad;
770 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
771 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
772 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
773 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
774 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
775 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
777 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
778 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
779 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
781 // --- Place part # 10-11 (see sketch)
785 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
787 xcc = (xx[9] + xx[10]) / 20.;
788 ycc = (yy[9] + yy[10]) / 20.;
789 xccc = (xbeg[9] + xend[9]) / 20.;
790 yccc = (ybeg[9] + yend[9]) / 20.;
791 if (xx[9] == xx[10]) {
796 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
798 aphi = (pphi + (i-1) * 36.) * degrad;
799 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
800 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
801 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
802 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
803 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
804 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
806 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
807 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
808 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
810 // --- Place part # 13-14 (see sketch)
814 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
816 xcc = (xx[12] + xx[13]) / 20.;
817 ycc = (yy[12] + yy[13]) / 20.;
818 xccc = (xbeg[12] + xend[12]) / 20.;
819 yccc = (ybeg[12] + yend[12]) / 20.;
820 if (xx[12] == xx[13]) {
823 r1 = yy[12] - yy[13];
824 r2 = xx[12] - xx[13];
825 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
827 aphi = (pphi + (i-1) * 36.) * degrad;
828 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
829 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
830 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
831 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
832 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
833 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
835 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
836 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
837 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
839 // --- Place an element of layer #1
841 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
842 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
843 coeffa = biga * biga + 1.;
844 coeffb = biga * bigb - biga * ycc - xcc;
845 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
846 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
847 ycc1 = biga * xcc1 + bigb;
849 bigb1 = xcc1 / biga + ycc1;
850 coeffa = biga1 * biga1 + 1.;
851 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
852 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
853 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
854 ycc2 = biga1 * xcc2 + bigb1;
855 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
856 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
857 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
858 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
861 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
863 // --- Place part # 12-13 (see sketch)
867 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
869 xcc = (xx[11] + xx[12]) / 20.;
870 ycc = (yy[11] + yy[12]) / 20.;
871 xccc = (xbeg[11] + xend[11]) / 20.;
872 yccc = (ybeg[11] + yend[11]) / 20.;
873 if (xx[11] == xx[12]) {
876 r1 = yy[12] - yy[11];
877 r2 = xx[12] - xx[11];
878 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
880 aphi = (pphi + (i-1) * 36.) * degrad;
881 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
882 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
883 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
884 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
885 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
886 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
888 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
889 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
890 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
892 // --- Place part # 11-12 (see sketch)
896 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
898 xcc = (xx[10] + xx[11]) / 20.;
899 ycc = (yy[10] + yy[11]) / 20.;
900 xccc = (xbeg[10] + xend[10]) / 20.;
901 yccc = (ybeg[10] + yend[10]) / 20.;
902 if (xx[10] == xx[11]) {
905 r1 = yy[11] - yy[10];
906 r2 = xx[11] - xx[10];
907 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
909 aphi = (pphi + (i-1) * 36.) * degrad;
910 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
911 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
912 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
913 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
914 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
915 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
917 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
918 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
919 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
921 // --- Place an element of layer #1
923 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
924 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
925 coeffa = biga * biga + 1.;
926 coeffb = biga * bigb - biga * ycc - xcc;
927 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
928 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
929 ycc1 = biga * xcc1 + bigb;
931 bigb1 = xcc1 / biga + ycc1;
932 coeffa = biga1 * biga1 + 1.;
933 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
934 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
935 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
936 ycc2 = biga1 * xcc2 + bigb1;
937 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
938 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * 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);
943 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
945 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
947 darc[0] = rarc[12] / 10. - .02;
948 darc[1] = rarc[12] / 10.;
950 darc[3] = atheta12 - (i-1) * 36.;
951 darc[4] = atheta23 - (i-1) * 36.;
952 xcc = xarc[12] / 10.;
953 ycc = yarc[12] / 10.;
954 aphi = (pphi + (i-1) * 36.) * degrad;
955 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
956 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
957 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
958 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
959 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
960 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
962 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
964 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
966 darc[0] = rarc[11] / 10. - .02;
967 darc[1] = rarc[11] / 10.;
969 darc[3] = atheta23 + 90. - (i-1) * 36.;
970 darc[4] = atheta34 + 90. - (i-1) * 36.;
971 xcc = xarc[11] / 10.;
972 ycc = yarc[11] / 10.;
973 aphi = (pphi + (i-1) * 36.) * degrad;
974 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
975 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
976 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
977 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
978 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
979 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
981 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
983 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
985 darc[0] = rarc[10] / 10. - .02;
986 darc[1] = rarc[10] / 10.;
988 darc[3] = atheta45 + 180. - (i-1) * 36.;
989 darc[4] = atheta34 + 180. - (i-1) * 36.;
990 xcc = xarc[10] / 10.;
991 ycc = yarc[10] / 10.;
992 aphi = (pphi + (i-1) * 36.) * degrad;
993 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
994 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
995 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
996 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
997 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
998 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1000 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1002 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1004 darc[0] = rarc[9] / 10. - .02;
1005 darc[1] = rarc[9] / 10.;
1007 darc[3] = atheta45 - 90. - (i-1) * 36.;
1008 darc[4] = atheta56 - 90. - (i-1) * 36.;
1009 xcc = xarc[9] / 10.;
1010 ycc = yarc[9] / 10.;
1011 aphi = (pphi + (i-1) * 36.) * degrad;
1012 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1013 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1014 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1015 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1016 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1017 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1019 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1021 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1023 darc[0] = rarc[8] / 10. - .02;
1024 darc[1] = rarc[8] / 10.;
1026 darc[3] = atheta67 + 45. - (i-1) * 36.;
1027 darc[4] = atheta56 + 45. - (i-1) * 36.;
1028 xcc = xarc[8] / 10.;
1029 ycc = yarc[8] / 10.;
1030 aphi = (pphi + (i-1) * 36.) * degrad;
1031 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1032 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1033 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1034 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1035 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1036 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1038 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1040 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1042 darc[0] = rarc[7] / 10. - .02;
1043 darc[1] = rarc[7] / 10.;
1045 darc[3] = atheta67 - (i-1) * 36.;
1046 darc[4] = atheta78 - (i-1) * 36.;
1047 xcc = xarc[7] / 10.;
1048 ycc = yarc[7] / 10.;
1049 aphi = (pphi + (i-1) * 36.) * degrad;
1050 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1051 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1052 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1053 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1054 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1055 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1057 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1059 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1061 darc[0] = rarc[6] / 10. - .02;
1062 darc[1] = rarc[6] / 10.;
1064 darc[3] = atheta89 + 45. - (i-1) * 36.;
1065 darc[4] = atheta78 + 45. - (i-1) * 36.;
1066 xcc = xarc[6] / 10.;
1067 ycc = yarc[6] / 10.;
1068 aphi = (pphi + (i-1) * 36.) * degrad;
1069 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1070 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1071 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1072 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1073 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1074 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1076 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1078 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1080 darc[0] = rarc[5] / 10. - .02;
1081 darc[1] = rarc[5] / 10.;
1083 darc[3] = atheta89 + 45. - (i-1) * 36.;
1084 darc[4] = atheta910 + 45. - (i-1) * 36.;
1085 xcc = xarc[5] / 10.;
1086 ycc = yarc[5] / 10.;
1087 aphi = (pphi + (i-1) * 36.) * degrad;
1088 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1089 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1090 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1091 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1092 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1093 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1095 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1097 // --- Place arc # 5 (between part 9-10 and part 10-11)
1100 darc[0] = rarc[4] / 10. - .02;
1101 darc[1] = rarc[4] / 10.;
1103 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1104 darc[4] = atheta910 + 45. - (i-1) * 36.;
1105 xcc = xarc[4] / 10.;
1106 ycc = yarc[4] / 10.;
1107 aphi = (pphi + (i-1) * 36.) * degrad;
1108 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1109 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1110 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1111 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1112 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1113 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1115 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1117 // --- Place arc # 4 (between part 10-11 and part 11-12)
1120 darc[0] = rarc[3] / 10. - .02;
1121 darc[1] = rarc[3] / 10.;
1123 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1124 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1125 xcc = xarc[3] / 10.;
1126 ycc = yarc[3] / 10.;
1127 aphi = (pphi + (i-1) * 36.) * degrad;
1128 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1129 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1130 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1131 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1132 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1133 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1135 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1137 // --- Place arc # 3 (between part 11-12 and part 12-13)
1140 darc[0] = rarc[2] / 10. - .02;
1141 darc[1] = rarc[2] / 10.;
1143 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1144 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1145 xcc = xarc[2] / 10.;
1146 ycc = yarc[2] / 10.;
1147 aphi = (pphi + (i-1) * 36.) * degrad;
1148 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1149 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1150 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1151 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1152 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1153 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1155 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1157 // --- Place arc # 2 (between part 12-13 and part 13-14)
1160 darc[0] = rarc[1] / 10. - .02;
1161 darc[1] = rarc[1] / 10.;
1163 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1164 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1165 xcc = xarc[1] / 10.;
1166 ycc = yarc[1] / 10.;
1167 aphi = (pphi + (i-1) * 36.) * degrad;
1168 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1169 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1170 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1171 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1172 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1173 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1175 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1177 // --- Place arc # 1 (between part 13-14 and part 1-2)
1180 darc[0] = rarc[0] / 10. - .02;
1181 darc[1] = rarc[0] / 10.;
1183 darc[3] = atheta12 + 45. - (i-1) * 36.;
1184 darc[4] = atheta1314 - (i-1) * 36.;
1185 xcc = xarc[0] / 10.;
1186 ycc = yarc[0] / 10.;
1187 aphi = (pphi + (i-1) * 36.) * degrad;
1188 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1189 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1190 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1191 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1192 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1193 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1195 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1198 //************************************************************************
1203 //************************************************************************
1205 // --- Define a ghost volume containing the Silicon Drift Detectors
1206 // (layer #3 and #4) and fill it with air or vacuum
1208 xxm = (49.999-3.)/(70.-25.);
1212 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1215 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1218 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1221 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1224 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1226 // --- Place the ghost volume in its mother volume (ITSV) and make it
1229 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1230 gMC->Gsatt("IT34", "SEEN", 0);
1234 // GOTO 3456 ! skip ITS layer no. 3
1236 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1237 // smaller lenght of ribs) and fill it with air or vacuum
1239 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1241 // the widest element is the sensitive element
1242 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1243 // 7.5 cm is the lenght
1244 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1246 // --- Make the ghost volume invisible
1248 gMC->Gsatt("IDV1", "SEEN", 0);
1250 // --- Define a volume containing the sensitive part of drifts
1251 // (silicon, layer #3)
1254 // see material budget report by G. Feofilov
1257 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1259 //--- Define the part of the (smaller) rib between two sensitive parts made of
1260 // carbon (layer #3)
1262 dsup[0] = .5 - dits[0];
1264 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1265 // 7.5 cm is the lenght
1266 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1268 //--- Define the first part of the (smaller) rib between two sensitive parts
1269 // made of aluminum (layer #3)
1271 dal1[0] = .5 - dits[0];
1272 dal1[1] = 0.00096/2.;
1273 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1274 // 7.5 cm is the lenght
1275 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1277 //--- Define the part of the (smaller) rib between two sensitive parts made of
1278 // kapton (layer #3)
1280 dkap[0] = .5 - dits[0];
1282 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1283 // 7.5 cm is the lenght
1284 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1286 //--- Define the second part of the (smaller) rib between two sensitive parts
1287 // made of aluminum (layer #3)
1289 dal2[0] = .5 - dits[0];
1290 dal2[1] = 0.0027/2.;
1291 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1292 // 7.5 cm is the lenght
1293 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1295 // --- Define the part of the (smaller) rib between two sensitive parts
1296 // made of silicon (the electronics) (layer #3)
1298 dchi[0] = .5 - dits[0];
1299 dchi[1] = 0.0071/2.;
1300 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1301 // 7.5 cm is the lenght
1302 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1304 // --- Define the part of the (smaller) rib between two sensitive parts
1305 // made of water (the cooler) (layer #3)
1307 dwat[0] = .5 - dits[0];
1308 dwat[1] = 0.0093/2.;
1309 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1310 // 7.5 cm is the lenght
1311 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1313 //--- Define the third part of the (smaller) rib between two sensitive parts
1314 // made of aluminum (the cooling tubes) (layer #3)
1316 dtub[0] = .5 - dits[0];
1317 dtub[1] = 0.00134/2.;
1318 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1319 // 7.5 cm is the lenght
1320 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1322 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1325 // twice the foreseen thickness
1328 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1330 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1333 // twice the foreseen thickness
1336 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1338 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1341 // twice the foreseen thickness
1344 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1346 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1349 // twice the foreseen thickness
1352 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1354 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1358 for (j = 1; j <= 5; ++j) {
1359 // odd elements are up and even elements are down
1361 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1362 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1363 } else if (j == 2) {
1364 xpos = -dbox1[0] + dits[0];
1365 zpos = 0. - dits[2] + 1. - dits[2];
1366 } else if (j == 3) {
1367 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1369 } else if (j == 4) {
1370 xpos = -dbox1[0] + dits[0];
1371 zpos = dits[2] + 0. - 1. + dits[2];
1372 } else if (j == 5) {
1373 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1374 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1376 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1379 // --- Place the smaller ribs into their mother (IDV1)
1381 // --- Right ribs (just a matter of convention)
1383 xpos = .5 - dbox1[0] + dits[0];
1389 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1393 ypos = dsup[1] + 2.81 + dal1[1];
1394 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1398 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1399 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1403 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1404 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1406 // --- Silicon (chip)
1408 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1409 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1413 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1414 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1418 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1420 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1422 // --- Right ribs (just a matter of convention)
1427 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1431 ypos = -(dsup[1] + 2.81 + dal1[1]);
1432 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1436 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1437 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1441 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1442 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1444 // --- Silicon (chip)
1446 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1447 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1451 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1452 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1456 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1457 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1458 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1460 // --- Place the end-ladder stuff into its mother (IDV1)
1463 // --- Negative-Z end-ladder
1466 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1470 xpos = dbox1[0] - dpcb[0];
1471 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1475 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1476 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1480 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1481 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1483 // --- Silicon (bus)
1485 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1486 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1488 // --- Positive-Z end-ladder
1491 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1495 xpos = dbox1[0] - dpcb[0];
1496 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1500 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1501 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1505 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1506 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1508 // --- Silicon (bus)
1510 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1511 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1513 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1514 // larger lenght of ribs) and fill it with air or vacuum
1516 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1518 // the widest element is the sensitive element
1519 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1520 // 7.5 cm is the lenght
1521 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1523 // --- Make the ghost volume invisible
1525 gMC->Gsatt("IDV2", "SEEN", 0);
1527 //--- Define the part of the (larger) rib between two sensitive parts madeof
1528 // carbon (layer #3)
1530 dsup[0] = .65 - dits[0];
1532 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1533 // 7.5 cm is the lenght
1534 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1536 //--- Define the first part of the (larger) rib between two sensitive parts
1537 // made of aluminum (layer #3)
1539 dal1[0] = .65 - dits[0];
1540 dal1[1] = 0.00096/2.;
1541 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1542 // 7.5 cm is the lenght
1543 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1545 //--- Define the part of the (larger) rib between two sensitive parts madeof
1546 // kapton (layer #3)
1548 dkap[0] = .65 - dits[0];
1549 dkap[1] = 0.0317/2.;
1550 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1551 // 7.5 cm is the lenght
1552 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1554 //--- Define the second part of the (larger) rib between two sensitive parts
1555 // made of aluminum (layer #3)
1557 dal2[0] = .65 - dits[0];
1558 dal2[1] = 0.0027/2.;
1559 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1560 // 7.5 cm is the lenght
1561 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1563 // --- Define the part of the (larger) rib between two sensitive parts
1564 // made of silicon (the electronics) (layer #3)
1566 dchi[0] = .65 - dits[0];
1567 dchi[1] = 0.0071/2.;
1568 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1569 // 7.5 cm is the lenght
1570 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1572 // --- Define the part of the (larger) rib between two sensitive parts
1573 // made of water (the cooler) (layer #3)
1575 dwat[0] = .65 - dits[0];
1576 dwat[1] = 0.0093/2.;
1577 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1578 // 7.5 cm is the lenght
1579 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1581 //--- Define the third part of the (larger) rib between two sensitive parts
1582 // made of aluminum (the cooling tubes) (layer #3)
1584 dtub[0] = .65 - dits[0];
1585 dtub[1] = 0.00134/2.;
1586 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1587 // 7.5 cm is the lenght
1588 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1590 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1594 for (j = 1; j <= 5; ++j) {
1595 // odd element are up and even elements are down
1597 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1598 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1599 } else if (j == 2) {
1600 xpos = -dbox2[0] + dits[0];
1601 zpos = 0. - dits[2] + 1. - dits[2];
1602 } else if (j == 3) {
1603 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1605 } else if (j == 4) {
1606 xpos = -dbox2[0] + dits[0];
1607 zpos = dits[2] + 0. - 1. + dits[2];
1608 } else if (j == 5) {
1609 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1610 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1612 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1615 // --- Place the larger ribs into their mother (IDV2)
1618 // --- Right ribs (just a matter of convention)
1620 xpos = .65 - dbox2[0] + dits[0];
1626 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1630 ypos = dsup[1] + 2.81 + dal1[1];
1631 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1635 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1636 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1640 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1641 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1643 // --- Silicon (chip)
1645 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1646 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1650 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1651 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1655 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1656 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1658 // --- Right ribs (just a matter of convention)
1663 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1667 ypos = -(dsup[1] + 2.81 + dal1[1]);
1668 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1672 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1673 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1677 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1678 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1680 // --- Silicon (chip)
1682 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1683 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1687 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1688 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1692 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1693 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1695 // --- Place the end-ladder stuff into its mother (IDV1)
1698 // --- Negative-Z end-ladder
1701 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1705 xpos = dbox2[0] - dpcb[0];
1706 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1710 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1711 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1715 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1716 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1718 // --- Silicon (bus)
1720 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1721 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1723 // --- Positive-Z end-ladder
1726 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1730 xpos = dbox2[0] - dpcb[0];
1731 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1735 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1736 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1740 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1741 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1743 // --- Silicon (bus)
1745 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1746 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1748 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1749 // mother volume (IT34)
1750 // Odd elements have large ribs and even elements have small ribs
1752 for (i = 1; i <= 12; ++i) {
1753 atheta = (i-1) * 30.;
1754 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1757 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1758 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1760 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1763 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1764 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1766 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1773 // GOTO 4567 ! skip ITS layer no. 4
1775 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1776 // smaller lenght of ribs) and fill it with air or vacuum
1778 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1780 // the widest element is the end-ladder stuff
1781 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1782 // 7.5 cm is the lenght
1783 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1785 // --- Make the ghost volume invisible
1787 gMC->Gsatt("IDV3", "SEEN", 0);
1789 // --- Define a volume containing the sensitive part of drifts
1790 // (silicon, layer #4)
1793 // see material budget report by G. Feofilov
1796 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1798 //--- Define the part of the (smaller) rib between two sensitive parts made of
1799 // carbon (layer #4)
1801 dsup[0] = .5 - dits[0];
1803 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1804 // 7.5 cm is the lengh
1805 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1807 //--- Define the first part of the (smaller) rib between two sensitive parts
1808 // made of aluminum (layer #4)
1810 dal1[0] = .5 - dits[0];
1811 dal1[1] = 0.00096/2.;
1812 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1813 // 7.5 cm is the lengh
1814 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1816 //--- Define the part of the (smaller) rib between two sensitive parts made of
1817 // kapton (layer #4)
1819 dkap[0] = .5 - dits[0];
1820 dkap[1] = 0.0317/2.;
1821 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1822 // 7.5 cm is the lengh
1823 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1825 //--- Define the second part of the (smaller) rib between two sensitive parts
1826 // made of aluminum (layer #4)
1828 dal2[0] = .5 - dits[0];
1829 dal2[1] = 0.0027/2.;
1830 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1831 // 7.5 cm is the lengh
1832 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1834 // --- Define the part of the (smaller) rib between two sensitive parts
1835 // made of silicon (the electronics) (layer #4)
1837 dchi[0] = .5 - dits[0];
1838 dchi[1] = 0.0071/2.;
1839 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1840 // 7.5 cm is the lengh
1841 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1843 // --- Define the part of the (smaller) rib between two sensitive parts
1844 // made of water (the cooler) (layer #4)
1846 dwat[0] = .5 - dits[0];
1847 dwat[1] = 0.0093/2.;
1848 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1849 // 7.5 cm is the lenght
1850 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1852 //--- Define the third part of the (smaller) rib between two sensitive parts
1853 // made of aluminum (the cooling tubes) (layer #4)
1855 dtub[0] = .5 - dits[0];
1856 dtub[1] = 0.00134/2.;
1857 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1858 // 7.5 cm is the lengh
1859 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1861 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1864 // twice the foreseen thickness
1867 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1869 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1872 // twice the foreseen thickness
1875 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1877 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1880 // twice the foreseen thickness
1883 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1885 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1888 // twice the foreseen thickness
1891 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1893 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1897 for (j = 1; j <= 7; ++j) {
1898 // odd elements are down and even elements are up
1900 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1901 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1902 } else if (j == 2) {
1903 xpos = -dbox1[0] + dits[0];
1904 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1905 } else if (j == 3) {
1906 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1907 zpos = 0. - dits[2] + .7 - dits[2];
1908 } else if (j == 4) {
1909 xpos = -dbox1[0] + dits[0];
1911 } else if (j == 5) {
1912 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1913 zpos = dits[2] + 0. - .7 + dits[2];
1914 } else if (j == 6) {
1915 xpos = -dbox1[0] + dits[0];
1916 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1917 } else if (j == 7) {
1918 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1919 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1921 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1924 // --- Place the smaller ribs into their mother (IDV3)
1926 // --- Right ribs (just a matter of convention)
1928 xpos = .5 - dbox1[0] + dits[0];
1934 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1938 ypos = dsup[1] + 2.81 + dal1[1];
1939 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1943 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1944 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1948 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1949 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1951 // --- Silicon (chip)
1953 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1954 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1958 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1959 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1963 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1965 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1967 // --- Right ribs (just a matter of convention)
1972 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1976 ypos = -(dsup[1] + 2.81 + dal1[1]);
1977 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1981 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1982 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1986 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1988 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1990 // --- Silicon (chip)
1992 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1993 2. + dal2[1] * 2. + dchi[1]);
1994 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1998 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1999 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2000 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2004 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2005 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2007 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2009 // --- Place the end-ladder stuff into its mother (IDV1)
2012 // --- Negative-Z end-ladder
2015 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2019 xpos = dbox1[0] - dpcb[0];
2020 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2024 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2025 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2029 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2030 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2032 // --- Silicon (bus)
2034 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2035 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2037 // --- Positive-Z end-ladder
2040 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2044 xpos = dbox1[0] - dpcb[0];
2045 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2049 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2050 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2054 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2055 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2057 // --- Silicon (bus)
2059 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2060 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2062 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2063 // larger lenght of ribs) and fill it with air or vacuum
2065 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2067 // the widest element is the end-ladder stuff
2068 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2069 // 7.5 cm is the lenght
2070 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2072 // --- Make the ghost volume invisible
2074 gMC->Gsatt("IDV4", "SEEN", 0);
2076 //--- Define the part of the (larger) rib between two sensitive parts madeof
2077 // carbon (layer #4)
2079 dsup[0] = .65 - dits[0];
2081 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2082 // 7.5 cm is the lengh
2083 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2085 //--- Define the first part of the (larger) rib between two sensitive parts
2086 // made of aluminum (layer #4)
2088 dal1[0] = .65 - dits[0];
2089 dal1[1] = 0.00096/2.;
2090 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2091 // 7.5 cm is the lengh
2092 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2094 //--- Define the part of the (larger) rib between two sensitive parts madeof
2095 // kapton (layer #4)
2097 dkap[0] = .65 - dits[0];
2098 dkap[1] = 0.0317/2.;
2099 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2100 // 7.5 cm is the lengh
2101 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2103 //--- Define the second part of the (larger) rib between two sensitive parts
2104 // made of aluminum (layer #4)
2106 dal2[0] = .65 - dits[0];
2107 dal2[1] = 0.0027/2.;
2108 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2109 // 7.5 cm is the lengh
2110 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2112 // --- Define the part of the (larger) rib between two sensitive parts
2113 // made of silicon (the electronics) (layer #4)
2115 dchi[0] = .65 - dits[0];
2116 dchi[1] = 0.0071/2.;
2117 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2118 // 7.5 cm is the lengh
2119 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2121 // --- Define the part of the (larger) rib between two sensitive parts
2122 // made of water (the cooler) (layer #4)
2124 dwat[0] = .65 - dits[0];
2125 dwat[1] = 0.0093/2.;
2126 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2127 // 7.5 cm is the lengh
2128 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2130 //--- Define the third part of the (larger) rib between two sensitive parts
2131 // made of aluminum (the cooling tubes) (layer #4)
2133 dtub[0] = .65 - dits[0];
2134 dtub[1] = 0.00134/2.;
2135 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2136 // 7.5 cm is the lengh
2137 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2139 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2143 for (j = 1; j <= 7; ++j) {
2144 // odd elements are down and even elements are up
2146 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2147 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2148 } else if (j == 2) {
2149 xpos = -dbox2[0] + dits[0];
2150 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2151 } else if (j == 3) {
2152 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2153 zpos = 0. - dits[2] + .7 - dits[2];
2154 } else if (j == 4) {
2155 xpos = -dbox2[0] + dits[0];
2157 } else if (j == 5) {
2158 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2159 zpos = dits[2] + 0. - .7 + dits[2];
2160 } else if (j == 6) {
2161 xpos = -dbox2[0] + dits[0];
2162 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2163 } else if (j == 7) {
2164 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2165 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2167 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2170 // --- Place the larger ribs into their mother (IDV4)
2173 // --- Right ribs (just a matter of convention)
2175 xpos = .65 - dbox2[0] + dits[0];
2181 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2185 ypos = dsup[1] + 2.81 + dal1[1];
2186 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2190 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2191 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2195 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2196 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2198 // --- Silicon (chip)
2200 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2201 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2205 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2206 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2210 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2212 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2214 // --- Right ribs (just a matter of convention)
2219 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2223 ypos = -(dsup[1] + 2.81 + dal1[1]);
2224 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2228 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2229 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2233 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2235 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2237 // --- Silicon (chip)
2239 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2240 2. + dal2[1] * 2. + dchi[1]);
2241 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2245 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2246 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2247 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2251 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2252 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2253 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2255 // --- Place the end-ladder stuff into its mother (IDV1)
2258 // --- Negative-Z end-ladder
2261 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2265 xpos = dbox2[0] - dpcb[0];
2266 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2270 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2271 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2275 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2276 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2278 // --- Silicon (bus)
2280 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2281 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2283 // --- Positive-Z end-ladder
2286 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2290 xpos = dbox2[0] - dpcb[0];
2291 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2295 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2296 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2300 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2301 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2303 // --- Silicon (bus)
2305 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2306 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2308 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2309 // mother volume (IT34)
2310 // Odd elements have large ribs and even elements have small ribs
2312 for (i = 1; i <= 24; ++i) {
2313 atheta = (i-1) * 15.;
2314 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2317 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2318 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2320 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2322 rzero = (24.0+22.8)/2.;
2323 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2324 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2326 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2330 //************************************************************************
2335 //************************************************************************
2337 // --- Define SSD with the 35+39 lay-out
2339 if (fMinorVersionV3 < 3) {
2341 //--- Define ghost volume containing the Strip Detectors and fill it with air
2344 xxm = (49.999-3.)/(70.-25.);
2348 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2349 (37.-27)/xxm-(49.998-37.)/xxm;
2352 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2356 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2360 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2361 (37.-27)/xxm+(49.998-37.)/xxm;
2364 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2365 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2366 gMC->Gsatt("IT56", "SEEN", 0);
2370 // GOTO 5678 ! skip ITS layer no. 5
2372 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2373 // it with air or vacuum
2375 dbox1[0] = (0.0600+2.*0.0150)/2.;
2377 dbox1[2] = 90.22/2.;
2378 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2380 // --- Make the ghost volume invisible
2382 gMC->Gsatt("ISV1", "SEEN", 0);
2384 // --- Define a ghost volume containing the electronics and cooling of
2385 // a single ladder of layer #5 and fill it with air or vacuum
2387 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2390 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2392 // --- Make the ghost volume invisible
2394 gMC->Gsatt("SSV1", "SEEN", 0);
2396 // --- Define a ghost volume containing the end-ladder stuff of
2397 // a single ladder of layer #5 and fill it with air or vacuum
2402 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2404 // --- Make the ghost volume invisible
2406 gMC->Gsatt("ELL5", "SEEN", 0);
2408 // --- Define a volume containing the sensitive part of the strips
2409 // (silicon, layer #5)
2414 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2416 // --- Define a volume containing the electronics of the strips
2417 // (silicon, layer #5)
2422 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2424 // --- Define the cooling tubes (aluminum, layer #5)
2427 dtub[1] = dtub[0] + .01;
2429 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2431 // --- Define the cooling fluid (water or freon, layer #5)
2436 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2437 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2439 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2447 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2448 dfra[6] = dfra[5] + .03;
2452 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2454 // --- Define the element connecting the triangles of the heat bridge
2455 // (carbon, layer #5)
2460 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2462 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2465 dpla[0] = (10./(8.*7.))/2.;
2468 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2470 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2472 dcop[0] = (2./(8.*7.))/2.;
2475 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2477 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2479 depx[0] = (30./(8.*7.))/2.;
2482 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2484 // --- Define the part of the end-ladder stuff made of silicon (bus)
2487 dsil[0] = (20./(8.*7.))/2.;
2490 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2492 // --- Place the end-ladder stuff into its mother (ELL5)
2494 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2500 xpos = -dela[0] + dpla[0];
2501 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2505 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2506 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2510 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2511 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2513 // --- Silicon (bus)
2515 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2516 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2518 // --- Place the sensitive part of the strips into its mother (ISV1)
2521 for (j = 1; j <= 23; ++j) {
2522 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2523 else xpos = -dbox1[0] + dits[0];
2524 zpos = ((j - 1) - 11.) * 3.91;
2525 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2528 // --- Place the electronics of the strips into its mother (SSV1)
2531 for (j = 1; j <= 23; ++j) {
2532 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2533 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2534 zpos = ((j - 1) - 11.) * 3.91 + .85;
2535 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2538 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2540 xpos = -dsrv[0] + .41;
2543 // --- Left tube (just a matter of convention)
2546 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2547 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2549 // --- Right tube (just a matter of convention)
2552 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2553 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2555 // --- Place the heat bridge elements into their mother (SSV1)
2557 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2559 for (j = 1; j <= 24; ++j) {
2560 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2561 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2564 // --- Place the elements connecting the triangles of the heat bridge
2565 // into their mother (SSV1)
2569 // --- Left element (just a matter of convention)
2571 xpos = -dsrv[0] + .47;
2572 ypos = -(2.1+0.015);
2573 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2575 // --- Right element
2577 xpos = -dsrv[0] + .47;
2579 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2583 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2585 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2587 // --- Place the ghost volumes containing the strip ladders (ISV1),
2588 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2589 // their mother volume (IT56)
2591 offset1 = TMath::ATan2(.9, 40.);
2593 rzero = dbox1[0] + 40.;
2594 runo = dbox1[0] * 2. + 40. + dsrv[0];
2595 rtwo = dbox1[0] * 2. + 40. + dela[0];
2596 for (i = 1; i <= 35; ++i) {
2597 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2598 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2600 // --- Strip ladders
2602 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2603 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2605 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2607 // --- Electronics/cooling
2609 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2610 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2612 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2614 // --- End-ladders (nagative-Z and positive-Z)
2616 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2617 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2618 zpos = -(dbox1[2] + dela[2] + 6.);
2619 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2620 zpos = dbox1[2] + dela[2] + 6.;
2621 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2627 // GOTO 5778 ! skip ITS layer no. 6
2629 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2630 // it with air or vacuum
2632 dbox2[0] = (0.0600+2.*0.0150)/2.;
2634 dbox2[2] = 101.95/2.;
2635 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2637 // --- Make the ghost volume invisible
2639 gMC->Gsatt("ISV2", "SEEN", 0);
2641 // --- Define a ghost volume containing the electronics and cooling of
2642 // a single ladder of layer #6 and fill it with air or vacuum
2644 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2646 dsrv[2] = 101.95/2.;
2647 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2649 // --- Make the ghost volume invisible
2651 gMC->Gsatt("SSV2", "SEEN", 0);
2653 // --- Define a ghost volume containing the end-ladder stuff of
2654 // a single ladder of layer #6 and fill it with air or vacuum
2659 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2661 // --- Make the ghost volume invisible
2663 gMC->Gsatt("ELL6", "SEEN", 0);
2665 // --- Define a volume containing the sensitive part of the strips
2666 // (silicon, layer #6)
2671 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2673 // --- Define a volume containing the electronics of the strips
2674 // (silicon, layer #6)
2679 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2681 // --- Define the cooling tubes (aluminum, layer #6)
2684 dtub[1] = dtub[0] + .01;
2685 dtub[2] = 101.95/2.;
2686 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2688 // --- Define the cooling fluid (water or freon, layer #6)
2692 dwat[2] = 101.95/2.;
2693 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2694 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2696 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2704 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2705 dfra[6] = dfra[5] + .03;
2709 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2711 // --- Define the element connecting the triangles of the heat bridge
2712 // (carbon, layer #6)
2716 dcei[2] = 101.95/2.;
2717 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2719 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2722 dpla[0] = (10./(8.*7.))/2.;
2725 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2727 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2729 dcop[0] = (2./(8.*7.))/2.;
2732 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2734 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2736 depx[0] = (30./(8.*7.))/2.;
2739 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2741 // --- Define the part of the end-ladder stuff made of silicon (bus)
2744 dsil[0] = (20./(8.*7.))/2.;
2747 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2749 // --- Place the end-ladder stuff into its mother (ELL5)
2751 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2757 xpos = -dela[0] + dpla[0];
2758 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2762 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2763 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2767 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2768 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2770 // --- Silicon (bus)
2772 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2773 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2775 // --- Place the sensitive part of the strips into its mother (ISV2)
2778 for (j = 1; j <= 26; ++j) {
2779 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2780 else xpos = -dbox2[0] + dits[0];
2781 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2782 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2785 // --- Place the electronics of the strips into its mother (SSV2)
2788 for (j = 1; j <= 26; ++j) {
2789 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2790 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2791 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2792 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2795 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2797 xpos = -dsrv[0] + .41;
2800 // --- Left tube (just a matter of convention)
2803 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2804 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2806 // --- Right tube (just a matter of convention)
2809 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2810 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2812 // --- Place the heat bridge elements into their mother (SSV2)
2814 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2816 for (j = 1; j <= 27; ++j) {
2817 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2818 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2821 // --- Place the elements connecting the triangles of the heat bridge
2822 // into their mother (SSV2)
2826 // --- Left element (just a matter of convention)
2828 xpos = -dsrv[0] + .47;
2829 ypos = -(2.1+0.015);
2830 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2832 // --- Right element
2834 xpos = -dsrv[0] + .47;
2836 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2840 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2842 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2844 // --- Place the ghost volumes containing the strip ladders (ISV2),
2845 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2846 // their mother volume (IT56)
2848 offset1 = TMath::ATan2(1., 45.);
2850 rzero = dbox2[0] + 45.;
2851 runo = dbox2[0] * 2. + 45. + dsrv[0];
2852 rtwo = dbox2[0] * 2. + 45. + dela[0];
2853 for (i = 1; i <= 39; ++i) {
2854 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2855 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2857 // --- Strip ladders
2859 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2860 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2862 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2864 // --- Electronics/cooling
2866 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2867 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2869 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2871 // --- End-ladders (nagative-Z and positive-Z)
2873 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2874 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2875 zpos = -(dbox2[2] + dela[2] + 6.);
2876 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2877 zpos = dbox2[2] + dela[2] + 6.;
2878 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2883 // --- Define SSD with the 32+36 lay-out
2885 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
2887 //--- Define ghost volume containing the Strip Detectors and fill it with air
2890 xxm = (49.999-3.)/(70.-25.);
2894 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2895 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2898 dgh[6] = -25. - (9.-3.01) / xxm -
2899 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2902 dgh[9] = (9.-3.01) / xxm + 25. +
2903 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2906 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2907 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2910 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2911 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2912 gMC->Gsatt("IT56", "SEEN", 0);
2916 // GOTO 6678 ! skip ITS layer no. 5
2918 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2919 // it with air or vacuum
2921 dbox1[0] = (0.0600+2.*0.0150)/2.;
2923 dbox1[2] = 86.31/2.;
2924 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2926 // --- Make the ghost volume invisible
2928 gMC->Gsatt("ISV1", "SEEN", 0);
2930 // --- Define a ghost volume containing the electronics and cooling of
2931 // a single ladder of layer #5 and fill it with air or vacuum
2933 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2936 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2938 // --- Make the ghost volume invisible
2940 gMC->Gsatt("SSV1", "SEEN", 0);
2942 // --- Define a ghost volume containing the end-ladder stuff of
2943 // a single ladder of layer #5 and fill it with air or vacuum
2948 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2950 // --- Make the ghost volume invisible
2952 gMC->Gsatt("ELL5", "SEEN", 0);
2954 // --- Define a volume containing the sensitive part of the strips
2955 // (silicon, layer #5)
2960 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2962 // --- Define a volume containing the electronics of the strips
2963 // (silicon, layer #5)
2968 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2970 // --- Define the cooling tubes (aluminum, layer #5)
2973 dtub[1] = dtub[0] + .01;
2975 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2977 // --- Define the cooling fluid (water or freon, layer #5)
2982 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2983 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2985 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2993 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2994 dfra[6] = dfra[5] + .03;
2998 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3000 // --- Define the element connecting the triangles of the heat bridge
3001 // (carbon, layer #5)
3006 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3008 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3011 dpla[0] = (10./(8.*7.))/2;
3014 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3016 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3018 dcop[0] = (2./(8.*7.))/2;
3021 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3023 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3025 depx[0] = (30./(8.*7.))/2.;
3028 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3030 // --- Define the part of the end-ladder stuff made of silicon (bus)
3033 dsil[0] = (20./(8.*7.))/2.;
3036 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3038 // --- Place the end-ladder stuff into its mother (ELL5)
3040 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3046 xpos = -dela[0] + dpla[0];
3047 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3051 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3052 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3056 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3057 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3059 // --- Silicon (bus)
3061 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3062 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3064 // --- Place the sensitive part of the strips into its mother (ISV1)
3067 for (j = 1; j <= 22; ++j) {
3068 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3069 else xpos = -dbox1[0] + dits[0];
3070 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3071 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3074 // --- Place the electronics of the strips into its mother (SSV1)
3077 for (j = 1; j <= 22; ++j) {
3078 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3079 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3080 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3081 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3084 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3086 xpos = -dsrv[0] + .41;
3089 // --- Left tube (just a matter of convention)
3092 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3093 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3095 // --- Right tube (just a matter of convention)
3098 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3099 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3101 // --- Place the heat bridge elements into their mother (SSV1)
3103 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3105 for (j = 1; j <= 23; ++j) {
3106 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3107 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3110 // --- Place the elements connecting the triangles of the heat bridge
3111 // into their mother (SSV1)
3115 // --- Left element (just a matter of convention)
3117 xpos = -dsrv[0] + .47;
3118 ypos = -(2.1+0.015);
3119 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3121 // --- Right element
3123 xpos = -dsrv[0] + .47;
3125 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3129 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3131 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3133 // --- Place the ghost volumes containing the strip ladders (ISV1),
3134 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3135 // their mother volume (IT56)
3137 offset1 = TMath::ATan2(.8, 36.6);
3139 rzero = dbox1[0] + 36.6;
3140 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3141 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3142 for (i = 1; i <= 32; ++i) {
3143 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3144 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3146 // --- Strip ladders
3148 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3149 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3151 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3153 // --- Electronics/cooling
3155 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3156 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3158 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3160 // --- End-ladders (nagative-Z and positive-Z)
3162 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3163 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3164 zpos = -(dbox1[2] + dela[2] + 6.);
3165 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3166 zpos = dbox1[2] + dela[2] + 6.;
3167 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3173 // GOTO 6778 ! skip ITS layer no. 6
3175 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3176 // it with air or vacuum
3178 dbox2[0] = (0.0600+2.*0.0150)/2.;
3180 dbox2[2] = 94.13/2.;
3181 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3183 // --- Make the ghost volume invisible
3185 gMC->Gsatt("ISV2", "SEEN", 0);
3187 // --- Define a ghost volume containing the electronics and cooling of
3188 // a single ladder of layer #6 and fill it with air or vacuum
3190 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3193 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3195 // --- Make the ghost volume invisible
3197 gMC->Gsatt("SSV2", "SEEN", 0);
3199 // --- Define a ghost volume containing the end-ladder stuff of
3200 // a single ladder of layer #6 and fill it with air or vacuum
3205 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3207 // --- Make the ghost volume invisible
3209 gMC->Gsatt("ELL6", "SEEN", 0);
3211 // --- Define a volume containing the sensitive part of the strips
3212 // (silicon, layer #6)
3217 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3219 // --- Define a volume containing the electronics of the strips
3220 // (silicon, layer #6)
3225 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3227 // --- Define the cooling tubes (aluminum, layer #6)
3230 dtub[1] = dtub[0] + .01;
3232 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3234 // --- Define the cooling fluid (water or freon, layer #6)
3239 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3240 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3242 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3250 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3251 dfra[6] = dfra[5] + .03;
3255 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3257 // --- Define the element connecting the triangles of the heat bridge
3258 // (carbon, layer #6)
3263 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3265 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3268 dpla[0] = (10./(8.*7.))/2;
3271 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3273 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3275 dcop[0] = (2./(8.*7.))/2;
3278 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3280 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3282 depx[0] = (30./(8.*7.))/2.;
3285 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3287 // --- Define the part of the end-ladder stuff made of silicon (bus)
3290 dsil[0] = (20./(8.*7.))/2.;
3293 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3295 // --- Place the end-ladder stuff into its mother (ELL5)
3297 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3303 xpos = -dela[0] + dpla[0];
3304 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3308 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3309 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3313 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3314 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3316 // --- Silicon (bus)
3318 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3319 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3321 // --- Place the sensitive part of the strips into its mother (ISV2)
3324 for (j = 1; j <= 24; ++j) {
3325 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3326 else xpos = dbox2[0] - dits[0];
3327 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3328 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3331 // --- Place the electronics of the strips into its mother (SSV2)
3334 for (j = 1; j <= 24; ++j) {
3335 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3336 else xpos = -dsrv[0] + .28;
3337 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3338 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3341 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3343 xpos = -dsrv[0] + .41;
3346 // --- Left tube (just a matter of convention)
3349 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3350 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3352 // --- Right tube (just a matter of convention)
3355 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3356 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3358 // --- Place the heat bridge elements into their mother (SSV2)
3360 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3362 for (j = 1; j <= 25; ++j) {
3363 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3364 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3367 // --- Place the elements connecting the triangles of the heat bridge
3368 // into their mother (SSV2)
3372 // --- Left element (just a matter of convention)
3374 xpos = -dsrv[0] + .47;
3375 ypos = -(2.1+0.015);
3376 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3378 // --- Right element
3380 xpos = -dsrv[0] + .47;
3382 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3386 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3388 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3390 // --- Place the ghost volumes containing the strip ladders (ISV2),
3391 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3392 // their mother volume (IT56)
3394 offset1 = TMath::ATan2(.9, 41.2);
3396 rzero = dbox2[0] + 41.2;
3397 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3398 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3399 for (i = 1; i <= 36; ++i) {
3400 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3401 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3403 // --- Strip ladders
3405 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3406 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3408 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3410 // --- Electronics/cooling
3412 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3413 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3415 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3417 // --- End-ladders (nagative-Z and positive-Z)
3419 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3420 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3421 zpos = -(dbox2[2] + dela[2] + 6.);
3422 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3423 zpos = dbox2[2] + dela[2] + 6.;
3424 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3430 //************************************************************************
3432 //* E N D - C A P S A N D F R A M E S *
3433 //* ========================================= *
3435 //************************************************************************
3437 // --- Define a dummy cylinder for multiple scattering tests
3439 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3442 // DITS(2)=DITS(1)+0.1
3444 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3445 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3448 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3450 // GOTO 8901 ! skip outer wall
3452 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3455 dits[1] = dits[0] + .06926;
3456 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3458 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3459 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3464 // --- The frame between the end-caps (octagonal lay-out) ---
3466 // GOTO 9012 ! skip octagonal frame
3468 if (fMinorVersionV3 == 1) {
3473 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3476 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3478 offset = angle / 2.;
3479 for (i = 0; i < 8; ++i) {
3480 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3481 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3483 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3484 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3488 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3489 aphi2 = 180. - aphi1;
3490 xpos = (xtra[0] + xtra[1]) / 2.;
3491 ypos = (ytra[0] + ytra[1]) / 2.;
3492 zpos = dtra[2] / 2.;
3493 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3496 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3497 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3498 zpos = -dtra[2] / 2.;
3499 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3502 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3503 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3506 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3507 aphi1 = 180. - aphi2;
3508 xpos = (xtra[1] + xtra[2]) / 2.;
3509 ypos = (ytra[1] + ytra[2]) / 2.;
3510 zpos = dtra[2] / 2.;
3511 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3514 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3515 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3516 zpos = -dtra[2] / 2.;
3517 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3520 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3521 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3524 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3525 aphi2 = 180. - aphi1;
3526 xpos = (xtra[2] + xtra[3]) / 2.;
3527 ypos = (ytra[2] + ytra[3]) / 2.;
3528 zpos = dtra[2] / 2.;
3529 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3532 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3533 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3534 zpos = -dtra[2] / 2.;
3535 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3538 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3539 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3542 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3543 aphi1 = 180. - aphi2;
3544 xpos = (xtra[3] + xtra[4]) / 2.;
3545 ypos = (ytra[3] + ytra[4]) / 2.;
3546 zpos = dtra[2] / 2.;
3547 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3550 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3551 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3552 zpos = -dtra[2] / 2.;
3553 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3556 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3557 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3560 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3561 aphi1 = 180. - aphi2;
3562 xpos = (xtra[4] + xtra[5]) / 2.;
3563 ypos = (ytra[4] + ytra[5]) / 2.;
3564 zpos = dtra[2] / 2.;
3565 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3568 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3569 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3570 zpos = -dtra[2] / 2.;
3571 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3574 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3575 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3578 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3579 aphi2 = 180. - aphi1;
3580 xpos = (xtra[5] + xtra[6]) / 2.;
3581 ypos = (ytra[5] + ytra[6]) / 2.;
3582 zpos = dtra[2] / 2.;
3583 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3586 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3587 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3588 zpos = -dtra[2] / 2.;
3589 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3592 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3593 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3596 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3597 aphi1 = 180. - aphi2;
3598 xpos = (xtra[6] + xtra[7]) / 2.;
3599 ypos = (ytra[6] + ytra[7]) / 2.;
3600 zpos = dtra[2] / 2.;
3601 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3604 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3605 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3606 zpos = -dtra[2] / 2.;
3607 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3610 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3611 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3614 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3615 aphi2 = 180. - aphi1;
3616 xpos = (xtra[7] + xtra[0]) / 2.;
3617 ypos = (ytra[7] + ytra[0]) / 2.;
3618 zpos = dtra[2] / 2.;
3619 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3622 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3623 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3624 zpos = -dtra[2] / 2.;
3625 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3628 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3629 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3632 } else if (fMinorVersionV3 == 4) {
3638 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3641 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3643 offset = angle / 2.;
3644 for (i = 0; i < 8; ++i) {
3645 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3646 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3648 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3649 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3653 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3654 aphi2 = 180. - aphi1;
3655 xpos = (xtra[0] + xtra[1]) / 2.;
3656 ypos = (ytra[0] + ytra[1]) / 2.;
3657 zpos = dtra[2] / 2.;
3658 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3661 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3662 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3663 zpos = -dtra[2] / 2.;
3664 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3667 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3668 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3671 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3672 aphi1 = 180. - aphi2;
3673 xpos = (xtra[1] + xtra[2]) / 2.;
3674 ypos = (ytra[1] + ytra[2]) / 2.;
3675 zpos = dtra[2] / 2.;
3676 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3679 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3680 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3681 zpos = -dtra[2] / 2.;
3682 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3685 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3686 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3689 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3690 aphi2 = 180. - aphi1;
3691 xpos = (xtra[2] + xtra[3]) / 2.;
3692 ypos = (ytra[2] + ytra[3]) / 2.;
3693 zpos = dtra[2] / 2.;
3694 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3697 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3698 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3699 zpos = -dtra[2] / 2.;
3700 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3703 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3704 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3707 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3708 aphi1 = 180. - aphi2;
3709 xpos = (xtra[3] + xtra[4]) / 2.;
3710 ypos = (ytra[3] + ytra[4]) / 2.;
3711 zpos = dtra[2] / 2.;
3712 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3715 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3716 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3717 zpos = -dtra[2] / 2.;
3718 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3721 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3722 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3725 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3726 aphi1 = 180. - aphi2;
3727 xpos = (xtra[4] + xtra[5]) / 2.;
3728 ypos = (ytra[4] + ytra[5]) / 2.;
3729 zpos = dtra[2] / 2.;
3730 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3733 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3734 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3735 zpos = -dtra[2] / 2.;
3736 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3739 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3740 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3743 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3744 aphi2 = 180. - aphi1;
3745 xpos = (xtra[5] + xtra[6]) / 2.;
3746 ypos = (ytra[5] + ytra[6]) / 2.;
3747 zpos = dtra[2] / 2.;
3748 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3751 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3752 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3753 zpos = -dtra[2] / 2.;
3754 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3757 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3758 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3761 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3762 aphi1 = 180. - aphi2;
3763 xpos = (xtra[6] + xtra[7]) / 2.;
3764 ypos = (ytra[6] + ytra[7]) / 2.;
3765 zpos = dtra[2] / 2.;
3766 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3769 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3770 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3771 zpos = -dtra[2] / 2.;
3772 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3775 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3776 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3779 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3780 aphi2 = 180. - aphi1;
3781 xpos = (xtra[7] + xtra[0]) / 2.;
3782 ypos = (ytra[7] + ytra[0]) / 2.;
3783 zpos = dtra[2] / 2.;
3784 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3787 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3788 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3789 zpos = -dtra[2] / 2.;
3790 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3793 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3794 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3800 // --- The frame between the end-caps (hexagonal lay-out) ---
3802 // GOTO 9123 ! skip hexagonal frame
3804 if (fMinorVersionV3 == 2) {
3809 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3815 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3817 offset = angle / 2.;
3818 for (i = 0; i < 6; ++i) {
3819 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3820 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3822 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3823 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3828 xpos = (xtra1[0] + xtra1[1]) / 2.;
3829 ypos = (ytra1[0] + ytra1[1]) / 2.;
3831 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3834 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3835 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3839 xpos = (xtra1[1] + xtra1[2]) / 2.;
3840 ypos = (ytra1[1] + ytra1[2]) / 2.;
3842 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3845 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3846 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3850 xpos = (xtra1[2] + xtra1[3]) / 2.;
3851 ypos = (ytra1[2] + ytra1[3]) / 2.;
3853 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3856 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3857 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3861 xpos = (xtra1[3] + xtra1[4]) / 2.;
3862 ypos = (ytra1[3] + ytra1[4]) / 2.;
3864 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3867 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3868 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3872 xpos = (xtra1[4] + xtra1[5]) / 2.;
3873 ypos = (ytra1[4] + ytra1[5]) / 2.;
3875 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3878 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3879 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3883 xpos = (xtra1[5] + xtra1[0]) / 2.;
3884 ypos = (ytra1[5] + ytra1[0]) / 2.;
3886 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3889 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3890 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3893 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3894 aphi1 = 180. - aphi2;
3895 xpos = (xtra1[0] + xtra1[1]) / 2.;
3896 ypos = (ytra1[0] + ytra1[1]) / 2.;
3897 zpos = dtra2[2] / 2.;
3898 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
3901 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3902 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3903 zpos = -dtra2[2] / 2.;
3904 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
3907 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3908 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3911 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3912 aphi2 = 180. - aphi1;
3913 xpos = (xtra1[1] + xtra1[2]) / 2.;
3914 ypos = (ytra1[1] + ytra1[2]) / 2.;
3915 zpos = dtra2[2] / 2.;
3916 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
3919 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3920 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3921 zpos = -dtra2[2] / 2.;
3922 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
3925 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3926 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3929 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3930 aphi1 = 180. - aphi2;
3931 xpos = (xtra1[2] + xtra1[3]) / 2.;
3932 ypos = (ytra1[2] + ytra1[3]) / 2.;
3933 zpos = dtra2[2] / 2.;
3934 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
3937 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3938 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3939 zpos = -dtra2[2] / 2.;
3940 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
3943 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3944 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3946 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
3947 - 50.*50.))) * raddeg;
3948 aphi2 = 180. - aphi1;
3949 xpos = (xtra1[2] + xtra1[3]) / 2.;
3950 ypos = (ytra1[2] + ytra1[3]) / 2.;
3951 zpos = dtra2[2] / 2.;
3952 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
3955 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3956 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
3957 zpos = -dtra2[2] / 2.;
3958 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
3961 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3962 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
3965 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3966 aphi1 = 180. - aphi2;
3967 xpos = (xtra1[3] + xtra1[4]) / 2.;
3968 ypos = (ytra1[3] + ytra1[4]) / 2.;
3969 zpos = dtra2[2] / 2.;
3970 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
3973 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3974 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
3975 zpos = -dtra2[2] / 2.;
3976 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
3979 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3980 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
3983 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3984 aphi2 = 180. - aphi1;
3985 xpos = (xtra1[4] + xtra1[5]) / 2.;
3986 ypos = (ytra1[4] + ytra1[5]) / 2.;
3987 zpos = dtra2[2] / 2.;
3988 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
3991 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3992 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
3993 zpos = -dtra2[2] / 2.;
3994 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
3997 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3998 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4001 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4002 aphi1 = 180. - aphi2;
4003 xpos = (xtra1[5] + xtra1[0]) / 2.;
4004 ypos = (ytra1[5] + ytra1[0]) / 2.;
4005 zpos = dtra2[2] / 2.;
4006 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4009 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4010 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4011 zpos = -dtra2[2] / 2.;
4012 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4015 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4016 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4018 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4019 aphi2 = 180. - aphi1;
4020 xpos = (xtra1[5] + xtra1[0]) / 2.;
4021 ypos = (ytra1[5] + ytra1[0]) / 2.;
4022 zpos = dtra2[2] / 2.;
4023 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4026 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4027 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4028 zpos = -dtra2[2] / 2.;
4029 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4032 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4033 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4036 } else if (fMinorVersionV3 == 5) {
4042 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4048 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4050 offset = angle / 2.;
4051 for (i = 0; i < 6; ++i) {
4052 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
4053 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
4055 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
4056 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4061 xpos = (xtra1[0] + xtra1[1]) / 2.;
4062 ypos = (ytra1[0] + ytra1[1]) / 2.;
4064 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
4067 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4068 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4072 xpos = (xtra1[1] + xtra1[2]) / 2.;
4073 ypos = (ytra1[1] + ytra1[2]) / 2.;
4075 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
4078 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4079 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4083 xpos = (xtra1[2] + xtra1[3]) / 2.;
4084 ypos = (ytra1[2] + ytra1[3]) / 2.;
4086 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
4089 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4090 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4094 xpos = (xtra1[3] + xtra1[4]) / 2.;
4095 ypos = (ytra1[3] + ytra1[4]) / 2.;
4097 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
4100 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4101 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4105 xpos = (xtra1[4] + xtra1[5]) / 2.;
4106 ypos = (ytra1[4] + ytra1[5]) / 2.;
4108 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
4111 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4112 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4116 xpos = (xtra1[5] + xtra1[0]) / 2.;
4117 ypos = (ytra1[5] + ytra1[0]) / 2.;
4119 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
4122 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4123 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4126 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4127 aphi1 = 180. - aphi2;
4128 xpos = (xtra1[0] + xtra1[1]) / 2.;
4129 ypos = (ytra1[0] + ytra1[1]) / 2.;
4130 zpos = dtra2[2] / 2.;
4131 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4134 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4135 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4136 zpos = -dtra2[2] / 2.;
4137 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4140 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4141 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4144 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4145 aphi2 = 180. - aphi1;
4146 xpos = (xtra1[1] + xtra1[2]) / 2.;
4147 ypos = (ytra1[1] + ytra1[2]) / 2.;
4148 zpos = dtra2[2] / 2.;
4149 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4152 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4153 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4154 zpos = -dtra2[2] / 2.;
4155 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4158 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4159 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4162 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4163 aphi1 = 180. - aphi2;
4164 xpos = (xtra1[2] + xtra1[3]) / 2.;
4165 ypos = (ytra1[2] + ytra1[3]) / 2.;
4166 zpos = dtra2[2] / 2.;
4167 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4170 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4171 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4172 zpos = -dtra2[2] / 2.;
4173 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4176 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4177 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4179 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4180 aphi2 = 180. - aphi1;
4181 xpos = (xtra1[2] + xtra1[3]) / 2.;
4182 ypos = (ytra1[2] + ytra1[3]) / 2.;
4183 zpos = dtra2[2] / 2.;
4184 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4187 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4188 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4189 zpos = -dtra2[2] / 2.;
4190 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4193 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4194 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4197 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4198 aphi1 = 180. - aphi2;
4199 xpos = (xtra1[3] + xtra1[4]) / 2.;
4200 ypos = (ytra1[3] + ytra1[4]) / 2.;
4201 zpos = dtra2[2] / 2.;
4202 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4205 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4206 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4207 zpos = -dtra2[2] / 2.;
4208 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4211 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4212 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4215 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4216 aphi2 = 180. - aphi1;
4217 xpos = (xtra1[4] + xtra1[5]) / 2.;
4218 ypos = (ytra1[4] + ytra1[5]) / 2.;
4219 zpos = dtra2[2] / 2.;
4220 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4223 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4224 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4225 zpos = -dtra2[2] / 2.;
4226 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4229 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4230 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4233 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4234 aphi1 = 180. - aphi2;
4235 xpos = (xtra1[5] + xtra1[0]) / 2.;
4236 ypos = (ytra1[5] + ytra1[0]) / 2.;
4237 zpos = dtra2[2] / 2.;
4238 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4241 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4242 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4243 zpos = -dtra2[2] / 2.;
4244 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4247 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4248 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4250 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4251 aphi2 = 180. - aphi1;
4252 xpos = (xtra1[5] + xtra1[0]) / 2.;
4253 ypos = (ytra1[5] + ytra1[0]) / 2.;
4254 zpos = dtra2[2] / 2.;
4255 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4258 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4259 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4260 zpos = -dtra2[2] / 2.;
4261 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4264 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4265 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4271 // --- Define the end-caps
4273 // GOTO 9234 ! skip both end-caps
4275 // --- Define the Z>0 end-cap
4277 // GOTO 9345 ! skip the Z>0 end-cap
4282 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4283 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4286 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4287 // end-ladder electro
4288 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4289 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4291 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4293 // In the Simonetti's drawings 52. In the TP 50.
4297 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4298 // end-ladder electro
4299 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4300 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4304 dtube[2] = 26.8/2./10.;
4307 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4309 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4310 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4316 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4317 // end-ladder electron
4320 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4321 // end-ladder electronics
4327 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4328 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4334 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4338 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4345 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4346 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4348 if (fMinorVersionV3 < 3 ) {
4350 dpgon[0] = offset2 + 360./(2.*35.);
4354 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4358 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4365 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4366 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4368 dpgon[0] = offset2 + 360./(2.*39.);
4372 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4376 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4383 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4384 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4386 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4388 dpgon[0] = offset2 + 5.625;
4392 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4393 // end-ladder electronics
4396 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4397 // end-ladder electr
4403 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4404 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4406 dpgon[0] = offset2 + 5.;
4410 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4411 // end-ladder electronics
4414 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4415 // end-ladder electr
4421 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4422 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4427 // --- Define the Z<0 end-cap
4429 // GOTO 9456 ! skip the Z<0 end-cap
4432 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4433 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4438 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4439 // end-ladder electr
4440 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4442 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4444 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4446 // In the Simonetti's drawings 52. In the TP 50.
4450 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4451 // end-ladder electr
4452 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4454 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4458 dtube[2] = 26.8/2./10.;
4461 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4463 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4465 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4471 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4472 // end-ladder electronics
4475 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4476 // end-ladder electro
4482 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4483 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4489 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4493 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4500 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4501 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4503 if (fMinorVersionV3 < 3) {
4505 dpgon[0] = offset2 + 360./(2.*35.);
4509 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4513 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4520 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4521 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4523 dpgon[0] = offset2 + 360./(2.*39.);
4527 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4531 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4538 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4539 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4541 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4543 dpgon[0] = offset2 + 5.625;
4547 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4548 // end-ladder electronics
4551 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4552 // end-ladder electr
4558 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4559 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4561 dpgon[0] = offset2 + 5.;
4565 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4566 // end-ladder electronics
4569 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4570 // end-ladder electr
4576 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4577 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4583 // --- Outputs the geometry tree in the EUCLID/CAD format
4586 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4588 fMinorVersion = fMinorVersionV3;
4591 //_____________________________________________________________________________
4592 void AliITSv3::CreateMaterials()
4595 // Create Materials for ITS
4597 AliITS::CreateMaterials();
4600 //_____________________________________________________________________________
4601 void AliITSv3::Init()
4604 // Initialise its after it is built
4608 fMinorVersion = fMinorVersionV3;
4611 //_____________________________________________________________________________
4612 void AliITSv3::StepManager()
4615 // Called at every step in ITS
4620 TLorentzVector position, momentum;
4621 TClonesArray &lhits = *fHits;
4625 if(gMC->IsTrackInside()) vol[3] += 1;
4626 if(gMC->IsTrackEntering()) vol[3] += 2;
4627 if(gMC->IsTrackExiting()) vol[3] += 4;
4628 if(gMC->IsTrackOut()) vol[3] += 8;
4629 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4630 if(gMC->IsTrackStop()) vol[3] += 32;
4631 if(gMC->IsTrackAlive()) vol[3] += 64;
4633 // Fill hit structure.
4634 if(gMC->TrackCharge() && gMC->Edep()) {
4636 // Only entering charged tracks
4637 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4639 id=gMC->CurrentVolOffID(1,copy);
4641 id=gMC->CurrentVolOffID(2,copy);
4643 } else if(id==fIdSens[1]) {
4645 id=gMC->CurrentVolOffID(1,copy);
4647 id=gMC->CurrentVolOffID(2,copy);
4649 } else if(id==fIdSens[2]) {
4652 id=gMC->CurrentVolOffID(1,copy);
4654 } else if(id==fIdSens[3]) {
4657 id=gMC->CurrentVolOffID(1,copy);
4659 } else if(id==fIdSens[4]) {
4662 id=gMC->CurrentVolOffID(1,copy);
4664 } else if(id==fIdSens[5]) {
4667 id=gMC->CurrentVolOffID(1,copy);
4670 gMC->TrackPosition(position);
4671 gMC->TrackMomentum(momentum);
4672 hits[0]=position[0];
4673 hits[1]=position[1];
4674 hits[2]=position[2];
4675 hits[3]=momentum[0];
4676 hits[4]=momentum[1];
4677 hits[5]=momentum[2];
4678 hits[6]=gMC->Edep();
4679 hits[7]=gMC->TrackTime();
4680 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);