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.17 2000/07/10 16:07:19 fca
19 Release version of ITS code
21 Revision 1.11.4.4 2000/05/19 10:09:51 nilsen
22 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
24 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
25 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
26 <=23 (was <=24). This may not be the final version.
28 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
29 Fixed up the comments/documentation.
31 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
32 This is the version of the files after the merging done in December 1999.
33 See the ReadMe110100.txt file for details
35 Revision 1.11 1999/10/22 08:25:25 fca
36 remove double definition of destructors
38 Revision 1.10 1999/10/22 08:16:49 fca
39 Correct destructors, thanks to I.Hrivnacova
41 Revision 1.9 1999/10/06 19:56:50 fca
44 Revision 1.8 1999/10/05 08:05:09 fca
45 Minor corrections for uninitialised variables.
47 Revision 1.7 1999/09/29 09:24:20 fca
48 Introduction of the Copyright and cvs Log
52 ///////////////////////////////////////////////////////////////////////////////
54 // Inner Traking System version 3
55 // This class contains the base procedures for the Inner Tracking System
57 // Authors: R. Barbera, A. Morsch.
61 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
62 // WORK with the geometry or module classes or any analysis classes. You are
63 // strongly encouraged to uses AliITSv5.
65 ///////////////////////////////////////////////////////////////////////////////
67 // See AliITSv3::StepManager().
68 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
69 //#define ALIITSPRINTGEOM 1 // print out geometry information
74 #include <TGeometry.h>
77 #include <TFile.h> // only required for Tracking function?
79 #include <TObjArray.h>
80 #include <TClonesArray.h>
86 #include "AliITShit.h"
95 //_____________________________________________________________________________
96 AliITSv3::AliITSv3() {
97 ////////////////////////////////////////////////////////////////////////
98 // Standard default constructor for the ITS version 3.
99 ////////////////////////////////////////////////////////////////////////
102 fIdName = new TString[fIdN];
109 fIdSens = new Int_t[fIdN];
110 for (Int_t i=0;i<fIdN;i++) fIdSens[i]=fIdName[i].Length();
113 //____________________________________________________________________________
114 AliITSv3::AliITSv3(const AliITSv3 &source){
115 ////////////////////////////////////////////////////////////////////////
116 // Copy Constructor for ITS version 3.
117 ////////////////////////////////////////////////////////////////////////
118 if(&source == this) return;
119 printf("Not allowed to copy AliITSv3\n");
122 //_____________________________________________________________________________
123 AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
124 ////////////////////////////////////////////////////////////////////////
125 // Assignment operator for the ITS version 3.
126 ////////////////////////////////////////////////////////////////////////
127 if(&source == this) return *this;
128 printf("Not allowed to copy AliITSv3\n");
131 //_____________________________________________________________________________
132 AliITSv3::~AliITSv3() {
133 ////////////////////////////////////////////////////////////////////////
134 // Standard destructor for the ITS version 3.
135 ////////////////////////////////////////////////////////////////////////
137 //_____________________________________________________________________________
138 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
139 ////////////////////////////////////////////////////////////////////////
140 // Standard constructor for the ITS version 3.
141 ////////////////////////////////////////////////////////////////////////
143 fIdName = new TString[fIdN];
150 fIdSens = new Int_t[fIdN];
151 for (Int_t i=0;i<fIdN;i++) fIdSens[i]=fIdName[i].Length();
153 }//__________________________________________________________________________
154 void AliITSv3::BuildGeometry(){
155 ////////////////////////////////////////////////////////////////////////
156 // Geometry builder for the ITS version 3.
157 ////////////////////////////////////////////////////////////////////////
159 const int kColorITS=kYellow;
161 top = gAlice->GetGeometry()->GetNode("alice");
163 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
165 node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
166 node->SetLineColor(kColorITS);
169 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
171 node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
172 node->SetLineColor(kColorITS);
175 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
177 node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
178 node->SetLineColor(kColorITS);
181 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
183 node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
184 node->SetLineColor(kColorITS);
187 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
189 node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
190 node->SetLineColor(kColorITS);
193 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
195 node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
196 node->SetLineColor(kColorITS);
199 //_____________________________________________________________________________
200 void AliITSv3::CreateGeometry(){
201 ////////////////////////////////////////////////////////////////////////
202 // This routine creates and defines the version 3 geometry of the ITS.
203 ////////////////////////////////////////////////////////////////////////
205 const Float_t kxx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
206 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
208 const Float_t kyy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
209 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
211 const Float_t kxbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
212 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
214 const Float_t kybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
215 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
217 const Float_t kxend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
218 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
220 const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
221 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
223 const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
224 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
226 const Float_t kyarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
227 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
229 const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
230 0.5,0.7,0.5,0.7,0.5,0.5 };
231 const Float_t krr = 4.064516;
232 const Float_t ktteta = 63.00;
233 const Float_t kpphi = -35.00;
234 const Float_t kgteta = 87.78;
235 const Double_t kdegrad = kPI/180.;
236 const Double_t kraddeg = 180./kPI;
237 const Double_t ktwopi = 2*kPI;
240 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
241 dfra[10], dcer[3], dkap[3], dpla[3],
242 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
243 atheta1011, dbus[3], dtub[3], dwat[3],
244 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
245 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
246 Double_t biga1, bigb1;
247 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
248 dtra1[3], dtra2[3], dtra3[3],
249 dtra4[3], dbox1[3], dbox2[3];
251 Float_t xtra1[6], ytra1[6], ztra1[6];
253 Float_t xpos1, ypos1;
255 Float_t angle, dcone[5], dtube[3], dpgon[10];
256 Float_t rzero, xzero, yzero;
257 Double_t coeffa, coeffb, coeffc;
259 Float_t atheta, offset;
260 Float_t offset1, offset2, dgh[15];
261 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
262 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
265 Double_t xcc1, ycc1, xcc2, ycc2;
267 const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
268 "TR05","TR06","TR07","TR08"};
269 const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
270 "TR15","TR16","TR17","TR18",
271 "TR19","TR20","TR21","TR22",
272 "TR23","TR24","TR25","TR26"};
273 const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
274 const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
275 const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
276 "TR57","TR58","TR59","TR60","TR61","TR62",
277 "TR63","TR64","TR65","TR66"};
279 Int_t *idtmed = fIdtmed->GetArray()-199;
281 // --- Define a ghost volume containing the whole ITS and fill it with air
299 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
301 // --- Place the ghost volume in its mother volume (ALIC) and make it
304 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
305 gMC->Gsatt("ITSV", "SEEN", 0);
307 //************************************************************************
312 //************************************************************************
314 // GOTO 2345 ! skip ITS layer no. 1 and 2
316 // --- Define a ghost volume containing the Silicon Pixel Detectors
317 // (layer #1 and #2) and fill it with air or vacuum
319 xxm = (49.999-3)/(70-25);
323 dgh[3] = -25.-(9.-3.01)/xxm;
332 dgh[12] = 25+(9-3.01)/xxm;
335 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
337 // --- Place the ghost volume in its mother volume (ITSV) and make it
340 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
341 gMC->Gsatt("IT12", "SEEN", 0);
343 // --- Define a ghost volume containing a single element of layer #1
344 // and fill it with air or vacuum
346 dbox1[0] = 0.005+0.01+0.0075;
349 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
351 //--Divide each element of layer #1 in three ladders along the beam direction
353 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
355 // --- Make the ghost volumes invisible
357 gMC->Gsatt("IPV1", "SEEN", 0);
358 gMC->Gsatt("IPB1", "SEEN", 0);
360 // --- Define a volume containing the chip of pixels (silicon, layer #1)
364 dchi[2] = dbox1[2] / 3.;
365 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
367 // --- Define a volume containing the bus of pixels (silicon, layer #1)
372 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
374 // --- Define a volume containing the sensitive part of pixels
375 // (silicon, layer #1)
380 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
382 // --- Place the chip into its mother (IPB1)
384 xpos = dbox1[0] - dchi[0];
387 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
389 // --- Place the sensitive volume into its mother (IPB1)
391 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
392 ypos = dchi[1] - dits[1];
393 zpos = -(dchi[2] - dits[2]);
394 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
396 // --- Place the bus into its mother (IPB1)
398 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
399 ypos = dchi[1] - dbus[1];
400 zpos = -(dchi[2] - dbus[2]);
401 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
403 // --- Define a ghost volume containing a single element of layer #2
404 // and fill it with air or vacuum
406 dbox2[0] = 0.005+0.01+0.0075;
409 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
411 //--Divide each element of layer #2 in four ladders along the beam direction
413 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
415 // --- Make the ghost volumes invisible
417 gMC->Gsatt("IPV2", "SEEN", 0);
418 gMC->Gsatt("IPB2", "SEEN", 0);
420 // --- Define a volume containing the chip of pixels (silicon, layer #2)
424 dchi[2] = dbox2[2] / 4.;
425 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
427 // --- Define a volume containing the bus of pixels (silicon, layer #2)
432 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
434 // --- Define a volume containing the sensitive part of pixels
435 // (silicon, layer #2)
440 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
442 // --- Place the chip into its mother (IPB2)
444 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
447 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
449 // --- Place the sensitive volume into its mother (IPB2)
451 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
452 ypos = -(dchi[1] - dits[1]);
453 zpos = -(dchi[2] - dits[2]);
454 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
456 // --- Place the bus into its mother (IPB2)
458 xpos = dbox1[0] - dbus[0];
459 ypos = -(dchi[1] - dbus[1]);
460 zpos = -(dchi[2] - dbus[2]);
461 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
463 // --- Define a generic segment of an element of the mechanical support
468 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
470 // --- Define a generic arc of an element of the mechanical support
475 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
477 // --- Define the mechanical supports of layers #1 and #2 and place the
478 // elements of the layers in it
481 // counter over the number of elements of layer #1 (
484 // counter over the number of elements of layer #2 (
485 for (i = 1; i <= 10; ++i) {
487 // --- Place part # 1-2 (see sketch)
489 // number of carbon fiber supports (see sketch)
492 dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) +
493 (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0]) ) / 20.;
495 xcc = ( kxx[0] + kxx[1]) / 20.;
496 ycc = ( kyy[0] + kyy[1]) / 20.;
497 xccc = (kxbeg[0] + kxend[0]) / 20.;
498 yccc = (kybeg[0] + kyend[0]) / 20.;
499 if (kxx[0] == kxx[1]) {
502 r1 = kyy[1] - kyy[0];
503 r2 = kxx[1] - kxx[0];
504 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
505 } // end if kxx[0] == kxx[1]
506 aphi = (kpphi + (i-1) * 36.) * kdegrad;
507 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
508 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
509 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
510 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
511 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
512 ypos1 * TMath::Sin(kgteta *kdegrad);
513 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
514 ypos1 * TMath::Cos(kgteta * kdegrad);
516 atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
517 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
518 atheta12 + 90., 0., 0.);
519 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
520 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
522 // --- Place part # 2-3 (see sketch)
526 dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) +
527 (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
529 xcc = ( kxx[1] + kxx[2]) / 20.;
530 ycc = ( kyy[1] + kyy[2]) / 20.;
531 xccc = (kxbeg[1] + kxend[1]) / 20.;
532 yccc = (kybeg[1] + kyend[1]) / 20.;
533 if (kxx[1] == kxx[2]) {
536 r1 = kyy[2] - kyy[1];
537 r2 = kxx[2] - kxx[1];
538 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
539 } // end if kxx[1] == kxx[2]
540 aphi = (kpphi + (i-1) * 36.) * kdegrad;
541 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
542 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
543 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
544 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
545 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
546 ypos1 * TMath::Sin(kgteta * kdegrad);
547 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
548 ypos1 * TMath::Cos(kgteta * kdegrad);
550 atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
551 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
552 atheta23 + 90., 0., 0.);
553 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
554 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
556 // --- Place an element of layer #2
558 biga = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
559 bigb = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
560 coeffa = biga * biga + 1.;
561 coeffb = biga * bigb - biga * ycc - xcc;
562 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
563 bigb * bigb - 0.08964*0.08964;
564 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
566 ycc1 = biga * xcc1 + bigb;
568 bigb1 = xcc1 / biga + ycc1;
569 coeffa = biga1 * biga1 + 1.;
570 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
571 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
572 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
573 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
575 ycc2 = biga1 * xcc2 + bigb1;
576 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
577 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
578 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
579 ypos1 * TMath::Sin(kgteta *kdegrad);
580 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
581 ypos1 * TMath::Cos(kgteta * kdegrad);
584 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
585 idrotm[(i-1) * 13 + 1101], "ONLY");
587 // --- Place part # 3-4 (see sketch)
591 dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) +
592 (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
594 xcc = (kxx[1] + kxx[2]) / 20.;
595 ycc = (kyy[1] + kyy[2]) / 20.;
596 xccc = (kxbeg[2] + kxend[2]) / 20.;
597 yccc = (kybeg[2] + kyend[2]) / 20.;
598 if (kxx[2] == kxx[3]) {
601 r1 = kyy[3] - kyy[2];
602 r2 = kxx[3] - kxx[2];
603 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
604 } // end if kxx[2] == kxx[3]
605 aphi = (kpphi + (i-1) * 36.) * kdegrad;
606 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
607 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
608 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
609 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
610 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
611 ypos1 * TMath::Sin(kgteta *kdegrad);
612 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
613 ypos1 * TMath::Cos(kgteta * kdegrad);
615 atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
616 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
617 atheta34 + 90., 0., 0.);
618 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
619 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
621 // --- Place part # 4-5 (see sketch)
625 dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) +
626 (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
628 xcc = ( kxx[3] + kxx[4]) / 20.;
629 ycc = ( kyy[3] + kyy[4]) / 20.;
630 xccc = (kxbeg[3] + kxend[3]) / 20.;
631 yccc = (kybeg[3] + kyend[3]) / 20.;
632 if (kxx[3] == kxx[4]) {
635 r1 = kyy[4] - kyy[3];
636 r2 = kxx[4] - kxx[3];
637 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
638 } // end if kxx[3] == kxx[4]
639 aphi = (kpphi + (i-1) * 36.) * kdegrad;
640 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
641 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
642 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
643 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
644 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
645 ypos1 * TMath::Sin(kgteta *kdegrad);
646 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
647 ypos1 * TMath::Cos(kgteta * kdegrad);
649 atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
650 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
651 atheta45 + 90., 0., 0.);
652 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
653 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
655 // --- Place an element of layer #2
657 biga = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
658 bigb = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
659 coeffa = biga * biga + 1.;
660 coeffb = biga * bigb - biga * ycc - xcc;
661 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
662 bigb * bigb - .014285030400000001;
663 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
665 ycc1 = biga * xcc1 + bigb;
667 bigb1 = xcc1 / biga + ycc1;
668 coeffa = biga1 * biga1 + 1.;
669 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
670 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
671 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
672 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
674 ycc2 = biga1 * xcc2 + bigb1;
675 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
676 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
677 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
678 ypos1 * TMath::Sin(kgteta *kdegrad);
679 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
680 ypos1 * TMath::Cos(kgteta * kdegrad);
683 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
684 idrotm[(i-1) * 13 + 1103], "ONLY");
686 // --- Place part # 5-6 (see sketch)
690 dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) +
691 (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
693 xcc = (kxx[4] + kxx[5]) / 20.;
694 ycc = (kyy[4] + kyy[5]) / 20.;
695 xccc = (kxbeg[4] + kxend[4]) / 20.;
696 yccc = (kybeg[4] + kyend[4]) / 20.;
697 if (kxx[4] == kxx[5]) {
700 r1 = kyy[5] - kyy[4];
701 r2 = kxx[5] - kxx[4];
702 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
704 aphi = (kpphi + (i-1) * 36.) * kdegrad;
705 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
706 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
707 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
708 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
709 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
710 ypos1 * TMath::Sin(kgteta *kdegrad);
711 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
712 ypos1 * TMath::Cos(kgteta * kdegrad);
714 atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
715 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
716 atheta56 + 90., 0., 0.);
717 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
718 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
720 // --- Place part # 6-7 (see sketch)
724 dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) +
725 (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
727 xcc = (kxx[5] + kxx[6]) / 20.;
728 ycc = (kyy[5] + kyy[6]) / 20.;
729 xccc = (kxbeg[5] + kxend[5]) / 20.;
730 yccc = (kybeg[5] + kyend[5]) / 20.;
731 if (kxx[5] == kxx[6]) {
734 r1 = kyy[6] - kyy[5];
735 r2 = kxx[6] - kxx[5];
736 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
737 } // end if kxx[5] == kxx[6]
738 aphi = (kpphi + (i-1) * 36.) * kdegrad;
739 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
740 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
741 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
742 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
743 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
744 ypos1 * TMath::Sin(kgteta *kdegrad);
745 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
746 ypos1 * TMath::Cos(kgteta * kdegrad);
748 atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
749 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
750 atheta67 + 90., 0., 0.);
751 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
752 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
754 // --- Place an element of layer #2
756 biga = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
757 bigb = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
758 coeffa = biga * biga + 1.;
759 coeffb = biga * bigb - biga * ycc - xcc;
760 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
761 bigb * bigb - .014285030400000001;
762 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
764 ycc1 = biga * xcc1 + bigb;
766 bigb1 = xcc1 / biga + ycc1;
767 coeffa = biga1 * biga1 + 1.;
768 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
769 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
770 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
771 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
773 ycc2 = biga1 * xcc2 + bigb1;
774 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
775 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
776 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
777 ypos1 * TMath::Sin(kgteta *kdegrad);
778 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
779 ypos1 * TMath::Cos(kgteta * kdegrad);
782 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
783 idrotm[(i-1) * 13 + 1105], "ONLY");
785 // --- Place part # 7-8 (see sketch)
789 dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
790 (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
792 xcc = (kxx[6] + kxx[7]) / 20.;
793 ycc = (kyy[6] + kyy[7]) / 20.;
794 xccc = (kxbeg[6] + kxend[6]) / 20.;
795 yccc = (kybeg[6] + kyend[6]) / 20.;
796 if (kxx[6] == kxx[7]) {
799 r1 = kyy[7] - kyy[6];
800 r2 = kxx[7] - kxx[6];
801 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
803 aphi = (kpphi + (i-1) * 36.) * kdegrad;
804 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
805 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
806 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
807 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
808 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
809 ypos1 * TMath::Sin(kgteta *kdegrad);
810 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
811 ypos1 * TMath::Cos(kgteta * kdegrad);
813 atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
814 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
815 atheta78 + 90., 0., 0.);
816 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
817 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
819 // --- Place part # 8-9 (see sketch)
823 dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) +
824 (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
826 xcc = (kxx[7] + kxx[8]) / 20.;
827 ycc = (kyy[7] + kyy[8]) / 20.;
828 xccc = (kxbeg[7] + kxend[7]) / 20.;
829 yccc = (kybeg[7] + kyend[7]) / 20.;
830 if (kxx[1] == kxx[2]) {
833 r1 = kyy[8] - kyy[7];
834 r2 = kxx[8] - kxx[7];
835 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
837 aphi = (kpphi + (i-1) * 36.) * kdegrad;
838 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
839 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
840 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
841 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
842 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
843 ypos1 * TMath::Sin(kgteta *kdegrad);
844 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
845 ypos1 * TMath::Cos(kgteta * kdegrad);
847 atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
848 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
849 atheta89 + 90., 0., 0.);
850 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
851 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
853 // --- Place an element of layer #2
855 biga = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
856 bigb = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
857 coeffa = biga * biga + 1.;
858 coeffb = biga * bigb - biga * ycc - xcc;
859 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
860 bigb * bigb - .014285030400000001;
861 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
863 ycc1 = biga * xcc1 + bigb;
865 bigb1 = xcc1 / biga + ycc1;
866 coeffa = biga1 * biga1 + 1.;
867 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
868 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
869 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
870 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
872 ycc2 = biga1 * xcc2 + bigb1;
873 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
874 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
875 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
876 ypos1 * TMath::Sin(kgteta *kdegrad);
877 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
878 ypos1 * TMath::Cos(kgteta * kdegrad);
881 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
882 idrotm[(i-1) * 13 + 1107], "ONLY");
884 // --- Place part # 9-10 (see sketch)
888 dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
889 (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
891 xcc = (kxx[8] + kxx[9]) / 20.;
892 ycc = (kyy[8] + kyy[9]) / 20.;
893 xccc = (kxbeg[8] + kxend[8]) / 20.;
894 yccc = (kybeg[8] + kyend[8]) / 20.;
895 if (kxx[8] == kxx[9]) {
898 r1 = kyy[9] - kyy[8];
899 r2 = kxx[9] - kxx[8];
900 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
902 aphi = (kpphi + (i-1) * 36.) * kdegrad;
903 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
904 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
905 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
906 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
907 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
908 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
910 atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
911 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
912 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
914 // --- Place part # 10-11 (see sketch)
918 dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
920 xcc = (kxx[9] + kxx[10]) / 20.;
921 ycc = (kyy[9] + kyy[10]) / 20.;
922 xccc = (kxbeg[9] + kxend[9]) / 20.;
923 yccc = (kybeg[9] + kyend[9]) / 20.;
924 if (kxx[9] == kxx[10]) {
927 r1 = kyy[10] - kyy[9];
928 r2 = kxx[10] - kxx[9];
929 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
931 aphi = (kpphi + (i-1) * 36.) * kdegrad;
932 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
933 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
934 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
935 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
936 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
937 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
939 atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
940 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
941 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
943 // --- Place part # 13-14 (see sketch)
947 dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
949 xcc = (kxx[12] + kxx[13]) / 20.;
950 ycc = (kyy[12] + kyy[13]) / 20.;
951 xccc = (kxbeg[12] + kxend[12]) / 20.;
952 yccc = (kybeg[12] + kyend[12]) / 20.;
953 if (kxx[12] == kxx[13]) {
956 r1 = kyy[12] - kyy[13];
957 r2 = kxx[12] - kxx[13];
958 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
960 aphi = (kpphi + (i-1) * 36.) * kdegrad;
961 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
962 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
963 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
964 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
965 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
966 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
968 atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
969 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
970 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
972 // --- Place an element of layer #1
974 biga = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
975 bigb = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
976 coeffa = biga * biga + 1.;
977 coeffb = biga * bigb - biga * ycc - xcc;
978 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
979 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
980 ycc1 = biga * xcc1 + bigb;
982 bigb1 = xcc1 / biga + ycc1;
983 coeffa = biga1 * biga1 + 1.;
984 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
985 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
986 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
987 ycc2 = biga1 * xcc2 + bigb1;
988 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
989 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
990 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
991 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
994 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
996 // --- Place part # 12-13 (see sketch)
1000 dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
1002 xcc = (kxx[11] + kxx[12]) / 20.;
1003 ycc = (kyy[11] + kyy[12]) / 20.;
1004 xccc = (kxbeg[11] + kxend[11]) / 20.;
1005 yccc = (kybeg[11] + kyend[11]) / 20.;
1006 if (kxx[11] == kxx[12]) {
1009 r1 = kyy[12] - kyy[11];
1010 r2 = kxx[12] - kxx[11];
1011 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1013 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1014 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1015 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1016 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1017 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1018 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1019 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1021 atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
1022 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
1023 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
1025 // --- Place part # 11-12 (see sketch)
1029 dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
1031 xcc = (kxx[10] + kxx[11]) / 20.;
1032 ycc = (kyy[10] + kyy[11]) / 20.;
1033 xccc = (kxbeg[10] + kxend[10]) / 20.;
1034 yccc = (kybeg[10] + kyend[10]) / 20.;
1035 if (kxx[10] == kxx[11]) {
1038 r1 = kyy[11] - kyy[10];
1039 r2 = kxx[11] - kxx[10];
1040 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1042 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1043 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1044 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1045 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1046 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1047 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1048 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1050 atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
1051 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1052 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1054 // --- Place an element of layer #1
1056 biga = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
1057 bigb = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
1058 coeffa = biga * biga + 1.;
1059 coeffb = biga * bigb - biga * ycc - xcc;
1060 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1061 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1062 ycc1 = biga * xcc1 + bigb;
1064 bigb1 = xcc1 / biga + ycc1;
1065 coeffa = biga1 * biga1 + 1.;
1066 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1067 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1068 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1069 ycc2 = biga1 * xcc2 + bigb1;
1070 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1071 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1072 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1073 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1076 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1078 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1080 darc[0] = krarc[12] / 10. - .02;
1081 darc[1] = krarc[12] / 10.;
1083 darc[3] = atheta12 - (i-1) * 36.;
1084 darc[4] = atheta23 - (i-1) * 36.;
1085 xcc = kxarc[12] / 10.;
1086 ycc = kyarc[12] / 10.;
1087 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1088 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1089 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1090 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1091 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1092 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1093 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1095 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1097 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1099 darc[0] = krarc[11] / 10. - .02;
1100 darc[1] = krarc[11] / 10.;
1102 darc[3] = atheta23 + 90. - (i-1) * 36.;
1103 darc[4] = atheta34 + 90. - (i-1) * 36.;
1104 xcc = kxarc[11] / 10.;
1105 ycc = kyarc[11] / 10.;
1106 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1107 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1108 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1109 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1110 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1111 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1112 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1114 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1116 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1118 darc[0] = krarc[10] / 10. - .02;
1119 darc[1] = krarc[10] / 10.;
1121 darc[3] = atheta45 + 180. - (i-1) * 36.;
1122 darc[4] = atheta34 + 180. - (i-1) * 36.;
1123 xcc = kxarc[10] / 10.;
1124 ycc = kyarc[10] / 10.;
1125 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1126 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1127 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1128 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1129 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1130 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1131 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1133 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1135 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1137 darc[0] = krarc[9] / 10. - .02;
1138 darc[1] = krarc[9] / 10.;
1140 darc[3] = atheta45 - 90. - (i-1) * 36.;
1141 darc[4] = atheta56 - 90. - (i-1) * 36.;
1142 xcc = kxarc[9] / 10.;
1143 ycc = kyarc[9] / 10.;
1144 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1145 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1146 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1147 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1148 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1149 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1150 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1152 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1154 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1156 darc[0] = krarc[8] / 10. - .02;
1157 darc[1] = krarc[8] / 10.;
1159 darc[3] = atheta67 + 45. - (i-1) * 36.;
1160 darc[4] = atheta56 + 45. - (i-1) * 36.;
1161 xcc = kxarc[8] / 10.;
1162 ycc = kyarc[8] / 10.;
1163 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1164 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1165 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
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(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1169 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1171 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1173 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1175 darc[0] = krarc[7] / 10. - .02;
1176 darc[1] = krarc[7] / 10.;
1178 darc[3] = atheta67 - (i-1) * 36.;
1179 darc[4] = atheta78 - (i-1) * 36.;
1180 xcc = kxarc[7] / 10.;
1181 ycc = kyarc[7] / 10.;
1182 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1183 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1184 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1185 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1186 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1187 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1188 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1190 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1192 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1194 darc[0] = krarc[6] / 10. - .02;
1195 darc[1] = krarc[6] / 10.;
1197 darc[3] = atheta89 + 45. - (i-1) * 36.;
1198 darc[4] = atheta78 + 45. - (i-1) * 36.;
1199 xcc = kxarc[6] / 10.;
1200 ycc = kyarc[6] / 10.;
1201 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1202 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1203 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1204 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1205 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1206 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1207 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1209 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1211 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1213 darc[0] = krarc[5] / 10. - .02;
1214 darc[1] = krarc[5] / 10.;
1216 darc[3] = atheta89 + 45. - (i-1) * 36.;
1217 darc[4] = atheta910 + 45. - (i-1) * 36.;
1218 xcc = kxarc[5] / 10.;
1219 ycc = kyarc[5] / 10.;
1220 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1221 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1222 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1223 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1224 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1225 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1226 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1228 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1230 // --- Place arc # 5 (between part 9-10 and part 10-11)
1233 darc[0] = krarc[4] / 10. - .02;
1234 darc[1] = krarc[4] / 10.;
1236 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1237 darc[4] = atheta910 + 45. - (i-1) * 36.;
1238 xcc = kxarc[4] / 10.;
1239 ycc = kyarc[4] / 10.;
1240 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1241 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1242 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1243 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1244 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1245 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1246 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1248 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1250 // --- Place arc # 4 (between part 10-11 and part 11-12)
1253 darc[0] = krarc[3] / 10. - .02;
1254 darc[1] = krarc[3] / 10.;
1256 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1257 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1258 xcc = kxarc[3] / 10.;
1259 ycc = kyarc[3] / 10.;
1260 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1261 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1262 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1263 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1264 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1265 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1266 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1268 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1270 // --- Place arc # 3 (between part 11-12 and part 12-13)
1273 darc[0] = krarc[2] / 10. - .02;
1274 darc[1] = krarc[2] / 10.;
1276 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1277 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1278 xcc = kxarc[2] / 10.;
1279 ycc = kyarc[2] / 10.;
1280 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1281 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1282 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1283 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1284 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1285 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1286 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1288 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1290 // --- Place arc # 2 (between part 12-13 and part 13-14)
1293 darc[0] = krarc[1] / 10. - .02;
1294 darc[1] = krarc[1] / 10.;
1296 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1297 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1298 xcc = kxarc[1] / 10.;
1299 ycc = kyarc[1] / 10.;
1300 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1301 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1302 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1303 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1304 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1305 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1306 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1308 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1310 // --- Place arc # 1 (between part 13-14 and part 1-2)
1313 darc[0] = krarc[0] / 10. - .02;
1314 darc[1] = krarc[0] / 10.;
1316 darc[3] = atheta12 + 45. - (i-1) * 36.;
1317 darc[4] = atheta1314 - (i-1) * 36.;
1318 xcc = kxarc[0] / 10.;
1319 ycc = kyarc[0] / 10.;
1320 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1321 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1322 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1323 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1324 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1325 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1326 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1328 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1331 //************************************************************************
1336 //************************************************************************
1338 // --- Define a ghost volume containing the Silicon Drift Detectors
1339 // (layer #3 and #4) and fill it with air or vacuum
1341 xxm = (49.999-3.)/(70.-25.);
1345 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1348 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1351 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1354 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1357 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1359 // --- Place the ghost volume in its mother volume (ITSV) and make it
1362 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1363 gMC->Gsatt("IT34", "SEEN", 0);
1367 // GOTO 3456 ! skip ITS layer no. 3
1369 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1370 // smaller lenght of ribs) and fill it with air or vacuum
1372 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1374 // the widest element is the sensitive element
1375 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1376 // 7.5 cm is the lenght
1377 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1379 // --- Make the ghost volume invisible
1381 gMC->Gsatt("IDV1", "SEEN", 0);
1383 // --- Define a volume containing the sensitive part of drifts
1384 // (silicon, layer #3)
1387 // see material budget report by G. Feofilov
1390 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1392 //--- Define the part of the (smaller) rib between two sensitive parts made of
1393 // carbon (layer #3)
1395 dsup[0] = .5 - dits[0];
1397 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1398 // 7.5 cm is the lenght
1399 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1401 //--- Define the first part of the (smaller) rib between two sensitive parts
1402 // made of aluminum (layer #3)
1404 dal1[0] = .5 - dits[0];
1405 dal1[1] = 0.00096/2.;
1406 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1407 // 7.5 cm is the lenght
1408 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1410 //--- Define the part of the (smaller) rib between two sensitive parts made of
1411 // kapton (layer #3)
1413 dkap[0] = .5 - dits[0];
1415 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1416 // 7.5 cm is the lenght
1417 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1419 //--- Define the second part of the (smaller) rib between two sensitive parts
1420 // made of aluminum (layer #3)
1422 dal2[0] = .5 - dits[0];
1423 dal2[1] = 0.0027/2.;
1424 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1425 // 7.5 cm is the lenght
1426 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1428 // --- Define the part of the (smaller) rib between two sensitive parts
1429 // made of silicon (the electronics) (layer #3)
1431 dchi[0] = .5 - dits[0];
1432 dchi[1] = 0.0071/2.;
1433 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1434 // 7.5 cm is the lenght
1435 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1437 // --- Define the part of the (smaller) rib between two sensitive parts
1438 // made of water (the cooler) (layer #3)
1440 dwat[0] = .5 - dits[0];
1441 dwat[1] = 0.0093/2.;
1442 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1443 // 7.5 cm is the lenght
1444 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1446 //--- Define the third part of the (smaller) rib between two sensitive parts
1447 // made of aluminum (the cooling tubes) (layer #3)
1449 dtub[0] = .5 - dits[0];
1450 dtub[1] = 0.00134/2.;
1451 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1452 // 7.5 cm is the lenght
1453 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1455 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1458 // twice the foreseen thickness
1461 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1463 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1466 // twice the foreseen thickness
1469 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1471 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1474 // twice the foreseen thickness
1477 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1479 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1482 // twice the foreseen thickness
1485 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1487 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1491 for (j = 1; j <= 5; ++j) {
1492 // odd elements are up and even elements are down
1494 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1495 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1496 } else if (j == 2) {
1497 xpos = -dbox1[0] + dits[0];
1498 zpos = 0. - dits[2] + 1. - dits[2];
1499 } else if (j == 3) {
1500 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1502 } else if (j == 4) {
1503 xpos = -dbox1[0] + dits[0];
1504 zpos = dits[2] + 0. - 1. + dits[2];
1505 } else if (j == 5) {
1506 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1507 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1509 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1512 // --- Place the smaller ribs into their mother (IDV1)
1514 // --- Right ribs (just a matter of convention)
1516 xpos = .5 - dbox1[0] + dits[0];
1522 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1526 ypos = dsup[1] + 2.81 + dal1[1];
1527 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1531 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1532 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1536 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1537 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1539 // --- Silicon (chip)
1541 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1542 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1546 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1547 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1551 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1553 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1555 // --- Right ribs (just a matter of convention)
1560 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1564 ypos = -(dsup[1] + 2.81 + dal1[1]);
1565 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1569 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1570 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1574 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1575 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1577 // --- Silicon (chip)
1579 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1580 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1584 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1585 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1589 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1590 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1591 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1593 // --- Place the end-ladder stuff into its mother (IDV1)
1596 // --- Negative-Z end-ladder
1599 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1603 xpos = dbox1[0] - dpcb[0];
1604 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1608 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1609 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1613 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1614 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1616 // --- Silicon (bus)
1618 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1619 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1621 // --- Positive-Z end-ladder
1624 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1628 xpos = dbox1[0] - dpcb[0];
1629 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1633 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1634 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1638 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1639 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1641 // --- Silicon (bus)
1643 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1644 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1646 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1647 // larger lenght of ribs) and fill it with air or vacuum
1649 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1651 // the widest element is the sensitive element
1652 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1653 // 7.5 cm is the lenght
1654 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1656 // --- Make the ghost volume invisible
1658 gMC->Gsatt("IDV2", "SEEN", 0);
1660 //--- Define the part of the (larger) rib between two sensitive parts madeof
1661 // carbon (layer #3)
1663 dsup[0] = .65 - dits[0];
1665 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1666 // 7.5 cm is the lenght
1667 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1669 //--- Define the first part of the (larger) rib between two sensitive parts
1670 // made of aluminum (layer #3)
1672 dal1[0] = .65 - dits[0];
1673 dal1[1] = 0.00096/2.;
1674 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1675 // 7.5 cm is the lenght
1676 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1678 //--- Define the part of the (larger) rib between two sensitive parts madeof
1679 // kapton (layer #3)
1681 dkap[0] = .65 - dits[0];
1682 dkap[1] = 0.0317/2.;
1683 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1684 // 7.5 cm is the lenght
1685 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1687 //--- Define the second part of the (larger) rib between two sensitive parts
1688 // made of aluminum (layer #3)
1690 dal2[0] = .65 - dits[0];
1691 dal2[1] = 0.0027/2.;
1692 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1693 // 7.5 cm is the lenght
1694 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1696 // --- Define the part of the (larger) rib between two sensitive parts
1697 // made of silicon (the electronics) (layer #3)
1699 dchi[0] = .65 - dits[0];
1700 dchi[1] = 0.0071/2.;
1701 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1702 // 7.5 cm is the lenght
1703 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1705 // --- Define the part of the (larger) rib between two sensitive parts
1706 // made of water (the cooler) (layer #3)
1708 dwat[0] = .65 - dits[0];
1709 dwat[1] = 0.0093/2.;
1710 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1711 // 7.5 cm is the lenght
1712 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1714 //--- Define the third part of the (larger) rib between two sensitive parts
1715 // made of aluminum (the cooling tubes) (layer #3)
1717 dtub[0] = .65 - dits[0];
1718 dtub[1] = 0.00134/2.;
1719 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1720 // 7.5 cm is the lenght
1721 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1723 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1727 for (j = 1; j <= 5; ++j) {
1728 // odd element are up and even elements are down
1730 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1731 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1732 } else if (j == 2) {
1733 xpos = -dbox2[0] + dits[0];
1734 zpos = 0. - dits[2] + 1. - dits[2];
1735 } else if (j == 3) {
1736 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1738 } else if (j == 4) {
1739 xpos = -dbox2[0] + dits[0];
1740 zpos = dits[2] + 0. - 1. + dits[2];
1741 } else if (j == 5) {
1742 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1743 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1745 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1748 // --- Place the larger ribs into their mother (IDV2)
1751 // --- Right ribs (just a matter of convention)
1753 xpos = .65 - dbox2[0] + dits[0];
1759 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1763 ypos = dsup[1] + 2.81 + dal1[1];
1764 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1768 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1769 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1773 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1774 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1776 // --- Silicon (chip)
1778 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1779 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1783 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1784 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1788 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1789 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1791 // --- Right ribs (just a matter of convention)
1796 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1800 ypos = -(dsup[1] + 2.81 + dal1[1]);
1801 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1805 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1806 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1810 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1811 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1813 // --- Silicon (chip)
1815 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1816 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1820 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1821 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1825 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1826 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1828 // --- Place the end-ladder stuff into its mother (IDV1)
1831 // --- Negative-Z end-ladder
1834 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1838 xpos = dbox2[0] - dpcb[0];
1839 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1843 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1844 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1848 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1849 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1851 // --- Silicon (bus)
1853 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1854 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1856 // --- Positive-Z end-ladder
1859 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1863 xpos = dbox2[0] - dpcb[0];
1864 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1868 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1869 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1873 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1874 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1876 // --- Silicon (bus)
1878 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1879 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1881 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1882 // mother volume (IT34)
1883 // Odd elements have large ribs and even elements have small ribs
1885 for (i = 1; i <= 12; ++i) {
1886 atheta = (i-1) * 30.;
1887 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1890 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1891 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1893 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1896 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1897 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1899 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1906 // GOTO 4567 ! skip ITS layer no. 4
1908 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1909 // smaller lenght of ribs) and fill it with air or vacuum
1911 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1913 // the widest element is the end-ladder stuff
1914 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1915 // 7.5 cm is the lenght
1916 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1918 // --- Make the ghost volume invisible
1920 gMC->Gsatt("IDV3", "SEEN", 0);
1922 // --- Define a volume containing the sensitive part of drifts
1923 // (silicon, layer #4)
1926 // see material budget report by G. Feofilov
1929 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1931 //--- Define the part of the (smaller) rib between two sensitive parts made of
1932 // carbon (layer #4)
1934 dsup[0] = .5 - dits[0];
1936 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1937 // 7.5 cm is the lengh
1938 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1940 //--- Define the first part of the (smaller) rib between two sensitive parts
1941 // made of aluminum (layer #4)
1943 dal1[0] = .5 - dits[0];
1944 dal1[1] = 0.00096/2.;
1945 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1946 // 7.5 cm is the lengh
1947 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1949 //--- Define the part of the (smaller) rib between two sensitive parts made of
1950 // kapton (layer #4)
1952 dkap[0] = .5 - dits[0];
1953 dkap[1] = 0.0317/2.;
1954 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1955 // 7.5 cm is the lengh
1956 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1958 //--- Define the second part of the (smaller) rib between two sensitive parts
1959 // made of aluminum (layer #4)
1961 dal2[0] = .5 - dits[0];
1962 dal2[1] = 0.0027/2.;
1963 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1964 // 7.5 cm is the lengh
1965 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1967 // --- Define the part of the (smaller) rib between two sensitive parts
1968 // made of silicon (the electronics) (layer #4)
1970 dchi[0] = .5 - dits[0];
1971 dchi[1] = 0.0071/2.;
1972 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1973 // 7.5 cm is the lengh
1974 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1976 // --- Define the part of the (smaller) rib between two sensitive parts
1977 // made of water (the cooler) (layer #4)
1979 dwat[0] = .5 - dits[0];
1980 dwat[1] = 0.0093/2.;
1981 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1982 // 7.5 cm is the lenght
1983 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1985 //--- Define the third part of the (smaller) rib between two sensitive parts
1986 // made of aluminum (the cooling tubes) (layer #4)
1988 dtub[0] = .5 - dits[0];
1989 dtub[1] = 0.00134/2.;
1990 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1991 // 7.5 cm is the lengh
1992 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1994 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1997 // twice the foreseen thickness
2000 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
2002 // --- Define the part of the end-ladder stuff made of copper (layer #4)
2005 // twice the foreseen thickness
2008 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
2010 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
2013 // twice the foreseen thickness
2016 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
2018 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
2021 // twice the foreseen thickness
2024 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
2026 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2030 for (j = 1; j <= 7; ++j) {
2031 // odd elements are down and even elements are up
2033 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2034 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2035 } else if (j == 2) {
2036 xpos = -dbox1[0] + dits[0];
2037 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2038 } else if (j == 3) {
2039 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2040 zpos = 0. - dits[2] + .7 - dits[2];
2041 } else if (j == 4) {
2042 xpos = -dbox1[0] + dits[0];
2044 } else if (j == 5) {
2045 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2046 zpos = dits[2] + 0. - .7 + dits[2];
2047 } else if (j == 6) {
2048 xpos = -dbox1[0] + dits[0];
2049 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2050 } else if (j == 7) {
2051 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2052 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2054 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2057 // --- Place the smaller ribs into their mother (IDV3)
2059 // --- Right ribs (just a matter of convention)
2061 xpos = .5 - dbox1[0] + dits[0];
2067 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2071 ypos = dsup[1] + 2.81 + dal1[1];
2072 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2076 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2077 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2081 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2082 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2084 // --- Silicon (chip)
2086 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2087 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2091 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2092 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2096 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2098 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2100 // --- Right ribs (just a matter of convention)
2105 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2109 ypos = -(dsup[1] + 2.81 + dal1[1]);
2110 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2114 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2115 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2119 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2121 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2123 // --- Silicon (chip)
2125 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2126 2. + dal2[1] * 2. + dchi[1]);
2127 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2131 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2132 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2133 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2137 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2138 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2140 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2142 // --- Place the end-ladder stuff into its mother (IDV1)
2145 // --- Negative-Z end-ladder
2148 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2152 xpos = dbox1[0] - dpcb[0];
2153 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2157 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2158 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2162 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2163 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2165 // --- Silicon (bus)
2167 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2168 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2170 // --- Positive-Z end-ladder
2173 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2177 xpos = dbox1[0] - dpcb[0];
2178 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2182 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2183 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2187 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2188 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2190 // --- Silicon (bus)
2192 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2193 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2195 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2196 // larger lenght of ribs) and fill it with air or vacuum
2198 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2200 // the widest element is the end-ladder stuff
2201 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2202 // 7.5 cm is the lenght
2203 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2205 // --- Make the ghost volume invisible
2207 gMC->Gsatt("IDV4", "SEEN", 0);
2209 //--- Define the part of the (larger) rib between two sensitive parts madeof
2210 // carbon (layer #4)
2212 dsup[0] = .65 - dits[0];
2214 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2215 // 7.5 cm is the lengh
2216 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2218 //--- Define the first part of the (larger) rib between two sensitive parts
2219 // made of aluminum (layer #4)
2221 dal1[0] = .65 - dits[0];
2222 dal1[1] = 0.00096/2.;
2223 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2224 // 7.5 cm is the lengh
2225 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2227 //--- Define the part of the (larger) rib between two sensitive parts madeof
2228 // kapton (layer #4)
2230 dkap[0] = .65 - dits[0];
2231 dkap[1] = 0.0317/2.;
2232 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2233 // 7.5 cm is the lengh
2234 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2236 //--- Define the second part of the (larger) rib between two sensitive parts
2237 // made of aluminum (layer #4)
2239 dal2[0] = .65 - dits[0];
2240 dal2[1] = 0.0027/2.;
2241 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2242 // 7.5 cm is the lengh
2243 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2245 // --- Define the part of the (larger) rib between two sensitive parts
2246 // made of silicon (the electronics) (layer #4)
2248 dchi[0] = .65 - dits[0];
2249 dchi[1] = 0.0071/2.;
2250 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2251 // 7.5 cm is the lengh
2252 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2254 // --- Define the part of the (larger) rib between two sensitive parts
2255 // made of water (the cooler) (layer #4)
2257 dwat[0] = .65 - dits[0];
2258 dwat[1] = 0.0093/2.;
2259 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2260 // 7.5 cm is the lengh
2261 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2263 //--- Define the third part of the (larger) rib between two sensitive parts
2264 // made of aluminum (the cooling tubes) (layer #4)
2266 dtub[0] = .65 - dits[0];
2267 dtub[1] = 0.00134/2.;
2268 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2269 // 7.5 cm is the lengh
2270 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2272 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2276 for (j = 1; j <= 7; ++j) {
2277 // odd elements are down and even elements are up
2279 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2280 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2281 } else if (j == 2) {
2282 xpos = -dbox2[0] + dits[0];
2283 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2284 } else if (j == 3) {
2285 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2286 zpos = 0. - dits[2] + .7 - dits[2];
2287 } else if (j == 4) {
2288 xpos = -dbox2[0] + dits[0];
2290 } else if (j == 5) {
2291 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2292 zpos = dits[2] + 0. - .7 + dits[2];
2293 } else if (j == 6) {
2294 xpos = -dbox2[0] + dits[0];
2295 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2296 } else if (j == 7) {
2297 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2298 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2300 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2303 // --- Place the larger ribs into their mother (IDV4)
2306 // --- Right ribs (just a matter of convention)
2308 xpos = .65 - dbox2[0] + dits[0];
2314 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2318 ypos = dsup[1] + 2.81 + dal1[1];
2319 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2323 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2324 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2328 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2329 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2331 // --- Silicon (chip)
2333 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2334 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2338 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2339 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2343 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2345 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2347 // --- Right ribs (just a matter of convention)
2352 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2356 ypos = -(dsup[1] + 2.81 + dal1[1]);
2357 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2361 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2362 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2366 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2368 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2370 // --- Silicon (chip)
2372 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2373 2. + dal2[1] * 2. + dchi[1]);
2374 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2378 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2379 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2380 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2384 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2385 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2386 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2388 // --- Place the end-ladder stuff into its mother (IDV1)
2391 // --- Negative-Z end-ladder
2394 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2398 xpos = dbox2[0] - dpcb[0];
2399 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2403 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2404 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2408 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2409 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2411 // --- Silicon (bus)
2413 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2414 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2416 // --- Positive-Z end-ladder
2419 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2423 xpos = dbox2[0] - dpcb[0];
2424 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2428 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2429 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2433 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2434 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2436 // --- Silicon (bus)
2438 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2439 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2441 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2442 // mother volume (IT34)
2443 // Odd elements have large ribs and even elements have small ribs
2445 for (i = 1; i <= 24; ++i) {
2446 atheta = (i-1) * 15.;
2447 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2450 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2451 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2453 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2455 rzero = (24.0+22.8)/2.;
2456 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2457 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2459 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2463 //************************************************************************
2468 //************************************************************************
2470 // --- Define SSD with the 35+39 lay-out
2472 if (fMinorVersionV3 < 3) {
2474 //--- Define ghost volume containing the Strip Detectors and fill it with air
2477 xxm = (49.999-3.)/(70.-25.);
2481 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2482 (37.-27)/xxm-(49.998-37.)/xxm;
2485 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2489 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2493 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2494 (37.-27)/xxm+(49.998-37.)/xxm;
2497 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2498 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2499 gMC->Gsatt("IT56", "SEEN", 0);
2503 // GOTO 5678 ! skip ITS layer no. 5
2505 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2506 // it with air or vacuum
2508 dbox1[0] = (0.0600+2.*0.0150)/2.;
2510 dbox1[2] = 90.22/2.;
2511 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2513 // --- Make the ghost volume invisible
2515 gMC->Gsatt("ISV1", "SEEN", 0);
2517 // --- Define a ghost volume containing the electronics and cooling of
2518 // a single ladder of layer #5 and fill it with air or vacuum
2520 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2523 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2525 // --- Make the ghost volume invisible
2527 gMC->Gsatt("SSV1", "SEEN", 0);
2529 // --- Define a ghost volume containing the end-ladder stuff of
2530 // a single ladder of layer #5 and fill it with air or vacuum
2535 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2537 // --- Make the ghost volume invisible
2539 gMC->Gsatt("ELL5", "SEEN", 0);
2541 // --- Define a volume containing the sensitive part of the strips
2542 // (silicon, layer #5)
2547 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2549 // --- Define a volume containing the electronics of the strips
2550 // (silicon, layer #5)
2555 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2557 // --- Define the cooling tubes (aluminum, layer #5)
2560 dtub[1] = dtub[0] + .01;
2562 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2564 // --- Define the cooling fluid (water or freon, layer #5)
2569 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2570 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2572 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2580 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2581 dfra[6] = dfra[5] + .03;
2585 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2587 // --- Define the element connecting the triangles of the heat bridge
2588 // (carbon, layer #5)
2593 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2595 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2598 dpla[0] = (10./(8.*7.))/2.;
2601 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2603 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2605 dcop[0] = (2./(8.*7.))/2.;
2608 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2610 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2612 depx[0] = (30./(8.*7.))/2.;
2615 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2617 // --- Define the part of the end-ladder stuff made of silicon (bus)
2620 dsil[0] = (20./(8.*7.))/2.;
2623 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2625 // --- Place the end-ladder stuff into its mother (ELL5)
2627 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2633 xpos = -dela[0] + dpla[0];
2634 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2638 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2639 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2643 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2644 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2646 // --- Silicon (bus)
2648 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2649 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2651 // --- Place the sensitive part of the strips into its mother (ISV1)
2654 for (j = 1; j <= 23; ++j) {
2655 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2656 else xpos = -dbox1[0] + dits[0];
2657 zpos = ((j - 1) - 11.) * 3.91;
2658 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2661 // --- Place the electronics of the strips into its mother (SSV1)
2664 for (j = 1; j <= 23; ++j) {
2665 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2666 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2667 zpos = ((j - 1) - 11.) * 3.91 + .85;
2668 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2671 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2673 xpos = -dsrv[0] + .41;
2676 // --- Left tube (just a matter of convention)
2679 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2680 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2682 // --- Right tube (just a matter of convention)
2685 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2686 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2688 // --- Place the heat bridge elements into their mother (SSV1)
2690 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2692 for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2693 // volume SSV1. This is the same number of
2694 // elements as SCH5 above. Done Bjorn S. Nilsen
2695 // April 4 2000. Error found by Ivana
2696 // Hrivnacova March 29 2000.
2697 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2698 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2701 // --- Place the elements connecting the triangles of the heat bridge
2702 // into their mother (SSV1)
2706 // --- Left element (just a matter of convention)
2708 xpos = -dsrv[0] + .47;
2709 ypos = -(2.1+0.015);
2710 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2712 // --- Right element
2714 xpos = -dsrv[0] + .47;
2716 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2720 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2722 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2724 // --- Place the ghost volumes containing the strip ladders (ISV1),
2725 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2726 // their mother volume (IT56)
2728 offset1 = TMath::ATan2(.9, 40.);
2730 rzero = dbox1[0] + 40.;
2731 runo = dbox1[0] * 2. + 40. + dsrv[0];
2732 rtwo = dbox1[0] * 2. + 40. + dela[0];
2733 for (i = 1; i <= 35; ++i) {
2734 atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
2735 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2737 // --- Strip ladders
2739 xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2740 ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2742 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2744 // --- Electronics/cooling
2746 xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2747 ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2749 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2751 // --- End-ladders (nagative-Z and positive-Z)
2753 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2754 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2755 zpos = -(dbox1[2] + dela[2] + 6.);
2756 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2757 zpos = dbox1[2] + dela[2] + 6.;
2758 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2764 // GOTO 5778 ! skip ITS layer no. 6
2766 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2767 // it with air or vacuum
2769 dbox2[0] = (0.0600+2.*0.0150)/2.;
2771 dbox2[2] = 101.95/2.;
2772 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2774 // --- Make the ghost volume invisible
2776 gMC->Gsatt("ISV2", "SEEN", 0);
2778 // --- Define a ghost volume containing the electronics and cooling of
2779 // a single ladder of layer #6 and fill it with air or vacuum
2781 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2783 dsrv[2] = 101.95/2.;
2784 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2786 // --- Make the ghost volume invisible
2788 gMC->Gsatt("SSV2", "SEEN", 0);
2790 // --- Define a ghost volume containing the end-ladder stuff of
2791 // a single ladder of layer #6 and fill it with air or vacuum
2796 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2798 // --- Make the ghost volume invisible
2800 gMC->Gsatt("ELL6", "SEEN", 0);
2802 // --- Define a volume containing the sensitive part of the strips
2803 // (silicon, layer #6)
2808 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2810 // --- Define a volume containing the electronics of the strips
2811 // (silicon, layer #6)
2816 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2818 // --- Define the cooling tubes (aluminum, layer #6)
2821 dtub[1] = dtub[0] + .01;
2822 dtub[2] = 101.95/2.;
2823 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2825 // --- Define the cooling fluid (water or freon, layer #6)
2829 dwat[2] = 101.95/2.;
2830 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2831 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2833 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2841 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2842 dfra[6] = dfra[5] + .03;
2846 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2848 // --- Define the element connecting the triangles of the heat bridge
2849 // (carbon, layer #6)
2853 dcei[2] = 101.95/2.;
2854 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2856 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2859 dpla[0] = (10./(8.*7.))/2.;
2862 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2864 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2866 dcop[0] = (2./(8.*7.))/2.;
2869 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2871 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2873 depx[0] = (30./(8.*7.))/2.;
2876 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2878 // --- Define the part of the end-ladder stuff made of silicon (bus)
2881 dsil[0] = (20./(8.*7.))/2.;
2884 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2886 // --- Place the end-ladder stuff into its mother (ELL5)
2888 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2894 xpos = -dela[0] + dpla[0];
2895 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2899 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2900 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2904 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2905 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2907 // --- Silicon (bus)
2909 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2910 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2912 // --- Place the sensitive part of the strips into its mother (ISV2)
2915 for (j = 1; j <= 26; ++j) {
2916 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2917 else xpos = -dbox2[0] + dits[0];
2918 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2919 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2922 // --- Place the electronics of the strips into its mother (SSV2)
2925 for (j = 1; j <= 26; ++j) {
2926 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2927 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2928 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2929 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2932 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2934 xpos = -dsrv[0] + .41;
2937 // --- Left tube (just a matter of convention)
2940 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2941 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2943 // --- Right tube (just a matter of convention)
2946 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2947 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2949 // --- Place the heat bridge elements into their mother (SSV2)
2951 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2953 for (j = 1; j <= 27; ++j) {
2954 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2955 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2958 // --- Place the elements connecting the triangles of the heat bridge
2959 // into their mother (SSV2)
2963 // --- Left element (just a matter of convention)
2965 xpos = -dsrv[0] + .47;
2966 ypos = -(2.1+0.015);
2967 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2969 // --- Right element
2971 xpos = -dsrv[0] + .47;
2973 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2977 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2979 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2981 // --- Place the ghost volumes containing the strip ladders (ISV2),
2982 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2983 // their mother volume (IT56)
2985 offset1 = TMath::ATan2(1., 45.);
2987 rzero = dbox2[0] + 45.;
2988 runo = dbox2[0] * 2. + 45. + dsrv[0];
2989 rtwo = dbox2[0] * 2. + 45. + dela[0];
2990 for (i = 1; i <= 39; ++i) {
2991 atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
2992 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2994 // --- Strip ladders
2996 xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
2997 ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
2999 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3001 // --- Electronics/cooling
3003 xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3004 ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3006 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3008 // --- End-ladders (nagative-Z and positive-Z)
3010 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3011 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3012 zpos = -(dbox2[2] + dela[2] + 6.);
3013 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3014 zpos = dbox2[2] + dela[2] + 6.;
3015 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3020 // --- Define SSD with the 32+36 lay-out
3022 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
3024 //--- Define ghost volume containing the Strip Detectors and fill it with air
3027 xxm = (49.999-3.)/(70.-25.);
3031 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
3032 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3035 dgh[6] = -25. - (9.-3.01) / xxm -
3036 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3039 dgh[9] = (9.-3.01) / xxm + 25. +
3040 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3043 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3044 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3047 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3048 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3049 gMC->Gsatt("IT56", "SEEN", 0);
3053 // GOTO 6678 ! skip ITS layer no. 5
3055 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3056 // it with air or vacuum
3058 dbox1[0] = (0.0600+2.*0.0150)/2.;
3060 dbox1[2] = 86.31/2.;
3061 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3063 // --- Make the ghost volume invisible
3065 gMC->Gsatt("ISV1", "SEEN", 0);
3067 // --- Define a ghost volume containing the electronics and cooling of
3068 // a single ladder of layer #5 and fill it with air or vacuum
3070 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3073 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3075 // --- Make the ghost volume invisible
3077 gMC->Gsatt("SSV1", "SEEN", 0);
3079 // --- Define a ghost volume containing the end-ladder stuff of
3080 // a single ladder of layer #5 and fill it with air or vacuum
3085 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3087 // --- Make the ghost volume invisible
3089 gMC->Gsatt("ELL5", "SEEN", 0);
3091 // --- Define a volume containing the sensitive part of the strips
3092 // (silicon, layer #5)
3097 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3099 // --- Define a volume containing the electronics of the strips
3100 // (silicon, layer #5)
3105 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3107 // --- Define the cooling tubes (aluminum, layer #5)
3110 dtub[1] = dtub[0] + .01;
3112 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3114 // --- Define the cooling fluid (water or freon, layer #5)
3119 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3120 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3122 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3130 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3131 dfra[6] = dfra[5] + .03;
3135 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3137 // --- Define the element connecting the triangles of the heat bridge
3138 // (carbon, layer #5)
3143 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3145 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3148 dpla[0] = (10./(8.*7.))/2;
3151 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3153 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3155 dcop[0] = (2./(8.*7.))/2;
3158 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3160 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3162 depx[0] = (30./(8.*7.))/2.;
3165 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3167 // --- Define the part of the end-ladder stuff made of silicon (bus)
3170 dsil[0] = (20./(8.*7.))/2.;
3173 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3175 // --- Place the end-ladder stuff into its mother (ELL5)
3177 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3183 xpos = -dela[0] + dpla[0];
3184 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3188 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3189 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3193 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3194 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3196 // --- Silicon (bus)
3198 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3199 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3201 // --- Place the sensitive part of the strips into its mother (ISV1)
3204 for (j = 1; j <= 22; ++j) {
3205 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3206 else xpos = -dbox1[0] + dits[0];
3207 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3208 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3211 // --- Place the electronics of the strips into its mother (SSV1)
3214 for (j = 1; j <= 22; ++j) {
3215 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3216 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3217 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3218 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3221 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3223 xpos = -dsrv[0] + .41;
3226 // --- Left tube (just a matter of convention)
3229 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3230 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3232 // --- Right tube (just a matter of convention)
3235 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3236 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3238 // --- Place the heat bridge elements into their mother (SSV1)
3240 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3242 for (j = 1; j <= 23; ++j) {
3243 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3244 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3247 // --- Place the elements connecting the triangles of the heat bridge
3248 // into their mother (SSV1)
3252 // --- Left element (just a matter of convention)
3254 xpos = -dsrv[0] + .47;
3255 ypos = -(2.1+0.015);
3256 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3258 // --- Right element
3260 xpos = -dsrv[0] + .47;
3262 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3266 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3268 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3270 // --- Place the ghost volumes containing the strip ladders (ISV1),
3271 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3272 // their mother volume (IT56)
3274 offset1 = TMath::ATan2(.8, 36.6);
3276 rzero = dbox1[0] + 36.6;
3277 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3278 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3279 for (i = 1; i <= 32; ++i) {
3280 atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
3281 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3283 // --- Strip ladders
3285 xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3286 ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3288 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3290 // --- Electronics/cooling
3292 xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3293 ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3295 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3297 // --- End-ladders (nagative-Z and positive-Z)
3299 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3300 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3301 zpos = -(dbox1[2] + dela[2] + 6.);
3302 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3303 zpos = dbox1[2] + dela[2] + 6.;
3304 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3310 // GOTO 6778 ! skip ITS layer no. 6
3312 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3313 // it with air or vacuum
3315 dbox2[0] = (0.0600+2.*0.0150)/2.;
3317 dbox2[2] = 94.13/2.;
3318 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3320 // --- Make the ghost volume invisible
3322 gMC->Gsatt("ISV2", "SEEN", 0);
3324 // --- Define a ghost volume containing the electronics and cooling of
3325 // a single ladder of layer #6 and fill it with air or vacuum
3327 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3330 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3332 // --- Make the ghost volume invisible
3334 gMC->Gsatt("SSV2", "SEEN", 0);
3336 // --- Define a ghost volume containing the end-ladder stuff of
3337 // a single ladder of layer #6 and fill it with air or vacuum
3342 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3344 // --- Make the ghost volume invisible
3346 gMC->Gsatt("ELL6", "SEEN", 0);
3348 // --- Define a volume containing the sensitive part of the strips
3349 // (silicon, layer #6)
3354 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3356 // --- Define a volume containing the electronics of the strips
3357 // (silicon, layer #6)
3362 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3364 // --- Define the cooling tubes (aluminum, layer #6)
3367 dtub[1] = dtub[0] + .01;
3369 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3371 // --- Define the cooling fluid (water or freon, layer #6)
3376 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3377 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3379 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3387 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3388 dfra[6] = dfra[5] + .03;
3392 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3394 // --- Define the element connecting the triangles of the heat bridge
3395 // (carbon, layer #6)
3400 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3402 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3405 dpla[0] = (10./(8.*7.))/2;
3408 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3410 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3412 dcop[0] = (2./(8.*7.))/2;
3415 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3417 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3419 depx[0] = (30./(8.*7.))/2.;
3422 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3424 // --- Define the part of the end-ladder stuff made of silicon (bus)
3427 dsil[0] = (20./(8.*7.))/2.;
3430 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3432 // --- Place the end-ladder stuff into its mother (ELL5)
3434 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3440 xpos = -dela[0] + dpla[0];
3441 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3445 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3446 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3450 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3451 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3453 // --- Silicon (bus)
3455 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3456 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3458 // --- Place the sensitive part of the strips into its mother (ISV2)
3461 for (j = 1; j <= 24; ++j) {
3462 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3463 else xpos = dbox2[0] - dits[0];
3464 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3465 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3468 // --- Place the electronics of the strips into its mother (SSV2)
3471 for (j = 1; j <= 24; ++j) {
3472 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3473 else xpos = -dsrv[0] + .28;
3474 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3475 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3478 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3480 xpos = -dsrv[0] + .41;
3483 // --- Left tube (just a matter of convention)
3486 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3487 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3489 // --- Right tube (just a matter of convention)
3492 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3493 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3495 // --- Place the heat bridge elements into their mother (SSV2)
3497 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3499 for (j = 1; j <= 25; ++j) {
3500 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3501 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3504 // --- Place the elements connecting the triangles of the heat bridge
3505 // into their mother (SSV2)
3509 // --- Left element (just a matter of convention)
3511 xpos = -dsrv[0] + .47;
3512 ypos = -(2.1+0.015);
3513 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3515 // --- Right element
3517 xpos = -dsrv[0] + .47;
3519 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3523 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3525 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3527 // --- Place the ghost volumes containing the strip ladders (ISV2),
3528 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3529 // their mother volume (IT56)
3531 offset1 = TMath::ATan2(.9, 41.2);
3533 rzero = dbox2[0] + 41.2;
3534 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3535 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3536 for (i = 1; i <= 36; ++i) {
3537 atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
3538 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3540 // --- Strip ladders
3542 xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3543 ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3545 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3547 // --- Electronics/cooling
3549 xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3550 ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3552 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3554 // --- End-ladders (nagative-Z and positive-Z)
3556 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3557 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3558 zpos = -(dbox2[2] + dela[2] + 6.);
3559 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3560 zpos = dbox2[2] + dela[2] + 6.;
3561 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3567 //************************************************************************
3569 //* E N D - C A P S A N D F R A M E S *
3570 //* ========================================= *
3572 //************************************************************************
3574 // --- Define a dummy cylinder for multiple scattering tests
3576 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3579 // DITS(2)=DITS(1)+0.1
3581 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3582 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3585 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3587 // GOTO 8901 ! skip outer wall
3589 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3592 dits[1] = dits[0] + .06926;
3593 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3595 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3596 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3601 // --- The frame between the end-caps (octagonal lay-out) ---
3603 // GOTO 9012 ! skip octagonal frame
3605 if (fMinorVersionV3 == 1) {
3610 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3613 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3615 offset = angle / 2.;
3616 for (i = 0; i < 8; ++i) {
3617 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3618 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3620 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3621 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3625 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3626 aphi2 = 180. - aphi1;
3627 xpos = (xtra[0] + xtra[1]) / 2.;
3628 ypos = (ytra[0] + ytra[1]) / 2.;
3629 zpos = dtra[2] / 2.;
3630 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3633 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3634 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3635 zpos = -dtra[2] / 2.;
3636 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3639 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3640 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3643 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3644 aphi1 = 180. - aphi2;
3645 xpos = (xtra[1] + xtra[2]) / 2.;
3646 ypos = (ytra[1] + ytra[2]) / 2.;
3647 zpos = dtra[2] / 2.;
3648 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3651 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3652 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3653 zpos = -dtra[2] / 2.;
3654 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3657 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3658 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3661 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3662 aphi2 = 180. - aphi1;
3663 xpos = (xtra[2] + xtra[3]) / 2.;
3664 ypos = (ytra[2] + ytra[3]) / 2.;
3665 zpos = dtra[2] / 2.;
3666 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3669 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3670 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3671 zpos = -dtra[2] / 2.;
3672 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3675 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3676 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3679 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3680 aphi1 = 180. - aphi2;
3681 xpos = (xtra[3] + xtra[4]) / 2.;
3682 ypos = (ytra[3] + ytra[4]) / 2.;
3683 zpos = dtra[2] / 2.;
3684 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3687 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3688 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3689 zpos = -dtra[2] / 2.;
3690 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3693 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3694 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3697 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3698 aphi1 = 180. - aphi2;
3699 xpos = (xtra[4] + xtra[5]) / 2.;
3700 ypos = (ytra[4] + ytra[5]) / 2.;
3701 zpos = dtra[2] / 2.;
3702 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3705 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3706 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3707 zpos = -dtra[2] / 2.;
3708 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3711 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3712 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3715 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3716 aphi2 = 180. - aphi1;
3717 xpos = (xtra[5] + xtra[6]) / 2.;
3718 ypos = (ytra[5] + ytra[6]) / 2.;
3719 zpos = dtra[2] / 2.;
3720 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3723 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3724 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3725 zpos = -dtra[2] / 2.;
3726 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3729 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3730 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3733 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3734 aphi1 = 180. - aphi2;
3735 xpos = (xtra[6] + xtra[7]) / 2.;
3736 ypos = (ytra[6] + ytra[7]) / 2.;
3737 zpos = dtra[2] / 2.;
3738 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3741 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3742 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3743 zpos = -dtra[2] / 2.;
3744 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3747 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3748 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3751 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3752 aphi2 = 180. - aphi1;
3753 xpos = (xtra[7] + xtra[0]) / 2.;
3754 ypos = (ytra[7] + ytra[0]) / 2.;
3755 zpos = dtra[2] / 2.;
3756 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3759 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3760 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3761 zpos = -dtra[2] / 2.;
3762 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3765 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3766 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3769 } else if (fMinorVersionV3 == 4) {
3775 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3778 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3780 offset = angle / 2.;
3781 for (i = 0; i < 8; ++i) {
3782 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3783 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3785 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3786 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3790 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3791 aphi2 = 180. - aphi1;
3792 xpos = (xtra[0] + xtra[1]) / 2.;
3793 ypos = (ytra[0] + ytra[1]) / 2.;
3794 zpos = dtra[2] / 2.;
3795 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3798 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3799 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3800 zpos = -dtra[2] / 2.;
3801 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3804 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3805 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3808 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3809 aphi1 = 180. - aphi2;
3810 xpos = (xtra[1] + xtra[2]) / 2.;
3811 ypos = (ytra[1] + ytra[2]) / 2.;
3812 zpos = dtra[2] / 2.;
3813 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3816 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3817 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3818 zpos = -dtra[2] / 2.;
3819 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3822 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3823 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3826 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3827 aphi2 = 180. - aphi1;
3828 xpos = (xtra[2] + xtra[3]) / 2.;
3829 ypos = (ytra[2] + ytra[3]) / 2.;
3830 zpos = dtra[2] / 2.;
3831 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3834 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3835 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3836 zpos = -dtra[2] / 2.;
3837 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3840 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3841 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3844 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3845 aphi1 = 180. - aphi2;
3846 xpos = (xtra[3] + xtra[4]) / 2.;
3847 ypos = (ytra[3] + ytra[4]) / 2.;
3848 zpos = dtra[2] / 2.;
3849 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3852 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3853 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3854 zpos = -dtra[2] / 2.;
3855 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3858 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3859 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3862 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3863 aphi1 = 180. - aphi2;
3864 xpos = (xtra[4] + xtra[5]) / 2.;
3865 ypos = (ytra[4] + ytra[5]) / 2.;
3866 zpos = dtra[2] / 2.;
3867 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3870 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3871 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3872 zpos = -dtra[2] / 2.;
3873 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3876 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3877 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3880 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3881 aphi2 = 180. - aphi1;
3882 xpos = (xtra[5] + xtra[6]) / 2.;
3883 ypos = (ytra[5] + ytra[6]) / 2.;
3884 zpos = dtra[2] / 2.;
3885 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3888 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3889 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3890 zpos = -dtra[2] / 2.;
3891 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3894 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3895 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3898 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3899 aphi1 = 180. - aphi2;
3900 xpos = (xtra[6] + xtra[7]) / 2.;
3901 ypos = (ytra[6] + ytra[7]) / 2.;
3902 zpos = dtra[2] / 2.;
3903 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3906 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3907 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3908 zpos = -dtra[2] / 2.;
3909 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3912 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3913 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3916 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
3917 aphi2 = 180. - aphi1;
3918 xpos = (xtra[7] + xtra[0]) / 2.;
3919 ypos = (ytra[7] + ytra[0]) / 2.;
3920 zpos = dtra[2] / 2.;
3921 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3924 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3925 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3926 zpos = -dtra[2] / 2.;
3927 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3930 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3931 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3937 // --- The frame between the end-caps (hexagonal lay-out) ---
3939 // GOTO 9123 ! skip hexagonal frame
3941 if (fMinorVersionV3 == 2) {
3946 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3952 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3954 offset = angle / 2.;
3955 for (i = 0; i < 6; ++i) {
3956 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
3957 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
3959 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
3960 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3965 xpos = (xtra1[0] + xtra1[1]) / 2.;
3966 ypos = (ytra1[0] + ytra1[1]) / 2.;
3968 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
3971 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3972 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3976 xpos = (xtra1[1] + xtra1[2]) / 2.;
3977 ypos = (ytra1[1] + ytra1[2]) / 2.;
3979 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
3982 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3983 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3987 xpos = (xtra1[2] + xtra1[3]) / 2.;
3988 ypos = (ytra1[2] + ytra1[3]) / 2.;
3990 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
3993 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3994 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3998 xpos = (xtra1[3] + xtra1[4]) / 2.;
3999 ypos = (ytra1[3] + ytra1[4]) / 2.;
4001 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4004 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4005 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4009 xpos = (xtra1[4] + xtra1[5]) / 2.;
4010 ypos = (ytra1[4] + ytra1[5]) / 2.;
4012 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4015 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4016 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4020 xpos = (xtra1[5] + xtra1[0]) / 2.;
4021 ypos = (ytra1[5] + ytra1[0]) / 2.;
4023 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4026 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4027 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4030 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4031 aphi1 = 180. - aphi2;
4032 xpos = (xtra1[0] + xtra1[1]) / 2.;
4033 ypos = (ytra1[0] + ytra1[1]) / 2.;
4034 zpos = dtra2[2] / 2.;
4035 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4038 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4039 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4040 zpos = -dtra2[2] / 2.;
4041 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4044 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4045 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4048 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4049 aphi2 = 180. - aphi1;
4050 xpos = (xtra1[1] + xtra1[2]) / 2.;
4051 ypos = (ytra1[1] + ytra1[2]) / 2.;
4052 zpos = dtra2[2] / 2.;
4053 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4056 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4057 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4058 zpos = -dtra2[2] / 2.;
4059 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4062 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4063 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4066 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4067 aphi1 = 180. - aphi2;
4068 xpos = (xtra1[2] + xtra1[3]) / 2.;
4069 ypos = (ytra1[2] + ytra1[3]) / 2.;
4070 zpos = dtra2[2] / 2.;
4071 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4074 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4075 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4076 zpos = -dtra2[2] / 2.;
4077 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4080 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4081 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4083 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))
4084 - 50.*50.))) * kraddeg;
4085 aphi2 = 180. - aphi1;
4086 xpos = (xtra1[2] + xtra1[3]) / 2.;
4087 ypos = (ytra1[2] + ytra1[3]) / 2.;
4088 zpos = dtra2[2] / 2.;
4089 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4092 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4093 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4094 zpos = -dtra2[2] / 2.;
4095 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4098 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4099 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4102 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4103 aphi1 = 180. - aphi2;
4104 xpos = (xtra1[3] + xtra1[4]) / 2.;
4105 ypos = (ytra1[3] + ytra1[4]) / 2.;
4106 zpos = dtra2[2] / 2.;
4107 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4110 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4111 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4112 zpos = -dtra2[2] / 2.;
4113 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4116 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4117 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4120 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4121 aphi2 = 180. - aphi1;
4122 xpos = (xtra1[4] + xtra1[5]) / 2.;
4123 ypos = (ytra1[4] + ytra1[5]) / 2.;
4124 zpos = dtra2[2] / 2.;
4125 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4128 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4129 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4130 zpos = -dtra2[2] / 2.;
4131 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4134 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4135 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4138 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4139 aphi1 = 180. - aphi2;
4140 xpos = (xtra1[5] + xtra1[0]) / 2.;
4141 ypos = (ytra1[5] + ytra1[0]) / 2.;
4142 zpos = dtra2[2] / 2.;
4143 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4146 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4147 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4148 zpos = -dtra2[2] / 2.;
4149 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4152 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4153 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4155 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4156 aphi2 = 180. - aphi1;
4157 xpos = (xtra1[5] + xtra1[0]) / 2.;
4158 ypos = (ytra1[5] + ytra1[0]) / 2.;
4159 zpos = dtra2[2] / 2.;
4160 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4163 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4164 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4165 zpos = -dtra2[2] / 2.;
4166 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4169 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4170 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4173 } else if (fMinorVersionV3 == 5) {
4179 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4185 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4187 offset = angle / 2.;
4188 for (i = 0; i < 6; ++i) {
4189 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
4190 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
4192 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
4193 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4198 xpos = (xtra1[0] + xtra1[1]) / 2.;
4199 ypos = (ytra1[0] + ytra1[1]) / 2.;
4201 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
4204 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4205 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4209 xpos = (xtra1[1] + xtra1[2]) / 2.;
4210 ypos = (ytra1[1] + ytra1[2]) / 2.;
4212 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4215 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4216 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4220 xpos = (xtra1[2] + xtra1[3]) / 2.;
4221 ypos = (ytra1[2] + ytra1[3]) / 2.;
4223 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4226 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4227 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4231 xpos = (xtra1[3] + xtra1[4]) / 2.;
4232 ypos = (ytra1[3] + ytra1[4]) / 2.;
4234 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4237 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4238 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4242 xpos = (xtra1[4] + xtra1[5]) / 2.;
4243 ypos = (ytra1[4] + ytra1[5]) / 2.;
4245 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4248 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4249 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4253 xpos = (xtra1[5] + xtra1[0]) / 2.;
4254 ypos = (ytra1[5] + ytra1[0]) / 2.;
4256 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4259 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4260 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4263 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4264 aphi1 = 180. - aphi2;
4265 xpos = (xtra1[0] + xtra1[1]) / 2.;
4266 ypos = (ytra1[0] + ytra1[1]) / 2.;
4267 zpos = dtra2[2] / 2.;
4268 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4271 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4272 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4273 zpos = -dtra2[2] / 2.;
4274 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4277 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4278 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4281 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4282 aphi2 = 180. - aphi1;
4283 xpos = (xtra1[1] + xtra1[2]) / 2.;
4284 ypos = (ytra1[1] + ytra1[2]) / 2.;
4285 zpos = dtra2[2] / 2.;
4286 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4289 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4290 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4291 zpos = -dtra2[2] / 2.;
4292 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4295 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4296 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4299 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4300 aphi1 = 180. - aphi2;
4301 xpos = (xtra1[2] + xtra1[3]) / 2.;
4302 ypos = (ytra1[2] + ytra1[3]) / 2.;
4303 zpos = dtra2[2] / 2.;
4304 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4307 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4308 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4309 zpos = -dtra2[2] / 2.;
4310 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4313 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4314 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4316 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4317 aphi2 = 180. - aphi1;
4318 xpos = (xtra1[2] + xtra1[3]) / 2.;
4319 ypos = (ytra1[2] + ytra1[3]) / 2.;
4320 zpos = dtra2[2] / 2.;
4321 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4324 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4325 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4326 zpos = -dtra2[2] / 2.;
4327 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4330 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4331 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4334 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4335 aphi1 = 180. - aphi2;
4336 xpos = (xtra1[3] + xtra1[4]) / 2.;
4337 ypos = (ytra1[3] + ytra1[4]) / 2.;
4338 zpos = dtra2[2] / 2.;
4339 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4342 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4343 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4344 zpos = -dtra2[2] / 2.;
4345 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4348 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4349 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4352 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4353 aphi2 = 180. - aphi1;
4354 xpos = (xtra1[4] + xtra1[5]) / 2.;
4355 ypos = (ytra1[4] + ytra1[5]) / 2.;
4356 zpos = dtra2[2] / 2.;
4357 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4360 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4361 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4362 zpos = -dtra2[2] / 2.;
4363 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4366 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4367 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4370 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4371 aphi1 = 180. - aphi2;
4372 xpos = (xtra1[5] + xtra1[0]) / 2.;
4373 ypos = (ytra1[5] + ytra1[0]) / 2.;
4374 zpos = dtra2[2] / 2.;
4375 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4378 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4379 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4380 zpos = -dtra2[2] / 2.;
4381 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4384 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4385 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4387 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4388 aphi2 = 180. - aphi1;
4389 xpos = (xtra1[5] + xtra1[0]) / 2.;
4390 ypos = (ytra1[5] + ytra1[0]) / 2.;
4391 zpos = dtra2[2] / 2.;
4392 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4395 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4396 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4397 zpos = -dtra2[2] / 2.;
4398 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4401 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4402 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4408 // --- Define the end-caps
4410 // GOTO 9234 ! skip both end-caps
4412 // --- Define the Z>0 end-cap
4414 // GOTO 9345 ! skip the Z>0 end-cap
4419 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4420 dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4423 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4424 // end-ladder electro
4425 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4426 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4428 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4430 // In the Simonetti's drawings 52. In the TP 50.
4434 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4435 // end-ladder electro
4436 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4437 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4441 dtube[2] = 26.8/2./10.;
4444 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4446 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4447 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4453 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4454 // end-ladder electron
4457 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4458 // end-ladder electronics
4464 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4465 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4471 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4475 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4482 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4483 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4485 if (fMinorVersionV3 < 3 ) {
4487 dpgon[0] = offset2 + 360./(2.*35.);
4491 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4495 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4502 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4503 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4505 dpgon[0] = offset2 + 360./(2.*39.);
4509 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4513 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4520 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4521 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4523 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4525 dpgon[0] = offset2 + 5.625;
4529 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4530 // end-ladder electronics
4533 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4534 // end-ladder electr
4540 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4541 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4543 dpgon[0] = offset2 + 5.;
4547 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4548 // end-ladder electronics
4551 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4552 // end-ladder electr
4558 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4559 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4564 // --- Define the Z<0 end-cap
4566 // GOTO 9456 ! skip the Z<0 end-cap
4569 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4570 dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4575 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4576 // end-ladder electr
4577 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4579 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4581 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4583 // In the Simonetti's drawings 52. In the TP 50.
4587 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4588 // end-ladder electr
4589 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4591 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4595 dtube[2] = 26.8/2./10.;
4598 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4600 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4602 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4608 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4609 // end-ladder electronics
4612 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4613 // end-ladder electro
4619 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4620 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4626 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4630 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4637 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4638 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4640 if (fMinorVersionV3 < 3) {
4642 dpgon[0] = offset2 + 360./(2.*35.);
4646 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4650 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4657 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4658 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4660 dpgon[0] = offset2 + 360./(2.*39.);
4664 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4668 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4675 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4676 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4678 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4680 dpgon[0] = offset2 + 5.625;
4684 dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4685 // end-ladder electronics
4688 dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4689 // end-ladder electr
4695 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4696 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4698 dpgon[0] = offset2 + 5.;
4702 dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4703 // end-ladder electronics
4706 dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4707 // end-ladder electr
4713 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4714 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4720 // --- Outputs the geometry tree in the EUCLID/CAD format
4723 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4725 fMinorVersion = fMinorVersionV3;
4727 //_____________________________________________________________________________
4728 void AliITSv3::CreateMaterials(){
4729 ////////////////////////////////////////////////////////////////////////
4731 // Create ITS materials
4732 // This function defines the default materials used in the Geant
4733 // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
4734 // In general it is automatically replaced by
4735 // the CreatMaterials routine defined in AliITSv?. Should the function
4736 // CreateMaterials not exist for the geometry version you are using this
4737 // one is used. See the definition found in AliITSv5 or the other routine
4738 // for a complete definition.
4741 Float_t awat[2] = { 1.00794,15.9994 };
4742 Float_t zwat[2] = { 1.,8. };
4743 Float_t wwat[2] = { 2.,1. };
4744 Float_t denswat = 1.;
4746 Float_t afre[2] = { 12.011,18.9984032 };
4747 Float_t zfre[2] = { 6.,9. };
4748 Float_t wfre[2] = { 5.,12. };
4749 Float_t densfre = 1.5;
4751 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4752 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4753 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4754 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4755 Float_t denscer = 3.6;
4757 // 60% SiO2 , 40% G10FR4
4759 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4760 Float_t zpcb[3] = { 14.,8.,8.875 };
4761 Float_t wpcb[3] = { .28,.32,.4 };
4762 Float_t denspcb = 1.8;
4764 Float_t apoly[2] = { 12.01,1. };
4765 Float_t zpoly[2] = { 6.,1. };
4766 Float_t wpoly[2] = { .33,.67 };
4768 Float_t zserv[4] = { 1.,6.,26.,29. };
4769 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4770 Float_t wserv[4] = { .014,.086,.42,.48 };
4772 Int_t isxfld = gAlice->Field()->Integ();
4773 Float_t sxmgmx = gAlice->Field()->Max();
4776 // --- Define the various materials for GEANT ---
4778 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4780 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4781 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4782 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4783 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4785 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4786 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4787 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4788 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4789 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4791 AliMedium(0, "SPD Si$", 0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4792 AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4793 AliMedium(2, "SPD Si bus$", 2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4794 AliMedium(3, "SPD C$", 3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4795 AliMedium(4, "SPD Air$", 4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4796 AliMedium(5, "SPD Vacuum$", 5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4797 AliMedium(6, "SPD Al$", 6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4798 AliMedium(7, "SPD Water $", 7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4799 AliMedium(8, "SPD Freon$", 8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4801 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4803 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4804 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4805 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4806 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4808 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4809 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4810 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4811 // After a call with ratios by number (negative number of elements),
4812 // the ratio array is changed to the ratio by weight, so all successive
4813 // calls with the same array must specify the number of elements as
4815 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4816 // After a call with ratios by number (negative number of elements),
4817 // the ratio array is changed to the ratio by weight, so all successive
4818 // calls with the same array must specify the number of elements as
4820 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4821 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4822 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4823 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4824 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4827 AliMedium(25, "SDD Si$", 25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4828 AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4829 AliMedium(27, "SDD Si bus$", 27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4830 AliMedium(28, "SDD C$", 28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4831 AliMedium(29, "SDD Air$", 29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4832 AliMedium(30, "SDD Vacuum$", 30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4833 AliMedium(31, "SDD Al$", 31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4834 AliMedium(32, "SDD Water $", 32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4835 AliMedium(33, "SDD Freon$", 33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4836 AliMedium(34, "SDD PCB$", 34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4837 AliMedium(35, "SDD Copper$", 35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4838 AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4839 AliMedium(37, "SDD Kapton$", 37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4841 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4843 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4844 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4845 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4846 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4848 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4849 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4850 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4851 // After a call with ratios by number (negative number of elements),
4852 // the ratio array is changed to the ratio by weight, so all successive
4853 // calls with the same array must specify the number of elements as
4855 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
4856 // After a call with ratios by number (negative number of elements),
4857 // the ratio array is changed to the ratio by weight, so all successive
4858 // calls with the same array must specify the number of elements as
4860 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4861 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4862 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4863 // After a call with ratios by number (negative number of elements),
4864 // the ratio array is changed to the ratio by weight, so all successive
4865 // calls with the same array must specify the number of elements as
4867 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4868 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4870 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4872 AliMedium(50, "SSD Si$", 50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4873 AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4874 AliMedium(52, "SSD Si bus$", 52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4875 AliMedium(53, "SSD C$", 53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4876 AliMedium(54, "SSD Air$", 54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4877 AliMedium(55, "SSD Vacuum$", 55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4878 AliMedium(56, "SSD Al$", 56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4879 AliMedium(57, "SSD Water $", 57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4880 AliMedium(58, "SSD Freon$", 58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4881 AliMedium(59, "SSD PCB$", 59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4882 AliMedium(60, "SSD Copper$", 60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4883 AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4884 AliMedium(62, "SSD Kapton$", 62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4885 AliMedium(63, "SSD G10FR4$", 63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4887 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4889 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4891 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4892 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4893 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4894 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4895 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4896 // After a call with ratios by number (negative number of elements),
4897 // the ratio array is changed to the ratio by weight, so all successive
4898 // calls with the same array must specify the number of elements as
4900 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4902 AliMedium(75,"GEN C$", 75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4903 AliMedium(76,"GEN Air$", 76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4904 AliMedium(77,"GEN Vacuum$", 77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
4905 AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4906 AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4907 AliMedium(80,"GEN Copper$", 80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4908 AliMedium(81,"GEN Water $", 81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4910 //_____________________________________________________________________________
4911 void AliITSv3::Init(){
4912 ////////////////////////////////////////////////////////////////////////
4913 // Initialise the ITS after it has been created.
4914 ////////////////////////////////////////////////////////////////////////
4918 fMinorVersion = fMinorVersionV3;
4920 //_____________________________________________________________________________
4921 void AliITSv3::StepManager(){
4922 ////////////////////////////////////////////////////////////////////////
4923 // Called for every step in the ITS, then calles the AliITShit class
4924 // creator with the information to be recoreded about that hit.
4925 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4926 // printing of information to a file which can be used to create a .det
4927 // file read in by the routine CreateGeometry(). If set to 0 or any other
4928 // value except 1, the default behavior, then no such file is created nor
4929 // it the extra variables and the like used in the printing allocated.
4930 ////////////////////////////////////////////////////////////////////////
4934 TLorentzVector position, momentum;
4935 TClonesArray &lhits = *fHits;
4936 #if ALIITSPRINTGEOM==1
4939 Float_t xl[3],xt[3],angl[6];
4940 // Float_t par[20],att[20];
4942 static Bool_t first=kTRUE,printit[6][50][50];
4943 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4944 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4952 if(gMC->IsTrackInside()) vol[3] += 1;
4953 if(gMC->IsTrackEntering()) vol[3] += 2;
4954 if(gMC->IsTrackExiting()) vol[3] += 4;
4955 if(gMC->IsTrackOut()) vol[3] += 8;
4956 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4957 if(gMC->IsTrackStop()) vol[3] += 32;
4958 if(gMC->IsTrackAlive()) vol[3] += 64;
4960 // Fill hit structure.
4961 if(!(gMC->TrackCharge())) return;
4963 // Only entering charged tracks
4964 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4966 id=gMC->CurrentVolOffID(1,copy);
4968 id=gMC->CurrentVolOffID(2,copy);
4970 } else if(id==fIdSens[1]) {
4972 id=gMC->CurrentVolOffID(1,copy);
4974 id=gMC->CurrentVolOffID(2,copy);
4976 } else if(id==fIdSens[2]) {
4979 id=gMC->CurrentVolOffID(1,copy);
4981 } else if(id==fIdSens[3]) {
4984 id=gMC->CurrentVolOffID(1,copy);
4986 } else if(id==fIdSens[4]) {
4989 id=gMC->CurrentVolOffID(1,copy);
4991 } else if(id==fIdSens[5]) {
4994 id=gMC->CurrentVolOffID(1,copy);
4997 gMC->TrackPosition(position);
4998 gMC->TrackMomentum(momentum);
4999 hits[0]=position[0];
5000 hits[1]=position[1];
5001 hits[2]=position[2];
5002 hits[3]=momentum[0];
5003 hits[4]=momentum[1];
5004 hits[5]=momentum[2];
5005 hits[6]=gMC->Edep();
5006 hits[7]=gMC->TrackTime();
5007 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
5008 #if ALIITSPRINTGEOM==1
5009 if(printit[vol[0]][vol[2]][vol[1]]){
5010 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
5011 xl[0] = xl[1] = xl[2] = 0.0;
5012 gMC->Gdtom(xl,xt,1);
5013 for(i=0;i<9;i++) mat[i] = 0.0;
5014 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
5017 gMC->Gdtom(xl,&(mat[0]),2);
5020 gMC->Gdtom(xl,&(mat[3]),2);
5023 gMC->Gdtom(xl,&(mat[6]),2);
5025 angl[0] = TMath::ACos(mat[2]);
5026 if(mat[2]==1.0) angl[0] = 0.0;
5027 angl[1] = TMath::ATan2(mat[1],mat[0]);
5028 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5030 angl[2] = TMath::ACos(mat[5]);
5031 if(mat[5]==1.0) angl[2] = 0.0;
5032 angl[3] = TMath::ATan2(mat[4],mat[3]);
5033 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5035 angl[4] = TMath::ACos(mat[8]);
5036 if(mat[8]==1.0) angl[4] = 0.0;
5037 angl[5] = TMath::ATan2(mat[7],mat[6]);
5038 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5040 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5041 // i = gMC->CurrentVolID(copy);
5042 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5043 fp = fopen("ITSgeometry_v5.det","a");
5044 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5045 vol[0],vol[2],vol[1], // layer ladder detector
5046 xt[0],xt[1],xt[2], // Translation vector
5047 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5050 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5051 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5052 ); // Adding the rotation matrix.
5055 } // end if printit[layer][ladder][detector]
5058 //____________________________________________________________________________
5059 void AliITSv3::Streamer(TBuffer &R__b){
5060 ////////////////////////////////////////////////////////////////////////
5061 // A dummy Streamer function for this class AliITSv3. By default it
5062 // only streams the AliITS class as it is required. Since this class
5063 // dosen't contain any "real" data to be saved, it doesn't.
5064 ////////////////////////////////////////////////////////////////////////
5066 if (R__b.IsReading()) {
5067 Version_t R__v = R__b.ReadVersion();
5069 AliITS::Streamer(R__b);
5071 AliITS::Streamer(R__b);
5074 R__b.WriteVersion(AliITSv3::IsA());
5075 AliITS::Streamer(R__b);
5076 } // end if R__b.IsReading()