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.10 1999/10/22 08:16:49 fca
19 Correct destructors, thanks to I.Hrivnacova
21 Revision 1.9 1999/10/06 19:56:50 fca
24 Revision 1.8 1999/10/05 08:05:09 fca
25 Minor corrections for uninitialised variables.
27 Revision 1.7 1999/09/29 09:24:20 fca
28 Introduction of the Copyright and cvs Log
32 ///////////////////////////////////////////////////////////////////////////////
34 // Inner Traking System version 3 //
35 // This class contains the base procedures for the Inner Tracking System //
37 // Authors: R. Barbera, A. Morsch.
41 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
42 // WORK with the geometry or module classes or any analysis classes. You are
43 // strongly encouraged to uses AliITSv5.
46 ///////////////////////////////////////////////////////////////////////////////
51 #include "AliITShit.h"
60 //_____________________________________________________________________________
61 AliITSv3::AliITSv3() {
63 // Default constructor for ITS
66 fId3Name = new char*[fId3N];
76 //_____________________________________________________________________________
77 AliITSv3::~AliITSv3() {
79 // Standard destructor for the ITS
84 //_____________________________________________________________________________
85 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
87 // Standard constructor for ITS
90 fId3Name = new char*[fId3N];
100 //_____________________________________________________________________________
101 void AliITSv3::CreateGeometry(){
103 // Create ITS geometry for version 3
108 const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
109 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
111 const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
112 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
114 const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
115 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
117 const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
118 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
120 const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
121 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
123 const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
124 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
126 const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
127 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
129 const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
130 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
132 const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
133 0.5,0.7,0.5,0.7,0.5,0.5 };
134 const Float_t rr = 4.064516;
135 const Float_t tteta = 63.00;
136 const Float_t pphi = -35.00;
137 const Float_t gteta = 87.78;
138 const Double_t degrad = kPI/180.;
139 const Double_t raddeg = 180./kPI;
140 const Double_t twopi = 2*kPI;
143 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
144 dfra[10], dcer[3], dkap[3], dpla[3],
145 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
146 atheta1011, dbus[3], dtub[3], dwat[3],
147 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
148 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
149 Double_t biga1, bigb1;
150 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
151 dtra1[3], dtra2[3], dtra3[3],
152 dtra4[3], dbox1[3], dbox2[3];
154 Float_t xtra1[6], ytra1[6], ztra1[6];
156 Float_t xpos1, ypos1;
158 Float_t angle, dcone[5], dtube[3], dpgon[10];
159 Float_t rzero, xzero, yzero;
160 Double_t coeffa, coeffb, coeffc;
162 Float_t atheta, offset;
163 Float_t offset1, offset2, dgh[15];
164 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
165 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
168 Double_t xcc1, ycc1, xcc2, ycc2;
170 const char natra[][5] ={ "TR01","TR02","TR03","TR04",
171 "TR05","TR06","TR07","TR08"};
172 const char natra1[][5] ={"TR11","TR12","TR13","TR14",
173 "TR15","TR16","TR17","TR18",
174 "TR19","TR20","TR21","TR22",
175 "TR23","TR24","TR25","TR26"};
176 const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
177 const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
178 const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
179 "TR57","TR58","TR59","TR60","TR61","TR62",
180 "TR63","TR64","TR65","TR66"};
182 Int_t *idtmed = fIdtmed->GetArray()-199;
184 // --- Define a ghost volume containing the whole ITS and fill it with air
202 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
204 // --- Place the ghost volume in its mother volume (ALIC) and make it
207 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
208 gMC->Gsatt("ITSV", "SEEN", 0);
210 //************************************************************************
215 //************************************************************************
217 // GOTO 2345 ! skip ITS layer no. 1 and 2
219 // --- Define a ghost volume containing the Silicon Pixel Detectors
220 // (layer #1 and #2) and fill it with air or vacuum
222 xxm = (49.999-3)/(70-25);
226 dgh[3] = -25.-(9.-3.01)/xxm;
235 dgh[12] = 25+(9-3.01)/xxm;
238 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
240 // --- Place the ghost volume in its mother volume (ITSV) and make it
243 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
244 gMC->Gsatt("IT12", "SEEN", 0);
246 // --- Define a ghost volume containing a single element of layer #1
247 // and fill it with air or vacuum
249 dbox1[0] = 0.005+0.01+0.0075;
252 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
254 //--Divide each element of layer #1 in three ladders along the beam direction
256 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
258 // --- Make the ghost volumes invisible
260 gMC->Gsatt("IPV1", "SEEN", 0);
261 gMC->Gsatt("IPB1", "SEEN", 0);
263 // --- Define a volume containing the chip of pixels (silicon, layer #1)
267 dchi[2] = dbox1[2] / 3.;
268 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
270 // --- Define a volume containing the bus of pixels (silicon, layer #1)
275 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
277 // --- Define a volume containing the sensitive part of pixels
278 // (silicon, layer #1)
283 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
285 // --- Place the chip into its mother (IPB1)
287 xpos = dbox1[0] - dchi[0];
290 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
292 // --- Place the sensitive volume into its mother (IPB1)
294 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
295 ypos = dchi[1] - dits[1];
296 zpos = -(dchi[2] - dits[2]);
297 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
299 // --- Place the bus into its mother (IPB1)
301 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
302 ypos = dchi[1] - dbus[1];
303 zpos = -(dchi[2] - dbus[2]);
304 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
306 // --- Define a ghost volume containing a single element of layer #2
307 // and fill it with air or vacuum
309 dbox2[0] = 0.005+0.01+0.0075;
312 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
314 //--Divide each element of layer #2 in four ladders along the beam direction
316 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
318 // --- Make the ghost volumes invisible
320 gMC->Gsatt("IPV2", "SEEN", 0);
321 gMC->Gsatt("IPB2", "SEEN", 0);
323 // --- Define a volume containing the chip of pixels (silicon, layer #2)
327 dchi[2] = dbox2[2] / 4.;
328 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
330 // --- Define a volume containing the bus of pixels (silicon, layer #2)
335 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
337 // --- Define a volume containing the sensitive part of pixels
338 // (silicon, layer #2)
343 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
345 // --- Place the chip into its mother (IPB2)
347 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
350 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
352 // --- Place the sensitive volume into its mother (IPB2)
354 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
355 ypos = -(dchi[1] - dits[1]);
356 zpos = -(dchi[2] - dits[2]);
357 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
359 // --- Place the bus into its mother (IPB2)
361 xpos = dbox1[0] - dbus[0];
362 ypos = -(dchi[1] - dbus[1]);
363 zpos = -(dchi[2] - dbus[2]);
364 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
366 // --- Define a generic segment of an element of the mechanical support
371 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
373 // --- Define a generic arc of an element of the mechanical support
378 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
380 // --- Define the mechanical supports of layers #1 and #2 and place the
381 // elements of the layers in it
384 // counter over the number of elements of layer #1 (
387 // counter over the number of elements of layer #2 (
388 for (i = 1; i <= 10; ++i) {
390 // --- Place part # 1-2 (see sketch)
392 // number of carbon fiber supports (see sketch)
395 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
396 (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
398 xcc = ( xx[0] + xx[1]) / 20.;
399 ycc = ( yy[0] + yy[1]) / 20.;
400 xccc = (xbeg[0] + xend[0]) / 20.;
401 yccc = (ybeg[0] + yend[0]) / 20.;
402 if (xx[0] == xx[1]) {
407 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
408 } // end if xx[0] == xx[1]
409 aphi = (pphi + (i-1) * 36.) * degrad;
410 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
411 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
412 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
413 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
414 xpos = xpos1 * TMath::Cos(gteta * degrad) +
415 ypos1 * TMath::Sin(gteta *degrad);
416 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
417 ypos1 * TMath::Cos(gteta * degrad);
419 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
420 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
421 atheta12 + 90., 0., 0.);
422 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
423 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
425 // --- Place part # 2-3 (see sketch)
429 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
430 (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
432 xcc = ( xx[1] + xx[2]) / 20.;
433 ycc = ( yy[1] + yy[2]) / 20.;
434 xccc = (xbeg[1] + xend[1]) / 20.;
435 yccc = (ybeg[1] + yend[1]) / 20.;
436 if (xx[1] == xx[2]) {
441 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
442 } // end if xx[1] == xx[2]
443 aphi = (pphi + (i-1) * 36.) * degrad;
444 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
445 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
446 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
447 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
448 xpos = xpos1 * TMath::Cos(gteta * degrad) +
449 ypos1 * TMath::Sin(gteta * degrad);
450 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
451 ypos1 * TMath::Cos(gteta * degrad);
453 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
454 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
455 atheta23 + 90., 0., 0.);
456 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
457 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
459 // --- Place an element of layer #2
461 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
462 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
463 coeffa = biga * biga + 1.;
464 coeffb = biga * bigb - biga * ycc - xcc;
465 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
466 bigb * bigb - 0.08964*0.08964;
467 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
469 ycc1 = biga * xcc1 + bigb;
471 bigb1 = xcc1 / biga + ycc1;
472 coeffa = biga1 * biga1 + 1.;
473 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
474 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
475 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
476 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
478 ycc2 = biga1 * xcc2 + bigb1;
479 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
480 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
481 xpos = xpos1 * TMath::Cos(gteta * degrad) +
482 ypos1 * TMath::Sin(gteta *degrad);
483 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
484 ypos1 * TMath::Cos(gteta * degrad);
487 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
488 idrotm[(i-1) * 13 + 1101], "ONLY");
490 // --- Place part # 3-4 (see sketch)
494 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
495 (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
497 xcc = (xx[1] + xx[2]) / 20.;
498 ycc = (yy[1] + yy[2]) / 20.;
499 xccc = (xbeg[2] + xend[2]) / 20.;
500 yccc = (ybeg[2] + yend[2]) / 20.;
501 if (xx[2] == xx[3]) {
506 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
507 } // end if xx[2] == xx[3]
508 aphi = (pphi + (i-1) * 36.) * degrad;
509 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
510 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
511 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
512 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
513 xpos = xpos1 * TMath::Cos(gteta * degrad) +
514 ypos1 * TMath::Sin(gteta *degrad);
515 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
516 ypos1 * TMath::Cos(gteta * degrad);
518 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
519 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
520 atheta34 + 90., 0., 0.);
521 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
522 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
524 // --- Place part # 4-5 (see sketch)
528 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
529 (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
531 xcc = ( xx[3] + xx[4]) / 20.;
532 ycc = ( yy[3] + yy[4]) / 20.;
533 xccc = (xbeg[3] + xend[3]) / 20.;
534 yccc = (ybeg[3] + yend[3]) / 20.;
535 if (xx[3] == xx[4]) {
540 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
541 } // end if xx[3] == xx[4]
542 aphi = (pphi + (i-1) * 36.) * degrad;
543 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
544 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
545 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
546 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
547 xpos = xpos1 * TMath::Cos(gteta * degrad) +
548 ypos1 * TMath::Sin(gteta *degrad);
549 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
550 ypos1 * TMath::Cos(gteta * degrad);
552 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
553 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
554 atheta45 + 90., 0., 0.);
555 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
556 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
558 // --- Place an element of layer #2
560 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
561 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
562 coeffa = biga * biga + 1.;
563 coeffb = biga * bigb - biga * ycc - xcc;
564 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
565 bigb * bigb - .014285030400000001;
566 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
568 ycc1 = biga * xcc1 + bigb;
570 bigb1 = xcc1 / biga + ycc1;
571 coeffa = biga1 * biga1 + 1.;
572 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
573 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
574 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
575 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
577 ycc2 = biga1 * xcc2 + bigb1;
578 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
579 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
580 xpos = xpos1 * TMath::Cos(gteta * degrad) +
581 ypos1 * TMath::Sin(gteta *degrad);
582 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
583 ypos1 * TMath::Cos(gteta * degrad);
586 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
587 idrotm[(i-1) * 13 + 1103], "ONLY");
589 // --- Place part # 5-6 (see sketch)
593 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
594 (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
596 xcc = (xx[4] + xx[5]) / 20.;
597 ycc = (yy[4] + yy[5]) / 20.;
598 xccc = (xbeg[4] + xend[4]) / 20.;
599 yccc = (ybeg[4] + yend[4]) / 20.;
600 if (xx[4] == xx[5]) {
605 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
607 aphi = (pphi + (i-1) * 36.) * degrad;
608 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
609 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
610 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
611 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
612 xpos = xpos1 * TMath::Cos(gteta * degrad) +
613 ypos1 * TMath::Sin(gteta *degrad);
614 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
615 ypos1 * TMath::Cos(gteta * degrad);
617 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
618 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
619 atheta56 + 90., 0., 0.);
620 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
621 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
623 // --- Place part # 6-7 (see sketch)
627 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
628 (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
630 xcc = (xx[5] + xx[6]) / 20.;
631 ycc = (yy[5] + yy[6]) / 20.;
632 xccc = (xbeg[5] + xend[5]) / 20.;
633 yccc = (ybeg[5] + yend[5]) / 20.;
634 if (xx[5] == xx[6]) {
639 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
640 } // end if xx[5] == xx[6]
641 aphi = (pphi + (i-1) * 36.) * degrad;
642 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
643 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
644 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
645 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
646 xpos = xpos1 * TMath::Cos(gteta * degrad) +
647 ypos1 * TMath::Sin(gteta *degrad);
648 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
649 ypos1 * TMath::Cos(gteta * degrad);
651 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
652 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
653 atheta67 + 90., 0., 0.);
654 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
655 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
657 // --- Place an element of layer #2
659 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
660 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
661 coeffa = biga * biga + 1.;
662 coeffb = biga * bigb - biga * ycc - xcc;
663 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
664 bigb * bigb - .014285030400000001;
665 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
667 ycc1 = biga * xcc1 + bigb;
669 bigb1 = xcc1 / biga + ycc1;
670 coeffa = biga1 * biga1 + 1.;
671 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
672 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
673 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
674 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
676 ycc2 = biga1 * xcc2 + bigb1;
677 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
678 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
679 xpos = xpos1 * TMath::Cos(gteta * degrad) +
680 ypos1 * TMath::Sin(gteta *degrad);
681 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
682 ypos1 * TMath::Cos(gteta * degrad);
685 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
686 idrotm[(i-1) * 13 + 1105], "ONLY");
688 // --- Place part # 7-8 (see sketch)
692 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
693 (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
695 xcc = (xx[6] + xx[7]) / 20.;
696 ycc = (yy[6] + yy[7]) / 20.;
697 xccc = (xbeg[6] + xend[6]) / 20.;
698 yccc = (ybeg[6] + yend[6]) / 20.;
699 if (xx[6] == xx[7]) {
704 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
706 aphi = (pphi + (i-1) * 36.) * degrad;
707 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
708 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
709 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
710 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
711 xpos = xpos1 * TMath::Cos(gteta * degrad) +
712 ypos1 * TMath::Sin(gteta *degrad);
713 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
714 ypos1 * TMath::Cos(gteta * degrad);
716 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
717 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
718 atheta78 + 90., 0., 0.);
719 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
720 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
722 // --- Place part # 8-9 (see sketch)
726 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
727 (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
729 xcc = (xx[7] + xx[8]) / 20.;
730 ycc = (yy[7] + yy[8]) / 20.;
731 xccc = (xbeg[7] + xend[7]) / 20.;
732 yccc = (ybeg[7] + yend[7]) / 20.;
733 if (xx[1] == xx[2]) {
738 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
740 aphi = (pphi + (i-1) * 36.) * degrad;
741 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
742 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
743 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
744 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
745 xpos = xpos1 * TMath::Cos(gteta * degrad) +
746 ypos1 * TMath::Sin(gteta *degrad);
747 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
748 ypos1 * TMath::Cos(gteta * degrad);
750 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
751 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
752 atheta89 + 90., 0., 0.);
753 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
754 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
756 // --- Place an element of layer #2
758 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
759 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
760 coeffa = biga * biga + 1.;
761 coeffb = biga * bigb - biga * ycc - xcc;
762 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
763 bigb * bigb - .014285030400000001;
764 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
766 ycc1 = biga * xcc1 + bigb;
768 bigb1 = xcc1 / biga + ycc1;
769 coeffa = biga1 * biga1 + 1.;
770 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
771 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
772 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
773 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
775 ycc2 = biga1 * xcc2 + bigb1;
776 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
777 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
778 xpos = xpos1 * TMath::Cos(gteta * degrad) +
779 ypos1 * TMath::Sin(gteta *degrad);
780 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
781 ypos1 * TMath::Cos(gteta * degrad);
784 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
785 idrotm[(i-1) * 13 + 1107], "ONLY");
787 // --- Place part # 9-10 (see sketch)
791 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
792 (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
794 xcc = (xx[8] + xx[9]) / 20.;
795 ycc = (yy[8] + yy[9]) / 20.;
796 xccc = (xbeg[8] + xend[8]) / 20.;
797 yccc = (ybeg[8] + yend[8]) / 20.;
798 if (xx[8] == xx[9]) {
803 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
805 aphi = (pphi + (i-1) * 36.) * degrad;
806 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
807 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
808 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
809 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
810 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
811 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
813 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
814 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
815 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
817 // --- Place part # 10-11 (see sketch)
821 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
823 xcc = (xx[9] + xx[10]) / 20.;
824 ycc = (yy[9] + yy[10]) / 20.;
825 xccc = (xbeg[9] + xend[9]) / 20.;
826 yccc = (ybeg[9] + yend[9]) / 20.;
827 if (xx[9] == xx[10]) {
832 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
834 aphi = (pphi + (i-1) * 36.) * degrad;
835 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
836 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
837 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
838 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
839 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
840 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
842 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
843 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
844 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
846 // --- Place part # 13-14 (see sketch)
850 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
852 xcc = (xx[12] + xx[13]) / 20.;
853 ycc = (yy[12] + yy[13]) / 20.;
854 xccc = (xbeg[12] + xend[12]) / 20.;
855 yccc = (ybeg[12] + yend[12]) / 20.;
856 if (xx[12] == xx[13]) {
859 r1 = yy[12] - yy[13];
860 r2 = xx[12] - xx[13];
861 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
863 aphi = (pphi + (i-1) * 36.) * degrad;
864 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
865 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
866 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
867 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
868 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
869 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
871 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
872 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
873 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
875 // --- Place an element of layer #1
877 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
878 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
879 coeffa = biga * biga + 1.;
880 coeffb = biga * bigb - biga * ycc - xcc;
881 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
882 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
883 ycc1 = biga * xcc1 + bigb;
885 bigb1 = xcc1 / biga + ycc1;
886 coeffa = biga1 * biga1 + 1.;
887 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
888 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
889 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
890 ycc2 = biga1 * xcc2 + bigb1;
891 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
892 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
893 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
894 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
897 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
899 // --- Place part # 12-13 (see sketch)
903 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
905 xcc = (xx[11] + xx[12]) / 20.;
906 ycc = (yy[11] + yy[12]) / 20.;
907 xccc = (xbeg[11] + xend[11]) / 20.;
908 yccc = (ybeg[11] + yend[11]) / 20.;
909 if (xx[11] == xx[12]) {
912 r1 = yy[12] - yy[11];
913 r2 = xx[12] - xx[11];
914 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
916 aphi = (pphi + (i-1) * 36.) * degrad;
917 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
918 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
919 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
920 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
921 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
922 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
924 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
925 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
926 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
928 // --- Place part # 11-12 (see sketch)
932 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
934 xcc = (xx[10] + xx[11]) / 20.;
935 ycc = (yy[10] + yy[11]) / 20.;
936 xccc = (xbeg[10] + xend[10]) / 20.;
937 yccc = (ybeg[10] + yend[10]) / 20.;
938 if (xx[10] == xx[11]) {
941 r1 = yy[11] - yy[10];
942 r2 = xx[11] - xx[10];
943 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
945 aphi = (pphi + (i-1) * 36.) * degrad;
946 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
947 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
948 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
949 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
950 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
951 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
953 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
954 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
955 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
957 // --- Place an element of layer #1
959 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
960 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
961 coeffa = biga * biga + 1.;
962 coeffb = biga * bigb - biga * ycc - xcc;
963 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
964 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
965 ycc1 = biga * xcc1 + bigb;
967 bigb1 = xcc1 / biga + ycc1;
968 coeffa = biga1 * biga1 + 1.;
969 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
970 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
971 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
972 ycc2 = biga1 * xcc2 + bigb1;
973 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
974 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
975 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
976 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
979 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
981 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
983 darc[0] = rarc[12] / 10. - .02;
984 darc[1] = rarc[12] / 10.;
986 darc[3] = atheta12 - (i-1) * 36.;
987 darc[4] = atheta23 - (i-1) * 36.;
988 xcc = xarc[12] / 10.;
989 ycc = yarc[12] / 10.;
990 aphi = (pphi + (i-1) * 36.) * degrad;
991 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
992 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
993 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
994 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
995 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
996 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
998 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1000 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1002 darc[0] = rarc[11] / 10. - .02;
1003 darc[1] = rarc[11] / 10.;
1005 darc[3] = atheta23 + 90. - (i-1) * 36.;
1006 darc[4] = atheta34 + 90. - (i-1) * 36.;
1007 xcc = xarc[11] / 10.;
1008 ycc = yarc[11] / 10.;
1009 aphi = (pphi + (i-1) * 36.) * degrad;
1010 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1011 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1012 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1013 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1014 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1015 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1017 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1019 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1021 darc[0] = rarc[10] / 10. - .02;
1022 darc[1] = rarc[10] / 10.;
1024 darc[3] = atheta45 + 180. - (i-1) * 36.;
1025 darc[4] = atheta34 + 180. - (i-1) * 36.;
1026 xcc = xarc[10] / 10.;
1027 ycc = yarc[10] / 10.;
1028 aphi = (pphi + (i-1) * 36.) * degrad;
1029 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1030 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1031 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1032 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1033 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1034 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1036 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1038 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1040 darc[0] = rarc[9] / 10. - .02;
1041 darc[1] = rarc[9] / 10.;
1043 darc[3] = atheta45 - 90. - (i-1) * 36.;
1044 darc[4] = atheta56 - 90. - (i-1) * 36.;
1045 xcc = xarc[9] / 10.;
1046 ycc = yarc[9] / 10.;
1047 aphi = (pphi + (i-1) * 36.) * degrad;
1048 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1049 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1050 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1051 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1052 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1053 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1055 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1057 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1059 darc[0] = rarc[8] / 10. - .02;
1060 darc[1] = rarc[8] / 10.;
1062 darc[3] = atheta67 + 45. - (i-1) * 36.;
1063 darc[4] = atheta56 + 45. - (i-1) * 36.;
1064 xcc = xarc[8] / 10.;
1065 ycc = yarc[8] / 10.;
1066 aphi = (pphi + (i-1) * 36.) * degrad;
1067 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1068 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1069 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1070 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1071 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1072 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1074 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1076 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1078 darc[0] = rarc[7] / 10. - .02;
1079 darc[1] = rarc[7] / 10.;
1081 darc[3] = atheta67 - (i-1) * 36.;
1082 darc[4] = atheta78 - (i-1) * 36.;
1083 xcc = xarc[7] / 10.;
1084 ycc = yarc[7] / 10.;
1085 aphi = (pphi + (i-1) * 36.) * degrad;
1086 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1087 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1088 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1089 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1090 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1091 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1093 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1095 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1097 darc[0] = rarc[6] / 10. - .02;
1098 darc[1] = rarc[6] / 10.;
1100 darc[3] = atheta89 + 45. - (i-1) * 36.;
1101 darc[4] = atheta78 + 45. - (i-1) * 36.;
1102 xcc = xarc[6] / 10.;
1103 ycc = yarc[6] / 10.;
1104 aphi = (pphi + (i-1) * 36.) * degrad;
1105 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1106 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1107 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1108 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1109 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1110 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1112 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1114 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1116 darc[0] = rarc[5] / 10. - .02;
1117 darc[1] = rarc[5] / 10.;
1119 darc[3] = atheta89 + 45. - (i-1) * 36.;
1120 darc[4] = atheta910 + 45. - (i-1) * 36.;
1121 xcc = xarc[5] / 10.;
1122 ycc = yarc[5] / 10.;
1123 aphi = (pphi + (i-1) * 36.) * degrad;
1124 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1125 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1126 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1127 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1128 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1129 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1131 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1133 // --- Place arc # 5 (between part 9-10 and part 10-11)
1136 darc[0] = rarc[4] / 10. - .02;
1137 darc[1] = rarc[4] / 10.;
1139 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1140 darc[4] = atheta910 + 45. - (i-1) * 36.;
1141 xcc = xarc[4] / 10.;
1142 ycc = yarc[4] / 10.;
1143 aphi = (pphi + (i-1) * 36.) * degrad;
1144 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1145 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1146 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1147 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1148 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1149 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1151 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1153 // --- Place arc # 4 (between part 10-11 and part 11-12)
1156 darc[0] = rarc[3] / 10. - .02;
1157 darc[1] = rarc[3] / 10.;
1159 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1160 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1161 xcc = xarc[3] / 10.;
1162 ycc = yarc[3] / 10.;
1163 aphi = (pphi + (i-1) * 36.) * degrad;
1164 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1165 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1166 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1167 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1168 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1169 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1171 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1173 // --- Place arc # 3 (between part 11-12 and part 12-13)
1176 darc[0] = rarc[2] / 10. - .02;
1177 darc[1] = rarc[2] / 10.;
1179 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1180 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1181 xcc = xarc[2] / 10.;
1182 ycc = yarc[2] / 10.;
1183 aphi = (pphi + (i-1) * 36.) * degrad;
1184 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1185 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1186 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1187 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1188 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1189 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1191 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1193 // --- Place arc # 2 (between part 12-13 and part 13-14)
1196 darc[0] = rarc[1] / 10. - .02;
1197 darc[1] = rarc[1] / 10.;
1199 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1200 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1201 xcc = xarc[1] / 10.;
1202 ycc = yarc[1] / 10.;
1203 aphi = (pphi + (i-1) * 36.) * degrad;
1204 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1205 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1206 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1207 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1208 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1209 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1211 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1213 // --- Place arc # 1 (between part 13-14 and part 1-2)
1216 darc[0] = rarc[0] / 10. - .02;
1217 darc[1] = rarc[0] / 10.;
1219 darc[3] = atheta12 + 45. - (i-1) * 36.;
1220 darc[4] = atheta1314 - (i-1) * 36.;
1221 xcc = xarc[0] / 10.;
1222 ycc = yarc[0] / 10.;
1223 aphi = (pphi + (i-1) * 36.) * degrad;
1224 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1225 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1226 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1227 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1228 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1229 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1231 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1234 //************************************************************************
1239 //************************************************************************
1241 // --- Define a ghost volume containing the Silicon Drift Detectors
1242 // (layer #3 and #4) and fill it with air or vacuum
1244 xxm = (49.999-3.)/(70.-25.);
1248 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1251 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1254 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1257 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1260 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1262 // --- Place the ghost volume in its mother volume (ITSV) and make it
1265 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1266 gMC->Gsatt("IT34", "SEEN", 0);
1270 // GOTO 3456 ! skip ITS layer no. 3
1272 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1273 // smaller lenght of ribs) and fill it with air or vacuum
1275 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1277 // the widest element is the sensitive element
1278 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1279 // 7.5 cm is the lenght
1280 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1282 // --- Make the ghost volume invisible
1284 gMC->Gsatt("IDV1", "SEEN", 0);
1286 // --- Define a volume containing the sensitive part of drifts
1287 // (silicon, layer #3)
1290 // see material budget report by G. Feofilov
1293 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1295 //--- Define the part of the (smaller) rib between two sensitive parts made of
1296 // carbon (layer #3)
1298 dsup[0] = .5 - dits[0];
1300 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1301 // 7.5 cm is the lenght
1302 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1304 //--- Define the first part of the (smaller) rib between two sensitive parts
1305 // made of aluminum (layer #3)
1307 dal1[0] = .5 - dits[0];
1308 dal1[1] = 0.00096/2.;
1309 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1310 // 7.5 cm is the lenght
1311 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1313 //--- Define the part of the (smaller) rib between two sensitive parts made of
1314 // kapton (layer #3)
1316 dkap[0] = .5 - dits[0];
1318 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1319 // 7.5 cm is the lenght
1320 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1322 //--- Define the second part of the (smaller) rib between two sensitive parts
1323 // made of aluminum (layer #3)
1325 dal2[0] = .5 - dits[0];
1326 dal2[1] = 0.0027/2.;
1327 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1328 // 7.5 cm is the lenght
1329 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1331 // --- Define the part of the (smaller) rib between two sensitive parts
1332 // made of silicon (the electronics) (layer #3)
1334 dchi[0] = .5 - dits[0];
1335 dchi[1] = 0.0071/2.;
1336 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1337 // 7.5 cm is the lenght
1338 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1340 // --- Define the part of the (smaller) rib between two sensitive parts
1341 // made of water (the cooler) (layer #3)
1343 dwat[0] = .5 - dits[0];
1344 dwat[1] = 0.0093/2.;
1345 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1346 // 7.5 cm is the lenght
1347 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1349 //--- Define the third part of the (smaller) rib between two sensitive parts
1350 // made of aluminum (the cooling tubes) (layer #3)
1352 dtub[0] = .5 - dits[0];
1353 dtub[1] = 0.00134/2.;
1354 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1355 // 7.5 cm is the lenght
1356 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1358 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1361 // twice the foreseen thickness
1364 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1366 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1369 // twice the foreseen thickness
1372 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1374 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1377 // twice the foreseen thickness
1380 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1382 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1385 // twice the foreseen thickness
1388 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1390 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1394 for (j = 1; j <= 5; ++j) {
1395 // odd elements are up and even elements are down
1397 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1398 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1399 } else if (j == 2) {
1400 xpos = -dbox1[0] + dits[0];
1401 zpos = 0. - dits[2] + 1. - dits[2];
1402 } else if (j == 3) {
1403 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1405 } else if (j == 4) {
1406 xpos = -dbox1[0] + dits[0];
1407 zpos = dits[2] + 0. - 1. + dits[2];
1408 } else if (j == 5) {
1409 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1410 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1412 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1415 // --- Place the smaller ribs into their mother (IDV1)
1417 // --- Right ribs (just a matter of convention)
1419 xpos = .5 - dbox1[0] + dits[0];
1425 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1429 ypos = dsup[1] + 2.81 + dal1[1];
1430 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1434 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1435 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1439 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1440 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1442 // --- Silicon (chip)
1444 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1445 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1449 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1450 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1454 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1456 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1458 // --- Right ribs (just a matter of convention)
1463 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1467 ypos = -(dsup[1] + 2.81 + dal1[1]);
1468 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1472 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1473 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1477 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1478 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1480 // --- Silicon (chip)
1482 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1483 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1487 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1488 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1492 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1493 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1494 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1496 // --- Place the end-ladder stuff into its mother (IDV1)
1499 // --- Negative-Z end-ladder
1502 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1506 xpos = dbox1[0] - dpcb[0];
1507 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1511 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1512 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1516 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1517 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1519 // --- Silicon (bus)
1521 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1522 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1524 // --- Positive-Z end-ladder
1527 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1531 xpos = dbox1[0] - dpcb[0];
1532 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1536 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1537 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1541 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1542 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1544 // --- Silicon (bus)
1546 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1547 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1549 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1550 // larger lenght of ribs) and fill it with air or vacuum
1552 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1554 // the widest element is the sensitive element
1555 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1556 // 7.5 cm is the lenght
1557 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1559 // --- Make the ghost volume invisible
1561 gMC->Gsatt("IDV2", "SEEN", 0);
1563 //--- Define the part of the (larger) rib between two sensitive parts madeof
1564 // carbon (layer #3)
1566 dsup[0] = .65 - dits[0];
1568 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1569 // 7.5 cm is the lenght
1570 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1572 //--- Define the first part of the (larger) rib between two sensitive parts
1573 // made of aluminum (layer #3)
1575 dal1[0] = .65 - dits[0];
1576 dal1[1] = 0.00096/2.;
1577 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1578 // 7.5 cm is the lenght
1579 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1581 //--- Define the part of the (larger) rib between two sensitive parts madeof
1582 // kapton (layer #3)
1584 dkap[0] = .65 - dits[0];
1585 dkap[1] = 0.0317/2.;
1586 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1587 // 7.5 cm is the lenght
1588 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1590 //--- Define the second part of the (larger) rib between two sensitive parts
1591 // made of aluminum (layer #3)
1593 dal2[0] = .65 - dits[0];
1594 dal2[1] = 0.0027/2.;
1595 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1596 // 7.5 cm is the lenght
1597 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1599 // --- Define the part of the (larger) rib between two sensitive parts
1600 // made of silicon (the electronics) (layer #3)
1602 dchi[0] = .65 - dits[0];
1603 dchi[1] = 0.0071/2.;
1604 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1605 // 7.5 cm is the lenght
1606 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1608 // --- Define the part of the (larger) rib between two sensitive parts
1609 // made of water (the cooler) (layer #3)
1611 dwat[0] = .65 - dits[0];
1612 dwat[1] = 0.0093/2.;
1613 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1614 // 7.5 cm is the lenght
1615 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1617 //--- Define the third part of the (larger) rib between two sensitive parts
1618 // made of aluminum (the cooling tubes) (layer #3)
1620 dtub[0] = .65 - dits[0];
1621 dtub[1] = 0.00134/2.;
1622 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1623 // 7.5 cm is the lenght
1624 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1626 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1630 for (j = 1; j <= 5; ++j) {
1631 // odd element are up and even elements are down
1633 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1634 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1635 } else if (j == 2) {
1636 xpos = -dbox2[0] + dits[0];
1637 zpos = 0. - dits[2] + 1. - dits[2];
1638 } else if (j == 3) {
1639 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1641 } else if (j == 4) {
1642 xpos = -dbox2[0] + dits[0];
1643 zpos = dits[2] + 0. - 1. + dits[2];
1644 } else if (j == 5) {
1645 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1646 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1648 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1651 // --- Place the larger ribs into their mother (IDV2)
1654 // --- Right ribs (just a matter of convention)
1656 xpos = .65 - dbox2[0] + dits[0];
1662 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1666 ypos = dsup[1] + 2.81 + dal1[1];
1667 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1671 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1672 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1676 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1677 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1679 // --- Silicon (chip)
1681 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1682 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1686 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1687 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1691 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1692 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1694 // --- Right ribs (just a matter of convention)
1699 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1703 ypos = -(dsup[1] + 2.81 + dal1[1]);
1704 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1708 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1709 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1713 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1714 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1716 // --- Silicon (chip)
1718 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1719 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1723 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1724 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1728 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1729 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1731 // --- Place the end-ladder stuff into its mother (IDV1)
1734 // --- Negative-Z end-ladder
1737 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1741 xpos = dbox2[0] - dpcb[0];
1742 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1746 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1747 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1751 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1752 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1754 // --- Silicon (bus)
1756 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1757 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1759 // --- Positive-Z end-ladder
1762 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1766 xpos = dbox2[0] - dpcb[0];
1767 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1771 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1772 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1776 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1777 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1779 // --- Silicon (bus)
1781 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1782 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1784 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1785 // mother volume (IT34)
1786 // Odd elements have large ribs and even elements have small ribs
1788 for (i = 1; i <= 12; ++i) {
1789 atheta = (i-1) * 30.;
1790 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1793 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1794 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1796 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1799 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1800 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1802 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1809 // GOTO 4567 ! skip ITS layer no. 4
1811 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1812 // smaller lenght of ribs) and fill it with air or vacuum
1814 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1816 // the widest element is the end-ladder stuff
1817 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1818 // 7.5 cm is the lenght
1819 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1821 // --- Make the ghost volume invisible
1823 gMC->Gsatt("IDV3", "SEEN", 0);
1825 // --- Define a volume containing the sensitive part of drifts
1826 // (silicon, layer #4)
1829 // see material budget report by G. Feofilov
1832 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1834 //--- Define the part of the (smaller) rib between two sensitive parts made of
1835 // carbon (layer #4)
1837 dsup[0] = .5 - dits[0];
1839 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1840 // 7.5 cm is the lengh
1841 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1843 //--- Define the first part of the (smaller) rib between two sensitive parts
1844 // made of aluminum (layer #4)
1846 dal1[0] = .5 - dits[0];
1847 dal1[1] = 0.00096/2.;
1848 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1849 // 7.5 cm is the lengh
1850 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1852 //--- Define the part of the (smaller) rib between two sensitive parts made of
1853 // kapton (layer #4)
1855 dkap[0] = .5 - dits[0];
1856 dkap[1] = 0.0317/2.;
1857 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1858 // 7.5 cm is the lengh
1859 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1861 //--- Define the second part of the (smaller) rib between two sensitive parts
1862 // made of aluminum (layer #4)
1864 dal2[0] = .5 - dits[0];
1865 dal2[1] = 0.0027/2.;
1866 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1867 // 7.5 cm is the lengh
1868 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1870 // --- Define the part of the (smaller) rib between two sensitive parts
1871 // made of silicon (the electronics) (layer #4)
1873 dchi[0] = .5 - dits[0];
1874 dchi[1] = 0.0071/2.;
1875 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1876 // 7.5 cm is the lengh
1877 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1879 // --- Define the part of the (smaller) rib between two sensitive parts
1880 // made of water (the cooler) (layer #4)
1882 dwat[0] = .5 - dits[0];
1883 dwat[1] = 0.0093/2.;
1884 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1885 // 7.5 cm is the lenght
1886 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1888 //--- Define the third part of the (smaller) rib between two sensitive parts
1889 // made of aluminum (the cooling tubes) (layer #4)
1891 dtub[0] = .5 - dits[0];
1892 dtub[1] = 0.00134/2.;
1893 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1894 // 7.5 cm is the lengh
1895 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1897 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1900 // twice the foreseen thickness
1903 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1905 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1908 // twice the foreseen thickness
1911 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1913 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1916 // twice the foreseen thickness
1919 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1921 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1924 // twice the foreseen thickness
1927 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1929 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1933 for (j = 1; j <= 7; ++j) {
1934 // odd elements are down and even elements are up
1936 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1937 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1938 } else if (j == 2) {
1939 xpos = -dbox1[0] + dits[0];
1940 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1941 } else if (j == 3) {
1942 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1943 zpos = 0. - dits[2] + .7 - dits[2];
1944 } else if (j == 4) {
1945 xpos = -dbox1[0] + dits[0];
1947 } else if (j == 5) {
1948 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1949 zpos = dits[2] + 0. - .7 + dits[2];
1950 } else if (j == 6) {
1951 xpos = -dbox1[0] + dits[0];
1952 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1953 } else if (j == 7) {
1954 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1955 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1957 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1960 // --- Place the smaller ribs into their mother (IDV3)
1962 // --- Right ribs (just a matter of convention)
1964 xpos = .5 - dbox1[0] + dits[0];
1970 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1974 ypos = dsup[1] + 2.81 + dal1[1];
1975 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1979 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1980 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1984 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1985 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1987 // --- Silicon (chip)
1989 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1990 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1994 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1995 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1999 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2001 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2003 // --- Right ribs (just a matter of convention)
2008 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2012 ypos = -(dsup[1] + 2.81 + dal1[1]);
2013 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2017 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2018 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2022 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2024 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2026 // --- Silicon (chip)
2028 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2029 2. + dal2[1] * 2. + dchi[1]);
2030 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2034 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2035 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2036 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2040 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2041 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2043 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2045 // --- Place the end-ladder stuff into its mother (IDV1)
2048 // --- Negative-Z end-ladder
2051 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2055 xpos = dbox1[0] - dpcb[0];
2056 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2060 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2061 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2065 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2066 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2068 // --- Silicon (bus)
2070 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2071 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2073 // --- Positive-Z end-ladder
2076 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2080 xpos = dbox1[0] - dpcb[0];
2081 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2085 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2086 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2090 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2091 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2093 // --- Silicon (bus)
2095 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2096 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2098 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2099 // larger lenght of ribs) and fill it with air or vacuum
2101 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2103 // the widest element is the end-ladder stuff
2104 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2105 // 7.5 cm is the lenght
2106 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2108 // --- Make the ghost volume invisible
2110 gMC->Gsatt("IDV4", "SEEN", 0);
2112 //--- Define the part of the (larger) rib between two sensitive parts madeof
2113 // carbon (layer #4)
2115 dsup[0] = .65 - dits[0];
2117 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2118 // 7.5 cm is the lengh
2119 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2121 //--- Define the first part of the (larger) rib between two sensitive parts
2122 // made of aluminum (layer #4)
2124 dal1[0] = .65 - dits[0];
2125 dal1[1] = 0.00096/2.;
2126 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2127 // 7.5 cm is the lengh
2128 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2130 //--- Define the part of the (larger) rib between two sensitive parts madeof
2131 // kapton (layer #4)
2133 dkap[0] = .65 - dits[0];
2134 dkap[1] = 0.0317/2.;
2135 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2136 // 7.5 cm is the lengh
2137 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2139 //--- Define the second part of the (larger) rib between two sensitive parts
2140 // made of aluminum (layer #4)
2142 dal2[0] = .65 - dits[0];
2143 dal2[1] = 0.0027/2.;
2144 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2145 // 7.5 cm is the lengh
2146 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2148 // --- Define the part of the (larger) rib between two sensitive parts
2149 // made of silicon (the electronics) (layer #4)
2151 dchi[0] = .65 - dits[0];
2152 dchi[1] = 0.0071/2.;
2153 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2154 // 7.5 cm is the lengh
2155 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2157 // --- Define the part of the (larger) rib between two sensitive parts
2158 // made of water (the cooler) (layer #4)
2160 dwat[0] = .65 - dits[0];
2161 dwat[1] = 0.0093/2.;
2162 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2163 // 7.5 cm is the lengh
2164 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2166 //--- Define the third part of the (larger) rib between two sensitive parts
2167 // made of aluminum (the cooling tubes) (layer #4)
2169 dtub[0] = .65 - dits[0];
2170 dtub[1] = 0.00134/2.;
2171 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2172 // 7.5 cm is the lengh
2173 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2175 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2179 for (j = 1; j <= 7; ++j) {
2180 // odd elements are down and even elements are up
2182 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2183 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2184 } else if (j == 2) {
2185 xpos = -dbox2[0] + dits[0];
2186 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2187 } else if (j == 3) {
2188 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2189 zpos = 0. - dits[2] + .7 - dits[2];
2190 } else if (j == 4) {
2191 xpos = -dbox2[0] + dits[0];
2193 } else if (j == 5) {
2194 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2195 zpos = dits[2] + 0. - .7 + dits[2];
2196 } else if (j == 6) {
2197 xpos = -dbox2[0] + dits[0];
2198 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2199 } else if (j == 7) {
2200 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2201 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2203 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2206 // --- Place the larger ribs into their mother (IDV4)
2209 // --- Right ribs (just a matter of convention)
2211 xpos = .65 - dbox2[0] + dits[0];
2217 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2221 ypos = dsup[1] + 2.81 + dal1[1];
2222 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2226 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2227 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2231 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2232 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2234 // --- Silicon (chip)
2236 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2237 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2241 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2242 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2246 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2248 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2250 // --- Right ribs (just a matter of convention)
2255 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2259 ypos = -(dsup[1] + 2.81 + dal1[1]);
2260 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2264 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2265 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2269 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2271 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2273 // --- Silicon (chip)
2275 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2276 2. + dal2[1] * 2. + dchi[1]);
2277 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2281 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2282 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2283 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2287 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2288 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2289 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2291 // --- Place the end-ladder stuff into its mother (IDV1)
2294 // --- Negative-Z end-ladder
2297 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2301 xpos = dbox2[0] - dpcb[0];
2302 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2306 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2307 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2311 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2312 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2314 // --- Silicon (bus)
2316 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2317 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2319 // --- Positive-Z end-ladder
2322 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2326 xpos = dbox2[0] - dpcb[0];
2327 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2331 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2332 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2336 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2337 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2339 // --- Silicon (bus)
2341 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2342 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2344 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2345 // mother volume (IT34)
2346 // Odd elements have large ribs and even elements have small ribs
2348 for (i = 1; i <= 24; ++i) {
2349 atheta = (i-1) * 15.;
2350 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2353 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2354 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2356 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2358 rzero = (24.0+22.8)/2.;
2359 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2360 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2362 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2366 //************************************************************************
2371 //************************************************************************
2373 // --- Define SSD with the 35+39 lay-out
2375 if (fMinorVersionV3 < 3) {
2377 //--- Define ghost volume containing the Strip Detectors and fill it with air
2380 xxm = (49.999-3.)/(70.-25.);
2384 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2385 (37.-27)/xxm-(49.998-37.)/xxm;
2388 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2392 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2396 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2397 (37.-27)/xxm+(49.998-37.)/xxm;
2400 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2401 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2402 gMC->Gsatt("IT56", "SEEN", 0);
2406 // GOTO 5678 ! skip ITS layer no. 5
2408 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2409 // it with air or vacuum
2411 dbox1[0] = (0.0600+2.*0.0150)/2.;
2413 dbox1[2] = 90.22/2.;
2414 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2416 // --- Make the ghost volume invisible
2418 gMC->Gsatt("ISV1", "SEEN", 0);
2420 // --- Define a ghost volume containing the electronics and cooling of
2421 // a single ladder of layer #5 and fill it with air or vacuum
2423 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2426 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2428 // --- Make the ghost volume invisible
2430 gMC->Gsatt("SSV1", "SEEN", 0);
2432 // --- Define a ghost volume containing the end-ladder stuff of
2433 // a single ladder of layer #5 and fill it with air or vacuum
2438 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2440 // --- Make the ghost volume invisible
2442 gMC->Gsatt("ELL5", "SEEN", 0);
2444 // --- Define a volume containing the sensitive part of the strips
2445 // (silicon, layer #5)
2450 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2452 // --- Define a volume containing the electronics of the strips
2453 // (silicon, layer #5)
2458 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2460 // --- Define the cooling tubes (aluminum, layer #5)
2463 dtub[1] = dtub[0] + .01;
2465 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2467 // --- Define the cooling fluid (water or freon, layer #5)
2472 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2473 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2475 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2483 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2484 dfra[6] = dfra[5] + .03;
2488 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2490 // --- Define the element connecting the triangles of the heat bridge
2491 // (carbon, layer #5)
2496 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2498 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2501 dpla[0] = (10./(8.*7.))/2.;
2504 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2506 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2508 dcop[0] = (2./(8.*7.))/2.;
2511 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2513 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2515 depx[0] = (30./(8.*7.))/2.;
2518 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2520 // --- Define the part of the end-ladder stuff made of silicon (bus)
2523 dsil[0] = (20./(8.*7.))/2.;
2526 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2528 // --- Place the end-ladder stuff into its mother (ELL5)
2530 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2536 xpos = -dela[0] + dpla[0];
2537 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2541 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2542 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2546 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2547 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2549 // --- Silicon (bus)
2551 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2552 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2554 // --- Place the sensitive part of the strips into its mother (ISV1)
2557 for (j = 1; j <= 23; ++j) {
2558 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2559 else xpos = -dbox1[0] + dits[0];
2560 zpos = ((j - 1) - 11.) * 3.91;
2561 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2564 // --- Place the electronics of the strips into its mother (SSV1)
2567 for (j = 1; j <= 23; ++j) {
2568 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2569 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2570 zpos = ((j - 1) - 11.) * 3.91 + .85;
2571 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2574 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2576 xpos = -dsrv[0] + .41;
2579 // --- Left tube (just a matter of convention)
2582 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2583 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2585 // --- Right tube (just a matter of convention)
2588 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2589 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2591 // --- Place the heat bridge elements into their mother (SSV1)
2593 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2595 for (j = 1; j <= 24; ++j) {
2596 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2597 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2600 // --- Place the elements connecting the triangles of the heat bridge
2601 // into their mother (SSV1)
2605 // --- Left element (just a matter of convention)
2607 xpos = -dsrv[0] + .47;
2608 ypos = -(2.1+0.015);
2609 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2611 // --- Right element
2613 xpos = -dsrv[0] + .47;
2615 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2619 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2621 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2623 // --- Place the ghost volumes containing the strip ladders (ISV1),
2624 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2625 // their mother volume (IT56)
2627 offset1 = TMath::ATan2(.9, 40.);
2629 rzero = dbox1[0] + 40.;
2630 runo = dbox1[0] * 2. + 40. + dsrv[0];
2631 rtwo = dbox1[0] * 2. + 40. + dela[0];
2632 for (i = 1; i <= 35; ++i) {
2633 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2634 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2636 // --- Strip ladders
2638 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2639 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2641 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2643 // --- Electronics/cooling
2645 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2646 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2648 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2650 // --- End-ladders (nagative-Z and positive-Z)
2652 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2653 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2654 zpos = -(dbox1[2] + dela[2] + 6.);
2655 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2656 zpos = dbox1[2] + dela[2] + 6.;
2657 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2663 // GOTO 5778 ! skip ITS layer no. 6
2665 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2666 // it with air or vacuum
2668 dbox2[0] = (0.0600+2.*0.0150)/2.;
2670 dbox2[2] = 101.95/2.;
2671 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2673 // --- Make the ghost volume invisible
2675 gMC->Gsatt("ISV2", "SEEN", 0);
2677 // --- Define a ghost volume containing the electronics and cooling of
2678 // a single ladder of layer #6 and fill it with air or vacuum
2680 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2682 dsrv[2] = 101.95/2.;
2683 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2685 // --- Make the ghost volume invisible
2687 gMC->Gsatt("SSV2", "SEEN", 0);
2689 // --- Define a ghost volume containing the end-ladder stuff of
2690 // a single ladder of layer #6 and fill it with air or vacuum
2695 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2697 // --- Make the ghost volume invisible
2699 gMC->Gsatt("ELL6", "SEEN", 0);
2701 // --- Define a volume containing the sensitive part of the strips
2702 // (silicon, layer #6)
2707 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2709 // --- Define a volume containing the electronics of the strips
2710 // (silicon, layer #6)
2715 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2717 // --- Define the cooling tubes (aluminum, layer #6)
2720 dtub[1] = dtub[0] + .01;
2721 dtub[2] = 101.95/2.;
2722 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2724 // --- Define the cooling fluid (water or freon, layer #6)
2728 dwat[2] = 101.95/2.;
2729 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2730 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2732 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2740 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2741 dfra[6] = dfra[5] + .03;
2745 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2747 // --- Define the element connecting the triangles of the heat bridge
2748 // (carbon, layer #6)
2752 dcei[2] = 101.95/2.;
2753 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2755 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2758 dpla[0] = (10./(8.*7.))/2.;
2761 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2763 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2765 dcop[0] = (2./(8.*7.))/2.;
2768 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2770 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2772 depx[0] = (30./(8.*7.))/2.;
2775 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2777 // --- Define the part of the end-ladder stuff made of silicon (bus)
2780 dsil[0] = (20./(8.*7.))/2.;
2783 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2785 // --- Place the end-ladder stuff into its mother (ELL5)
2787 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2793 xpos = -dela[0] + dpla[0];
2794 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2798 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2799 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2803 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2804 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2806 // --- Silicon (bus)
2808 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2809 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2811 // --- Place the sensitive part of the strips into its mother (ISV2)
2814 for (j = 1; j <= 26; ++j) {
2815 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2816 else xpos = -dbox2[0] + dits[0];
2817 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2818 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2821 // --- Place the electronics of the strips into its mother (SSV2)
2824 for (j = 1; j <= 26; ++j) {
2825 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2826 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2827 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2828 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2831 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2833 xpos = -dsrv[0] + .41;
2836 // --- Left tube (just a matter of convention)
2839 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2840 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2842 // --- Right tube (just a matter of convention)
2845 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2846 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2848 // --- Place the heat bridge elements into their mother (SSV2)
2850 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2852 for (j = 1; j <= 27; ++j) {
2853 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2854 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2857 // --- Place the elements connecting the triangles of the heat bridge
2858 // into their mother (SSV2)
2862 // --- Left element (just a matter of convention)
2864 xpos = -dsrv[0] + .47;
2865 ypos = -(2.1+0.015);
2866 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2868 // --- Right element
2870 xpos = -dsrv[0] + .47;
2872 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2876 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2878 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2880 // --- Place the ghost volumes containing the strip ladders (ISV2),
2881 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2882 // their mother volume (IT56)
2884 offset1 = TMath::ATan2(1., 45.);
2886 rzero = dbox2[0] + 45.;
2887 runo = dbox2[0] * 2. + 45. + dsrv[0];
2888 rtwo = dbox2[0] * 2. + 45. + dela[0];
2889 for (i = 1; i <= 39; ++i) {
2890 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2891 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2893 // --- Strip ladders
2895 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2896 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2898 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2900 // --- Electronics/cooling
2902 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2903 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2905 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2907 // --- End-ladders (nagative-Z and positive-Z)
2909 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2910 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2911 zpos = -(dbox2[2] + dela[2] + 6.);
2912 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2913 zpos = dbox2[2] + dela[2] + 6.;
2914 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2919 // --- Define SSD with the 32+36 lay-out
2921 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
2923 //--- Define ghost volume containing the Strip Detectors and fill it with air
2926 xxm = (49.999-3.)/(70.-25.);
2930 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2931 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2934 dgh[6] = -25. - (9.-3.01) / xxm -
2935 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2938 dgh[9] = (9.-3.01) / xxm + 25. +
2939 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2942 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2943 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2946 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2947 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2948 gMC->Gsatt("IT56", "SEEN", 0);
2952 // GOTO 6678 ! skip ITS layer no. 5
2954 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2955 // it with air or vacuum
2957 dbox1[0] = (0.0600+2.*0.0150)/2.;
2959 dbox1[2] = 86.31/2.;
2960 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2962 // --- Make the ghost volume invisible
2964 gMC->Gsatt("ISV1", "SEEN", 0);
2966 // --- Define a ghost volume containing the electronics and cooling of
2967 // a single ladder of layer #5 and fill it with air or vacuum
2969 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2972 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2974 // --- Make the ghost volume invisible
2976 gMC->Gsatt("SSV1", "SEEN", 0);
2978 // --- Define a ghost volume containing the end-ladder stuff of
2979 // a single ladder of layer #5 and fill it with air or vacuum
2984 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2986 // --- Make the ghost volume invisible
2988 gMC->Gsatt("ELL5", "SEEN", 0);
2990 // --- Define a volume containing the sensitive part of the strips
2991 // (silicon, layer #5)
2996 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2998 // --- Define a volume containing the electronics of the strips
2999 // (silicon, layer #5)
3004 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3006 // --- Define the cooling tubes (aluminum, layer #5)
3009 dtub[1] = dtub[0] + .01;
3011 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3013 // --- Define the cooling fluid (water or freon, layer #5)
3018 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3019 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3021 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3029 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3030 dfra[6] = dfra[5] + .03;
3034 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3036 // --- Define the element connecting the triangles of the heat bridge
3037 // (carbon, layer #5)
3042 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3044 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3047 dpla[0] = (10./(8.*7.))/2;
3050 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3052 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3054 dcop[0] = (2./(8.*7.))/2;
3057 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3059 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3061 depx[0] = (30./(8.*7.))/2.;
3064 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3066 // --- Define the part of the end-ladder stuff made of silicon (bus)
3069 dsil[0] = (20./(8.*7.))/2.;
3072 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3074 // --- Place the end-ladder stuff into its mother (ELL5)
3076 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3082 xpos = -dela[0] + dpla[0];
3083 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3087 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3088 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3092 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3093 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3095 // --- Silicon (bus)
3097 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3098 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3100 // --- Place the sensitive part of the strips into its mother (ISV1)
3103 for (j = 1; j <= 22; ++j) {
3104 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3105 else xpos = -dbox1[0] + dits[0];
3106 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3107 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3110 // --- Place the electronics of the strips into its mother (SSV1)
3113 for (j = 1; j <= 22; ++j) {
3114 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3115 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3116 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3117 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3120 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3122 xpos = -dsrv[0] + .41;
3125 // --- Left tube (just a matter of convention)
3128 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3129 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3131 // --- Right tube (just a matter of convention)
3134 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3135 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3137 // --- Place the heat bridge elements into their mother (SSV1)
3139 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3141 for (j = 1; j <= 23; ++j) {
3142 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3143 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3146 // --- Place the elements connecting the triangles of the heat bridge
3147 // into their mother (SSV1)
3151 // --- Left element (just a matter of convention)
3153 xpos = -dsrv[0] + .47;
3154 ypos = -(2.1+0.015);
3155 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3157 // --- Right element
3159 xpos = -dsrv[0] + .47;
3161 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3165 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3167 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3169 // --- Place the ghost volumes containing the strip ladders (ISV1),
3170 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3171 // their mother volume (IT56)
3173 offset1 = TMath::ATan2(.8, 36.6);
3175 rzero = dbox1[0] + 36.6;
3176 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3177 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3178 for (i = 1; i <= 32; ++i) {
3179 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3180 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3182 // --- Strip ladders
3184 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3185 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3187 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3189 // --- Electronics/cooling
3191 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3192 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3194 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3196 // --- End-ladders (nagative-Z and positive-Z)
3198 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3199 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3200 zpos = -(dbox1[2] + dela[2] + 6.);
3201 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3202 zpos = dbox1[2] + dela[2] + 6.;
3203 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3209 // GOTO 6778 ! skip ITS layer no. 6
3211 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3212 // it with air or vacuum
3214 dbox2[0] = (0.0600+2.*0.0150)/2.;
3216 dbox2[2] = 94.13/2.;
3217 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3219 // --- Make the ghost volume invisible
3221 gMC->Gsatt("ISV2", "SEEN", 0);
3223 // --- Define a ghost volume containing the electronics and cooling of
3224 // a single ladder of layer #6 and fill it with air or vacuum
3226 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3229 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3231 // --- Make the ghost volume invisible
3233 gMC->Gsatt("SSV2", "SEEN", 0);
3235 // --- Define a ghost volume containing the end-ladder stuff of
3236 // a single ladder of layer #6 and fill it with air or vacuum
3241 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3243 // --- Make the ghost volume invisible
3245 gMC->Gsatt("ELL6", "SEEN", 0);
3247 // --- Define a volume containing the sensitive part of the strips
3248 // (silicon, layer #6)
3253 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3255 // --- Define a volume containing the electronics of the strips
3256 // (silicon, layer #6)
3261 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3263 // --- Define the cooling tubes (aluminum, layer #6)
3266 dtub[1] = dtub[0] + .01;
3268 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3270 // --- Define the cooling fluid (water or freon, layer #6)
3275 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3276 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3278 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3286 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3287 dfra[6] = dfra[5] + .03;
3291 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3293 // --- Define the element connecting the triangles of the heat bridge
3294 // (carbon, layer #6)
3299 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3301 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3304 dpla[0] = (10./(8.*7.))/2;
3307 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3309 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3311 dcop[0] = (2./(8.*7.))/2;
3314 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3316 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3318 depx[0] = (30./(8.*7.))/2.;
3321 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3323 // --- Define the part of the end-ladder stuff made of silicon (bus)
3326 dsil[0] = (20./(8.*7.))/2.;
3329 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3331 // --- Place the end-ladder stuff into its mother (ELL5)
3333 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3339 xpos = -dela[0] + dpla[0];
3340 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3344 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3345 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3349 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3350 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3352 // --- Silicon (bus)
3354 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3355 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3357 // --- Place the sensitive part of the strips into its mother (ISV2)
3360 for (j = 1; j <= 24; ++j) {
3361 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3362 else xpos = dbox2[0] - dits[0];
3363 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3364 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3367 // --- Place the electronics of the strips into its mother (SSV2)
3370 for (j = 1; j <= 24; ++j) {
3371 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3372 else xpos = -dsrv[0] + .28;
3373 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3374 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3377 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3379 xpos = -dsrv[0] + .41;
3382 // --- Left tube (just a matter of convention)
3385 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3386 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3388 // --- Right tube (just a matter of convention)
3391 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3392 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3394 // --- Place the heat bridge elements into their mother (SSV2)
3396 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3398 for (j = 1; j <= 25; ++j) {
3399 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3400 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3403 // --- Place the elements connecting the triangles of the heat bridge
3404 // into their mother (SSV2)
3408 // --- Left element (just a matter of convention)
3410 xpos = -dsrv[0] + .47;
3411 ypos = -(2.1+0.015);
3412 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3414 // --- Right element
3416 xpos = -dsrv[0] + .47;
3418 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3422 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3424 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3426 // --- Place the ghost volumes containing the strip ladders (ISV2),
3427 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3428 // their mother volume (IT56)
3430 offset1 = TMath::ATan2(.9, 41.2);
3432 rzero = dbox2[0] + 41.2;
3433 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3434 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3435 for (i = 1; i <= 36; ++i) {
3436 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3437 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3439 // --- Strip ladders
3441 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3442 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3444 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3446 // --- Electronics/cooling
3448 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3449 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3451 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3453 // --- End-ladders (nagative-Z and positive-Z)
3455 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3456 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3457 zpos = -(dbox2[2] + dela[2] + 6.);
3458 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3459 zpos = dbox2[2] + dela[2] + 6.;
3460 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3466 //************************************************************************
3468 //* E N D - C A P S A N D F R A M E S *
3469 //* ========================================= *
3471 //************************************************************************
3473 // --- Define a dummy cylinder for multiple scattering tests
3475 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3478 // DITS(2)=DITS(1)+0.1
3480 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3481 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3484 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3486 // GOTO 8901 ! skip outer wall
3488 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3491 dits[1] = dits[0] + .06926;
3492 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3494 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3495 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3500 // --- The frame between the end-caps (octagonal lay-out) ---
3502 // GOTO 9012 ! skip octagonal frame
3504 if (fMinorVersionV3 == 1) {
3509 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3512 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3514 offset = angle / 2.;
3515 for (i = 0; i < 8; ++i) {
3516 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3517 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3519 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3520 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3524 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3525 aphi2 = 180. - aphi1;
3526 xpos = (xtra[0] + xtra[1]) / 2.;
3527 ypos = (ytra[0] + ytra[1]) / 2.;
3528 zpos = dtra[2] / 2.;
3529 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3532 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3533 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3534 zpos = -dtra[2] / 2.;
3535 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3538 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3539 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3542 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3543 aphi1 = 180. - aphi2;
3544 xpos = (xtra[1] + xtra[2]) / 2.;
3545 ypos = (ytra[1] + ytra[2]) / 2.;
3546 zpos = dtra[2] / 2.;
3547 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3550 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3551 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3552 zpos = -dtra[2] / 2.;
3553 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3556 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3557 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3560 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;
3561 aphi2 = 180. - aphi1;
3562 xpos = (xtra[2] + xtra[3]) / 2.;
3563 ypos = (ytra[2] + ytra[3]) / 2.;
3564 zpos = dtra[2] / 2.;
3565 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3568 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3569 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3570 zpos = -dtra[2] / 2.;
3571 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3574 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3575 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3578 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;
3579 aphi1 = 180. - aphi2;
3580 xpos = (xtra[3] + xtra[4]) / 2.;
3581 ypos = (ytra[3] + ytra[4]) / 2.;
3582 zpos = dtra[2] / 2.;
3583 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3586 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3587 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3588 zpos = -dtra[2] / 2.;
3589 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3592 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3593 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3596 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3597 aphi1 = 180. - aphi2;
3598 xpos = (xtra[4] + xtra[5]) / 2.;
3599 ypos = (ytra[4] + ytra[5]) / 2.;
3600 zpos = dtra[2] / 2.;
3601 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3604 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3605 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3606 zpos = -dtra[2] / 2.;
3607 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3610 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3611 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3614 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3615 aphi2 = 180. - aphi1;
3616 xpos = (xtra[5] + xtra[6]) / 2.;
3617 ypos = (ytra[5] + ytra[6]) / 2.;
3618 zpos = dtra[2] / 2.;
3619 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3622 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3623 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3624 zpos = -dtra[2] / 2.;
3625 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3628 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3629 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3632 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;
3633 aphi1 = 180. - aphi2;
3634 xpos = (xtra[6] + xtra[7]) / 2.;
3635 ypos = (ytra[6] + ytra[7]) / 2.;
3636 zpos = dtra[2] / 2.;
3637 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3640 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3641 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3642 zpos = -dtra[2] / 2.;
3643 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3646 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3647 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3650 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;
3651 aphi2 = 180. - aphi1;
3652 xpos = (xtra[7] + xtra[0]) / 2.;
3653 ypos = (ytra[7] + ytra[0]) / 2.;
3654 zpos = dtra[2] / 2.;
3655 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3658 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3659 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3660 zpos = -dtra[2] / 2.;
3661 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3664 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3665 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3668 } else if (fMinorVersionV3 == 4) {
3674 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3677 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3679 offset = angle / 2.;
3680 for (i = 0; i < 8; ++i) {
3681 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3682 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3684 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3685 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3689 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3690 aphi2 = 180. - aphi1;
3691 xpos = (xtra[0] + xtra[1]) / 2.;
3692 ypos = (ytra[0] + ytra[1]) / 2.;
3693 zpos = dtra[2] / 2.;
3694 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3697 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3698 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3699 zpos = -dtra[2] / 2.;
3700 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3703 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3704 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3707 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3708 aphi1 = 180. - aphi2;
3709 xpos = (xtra[1] + xtra[2]) / 2.;
3710 ypos = (ytra[1] + ytra[2]) / 2.;
3711 zpos = dtra[2] / 2.;
3712 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3715 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3716 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3717 zpos = -dtra[2] / 2.;
3718 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3721 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3722 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3725 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;
3726 aphi2 = 180. - aphi1;
3727 xpos = (xtra[2] + xtra[3]) / 2.;
3728 ypos = (ytra[2] + ytra[3]) / 2.;
3729 zpos = dtra[2] / 2.;
3730 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3733 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3734 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3735 zpos = -dtra[2] / 2.;
3736 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3739 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3740 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3743 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;
3744 aphi1 = 180. - aphi2;
3745 xpos = (xtra[3] + xtra[4]) / 2.;
3746 ypos = (ytra[3] + ytra[4]) / 2.;
3747 zpos = dtra[2] / 2.;
3748 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3751 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3752 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3753 zpos = -dtra[2] / 2.;
3754 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3757 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3758 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3761 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3762 aphi1 = 180. - aphi2;
3763 xpos = (xtra[4] + xtra[5]) / 2.;
3764 ypos = (ytra[4] + ytra[5]) / 2.;
3765 zpos = dtra[2] / 2.;
3766 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3769 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3770 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3771 zpos = -dtra[2] / 2.;
3772 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3775 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3776 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3779 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3780 aphi2 = 180. - aphi1;
3781 xpos = (xtra[5] + xtra[6]) / 2.;
3782 ypos = (ytra[5] + ytra[6]) / 2.;
3783 zpos = dtra[2] / 2.;
3784 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3787 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3788 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3789 zpos = -dtra[2] / 2.;
3790 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3793 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3794 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3797 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;
3798 aphi1 = 180. - aphi2;
3799 xpos = (xtra[6] + xtra[7]) / 2.;
3800 ypos = (ytra[6] + ytra[7]) / 2.;
3801 zpos = dtra[2] / 2.;
3802 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3805 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3806 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3807 zpos = -dtra[2] / 2.;
3808 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3811 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3812 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3815 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;
3816 aphi2 = 180. - aphi1;
3817 xpos = (xtra[7] + xtra[0]) / 2.;
3818 ypos = (ytra[7] + ytra[0]) / 2.;
3819 zpos = dtra[2] / 2.;
3820 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3823 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3824 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3825 zpos = -dtra[2] / 2.;
3826 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3829 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3830 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3836 // --- The frame between the end-caps (hexagonal lay-out) ---
3838 // GOTO 9123 ! skip hexagonal frame
3840 if (fMinorVersionV3 == 2) {
3845 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3851 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3853 offset = angle / 2.;
3854 for (i = 0; i < 6; ++i) {
3855 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3856 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3858 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3859 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3864 xpos = (xtra1[0] + xtra1[1]) / 2.;
3865 ypos = (ytra1[0] + ytra1[1]) / 2.;
3867 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3870 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3871 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3875 xpos = (xtra1[1] + xtra1[2]) / 2.;
3876 ypos = (ytra1[1] + ytra1[2]) / 2.;
3878 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3881 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3882 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3886 xpos = (xtra1[2] + xtra1[3]) / 2.;
3887 ypos = (ytra1[2] + ytra1[3]) / 2.;
3889 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3892 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3893 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3897 xpos = (xtra1[3] + xtra1[4]) / 2.;
3898 ypos = (ytra1[3] + ytra1[4]) / 2.;
3900 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3903 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3904 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3908 xpos = (xtra1[4] + xtra1[5]) / 2.;
3909 ypos = (ytra1[4] + ytra1[5]) / 2.;
3911 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3914 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3915 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3919 xpos = (xtra1[5] + xtra1[0]) / 2.;
3920 ypos = (ytra1[5] + ytra1[0]) / 2.;
3922 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3925 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3926 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3929 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3930 aphi1 = 180. - aphi2;
3931 xpos = (xtra1[0] + xtra1[1]) / 2.;
3932 ypos = (ytra1[0] + ytra1[1]) / 2.;
3933 zpos = dtra2[2] / 2.;
3934 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
3937 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3938 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3939 zpos = -dtra2[2] / 2.;
3940 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
3943 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3944 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3947 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3948 aphi2 = 180. - aphi1;
3949 xpos = (xtra1[1] + xtra1[2]) / 2.;
3950 ypos = (ytra1[1] + ytra1[2]) / 2.;
3951 zpos = dtra2[2] / 2.;
3952 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
3955 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3956 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3957 zpos = -dtra2[2] / 2.;
3958 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
3961 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3962 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3965 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3966 aphi1 = 180. - aphi2;
3967 xpos = (xtra1[2] + xtra1[3]) / 2.;
3968 ypos = (ytra1[2] + ytra1[3]) / 2.;
3969 zpos = dtra2[2] / 2.;
3970 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
3973 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3974 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3975 zpos = -dtra2[2] / 2.;
3976 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
3979 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3980 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3982 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
3983 - 50.*50.))) * raddeg;
3984 aphi2 = 180. - aphi1;
3985 xpos = (xtra1[2] + xtra1[3]) / 2.;
3986 ypos = (ytra1[2] + ytra1[3]) / 2.;
3987 zpos = dtra2[2] / 2.;
3988 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
3991 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3992 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
3993 zpos = -dtra2[2] / 2.;
3994 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
3997 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3998 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4001 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4002 aphi1 = 180. - aphi2;
4003 xpos = (xtra1[3] + xtra1[4]) / 2.;
4004 ypos = (ytra1[3] + ytra1[4]) / 2.;
4005 zpos = dtra2[2] / 2.;
4006 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4009 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4010 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4011 zpos = -dtra2[2] / 2.;
4012 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4015 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4016 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4019 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4020 aphi2 = 180. - aphi1;
4021 xpos = (xtra1[4] + xtra1[5]) / 2.;
4022 ypos = (ytra1[4] + ytra1[5]) / 2.;
4023 zpos = dtra2[2] / 2.;
4024 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4027 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4028 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4029 zpos = -dtra2[2] / 2.;
4030 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4033 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4034 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4037 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4038 aphi1 = 180. - aphi2;
4039 xpos = (xtra1[5] + xtra1[0]) / 2.;
4040 ypos = (ytra1[5] + ytra1[0]) / 2.;
4041 zpos = dtra2[2] / 2.;
4042 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4045 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4046 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4047 zpos = -dtra2[2] / 2.;
4048 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4051 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4052 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4054 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4055 aphi2 = 180. - aphi1;
4056 xpos = (xtra1[5] + xtra1[0]) / 2.;
4057 ypos = (ytra1[5] + ytra1[0]) / 2.;
4058 zpos = dtra2[2] / 2.;
4059 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4062 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4063 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4064 zpos = -dtra2[2] / 2.;
4065 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4068 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4069 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4072 } else if (fMinorVersionV3 == 5) {
4078 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4084 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4086 offset = angle / 2.;
4087 for (i = 0; i < 6; ++i) {
4088 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
4089 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
4091 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
4092 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4097 xpos = (xtra1[0] + xtra1[1]) / 2.;
4098 ypos = (ytra1[0] + ytra1[1]) / 2.;
4100 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
4103 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4104 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4108 xpos = (xtra1[1] + xtra1[2]) / 2.;
4109 ypos = (ytra1[1] + ytra1[2]) / 2.;
4111 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
4114 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4115 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4119 xpos = (xtra1[2] + xtra1[3]) / 2.;
4120 ypos = (ytra1[2] + ytra1[3]) / 2.;
4122 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
4125 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4126 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4130 xpos = (xtra1[3] + xtra1[4]) / 2.;
4131 ypos = (ytra1[3] + ytra1[4]) / 2.;
4133 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
4136 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4137 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4141 xpos = (xtra1[4] + xtra1[5]) / 2.;
4142 ypos = (ytra1[4] + ytra1[5]) / 2.;
4144 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
4147 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4148 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4152 xpos = (xtra1[5] + xtra1[0]) / 2.;
4153 ypos = (ytra1[5] + ytra1[0]) / 2.;
4155 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
4158 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4159 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4162 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4163 aphi1 = 180. - aphi2;
4164 xpos = (xtra1[0] + xtra1[1]) / 2.;
4165 ypos = (ytra1[0] + ytra1[1]) / 2.;
4166 zpos = dtra2[2] / 2.;
4167 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4170 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4171 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4172 zpos = -dtra2[2] / 2.;
4173 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4176 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4177 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4180 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4181 aphi2 = 180. - aphi1;
4182 xpos = (xtra1[1] + xtra1[2]) / 2.;
4183 ypos = (ytra1[1] + ytra1[2]) / 2.;
4184 zpos = dtra2[2] / 2.;
4185 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4188 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4189 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4190 zpos = -dtra2[2] / 2.;
4191 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4194 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4195 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4198 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4199 aphi1 = 180. - aphi2;
4200 xpos = (xtra1[2] + xtra1[3]) / 2.;
4201 ypos = (ytra1[2] + ytra1[3]) / 2.;
4202 zpos = dtra2[2] / 2.;
4203 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4206 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4207 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4208 zpos = -dtra2[2] / 2.;
4209 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4212 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4213 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4215 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4216 aphi2 = 180. - aphi1;
4217 xpos = (xtra1[2] + xtra1[3]) / 2.;
4218 ypos = (ytra1[2] + ytra1[3]) / 2.;
4219 zpos = dtra2[2] / 2.;
4220 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4223 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4224 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4225 zpos = -dtra2[2] / 2.;
4226 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4229 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4230 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4233 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4234 aphi1 = 180. - aphi2;
4235 xpos = (xtra1[3] + xtra1[4]) / 2.;
4236 ypos = (ytra1[3] + ytra1[4]) / 2.;
4237 zpos = dtra2[2] / 2.;
4238 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4241 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4242 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4243 zpos = -dtra2[2] / 2.;
4244 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4247 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4248 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4251 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4252 aphi2 = 180. - aphi1;
4253 xpos = (xtra1[4] + xtra1[5]) / 2.;
4254 ypos = (ytra1[4] + ytra1[5]) / 2.;
4255 zpos = dtra2[2] / 2.;
4256 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4259 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4260 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4261 zpos = -dtra2[2] / 2.;
4262 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4265 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4266 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4269 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4270 aphi1 = 180. - aphi2;
4271 xpos = (xtra1[5] + xtra1[0]) / 2.;
4272 ypos = (ytra1[5] + ytra1[0]) / 2.;
4273 zpos = dtra2[2] / 2.;
4274 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4277 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4278 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4279 zpos = -dtra2[2] / 2.;
4280 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4283 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4284 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4286 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4287 aphi2 = 180. - aphi1;
4288 xpos = (xtra1[5] + xtra1[0]) / 2.;
4289 ypos = (ytra1[5] + ytra1[0]) / 2.;
4290 zpos = dtra2[2] / 2.;
4291 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4294 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4295 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4296 zpos = -dtra2[2] / 2.;
4297 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4300 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4301 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4307 // --- Define the end-caps
4309 // GOTO 9234 ! skip both end-caps
4311 // --- Define the Z>0 end-cap
4313 // GOTO 9345 ! skip the Z>0 end-cap
4318 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4319 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4322 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4323 // end-ladder electro
4324 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4325 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4327 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4329 // In the Simonetti's drawings 52. In the TP 50.
4333 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4334 // end-ladder electro
4335 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4336 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4340 dtube[2] = 26.8/2./10.;
4343 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4345 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4346 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4352 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4353 // end-ladder electron
4356 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4357 // end-ladder electronics
4363 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4364 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4370 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4374 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4381 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4382 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4384 if (fMinorVersionV3 < 3 ) {
4386 dpgon[0] = offset2 + 360./(2.*35.);
4390 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4394 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4401 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4402 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4404 dpgon[0] = offset2 + 360./(2.*39.);
4408 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4412 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4419 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4420 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4422 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4424 dpgon[0] = offset2 + 5.625;
4428 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4429 // end-ladder electronics
4432 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4433 // end-ladder electr
4439 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4440 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4442 dpgon[0] = offset2 + 5.;
4446 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4447 // end-ladder electronics
4450 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4451 // end-ladder electr
4457 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4458 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4463 // --- Define the Z<0 end-cap
4465 // GOTO 9456 ! skip the Z<0 end-cap
4468 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4469 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4474 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4475 // end-ladder electr
4476 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4478 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4480 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4482 // In the Simonetti's drawings 52. In the TP 50.
4486 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4487 // end-ladder electr
4488 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4490 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4494 dtube[2] = 26.8/2./10.;
4497 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4499 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4501 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4507 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4508 // end-ladder electronics
4511 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4512 // end-ladder electro
4518 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4519 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4525 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4529 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4536 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4537 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4539 if (fMinorVersionV3 < 3) {
4541 dpgon[0] = offset2 + 360./(2.*35.);
4545 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4549 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4556 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4557 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4559 dpgon[0] = offset2 + 360./(2.*39.);
4563 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4567 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4574 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4575 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4577 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4579 dpgon[0] = offset2 + 5.625;
4583 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4584 // end-ladder electronics
4587 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4588 // end-ladder electr
4594 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4595 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4597 dpgon[0] = offset2 + 5.;
4601 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4602 // end-ladder electronics
4605 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4606 // end-ladder electr
4612 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4613 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4619 // --- Outputs the geometry tree in the EUCLID/CAD format
4622 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4624 fMinorVersion = fMinorVersionV3;
4627 //_____________________________________________________________________________
4628 void AliITSv3::CreateMaterials()
4631 // Create Materials for ITS
4633 AliITS::CreateMaterials();
4636 //_____________________________________________________________________________
4637 void AliITSv3::Init(){
4639 // Initialise its after it is built
4644 fIdName = new char*[fIdN];
4645 fIdSens = new Int_t[fIdN];
4646 for(i=0;i<fId3N;i++) {
4647 l = strlen(fId3Name[i]);
4648 fIdName[i] = new char[l+1];
4649 for(j=0;j<l;j++) fIdName[i][j] = fId3Name[i][j];
4650 fIdName[i][l] = '\0'; // Null terminate this string.
4655 fMinorVersion = fMinorVersionV3;
4658 //_____________________________________________________________________________
4659 void AliITSv3::StepManager()
4662 // Called at every step in ITS
4667 TLorentzVector position, momentum;
4668 TClonesArray &lhits = *fHits;
4672 if(gMC->IsTrackInside()) vol[3] += 1;
4673 if(gMC->IsTrackEntering()) vol[3] += 2;
4674 if(gMC->IsTrackExiting()) vol[3] += 4;
4675 if(gMC->IsTrackOut()) vol[3] += 8;
4676 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4677 if(gMC->IsTrackStop()) vol[3] += 32;
4678 if(gMC->IsTrackAlive()) vol[3] += 64;
4680 // Fill hit structure.
4681 if(gMC->TrackCharge() && gMC->Edep()) {
4683 // Only entering charged tracks
4684 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4686 id=gMC->CurrentVolOffID(1,copy);
4688 id=gMC->CurrentVolOffID(2,copy);
4690 } else if(id==fIdSens[1]) {
4692 id=gMC->CurrentVolOffID(1,copy);
4694 id=gMC->CurrentVolOffID(2,copy);
4696 } else if(id==fIdSens[2]) {
4699 id=gMC->CurrentVolOffID(1,copy);
4701 } else if(id==fIdSens[3]) {
4704 id=gMC->CurrentVolOffID(1,copy);
4706 } else if(id==fIdSens[4]) {
4709 id=gMC->CurrentVolOffID(1,copy);
4711 } else if(id==fIdSens[5]) {
4714 id=gMC->CurrentVolOffID(1,copy);
4717 gMC->TrackPosition(position);
4718 gMC->TrackMomentum(momentum);
4719 hits[0]=position[0];
4720 hits[1]=position[1];
4721 hits[2]=position[2];
4722 hits[3]=momentum[0];
4723 hits[4]=momentum[1];
4724 hits[5]=momentum[2];
4725 hits[6]=gMC->Edep();
4726 hits[7]=gMC->TrackTime();
4727 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
4731 //____________________________________________________________________________
4732 void AliITSv3::Streamer(TBuffer &R__b)
4734 // Stream an object of class AliITSv3.
4736 if (R__b.IsReading()) {
4737 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
4738 AliITS::Streamer(R__b);
4739 // This information does not need to be read. It is "hard wired"
4740 // into this class via its creators.
4742 //R__b.ReadArray(fId3Name);
4744 R__b.WriteVersion(AliITSv3::IsA());
4745 AliITS::Streamer(R__b);
4746 // This information does not need to be saved. It is "hard wired"
4747 // into this class via its creators.
4749 //R__b.WriteArray(fId3Name, __COUNTER__);