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 **************************************************************************/
18 Revision 1.7 1999/09/29 09:24:20 fca
19 Introduction of the Copyright and cvs Log
23 ///////////////////////////////////////////////////////////////////////////////
25 // Inner Traking System version 3 //
26 // This class contains the base procedures for the Inner Tracking System //
28 // Authors: R. Barbera, A. Morsch.
32 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
33 // WORK with the geometry or module classes or any analysis classes. You are
34 // strongly encouraged to uses AliITSv5.
37 ///////////////////////////////////////////////////////////////////////////////
42 #include "AliITShit.h"
51 //_____________________________________________________________________________
52 AliITSv3::AliITSv3() {
54 // Default constructor for ITS
57 fId3Name = new char*[fId3N];
67 //_____________________________________________________________________________
68 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
70 // Standard constructor for ITS
73 fId3Name = new char*[fId3N];
83 //_____________________________________________________________________________
84 void AliITSv3::CreateGeometry(){
86 // Create ITS geometry for version 3
91 const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
92 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
94 const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
95 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
97 const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
98 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
100 const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
101 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
103 const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
104 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
106 const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
107 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
109 const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
110 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
112 const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
113 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
115 const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
116 0.5,0.7,0.5,0.7,0.5,0.5 };
117 const Float_t rr = 4.064516;
118 const Float_t tteta = 63.00;
119 const Float_t pphi = -35.00;
120 const Float_t gteta = 87.78;
121 const Double_t degrad = kPI/180.;
122 const Double_t raddeg = 180./kPI;
123 const Double_t twopi = 2*kPI;
126 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
127 dfra[10], dcer[3], dkap[3], dpla[3],
128 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
129 atheta1011, dbus[3], dtub[3], dwat[3],
130 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
131 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
132 Double_t biga1, bigb1;
133 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
134 dtra1[3], dtra2[3], dtra3[3],
135 dtra4[3], dbox1[3], dbox2[3];
137 Float_t xtra1[6], ytra1[6], ztra1[6];
139 Float_t xpos1, ypos1;
141 Float_t angle, dcone[5], dtube[3], dpgon[10];
142 Float_t rzero, xzero, yzero;
143 Double_t coeffa, coeffb, coeffc;
145 Float_t atheta, offset;
146 Float_t offset1, offset2, dgh[15];
147 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
148 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
151 Double_t xcc1, ycc1, xcc2, ycc2;
153 const char natra[][5] ={ "TR01","TR02","TR03","TR04",
154 "TR05","TR06","TR07","TR08"};
155 const char natra1[][5] ={"TR11","TR12","TR13","TR14",
156 "TR15","TR16","TR17","TR18",
157 "TR19","TR20","TR21","TR22",
158 "TR23","TR24","TR25","TR26"};
159 const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
160 const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
161 const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
162 "TR57","TR58","TR59","TR60","TR61","TR62",
163 "TR63","TR64","TR65","TR66"};
165 Int_t *idtmed = fIdtmed->GetArray()-199;
167 // --- Define a ghost volume containing the whole ITS and fill it with air
185 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
187 // --- Place the ghost volume in its mother volume (ALIC) and make it
190 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
191 gMC->Gsatt("ITSV", "SEEN", 0);
193 //************************************************************************
198 //************************************************************************
200 // GOTO 2345 ! skip ITS layer no. 1 and 2
202 // --- Define a ghost volume containing the Silicon Pixel Detectors
203 // (layer #1 and #2) and fill it with air or vacuum
205 xxm = (49.999-3)/(70-25);
209 dgh[3] = -25.-(9.-3.01)/xxm;
218 dgh[12] = 25+(9-3.01)/xxm;
221 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
223 // --- Place the ghost volume in its mother volume (ITSV) and make it
226 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
227 gMC->Gsatt("IT12", "SEEN", 0);
229 // --- Define a ghost volume containing a single element of layer #1
230 // and fill it with air or vacuum
232 dbox1[0] = 0.005+0.01+0.0075;
235 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
237 //--Divide each element of layer #1 in three ladders along the beam direction
239 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
241 // --- Make the ghost volumes invisible
243 gMC->Gsatt("IPV1", "SEEN", 0);
244 gMC->Gsatt("IPB1", "SEEN", 0);
246 // --- Define a volume containing the chip of pixels (silicon, layer #1)
250 dchi[2] = dbox1[2] / 3.;
251 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
253 // --- Define a volume containing the bus of pixels (silicon, layer #1)
258 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
260 // --- Define a volume containing the sensitive part of pixels
261 // (silicon, layer #1)
266 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
268 // --- Place the chip into its mother (IPB1)
270 xpos = dbox1[0] - dchi[0];
273 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
275 // --- Place the sensitive volume into its mother (IPB1)
277 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
278 ypos = dchi[1] - dits[1];
279 zpos = -(dchi[2] - dits[2]);
280 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
282 // --- Place the bus into its mother (IPB1)
284 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
285 ypos = dchi[1] - dbus[1];
286 zpos = -(dchi[2] - dbus[2]);
287 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
289 // --- Define a ghost volume containing a single element of layer #2
290 // and fill it with air or vacuum
292 dbox2[0] = 0.005+0.01+0.0075;
295 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
297 //--Divide each element of layer #2 in four ladders along the beam direction
299 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
301 // --- Make the ghost volumes invisible
303 gMC->Gsatt("IPV2", "SEEN", 0);
304 gMC->Gsatt("IPB2", "SEEN", 0);
306 // --- Define a volume containing the chip of pixels (silicon, layer #2)
310 dchi[2] = dbox2[2] / 4.;
311 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
313 // --- Define a volume containing the bus of pixels (silicon, layer #2)
318 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
320 // --- Define a volume containing the sensitive part of pixels
321 // (silicon, layer #2)
326 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
328 // --- Place the chip into its mother (IPB2)
330 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
333 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
335 // --- Place the sensitive volume into its mother (IPB2)
337 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
338 ypos = -(dchi[1] - dits[1]);
339 zpos = -(dchi[2] - dits[2]);
340 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
342 // --- Place the bus into its mother (IPB2)
344 xpos = dbox1[0] - dbus[0];
345 ypos = -(dchi[1] - dbus[1]);
346 zpos = -(dchi[2] - dbus[2]);
347 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
349 // --- Define a generic segment of an element of the mechanical support
354 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
356 // --- Define a generic arc of an element of the mechanical support
361 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
363 // --- Define the mechanical supports of layers #1 and #2 and place the
364 // elements of the layers in it
367 // counter over the number of elements of layer #1 (
370 // counter over the number of elements of layer #2 (
371 for (i = 1; i <= 10; ++i) {
373 // --- Place part # 1-2 (see sketch)
375 // number of carbon fiber supports (see sketch)
378 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
379 (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
381 xcc = ( xx[0] + xx[1]) / 20.;
382 ycc = ( yy[0] + yy[1]) / 20.;
383 xccc = (xbeg[0] + xend[0]) / 20.;
384 yccc = (ybeg[0] + yend[0]) / 20.;
385 if (xx[0] == xx[1]) {
390 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
391 } // end if xx[0] == xx[1]
392 aphi = (pphi + (i-1) * 36.) * degrad;
393 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
394 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
395 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
396 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
397 xpos = xpos1 * TMath::Cos(gteta * degrad) +
398 ypos1 * TMath::Sin(gteta *degrad);
399 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
400 ypos1 * TMath::Cos(gteta * degrad);
402 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
403 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
404 atheta12 + 90., 0., 0.);
405 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
406 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
408 // --- Place part # 2-3 (see sketch)
412 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
413 (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
415 xcc = ( xx[1] + xx[2]) / 20.;
416 ycc = ( yy[1] + yy[2]) / 20.;
417 xccc = (xbeg[1] + xend[1]) / 20.;
418 yccc = (ybeg[1] + yend[1]) / 20.;
419 if (xx[1] == xx[2]) {
424 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
425 } // end if xx[1] == xx[2]
426 aphi = (pphi + (i-1) * 36.) * degrad;
427 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
428 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
429 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
430 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
431 xpos = xpos1 * TMath::Cos(gteta * degrad) +
432 ypos1 * TMath::Sin(gteta * degrad);
433 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
434 ypos1 * TMath::Cos(gteta * degrad);
436 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
437 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
438 atheta23 + 90., 0., 0.);
439 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
440 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
442 // --- Place an element of layer #2
444 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
445 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
446 coeffa = biga * biga + 1.;
447 coeffb = biga * bigb - biga * ycc - xcc;
448 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
449 bigb * bigb - 0.08964*0.08964;
450 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
452 ycc1 = biga * xcc1 + bigb;
454 bigb1 = xcc1 / biga + ycc1;
455 coeffa = biga1 * biga1 + 1.;
456 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
457 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
458 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
459 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
461 ycc2 = biga1 * xcc2 + bigb1;
462 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
463 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
464 xpos = xpos1 * TMath::Cos(gteta * degrad) +
465 ypos1 * TMath::Sin(gteta *degrad);
466 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
467 ypos1 * TMath::Cos(gteta * degrad);
470 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
471 idrotm[(i-1) * 13 + 1101], "ONLY");
473 // --- Place part # 3-4 (see sketch)
477 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
478 (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
480 xcc = (xx[1] + xx[2]) / 20.;
481 ycc = (yy[1] + yy[2]) / 20.;
482 xccc = (xbeg[2] + xend[2]) / 20.;
483 yccc = (ybeg[2] + yend[2]) / 20.;
484 if (xx[2] == xx[3]) {
489 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
490 } // end if xx[2] == xx[3]
491 aphi = (pphi + (i-1) * 36.) * degrad;
492 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
493 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
494 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
495 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
496 xpos = xpos1 * TMath::Cos(gteta * degrad) +
497 ypos1 * TMath::Sin(gteta *degrad);
498 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
499 ypos1 * TMath::Cos(gteta * degrad);
501 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
502 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
503 atheta34 + 90., 0., 0.);
504 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
505 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
507 // --- Place part # 4-5 (see sketch)
511 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
512 (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
514 xcc = ( xx[3] + xx[4]) / 20.;
515 ycc = ( yy[3] + yy[4]) / 20.;
516 xccc = (xbeg[3] + xend[3]) / 20.;
517 yccc = (ybeg[3] + yend[3]) / 20.;
518 if (xx[3] == xx[4]) {
523 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
524 } // end if xx[3] == xx[4]
525 aphi = (pphi + (i-1) * 36.) * degrad;
526 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
527 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
528 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
529 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
530 xpos = xpos1 * TMath::Cos(gteta * degrad) +
531 ypos1 * TMath::Sin(gteta *degrad);
532 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
533 ypos1 * TMath::Cos(gteta * degrad);
535 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
536 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
537 atheta45 + 90., 0., 0.);
538 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
539 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
541 // --- Place an element of layer #2
543 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
544 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
545 coeffa = biga * biga + 1.;
546 coeffb = biga * bigb - biga * ycc - xcc;
547 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
548 bigb * bigb - .014285030400000001;
549 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
551 ycc1 = biga * xcc1 + bigb;
553 bigb1 = xcc1 / biga + ycc1;
554 coeffa = biga1 * biga1 + 1.;
555 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
556 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
557 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
558 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
560 ycc2 = biga1 * xcc2 + bigb1;
561 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
562 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
563 xpos = xpos1 * TMath::Cos(gteta * degrad) +
564 ypos1 * TMath::Sin(gteta *degrad);
565 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
566 ypos1 * TMath::Cos(gteta * degrad);
569 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
570 idrotm[(i-1) * 13 + 1103], "ONLY");
572 // --- Place part # 5-6 (see sketch)
576 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
577 (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
579 xcc = (xx[4] + xx[5]) / 20.;
580 ycc = (yy[4] + yy[5]) / 20.;
581 xccc = (xbeg[4] + xend[4]) / 20.;
582 yccc = (ybeg[4] + yend[4]) / 20.;
583 if (xx[4] == xx[5]) {
588 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
590 aphi = (pphi + (i-1) * 36.) * degrad;
591 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
592 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
593 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
594 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
595 xpos = xpos1 * TMath::Cos(gteta * degrad) +
596 ypos1 * TMath::Sin(gteta *degrad);
597 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
598 ypos1 * TMath::Cos(gteta * degrad);
600 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
601 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
602 atheta56 + 90., 0., 0.);
603 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
604 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
606 // --- Place part # 6-7 (see sketch)
610 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
611 (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
613 xcc = (xx[5] + xx[6]) / 20.;
614 ycc = (yy[5] + yy[6]) / 20.;
615 xccc = (xbeg[5] + xend[5]) / 20.;
616 yccc = (ybeg[5] + yend[5]) / 20.;
617 if (xx[5] == xx[6]) {
622 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
623 } // end if xx[5] == xx[6]
624 aphi = (pphi + (i-1) * 36.) * degrad;
625 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
626 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
627 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
628 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
629 xpos = xpos1 * TMath::Cos(gteta * degrad) +
630 ypos1 * TMath::Sin(gteta *degrad);
631 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
632 ypos1 * TMath::Cos(gteta * degrad);
634 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
635 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
636 atheta67 + 90., 0., 0.);
637 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
638 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
640 // --- Place an element of layer #2
642 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
643 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
644 coeffa = biga * biga + 1.;
645 coeffb = biga * bigb - biga * ycc - xcc;
646 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
647 bigb * bigb - .014285030400000001;
648 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
650 ycc1 = biga * xcc1 + bigb;
652 bigb1 = xcc1 / biga + ycc1;
653 coeffa = biga1 * biga1 + 1.;
654 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
655 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
656 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
657 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
659 ycc2 = biga1 * xcc2 + bigb1;
660 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
661 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
662 xpos = xpos1 * TMath::Cos(gteta * degrad) +
663 ypos1 * TMath::Sin(gteta *degrad);
664 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
665 ypos1 * TMath::Cos(gteta * degrad);
668 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
669 idrotm[(i-1) * 13 + 1105], "ONLY");
671 // --- Place part # 7-8 (see sketch)
675 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
676 (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
678 xcc = (xx[6] + xx[7]) / 20.;
679 ycc = (yy[6] + yy[7]) / 20.;
680 xccc = (xbeg[6] + xend[6]) / 20.;
681 yccc = (ybeg[6] + yend[6]) / 20.;
682 if (xx[6] == xx[7]) {
687 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
689 aphi = (pphi + (i-1) * 36.) * degrad;
690 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
691 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
692 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
693 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
694 xpos = xpos1 * TMath::Cos(gteta * degrad) +
695 ypos1 * TMath::Sin(gteta *degrad);
696 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
697 ypos1 * TMath::Cos(gteta * degrad);
699 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
700 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
701 atheta78 + 90., 0., 0.);
702 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
703 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
705 // --- Place part # 8-9 (see sketch)
709 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
710 (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
712 xcc = (xx[7] + xx[8]) / 20.;
713 ycc = (yy[7] + yy[8]) / 20.;
714 xccc = (xbeg[7] + xend[7]) / 20.;
715 yccc = (ybeg[7] + yend[7]) / 20.;
716 if (xx[1] == xx[2]) {
721 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
723 aphi = (pphi + (i-1) * 36.) * degrad;
724 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
725 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
726 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
727 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
728 xpos = xpos1 * TMath::Cos(gteta * degrad) +
729 ypos1 * TMath::Sin(gteta *degrad);
730 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
731 ypos1 * TMath::Cos(gteta * degrad);
733 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
734 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
735 atheta89 + 90., 0., 0.);
736 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
737 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
739 // --- Place an element of layer #2
741 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
742 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
743 coeffa = biga * biga + 1.;
744 coeffb = biga * bigb - biga * ycc - xcc;
745 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
746 bigb * bigb - .014285030400000001;
747 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
749 ycc1 = biga * xcc1 + bigb;
751 bigb1 = xcc1 / biga + ycc1;
752 coeffa = biga1 * biga1 + 1.;
753 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
754 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
755 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
756 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
758 ycc2 = biga1 * xcc2 + bigb1;
759 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
760 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
761 xpos = xpos1 * TMath::Cos(gteta * degrad) +
762 ypos1 * TMath::Sin(gteta *degrad);
763 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
764 ypos1 * TMath::Cos(gteta * degrad);
767 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
768 idrotm[(i-1) * 13 + 1107], "ONLY");
770 // --- Place part # 9-10 (see sketch)
774 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
775 (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
777 xcc = (xx[8] + xx[9]) / 20.;
778 ycc = (yy[8] + yy[9]) / 20.;
779 xccc = (xbeg[8] + xend[8]) / 20.;
780 yccc = (ybeg[8] + yend[8]) / 20.;
781 if (xx[8] == xx[9]) {
786 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
788 aphi = (pphi + (i-1) * 36.) * degrad;
789 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
790 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
791 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
792 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
793 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
794 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
796 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
797 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
798 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
800 // --- Place part # 10-11 (see sketch)
804 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
806 xcc = (xx[9] + xx[10]) / 20.;
807 ycc = (yy[9] + yy[10]) / 20.;
808 xccc = (xbeg[9] + xend[9]) / 20.;
809 yccc = (ybeg[9] + yend[9]) / 20.;
810 if (xx[9] == xx[10]) {
815 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
817 aphi = (pphi + (i-1) * 36.) * degrad;
818 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
819 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
820 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
821 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
822 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
823 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
825 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
826 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
827 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
829 // --- Place part # 13-14 (see sketch)
833 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
835 xcc = (xx[12] + xx[13]) / 20.;
836 ycc = (yy[12] + yy[13]) / 20.;
837 xccc = (xbeg[12] + xend[12]) / 20.;
838 yccc = (ybeg[12] + yend[12]) / 20.;
839 if (xx[12] == xx[13]) {
842 r1 = yy[12] - yy[13];
843 r2 = xx[12] - xx[13];
844 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
846 aphi = (pphi + (i-1) * 36.) * degrad;
847 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
848 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
849 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
850 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
851 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
852 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
854 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
855 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
856 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
858 // --- Place an element of layer #1
860 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
861 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
862 coeffa = biga * biga + 1.;
863 coeffb = biga * bigb - biga * ycc - xcc;
864 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
865 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
866 ycc1 = biga * xcc1 + bigb;
868 bigb1 = xcc1 / biga + ycc1;
869 coeffa = biga1 * biga1 + 1.;
870 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
871 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
872 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
873 ycc2 = biga1 * xcc2 + bigb1;
874 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
875 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
876 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
877 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
880 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
882 // --- Place part # 12-13 (see sketch)
886 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
888 xcc = (xx[11] + xx[12]) / 20.;
889 ycc = (yy[11] + yy[12]) / 20.;
890 xccc = (xbeg[11] + xend[11]) / 20.;
891 yccc = (ybeg[11] + yend[11]) / 20.;
892 if (xx[11] == xx[12]) {
895 r1 = yy[12] - yy[11];
896 r2 = xx[12] - xx[11];
897 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
899 aphi = (pphi + (i-1) * 36.) * degrad;
900 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
901 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
902 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
903 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
904 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
905 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
907 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
908 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
909 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
911 // --- Place part # 11-12 (see sketch)
915 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
917 xcc = (xx[10] + xx[11]) / 20.;
918 ycc = (yy[10] + yy[11]) / 20.;
919 xccc = (xbeg[10] + xend[10]) / 20.;
920 yccc = (ybeg[10] + yend[10]) / 20.;
921 if (xx[10] == xx[11]) {
924 r1 = yy[11] - yy[10];
925 r2 = xx[11] - xx[10];
926 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
928 aphi = (pphi + (i-1) * 36.) * degrad;
929 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
930 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
931 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
932 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
933 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
934 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
936 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
937 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
938 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
940 // --- Place an element of layer #1
942 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
943 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
944 coeffa = biga * biga + 1.;
945 coeffb = biga * bigb - biga * ycc - xcc;
946 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
947 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
948 ycc1 = biga * xcc1 + bigb;
950 bigb1 = xcc1 / biga + ycc1;
951 coeffa = biga1 * biga1 + 1.;
952 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
953 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
954 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
955 ycc2 = biga1 * xcc2 + bigb1;
956 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
957 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
958 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
959 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
962 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
964 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
966 darc[0] = rarc[12] / 10. - .02;
967 darc[1] = rarc[12] / 10.;
969 darc[3] = atheta12 - (i-1) * 36.;
970 darc[4] = atheta23 - (i-1) * 36.;
971 xcc = xarc[12] / 10.;
972 ycc = yarc[12] / 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 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
983 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
985 darc[0] = rarc[11] / 10. - .02;
986 darc[1] = rarc[11] / 10.;
988 darc[3] = atheta23 + 90. - (i-1) * 36.;
989 darc[4] = atheta34 + 90. - (i-1) * 36.;
990 xcc = xarc[11] / 10.;
991 ycc = yarc[11] / 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 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1002 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1004 darc[0] = rarc[10] / 10. - .02;
1005 darc[1] = rarc[10] / 10.;
1007 darc[3] = atheta45 + 180. - (i-1) * 36.;
1008 darc[4] = atheta34 + 180. - (i-1) * 36.;
1009 xcc = xarc[10] / 10.;
1010 ycc = yarc[10] / 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 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1021 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1023 darc[0] = rarc[9] / 10. - .02;
1024 darc[1] = rarc[9] / 10.;
1026 darc[3] = atheta45 - 90. - (i-1) * 36.;
1027 darc[4] = atheta56 - 90. - (i-1) * 36.;
1028 xcc = xarc[9] / 10.;
1029 ycc = yarc[9] / 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 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1040 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1042 darc[0] = rarc[8] / 10. - .02;
1043 darc[1] = rarc[8] / 10.;
1045 darc[3] = atheta67 + 45. - (i-1) * 36.;
1046 darc[4] = atheta56 + 45. - (i-1) * 36.;
1047 xcc = xarc[8] / 10.;
1048 ycc = yarc[8] / 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 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1059 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1061 darc[0] = rarc[7] / 10. - .02;
1062 darc[1] = rarc[7] / 10.;
1064 darc[3] = atheta67 - (i-1) * 36.;
1065 darc[4] = atheta78 - (i-1) * 36.;
1066 xcc = xarc[7] / 10.;
1067 ycc = yarc[7] / 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 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1078 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1080 darc[0] = rarc[6] / 10. - .02;
1081 darc[1] = rarc[6] / 10.;
1083 darc[3] = atheta89 + 45. - (i-1) * 36.;
1084 darc[4] = atheta78 + 45. - (i-1) * 36.;
1085 xcc = xarc[6] / 10.;
1086 ycc = yarc[6] / 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 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1097 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1099 darc[0] = rarc[5] / 10. - .02;
1100 darc[1] = rarc[5] / 10.;
1102 darc[3] = atheta89 + 45. - (i-1) * 36.;
1103 darc[4] = atheta910 + 45. - (i-1) * 36.;
1104 xcc = xarc[5] / 10.;
1105 ycc = yarc[5] / 10.;
1106 aphi = (pphi + (i-1) * 36.) * degrad;
1107 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1108 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1109 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1110 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1111 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1112 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1114 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1116 // --- Place arc # 5 (between part 9-10 and part 10-11)
1119 darc[0] = rarc[4] / 10. - .02;
1120 darc[1] = rarc[4] / 10.;
1122 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1123 darc[4] = atheta910 + 45. - (i-1) * 36.;
1124 xcc = xarc[4] / 10.;
1125 ycc = yarc[4] / 10.;
1126 aphi = (pphi + (i-1) * 36.) * degrad;
1127 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1128 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1129 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1130 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1131 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1132 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1134 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1136 // --- Place arc # 4 (between part 10-11 and part 11-12)
1139 darc[0] = rarc[3] / 10. - .02;
1140 darc[1] = rarc[3] / 10.;
1142 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1143 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1144 xcc = xarc[3] / 10.;
1145 ycc = yarc[3] / 10.;
1146 aphi = (pphi + (i-1) * 36.) * degrad;
1147 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1148 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1149 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1150 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1151 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1152 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1154 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1156 // --- Place arc # 3 (between part 11-12 and part 12-13)
1159 darc[0] = rarc[2] / 10. - .02;
1160 darc[1] = rarc[2] / 10.;
1162 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1163 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1164 xcc = xarc[2] / 10.;
1165 ycc = yarc[2] / 10.;
1166 aphi = (pphi + (i-1) * 36.) * degrad;
1167 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1168 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1169 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1170 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1171 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1172 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1174 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1176 // --- Place arc # 2 (between part 12-13 and part 13-14)
1179 darc[0] = rarc[1] / 10. - .02;
1180 darc[1] = rarc[1] / 10.;
1182 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1183 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1184 xcc = xarc[1] / 10.;
1185 ycc = yarc[1] / 10.;
1186 aphi = (pphi + (i-1) * 36.) * degrad;
1187 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1188 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1189 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1190 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1191 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1192 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1194 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1196 // --- Place arc # 1 (between part 13-14 and part 1-2)
1199 darc[0] = rarc[0] / 10. - .02;
1200 darc[1] = rarc[0] / 10.;
1202 darc[3] = atheta12 + 45. - (i-1) * 36.;
1203 darc[4] = atheta1314 - (i-1) * 36.;
1204 xcc = xarc[0] / 10.;
1205 ycc = yarc[0] / 10.;
1206 aphi = (pphi + (i-1) * 36.) * degrad;
1207 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1208 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1209 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1210 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1211 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1212 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1214 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1217 //************************************************************************
1222 //************************************************************************
1224 // --- Define a ghost volume containing the Silicon Drift Detectors
1225 // (layer #3 and #4) and fill it with air or vacuum
1227 xxm = (49.999-3.)/(70.-25.);
1231 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1234 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1237 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1240 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1243 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1245 // --- Place the ghost volume in its mother volume (ITSV) and make it
1248 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1249 gMC->Gsatt("IT34", "SEEN", 0);
1253 // GOTO 3456 ! skip ITS layer no. 3
1255 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1256 // smaller lenght of ribs) and fill it with air or vacuum
1258 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1260 // the widest element is the sensitive element
1261 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1262 // 7.5 cm is the lenght
1263 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1265 // --- Make the ghost volume invisible
1267 gMC->Gsatt("IDV1", "SEEN", 0);
1269 // --- Define a volume containing the sensitive part of drifts
1270 // (silicon, layer #3)
1273 // see material budget report by G. Feofilov
1276 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1278 //--- Define the part of the (smaller) rib between two sensitive parts made of
1279 // carbon (layer #3)
1281 dsup[0] = .5 - dits[0];
1283 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1284 // 7.5 cm is the lenght
1285 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1287 //--- Define the first part of the (smaller) rib between two sensitive parts
1288 // made of aluminum (layer #3)
1290 dal1[0] = .5 - dits[0];
1291 dal1[1] = 0.00096/2.;
1292 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1293 // 7.5 cm is the lenght
1294 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1296 //--- Define the part of the (smaller) rib between two sensitive parts made of
1297 // kapton (layer #3)
1299 dkap[0] = .5 - dits[0];
1301 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1302 // 7.5 cm is the lenght
1303 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1305 //--- Define the second part of the (smaller) rib between two sensitive parts
1306 // made of aluminum (layer #3)
1308 dal2[0] = .5 - dits[0];
1309 dal2[1] = 0.0027/2.;
1310 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1311 // 7.5 cm is the lenght
1312 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1314 // --- Define the part of the (smaller) rib between two sensitive parts
1315 // made of silicon (the electronics) (layer #3)
1317 dchi[0] = .5 - dits[0];
1318 dchi[1] = 0.0071/2.;
1319 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1320 // 7.5 cm is the lenght
1321 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1323 // --- Define the part of the (smaller) rib between two sensitive parts
1324 // made of water (the cooler) (layer #3)
1326 dwat[0] = .5 - dits[0];
1327 dwat[1] = 0.0093/2.;
1328 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1329 // 7.5 cm is the lenght
1330 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1332 //--- Define the third part of the (smaller) rib between two sensitive parts
1333 // made of aluminum (the cooling tubes) (layer #3)
1335 dtub[0] = .5 - dits[0];
1336 dtub[1] = 0.00134/2.;
1337 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1338 // 7.5 cm is the lenght
1339 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1341 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1344 // twice the foreseen thickness
1347 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1349 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1352 // twice the foreseen thickness
1355 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1357 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1360 // twice the foreseen thickness
1363 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1365 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1368 // twice the foreseen thickness
1371 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1373 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1377 for (j = 1; j <= 5; ++j) {
1378 // odd elements are up and even elements are down
1380 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1381 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1382 } else if (j == 2) {
1383 xpos = -dbox1[0] + dits[0];
1384 zpos = 0. - dits[2] + 1. - dits[2];
1385 } else if (j == 3) {
1386 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1388 } else if (j == 4) {
1389 xpos = -dbox1[0] + dits[0];
1390 zpos = dits[2] + 0. - 1. + dits[2];
1391 } else if (j == 5) {
1392 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1393 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1395 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1398 // --- Place the smaller ribs into their mother (IDV1)
1400 // --- Right ribs (just a matter of convention)
1402 xpos = .5 - dbox1[0] + dits[0];
1408 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1412 ypos = dsup[1] + 2.81 + dal1[1];
1413 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1417 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1418 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1422 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1423 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1425 // --- Silicon (chip)
1427 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1428 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1432 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1433 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1437 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1439 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1441 // --- Right ribs (just a matter of convention)
1446 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1450 ypos = -(dsup[1] + 2.81 + dal1[1]);
1451 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1455 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1456 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1460 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1461 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1463 // --- Silicon (chip)
1465 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1466 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1470 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1471 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1475 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1476 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1477 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1479 // --- Place the end-ladder stuff into its mother (IDV1)
1482 // --- Negative-Z end-ladder
1485 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1489 xpos = dbox1[0] - dpcb[0];
1490 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1494 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1495 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1499 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1500 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1502 // --- Silicon (bus)
1504 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1505 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1507 // --- Positive-Z end-ladder
1510 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1514 xpos = dbox1[0] - dpcb[0];
1515 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1519 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1520 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1524 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1525 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1527 // --- Silicon (bus)
1529 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1530 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1532 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1533 // larger lenght of ribs) and fill it with air or vacuum
1535 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1537 // the widest element is the sensitive element
1538 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1539 // 7.5 cm is the lenght
1540 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1542 // --- Make the ghost volume invisible
1544 gMC->Gsatt("IDV2", "SEEN", 0);
1546 //--- Define the part of the (larger) rib between two sensitive parts madeof
1547 // carbon (layer #3)
1549 dsup[0] = .65 - dits[0];
1551 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1552 // 7.5 cm is the lenght
1553 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1555 //--- Define the first part of the (larger) rib between two sensitive parts
1556 // made of aluminum (layer #3)
1558 dal1[0] = .65 - dits[0];
1559 dal1[1] = 0.00096/2.;
1560 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1561 // 7.5 cm is the lenght
1562 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1564 //--- Define the part of the (larger) rib between two sensitive parts madeof
1565 // kapton (layer #3)
1567 dkap[0] = .65 - dits[0];
1568 dkap[1] = 0.0317/2.;
1569 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1570 // 7.5 cm is the lenght
1571 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1573 //--- Define the second part of the (larger) rib between two sensitive parts
1574 // made of aluminum (layer #3)
1576 dal2[0] = .65 - dits[0];
1577 dal2[1] = 0.0027/2.;
1578 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1579 // 7.5 cm is the lenght
1580 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1582 // --- Define the part of the (larger) rib between two sensitive parts
1583 // made of silicon (the electronics) (layer #3)
1585 dchi[0] = .65 - dits[0];
1586 dchi[1] = 0.0071/2.;
1587 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1588 // 7.5 cm is the lenght
1589 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1591 // --- Define the part of the (larger) rib between two sensitive parts
1592 // made of water (the cooler) (layer #3)
1594 dwat[0] = .65 - dits[0];
1595 dwat[1] = 0.0093/2.;
1596 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1597 // 7.5 cm is the lenght
1598 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1600 //--- Define the third part of the (larger) rib between two sensitive parts
1601 // made of aluminum (the cooling tubes) (layer #3)
1603 dtub[0] = .65 - dits[0];
1604 dtub[1] = 0.00134/2.;
1605 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1606 // 7.5 cm is the lenght
1607 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1609 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1613 for (j = 1; j <= 5; ++j) {
1614 // odd element are up and even elements are down
1616 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1617 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1618 } else if (j == 2) {
1619 xpos = -dbox2[0] + dits[0];
1620 zpos = 0. - dits[2] + 1. - dits[2];
1621 } else if (j == 3) {
1622 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1624 } else if (j == 4) {
1625 xpos = -dbox2[0] + dits[0];
1626 zpos = dits[2] + 0. - 1. + dits[2];
1627 } else if (j == 5) {
1628 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1629 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1631 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1634 // --- Place the larger ribs into their mother (IDV2)
1637 // --- Right ribs (just a matter of convention)
1639 xpos = .65 - dbox2[0] + dits[0];
1645 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1649 ypos = dsup[1] + 2.81 + dal1[1];
1650 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1654 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1655 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1659 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1660 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1662 // --- Silicon (chip)
1664 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1665 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1669 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1670 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1674 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1675 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1677 // --- Right ribs (just a matter of convention)
1682 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1686 ypos = -(dsup[1] + 2.81 + dal1[1]);
1687 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1691 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1692 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1696 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1697 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1699 // --- Silicon (chip)
1701 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1702 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1706 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1707 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1711 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1712 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1714 // --- Place the end-ladder stuff into its mother (IDV1)
1717 // --- Negative-Z end-ladder
1720 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1724 xpos = dbox2[0] - dpcb[0];
1725 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1729 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1730 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1734 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1735 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1737 // --- Silicon (bus)
1739 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1740 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1742 // --- Positive-Z end-ladder
1745 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1749 xpos = dbox2[0] - dpcb[0];
1750 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1754 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1755 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1759 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1760 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1762 // --- Silicon (bus)
1764 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1765 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1767 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1768 // mother volume (IT34)
1769 // Odd elements have large ribs and even elements have small ribs
1771 for (i = 1; i <= 12; ++i) {
1772 atheta = (i-1) * 30.;
1773 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1776 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1777 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1779 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1782 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1783 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1785 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1792 // GOTO 4567 ! skip ITS layer no. 4
1794 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1795 // smaller lenght of ribs) and fill it with air or vacuum
1797 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1799 // the widest element is the end-ladder stuff
1800 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1801 // 7.5 cm is the lenght
1802 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1804 // --- Make the ghost volume invisible
1806 gMC->Gsatt("IDV3", "SEEN", 0);
1808 // --- Define a volume containing the sensitive part of drifts
1809 // (silicon, layer #4)
1812 // see material budget report by G. Feofilov
1815 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1817 //--- Define the part of the (smaller) rib between two sensitive parts made of
1818 // carbon (layer #4)
1820 dsup[0] = .5 - dits[0];
1822 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1823 // 7.5 cm is the lengh
1824 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1826 //--- Define the first part of the (smaller) rib between two sensitive parts
1827 // made of aluminum (layer #4)
1829 dal1[0] = .5 - dits[0];
1830 dal1[1] = 0.00096/2.;
1831 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1832 // 7.5 cm is the lengh
1833 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1835 //--- Define the part of the (smaller) rib between two sensitive parts made of
1836 // kapton (layer #4)
1838 dkap[0] = .5 - dits[0];
1839 dkap[1] = 0.0317/2.;
1840 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1841 // 7.5 cm is the lengh
1842 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1844 //--- Define the second part of the (smaller) rib between two sensitive parts
1845 // made of aluminum (layer #4)
1847 dal2[0] = .5 - dits[0];
1848 dal2[1] = 0.0027/2.;
1849 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1850 // 7.5 cm is the lengh
1851 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1853 // --- Define the part of the (smaller) rib between two sensitive parts
1854 // made of silicon (the electronics) (layer #4)
1856 dchi[0] = .5 - dits[0];
1857 dchi[1] = 0.0071/2.;
1858 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1859 // 7.5 cm is the lengh
1860 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1862 // --- Define the part of the (smaller) rib between two sensitive parts
1863 // made of water (the cooler) (layer #4)
1865 dwat[0] = .5 - dits[0];
1866 dwat[1] = 0.0093/2.;
1867 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1868 // 7.5 cm is the lenght
1869 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1871 //--- Define the third part of the (smaller) rib between two sensitive parts
1872 // made of aluminum (the cooling tubes) (layer #4)
1874 dtub[0] = .5 - dits[0];
1875 dtub[1] = 0.00134/2.;
1876 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1877 // 7.5 cm is the lengh
1878 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1880 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1883 // twice the foreseen thickness
1886 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1888 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1891 // twice the foreseen thickness
1894 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1896 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1899 // twice the foreseen thickness
1902 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1904 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1907 // twice the foreseen thickness
1910 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1912 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1916 for (j = 1; j <= 7; ++j) {
1917 // odd elements are down and even elements are up
1919 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1920 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1921 } else if (j == 2) {
1922 xpos = -dbox1[0] + dits[0];
1923 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1924 } else if (j == 3) {
1925 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1926 zpos = 0. - dits[2] + .7 - dits[2];
1927 } else if (j == 4) {
1928 xpos = -dbox1[0] + dits[0];
1930 } else if (j == 5) {
1931 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1932 zpos = dits[2] + 0. - .7 + dits[2];
1933 } else if (j == 6) {
1934 xpos = -dbox1[0] + dits[0];
1935 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1936 } else if (j == 7) {
1937 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1938 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1940 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1943 // --- Place the smaller ribs into their mother (IDV3)
1945 // --- Right ribs (just a matter of convention)
1947 xpos = .5 - dbox1[0] + dits[0];
1953 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1957 ypos = dsup[1] + 2.81 + dal1[1];
1958 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1962 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1963 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1967 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1968 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1970 // --- Silicon (chip)
1972 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1973 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1977 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1978 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1982 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1984 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1986 // --- Right ribs (just a matter of convention)
1991 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1995 ypos = -(dsup[1] + 2.81 + dal1[1]);
1996 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2000 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2001 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2005 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2007 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2009 // --- Silicon (chip)
2011 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2012 2. + dal2[1] * 2. + dchi[1]);
2013 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2017 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2018 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2019 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2023 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2024 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2026 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2028 // --- Place the end-ladder stuff into its mother (IDV1)
2031 // --- Negative-Z end-ladder
2034 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2038 xpos = dbox1[0] - dpcb[0];
2039 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2043 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2044 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2048 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2049 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2051 // --- Silicon (bus)
2053 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2054 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2056 // --- Positive-Z end-ladder
2059 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2063 xpos = dbox1[0] - dpcb[0];
2064 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2068 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2069 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2073 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2074 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2076 // --- Silicon (bus)
2078 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2079 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2081 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2082 // larger lenght of ribs) and fill it with air or vacuum
2084 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2086 // the widest element is the end-ladder stuff
2087 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2088 // 7.5 cm is the lenght
2089 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2091 // --- Make the ghost volume invisible
2093 gMC->Gsatt("IDV4", "SEEN", 0);
2095 //--- Define the part of the (larger) rib between two sensitive parts madeof
2096 // carbon (layer #4)
2098 dsup[0] = .65 - dits[0];
2100 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2101 // 7.5 cm is the lengh
2102 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2104 //--- Define the first part of the (larger) rib between two sensitive parts
2105 // made of aluminum (layer #4)
2107 dal1[0] = .65 - dits[0];
2108 dal1[1] = 0.00096/2.;
2109 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2110 // 7.5 cm is the lengh
2111 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2113 //--- Define the part of the (larger) rib between two sensitive parts madeof
2114 // kapton (layer #4)
2116 dkap[0] = .65 - dits[0];
2117 dkap[1] = 0.0317/2.;
2118 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2119 // 7.5 cm is the lengh
2120 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2122 //--- Define the second part of the (larger) rib between two sensitive parts
2123 // made of aluminum (layer #4)
2125 dal2[0] = .65 - dits[0];
2126 dal2[1] = 0.0027/2.;
2127 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2128 // 7.5 cm is the lengh
2129 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2131 // --- Define the part of the (larger) rib between two sensitive parts
2132 // made of silicon (the electronics) (layer #4)
2134 dchi[0] = .65 - dits[0];
2135 dchi[1] = 0.0071/2.;
2136 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2137 // 7.5 cm is the lengh
2138 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2140 // --- Define the part of the (larger) rib between two sensitive parts
2141 // made of water (the cooler) (layer #4)
2143 dwat[0] = .65 - dits[0];
2144 dwat[1] = 0.0093/2.;
2145 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2146 // 7.5 cm is the lengh
2147 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2149 //--- Define the third part of the (larger) rib between two sensitive parts
2150 // made of aluminum (the cooling tubes) (layer #4)
2152 dtub[0] = .65 - dits[0];
2153 dtub[1] = 0.00134/2.;
2154 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2155 // 7.5 cm is the lengh
2156 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2158 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2162 for (j = 1; j <= 7; ++j) {
2163 // odd elements are down and even elements are up
2165 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2166 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2167 } else if (j == 2) {
2168 xpos = -dbox2[0] + dits[0];
2169 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2170 } else if (j == 3) {
2171 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2172 zpos = 0. - dits[2] + .7 - dits[2];
2173 } else if (j == 4) {
2174 xpos = -dbox2[0] + dits[0];
2176 } else if (j == 5) {
2177 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2178 zpos = dits[2] + 0. - .7 + dits[2];
2179 } else if (j == 6) {
2180 xpos = -dbox2[0] + dits[0];
2181 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2182 } else if (j == 7) {
2183 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2184 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2186 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2189 // --- Place the larger ribs into their mother (IDV4)
2192 // --- Right ribs (just a matter of convention)
2194 xpos = .65 - dbox2[0] + dits[0];
2200 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2204 ypos = dsup[1] + 2.81 + dal1[1];
2205 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2209 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2210 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2214 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2215 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2217 // --- Silicon (chip)
2219 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2220 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2224 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2225 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2229 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2231 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2233 // --- Right ribs (just a matter of convention)
2238 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2242 ypos = -(dsup[1] + 2.81 + dal1[1]);
2243 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2247 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2248 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2252 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2254 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2256 // --- Silicon (chip)
2258 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2259 2. + dal2[1] * 2. + dchi[1]);
2260 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2264 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2265 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2266 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2270 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2271 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2272 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2274 // --- Place the end-ladder stuff into its mother (IDV1)
2277 // --- Negative-Z end-ladder
2280 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2284 xpos = dbox2[0] - dpcb[0];
2285 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2289 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2290 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2294 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2295 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2297 // --- Silicon (bus)
2299 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2300 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2302 // --- Positive-Z end-ladder
2305 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2309 xpos = dbox2[0] - dpcb[0];
2310 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2314 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2315 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2319 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2320 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2322 // --- Silicon (bus)
2324 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2325 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2327 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2328 // mother volume (IT34)
2329 // Odd elements have large ribs and even elements have small ribs
2331 for (i = 1; i <= 24; ++i) {
2332 atheta = (i-1) * 15.;
2333 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2336 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2337 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2339 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2341 rzero = (24.0+22.8)/2.;
2342 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2343 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2345 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2349 //************************************************************************
2354 //************************************************************************
2356 // --- Define SSD with the 35+39 lay-out
2358 if (fMinorVersionV3 < 3) {
2360 //--- Define ghost volume containing the Strip Detectors and fill it with air
2363 xxm = (49.999-3.)/(70.-25.);
2367 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2368 (37.-27)/xxm-(49.998-37.)/xxm;
2371 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2375 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2379 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2380 (37.-27)/xxm+(49.998-37.)/xxm;
2383 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2384 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2385 gMC->Gsatt("IT56", "SEEN", 0);
2389 // GOTO 5678 ! skip ITS layer no. 5
2391 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2392 // it with air or vacuum
2394 dbox1[0] = (0.0600+2.*0.0150)/2.;
2396 dbox1[2] = 90.22/2.;
2397 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2399 // --- Make the ghost volume invisible
2401 gMC->Gsatt("ISV1", "SEEN", 0);
2403 // --- Define a ghost volume containing the electronics and cooling of
2404 // a single ladder of layer #5 and fill it with air or vacuum
2406 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2409 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2411 // --- Make the ghost volume invisible
2413 gMC->Gsatt("SSV1", "SEEN", 0);
2415 // --- Define a ghost volume containing the end-ladder stuff of
2416 // a single ladder of layer #5 and fill it with air or vacuum
2421 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2423 // --- Make the ghost volume invisible
2425 gMC->Gsatt("ELL5", "SEEN", 0);
2427 // --- Define a volume containing the sensitive part of the strips
2428 // (silicon, layer #5)
2433 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2435 // --- Define a volume containing the electronics of the strips
2436 // (silicon, layer #5)
2441 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2443 // --- Define the cooling tubes (aluminum, layer #5)
2446 dtub[1] = dtub[0] + .01;
2448 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2450 // --- Define the cooling fluid (water or freon, layer #5)
2455 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2456 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2458 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2466 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2467 dfra[6] = dfra[5] + .03;
2471 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2473 // --- Define the element connecting the triangles of the heat bridge
2474 // (carbon, layer #5)
2479 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2481 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2484 dpla[0] = (10./(8.*7.))/2.;
2487 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2489 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2491 dcop[0] = (2./(8.*7.))/2.;
2494 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2496 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2498 depx[0] = (30./(8.*7.))/2.;
2501 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2503 // --- Define the part of the end-ladder stuff made of silicon (bus)
2506 dsil[0] = (20./(8.*7.))/2.;
2509 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2511 // --- Place the end-ladder stuff into its mother (ELL5)
2513 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2519 xpos = -dela[0] + dpla[0];
2520 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2524 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2525 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2529 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2530 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2532 // --- Silicon (bus)
2534 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2535 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2537 // --- Place the sensitive part of the strips into its mother (ISV1)
2540 for (j = 1; j <= 23; ++j) {
2541 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2542 else xpos = -dbox1[0] + dits[0];
2543 zpos = ((j - 1) - 11.) * 3.91;
2544 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2547 // --- Place the electronics of the strips into its mother (SSV1)
2550 for (j = 1; j <= 23; ++j) {
2551 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2552 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2553 zpos = ((j - 1) - 11.) * 3.91 + .85;
2554 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2557 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2559 xpos = -dsrv[0] + .41;
2562 // --- Left tube (just a matter of convention)
2565 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2566 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2568 // --- Right tube (just a matter of convention)
2571 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2572 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2574 // --- Place the heat bridge elements into their mother (SSV1)
2576 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2578 for (j = 1; j <= 24; ++j) {
2579 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2580 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2583 // --- Place the elements connecting the triangles of the heat bridge
2584 // into their mother (SSV1)
2588 // --- Left element (just a matter of convention)
2590 xpos = -dsrv[0] + .47;
2591 ypos = -(2.1+0.015);
2592 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2594 // --- Right element
2596 xpos = -dsrv[0] + .47;
2598 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2602 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2604 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2606 // --- Place the ghost volumes containing the strip ladders (ISV1),
2607 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2608 // their mother volume (IT56)
2610 offset1 = TMath::ATan2(.9, 40.);
2612 rzero = dbox1[0] + 40.;
2613 runo = dbox1[0] * 2. + 40. + dsrv[0];
2614 rtwo = dbox1[0] * 2. + 40. + dela[0];
2615 for (i = 1; i <= 35; ++i) {
2616 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2617 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2619 // --- Strip ladders
2621 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2622 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2624 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2626 // --- Electronics/cooling
2628 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2629 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2631 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2633 // --- End-ladders (nagative-Z and positive-Z)
2635 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2636 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2637 zpos = -(dbox1[2] + dela[2] + 6.);
2638 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2639 zpos = dbox1[2] + dela[2] + 6.;
2640 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2646 // GOTO 5778 ! skip ITS layer no. 6
2648 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2649 // it with air or vacuum
2651 dbox2[0] = (0.0600+2.*0.0150)/2.;
2653 dbox2[2] = 101.95/2.;
2654 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2656 // --- Make the ghost volume invisible
2658 gMC->Gsatt("ISV2", "SEEN", 0);
2660 // --- Define a ghost volume containing the electronics and cooling of
2661 // a single ladder of layer #6 and fill it with air or vacuum
2663 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2665 dsrv[2] = 101.95/2.;
2666 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2668 // --- Make the ghost volume invisible
2670 gMC->Gsatt("SSV2", "SEEN", 0);
2672 // --- Define a ghost volume containing the end-ladder stuff of
2673 // a single ladder of layer #6 and fill it with air or vacuum
2678 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2680 // --- Make the ghost volume invisible
2682 gMC->Gsatt("ELL6", "SEEN", 0);
2684 // --- Define a volume containing the sensitive part of the strips
2685 // (silicon, layer #6)
2690 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2692 // --- Define a volume containing the electronics of the strips
2693 // (silicon, layer #6)
2698 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2700 // --- Define the cooling tubes (aluminum, layer #6)
2703 dtub[1] = dtub[0] + .01;
2704 dtub[2] = 101.95/2.;
2705 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2707 // --- Define the cooling fluid (water or freon, layer #6)
2711 dwat[2] = 101.95/2.;
2712 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2713 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2715 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2723 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2724 dfra[6] = dfra[5] + .03;
2728 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2730 // --- Define the element connecting the triangles of the heat bridge
2731 // (carbon, layer #6)
2735 dcei[2] = 101.95/2.;
2736 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2738 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2741 dpla[0] = (10./(8.*7.))/2.;
2744 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2746 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2748 dcop[0] = (2./(8.*7.))/2.;
2751 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2753 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2755 depx[0] = (30./(8.*7.))/2.;
2758 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2760 // --- Define the part of the end-ladder stuff made of silicon (bus)
2763 dsil[0] = (20./(8.*7.))/2.;
2766 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2768 // --- Place the end-ladder stuff into its mother (ELL5)
2770 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2776 xpos = -dela[0] + dpla[0];
2777 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2781 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2782 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2786 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2787 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2789 // --- Silicon (bus)
2791 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2792 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2794 // --- Place the sensitive part of the strips into its mother (ISV2)
2797 for (j = 1; j <= 26; ++j) {
2798 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2799 else xpos = -dbox2[0] + dits[0];
2800 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2801 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2804 // --- Place the electronics of the strips into its mother (SSV2)
2807 for (j = 1; j <= 26; ++j) {
2808 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2809 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2810 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2811 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2814 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2816 xpos = -dsrv[0] + .41;
2819 // --- Left tube (just a matter of convention)
2822 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2823 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2825 // --- Right tube (just a matter of convention)
2828 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2829 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2831 // --- Place the heat bridge elements into their mother (SSV2)
2833 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2835 for (j = 1; j <= 27; ++j) {
2836 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2837 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2840 // --- Place the elements connecting the triangles of the heat bridge
2841 // into their mother (SSV2)
2845 // --- Left element (just a matter of convention)
2847 xpos = -dsrv[0] + .47;
2848 ypos = -(2.1+0.015);
2849 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2851 // --- Right element
2853 xpos = -dsrv[0] + .47;
2855 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2859 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2861 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2863 // --- Place the ghost volumes containing the strip ladders (ISV2),
2864 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2865 // their mother volume (IT56)
2867 offset1 = TMath::ATan2(1., 45.);
2869 rzero = dbox2[0] + 45.;
2870 runo = dbox2[0] * 2. + 45. + dsrv[0];
2871 rtwo = dbox2[0] * 2. + 45. + dela[0];
2872 for (i = 1; i <= 39; ++i) {
2873 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2874 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2876 // --- Strip ladders
2878 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2879 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2881 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2883 // --- Electronics/cooling
2885 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2886 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2888 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2890 // --- End-ladders (nagative-Z and positive-Z)
2892 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2893 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2894 zpos = -(dbox2[2] + dela[2] + 6.);
2895 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2896 zpos = dbox2[2] + dela[2] + 6.;
2897 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2902 // --- Define SSD with the 32+36 lay-out
2904 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
2906 //--- Define ghost volume containing the Strip Detectors and fill it with air
2909 xxm = (49.999-3.)/(70.-25.);
2913 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2914 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2917 dgh[6] = -25. - (9.-3.01) / xxm -
2918 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2921 dgh[9] = (9.-3.01) / xxm + 25. +
2922 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2925 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2926 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2929 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2930 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2931 gMC->Gsatt("IT56", "SEEN", 0);
2935 // GOTO 6678 ! skip ITS layer no. 5
2937 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2938 // it with air or vacuum
2940 dbox1[0] = (0.0600+2.*0.0150)/2.;
2942 dbox1[2] = 86.31/2.;
2943 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2945 // --- Make the ghost volume invisible
2947 gMC->Gsatt("ISV1", "SEEN", 0);
2949 // --- Define a ghost volume containing the electronics and cooling of
2950 // a single ladder of layer #5 and fill it with air or vacuum
2952 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2955 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2957 // --- Make the ghost volume invisible
2959 gMC->Gsatt("SSV1", "SEEN", 0);
2961 // --- Define a ghost volume containing the end-ladder stuff of
2962 // a single ladder of layer #5 and fill it with air or vacuum
2967 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2969 // --- Make the ghost volume invisible
2971 gMC->Gsatt("ELL5", "SEEN", 0);
2973 // --- Define a volume containing the sensitive part of the strips
2974 // (silicon, layer #5)
2979 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2981 // --- Define a volume containing the electronics of the strips
2982 // (silicon, layer #5)
2987 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2989 // --- Define the cooling tubes (aluminum, layer #5)
2992 dtub[1] = dtub[0] + .01;
2994 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2996 // --- Define the cooling fluid (water or freon, layer #5)
3001 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3002 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3004 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3012 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3013 dfra[6] = dfra[5] + .03;
3017 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3019 // --- Define the element connecting the triangles of the heat bridge
3020 // (carbon, layer #5)
3025 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3027 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3030 dpla[0] = (10./(8.*7.))/2;
3033 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3035 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3037 dcop[0] = (2./(8.*7.))/2;
3040 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3042 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3044 depx[0] = (30./(8.*7.))/2.;
3047 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3049 // --- Define the part of the end-ladder stuff made of silicon (bus)
3052 dsil[0] = (20./(8.*7.))/2.;
3055 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3057 // --- Place the end-ladder stuff into its mother (ELL5)
3059 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3065 xpos = -dela[0] + dpla[0];
3066 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3070 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3071 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3075 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3076 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3078 // --- Silicon (bus)
3080 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3081 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3083 // --- Place the sensitive part of the strips into its mother (ISV1)
3086 for (j = 1; j <= 22; ++j) {
3087 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3088 else xpos = -dbox1[0] + dits[0];
3089 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3090 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3093 // --- Place the electronics of the strips into its mother (SSV1)
3096 for (j = 1; j <= 22; ++j) {
3097 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3098 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3099 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3100 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3103 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3105 xpos = -dsrv[0] + .41;
3108 // --- Left tube (just a matter of convention)
3111 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3112 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3114 // --- Right tube (just a matter of convention)
3117 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3118 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3120 // --- Place the heat bridge elements into their mother (SSV1)
3122 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3124 for (j = 1; j <= 23; ++j) {
3125 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3126 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3129 // --- Place the elements connecting the triangles of the heat bridge
3130 // into their mother (SSV1)
3134 // --- Left element (just a matter of convention)
3136 xpos = -dsrv[0] + .47;
3137 ypos = -(2.1+0.015);
3138 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3140 // --- Right element
3142 xpos = -dsrv[0] + .47;
3144 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3148 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3150 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3152 // --- Place the ghost volumes containing the strip ladders (ISV1),
3153 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3154 // their mother volume (IT56)
3156 offset1 = TMath::ATan2(.8, 36.6);
3158 rzero = dbox1[0] + 36.6;
3159 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3160 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3161 for (i = 1; i <= 32; ++i) {
3162 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3163 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3165 // --- Strip ladders
3167 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3168 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3170 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3172 // --- Electronics/cooling
3174 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3175 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3177 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3179 // --- End-ladders (nagative-Z and positive-Z)
3181 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3182 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3183 zpos = -(dbox1[2] + dela[2] + 6.);
3184 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3185 zpos = dbox1[2] + dela[2] + 6.;
3186 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3192 // GOTO 6778 ! skip ITS layer no. 6
3194 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3195 // it with air or vacuum
3197 dbox2[0] = (0.0600+2.*0.0150)/2.;
3199 dbox2[2] = 94.13/2.;
3200 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3202 // --- Make the ghost volume invisible
3204 gMC->Gsatt("ISV2", "SEEN", 0);
3206 // --- Define a ghost volume containing the electronics and cooling of
3207 // a single ladder of layer #6 and fill it with air or vacuum
3209 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3212 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3214 // --- Make the ghost volume invisible
3216 gMC->Gsatt("SSV2", "SEEN", 0);
3218 // --- Define a ghost volume containing the end-ladder stuff of
3219 // a single ladder of layer #6 and fill it with air or vacuum
3224 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3226 // --- Make the ghost volume invisible
3228 gMC->Gsatt("ELL6", "SEEN", 0);
3230 // --- Define a volume containing the sensitive part of the strips
3231 // (silicon, layer #6)
3236 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3238 // --- Define a volume containing the electronics of the strips
3239 // (silicon, layer #6)
3244 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3246 // --- Define the cooling tubes (aluminum, layer #6)
3249 dtub[1] = dtub[0] + .01;
3251 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3253 // --- Define the cooling fluid (water or freon, layer #6)
3258 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3259 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3261 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3269 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3270 dfra[6] = dfra[5] + .03;
3274 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3276 // --- Define the element connecting the triangles of the heat bridge
3277 // (carbon, layer #6)
3282 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3284 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3287 dpla[0] = (10./(8.*7.))/2;
3290 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3292 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3294 dcop[0] = (2./(8.*7.))/2;
3297 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3299 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3301 depx[0] = (30./(8.*7.))/2.;
3304 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3306 // --- Define the part of the end-ladder stuff made of silicon (bus)
3309 dsil[0] = (20./(8.*7.))/2.;
3312 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3314 // --- Place the end-ladder stuff into its mother (ELL5)
3316 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3322 xpos = -dela[0] + dpla[0];
3323 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3327 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3328 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3332 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3333 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3335 // --- Silicon (bus)
3337 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3338 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3340 // --- Place the sensitive part of the strips into its mother (ISV2)
3343 for (j = 1; j <= 24; ++j) {
3344 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3345 else xpos = dbox2[0] - dits[0];
3346 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3347 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3350 // --- Place the electronics of the strips into its mother (SSV2)
3353 for (j = 1; j <= 24; ++j) {
3354 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3355 else xpos = -dsrv[0] + .28;
3356 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3357 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3360 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3362 xpos = -dsrv[0] + .41;
3365 // --- Left tube (just a matter of convention)
3368 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3369 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3371 // --- Right tube (just a matter of convention)
3374 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3375 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3377 // --- Place the heat bridge elements into their mother (SSV2)
3379 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3381 for (j = 1; j <= 25; ++j) {
3382 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3383 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3386 // --- Place the elements connecting the triangles of the heat bridge
3387 // into their mother (SSV2)
3391 // --- Left element (just a matter of convention)
3393 xpos = -dsrv[0] + .47;
3394 ypos = -(2.1+0.015);
3395 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3397 // --- Right element
3399 xpos = -dsrv[0] + .47;
3401 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3405 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3407 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3409 // --- Place the ghost volumes containing the strip ladders (ISV2),
3410 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3411 // their mother volume (IT56)
3413 offset1 = TMath::ATan2(.9, 41.2);
3415 rzero = dbox2[0] + 41.2;
3416 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3417 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3418 for (i = 1; i <= 36; ++i) {
3419 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3420 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3422 // --- Strip ladders
3424 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3425 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3427 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3429 // --- Electronics/cooling
3431 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3432 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3434 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");