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.11.4.2 2000/03/04 23:46:02 nilsen
19 Fixed up the comments/documentation.
21 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
22 This is the version of the files after the merging done in December 1999.
23 See the ReadMe110100.txt file for details
25 Revision 1.11 1999/10/22 08:25:25 fca
26 remove double definition of destructors
28 Revision 1.10 1999/10/22 08:16:49 fca
29 Correct destructors, thanks to I.Hrivnacova
31 Revision 1.9 1999/10/06 19:56:50 fca
34 Revision 1.8 1999/10/05 08:05:09 fca
35 Minor corrections for uninitialised variables.
37 Revision 1.7 1999/09/29 09:24:20 fca
38 Introduction of the Copyright and cvs Log
42 ///////////////////////////////////////////////////////////////////////////////
44 // Inner Traking System version 3
45 // This class contains the base procedures for the Inner Tracking System
47 // Authors: R. Barbera, A. Morsch.
51 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
52 // WORK with the geometry or module classes or any analysis classes. You are
53 // strongly encouraged to uses AliITSv5.
55 ///////////////////////////////////////////////////////////////////////////////
57 // See AliITSv3::StepManager().
58 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
59 //#define ALIITSPRINTGEOM 1 // print out geometry information
64 #include "AliITShit.h"
73 //_____________________________________________________________________________
74 AliITSv3::AliITSv3() {
75 ////////////////////////////////////////////////////////////////////////
76 // Standard default constructor for the ITS version 3.
77 ////////////////////////////////////////////////////////////////////////
79 fId3Name = new char*[fId3N];
88 //_____________________________________________________________________________
89 AliITSv3::~AliITSv3() {
90 ////////////////////////////////////////////////////////////////////////
91 // Standard destructor for the ITS version 3.
92 ////////////////////////////////////////////////////////////////////////
96 //_____________________________________________________________________________
97 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
98 ////////////////////////////////////////////////////////////////////////
99 // Standard constructor for the ITS version 3.
100 ////////////////////////////////////////////////////////////////////////
102 fId3Name = new char*[fId3N];
103 fId3Name[0] = "ITS1";
104 fId3Name[1] = "ITS2";
105 fId3Name[2] = "ITS3";
106 fId3Name[3] = "ITS4";
107 fId3Name[4] = "ITS5";
108 fId3Name[5] = "ITS6";
112 //_____________________________________________________________________________
113 void AliITSv3::CreateGeometry(){
114 ////////////////////////////////////////////////////////////////////////
115 // This routine creates and defines the version 3 geometry of the ITS.
116 ////////////////////////////////////////////////////////////////////////
118 const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
119 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
121 const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
122 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
124 const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
125 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
127 const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
128 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
130 const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
131 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
133 const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
134 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
136 const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
137 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
139 const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
140 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
142 const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
143 0.5,0.7,0.5,0.7,0.5,0.5 };
144 const Float_t rr = 4.064516;
145 const Float_t tteta = 63.00;
146 const Float_t pphi = -35.00;
147 const Float_t gteta = 87.78;
148 const Double_t degrad = kPI/180.;
149 const Double_t raddeg = 180./kPI;
150 const Double_t twopi = 2*kPI;
153 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
154 dfra[10], dcer[3], dkap[3], dpla[3],
155 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
156 atheta1011, dbus[3], dtub[3], dwat[3],
157 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
158 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
159 Double_t biga1, bigb1;
160 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
161 dtra1[3], dtra2[3], dtra3[3],
162 dtra4[3], dbox1[3], dbox2[3];
164 Float_t xtra1[6], ytra1[6], ztra1[6];
166 Float_t xpos1, ypos1;
168 Float_t angle, dcone[5], dtube[3], dpgon[10];
169 Float_t rzero, xzero, yzero;
170 Double_t coeffa, coeffb, coeffc;
172 Float_t atheta, offset;
173 Float_t offset1, offset2, dgh[15];
174 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
175 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
178 Double_t xcc1, ycc1, xcc2, ycc2;
180 const char natra[][5] ={ "TR01","TR02","TR03","TR04",
181 "TR05","TR06","TR07","TR08"};
182 const char natra1[][5] ={"TR11","TR12","TR13","TR14",
183 "TR15","TR16","TR17","TR18",
184 "TR19","TR20","TR21","TR22",
185 "TR23","TR24","TR25","TR26"};
186 const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
187 const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
188 const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
189 "TR57","TR58","TR59","TR60","TR61","TR62",
190 "TR63","TR64","TR65","TR66"};
192 Int_t *idtmed = fIdtmed->GetArray()-199;
194 // --- Define a ghost volume containing the whole ITS and fill it with air
212 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
214 // --- Place the ghost volume in its mother volume (ALIC) and make it
217 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
218 gMC->Gsatt("ITSV", "SEEN", 0);
220 //************************************************************************
225 //************************************************************************
227 // GOTO 2345 ! skip ITS layer no. 1 and 2
229 // --- Define a ghost volume containing the Silicon Pixel Detectors
230 // (layer #1 and #2) and fill it with air or vacuum
232 xxm = (49.999-3)/(70-25);
236 dgh[3] = -25.-(9.-3.01)/xxm;
245 dgh[12] = 25+(9-3.01)/xxm;
248 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
250 // --- Place the ghost volume in its mother volume (ITSV) and make it
253 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
254 gMC->Gsatt("IT12", "SEEN", 0);
256 // --- Define a ghost volume containing a single element of layer #1
257 // and fill it with air or vacuum
259 dbox1[0] = 0.005+0.01+0.0075;
262 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
264 //--Divide each element of layer #1 in three ladders along the beam direction
266 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
268 // --- Make the ghost volumes invisible
270 gMC->Gsatt("IPV1", "SEEN", 0);
271 gMC->Gsatt("IPB1", "SEEN", 0);
273 // --- Define a volume containing the chip of pixels (silicon, layer #1)
277 dchi[2] = dbox1[2] / 3.;
278 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
280 // --- Define a volume containing the bus of pixels (silicon, layer #1)
285 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
287 // --- Define a volume containing the sensitive part of pixels
288 // (silicon, layer #1)
293 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
295 // --- Place the chip into its mother (IPB1)
297 xpos = dbox1[0] - dchi[0];
300 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
302 // --- Place the sensitive volume into its mother (IPB1)
304 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
305 ypos = dchi[1] - dits[1];
306 zpos = -(dchi[2] - dits[2]);
307 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
309 // --- Place the bus into its mother (IPB1)
311 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
312 ypos = dchi[1] - dbus[1];
313 zpos = -(dchi[2] - dbus[2]);
314 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
316 // --- Define a ghost volume containing a single element of layer #2
317 // and fill it with air or vacuum
319 dbox2[0] = 0.005+0.01+0.0075;
322 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
324 //--Divide each element of layer #2 in four ladders along the beam direction
326 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
328 // --- Make the ghost volumes invisible
330 gMC->Gsatt("IPV2", "SEEN", 0);
331 gMC->Gsatt("IPB2", "SEEN", 0);
333 // --- Define a volume containing the chip of pixels (silicon, layer #2)
337 dchi[2] = dbox2[2] / 4.;
338 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
340 // --- Define a volume containing the bus of pixels (silicon, layer #2)
345 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
347 // --- Define a volume containing the sensitive part of pixels
348 // (silicon, layer #2)
353 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
355 // --- Place the chip into its mother (IPB2)
357 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
360 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
362 // --- Place the sensitive volume into its mother (IPB2)
364 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
365 ypos = -(dchi[1] - dits[1]);
366 zpos = -(dchi[2] - dits[2]);
367 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
369 // --- Place the bus into its mother (IPB2)
371 xpos = dbox1[0] - dbus[0];
372 ypos = -(dchi[1] - dbus[1]);
373 zpos = -(dchi[2] - dbus[2]);
374 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
376 // --- Define a generic segment of an element of the mechanical support
381 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
383 // --- Define a generic arc of an element of the mechanical support
388 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
390 // --- Define the mechanical supports of layers #1 and #2 and place the
391 // elements of the layers in it
394 // counter over the number of elements of layer #1 (
397 // counter over the number of elements of layer #2 (
398 for (i = 1; i <= 10; ++i) {
400 // --- Place part # 1-2 (see sketch)
402 // number of carbon fiber supports (see sketch)
405 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
406 (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
408 xcc = ( xx[0] + xx[1]) / 20.;
409 ycc = ( yy[0] + yy[1]) / 20.;
410 xccc = (xbeg[0] + xend[0]) / 20.;
411 yccc = (ybeg[0] + yend[0]) / 20.;
412 if (xx[0] == xx[1]) {
417 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
418 } // end if xx[0] == xx[1]
419 aphi = (pphi + (i-1) * 36.) * degrad;
420 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
421 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
422 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
423 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
424 xpos = xpos1 * TMath::Cos(gteta * degrad) +
425 ypos1 * TMath::Sin(gteta *degrad);
426 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
427 ypos1 * TMath::Cos(gteta * degrad);
429 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
430 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
431 atheta12 + 90., 0., 0.);
432 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
433 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
435 // --- Place part # 2-3 (see sketch)
439 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
440 (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
442 xcc = ( xx[1] + xx[2]) / 20.;
443 ycc = ( yy[1] + yy[2]) / 20.;
444 xccc = (xbeg[1] + xend[1]) / 20.;
445 yccc = (ybeg[1] + yend[1]) / 20.;
446 if (xx[1] == xx[2]) {
451 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
452 } // end if xx[1] == xx[2]
453 aphi = (pphi + (i-1) * 36.) * degrad;
454 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
455 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
456 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
457 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
458 xpos = xpos1 * TMath::Cos(gteta * degrad) +
459 ypos1 * TMath::Sin(gteta * degrad);
460 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
461 ypos1 * TMath::Cos(gteta * degrad);
463 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
464 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
465 atheta23 + 90., 0., 0.);
466 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
467 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
469 // --- Place an element of layer #2
471 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
472 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
473 coeffa = biga * biga + 1.;
474 coeffb = biga * bigb - biga * ycc - xcc;
475 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
476 bigb * bigb - 0.08964*0.08964;
477 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
479 ycc1 = biga * xcc1 + bigb;
481 bigb1 = xcc1 / biga + ycc1;
482 coeffa = biga1 * biga1 + 1.;
483 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
484 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
485 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
486 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
488 ycc2 = biga1 * xcc2 + bigb1;
489 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
490 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
491 xpos = xpos1 * TMath::Cos(gteta * degrad) +
492 ypos1 * TMath::Sin(gteta *degrad);
493 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
494 ypos1 * TMath::Cos(gteta * degrad);
497 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
498 idrotm[(i-1) * 13 + 1101], "ONLY");
500 // --- Place part # 3-4 (see sketch)
504 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
505 (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
507 xcc = (xx[1] + xx[2]) / 20.;
508 ycc = (yy[1] + yy[2]) / 20.;
509 xccc = (xbeg[2] + xend[2]) / 20.;
510 yccc = (ybeg[2] + yend[2]) / 20.;
511 if (xx[2] == xx[3]) {
516 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
517 } // end if xx[2] == xx[3]
518 aphi = (pphi + (i-1) * 36.) * degrad;
519 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
520 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
521 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
522 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
523 xpos = xpos1 * TMath::Cos(gteta * degrad) +
524 ypos1 * TMath::Sin(gteta *degrad);
525 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
526 ypos1 * TMath::Cos(gteta * degrad);
528 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
529 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
530 atheta34 + 90., 0., 0.);
531 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
532 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
534 // --- Place part # 4-5 (see sketch)
538 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
539 (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
541 xcc = ( xx[3] + xx[4]) / 20.;
542 ycc = ( yy[3] + yy[4]) / 20.;
543 xccc = (xbeg[3] + xend[3]) / 20.;
544 yccc = (ybeg[3] + yend[3]) / 20.;
545 if (xx[3] == xx[4]) {
550 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
551 } // end if xx[3] == xx[4]
552 aphi = (pphi + (i-1) * 36.) * degrad;
553 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
554 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
555 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
556 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
557 xpos = xpos1 * TMath::Cos(gteta * degrad) +
558 ypos1 * TMath::Sin(gteta *degrad);
559 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
560 ypos1 * TMath::Cos(gteta * degrad);
562 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
563 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
564 atheta45 + 90., 0., 0.);
565 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
566 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
568 // --- Place an element of layer #2
570 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
571 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
572 coeffa = biga * biga + 1.;
573 coeffb = biga * bigb - biga * ycc - xcc;
574 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
575 bigb * bigb - .014285030400000001;
576 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
578 ycc1 = biga * xcc1 + bigb;
580 bigb1 = xcc1 / biga + ycc1;
581 coeffa = biga1 * biga1 + 1.;
582 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
583 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
584 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
585 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
587 ycc2 = biga1 * xcc2 + bigb1;
588 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
589 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
590 xpos = xpos1 * TMath::Cos(gteta * degrad) +
591 ypos1 * TMath::Sin(gteta *degrad);
592 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
593 ypos1 * TMath::Cos(gteta * degrad);
596 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
597 idrotm[(i-1) * 13 + 1103], "ONLY");
599 // --- Place part # 5-6 (see sketch)
603 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
604 (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
606 xcc = (xx[4] + xx[5]) / 20.;
607 ycc = (yy[4] + yy[5]) / 20.;
608 xccc = (xbeg[4] + xend[4]) / 20.;
609 yccc = (ybeg[4] + yend[4]) / 20.;
610 if (xx[4] == xx[5]) {
615 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
617 aphi = (pphi + (i-1) * 36.) * degrad;
618 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
619 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
620 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
621 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
622 xpos = xpos1 * TMath::Cos(gteta * degrad) +
623 ypos1 * TMath::Sin(gteta *degrad);
624 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
625 ypos1 * TMath::Cos(gteta * degrad);
627 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
628 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
629 atheta56 + 90., 0., 0.);
630 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
631 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
633 // --- Place part # 6-7 (see sketch)
637 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
638 (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
640 xcc = (xx[5] + xx[6]) / 20.;
641 ycc = (yy[5] + yy[6]) / 20.;
642 xccc = (xbeg[5] + xend[5]) / 20.;
643 yccc = (ybeg[5] + yend[5]) / 20.;
644 if (xx[5] == xx[6]) {
649 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
650 } // end if xx[5] == xx[6]
651 aphi = (pphi + (i-1) * 36.) * degrad;
652 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
653 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
654 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
655 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
656 xpos = xpos1 * TMath::Cos(gteta * degrad) +
657 ypos1 * TMath::Sin(gteta *degrad);
658 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
659 ypos1 * TMath::Cos(gteta * degrad);
661 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
662 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
663 atheta67 + 90., 0., 0.);
664 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
665 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
667 // --- Place an element of layer #2
669 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
670 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
671 coeffa = biga * biga + 1.;
672 coeffb = biga * bigb - biga * ycc - xcc;
673 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
674 bigb * bigb - .014285030400000001;
675 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
677 ycc1 = biga * xcc1 + bigb;
679 bigb1 = xcc1 / biga + ycc1;
680 coeffa = biga1 * biga1 + 1.;
681 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
682 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
683 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
684 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
686 ycc2 = biga1 * xcc2 + bigb1;
687 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
688 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
689 xpos = xpos1 * TMath::Cos(gteta * degrad) +
690 ypos1 * TMath::Sin(gteta *degrad);
691 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
692 ypos1 * TMath::Cos(gteta * degrad);
695 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
696 idrotm[(i-1) * 13 + 1105], "ONLY");
698 // --- Place part # 7-8 (see sketch)
702 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
703 (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
705 xcc = (xx[6] + xx[7]) / 20.;
706 ycc = (yy[6] + yy[7]) / 20.;
707 xccc = (xbeg[6] + xend[6]) / 20.;
708 yccc = (ybeg[6] + yend[6]) / 20.;
709 if (xx[6] == xx[7]) {
714 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
716 aphi = (pphi + (i-1) * 36.) * degrad;
717 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
718 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
719 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
720 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
721 xpos = xpos1 * TMath::Cos(gteta * degrad) +
722 ypos1 * TMath::Sin(gteta *degrad);
723 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
724 ypos1 * TMath::Cos(gteta * degrad);
726 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
727 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
728 atheta78 + 90., 0., 0.);
729 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
730 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
732 // --- Place part # 8-9 (see sketch)
736 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
737 (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
739 xcc = (xx[7] + xx[8]) / 20.;
740 ycc = (yy[7] + yy[8]) / 20.;
741 xccc = (xbeg[7] + xend[7]) / 20.;
742 yccc = (ybeg[7] + yend[7]) / 20.;
743 if (xx[1] == xx[2]) {
748 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
750 aphi = (pphi + (i-1) * 36.) * degrad;
751 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
752 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
753 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
754 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
755 xpos = xpos1 * TMath::Cos(gteta * degrad) +
756 ypos1 * TMath::Sin(gteta *degrad);
757 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
758 ypos1 * TMath::Cos(gteta * degrad);
760 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
761 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
762 atheta89 + 90., 0., 0.);
763 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
764 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
766 // --- Place an element of layer #2
768 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
769 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
770 coeffa = biga * biga + 1.;
771 coeffb = biga * bigb - biga * ycc - xcc;
772 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
773 bigb * bigb - .014285030400000001;
774 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
776 ycc1 = biga * xcc1 + bigb;
778 bigb1 = xcc1 / biga + ycc1;
779 coeffa = biga1 * biga1 + 1.;
780 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
781 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
782 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
783 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
785 ycc2 = biga1 * xcc2 + bigb1;
786 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
787 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
788 xpos = xpos1 * TMath::Cos(gteta * degrad) +
789 ypos1 * TMath::Sin(gteta *degrad);
790 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
791 ypos1 * TMath::Cos(gteta * degrad);
794 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
795 idrotm[(i-1) * 13 + 1107], "ONLY");
797 // --- Place part # 9-10 (see sketch)
801 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
802 (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
804 xcc = (xx[8] + xx[9]) / 20.;
805 ycc = (yy[8] + yy[9]) / 20.;
806 xccc = (xbeg[8] + xend[8]) / 20.;
807 yccc = (ybeg[8] + yend[8]) / 20.;
808 if (xx[8] == xx[9]) {
813 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
815 aphi = (pphi + (i-1) * 36.) * degrad;
816 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
817 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
818 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
819 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
820 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
821 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
823 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
824 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
825 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
827 // --- Place part # 10-11 (see sketch)
831 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
833 xcc = (xx[9] + xx[10]) / 20.;
834 ycc = (yy[9] + yy[10]) / 20.;
835 xccc = (xbeg[9] + xend[9]) / 20.;
836 yccc = (ybeg[9] + yend[9]) / 20.;
837 if (xx[9] == xx[10]) {
842 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
844 aphi = (pphi + (i-1) * 36.) * degrad;
845 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
846 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
847 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
848 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
849 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
850 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
852 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
853 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
854 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
856 // --- Place part # 13-14 (see sketch)
860 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
862 xcc = (xx[12] + xx[13]) / 20.;
863 ycc = (yy[12] + yy[13]) / 20.;
864 xccc = (xbeg[12] + xend[12]) / 20.;
865 yccc = (ybeg[12] + yend[12]) / 20.;
866 if (xx[12] == xx[13]) {
869 r1 = yy[12] - yy[13];
870 r2 = xx[12] - xx[13];
871 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
873 aphi = (pphi + (i-1) * 36.) * degrad;
874 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
875 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
876 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
877 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
878 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
879 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
881 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
882 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
883 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
885 // --- Place an element of layer #1
887 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
888 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
889 coeffa = biga * biga + 1.;
890 coeffb = biga * bigb - biga * ycc - xcc;
891 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
892 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
893 ycc1 = biga * xcc1 + bigb;
895 bigb1 = xcc1 / biga + ycc1;
896 coeffa = biga1 * biga1 + 1.;
897 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
898 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
899 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
900 ycc2 = biga1 * xcc2 + bigb1;
901 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
902 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
903 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
904 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
907 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
909 // --- Place part # 12-13 (see sketch)
913 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
915 xcc = (xx[11] + xx[12]) / 20.;
916 ycc = (yy[11] + yy[12]) / 20.;
917 xccc = (xbeg[11] + xend[11]) / 20.;
918 yccc = (ybeg[11] + yend[11]) / 20.;
919 if (xx[11] == xx[12]) {
922 r1 = yy[12] - yy[11];
923 r2 = xx[12] - xx[11];
924 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
926 aphi = (pphi + (i-1) * 36.) * degrad;
927 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
928 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
929 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
930 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
931 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
932 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
934 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
935 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
936 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
938 // --- Place part # 11-12 (see sketch)
942 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
944 xcc = (xx[10] + xx[11]) / 20.;
945 ycc = (yy[10] + yy[11]) / 20.;
946 xccc = (xbeg[10] + xend[10]) / 20.;
947 yccc = (ybeg[10] + yend[10]) / 20.;
948 if (xx[10] == xx[11]) {
951 r1 = yy[11] - yy[10];
952 r2 = xx[11] - xx[10];
953 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
955 aphi = (pphi + (i-1) * 36.) * degrad;
956 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
957 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
958 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
959 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
960 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
961 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
963 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
964 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
965 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
967 // --- Place an element of layer #1
969 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
970 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
971 coeffa = biga * biga + 1.;
972 coeffb = biga * bigb - biga * ycc - xcc;
973 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
974 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
975 ycc1 = biga * xcc1 + bigb;
977 bigb1 = xcc1 / biga + ycc1;
978 coeffa = biga1 * biga1 + 1.;
979 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
980 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
981 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
982 ycc2 = biga1 * xcc2 + bigb1;
983 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
984 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
985 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
986 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
989 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
991 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
993 darc[0] = rarc[12] / 10. - .02;
994 darc[1] = rarc[12] / 10.;
996 darc[3] = atheta12 - (i-1) * 36.;
997 darc[4] = atheta23 - (i-1) * 36.;
998 xcc = xarc[12] / 10.;
999 ycc = yarc[12] / 10.;
1000 aphi = (pphi + (i-1) * 36.) * degrad;
1001 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1002 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1003 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1004 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1005 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1006 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1008 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1010 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1012 darc[0] = rarc[11] / 10. - .02;
1013 darc[1] = rarc[11] / 10.;
1015 darc[3] = atheta23 + 90. - (i-1) * 36.;
1016 darc[4] = atheta34 + 90. - (i-1) * 36.;
1017 xcc = xarc[11] / 10.;
1018 ycc = yarc[11] / 10.;
1019 aphi = (pphi + (i-1) * 36.) * degrad;
1020 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1021 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1022 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1023 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1024 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1025 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1027 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1029 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1031 darc[0] = rarc[10] / 10. - .02;
1032 darc[1] = rarc[10] / 10.;
1034 darc[3] = atheta45 + 180. - (i-1) * 36.;
1035 darc[4] = atheta34 + 180. - (i-1) * 36.;
1036 xcc = xarc[10] / 10.;
1037 ycc = yarc[10] / 10.;
1038 aphi = (pphi + (i-1) * 36.) * degrad;
1039 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1040 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1041 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1042 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1043 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1044 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1046 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1048 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1050 darc[0] = rarc[9] / 10. - .02;
1051 darc[1] = rarc[9] / 10.;
1053 darc[3] = atheta45 - 90. - (i-1) * 36.;
1054 darc[4] = atheta56 - 90. - (i-1) * 36.;
1055 xcc = xarc[9] / 10.;
1056 ycc = yarc[9] / 10.;
1057 aphi = (pphi + (i-1) * 36.) * degrad;
1058 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1059 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1060 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1061 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1062 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1063 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1065 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1067 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1069 darc[0] = rarc[8] / 10. - .02;
1070 darc[1] = rarc[8] / 10.;
1072 darc[3] = atheta67 + 45. - (i-1) * 36.;
1073 darc[4] = atheta56 + 45. - (i-1) * 36.;
1074 xcc = xarc[8] / 10.;
1075 ycc = yarc[8] / 10.;
1076 aphi = (pphi + (i-1) * 36.) * degrad;
1077 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1078 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1079 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1080 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1081 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1082 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1084 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1086 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1088 darc[0] = rarc[7] / 10. - .02;
1089 darc[1] = rarc[7] / 10.;
1091 darc[3] = atheta67 - (i-1) * 36.;
1092 darc[4] = atheta78 - (i-1) * 36.;
1093 xcc = xarc[7] / 10.;
1094 ycc = yarc[7] / 10.;
1095 aphi = (pphi + (i-1) * 36.) * degrad;
1096 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1097 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1098 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1099 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1100 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1101 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1103 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1105 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1107 darc[0] = rarc[6] / 10. - .02;
1108 darc[1] = rarc[6] / 10.;
1110 darc[3] = atheta89 + 45. - (i-1) * 36.;
1111 darc[4] = atheta78 + 45. - (i-1) * 36.;
1112 xcc = xarc[6] / 10.;
1113 ycc = yarc[6] / 10.;
1114 aphi = (pphi + (i-1) * 36.) * degrad;
1115 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1116 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1117 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1118 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1119 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1120 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1122 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1124 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1126 darc[0] = rarc[5] / 10. - .02;
1127 darc[1] = rarc[5] / 10.;
1129 darc[3] = atheta89 + 45. - (i-1) * 36.;
1130 darc[4] = atheta910 + 45. - (i-1) * 36.;
1131 xcc = xarc[5] / 10.;
1132 ycc = yarc[5] / 10.;
1133 aphi = (pphi + (i-1) * 36.) * degrad;
1134 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1135 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1136 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1137 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1138 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1139 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1141 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1143 // --- Place arc # 5 (between part 9-10 and part 10-11)
1146 darc[0] = rarc[4] / 10. - .02;
1147 darc[1] = rarc[4] / 10.;
1149 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1150 darc[4] = atheta910 + 45. - (i-1) * 36.;
1151 xcc = xarc[4] / 10.;
1152 ycc = yarc[4] / 10.;
1153 aphi = (pphi + (i-1) * 36.) * degrad;
1154 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1155 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1156 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1157 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1158 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1159 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1161 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1163 // --- Place arc # 4 (between part 10-11 and part 11-12)
1166 darc[0] = rarc[3] / 10. - .02;
1167 darc[1] = rarc[3] / 10.;
1169 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1170 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1171 xcc = xarc[3] / 10.;
1172 ycc = yarc[3] / 10.;
1173 aphi = (pphi + (i-1) * 36.) * degrad;
1174 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1175 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1176 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1177 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1178 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1179 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1181 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1183 // --- Place arc # 3 (between part 11-12 and part 12-13)
1186 darc[0] = rarc[2] / 10. - .02;
1187 darc[1] = rarc[2] / 10.;
1189 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1190 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1191 xcc = xarc[2] / 10.;
1192 ycc = yarc[2] / 10.;
1193 aphi = (pphi + (i-1) * 36.) * degrad;
1194 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1195 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1196 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1197 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1198 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1199 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1201 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1203 // --- Place arc # 2 (between part 12-13 and part 13-14)
1206 darc[0] = rarc[1] / 10. - .02;
1207 darc[1] = rarc[1] / 10.;
1209 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1210 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1211 xcc = xarc[1] / 10.;
1212 ycc = yarc[1] / 10.;
1213 aphi = (pphi + (i-1) * 36.) * degrad;
1214 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1215 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1216 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1217 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1218 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1219 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1221 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1223 // --- Place arc # 1 (between part 13-14 and part 1-2)
1226 darc[0] = rarc[0] / 10. - .02;
1227 darc[1] = rarc[0] / 10.;
1229 darc[3] = atheta12 + 45. - (i-1) * 36.;
1230 darc[4] = atheta1314 - (i-1) * 36.;
1231 xcc = xarc[0] / 10.;
1232 ycc = yarc[0] / 10.;
1233 aphi = (pphi + (i-1) * 36.) * degrad;
1234 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1235 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1236 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1237 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1238 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1239 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1241 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1244 //************************************************************************
1249 //************************************************************************
1251 // --- Define a ghost volume containing the Silicon Drift Detectors
1252 // (layer #3 and #4) and fill it with air or vacuum
1254 xxm = (49.999-3.)/(70.-25.);
1258 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1261 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1264 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1267 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1270 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1272 // --- Place the ghost volume in its mother volume (ITSV) and make it
1275 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1276 gMC->Gsatt("IT34", "SEEN", 0);
1280 // GOTO 3456 ! skip ITS layer no. 3
1282 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1283 // smaller lenght of ribs) and fill it with air or vacuum
1285 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1287 // the widest element is the sensitive element
1288 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1289 // 7.5 cm is the lenght
1290 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1292 // --- Make the ghost volume invisible
1294 gMC->Gsatt("IDV1", "SEEN", 0);
1296 // --- Define a volume containing the sensitive part of drifts
1297 // (silicon, layer #3)
1300 // see material budget report by G. Feofilov
1303 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1305 //--- Define the part of the (smaller) rib between two sensitive parts made of
1306 // carbon (layer #3)
1308 dsup[0] = .5 - dits[0];
1310 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1311 // 7.5 cm is the lenght
1312 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1314 //--- Define the first part of the (smaller) rib between two sensitive parts
1315 // made of aluminum (layer #3)
1317 dal1[0] = .5 - dits[0];
1318 dal1[1] = 0.00096/2.;
1319 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1320 // 7.5 cm is the lenght
1321 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1323 //--- Define the part of the (smaller) rib between two sensitive parts made of
1324 // kapton (layer #3)
1326 dkap[0] = .5 - dits[0];
1328 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1329 // 7.5 cm is the lenght
1330 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1332 //--- Define the second part of the (smaller) rib between two sensitive parts
1333 // made of aluminum (layer #3)
1335 dal2[0] = .5 - dits[0];
1336 dal2[1] = 0.0027/2.;
1337 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1338 // 7.5 cm is the lenght
1339 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1341 // --- Define the part of the (smaller) rib between two sensitive parts
1342 // made of silicon (the electronics) (layer #3)
1344 dchi[0] = .5 - dits[0];
1345 dchi[1] = 0.0071/2.;
1346 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1347 // 7.5 cm is the lenght
1348 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1350 // --- Define the part of the (smaller) rib between two sensitive parts
1351 // made of water (the cooler) (layer #3)
1353 dwat[0] = .5 - dits[0];
1354 dwat[1] = 0.0093/2.;
1355 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1356 // 7.5 cm is the lenght
1357 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1359 //--- Define the third part of the (smaller) rib between two sensitive parts
1360 // made of aluminum (the cooling tubes) (layer #3)
1362 dtub[0] = .5 - dits[0];
1363 dtub[1] = 0.00134/2.;
1364 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1365 // 7.5 cm is the lenght
1366 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1368 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1371 // twice the foreseen thickness
1374 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1376 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1379 // twice the foreseen thickness
1382 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1384 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1387 // twice the foreseen thickness
1390 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1392 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1395 // twice the foreseen thickness
1398 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1400 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1404 for (j = 1; j <= 5; ++j) {
1405 // odd elements are up and even elements are down
1407 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1408 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1409 } else if (j == 2) {
1410 xpos = -dbox1[0] + dits[0];
1411 zpos = 0. - dits[2] + 1. - dits[2];
1412 } else if (j == 3) {
1413 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1415 } else if (j == 4) {
1416 xpos = -dbox1[0] + dits[0];
1417 zpos = dits[2] + 0. - 1. + dits[2];
1418 } else if (j == 5) {
1419 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1420 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1422 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1425 // --- Place the smaller ribs into their mother (IDV1)
1427 // --- Right ribs (just a matter of convention)
1429 xpos = .5 - dbox1[0] + dits[0];
1435 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1439 ypos = dsup[1] + 2.81 + dal1[1];
1440 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1444 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1445 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1449 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1450 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1452 // --- Silicon (chip)
1454 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1455 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1459 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1460 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1464 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1466 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1468 // --- Right ribs (just a matter of convention)
1473 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1477 ypos = -(dsup[1] + 2.81 + dal1[1]);
1478 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1482 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1483 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1487 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1488 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1490 // --- Silicon (chip)
1492 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1493 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1497 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1498 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1502 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1503 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1504 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1506 // --- Place the end-ladder stuff into its mother (IDV1)
1509 // --- Negative-Z end-ladder
1512 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1516 xpos = dbox1[0] - dpcb[0];
1517 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1521 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1522 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1526 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1527 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1529 // --- Silicon (bus)
1531 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1532 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1534 // --- Positive-Z end-ladder
1537 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1541 xpos = dbox1[0] - dpcb[0];
1542 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1546 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1547 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1551 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1552 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1554 // --- Silicon (bus)
1556 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1557 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1559 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1560 // larger lenght of ribs) and fill it with air or vacuum
1562 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1564 // the widest element is the sensitive element
1565 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1566 // 7.5 cm is the lenght
1567 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1569 // --- Make the ghost volume invisible
1571 gMC->Gsatt("IDV2", "SEEN", 0);
1573 //--- Define the part of the (larger) rib between two sensitive parts madeof
1574 // carbon (layer #3)
1576 dsup[0] = .65 - dits[0];
1578 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1579 // 7.5 cm is the lenght
1580 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1582 //--- Define the first part of the (larger) rib between two sensitive parts
1583 // made of aluminum (layer #3)
1585 dal1[0] = .65 - dits[0];
1586 dal1[1] = 0.00096/2.;
1587 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1588 // 7.5 cm is the lenght
1589 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1591 //--- Define the part of the (larger) rib between two sensitive parts madeof
1592 // kapton (layer #3)
1594 dkap[0] = .65 - dits[0];
1595 dkap[1] = 0.0317/2.;
1596 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1597 // 7.5 cm is the lenght
1598 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1600 //--- Define the second part of the (larger) rib between two sensitive parts
1601 // made of aluminum (layer #3)
1603 dal2[0] = .65 - dits[0];
1604 dal2[1] = 0.0027/2.;
1605 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1606 // 7.5 cm is the lenght
1607 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1609 // --- Define the part of the (larger) rib between two sensitive parts
1610 // made of silicon (the electronics) (layer #3)
1612 dchi[0] = .65 - dits[0];
1613 dchi[1] = 0.0071/2.;
1614 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1615 // 7.5 cm is the lenght
1616 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1618 // --- Define the part of the (larger) rib between two sensitive parts
1619 // made of water (the cooler) (layer #3)
1621 dwat[0] = .65 - dits[0];
1622 dwat[1] = 0.0093/2.;
1623 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1624 // 7.5 cm is the lenght
1625 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1627 //--- Define the third part of the (larger) rib between two sensitive parts
1628 // made of aluminum (the cooling tubes) (layer #3)
1630 dtub[0] = .65 - dits[0];
1631 dtub[1] = 0.00134/2.;
1632 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1633 // 7.5 cm is the lenght
1634 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1636 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1640 for (j = 1; j <= 5; ++j) {
1641 // odd element are up and even elements are down
1643 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1644 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1645 } else if (j == 2) {
1646 xpos = -dbox2[0] + dits[0];
1647 zpos = 0. - dits[2] + 1. - dits[2];
1648 } else if (j == 3) {
1649 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1651 } else if (j == 4) {
1652 xpos = -dbox2[0] + dits[0];
1653 zpos = dits[2] + 0. - 1. + dits[2];
1654 } else if (j == 5) {
1655 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1656 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1658 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1661 // --- Place the larger ribs into their mother (IDV2)
1664 // --- Right ribs (just a matter of convention)
1666 xpos = .65 - dbox2[0] + dits[0];
1672 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1676 ypos = dsup[1] + 2.81 + dal1[1];
1677 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1681 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1682 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1686 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1687 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1689 // --- Silicon (chip)
1691 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1692 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1696 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1697 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1701 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1702 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1704 // --- Right ribs (just a matter of convention)
1709 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1713 ypos = -(dsup[1] + 2.81 + dal1[1]);
1714 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1718 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1719 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1723 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1724 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1726 // --- Silicon (chip)
1728 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1729 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1733 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1734 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1738 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1739 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1741 // --- Place the end-ladder stuff into its mother (IDV1)
1744 // --- Negative-Z end-ladder
1747 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1751 xpos = dbox2[0] - dpcb[0];
1752 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1756 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1757 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1761 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1762 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1764 // --- Silicon (bus)
1766 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1767 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1769 // --- Positive-Z end-ladder
1772 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1776 xpos = dbox2[0] - dpcb[0];
1777 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1781 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1782 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1786 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1787 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1789 // --- Silicon (bus)
1791 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1792 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1794 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1795 // mother volume (IT34)
1796 // Odd elements have large ribs and even elements have small ribs
1798 for (i = 1; i <= 12; ++i) {
1799 atheta = (i-1) * 30.;
1800 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1803 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1804 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1806 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1809 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1810 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1812 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1819 // GOTO 4567 ! skip ITS layer no. 4
1821 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1822 // smaller lenght of ribs) and fill it with air or vacuum
1824 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1826 // the widest element is the end-ladder stuff
1827 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1828 // 7.5 cm is the lenght
1829 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1831 // --- Make the ghost volume invisible
1833 gMC->Gsatt("IDV3", "SEEN", 0);
1835 // --- Define a volume containing the sensitive part of drifts
1836 // (silicon, layer #4)
1839 // see material budget report by G. Feofilov
1842 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1844 //--- Define the part of the (smaller) rib between two sensitive parts made of
1845 // carbon (layer #4)
1847 dsup[0] = .5 - dits[0];
1849 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1850 // 7.5 cm is the lengh
1851 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1853 //--- Define the first part of the (smaller) rib between two sensitive parts
1854 // made of aluminum (layer #4)
1856 dal1[0] = .5 - dits[0];
1857 dal1[1] = 0.00096/2.;
1858 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1859 // 7.5 cm is the lengh
1860 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1862 //--- Define the part of the (smaller) rib between two sensitive parts made of
1863 // kapton (layer #4)
1865 dkap[0] = .5 - dits[0];
1866 dkap[1] = 0.0317/2.;
1867 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1868 // 7.5 cm is the lengh
1869 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1871 //--- Define the second part of the (smaller) rib between two sensitive parts
1872 // made of aluminum (layer #4)
1874 dal2[0] = .5 - dits[0];
1875 dal2[1] = 0.0027/2.;
1876 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1877 // 7.5 cm is the lengh
1878 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1880 // --- Define the part of the (smaller) rib between two sensitive parts
1881 // made of silicon (the electronics) (layer #4)
1883 dchi[0] = .5 - dits[0];
1884 dchi[1] = 0.0071/2.;
1885 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1886 // 7.5 cm is the lengh
1887 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1889 // --- Define the part of the (smaller) rib between two sensitive parts
1890 // made of water (the cooler) (layer #4)
1892 dwat[0] = .5 - dits[0];
1893 dwat[1] = 0.0093/2.;
1894 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1895 // 7.5 cm is the lenght
1896 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1898 //--- Define the third part of the (smaller) rib between two sensitive parts
1899 // made of aluminum (the cooling tubes) (layer #4)
1901 dtub[0] = .5 - dits[0];
1902 dtub[1] = 0.00134/2.;
1903 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1904 // 7.5 cm is the lengh
1905 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1907 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1910 // twice the foreseen thickness
1913 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1915 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1918 // twice the foreseen thickness
1921 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1923 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1926 // twice the foreseen thickness
1929 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1931 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1934 // twice the foreseen thickness
1937 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1939 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1943 for (j = 1; j <= 7; ++j) {
1944 // odd elements are down and even elements are up
1946 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1947 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1948 } else if (j == 2) {
1949 xpos = -dbox1[0] + dits[0];
1950 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1951 } else if (j == 3) {
1952 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1953 zpos = 0. - dits[2] + .7 - dits[2];
1954 } else if (j == 4) {
1955 xpos = -dbox1[0] + dits[0];
1957 } else if (j == 5) {
1958 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1959 zpos = dits[2] + 0. - .7 + dits[2];
1960 } else if (j == 6) {
1961 xpos = -dbox1[0] + dits[0];
1962 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1963 } else if (j == 7) {
1964 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1965 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1967 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1970 // --- Place the smaller ribs into their mother (IDV3)
1972 // --- Right ribs (just a matter of convention)
1974 xpos = .5 - dbox1[0] + dits[0];
1980 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1984 ypos = dsup[1] + 2.81 + dal1[1];
1985 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1989 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1990 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1994 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1995 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1997 // --- Silicon (chip)
1999 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2000 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2004 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2005 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2009 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2011 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2013 // --- Right ribs (just a matter of convention)
2018 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2022 ypos = -(dsup[1] + 2.81 + dal1[1]);
2023 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2027 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2028 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2032 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2034 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2036 // --- Silicon (chip)
2038 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2039 2. + dal2[1] * 2. + dchi[1]);
2040 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2044 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2045 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2046 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2050 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2051 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2053 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2055 // --- Place the end-ladder stuff into its mother (IDV1)
2058 // --- Negative-Z end-ladder
2061 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2065 xpos = dbox1[0] - dpcb[0];
2066 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2070 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2071 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2075 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2076 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2078 // --- Silicon (bus)
2080 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2081 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2083 // --- Positive-Z end-ladder
2086 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2090 xpos = dbox1[0] - dpcb[0];
2091 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2095 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2096 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2100 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2101 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2103 // --- Silicon (bus)
2105 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2106 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2108 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2109 // larger lenght of ribs) and fill it with air or vacuum
2111 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2113 // the widest element is the end-ladder stuff
2114 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2115 // 7.5 cm is the lenght
2116 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2118 // --- Make the ghost volume invisible
2120 gMC->Gsatt("IDV4", "SEEN", 0);
2122 //--- Define the part of the (larger) rib between two sensitive parts madeof
2123 // carbon (layer #4)
2125 dsup[0] = .65 - dits[0];
2127 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2128 // 7.5 cm is the lengh
2129 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2131 //--- Define the first part of the (larger) rib between two sensitive parts
2132 // made of aluminum (layer #4)
2134 dal1[0] = .65 - dits[0];
2135 dal1[1] = 0.00096/2.;
2136 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2137 // 7.5 cm is the lengh
2138 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2140 //--- Define the part of the (larger) rib between two sensitive parts madeof
2141 // kapton (layer #4)
2143 dkap[0] = .65 - dits[0];
2144 dkap[1] = 0.0317/2.;
2145 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2146 // 7.5 cm is the lengh
2147 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2149 //--- Define the second part of the (larger) rib between two sensitive parts
2150 // made of aluminum (layer #4)
2152 dal2[0] = .65 - dits[0];
2153 dal2[1] = 0.0027/2.;
2154 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2155 // 7.5 cm is the lengh
2156 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2158 // --- Define the part of the (larger) rib between two sensitive parts
2159 // made of silicon (the electronics) (layer #4)
2161 dchi[0] = .65 - dits[0];
2162 dchi[1] = 0.0071/2.;
2163 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2164 // 7.5 cm is the lengh
2165 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2167 // --- Define the part of the (larger) rib between two sensitive parts
2168 // made of water (the cooler) (layer #4)
2170 dwat[0] = .65 - dits[0];
2171 dwat[1] = 0.0093/2.;
2172 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2173 // 7.5 cm is the lengh
2174 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2176 //--- Define the third part of the (larger) rib between two sensitive parts
2177 // made of aluminum (the cooling tubes) (layer #4)
2179 dtub[0] = .65 - dits[0];
2180 dtub[1] = 0.00134/2.;
2181 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2182 // 7.5 cm is the lengh
2183 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2185 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2189 for (j = 1; j <= 7; ++j) {
2190 // odd elements are down and even elements are up
2192 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2193 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2194 } else if (j == 2) {
2195 xpos = -dbox2[0] + dits[0];
2196 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2197 } else if (j == 3) {
2198 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2199 zpos = 0. - dits[2] + .7 - dits[2];
2200 } else if (j == 4) {
2201 xpos = -dbox2[0] + dits[0];
2203 } else if (j == 5) {
2204 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2205 zpos = dits[2] + 0. - .7 + dits[2];
2206 } else if (j == 6) {
2207 xpos = -dbox2[0] + dits[0];
2208 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2209 } else if (j == 7) {
2210 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2211 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2213 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2216 // --- Place the larger ribs into their mother (IDV4)
2219 // --- Right ribs (just a matter of convention)
2221 xpos = .65 - dbox2[0] + dits[0];
2227 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2231 ypos = dsup[1] + 2.81 + dal1[1];
2232 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2236 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2237 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2241 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2242 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2244 // --- Silicon (chip)
2246 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2247 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2251 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2252 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2256 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2258 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2260 // --- Right ribs (just a matter of convention)
2265 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2269 ypos = -(dsup[1] + 2.81 + dal1[1]);
2270 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2274 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2275 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2279 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2281 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2283 // --- Silicon (chip)
2285 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2286 2. + dal2[1] * 2. + dchi[1]);
2287 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2291 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2292 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2293 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2297 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2298 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2299 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2301 // --- Place the end-ladder stuff into its mother (IDV1)
2304 // --- Negative-Z end-ladder
2307 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2311 xpos = dbox2[0] - dpcb[0];
2312 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2316 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2317 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2321 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2322 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2324 // --- Silicon (bus)
2326 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2327 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2329 // --- Positive-Z end-ladder
2332 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2336 xpos = dbox2[0] - dpcb[0];
2337 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2341 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2342 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2346 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2347 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2349 // --- Silicon (bus)
2351 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2352 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2354 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2355 // mother volume (IT34)
2356 // Odd elements have large ribs and even elements have small ribs
2358 for (i = 1; i <= 24; ++i) {
2359 atheta = (i-1) * 15.;
2360 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2363 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2364 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2366 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2368 rzero = (24.0+22.8)/2.;
2369 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2370 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2372 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2376 //************************************************************************
2381 //************************************************************************
2383 // --- Define SSD with the 35+39 lay-out
2385 if (fMinorVersionV3 < 3) {
2387 //--- Define ghost volume containing the Strip Detectors and fill it with air
2390 xxm = (49.999-3.)/(70.-25.);
2394 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2395 (37.-27)/xxm-(49.998-37.)/xxm;
2398 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2402 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2406 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2407 (37.-27)/xxm+(49.998-37.)/xxm;
2410 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2411 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2412 gMC->Gsatt("IT56", "SEEN", 0);
2416 // GOTO 5678 ! skip ITS layer no. 5
2418 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2419 // it with air or vacuum
2421 dbox1[0] = (0.0600+2.*0.0150)/2.;
2423 dbox1[2] = 90.22/2.;
2424 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2426 // --- Make the ghost volume invisible
2428 gMC->Gsatt("ISV1", "SEEN", 0);
2430 // --- Define a ghost volume containing the electronics and cooling of
2431 // a single ladder of layer #5 and fill it with air or vacuum
2433 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2436 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2438 // --- Make the ghost volume invisible
2440 gMC->Gsatt("SSV1", "SEEN", 0);
2442 // --- Define a ghost volume containing the end-ladder stuff of
2443 // a single ladder of layer #5 and fill it with air or vacuum
2448 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2450 // --- Make the ghost volume invisible
2452 gMC->Gsatt("ELL5", "SEEN", 0);
2454 // --- Define a volume containing the sensitive part of the strips
2455 // (silicon, layer #5)
2460 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2462 // --- Define a volume containing the electronics of the strips
2463 // (silicon, layer #5)
2468 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2470 // --- Define the cooling tubes (aluminum, layer #5)
2473 dtub[1] = dtub[0] + .01;
2475 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2477 // --- Define the cooling fluid (water or freon, layer #5)
2482 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2483 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2485 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2493 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2494 dfra[6] = dfra[5] + .03;
2498 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2500 // --- Define the element connecting the triangles of the heat bridge
2501 // (carbon, layer #5)
2506 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2508 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2511 dpla[0] = (10./(8.*7.))/2.;
2514 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2516 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2518 dcop[0] = (2./(8.*7.))/2.;
2521 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2523 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2525 depx[0] = (30./(8.*7.))/2.;
2528 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2530 // --- Define the part of the end-ladder stuff made of silicon (bus)
2533 dsil[0] = (20./(8.*7.))/2.;
2536 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2538 // --- Place the end-ladder stuff into its mother (ELL5)
2540 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2546 xpos = -dela[0] + dpla[0];
2547 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2551 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2552 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2556 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2557 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2559 // --- Silicon (bus)
2561 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2562 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2564 // --- Place the sensitive part of the strips into its mother (ISV1)
2567 for (j = 1; j <= 23; ++j) {
2568 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2569 else xpos = -dbox1[0] + dits[0];
2570 zpos = ((j - 1) - 11.) * 3.91;
2571 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2574 // --- Place the electronics of the strips into its mother (SSV1)
2577 for (j = 1; j <= 23; ++j) {
2578 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2579 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2580 zpos = ((j - 1) - 11.) * 3.91 + .85;
2581 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2584 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2586 xpos = -dsrv[0] + .41;
2589 // --- Left tube (just a matter of convention)
2592 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2593 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2595 // --- Right tube (just a matter of convention)
2598 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2599 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2601 // --- Place the heat bridge elements into their mother (SSV1)
2603 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2605 for (j = 1; j <= 24; ++j) {
2606 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2607 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2610 // --- Place the elements connecting the triangles of the heat bridge
2611 // into their mother (SSV1)
2615 // --- Left element (just a matter of convention)
2617 xpos = -dsrv[0] + .47;
2618 ypos = -(2.1+0.015);
2619 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2621 // --- Right element
2623 xpos = -dsrv[0] + .47;
2625 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2629 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2631 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2633 // --- Place the ghost volumes containing the strip ladders (ISV1),
2634 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2635 // their mother volume (IT56)
2637 offset1 = TMath::ATan2(.9, 40.);
2639 rzero = dbox1[0] + 40.;
2640 runo = dbox1[0] * 2. + 40. + dsrv[0];
2641 rtwo = dbox1[0] * 2. + 40. + dela[0];
2642 for (i = 1; i <= 35; ++i) {
2643 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2644 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2646 // --- Strip ladders
2648 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2649 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2651 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2653 // --- Electronics/cooling
2655 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2656 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2658 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2660 // --- End-ladders (nagative-Z and positive-Z)
2662 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2663 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2664 zpos = -(dbox1[2] + dela[2] + 6.);
2665 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2666 zpos = dbox1[2] + dela[2] + 6.;
2667 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2673 // GOTO 5778 ! skip ITS layer no. 6
2675 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2676 // it with air or vacuum
2678 dbox2[0] = (0.0600+2.*0.0150)/2.;
2680 dbox2[2] = 101.95/2.;
2681 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2683 // --- Make the ghost volume invisible
2685 gMC->Gsatt("ISV2", "SEEN", 0);
2687 // --- Define a ghost volume containing the electronics and cooling of
2688 // a single ladder of layer #6 and fill it with air or vacuum
2690 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2692 dsrv[2] = 101.95/2.;
2693 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2695 // --- Make the ghost volume invisible
2697 gMC->Gsatt("SSV2", "SEEN", 0);
2699 // --- Define a ghost volume containing the end-ladder stuff of
2700 // a single ladder of layer #6 and fill it with air or vacuum
2705 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2707 // --- Make the ghost volume invisible
2709 gMC->Gsatt("ELL6", "SEEN", 0);
2711 // --- Define a volume containing the sensitive part of the strips
2712 // (silicon, layer #6)
2717 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2719 // --- Define a volume containing the electronics of the strips
2720 // (silicon, layer #6)
2725 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2727 // --- Define the cooling tubes (aluminum, layer #6)
2730 dtub[1] = dtub[0] + .01;
2731 dtub[2] = 101.95/2.;
2732 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2734 // --- Define the cooling fluid (water or freon, layer #6)
2738 dwat[2] = 101.95/2.;
2739 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2740 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2742 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2750 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2751 dfra[6] = dfra[5] + .03;
2755 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2757 // --- Define the element connecting the triangles of the heat bridge
2758 // (carbon, layer #6)
2762 dcei[2] = 101.95/2.;
2763 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2765 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2768 dpla[0] = (10./(8.*7.))/2.;
2771 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2773 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2775 dcop[0] = (2./(8.*7.))/2.;
2778 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2780 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2782 depx[0] = (30./(8.*7.))/2.;
2785 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2787 // --- Define the part of the end-ladder stuff made of silicon (bus)
2790 dsil[0] = (20./(8.*7.))/2.;
2793 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2795 // --- Place the end-ladder stuff into its mother (ELL5)
2797 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2803 xpos = -dela[0] + dpla[0];
2804 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2808 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2809 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2813 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2814 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2816 // --- Silicon (bus)
2818 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2819 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2821 // --- Place the sensitive part of the strips into its mother (ISV2)
2824 for (j = 1; j <= 26; ++j) {
2825 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2826 else xpos = -dbox2[0] + dits[0];
2827 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2828 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2831 // --- Place the electronics of the strips into its mother (SSV2)
2834 for (j = 1; j <= 26; ++j) {
2835 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2836 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2837 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2838 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2841 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2843 xpos = -dsrv[0] + .41;
2846 // --- Left tube (just a matter of convention)
2849 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2850 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2852 // --- Right tube (just a matter of convention)
2855 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2856 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2858 // --- Place the heat bridge elements into their mother (SSV2)
2860 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2862 for (j = 1; j <= 27; ++j) {
2863 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2864 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2867 // --- Place the elements connecting the triangles of the heat bridge
2868 // into their mother (SSV2)
2872 // --- Left element (just a matter of convention)
2874 xpos = -dsrv[0] + .47;
2875 ypos = -(2.1+0.015);
2876 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2878 // --- Right element
2880 xpos = -dsrv[0] + .47;
2882 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2886 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2888 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2890 // --- Place the ghost volumes containing the strip ladders (ISV2),
2891 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2892 // their mother volume (IT56)
2894 offset1 = TMath::ATan2(1., 45.);
2896 rzero = dbox2[0] + 45.;
2897 runo = dbox2[0] * 2. + 45. + dsrv[0];
2898 rtwo = dbox2[0] * 2. + 45. + dela[0];
2899 for (i = 1; i <= 39; ++i) {
2900 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2901 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2903 // --- Strip ladders
2905 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2906 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2908 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2910 // --- Electronics/cooling
2912 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2913 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2915 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2917 // --- End-ladders (nagative-Z and positive-Z)
2919 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2920 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2921 zpos = -(dbox2[2] + dela[2] + 6.);
2922 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2923 zpos = dbox2[2] + dela[2] + 6.;
2924 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2929 // --- Define SSD with the 32+36 lay-out
2931 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
2933 //--- Define ghost volume containing the Strip Detectors and fill it with air
2936 xxm = (49.999-3.)/(70.-25.);
2940 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2941 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2944 dgh[6] = -25. - (9.-3.01) / xxm -
2945 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2948 dgh[9] = (9.-3.01) / xxm + 25. +
2949 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2952 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2953 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2956 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2957 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2958 gMC->Gsatt("IT56", "SEEN", 0);
2962 // GOTO 6678 ! skip ITS layer no. 5
2964 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2965 // it with air or vacuum
2967 dbox1[0] = (0.0600+2.*0.0150)/2.;
2969 dbox1[2] = 86.31/2.;
2970 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2972 // --- Make the ghost volume invisible
2974 gMC->Gsatt("ISV1", "SEEN", 0);
2976 // --- Define a ghost volume containing the electronics and cooling of
2977 // a single ladder of layer #5 and fill it with air or vacuum
2979 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2982 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2984 // --- Make the ghost volume invisible
2986 gMC->Gsatt("SSV1", "SEEN", 0);
2988 // --- Define a ghost volume containing the end-ladder stuff of
2989 // a single ladder of layer #5 and fill it with air or vacuum
2994 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2996 // --- Make the ghost volume invisible
2998 gMC->Gsatt("ELL5", "SEEN", 0);
3000 // --- Define a volume containing the sensitive part of the strips
3001 // (silicon, layer #5)
3006 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3008 // --- Define a volume containing the electronics of the strips
3009 // (silicon, layer #5)
3014 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3016 // --- Define the cooling tubes (aluminum, layer #5)
3019 dtub[1] = dtub[0] + .01;
3021 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3023 // --- Define the cooling fluid (water or freon, layer #5)
3028 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3029 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3031 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3039 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3040 dfra[6] = dfra[5] + .03;
3044 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3046 // --- Define the element connecting the triangles of the heat bridge
3047 // (carbon, layer #5)
3052 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3054 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3057 dpla[0] = (10./(8.*7.))/2;
3060 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3062 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3064 dcop[0] = (2./(8.*7.))/2;
3067 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3069 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3071 depx[0] = (30./(8.*7.))/2.;
3074 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3076 // --- Define the part of the end-ladder stuff made of silicon (bus)
3079 dsil[0] = (20./(8.*7.))/2.;
3082 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3084 // --- Place the end-ladder stuff into its mother (ELL5)
3086 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3092 xpos = -dela[0] + dpla[0];
3093 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3097 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3098 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3102 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3103 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3105 // --- Silicon (bus)
3107 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3108 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3110 // --- Place the sensitive part of the strips into its mother (ISV1)
3113 for (j = 1; j <= 22; ++j) {
3114 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3115 else xpos = -dbox1[0] + dits[0];
3116 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3117 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3120 // --- Place the electronics of the strips into its mother (SSV1)
3123 for (j = 1; j <= 22; ++j) {
3124 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3125 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3126 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3127 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3130 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3132 xpos = -dsrv[0] + .41;
3135 // --- Left tube (just a matter of convention)
3138 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3139 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3141 // --- Right tube (just a matter of convention)
3144 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3145 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3147 // --- Place the heat bridge elements into their mother (SSV1)
3149 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3151 for (j = 1; j <= 23; ++j) {
3152 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3153 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3156 // --- Place the elements connecting the triangles of the heat bridge
3157 // into their mother (SSV1)
3161 // --- Left element (just a matter of convention)
3163 xpos = -dsrv[0] + .47;
3164 ypos = -(2.1+0.015);
3165 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3167 // --- Right element
3169 xpos = -dsrv[0] + .47;
3171 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3175 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3177 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3179 // --- Place the ghost volumes containing the strip ladders (ISV1),
3180 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3181 // their mother volume (IT56)
3183 offset1 = TMath::ATan2(.8, 36.6);
3185 rzero = dbox1[0] + 36.6;
3186 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3187 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3188 for (i = 1; i <= 32; ++i) {
3189 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3190 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3192 // --- Strip ladders
3194 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3195 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3197 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3199 // --- Electronics/cooling
3201 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3202 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3204 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3206 // --- End-ladders (nagative-Z and positive-Z)
3208 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3209 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3210 zpos = -(dbox1[2] + dela[2] + 6.);
3211 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3212 zpos = dbox1[2] + dela[2] + 6.;
3213 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3219 // GOTO 6778 ! skip ITS layer no. 6
3221 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3222 // it with air or vacuum
3224 dbox2[0] = (0.0600+2.*0.0150)/2.;
3226 dbox2[2] = 94.13/2.;
3227 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3229 // --- Make the ghost volume invisible
3231 gMC->Gsatt("ISV2", "SEEN", 0);
3233 // --- Define a ghost volume containing the electronics and cooling of
3234 // a single ladder of layer #6 and fill it with air or vacuum
3236 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3239 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3241 // --- Make the ghost volume invisible
3243 gMC->Gsatt("SSV2", "SEEN", 0);
3245 // --- Define a ghost volume containing the end-ladder stuff of
3246 // a single ladder of layer #6 and fill it with air or vacuum
3251 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3253 // --- Make the ghost volume invisible
3255 gMC->Gsatt("ELL6", "SEEN", 0);
3257 // --- Define a volume containing the sensitive part of the strips
3258 // (silicon, layer #6)
3263 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3265 // --- Define a volume containing the electronics of the strips
3266 // (silicon, layer #6)
3271 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3273 // --- Define the cooling tubes (aluminum, layer #6)
3276 dtub[1] = dtub[0] + .01;
3278 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3280 // --- Define the cooling fluid (water or freon, layer #6)
3285 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3286 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3288 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3296 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3297 dfra[6] = dfra[5] + .03;
3301 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3303 // --- Define the element connecting the triangles of the heat bridge
3304 // (carbon, layer #6)
3309 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3311 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3314 dpla[0] = (10./(8.*7.))/2;
3317 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3319 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3321 dcop[0] = (2./(8.*7.))/2;
3324 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3326 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3328 depx[0] = (30./(8.*7.))/2.;
3331 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3333 // --- Define the part of the end-ladder stuff made of silicon (bus)
3336 dsil[0] = (20./(8.*7.))/2.;
3339 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3341 // --- Place the end-ladder stuff into its mother (ELL5)
3343 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3349 xpos = -dela[0] + dpla[0];
3350 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3354 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3355 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3359 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3360 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3362 // --- Silicon (bus)
3364 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3365 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3367 // --- Place the sensitive part of the strips into its mother (ISV2)
3370 for (j = 1; j <= 24; ++j) {
3371 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3372 else xpos = dbox2[0] - dits[0];
3373 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3374 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3377 // --- Place the electronics of the strips into its mother (SSV2)
3380 for (j = 1; j <= 24; ++j) {
3381 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3382 else xpos = -dsrv[0] + .28;
3383 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3384 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3387 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3389 xpos = -dsrv[0] + .41;
3392 // --- Left tube (just a matter of convention)
3395 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3396 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3398 // --- Right tube (just a matter of convention)
3401 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3402 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3404 // --- Place the heat bridge elements into their mother (SSV2)
3406 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3408 for (j = 1; j <= 25; ++j) {
3409 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3410 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3413 // --- Place the elements connecting the triangles of the heat bridge
3414 // into their mother (SSV2)
3418 // --- Left element (just a matter of convention)
3420 xpos = -dsrv[0] + .47;
3421 ypos = -(2.1+0.015);
3422 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3424 // --- Right element
3426 xpos = -dsrv[0] + .47;
3428 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3432 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3434 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3436 // --- Place the ghost volumes containing the strip ladders (ISV2),
3437 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3438 // their mother volume (IT56)
3440 offset1 = TMath::ATan2(.9, 41.2);
3442 rzero = dbox2[0] + 41.2;
3443 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3444 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3445 for (i = 1; i <= 36; ++i) {
3446 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3447 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3449 // --- Strip ladders
3451 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3452 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3454 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3456 // --- Electronics/cooling
3458 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3459 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3461 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3463 // --- End-ladders (nagative-Z and positive-Z)
3465 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3466 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3467 zpos = -(dbox2[2] + dela[2] + 6.);
3468 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3469 zpos = dbox2[2] + dela[2] + 6.;
3470 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3476 //************************************************************************
3478 //* E N D - C A P S A N D F R A M E S *
3479 //* ========================================= *
3481 //************************************************************************
3483 // --- Define a dummy cylinder for multiple scattering tests
3485 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3488 // DITS(2)=DITS(1)+0.1
3490 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3491 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3494 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3496 // GOTO 8901 ! skip outer wall
3498 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3501 dits[1] = dits[0] + .06926;
3502 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3504 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3505 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3510 // --- The frame between the end-caps (octagonal lay-out) ---
3512 // GOTO 9012 ! skip octagonal frame
3514 if (fMinorVersionV3 == 1) {
3519 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3522 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3524 offset = angle / 2.;
3525 for (i = 0; i < 8; ++i) {
3526 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3527 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3529 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3530 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3534 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3535 aphi2 = 180. - aphi1;
3536 xpos = (xtra[0] + xtra[1]) / 2.;
3537 ypos = (ytra[0] + ytra[1]) / 2.;
3538 zpos = dtra[2] / 2.;
3539 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3542 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3543 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3544 zpos = -dtra[2] / 2.;
3545 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3548 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3549 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3552 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3553 aphi1 = 180. - aphi2;
3554 xpos = (xtra[1] + xtra[2]) / 2.;
3555 ypos = (ytra[1] + ytra[2]) / 2.;
3556 zpos = dtra[2] / 2.;
3557 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3560 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3561 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3562 zpos = -dtra[2] / 2.;
3563 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3566 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3567 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3570 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3571 aphi2 = 180. - aphi1;
3572 xpos = (xtra[2] + xtra[3]) / 2.;
3573 ypos = (ytra[2] + ytra[3]) / 2.;
3574 zpos = dtra[2] / 2.;
3575 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3578 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3579 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3580 zpos = -dtra[2] / 2.;
3581 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3584 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3585 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3588 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3589 aphi1 = 180. - aphi2;
3590 xpos = (xtra[3] + xtra[4]) / 2.;
3591 ypos = (ytra[3] + ytra[4]) / 2.;
3592 zpos = dtra[2] / 2.;
3593 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3596 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3597 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3598 zpos = -dtra[2] / 2.;
3599 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3602 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3603 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3606 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3607 aphi1 = 180. - aphi2;
3608 xpos = (xtra[4] + xtra[5]) / 2.;
3609 ypos = (ytra[4] + ytra[5]) / 2.;
3610 zpos = dtra[2] / 2.;
3611 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3614 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3615 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3616 zpos = -dtra[2] / 2.;
3617 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3620 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3621 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3624 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3625 aphi2 = 180. - aphi1;
3626 xpos = (xtra[5] + xtra[6]) / 2.;
3627 ypos = (ytra[5] + ytra[6]) / 2.;
3628 zpos = dtra[2] / 2.;
3629 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3632 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3633 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3634 zpos = -dtra[2] / 2.;
3635 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3638 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3639 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3642 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3643 aphi1 = 180. - aphi2;
3644 xpos = (xtra[6] + xtra[7]) / 2.;
3645 ypos = (ytra[6] + ytra[7]) / 2.;
3646 zpos = dtra[2] / 2.;
3647 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3650 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3651 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3652 zpos = -dtra[2] / 2.;
3653 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3656 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3657 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3660 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3661 aphi2 = 180. - aphi1;
3662 xpos = (xtra[7] + xtra[0]) / 2.;
3663 ypos = (ytra[7] + ytra[0]) / 2.;
3664 zpos = dtra[2] / 2.;
3665 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3668 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3669 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3670 zpos = -dtra[2] / 2.;
3671 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3674 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3675 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3678 } else if (fMinorVersionV3 == 4) {
3684 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3687 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3689 offset = angle / 2.;
3690 for (i = 0; i < 8; ++i) {
3691 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3692 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3694 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3695 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3699 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3700 aphi2 = 180. - aphi1;
3701 xpos = (xtra[0] + xtra[1]) / 2.;
3702 ypos = (ytra[0] + ytra[1]) / 2.;
3703 zpos = dtra[2] / 2.;
3704 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3707 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3708 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3709 zpos = -dtra[2] / 2.;
3710 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3713 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3714 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3717 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3718 aphi1 = 180. - aphi2;
3719 xpos = (xtra[1] + xtra[2]) / 2.;
3720 ypos = (ytra[1] + ytra[2]) / 2.;
3721 zpos = dtra[2] / 2.;
3722 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3725 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3726 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3727 zpos = -dtra[2] / 2.;
3728 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3731 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3732 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3735 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3736 aphi2 = 180. - aphi1;
3737 xpos = (xtra[2] + xtra[3]) / 2.;
3738 ypos = (ytra[2] + ytra[3]) / 2.;
3739 zpos = dtra[2] / 2.;
3740 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3743 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3744 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3745 zpos = -dtra[2] / 2.;
3746 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3749 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3750 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3753 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3754 aphi1 = 180. - aphi2;
3755 xpos = (xtra[3] + xtra[4]) / 2.;
3756 ypos = (ytra[3] + ytra[4]) / 2.;
3757 zpos = dtra[2] / 2.;
3758 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3761 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3762 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3763 zpos = -dtra[2] / 2.;
3764 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3767 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3768 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3771 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3772 aphi1 = 180. - aphi2;
3773 xpos = (xtra[4] + xtra[5]) / 2.;
3774 ypos = (ytra[4] + ytra[5]) / 2.;
3775 zpos = dtra[2] / 2.;
3776 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3779 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3780 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3781 zpos = -dtra[2] / 2.;
3782 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3785 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3786 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3789 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3790 aphi2 = 180. - aphi1;
3791 xpos = (xtra[5] + xtra[6]) / 2.;
3792 ypos = (ytra[5] + ytra[6]) / 2.;
3793 zpos = dtra[2] / 2.;
3794 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3797 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3798 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3799 zpos = -dtra[2] / 2.;
3800 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3803 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3804 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3807 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3808 aphi1 = 180. - aphi2;
3809 xpos = (xtra[6] + xtra[7]) / 2.;
3810 ypos = (ytra[6] + ytra[7]) / 2.;
3811 zpos = dtra[2] / 2.;
3812 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3815 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3816 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3817 zpos = -dtra[2] / 2.;
3818 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3821 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3822 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3825 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3826 aphi2 = 180. - aphi1;
3827 xpos = (xtra[7] + xtra[0]) / 2.;
3828 ypos = (ytra[7] + ytra[0]) / 2.;
3829 zpos = dtra[2] / 2.;
3830 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3833 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3834 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3835 zpos = -dtra[2] / 2.;
3836 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3839 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3840 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3846 // --- The frame between the end-caps (hexagonal lay-out) ---
3848 // GOTO 9123 ! skip hexagonal frame
3850 if (fMinorVersionV3 == 2) {
3855 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3861 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3863 offset = angle / 2.;
3864 for (i = 0; i < 6; ++i) {
3865 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3866 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3868 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3869 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3874 xpos = (xtra1[0] + xtra1[1]) / 2.;
3875 ypos = (ytra1[0] + ytra1[1]) / 2.;
3877 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3880 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3881 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3885 xpos = (xtra1[1] + xtra1[2]) / 2.;
3886 ypos = (ytra1[1] + ytra1[2]) / 2.;
3888 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3891 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3892 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3896 xpos = (xtra1[2] + xtra1[3]) / 2.;
3897 ypos = (ytra1[2] + ytra1[3]) / 2.;
3899 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3902 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3903 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3907 xpos = (xtra1[3] + xtra1[4]) / 2.;
3908 ypos = (ytra1[3] + ytra1[4]) / 2.;
3910 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3913 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3914 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3918 xpos = (xtra1[4] + xtra1[5]) / 2.;
3919 ypos = (ytra1[4] + ytra1[5]) / 2.;
3921 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3924 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3925 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3929 xpos = (xtra1[5] + xtra1[0]) / 2.;
3930 ypos = (ytra1[5] + ytra1[0]) / 2.;
3932 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3935 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3936 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3939 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3940 aphi1 = 180. - aphi2;
3941 xpos = (xtra1[0] + xtra1[1]) / 2.;
3942 ypos = (ytra1[0] + ytra1[1]) / 2.;
3943 zpos = dtra2[2] / 2.;
3944 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
3947 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3948 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3949 zpos = -dtra2[2] / 2.;
3950 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
3953 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3954 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3957 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3958 aphi2 = 180. - aphi1;
3959 xpos = (xtra1[1] + xtra1[2]) / 2.;
3960 ypos = (ytra1[1] + ytra1[2]) / 2.;
3961 zpos = dtra2[2] / 2.;
3962 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
3965 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3966 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3967 zpos = -dtra2[2] / 2.;
3968 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
3971 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3972 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3975 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3976 aphi1 = 180. - aphi2;
3977 xpos = (xtra1[2] + xtra1[3]) / 2.;
3978 ypos = (ytra1[2] + ytra1[3]) / 2.;
3979 zpos = dtra2[2] / 2.;
3980 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
3983 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3984 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3985 zpos = -dtra2[2] / 2.;
3986 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
3989 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3990 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3992 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
3993 - 50.*50.))) * raddeg;
3994 aphi2 = 180. - aphi1;
3995 xpos = (xtra1[2] + xtra1[3]) / 2.;
3996 ypos = (ytra1[2] + ytra1[3]) / 2.;
3997 zpos = dtra2[2] / 2.;
3998 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4001 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4002 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4003 zpos = -dtra2[2] / 2.;
4004 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4007 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4008 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4011 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4012 aphi1 = 180. - aphi2;
4013 xpos = (xtra1[3] + xtra1[4]) / 2.;
4014 ypos = (ytra1[3] + ytra1[4]) / 2.;
4015 zpos = dtra2[2] / 2.;
4016 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4019 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4020 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4021 zpos = -dtra2[2] / 2.;
4022 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4025 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4026 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4029 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4030 aphi2 = 180. - aphi1;
4031 xpos = (xtra1[4] + xtra1[5]) / 2.;
4032 ypos = (ytra1[4] + ytra1[5]) / 2.;
4033 zpos = dtra2[2] / 2.;
4034 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4037 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4038 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4039 zpos = -dtra2[2] / 2.;
4040 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4043 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4044 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4047 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4048 aphi1 = 180. - aphi2;
4049 xpos = (xtra1[5] + xtra1[0]) / 2.;
4050 ypos = (ytra1[5] + ytra1[0]) / 2.;
4051 zpos = dtra2[2] / 2.;
4052 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4055 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4056 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4057 zpos = -dtra2[2] / 2.;
4058 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4061 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4062 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4064 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4065 aphi2 = 180. - aphi1;
4066 xpos = (xtra1[5] + xtra1[0]) / 2.;
4067 ypos = (ytra1[5] + ytra1[0]) / 2.;
4068 zpos = dtra2[2] / 2.;
4069 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4072 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4073 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4074 zpos = -dtra2[2] / 2.;
4075 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4078 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4079 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4082 } else if (fMinorVersionV3 == 5) {
4088 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4094 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4096 offset = angle / 2.;
4097 for (i = 0; i < 6; ++i) {
4098 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
4099 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
4101 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
4102 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4107 xpos = (xtra1[0] + xtra1[1]) / 2.;
4108 ypos = (ytra1[0] + ytra1[1]) / 2.;
4110 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
4113 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4114 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4118 xpos = (xtra1[1] + xtra1[2]) / 2.;
4119 ypos = (ytra1[1] + ytra1[2]) / 2.;
4121 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
4124 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4125 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4129 xpos = (xtra1[2] + xtra1[3]) / 2.;
4130 ypos = (ytra1[2] + ytra1[3]) / 2.;
4132 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
4135 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4136 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4140 xpos = (xtra1[3] + xtra1[4]) / 2.;
4141 ypos = (ytra1[3] + ytra1[4]) / 2.;
4143 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
4146 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4147 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4151 xpos = (xtra1[4] + xtra1[5]) / 2.;
4152 ypos = (ytra1[4] + ytra1[5]) / 2.;
4154 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
4157 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4158 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4162 xpos = (xtra1[5] + xtra1[0]) / 2.;
4163 ypos = (ytra1[5] + ytra1[0]) / 2.;
4165 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
4168 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4169 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4172 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4173 aphi1 = 180. - aphi2;
4174 xpos = (xtra1[0] + xtra1[1]) / 2.;
4175 ypos = (ytra1[0] + ytra1[1]) / 2.;
4176 zpos = dtra2[2] / 2.;
4177 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4180 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4181 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4182 zpos = -dtra2[2] / 2.;
4183 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4186 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4187 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4190 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4191 aphi2 = 180. - aphi1;
4192 xpos = (xtra1[1] + xtra1[2]) / 2.;
4193 ypos = (ytra1[1] + ytra1[2]) / 2.;
4194 zpos = dtra2[2] / 2.;
4195 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4198 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4199 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4200 zpos = -dtra2[2] / 2.;
4201 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4204 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4205 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4208 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4209 aphi1 = 180. - aphi2;
4210 xpos = (xtra1[2] + xtra1[3]) / 2.;
4211 ypos = (ytra1[2] + ytra1[3]) / 2.;
4212 zpos = dtra2[2] / 2.;
4213 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4216 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4217 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4218 zpos = -dtra2[2] / 2.;
4219 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4222 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4223 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4225 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4226 aphi2 = 180. - aphi1;
4227 xpos = (xtra1[2] + xtra1[3]) / 2.;
4228 ypos = (ytra1[2] + ytra1[3]) / 2.;
4229 zpos = dtra2[2] / 2.;
4230 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4233 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4234 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4235 zpos = -dtra2[2] / 2.;
4236 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4239 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4240 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4243 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4244 aphi1 = 180. - aphi2;
4245 xpos = (xtra1[3] + xtra1[4]) / 2.;
4246 ypos = (ytra1[3] + ytra1[4]) / 2.;
4247 zpos = dtra2[2] / 2.;
4248 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4251 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4252 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4253 zpos = -dtra2[2] / 2.;
4254 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4257 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4258 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4261 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4262 aphi2 = 180. - aphi1;
4263 xpos = (xtra1[4] + xtra1[5]) / 2.;
4264 ypos = (ytra1[4] + ytra1[5]) / 2.;
4265 zpos = dtra2[2] / 2.;
4266 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4269 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4270 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4271 zpos = -dtra2[2] / 2.;
4272 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4275 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4276 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4279 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4280 aphi1 = 180. - aphi2;
4281 xpos = (xtra1[5] + xtra1[0]) / 2.;
4282 ypos = (ytra1[5] + ytra1[0]) / 2.;
4283 zpos = dtra2[2] / 2.;
4284 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4287 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4288 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4289 zpos = -dtra2[2] / 2.;
4290 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4293 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4294 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4296 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4297 aphi2 = 180. - aphi1;
4298 xpos = (xtra1[5] + xtra1[0]) / 2.;
4299 ypos = (ytra1[5] + ytra1[0]) / 2.;
4300 zpos = dtra2[2] / 2.;
4301 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4304 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4305 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4306 zpos = -dtra2[2] / 2.;
4307 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4310 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4311 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4317 // --- Define the end-caps
4319 // GOTO 9234 ! skip both end-caps
4321 // --- Define the Z>0 end-cap
4323 // GOTO 9345 ! skip the Z>0 end-cap
4328 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4329 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4332 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4333 // end-ladder electro
4334 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4335 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4337 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4339 // In the Simonetti's drawings 52. In the TP 50.
4343 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4344 // end-ladder electro
4345 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4346 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4350 dtube[2] = 26.8/2./10.;
4353 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4355 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4356 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4362 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4363 // end-ladder electron
4366 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4367 // end-ladder electronics
4373 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4374 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4380 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4384 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4391 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4392 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4394 if (fMinorVersionV3 < 3 ) {
4396 dpgon[0] = offset2 + 360./(2.*35.);
4400 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4404 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4411 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4412 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4414 dpgon[0] = offset2 + 360./(2.*39.);
4418 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4422 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4429 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4430 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4432 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4434 dpgon[0] = offset2 + 5.625;
4438 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4439 // end-ladder electronics
4442 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4443 // end-ladder electr
4449 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4450 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4452 dpgon[0] = offset2 + 5.;
4456 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4457 // end-ladder electronics
4460 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4461 // end-ladder electr
4467 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4468 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4473 // --- Define the Z<0 end-cap
4475 // GOTO 9456 ! skip the Z<0 end-cap
4478 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4479 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4484 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4485 // end-ladder electr
4486 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4488 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4490 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4492 // In the Simonetti's drawings 52. In the TP 50.
4496 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4497 // end-ladder electr
4498 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4500 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4504 dtube[2] = 26.8/2./10.;
4507 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4509 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4511 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4517 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4518 // end-ladder electronics
4521 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4522 // end-ladder electro
4528 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4529 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4535 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4539 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4546 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4547 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4549 if (fMinorVersionV3 < 3) {
4551 dpgon[0] = offset2 + 360./(2.*35.);
4555 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4559 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4566 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4567 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4569 dpgon[0] = offset2 + 360./(2.*39.);
4573 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4577 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4584 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4585 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4587 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4589 dpgon[0] = offset2 + 5.625;
4593 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4594 // end-ladder electronics
4597 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4598 // end-ladder electr
4604 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4605 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4607 dpgon[0] = offset2 + 5.;
4611 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4612 // end-ladder electronics
4615 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4616 // end-ladder electr
4622 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4623 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4629 // --- Outputs the geometry tree in the EUCLID/CAD format
4632 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4634 fMinorVersion = fMinorVersionV3;
4636 //_____________________________________________________________________________
4637 void AliITSv3::CreateMaterials(){
4638 ////////////////////////////////////////////////////////////////////////
4639 // Create Materials for ITS as defined in AliITS::CreateMaterials().
4640 ////////////////////////////////////////////////////////////////////////
4641 AliITS::CreateMaterials();
4643 //_____________________________________________________________________________
4644 void AliITSv3::Init(){
4645 ////////////////////////////////////////////////////////////////////////
4646 // Initialise the ITS after it has been created.
4647 ////////////////////////////////////////////////////////////////////////
4651 fIdName = new char*[fIdN];
4652 fIdSens = new Int_t[fIdN];
4653 for(i=0;i<fId3N;i++) {
4654 l = strlen(fId3Name[i]);
4655 fIdName[i] = new char[l+1];
4656 for(j=0;j<l;j++) fIdName[i][j] = fId3Name[i][j];
4657 fIdName[i][l] = '\0'; // Null terminate this string.
4662 fMinorVersion = fMinorVersionV3;
4664 //_____________________________________________________________________________
4665 void AliITSv3::StepManager(){
4666 ////////////////////////////////////////////////////////////////////////
4667 // Called for every step in the ITS, then calles the AliITShit class
4668 // creator with the information to be recoreded about that hit.
4669 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4670 // printing of information to a file which can be used to create a .det
4671 // file read in by the routine CreateGeometry(). If set to 0 or any other
4672 // value except 1, the default behavior, then no such file is created nor
4673 // it the extra variables and the like used in the printing allocated.
4674 ////////////////////////////////////////////////////////////////////////
4678 TLorentzVector position, momentum;
4679 TClonesArray &lhits = *fHits;
4680 #if ALIITSPRINTGEOM==1
4683 Float_t xl[3],xt[3],angl[6];
4684 // Float_t par[20],att[20];
4686 static Bool_t first=kTRUE,printit[6][50][50];
4687 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4688 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4696 if(gMC->IsTrackInside()) vol[3] += 1;
4697 if(gMC->IsTrackEntering()) vol[3] += 2;
4698 if(gMC->IsTrackExiting()) vol[3] += 4;
4699 if(gMC->IsTrackOut()) vol[3] += 8;
4700 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4701 if(gMC->IsTrackStop()) vol[3] += 32;
4702 if(gMC->IsTrackAlive()) vol[3] += 64;
4704 // Fill hit structure.
4705 if(!(gMC->TrackCharge())) return;
4707 // Only entering charged tracks
4708 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4710 id=gMC->CurrentVolOffID(1,copy);
4712 id=gMC->CurrentVolOffID(2,copy);
4714 } else if(id==fIdSens[1]) {
4716 id=gMC->CurrentVolOffID(1,copy);
4718 id=gMC->CurrentVolOffID(2,copy);
4720 } else if(id==fIdSens[2]) {
4723 id=gMC->CurrentVolOffID(1,copy);
4725 } else if(id==fIdSens[3]) {
4728 id=gMC->CurrentVolOffID(1,copy);
4730 } else if(id==fIdSens[4]) {
4733 id=gMC->CurrentVolOffID(1,copy);
4735 } else if(id==fIdSens[5]) {
4738 id=gMC->CurrentVolOffID(1,copy);
4741 gMC->TrackPosition(position);
4742 gMC->TrackMomentum(momentum);
4743 hits[0]=position[0];
4744 hits[1]=position[1];
4745 hits[2]=position[2];
4746 hits[3]=momentum[0];
4747 hits[4]=momentum[1];
4748 hits[5]=momentum[2];
4749 hits[6]=gMC->Edep();
4750 hits[7]=gMC->TrackTime();
4751 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
4752 #if ALIITSPRINTGEOM==1
4753 if(printit[vol[0]][vol[2]][vol[1]]){
4754 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
4755 xl[0] = xl[1] = xl[2] = 0.0;
4756 gMC->Gdtom(xl,xt,1);
4757 for(i=0;i<9;i++) mat[i] = 0.0;
4758 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
4761 gMC->Gdtom(xl,&(mat[0]),2);
4764 gMC->Gdtom(xl,&(mat[3]),2);
4767 gMC->Gdtom(xl,&(mat[6]),2);
4769 angl[0] = TMath::ACos(mat[2]);
4770 if(mat[2]==1.0) angl[0] = 0.0;
4771 angl[1] = TMath::ATan2(mat[1],mat[0]);
4772 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
4774 angl[2] = TMath::ACos(mat[5]);
4775 if(mat[5]==1.0) angl[2] = 0.0;
4776 angl[3] = TMath::ATan2(mat[4],mat[3]);
4777 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
4779 angl[4] = TMath::ACos(mat[8]);
4780 if(mat[8]==1.0) angl[4] = 0.0;
4781 angl[5] = TMath::ATan2(mat[7],mat[6]);
4782 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
4784 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
4785 // i = gMC->CurrentVolID(copy);
4786 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
4787 fp = fopen("ITSgeometry_v5.det","a");
4788 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
4789 vol[0],vol[2],vol[1], // layer ladder detector
4790 xt[0],xt[1],xt[2], // Translation vector
4791 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
4794 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
4795 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
4796 ); // Adding the rotation matrix.
4799 } // end if printit[layer][ladder][detector]
4802 //____________________________________________________________________________
4803 void AliITSv3::Streamer(TBuffer &R__b){
4804 ////////////////////////////////////////////////////////////////////////
4805 // A dummy Streamer function for this class AliITSv3. By default it
4806 // only streams the AliITS class as it is required. Since this class
4807 // dosen't contain any "real" data to be saved, it doesn't.
4808 ////////////////////////////////////////////////////////////////////////
4809 if (R__b.IsReading()) {
4810 Version_t R__v = R__b.ReadVersion();
4812 AliITS::Streamer(R__b);
4813 // This information does not need to be read. It is "hard wired"
4814 // into this class via its creators.
4816 //R__b.ReadArray(fId3Name);
4820 R__b.WriteVersion(AliITSv3::IsA());
4821 AliITS::Streamer(R__b);
4822 // This information does not need to be saved. It is "hard wired"
4823 // into this class via its creators.
4825 //R__b.WriteArray(fId3Name, __COUNTER__);
4826 } // end if R__b.IsReading()