1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.11.4.10 2000/07/31 13:50:51 barbera
19 Updated from the release
21 Revision 1.17 2000/07/10 16:07:19 fca
22 Release version of ITS code
24 Revision 1.11.4.4 2000/05/19 10:09:51 nilsen
25 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
27 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
28 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
29 <=23 (was <=24). This may not be the final version.
31 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
32 Fixed up the comments/documentation.
34 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
35 This is the version of the files after the merging done in December 1999.
36 See the ReadMe110100.txt file for details
38 Revision 1.11 1999/10/22 08:25:25 fca
39 remove double definition of destructors
41 Revision 1.10 1999/10/22 08:16:49 fca
42 Correct destructors, thanks to I.Hrivnacova
44 Revision 1.9 1999/10/06 19:56:50 fca
47 Revision 1.8 1999/10/05 08:05:09 fca
48 Minor corrections for uninitialised variables.
50 Revision 1.7 1999/09/29 09:24:20 fca
51 Introduction of the Copyright and cvs Log
55 ///////////////////////////////////////////////////////////////////////////////
57 // Inner Traking System version 3
58 // This class contains the base procedures for the Inner Tracking System
60 // Authors: R. Barbera, A. Morsch.
64 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
65 // WORK with the geometry or module classes or any analysis classes. You are
66 // strongly encouraged to uses AliITSv5.
68 ///////////////////////////////////////////////////////////////////////////////
70 // See AliITSv3::StepManager().
71 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
72 //#define ALIITSPRINTGEOM 1 // print out geometry information
77 #include <TGeometry.h>
80 #include <TFile.h> // only required for Tracking function?
82 #include <TObjArray.h>
83 #include <TObjString.h>
84 #include <TClonesArray.h>
90 #include "AliITShit.h"
96 //_____________________________________________________________________________
97 AliITSv3::AliITSv3() {
98 ////////////////////////////////////////////////////////////////////////
99 // Standard default constructor for the ITS version 3.
100 ////////////////////////////////////////////////////////////////////////
108 //____________________________________________________________________________
109 AliITSv3::AliITSv3(const AliITSv3 &source){
110 ////////////////////////////////////////////////////////////////////////
111 // Copy Constructor for ITS version 3.
112 ////////////////////////////////////////////////////////////////////////
113 if(&source == this) return;
114 printf("Not allowed to copy AliITSv3\n");
117 //_____________________________________________________________________________
118 AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
119 ////////////////////////////////////////////////////////////////////////
120 // Assignment operator for the ITS version 3.
121 ////////////////////////////////////////////////////////////////////////
122 if(&source == this) return *this;
123 printf("Not allowed to copy AliITSv3\n");
126 //_____________________________________________________________________________
127 AliITSv3::~AliITSv3() {
128 ////////////////////////////////////////////////////////////////////////
129 // Standard destructor for the ITS version 3.
130 ////////////////////////////////////////////////////////////////////////
132 //_____________________________________________________________________________
133 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
134 ////////////////////////////////////////////////////////////////////////
135 // Standard constructor for the ITS version 3.
136 ////////////////////////////////////////////////////////////////////////
140 // TObjArray of TObjStrings
141 fIdName = new TObjArray(fIdN);
142 fIdName->AddAt(new TObjString("ITS1"),0);
143 fIdName->AddAt(new TObjString("ITS2"),1);
144 fIdName->AddAt(new TObjString("ITS3"),2);
145 fIdName->AddAt(new TObjString("ITS4"),3);
146 fIdName->AddAt(new TObjString("ITS5"),4);
147 fIdName->AddAt(new TObjString("ITS6"),5);
149 // Array of TStrings.
150 fIdName = new TString[fIdN];
157 fIdSens = new Int_t[fIdN];
158 for (Int_t i=0;i<fIdN;i++) fIdSens[i] = 0;
161 }//__________________________________________________________________________
162 void AliITSv3::BuildGeometry(){
163 ////////////////////////////////////////////////////////////////////////
164 // Geometry builder for the ITS version 3.
165 ////////////////////////////////////////////////////////////////////////
167 const int kColorITS=kYellow;
169 top = gAlice->GetGeometry()->GetNode("alice");
171 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
173 node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
174 node->SetLineColor(kColorITS);
177 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
179 node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
180 node->SetLineColor(kColorITS);
183 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
185 node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
186 node->SetLineColor(kColorITS);
189 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
191 node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
192 node->SetLineColor(kColorITS);
195 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
197 node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
198 node->SetLineColor(kColorITS);
201 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
203 node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
204 node->SetLineColor(kColorITS);
207 //_____________________________________________________________________________
208 void AliITSv3::CreateGeometry(){
209 ////////////////////////////////////////////////////////////////////////
210 // This routine creates and defines the version 3 geometry of the ITS.
211 ////////////////////////////////////////////////////////////////////////
213 const Float_t kxx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
214 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
216 const Float_t kyy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
217 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
219 const Float_t kxbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
220 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
222 const Float_t kybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
223 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
225 const Float_t kxend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
226 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
228 const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
229 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
231 const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
232 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
234 const Float_t kyarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
235 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
237 const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
238 0.5,0.7,0.5,0.7,0.5,0.5 };
239 const Float_t krr = 4.064516;
240 const Float_t ktteta = 63.00;
241 const Float_t kpphi = -35.00;
242 const Float_t kgteta = 87.78;
243 const Double_t kdegrad = kPI/180.;
244 const Double_t kraddeg = 180./kPI;
245 const Double_t ktwopi = 2*kPI;
248 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
249 dfra[10], dcer[3], dkap[3], dpla[3],
250 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
251 atheta1011, dbus[3], dtub[3], dwat[3],
252 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
253 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
254 Double_t biga1, bigb1;
255 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
256 dtra1[3], dtra2[3], dtra3[3],
257 dtra4[3], dbox1[3], dbox2[3];
259 Float_t xtra1[6], ytra1[6], ztra1[6];
261 Float_t xpos1, ypos1;
263 Float_t angle, dcone[5], dtube[3], dpgon[10];
264 Float_t rzero, xzero, yzero;
265 Double_t coeffa, coeffb, coeffc;
267 Float_t atheta, offset;
268 Float_t offset1, offset2, dgh[15];
269 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
270 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
273 Double_t xcc1, ycc1, xcc2, ycc2;
275 const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
276 "TR05","TR06","TR07","TR08"};
277 const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
278 "TR15","TR16","TR17","TR18",
279 "TR19","TR20","TR21","TR22",
280 "TR23","TR24","TR25","TR26"};
281 const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
282 const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
283 const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
284 "TR57","TR58","TR59","TR60","TR61","TR62",
285 "TR63","TR64","TR65","TR66"};
287 Int_t *idtmed = fIdtmed->GetArray()-199;
289 // --- Define a ghost volume containing the whole ITS and fill it with air
307 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
309 // --- Place the ghost volume in its mother volume (ALIC) and make it
312 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
313 gMC->Gsatt("ITSV", "SEEN", 0);
315 //************************************************************************
320 //************************************************************************
322 // GOTO 2345 ! skip ITS layer no. 1 and 2
324 // --- Define a ghost volume containing the Silicon Pixel Detectors
325 // (layer #1 and #2) and fill it with air or vacuum
327 xxm = (49.999-3)/(70-25);
331 dgh[3] = -25.-(9.-3.01)/xxm;
340 dgh[12] = 25+(9-3.01)/xxm;
343 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
345 // --- Place the ghost volume in its mother volume (ITSV) and make it
348 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
349 gMC->Gsatt("IT12", "SEEN", 0);
351 // --- Define a ghost volume containing a single element of layer #1
352 // and fill it with air or vacuum
354 dbox1[0] = 0.005+0.01+0.0075;
357 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
359 //--Divide each element of layer #1 in three ladders along the beam direction
361 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
363 // --- Make the ghost volumes invisible
365 gMC->Gsatt("IPV1", "SEEN", 0);
366 gMC->Gsatt("IPB1", "SEEN", 0);
368 // --- Define a volume containing the chip of pixels (silicon, layer #1)
372 dchi[2] = dbox1[2] / 3.;
373 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
375 // --- Define a volume containing the bus of pixels (silicon, layer #1)
380 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
382 // --- Define a volume containing the sensitive part of pixels
383 // (silicon, layer #1)
388 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
390 // --- Place the chip into its mother (IPB1)
392 xpos = dbox1[0] - dchi[0];
395 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
397 // --- Place the sensitive volume into its mother (IPB1)
399 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
400 ypos = dchi[1] - dits[1];
401 zpos = -(dchi[2] - dits[2]);
402 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
404 // --- Place the bus into its mother (IPB1)
406 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
407 ypos = dchi[1] - dbus[1];
408 zpos = -(dchi[2] - dbus[2]);
409 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
411 // --- Define a ghost volume containing a single element of layer #2
412 // and fill it with air or vacuum
414 dbox2[0] = 0.005+0.01+0.0075;
417 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
419 //--Divide each element of layer #2 in four ladders along the beam direction
421 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
423 // --- Make the ghost volumes invisible
425 gMC->Gsatt("IPV2", "SEEN", 0);
426 gMC->Gsatt("IPB2", "SEEN", 0);
428 // --- Define a volume containing the chip of pixels (silicon, layer #2)
432 dchi[2] = dbox2[2] / 4.;
433 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
435 // --- Define a volume containing the bus of pixels (silicon, layer #2)
440 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
442 // --- Define a volume containing the sensitive part of pixels
443 // (silicon, layer #2)
448 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
450 // --- Place the chip into its mother (IPB2)
452 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
455 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
457 // --- Place the sensitive volume into its mother (IPB2)
459 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
460 ypos = -(dchi[1] - dits[1]);
461 zpos = -(dchi[2] - dits[2]);
462 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
464 // --- Place the bus into its mother (IPB2)
466 xpos = dbox1[0] - dbus[0];
467 ypos = -(dchi[1] - dbus[1]);
468 zpos = -(dchi[2] - dbus[2]);
469 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
471 // --- Define a generic segment of an element of the mechanical support
476 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
478 // --- Define a generic arc of an element of the mechanical support
483 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
485 // --- Define the mechanical supports of layers #1 and #2 and place the
486 // elements of the layers in it
489 // counter over the number of elements of layer #1 (
492 // counter over the number of elements of layer #2 (
493 for (i = 1; i <= 10; ++i) {
495 // --- Place part # 1-2 (see sketch)
497 // number of carbon fiber supports (see sketch)
500 dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) +
501 (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0]) ) / 20.;
503 xcc = ( kxx[0] + kxx[1]) / 20.;
504 ycc = ( kyy[0] + kyy[1]) / 20.;
505 xccc = (kxbeg[0] + kxend[0]) / 20.;
506 yccc = (kybeg[0] + kyend[0]) / 20.;
507 if (kxx[0] == kxx[1]) {
510 r1 = kyy[1] - kyy[0];
511 r2 = kxx[1] - kxx[0];
512 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
513 } // end if kxx[0] == kxx[1]
514 aphi = (kpphi + (i-1) * 36.) * kdegrad;
515 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
516 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
517 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
518 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
519 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
520 ypos1 * TMath::Sin(kgteta *kdegrad);
521 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
522 ypos1 * TMath::Cos(kgteta * kdegrad);
524 atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
525 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
526 atheta12 + 90., 0., 0.);
527 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
528 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
530 // --- Place part # 2-3 (see sketch)
534 dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) +
535 (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
537 xcc = ( kxx[1] + kxx[2]) / 20.;
538 ycc = ( kyy[1] + kyy[2]) / 20.;
539 xccc = (kxbeg[1] + kxend[1]) / 20.;
540 yccc = (kybeg[1] + kyend[1]) / 20.;
541 if (kxx[1] == kxx[2]) {
544 r1 = kyy[2] - kyy[1];
545 r2 = kxx[2] - kxx[1];
546 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
547 } // end if kxx[1] == kxx[2]
548 aphi = (kpphi + (i-1) * 36.) * kdegrad;
549 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
550 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
551 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
552 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
553 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
554 ypos1 * TMath::Sin(kgteta * kdegrad);
555 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
556 ypos1 * TMath::Cos(kgteta * kdegrad);
558 atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
559 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
560 atheta23 + 90., 0., 0.);
561 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
562 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
564 // --- Place an element of layer #2
566 biga = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
567 bigb = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
568 coeffa = biga * biga + 1.;
569 coeffb = biga * bigb - biga * ycc - xcc;
570 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
571 bigb * bigb - 0.08964*0.08964;
572 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
574 ycc1 = biga * xcc1 + bigb;
576 bigb1 = xcc1 / biga + ycc1;
577 coeffa = biga1 * biga1 + 1.;
578 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
579 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
580 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
581 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
583 ycc2 = biga1 * xcc2 + bigb1;
584 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
585 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
586 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
587 ypos1 * TMath::Sin(kgteta *kdegrad);
588 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
589 ypos1 * TMath::Cos(kgteta * kdegrad);
592 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
593 idrotm[(i-1) * 13 + 1101], "ONLY");
595 // --- Place part # 3-4 (see sketch)
599 dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) +
600 (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
602 xcc = (kxx[1] + kxx[2]) / 20.;
603 ycc = (kyy[1] + kyy[2]) / 20.;
604 xccc = (kxbeg[2] + kxend[2]) / 20.;
605 yccc = (kybeg[2] + kyend[2]) / 20.;
606 if (kxx[2] == kxx[3]) {
609 r1 = kyy[3] - kyy[2];
610 r2 = kxx[3] - kxx[2];
611 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
612 } // end if kxx[2] == kxx[3]
613 aphi = (kpphi + (i-1) * 36.) * kdegrad;
614 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
615 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
616 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
617 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
618 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
619 ypos1 * TMath::Sin(kgteta *kdegrad);
620 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
621 ypos1 * TMath::Cos(kgteta * kdegrad);
623 atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
624 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
625 atheta34 + 90., 0., 0.);
626 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
627 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
629 // --- Place part # 4-5 (see sketch)
633 dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) +
634 (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
636 xcc = ( kxx[3] + kxx[4]) / 20.;
637 ycc = ( kyy[3] + kyy[4]) / 20.;
638 xccc = (kxbeg[3] + kxend[3]) / 20.;
639 yccc = (kybeg[3] + kyend[3]) / 20.;
640 if (kxx[3] == kxx[4]) {
643 r1 = kyy[4] - kyy[3];
644 r2 = kxx[4] - kxx[3];
645 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
646 } // end if kxx[3] == kxx[4]
647 aphi = (kpphi + (i-1) * 36.) * kdegrad;
648 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
649 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
650 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
651 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
652 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
653 ypos1 * TMath::Sin(kgteta *kdegrad);
654 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
655 ypos1 * TMath::Cos(kgteta * kdegrad);
657 atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
658 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
659 atheta45 + 90., 0., 0.);
660 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
661 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
663 // --- Place an element of layer #2
665 biga = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
666 bigb = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
667 coeffa = biga * biga + 1.;
668 coeffb = biga * bigb - biga * ycc - xcc;
669 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
670 bigb * bigb - .014285030400000001;
671 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
673 ycc1 = biga * xcc1 + bigb;
675 bigb1 = xcc1 / biga + ycc1;
676 coeffa = biga1 * biga1 + 1.;
677 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
678 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
679 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
680 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
682 ycc2 = biga1 * xcc2 + bigb1;
683 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
684 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
685 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
686 ypos1 * TMath::Sin(kgteta *kdegrad);
687 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
688 ypos1 * TMath::Cos(kgteta * kdegrad);
691 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
692 idrotm[(i-1) * 13 + 1103], "ONLY");
694 // --- Place part # 5-6 (see sketch)
698 dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) +
699 (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
701 xcc = (kxx[4] + kxx[5]) / 20.;
702 ycc = (kyy[4] + kyy[5]) / 20.;
703 xccc = (kxbeg[4] + kxend[4]) / 20.;
704 yccc = (kybeg[4] + kyend[4]) / 20.;
705 if (kxx[4] == kxx[5]) {
708 r1 = kyy[5] - kyy[4];
709 r2 = kxx[5] - kxx[4];
710 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
712 aphi = (kpphi + (i-1) * 36.) * kdegrad;
713 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
714 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
715 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
716 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
717 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
718 ypos1 * TMath::Sin(kgteta *kdegrad);
719 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
720 ypos1 * TMath::Cos(kgteta * kdegrad);
722 atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
723 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
724 atheta56 + 90., 0., 0.);
725 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
726 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
728 // --- Place part # 6-7 (see sketch)
732 dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) +
733 (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
735 xcc = (kxx[5] + kxx[6]) / 20.;
736 ycc = (kyy[5] + kyy[6]) / 20.;
737 xccc = (kxbeg[5] + kxend[5]) / 20.;
738 yccc = (kybeg[5] + kyend[5]) / 20.;
739 if (kxx[5] == kxx[6]) {
742 r1 = kyy[6] - kyy[5];
743 r2 = kxx[6] - kxx[5];
744 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
745 } // end if kxx[5] == kxx[6]
746 aphi = (kpphi + (i-1) * 36.) * kdegrad;
747 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
748 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
749 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
750 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
751 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
752 ypos1 * TMath::Sin(kgteta *kdegrad);
753 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
754 ypos1 * TMath::Cos(kgteta * kdegrad);
756 atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
757 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
758 atheta67 + 90., 0., 0.);
759 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
760 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
762 // --- Place an element of layer #2
764 biga = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
765 bigb = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
766 coeffa = biga * biga + 1.;
767 coeffb = biga * bigb - biga * ycc - xcc;
768 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
769 bigb * bigb - .014285030400000001;
770 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
772 ycc1 = biga * xcc1 + bigb;
774 bigb1 = xcc1 / biga + ycc1;
775 coeffa = biga1 * biga1 + 1.;
776 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
777 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
778 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
779 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
781 ycc2 = biga1 * xcc2 + bigb1;
782 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
783 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
784 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
785 ypos1 * TMath::Sin(kgteta *kdegrad);
786 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
787 ypos1 * TMath::Cos(kgteta * kdegrad);
790 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
791 idrotm[(i-1) * 13 + 1105], "ONLY");
793 // --- Place part # 7-8 (see sketch)
797 dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
798 (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
800 xcc = (kxx[6] + kxx[7]) / 20.;
801 ycc = (kyy[6] + kyy[7]) / 20.;
802 xccc = (kxbeg[6] + kxend[6]) / 20.;
803 yccc = (kybeg[6] + kyend[6]) / 20.;
804 if (kxx[6] == kxx[7]) {
807 r1 = kyy[7] - kyy[6];
808 r2 = kxx[7] - kxx[6];
809 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
811 aphi = (kpphi + (i-1) * 36.) * kdegrad;
812 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
813 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
814 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
815 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
816 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
817 ypos1 * TMath::Sin(kgteta *kdegrad);
818 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
819 ypos1 * TMath::Cos(kgteta * kdegrad);
821 atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
822 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
823 atheta78 + 90., 0., 0.);
824 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
825 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
827 // --- Place part # 8-9 (see sketch)
831 dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) +
832 (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
834 xcc = (kxx[7] + kxx[8]) / 20.;
835 ycc = (kyy[7] + kyy[8]) / 20.;
836 xccc = (kxbeg[7] + kxend[7]) / 20.;
837 yccc = (kybeg[7] + kyend[7]) / 20.;
838 if (kxx[1] == kxx[2]) {
841 r1 = kyy[8] - kyy[7];
842 r2 = kxx[8] - kxx[7];
843 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
845 aphi = (kpphi + (i-1) * 36.) * kdegrad;
846 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
847 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
848 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
849 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
850 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
851 ypos1 * TMath::Sin(kgteta *kdegrad);
852 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
853 ypos1 * TMath::Cos(kgteta * kdegrad);
855 atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
856 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
857 atheta89 + 90., 0., 0.);
858 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
859 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
861 // --- Place an element of layer #2
863 biga = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
864 bigb = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
865 coeffa = biga * biga + 1.;
866 coeffb = biga * bigb - biga * ycc - xcc;
867 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
868 bigb * bigb - .014285030400000001;
869 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
871 ycc1 = biga * xcc1 + bigb;
873 bigb1 = xcc1 / biga + ycc1;
874 coeffa = biga1 * biga1 + 1.;
875 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
876 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
877 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
878 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
880 ycc2 = biga1 * xcc2 + bigb1;
881 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
882 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
883 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
884 ypos1 * TMath::Sin(kgteta *kdegrad);
885 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
886 ypos1 * TMath::Cos(kgteta * kdegrad);
889 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
890 idrotm[(i-1) * 13 + 1107], "ONLY");
892 // --- Place part # 9-10 (see sketch)
896 dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
897 (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
899 xcc = (kxx[8] + kxx[9]) / 20.;
900 ycc = (kyy[8] + kyy[9]) / 20.;
901 xccc = (kxbeg[8] + kxend[8]) / 20.;
902 yccc = (kybeg[8] + kyend[8]) / 20.;
903 if (kxx[8] == kxx[9]) {
906 r1 = kyy[9] - kyy[8];
907 r2 = kxx[9] - kxx[8];
908 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
910 aphi = (kpphi + (i-1) * 36.) * kdegrad;
911 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
912 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
913 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
914 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
915 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
916 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
918 atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
919 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
920 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
922 // --- Place part # 10-11 (see sketch)
926 dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
928 xcc = (kxx[9] + kxx[10]) / 20.;
929 ycc = (kyy[9] + kyy[10]) / 20.;
930 xccc = (kxbeg[9] + kxend[9]) / 20.;
931 yccc = (kybeg[9] + kyend[9]) / 20.;
932 if (kxx[9] == kxx[10]) {
935 r1 = kyy[10] - kyy[9];
936 r2 = kxx[10] - kxx[9];
937 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
939 aphi = (kpphi + (i-1) * 36.) * kdegrad;
940 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
941 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
942 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
943 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
944 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
945 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
947 atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
948 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
949 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
951 // --- Place part # 13-14 (see sketch)
955 dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
957 xcc = (kxx[12] + kxx[13]) / 20.;
958 ycc = (kyy[12] + kyy[13]) / 20.;
959 xccc = (kxbeg[12] + kxend[12]) / 20.;
960 yccc = (kybeg[12] + kyend[12]) / 20.;
961 if (kxx[12] == kxx[13]) {
964 r1 = kyy[12] - kyy[13];
965 r2 = kxx[12] - kxx[13];
966 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
968 aphi = (kpphi + (i-1) * 36.) * kdegrad;
969 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
970 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
971 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
972 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
973 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
974 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
976 atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
977 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
978 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
980 // --- Place an element of layer #1
982 biga = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
983 bigb = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
984 coeffa = biga * biga + 1.;
985 coeffb = biga * bigb - biga * ycc - xcc;
986 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
987 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
988 ycc1 = biga * xcc1 + bigb;
990 bigb1 = xcc1 / biga + ycc1;
991 coeffa = biga1 * biga1 + 1.;
992 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
993 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
994 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
995 ycc2 = biga1 * xcc2 + bigb1;
996 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
997 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
998 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
999 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1002 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
1004 // --- Place part # 12-13 (see sketch)
1008 dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
1010 xcc = (kxx[11] + kxx[12]) / 20.;
1011 ycc = (kyy[11] + kyy[12]) / 20.;
1012 xccc = (kxbeg[11] + kxend[11]) / 20.;
1013 yccc = (kybeg[11] + kyend[11]) / 20.;
1014 if (kxx[11] == kxx[12]) {
1017 r1 = kyy[12] - kyy[11];
1018 r2 = kxx[12] - kxx[11];
1019 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1021 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1022 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1023 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1024 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1025 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1026 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1027 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1029 atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
1030 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
1031 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
1033 // --- Place part # 11-12 (see sketch)
1037 dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
1039 xcc = (kxx[10] + kxx[11]) / 20.;
1040 ycc = (kyy[10] + kyy[11]) / 20.;
1041 xccc = (kxbeg[10] + kxend[10]) / 20.;
1042 yccc = (kybeg[10] + kyend[10]) / 20.;
1043 if (kxx[10] == kxx[11]) {
1046 r1 = kyy[11] - kyy[10];
1047 r2 = kxx[11] - kxx[10];
1048 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1050 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1051 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1052 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1053 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1054 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1055 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1056 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1058 atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
1059 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1060 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1062 // --- Place an element of layer #1
1064 biga = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
1065 bigb = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
1066 coeffa = biga * biga + 1.;
1067 coeffb = biga * bigb - biga * ycc - xcc;
1068 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1069 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1070 ycc1 = biga * xcc1 + bigb;
1072 bigb1 = xcc1 / biga + ycc1;
1073 coeffa = biga1 * biga1 + 1.;
1074 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1075 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1076 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1077 ycc2 = biga1 * xcc2 + bigb1;
1078 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1079 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1080 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1081 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1084 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1086 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1088 darc[0] = krarc[12] / 10. - .02;
1089 darc[1] = krarc[12] / 10.;
1091 darc[3] = atheta12 - (i-1) * 36.;
1092 darc[4] = atheta23 - (i-1) * 36.;
1093 xcc = kxarc[12] / 10.;
1094 ycc = kyarc[12] / 10.;
1095 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1096 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1097 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1098 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1099 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1100 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1101 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1103 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1105 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1107 darc[0] = krarc[11] / 10. - .02;
1108 darc[1] = krarc[11] / 10.;
1110 darc[3] = atheta23 + 90. - (i-1) * 36.;
1111 darc[4] = atheta34 + 90. - (i-1) * 36.;
1112 xcc = kxarc[11] / 10.;
1113 ycc = kyarc[11] / 10.;
1114 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1115 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1116 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1117 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1118 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1119 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1120 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1122 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1124 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1126 darc[0] = krarc[10] / 10. - .02;
1127 darc[1] = krarc[10] / 10.;
1129 darc[3] = atheta45 + 180. - (i-1) * 36.;
1130 darc[4] = atheta34 + 180. - (i-1) * 36.;
1131 xcc = kxarc[10] / 10.;
1132 ycc = kyarc[10] / 10.;
1133 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1134 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1135 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1136 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1137 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1138 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1139 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1141 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1143 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1145 darc[0] = krarc[9] / 10. - .02;
1146 darc[1] = krarc[9] / 10.;
1148 darc[3] = atheta45 - 90. - (i-1) * 36.;
1149 darc[4] = atheta56 - 90. - (i-1) * 36.;
1150 xcc = kxarc[9] / 10.;
1151 ycc = kyarc[9] / 10.;
1152 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1153 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1154 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1155 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1156 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1157 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1158 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1160 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1162 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1164 darc[0] = krarc[8] / 10. - .02;
1165 darc[1] = krarc[8] / 10.;
1167 darc[3] = atheta67 + 45. - (i-1) * 36.;
1168 darc[4] = atheta56 + 45. - (i-1) * 36.;
1169 xcc = kxarc[8] / 10.;
1170 ycc = kyarc[8] / 10.;
1171 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1172 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1173 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1174 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1175 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1176 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1177 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1179 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1181 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1183 darc[0] = krarc[7] / 10. - .02;
1184 darc[1] = krarc[7] / 10.;
1186 darc[3] = atheta67 - (i-1) * 36.;
1187 darc[4] = atheta78 - (i-1) * 36.;
1188 xcc = kxarc[7] / 10.;
1189 ycc = kyarc[7] / 10.;
1190 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1191 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1192 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1193 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1194 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1195 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1196 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1198 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1200 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1202 darc[0] = krarc[6] / 10. - .02;
1203 darc[1] = krarc[6] / 10.;
1205 darc[3] = atheta89 + 45. - (i-1) * 36.;
1206 darc[4] = atheta78 + 45. - (i-1) * 36.;
1207 xcc = kxarc[6] / 10.;
1208 ycc = kyarc[6] / 10.;
1209 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1210 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1211 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1212 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1213 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1214 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1215 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1217 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1219 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1221 darc[0] = krarc[5] / 10. - .02;
1222 darc[1] = krarc[5] / 10.;
1224 darc[3] = atheta89 + 45. - (i-1) * 36.;
1225 darc[4] = atheta910 + 45. - (i-1) * 36.;
1226 xcc = kxarc[5] / 10.;
1227 ycc = kyarc[5] / 10.;
1228 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1229 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1230 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1231 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1232 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1233 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1234 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1236 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1238 // --- Place arc # 5 (between part 9-10 and part 10-11)
1241 darc[0] = krarc[4] / 10. - .02;
1242 darc[1] = krarc[4] / 10.;
1244 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1245 darc[4] = atheta910 + 45. - (i-1) * 36.;
1246 xcc = kxarc[4] / 10.;
1247 ycc = kyarc[4] / 10.;
1248 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1249 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1250 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1251 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1252 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1253 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1254 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1256 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1258 // --- Place arc # 4 (between part 10-11 and part 11-12)
1261 darc[0] = krarc[3] / 10. - .02;
1262 darc[1] = krarc[3] / 10.;
1264 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1265 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1266 xcc = kxarc[3] / 10.;
1267 ycc = kyarc[3] / 10.;
1268 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1269 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1270 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1271 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1272 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1273 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1274 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1276 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1278 // --- Place arc # 3 (between part 11-12 and part 12-13)
1281 darc[0] = krarc[2] / 10. - .02;
1282 darc[1] = krarc[2] / 10.;
1284 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1285 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1286 xcc = kxarc[2] / 10.;
1287 ycc = kyarc[2] / 10.;
1288 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1289 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1290 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1291 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1292 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1293 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1294 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1296 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1298 // --- Place arc # 2 (between part 12-13 and part 13-14)
1301 darc[0] = krarc[1] / 10. - .02;
1302 darc[1] = krarc[1] / 10.;
1304 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1305 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1306 xcc = kxarc[1] / 10.;
1307 ycc = kyarc[1] / 10.;
1308 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1309 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1310 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1311 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1312 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1313 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1314 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1316 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1318 // --- Place arc # 1 (between part 13-14 and part 1-2)
1321 darc[0] = krarc[0] / 10. - .02;
1322 darc[1] = krarc[0] / 10.;
1324 darc[3] = atheta12 + 45. - (i-1) * 36.;
1325 darc[4] = atheta1314 - (i-1) * 36.;
1326 xcc = kxarc[0] / 10.;
1327 ycc = kyarc[0] / 10.;
1328 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1329 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1330 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1331 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1332 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1333 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1334 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1336 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1339 //************************************************************************
1344 //************************************************************************
1346 // --- Define a ghost volume containing the Silicon Drift Detectors
1347 // (layer #3 and #4) and fill it with air or vacuum
1349 xxm = (49.999-3.)/(70.-25.);
1353 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1356 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1359 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1362 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1365 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1367 // --- Place the ghost volume in its mother volume (ITSV) and make it
1370 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1371 gMC->Gsatt("IT34", "SEEN", 0);
1375 // GOTO 3456 ! skip ITS layer no. 3
1377 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1378 // smaller lenght of ribs) and fill it with air or vacuum
1380 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1382 // the widest element is the sensitive element
1383 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1384 // 7.5 cm is the lenght
1385 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1387 // --- Make the ghost volume invisible
1389 gMC->Gsatt("IDV1", "SEEN", 0);
1391 // --- Define a volume containing the sensitive part of drifts
1392 // (silicon, layer #3)
1395 // see material budget report by G. Feofilov
1398 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1400 //--- Define the part of the (smaller) rib between two sensitive parts made of
1401 // carbon (layer #3)
1403 dsup[0] = .5 - dits[0];
1405 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1406 // 7.5 cm is the lenght
1407 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1409 //--- Define the first part of the (smaller) rib between two sensitive parts
1410 // made of aluminum (layer #3)
1412 dal1[0] = .5 - dits[0];
1413 dal1[1] = 0.00096/2.;
1414 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1415 // 7.5 cm is the lenght
1416 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1418 //--- Define the part of the (smaller) rib between two sensitive parts made of
1419 // kapton (layer #3)
1421 dkap[0] = .5 - dits[0];
1423 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1424 // 7.5 cm is the lenght
1425 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1427 //--- Define the second part of the (smaller) rib between two sensitive parts
1428 // made of aluminum (layer #3)
1430 dal2[0] = .5 - dits[0];
1431 dal2[1] = 0.0027/2.;
1432 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1433 // 7.5 cm is the lenght
1434 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1436 // --- Define the part of the (smaller) rib between two sensitive parts
1437 // made of silicon (the electronics) (layer #3)
1439 dchi[0] = .5 - dits[0];
1440 dchi[1] = 0.0071/2.;
1441 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1442 // 7.5 cm is the lenght
1443 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1445 // --- Define the part of the (smaller) rib between two sensitive parts
1446 // made of water (the cooler) (layer #3)
1448 dwat[0] = .5 - dits[0];
1449 dwat[1] = 0.0093/2.;
1450 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1451 // 7.5 cm is the lenght
1452 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1454 //--- Define the third part of the (smaller) rib between two sensitive parts
1455 // made of aluminum (the cooling tubes) (layer #3)
1457 dtub[0] = .5 - dits[0];
1458 dtub[1] = 0.00134/2.;
1459 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1460 // 7.5 cm is the lenght
1461 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1463 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1466 // twice the foreseen thickness
1469 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1471 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1474 // twice the foreseen thickness
1477 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1479 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1482 // twice the foreseen thickness
1485 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1487 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1490 // twice the foreseen thickness
1493 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1495 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1499 for (j = 1; j <= 5; ++j) {
1500 // odd elements are up and even elements are down
1502 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1503 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1504 } else if (j == 2) {
1505 xpos = -dbox1[0] + dits[0];
1506 zpos = 0. - dits[2] + 1. - dits[2];
1507 } else if (j == 3) {
1508 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1510 } else if (j == 4) {
1511 xpos = -dbox1[0] + dits[0];
1512 zpos = dits[2] + 0. - 1. + dits[2];
1513 } else if (j == 5) {
1514 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1515 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1517 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1520 // --- Place the smaller ribs into their mother (IDV1)
1522 // --- Right ribs (just a matter of convention)
1524 xpos = .5 - dbox1[0] + dits[0];
1530 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1534 ypos = dsup[1] + 2.81 + dal1[1];
1535 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1539 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1540 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1544 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1545 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1547 // --- Silicon (chip)
1549 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1550 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1554 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1555 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1559 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1561 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1563 // --- Right ribs (just a matter of convention)
1568 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1572 ypos = -(dsup[1] + 2.81 + dal1[1]);
1573 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1577 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1578 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1582 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1583 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1585 // --- Silicon (chip)
1587 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1588 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1592 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1593 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1597 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1598 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1599 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1601 // --- Place the end-ladder stuff into its mother (IDV1)
1604 // --- Negative-Z end-ladder
1607 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1611 xpos = dbox1[0] - dpcb[0];
1612 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1616 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1617 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1621 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1622 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1624 // --- Silicon (bus)
1626 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1627 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1629 // --- Positive-Z end-ladder
1632 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1636 xpos = dbox1[0] - dpcb[0];
1637 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1641 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1642 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1646 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1647 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1649 // --- Silicon (bus)
1651 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1652 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1654 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1655 // larger lenght of ribs) and fill it with air or vacuum
1657 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1659 // the widest element is the sensitive element
1660 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1661 // 7.5 cm is the lenght
1662 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1664 // --- Make the ghost volume invisible
1666 gMC->Gsatt("IDV2", "SEEN", 0);
1668 //--- Define the part of the (larger) rib between two sensitive parts madeof
1669 // carbon (layer #3)
1671 dsup[0] = .65 - dits[0];
1673 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1674 // 7.5 cm is the lenght
1675 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1677 //--- Define the first part of the (larger) rib between two sensitive parts
1678 // made of aluminum (layer #3)
1680 dal1[0] = .65 - dits[0];
1681 dal1[1] = 0.00096/2.;
1682 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1683 // 7.5 cm is the lenght
1684 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1686 //--- Define the part of the (larger) rib between two sensitive parts madeof
1687 // kapton (layer #3)
1689 dkap[0] = .65 - dits[0];
1690 dkap[1] = 0.0317/2.;
1691 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1692 // 7.5 cm is the lenght
1693 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1695 //--- Define the second part of the (larger) rib between two sensitive parts
1696 // made of aluminum (layer #3)
1698 dal2[0] = .65 - dits[0];
1699 dal2[1] = 0.0027/2.;
1700 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1701 // 7.5 cm is the lenght
1702 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1704 // --- Define the part of the (larger) rib between two sensitive parts
1705 // made of silicon (the electronics) (layer #3)
1707 dchi[0] = .65 - dits[0];
1708 dchi[1] = 0.0071/2.;
1709 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1710 // 7.5 cm is the lenght
1711 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1713 // --- Define the part of the (larger) rib between two sensitive parts
1714 // made of water (the cooler) (layer #3)
1716 dwat[0] = .65 - dits[0];
1717 dwat[1] = 0.0093/2.;
1718 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1719 // 7.5 cm is the lenght
1720 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1722 //--- Define the third part of the (larger) rib between two sensitive parts
1723 // made of aluminum (the cooling tubes) (layer #3)
1725 dtub[0] = .65 - dits[0];
1726 dtub[1] = 0.00134/2.;
1727 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1728 // 7.5 cm is the lenght
1729 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1731 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1735 for (j = 1; j <= 5; ++j) {
1736 // odd element are up and even elements are down
1738 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1739 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1740 } else if (j == 2) {
1741 xpos = -dbox2[0] + dits[0];
1742 zpos = 0. - dits[2] + 1. - dits[2];
1743 } else if (j == 3) {
1744 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1746 } else if (j == 4) {
1747 xpos = -dbox2[0] + dits[0];
1748 zpos = dits[2] + 0. - 1. + dits[2];
1749 } else if (j == 5) {
1750 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1751 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1753 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1756 // --- Place the larger ribs into their mother (IDV2)
1759 // --- Right ribs (just a matter of convention)
1761 xpos = .65 - dbox2[0] + dits[0];
1767 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1771 ypos = dsup[1] + 2.81 + dal1[1];
1772 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1776 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1777 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1781 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1782 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1784 // --- Silicon (chip)
1786 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1787 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1791 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1792 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1796 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1797 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1799 // --- Right ribs (just a matter of convention)
1804 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1808 ypos = -(dsup[1] + 2.81 + dal1[1]);
1809 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1813 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1814 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1818 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1819 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1821 // --- Silicon (chip)
1823 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1824 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1828 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1829 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1833 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1834 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1836 // --- Place the end-ladder stuff into its mother (IDV1)
1839 // --- Negative-Z end-ladder
1842 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1846 xpos = dbox2[0] - dpcb[0];
1847 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1851 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1852 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1856 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1857 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1859 // --- Silicon (bus)
1861 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1862 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1864 // --- Positive-Z end-ladder
1867 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1871 xpos = dbox2[0] - dpcb[0];
1872 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1876 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1877 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1881 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1882 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1884 // --- Silicon (bus)
1886 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1887 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1889 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1890 // mother volume (IT34)
1891 // Odd elements have large ribs and even elements have small ribs
1893 for (i = 1; i <= 12; ++i) {
1894 atheta = (i-1) * 30.;
1895 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1898 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1899 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1901 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1904 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1905 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1907 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1914 // GOTO 4567 ! skip ITS layer no. 4
1916 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1917 // smaller lenght of ribs) and fill it with air or vacuum
1919 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1921 // the widest element is the end-ladder stuff
1922 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1923 // 7.5 cm is the lenght
1924 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1926 // --- Make the ghost volume invisible
1928 gMC->Gsatt("IDV3", "SEEN", 0);
1930 // --- Define a volume containing the sensitive part of drifts
1931 // (silicon, layer #4)
1934 // see material budget report by G. Feofilov
1937 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1939 //--- Define the part of the (smaller) rib between two sensitive parts made of
1940 // carbon (layer #4)
1942 dsup[0] = .5 - dits[0];
1944 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1945 // 7.5 cm is the lengh
1946 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1948 //--- Define the first part of the (smaller) rib between two sensitive parts
1949 // made of aluminum (layer #4)
1951 dal1[0] = .5 - dits[0];
1952 dal1[1] = 0.00096/2.;
1953 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1954 // 7.5 cm is the lengh
1955 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1957 //--- Define the part of the (smaller) rib between two sensitive parts made of
1958 // kapton (layer #4)
1960 dkap[0] = .5 - dits[0];
1961 dkap[1] = 0.0317/2.;
1962 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1963 // 7.5 cm is the lengh
1964 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1966 //--- Define the second part of the (smaller) rib between two sensitive parts
1967 // made of aluminum (layer #4)
1969 dal2[0] = .5 - dits[0];
1970 dal2[1] = 0.0027/2.;
1971 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1972 // 7.5 cm is the lengh
1973 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1975 // --- Define the part of the (smaller) rib between two sensitive parts
1976 // made of silicon (the electronics) (layer #4)
1978 dchi[0] = .5 - dits[0];
1979 dchi[1] = 0.0071/2.;
1980 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1981 // 7.5 cm is the lengh
1982 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1984 // --- Define the part of the (smaller) rib between two sensitive parts
1985 // made of water (the cooler) (layer #4)
1987 dwat[0] = .5 - dits[0];
1988 dwat[1] = 0.0093/2.;
1989 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1990 // 7.5 cm is the lenght
1991 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1993 //--- Define the third part of the (smaller) rib between two sensitive parts
1994 // made of aluminum (the cooling tubes) (layer #4)
1996 dtub[0] = .5 - dits[0];
1997 dtub[1] = 0.00134/2.;
1998 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1999 // 7.5 cm is the lengh
2000 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
2002 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
2005 // twice the foreseen thickness
2008 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
2010 // --- Define the part of the end-ladder stuff made of copper (layer #4)
2013 // twice the foreseen thickness
2016 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
2018 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
2021 // twice the foreseen thickness
2024 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
2026 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
2029 // twice the foreseen thickness
2032 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
2034 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2038 for (j = 1; j <= 7; ++j) {
2039 // odd elements are down and even elements are up
2041 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2042 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2043 } else if (j == 2) {
2044 xpos = -dbox1[0] + dits[0];
2045 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2046 } else if (j == 3) {
2047 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2048 zpos = 0. - dits[2] + .7 - dits[2];
2049 } else if (j == 4) {
2050 xpos = -dbox1[0] + dits[0];
2052 } else if (j == 5) {
2053 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2054 zpos = dits[2] + 0. - .7 + dits[2];
2055 } else if (j == 6) {
2056 xpos = -dbox1[0] + dits[0];
2057 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2058 } else if (j == 7) {
2059 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2060 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2062 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2065 // --- Place the smaller ribs into their mother (IDV3)
2067 // --- Right ribs (just a matter of convention)
2069 xpos = .5 - dbox1[0] + dits[0];
2075 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2079 ypos = dsup[1] + 2.81 + dal1[1];
2080 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2084 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2085 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2089 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2090 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2092 // --- Silicon (chip)
2094 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2095 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2099 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2100 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2104 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2106 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2108 // --- Right ribs (just a matter of convention)
2113 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2117 ypos = -(dsup[1] + 2.81 + dal1[1]);
2118 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2122 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2123 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2127 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2129 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2131 // --- Silicon (chip)
2133 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2134 2. + dal2[1] * 2. + dchi[1]);
2135 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2139 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2140 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2141 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2145 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2146 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2148 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2150 // --- Place the end-ladder stuff into its mother (IDV1)
2153 // --- Negative-Z end-ladder
2156 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2160 xpos = dbox1[0] - dpcb[0];
2161 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2165 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2166 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2170 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2171 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2173 // --- Silicon (bus)
2175 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2176 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2178 // --- Positive-Z end-ladder
2181 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2185 xpos = dbox1[0] - dpcb[0];
2186 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2190 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2191 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2195 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2196 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2198 // --- Silicon (bus)
2200 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2201 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2203 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2204 // larger lenght of ribs) and fill it with air or vacuum
2206 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2208 // the widest element is the end-ladder stuff
2209 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2210 // 7.5 cm is the lenght
2211 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2213 // --- Make the ghost volume invisible
2215 gMC->Gsatt("IDV4", "SEEN", 0);
2217 //--- Define the part of the (larger) rib between two sensitive parts madeof
2218 // carbon (layer #4)
2220 dsup[0] = .65 - dits[0];
2222 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2223 // 7.5 cm is the lengh
2224 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2226 //--- Define the first part of the (larger) rib between two sensitive parts
2227 // made of aluminum (layer #4)
2229 dal1[0] = .65 - dits[0];
2230 dal1[1] = 0.00096/2.;
2231 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2232 // 7.5 cm is the lengh
2233 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2235 //--- Define the part of the (larger) rib between two sensitive parts madeof
2236 // kapton (layer #4)
2238 dkap[0] = .65 - dits[0];
2239 dkap[1] = 0.0317/2.;
2240 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2241 // 7.5 cm is the lengh
2242 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2244 //--- Define the second part of the (larger) rib between two sensitive parts
2245 // made of aluminum (layer #4)
2247 dal2[0] = .65 - dits[0];
2248 dal2[1] = 0.0027/2.;
2249 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2250 // 7.5 cm is the lengh
2251 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2253 // --- Define the part of the (larger) rib between two sensitive parts
2254 // made of silicon (the electronics) (layer #4)
2256 dchi[0] = .65 - dits[0];
2257 dchi[1] = 0.0071/2.;
2258 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2259 // 7.5 cm is the lengh
2260 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2262 // --- Define the part of the (larger) rib between two sensitive parts
2263 // made of water (the cooler) (layer #4)
2265 dwat[0] = .65 - dits[0];
2266 dwat[1] = 0.0093/2.;
2267 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2268 // 7.5 cm is the lengh
2269 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2271 //--- Define the third part of the (larger) rib between two sensitive parts
2272 // made of aluminum (the cooling tubes) (layer #4)
2274 dtub[0] = .65 - dits[0];
2275 dtub[1] = 0.00134/2.;
2276 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2277 // 7.5 cm is the lengh
2278 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2280 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2284 for (j = 1; j <= 7; ++j) {
2285 // odd elements are down and even elements are up
2287 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2288 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2289 } else if (j == 2) {
2290 xpos = -dbox2[0] + dits[0];
2291 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2292 } else if (j == 3) {
2293 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2294 zpos = 0. - dits[2] + .7 - dits[2];
2295 } else if (j == 4) {
2296 xpos = -dbox2[0] + dits[0];
2298 } else if (j == 5) {
2299 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2300 zpos = dits[2] + 0. - .7 + dits[2];
2301 } else if (j == 6) {
2302 xpos = -dbox2[0] + dits[0];
2303 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2304 } else if (j == 7) {
2305 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2306 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2308 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2311 // --- Place the larger ribs into their mother (IDV4)
2314 // --- Right ribs (just a matter of convention)
2316 xpos = .65 - dbox2[0] + dits[0];
2322 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2326 ypos = dsup[1] + 2.81 + dal1[1];
2327 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2331 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2332 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2336 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2337 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2339 // --- Silicon (chip)
2341 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2342 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2346 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2347 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2351 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2353 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2355 // --- Right ribs (just a matter of convention)
2360 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2364 ypos = -(dsup[1] + 2.81 + dal1[1]);
2365 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2369 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2370 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2374 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2376 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2378 // --- Silicon (chip)
2380 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2381 2. + dal2[1] * 2. + dchi[1]);
2382 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2386 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2387 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2388 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2392 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2393 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2394 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2396 // --- Place the end-ladder stuff into its mother (IDV1)
2399 // --- Negative-Z end-ladder
2402 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2406 xpos = dbox2[0] - dpcb[0];
2407 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2411 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2412 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2416 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2417 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2419 // --- Silicon (bus)
2421 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2422 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2424 // --- Positive-Z end-ladder
2427 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2431 xpos = dbox2[0] - dpcb[0];
2432 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2436 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2437 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2441 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2442 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2444 // --- Silicon (bus)
2446 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2447 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2449 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2450 // mother volume (IT34)
2451 // Odd elements have large ribs and even elements have small ribs
2453 for (i = 1; i <= 24; ++i) {
2454 atheta = (i-1) * 15.;
2455 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2458 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2459 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2461 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2463 rzero = (24.0+22.8)/2.;
2464 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2465 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2467 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2471 //************************************************************************
2476 //************************************************************************
2478 // --- Define SSD with the 35+39 lay-out
2480 if (fMinorVersion < 3) {
2482 //--- Define ghost volume containing the Strip Detectors and fill it with air
2485 xxm = (49.999-3.)/(70.-25.);
2489 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2490 (37.-27)/xxm-(49.998-37.)/xxm;
2493 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2497 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2501 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2502 (37.-27)/xxm+(49.998-37.)/xxm;
2505 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2506 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2507 gMC->Gsatt("IT56", "SEEN", 0);
2511 // GOTO 5678 ! skip ITS layer no. 5
2513 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2514 // it with air or vacuum
2516 dbox1[0] = (0.0600+2.*0.0150)/2.;
2518 dbox1[2] = 90.22/2.;
2519 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2521 // --- Make the ghost volume invisible
2523 gMC->Gsatt("ISV1", "SEEN", 0);
2525 // --- Define a ghost volume containing the electronics and cooling of
2526 // a single ladder of layer #5 and fill it with air or vacuum
2528 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2531 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2533 // --- Make the ghost volume invisible
2535 gMC->Gsatt("SSV1", "SEEN", 0);
2537 // --- Define a ghost volume containing the end-ladder stuff of
2538 // a single ladder of layer #5 and fill it with air or vacuum
2543 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2545 // --- Make the ghost volume invisible
2547 gMC->Gsatt("ELL5", "SEEN", 0);
2549 // --- Define a volume containing the sensitive part of the strips
2550 // (silicon, layer #5)
2555 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2557 // --- Define a volume containing the electronics of the strips
2558 // (silicon, layer #5)
2563 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2565 // --- Define the cooling tubes (aluminum, layer #5)
2568 dtub[1] = dtub[0] + .01;
2570 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2572 // --- Define the cooling fluid (water or freon, layer #5)
2577 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2578 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2580 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2588 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2589 dfra[6] = dfra[5] + .03;
2593 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2595 // --- Define the element connecting the triangles of the heat bridge
2596 // (carbon, layer #5)
2601 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2603 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2606 dpla[0] = (10./(8.*7.))/2.;
2609 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2611 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2613 dcop[0] = (2./(8.*7.))/2.;
2616 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2618 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2620 depx[0] = (30./(8.*7.))/2.;
2623 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2625 // --- Define the part of the end-ladder stuff made of silicon (bus)
2628 dsil[0] = (20./(8.*7.))/2.;
2631 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2633 // --- Place the end-ladder stuff into its mother (ELL5)
2635 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2641 xpos = -dela[0] + dpla[0];
2642 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2646 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2647 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2651 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2652 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2654 // --- Silicon (bus)
2656 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2657 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2659 // --- Place the sensitive part of the strips into its mother (ISV1)
2662 for (j = 1; j <= 23; ++j) {
2663 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2664 else xpos = -dbox1[0] + dits[0];
2665 zpos = ((j - 1) - 11.) * 3.91;
2666 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2669 // --- Place the electronics of the strips into its mother (SSV1)
2672 for (j = 1; j <= 23; ++j) {
2673 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2674 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2675 zpos = ((j - 1) - 11.) * 3.91 + .85;
2676 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2679 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2681 xpos = -dsrv[0] + .41;
2684 // --- Left tube (just a matter of convention)
2687 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2688 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2690 // --- Right tube (just a matter of convention)
2693 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2694 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2696 // --- Place the heat bridge elements into their mother (SSV1)
2698 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2700 for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2701 // volume SSV1. This is the same number of
2702 // elements as SCH5 above. Done Bjorn S. Nilsen
2703 // April 4 2000. Error found by Ivana
2704 // Hrivnacova March 29 2000.
2705 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2706 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2709 // --- Place the elements connecting the triangles of the heat bridge
2710 // into their mother (SSV1)
2714 // --- Left element (just a matter of convention)
2716 xpos = -dsrv[0] + .47;
2717 ypos = -(2.1+0.015);
2718 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2720 // --- Right element
2722 xpos = -dsrv[0] + .47;
2724 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2728 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2730 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2732 // --- Place the ghost volumes containing the strip ladders (ISV1),
2733 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2734 // their mother volume (IT56)
2736 offset1 = TMath::ATan2(.9, 40.);
2738 rzero = dbox1[0] + 40.;
2739 runo = dbox1[0] * 2. + 40. + dsrv[0];
2740 rtwo = dbox1[0] * 2. + 40. + dela[0];
2741 for (i = 1; i <= 35; ++i) {
2742 atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
2743 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2745 // --- Strip ladders
2747 xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2748 ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2750 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2752 // --- Electronics/cooling
2754 xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2755 ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2757 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2759 // --- End-ladders (nagative-Z and positive-Z)
2761 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2762 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2763 zpos = -(dbox1[2] + dela[2] + 6.);
2764 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2765 zpos = dbox1[2] + dela[2] + 6.;
2766 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2772 // GOTO 5778 ! skip ITS layer no. 6
2774 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2775 // it with air or vacuum
2777 dbox2[0] = (0.0600+2.*0.0150)/2.;
2779 dbox2[2] = 101.95/2.;
2780 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2782 // --- Make the ghost volume invisible
2784 gMC->Gsatt("ISV2", "SEEN", 0);
2786 // --- Define a ghost volume containing the electronics and cooling of
2787 // a single ladder of layer #6 and fill it with air or vacuum
2789 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2791 dsrv[2] = 101.95/2.;
2792 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2794 // --- Make the ghost volume invisible
2796 gMC->Gsatt("SSV2", "SEEN", 0);
2798 // --- Define a ghost volume containing the end-ladder stuff of
2799 // a single ladder of layer #6 and fill it with air or vacuum
2804 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2806 // --- Make the ghost volume invisible
2808 gMC->Gsatt("ELL6", "SEEN", 0);
2810 // --- Define a volume containing the sensitive part of the strips
2811 // (silicon, layer #6)
2816 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2818 // --- Define a volume containing the electronics of the strips
2819 // (silicon, layer #6)
2824 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2826 // --- Define the cooling tubes (aluminum, layer #6)
2829 dtub[1] = dtub[0] + .01;
2830 dtub[2] = 101.95/2.;
2831 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2833 // --- Define the cooling fluid (water or freon, layer #6)
2837 dwat[2] = 101.95/2.;
2838 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2839 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2841 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2849 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2850 dfra[6] = dfra[5] + .03;
2854 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2856 // --- Define the element connecting the triangles of the heat bridge
2857 // (carbon, layer #6)
2861 dcei[2] = 101.95/2.;
2862 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2864 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2867 dpla[0] = (10./(8.*7.))/2.;
2870 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2872 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2874 dcop[0] = (2./(8.*7.))/2.;
2877 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2879 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2881 depx[0] = (30./(8.*7.))/2.;
2884 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2886 // --- Define the part of the end-ladder stuff made of silicon (bus)
2889 dsil[0] = (20./(8.*7.))/2.;
2892 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2894 // --- Place the end-ladder stuff into its mother (ELL5)
2896 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2902 xpos = -dela[0] + dpla[0];
2903 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2907 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2908 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2912 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2913 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2915 // --- Silicon (bus)
2917 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2918 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2920 // --- Place the sensitive part of the strips into its mother (ISV2)
2923 for (j = 1; j <= 26; ++j) {
2924 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2925 else xpos = -dbox2[0] + dits[0];
2926 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2927 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2930 // --- Place the electronics of the strips into its mother (SSV2)
2933 for (j = 1; j <= 26; ++j) {
2934 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2935 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2936 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2937 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2940 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2942 xpos = -dsrv[0] + .41;
2945 // --- Left tube (just a matter of convention)
2948 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2949 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2951 // --- Right tube (just a matter of convention)
2954 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2955 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2957 // --- Place the heat bridge elements into their mother (SSV2)
2959 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2961 for (j = 1; j <= 27; ++j) {
2962 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2963 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2966 // --- Place the elements connecting the triangles of the heat bridge
2967 // into their mother (SSV2)
2971 // --- Left element (just a matter of convention)
2973 xpos = -dsrv[0] + .47;
2974 ypos = -(2.1+0.015);
2975 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2977 // --- Right element
2979 xpos = -dsrv[0] + .47;
2981 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2985 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2987 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2989 // --- Place the ghost volumes containing the strip ladders (ISV2),
2990 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2991 // their mother volume (IT56)
2993 offset1 = TMath::ATan2(1., 45.);
2995 rzero = dbox2[0] + 45.;
2996 runo = dbox2[0] * 2. + 45. + dsrv[0];
2997 rtwo = dbox2[0] * 2. + 45. + dela[0];
2998 for (i = 1; i <= 39; ++i) {
2999 atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
3000 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3002 // --- Strip ladders
3004 xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3005 ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3007 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3009 // --- Electronics/cooling
3011 xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3012 ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3014 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3016 // --- End-ladders (nagative-Z and positive-Z)
3018 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3019 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3020 zpos = -(dbox2[2] + dela[2] + 6.);
3021 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3022 zpos = dbox2[2] + dela[2] + 6.;
3023 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3028 // --- Define SSD with the 32+36 lay-out
3030 if (fMinorVersion >2 && fMinorVersion < 6) {
3032 //--- Define ghost volume containing the Strip Detectors and fill it with air
3035 xxm = (49.999-3.)/(70.-25.);
3039 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
3040 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3043 dgh[6] = -25. - (9.-3.01) / xxm -
3044 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3047 dgh[9] = (9.-3.01) / xxm + 25. +
3048 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3051 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3052 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3055 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3056 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3057 gMC->Gsatt("IT56", "SEEN", 0);
3061 // GOTO 6678 ! skip ITS layer no. 5
3063 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3064 // it with air or vacuum
3066 dbox1[0] = (0.0600+2.*0.0150)/2.;
3068 dbox1[2] = 86.31/2.;
3069 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3071 // --- Make the ghost volume invisible
3073 gMC->Gsatt("ISV1", "SEEN", 0);
3075 // --- Define a ghost volume containing the electronics and cooling of
3076 // a single ladder of layer #5 and fill it with air or vacuum
3078 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3081 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3083 // --- Make the ghost volume invisible
3085 gMC->Gsatt("SSV1", "SEEN", 0);
3087 // --- Define a ghost volume containing the end-ladder stuff of
3088 // a single ladder of layer #5 and fill it with air or vacuum
3093 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3095 // --- Make the ghost volume invisible
3097 gMC->Gsatt("ELL5", "SEEN", 0);
3099 // --- Define a volume containing the sensitive part of the strips
3100 // (silicon, layer #5)
3105 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3107 // --- Define a volume containing the electronics of the strips
3108 // (silicon, layer #5)
3113 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3115 // --- Define the cooling tubes (aluminum, layer #5)
3118 dtub[1] = dtub[0] + .01;
3120 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3122 // --- Define the cooling fluid (water or freon, layer #5)
3127 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3128 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3130 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3138 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3139 dfra[6] = dfra[5] + .03;
3143 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3145 // --- Define the element connecting the triangles of the heat bridge
3146 // (carbon, layer #5)
3151 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3153 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3156 dpla[0] = (10./(8.*7.))/2;
3159 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3161 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3163 dcop[0] = (2./(8.*7.))/2;
3166 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3168 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3170 depx[0] = (30./(8.*7.))/2.;
3173 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3175 // --- Define the part of the end-ladder stuff made of silicon (bus)
3178 dsil[0] = (20./(8.*7.))/2.;
3181 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3183 // --- Place the end-ladder stuff into its mother (ELL5)
3185 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3191 xpos = -dela[0] + dpla[0];
3192 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3196 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3197 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3201 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3202 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3204 // --- Silicon (bus)
3206 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3207 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3209 // --- Place the sensitive part of the strips into its mother (ISV1)
3212 for (j = 1; j <= 22; ++j) {
3213 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3214 else xpos = -dbox1[0] + dits[0];
3215 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3216 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3219 // --- Place the electronics of the strips into its mother (SSV1)
3222 for (j = 1; j <= 22; ++j) {
3223 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3224 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3225 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3226 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3229 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3231 xpos = -dsrv[0] + .41;
3234 // --- Left tube (just a matter of convention)
3237 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3238 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3240 // --- Right tube (just a matter of convention)
3243 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3244 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3246 // --- Place the heat bridge elements into their mother (SSV1)
3248 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3250 for (j = 1; j <= 23; ++j) {
3251 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3252 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3255 // --- Place the elements connecting the triangles of the heat bridge
3256 // into their mother (SSV1)
3260 // --- Left element (just a matter of convention)
3262 xpos = -dsrv[0] + .47;
3263 ypos = -(2.1+0.015);
3264 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3266 // --- Right element
3268 xpos = -dsrv[0] + .47;
3270 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3274 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3276 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3278 // --- Place the ghost volumes containing the strip ladders (ISV1),
3279 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3280 // their mother volume (IT56)
3282 offset1 = TMath::ATan2(.8, 36.6);
3284 rzero = dbox1[0] + 36.6;
3285 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3286 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3287 for (i = 1; i <= 32; ++i) {
3288 atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
3289 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3291 // --- Strip ladders
3293 xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3294 ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3296 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3298 // --- Electronics/cooling
3300 xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3301 ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3303 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3305 // --- End-ladders (nagative-Z and positive-Z)
3307 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3308 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3309 zpos = -(dbox1[2] + dela[2] + 6.);
3310 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3311 zpos = dbox1[2] + dela[2] + 6.;
3312 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3318 // GOTO 6778 ! skip ITS layer no. 6
3320 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3321 // it with air or vacuum
3323 dbox2[0] = (0.0600+2.*0.0150)/2.;
3325 dbox2[2] = 94.13/2.;
3326 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3328 // --- Make the ghost volume invisible
3330 gMC->Gsatt("ISV2", "SEEN", 0);
3332 // --- Define a ghost volume containing the electronics and cooling of
3333 // a single ladder of layer #6 and fill it with air or vacuum
3335 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3338 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3340 // --- Make the ghost volume invisible
3342 gMC->Gsatt("SSV2", "SEEN", 0);
3344 // --- Define a ghost volume containing the end-ladder stuff of
3345 // a single ladder of layer #6 and fill it with air or vacuum
3350 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3352 // --- Make the ghost volume invisible
3354 gMC->Gsatt("ELL6", "SEEN", 0);
3356 // --- Define a volume containing the sensitive part of the strips
3357 // (silicon, layer #6)
3362 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3364 // --- Define a volume containing the electronics of the strips
3365 // (silicon, layer #6)
3370 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3372 // --- Define the cooling tubes (aluminum, layer #6)
3375 dtub[1] = dtub[0] + .01;
3377 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3379 // --- Define the cooling fluid (water or freon, layer #6)
3384 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3385 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3387 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3395 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3396 dfra[6] = dfra[5] + .03;
3400 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3402 // --- Define the element connecting the triangles of the heat bridge
3403 // (carbon, layer #6)
3408 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3410 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3413 dpla[0] = (10./(8.*7.))/2;
3416 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3418 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3420 dcop[0] = (2./(8.*7.))/2;
3423 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3425 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3427 depx[0] = (30./(8.*7.))/2.;
3430 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3432 // --- Define the part of the end-ladder stuff made of silicon (bus)
3435 dsil[0] = (20./(8.*7.))/2.;
3438 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3440 // --- Place the end-ladder stuff into its mother (ELL5)
3442 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3448 xpos = -dela[0] + dpla[0];
3449 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3453 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3454 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3458 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3459 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3461 // --- Silicon (bus)
3463 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3464 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3466 // --- Place the sensitive part of the strips into its mother (ISV2)
3469 for (j = 1; j <= 24; ++j) {
3470 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3471 else xpos = dbox2[0] - dits[0];
3472 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3473 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3476 // --- Place the electronics of the strips into its mother (SSV2)
3479 for (j = 1; j <= 24; ++j) {
3480 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3481 else xpos = -dsrv[0] + .28;
3482 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3483 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3486 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3488 xpos = -dsrv[0] + .41;
3491 // --- Left tube (just a matter of convention)
3494 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3495 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3497 // --- Right tube (just a matter of convention)
3500 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3501 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3503 // --- Place the heat bridge elements into their mother (SSV2)
3505 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3507 for (j = 1; j <= 25; ++j) {
3508 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3509 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3512 // --- Place the elements connecting the triangles of the heat bridge
3513 // into their mother (SSV2)
3517 // --- Left element (just a matter of convention)
3519 xpos = -dsrv[0] + .47;
3520 ypos = -(2.1+0.015);
3521 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3523 // --- Right element
3525 xpos = -dsrv[0] + .47;
3527 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3531 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3533 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3535 // --- Place the ghost volumes containing the strip ladders (ISV2),
3536 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3537 // their mother volume (IT56)
3539 offset1 = TMath::ATan2(.9, 41.2);
3541 rzero = dbox2[0] + 41.2;
3542 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3543 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3544 for (i = 1; i <= 36; ++i) {
3545 atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
3546 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3548 // --- Strip ladders
3550 xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3551 ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3553 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3555 // --- Electronics/cooling
3557 xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3558 ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3560 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3562 // --- End-ladders (nagative-Z and positive-Z)
3564 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3565 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3566 zpos = -(dbox2[2] + dela[2] + 6.);
3567 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3568 zpos = dbox2[2] + dela[2] + 6.;
3569 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3575 //************************************************************************
3577 //* E N D - C A P S A N D F R A M E S *
3578 //* ========================================= *
3580 //************************************************************************
3582 // --- Define a dummy cylinder for multiple scattering tests
3584 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3587 // DITS(2)=DITS(1)+0.1
3589 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3590 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3593 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3595 // GOTO 8901 ! skip outer wall
3597 if (fMinorVersion == 0 || fMinorVersion == 3) {
3600 dits[1] = dits[0] + .06926;
3601 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3603 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3604 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3609 // --- The frame between the end-caps (octagonal lay-out) ---
3611 // GOTO 9012 ! skip octagonal frame
3613 if (fMinorVersion == 1) {
3618 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3621 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3623 offset = angle / 2.;
3624 for (i = 0; i < 8; ++i) {
3625 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3626 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3628 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3629 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3633 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;
3634 aphi2 = 180. - aphi1;
3635 xpos = (xtra[0] + xtra[1]) / 2.;
3636 ypos = (ytra[0] + ytra[1]) / 2.;
3637 zpos = dtra[2] / 2.;
3638 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3641 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3642 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3643 zpos = -dtra[2] / 2.;
3644 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3647 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3648 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3651 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;
3652 aphi1 = 180. - aphi2;
3653 xpos = (xtra[1] + xtra[2]) / 2.;
3654 ypos = (ytra[1] + ytra[2]) / 2.;
3655 zpos = dtra[2] / 2.;
3656 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3659 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3660 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3661 zpos = -dtra[2] / 2.;
3662 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3665 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3666 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3669 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;
3670 aphi2 = 180. - aphi1;
3671 xpos = (xtra[2] + xtra[3]) / 2.;
3672 ypos = (ytra[2] + ytra[3]) / 2.;
3673 zpos = dtra[2] / 2.;
3674 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3677 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3678 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3679 zpos = -dtra[2] / 2.;
3680 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3683 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3684 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3687 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;
3688 aphi1 = 180. - aphi2;
3689 xpos = (xtra[3] + xtra[4]) / 2.;
3690 ypos = (ytra[3] + ytra[4]) / 2.;
3691 zpos = dtra[2] / 2.;
3692 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3695 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3696 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3697 zpos = -dtra[2] / 2.;
3698 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3701 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3702 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3705 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;
3706 aphi1 = 180. - aphi2;
3707 xpos = (xtra[4] + xtra[5]) / 2.;
3708 ypos = (ytra[4] + ytra[5]) / 2.;
3709 zpos = dtra[2] / 2.;
3710 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3713 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3714 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3715 zpos = -dtra[2] / 2.;
3716 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3719 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3720 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3723 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;
3724 aphi2 = 180. - aphi1;
3725 xpos = (xtra[5] + xtra[6]) / 2.;
3726 ypos = (ytra[5] + ytra[6]) / 2.;
3727 zpos = dtra[2] / 2.;
3728 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3731 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3732 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3733 zpos = -dtra[2] / 2.;
3734 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3737 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3738 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3741 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;
3742 aphi1 = 180. - aphi2;
3743 xpos = (xtra[6] + xtra[7]) / 2.;
3744 ypos = (ytra[6] + ytra[7]) / 2.;
3745 zpos = dtra[2] / 2.;
3746 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3749 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3750 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3751 zpos = -dtra[2] / 2.;
3752 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3755 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3756 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3759 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;
3760 aphi2 = 180. - aphi1;
3761 xpos = (xtra[7] + xtra[0]) / 2.;
3762 ypos = (ytra[7] + ytra[0]) / 2.;
3763 zpos = dtra[2] / 2.;
3764 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3767 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3768 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3769 zpos = -dtra[2] / 2.;
3770 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3773 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3774 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3777 } else if (fMinorVersion == 4) {
3783 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3786 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3788 offset = angle / 2.;
3789 for (i = 0; i < 8; ++i) {
3790 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3791 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3793 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3794 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3798 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;
3799 aphi2 = 180. - aphi1;
3800 xpos = (xtra[0] + xtra[1]) / 2.;
3801 ypos = (ytra[0] + ytra[1]) / 2.;
3802 zpos = dtra[2] / 2.;
3803 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3806 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3807 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3808 zpos = -dtra[2] / 2.;
3809 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3812 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3813 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3816 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;
3817 aphi1 = 180. - aphi2;
3818 xpos = (xtra[1] + xtra[2]) / 2.;
3819 ypos = (ytra[1] + ytra[2]) / 2.;
3820 zpos = dtra[2] / 2.;
3821 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3824 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3825 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3826 zpos = -dtra[2] / 2.;
3827 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3830 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3831 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3834 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;
3835 aphi2 = 180. - aphi1;
3836 xpos = (xtra[2] + xtra[3]) / 2.;
3837 ypos = (ytra[2] + ytra[3]) / 2.;
3838 zpos = dtra[2] / 2.;
3839 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3842 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3843 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3844 zpos = -dtra[2] / 2.;
3845 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3848 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3849 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3852 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;
3853 aphi1 = 180. - aphi2;
3854 xpos = (xtra[3] + xtra[4]) / 2.;
3855 ypos = (ytra[3] + ytra[4]) / 2.;
3856 zpos = dtra[2] / 2.;
3857 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3860 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3861 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3862 zpos = -dtra[2] / 2.;
3863 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3866 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3867 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3870 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;
3871 aphi1 = 180. - aphi2;
3872 xpos = (xtra[4] + xtra[5]) / 2.;
3873 ypos = (ytra[4] + ytra[5]) / 2.;
3874 zpos = dtra[2] / 2.;
3875 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3878 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3879 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3880 zpos = -dtra[2] / 2.;
3881 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3884 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3885 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3888 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;
3889 aphi2 = 180. - aphi1;
3890 xpos = (xtra[5] + xtra[6]) / 2.;
3891 ypos = (ytra[5] + ytra[6]) / 2.;
3892 zpos = dtra[2] / 2.;
3893 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3896 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3897 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3898 zpos = -dtra[2] / 2.;
3899 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3902 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3903 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3906 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;
3907 aphi1 = 180. - aphi2;
3908 xpos = (xtra[6] + xtra[7]) / 2.;
3909 ypos = (ytra[6] + ytra[7]) / 2.;
3910 zpos = dtra[2] / 2.;
3911 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3914 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3915 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3916 zpos = -dtra[2] / 2.;
3917 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3920 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3921 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3924 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;
3925 aphi2 = 180. - aphi1;
3926 xpos = (xtra[7] + xtra[0]) / 2.;
3927 ypos = (ytra[7] + ytra[0]) / 2.;
3928 zpos = dtra[2] / 2.;
3929 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3932 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3933 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3934 zpos = -dtra[2] / 2.;
3935 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3938 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3939 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3945 // --- The frame between the end-caps (hexagonal lay-out) ---
3947 // GOTO 9123 ! skip hexagonal frame
3949 if (fMinorVersion == 2) {
3954 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3960 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3962 offset = angle / 2.;
3963 for (i = 0; i < 6; ++i) {
3964 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
3965 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
3967 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
3968 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3973 xpos = (xtra1[0] + xtra1[1]) / 2.;
3974 ypos = (ytra1[0] + ytra1[1]) / 2.;
3976 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
3979 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3980 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3984 xpos = (xtra1[1] + xtra1[2]) / 2.;
3985 ypos = (ytra1[1] + ytra1[2]) / 2.;
3987 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
3990 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3991 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3995 xpos = (xtra1[2] + xtra1[3]) / 2.;
3996 ypos = (ytra1[2] + ytra1[3]) / 2.;
3998 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4001 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4002 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4006 xpos = (xtra1[3] + xtra1[4]) / 2.;
4007 ypos = (ytra1[3] + ytra1[4]) / 2.;
4009 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4012 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4013 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4017 xpos = (xtra1[4] + xtra1[5]) / 2.;
4018 ypos = (ytra1[4] + ytra1[5]) / 2.;
4020 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4023 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4024 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4028 xpos = (xtra1[5] + xtra1[0]) / 2.;
4029 ypos = (ytra1[5] + ytra1[0]) / 2.;
4031 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4034 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4035 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4038 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4039 aphi1 = 180. - aphi2;
4040 xpos = (xtra1[0] + xtra1[1]) / 2.;
4041 ypos = (ytra1[0] + ytra1[1]) / 2.;
4042 zpos = dtra2[2] / 2.;
4043 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4046 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4047 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4048 zpos = -dtra2[2] / 2.;
4049 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4052 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4053 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4056 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4057 aphi2 = 180. - aphi1;
4058 xpos = (xtra1[1] + xtra1[2]) / 2.;
4059 ypos = (ytra1[1] + ytra1[2]) / 2.;
4060 zpos = dtra2[2] / 2.;
4061 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4064 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4065 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4066 zpos = -dtra2[2] / 2.;
4067 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4070 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4071 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4074 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4075 aphi1 = 180. - aphi2;
4076 xpos = (xtra1[2] + xtra1[3]) / 2.;
4077 ypos = (ytra1[2] + ytra1[3]) / 2.;
4078 zpos = dtra2[2] / 2.;
4079 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4082 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4083 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4084 zpos = -dtra2[2] / 2.;
4085 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4088 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4089 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4091 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))
4092 - 50.*50.))) * kraddeg;
4093 aphi2 = 180. - aphi1;
4094 xpos = (xtra1[2] + xtra1[3]) / 2.;
4095 ypos = (ytra1[2] + ytra1[3]) / 2.;
4096 zpos = dtra2[2] / 2.;
4097 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4100 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4101 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4102 zpos = -dtra2[2] / 2.;
4103 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4106 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4107 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4110 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4111 aphi1 = 180. - aphi2;
4112 xpos = (xtra1[3] + xtra1[4]) / 2.;
4113 ypos = (ytra1[3] + ytra1[4]) / 2.;
4114 zpos = dtra2[2] / 2.;
4115 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4118 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4119 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4120 zpos = -dtra2[2] / 2.;
4121 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4124 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4125 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4128 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4129 aphi2 = 180. - aphi1;
4130 xpos = (xtra1[4] + xtra1[5]) / 2.;
4131 ypos = (ytra1[4] + ytra1[5]) / 2.;
4132 zpos = dtra2[2] / 2.;
4133 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4136 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4137 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4138 zpos = -dtra2[2] / 2.;
4139 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4142 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4143 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4146 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4147 aphi1 = 180. - aphi2;
4148 xpos = (xtra1[5] + xtra1[0]) / 2.;
4149 ypos = (ytra1[5] + ytra1[0]) / 2.;
4150 zpos = dtra2[2] / 2.;
4151 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4154 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4155 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4156 zpos = -dtra2[2] / 2.;
4157 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4160 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4161 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4163 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4164 aphi2 = 180. - aphi1;
4165 xpos = (xtra1[5] + xtra1[0]) / 2.;
4166 ypos = (ytra1[5] + ytra1[0]) / 2.;
4167 zpos = dtra2[2] / 2.;
4168 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4171 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4172 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4173 zpos = -dtra2[2] / 2.;
4174 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4177 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4178 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4181 } else if (fMinorVersion == 5) {
4187 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4193 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4195 offset = angle / 2.;
4196 for (i = 0; i < 6; ++i) {
4197 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
4198 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
4200 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
4201 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4206 xpos = (xtra1[0] + xtra1[1]) / 2.;
4207 ypos = (ytra1[0] + ytra1[1]) / 2.;
4209 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
4212 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4213 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4217 xpos = (xtra1[1] + xtra1[2]) / 2.;
4218 ypos = (ytra1[1] + ytra1[2]) / 2.;
4220 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4223 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4224 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4228 xpos = (xtra1[2] + xtra1[3]) / 2.;
4229 ypos = (ytra1[2] + ytra1[3]) / 2.;
4231 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4234 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4235 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4239 xpos = (xtra1[3] + xtra1[4]) / 2.;
4240 ypos = (ytra1[3] + ytra1[4]) / 2.;
4242 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4245 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4246 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4250 xpos = (xtra1[4] + xtra1[5]) / 2.;
4251 ypos = (ytra1[4] + ytra1[5]) / 2.;
4253 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4256 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4257 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4261 xpos = (xtra1[5] + xtra1[0]) / 2.;
4262 ypos = (ytra1[5] + ytra1[0]) / 2.;
4264 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4267 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4268 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4271 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4272 aphi1 = 180. - aphi2;
4273 xpos = (xtra1[0] + xtra1[1]) / 2.;
4274 ypos = (ytra1[0] + ytra1[1]) / 2.;
4275 zpos = dtra2[2] / 2.;
4276 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4279 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4280 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4281 zpos = -dtra2[2] / 2.;
4282 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4285 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4286 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4289 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4290 aphi2 = 180. - aphi1;
4291 xpos = (xtra1[1] + xtra1[2]) / 2.;
4292 ypos = (ytra1[1] + ytra1[2]) / 2.;
4293 zpos = dtra2[2] / 2.;
4294 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4297 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4298 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4299 zpos = -dtra2[2] / 2.;
4300 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4303 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4304 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4307 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4308 aphi1 = 180. - aphi2;
4309 xpos = (xtra1[2] + xtra1[3]) / 2.;
4310 ypos = (ytra1[2] + ytra1[3]) / 2.;
4311 zpos = dtra2[2] / 2.;
4312 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4315 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4316 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4317 zpos = -dtra2[2] / 2.;
4318 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4321 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4322 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4324 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4325 aphi2 = 180. - aphi1;
4326 xpos = (xtra1[2] + xtra1[3]) / 2.;
4327 ypos = (ytra1[2] + ytra1[3]) / 2.;
4328 zpos = dtra2[2] / 2.;
4329 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4332 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4333 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4334 zpos = -dtra2[2] / 2.;
4335 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4338 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4339 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4342 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4343 aphi1 = 180. - aphi2;
4344 xpos = (xtra1[3] + xtra1[4]) / 2.;
4345 ypos = (ytra1[3] + ytra1[4]) / 2.;
4346 zpos = dtra2[2] / 2.;
4347 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4350 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4351 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4352 zpos = -dtra2[2] / 2.;
4353 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4356 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4357 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4360 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4361 aphi2 = 180. - aphi1;
4362 xpos = (xtra1[4] + xtra1[5]) / 2.;
4363 ypos = (ytra1[4] + ytra1[5]) / 2.;
4364 zpos = dtra2[2] / 2.;
4365 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4368 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4369 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4370 zpos = -dtra2[2] / 2.;
4371 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4374 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4375 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4378 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4379 aphi1 = 180. - aphi2;
4380 xpos = (xtra1[5] + xtra1[0]) / 2.;
4381 ypos = (ytra1[5] + ytra1[0]) / 2.;
4382 zpos = dtra2[2] / 2.;
4383 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4386 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4387 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4388 zpos = -dtra2[2] / 2.;
4389 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4392 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4393 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4395 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4396 aphi2 = 180. - aphi1;
4397 xpos = (xtra1[5] + xtra1[0]) / 2.;
4398 ypos = (ytra1[5] + ytra1[0]) / 2.;
4399 zpos = dtra2[2] / 2.;
4400 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4403 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4404 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4405 zpos = -dtra2[2] / 2.;
4406 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4409 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4410 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4416 // --- Define the end-caps
4418 // GOTO 9234 ! skip both end-caps
4420 // --- Define the Z>0 end-cap
4422 // GOTO 9345 ! skip the Z>0 end-cap
4427 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4428 dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4431 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4432 // end-ladder electro
4433 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4434 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4436 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4438 // In the Simonetti's drawings 52. In the TP 50.
4442 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4443 // end-ladder electro
4444 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4445 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4449 dtube[2] = 26.8/2./10.;
4452 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4454 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4455 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4461 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4462 // end-ladder electron
4465 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4466 // end-ladder electronics
4472 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4473 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4479 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4483 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4490 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4491 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4493 if (fMinorVersion < 3 ) {
4495 dpgon[0] = offset2 + 360./(2.*35.);
4499 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4503 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4510 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4511 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4513 dpgon[0] = offset2 + 360./(2.*39.);
4517 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4521 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4528 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4529 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4531 if (fMinorVersion > 2 && fMinorVersion < 6) {
4533 dpgon[0] = offset2 + 5.625;
4537 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4538 // end-ladder electronics
4541 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4542 // end-ladder electr
4548 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4549 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4551 dpgon[0] = offset2 + 5.;
4555 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4556 // end-ladder electronics
4559 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4560 // end-ladder electr
4566 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4567 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4572 // --- Define the Z<0 end-cap
4574 // GOTO 9456 ! skip the Z<0 end-cap
4577 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4578 dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4583 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4584 // end-ladder electr
4585 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4587 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4589 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4591 // In the Simonetti's drawings 52. In the TP 50.
4595 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4596 // end-ladder electr
4597 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4599 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4603 dtube[2] = 26.8/2./10.;
4606 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4608 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4610 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4616 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4617 // end-ladder electronics
4620 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4621 // end-ladder electro
4627 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4628 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4634 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4638 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4645 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4646 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4648 if (fMinorVersion < 3) {
4650 dpgon[0] = offset2 + 360./(2.*35.);
4654 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4658 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4665 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4666 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4668 dpgon[0] = offset2 + 360./(2.*39.);
4672 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4676 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4683 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4684 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4686 if (fMinorVersion > 2 && fMinorVersion < 6) {
4688 dpgon[0] = offset2 + 5.625;
4692 dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4693 // end-ladder electronics
4696 dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4697 // end-ladder electr
4703 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4704 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4706 dpgon[0] = offset2 + 5.;
4710 dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4711 // end-ladder electronics
4714 dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4715 // end-ladder electr
4721 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4722 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4728 // --- Outputs the geometry tree in the EUCLID/CAD format
4731 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4734 //_____________________________________________________________________________
4735 void AliITSv3::CreateMaterials(){
4736 ////////////////////////////////////////////////////////////////////////
4738 // Create ITS materials
4739 // This function defines the default materials used in the Geant
4740 // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
4741 // In general it is automatically replaced by
4742 // the CreatMaterials routine defined in AliITSv?. Should the function
4743 // CreateMaterials not exist for the geometry version you are using this
4744 // one is used. See the definition found in AliITSv5 or the other routine
4745 // for a complete definition.
4748 Float_t awat[2] = { 1.00794,15.9994 };
4749 Float_t zwat[2] = { 1.,8. };
4750 Float_t wwat[2] = { 2.,1. };
4751 Float_t denswat = 1.;
4753 Float_t afre[2] = { 12.011,18.9984032 };
4754 Float_t zfre[2] = { 6.,9. };
4755 Float_t wfre[2] = { 5.,12. };
4756 Float_t densfre = 1.5;
4758 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4759 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4760 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4761 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4762 Float_t denscer = 3.6;
4764 // 60% SiO2 , 40% G10FR4
4766 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4767 Float_t zpcb[3] = { 14.,8.,8.875 };
4768 Float_t wpcb[3] = { .28,.32,.4 };
4769 Float_t denspcb = 1.8;
4771 Float_t apoly[2] = { 12.01,1. };
4772 Float_t zpoly[2] = { 6.,1. };
4773 Float_t wpoly[2] = { .33,.67 };
4775 Float_t zserv[4] = { 1.,6.,26.,29. };
4776 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4777 Float_t wserv[4] = { .014,.086,.42,.48 };
4779 Int_t isxfld = gAlice->Field()->Integ();
4780 Float_t sxmgmx = gAlice->Field()->Max();
4783 // --- Define the various materials for GEANT ---
4785 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4787 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4788 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4789 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4790 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4792 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4793 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4794 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4795 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4796 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4798 AliMedium(0, "SPD Si$", 0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4799 AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4800 AliMedium(2, "SPD Si bus$", 2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4801 AliMedium(3, "SPD C$", 3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4802 AliMedium(4, "SPD Air$", 4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4803 AliMedium(5, "SPD Vacuum$", 5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4804 AliMedium(6, "SPD Al$", 6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4805 AliMedium(7, "SPD Water $", 7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4806 AliMedium(8, "SPD Freon$", 8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4808 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4810 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4811 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4812 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4813 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4815 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4816 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4817 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4818 // After a call with ratios by number (negative number of elements),
4819 // the ratio array is changed to the ratio by weight, so all successive
4820 // calls with the same array must specify the number of elements as
4822 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4823 // After a call with ratios by number (negative number of elements),
4824 // the ratio array is changed to the ratio by weight, so all successive
4825 // calls with the same array must specify the number of elements as
4827 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4828 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4829 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4830 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4831 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4834 AliMedium(25, "SDD Si$", 25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4835 AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4836 AliMedium(27, "SDD Si bus$", 27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4837 AliMedium(28, "SDD C$", 28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4838 AliMedium(29, "SDD Air$", 29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4839 AliMedium(30, "SDD Vacuum$", 30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4840 AliMedium(31, "SDD Al$", 31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4841 AliMedium(32, "SDD Water $", 32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4842 AliMedium(33, "SDD Freon$", 33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4843 AliMedium(34, "SDD PCB$", 34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4844 AliMedium(35, "SDD Copper$", 35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4845 AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4846 AliMedium(37, "SDD Kapton$", 37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4848 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4850 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4851 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4852 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4853 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4855 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4856 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4857 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4858 // After a call with ratios by number (negative number of elements),
4859 // the ratio array is changed to the ratio by weight, so all successive
4860 // calls with the same array must specify the number of elements as
4862 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
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(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4868 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4869 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4870 // After a call with ratios by number (negative number of elements),
4871 // the ratio array is changed to the ratio by weight, so all successive
4872 // calls with the same array must specify the number of elements as
4874 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4875 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4877 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4879 AliMedium(50, "SSD Si$", 50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4880 AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4881 AliMedium(52, "SSD Si bus$", 52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4882 AliMedium(53, "SSD C$", 53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4883 AliMedium(54, "SSD Air$", 54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4884 AliMedium(55, "SSD Vacuum$", 55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4885 AliMedium(56, "SSD Al$", 56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4886 AliMedium(57, "SSD Water $", 57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4887 AliMedium(58, "SSD Freon$", 58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4888 AliMedium(59, "SSD PCB$", 59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4889 AliMedium(60, "SSD Copper$", 60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4890 AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4891 AliMedium(62, "SSD Kapton$", 62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4892 AliMedium(63, "SSD G10FR4$", 63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4894 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4896 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4898 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4899 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4900 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4901 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4902 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4903 // After a call with ratios by number (negative number of elements),
4904 // the ratio array is changed to the ratio by weight, so all successive
4905 // calls with the same array must specify the number of elements as
4907 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4909 AliMedium(75,"GEN C$", 75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4910 AliMedium(76,"GEN Air$", 76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4911 AliMedium(77,"GEN Vacuum$", 77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
4912 AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4913 AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4914 AliMedium(80,"GEN Copper$", 80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4915 AliMedium(81,"GEN Water $", 81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4917 //_____________________________________________________________________________
4918 void AliITSv3::Init(){
4919 ////////////////////////////////////////////////////////////////////////
4920 // Initialise the ITS after it has been created.
4921 ////////////////////////////////////////////////////////////////////////
4926 //_____________________________________________________________________________
4927 void AliITSv3::StepManager(){
4928 ////////////////////////////////////////////////////////////////////////
4929 // Called for every step in the ITS, then calles the AliITShit class
4930 // creator with the information to be recoreded about that hit.
4931 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4932 // printing of information to a file which can be used to create a .det
4933 // file read in by the routine CreateGeometry(). If set to 0 or any other
4934 // value except 1, the default behavior, then no such file is created nor
4935 // it the extra variables and the like used in the printing allocated.
4936 ////////////////////////////////////////////////////////////////////////
4940 TLorentzVector position, momentum;
4941 TClonesArray &lhits = *fHits;
4942 #if ALIITSPRINTGEOM==1
4945 Float_t xl[3],xt[3],angl[6];
4946 // Float_t par[20],att[20];
4948 static Bool_t first=kTRUE,printit[6][50][50];
4949 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4950 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4958 if(gMC->IsTrackInside()) vol[3] += 1;
4959 if(gMC->IsTrackEntering()) vol[3] += 2;
4960 if(gMC->IsTrackExiting()) vol[3] += 4;
4961 if(gMC->IsTrackOut()) vol[3] += 8;
4962 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4963 if(gMC->IsTrackStop()) vol[3] += 32;
4964 if(gMC->IsTrackAlive()) vol[3] += 64;
4966 // Fill hit structure.
4967 if(!(gMC->TrackCharge())) return;
4969 // Only entering charged tracks
4970 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4972 id=gMC->CurrentVolOffID(1,copy);
4974 id=gMC->CurrentVolOffID(2,copy);
4976 } else if(id==fIdSens[1]) {
4978 id=gMC->CurrentVolOffID(1,copy);
4980 id=gMC->CurrentVolOffID(2,copy);
4982 } else if(id==fIdSens[2]) {
4985 id=gMC->CurrentVolOffID(1,copy);
4987 } else if(id==fIdSens[3]) {
4990 id=gMC->CurrentVolOffID(1,copy);
4992 } else if(id==fIdSens[4]) {
4995 id=gMC->CurrentVolOffID(1,copy);
4997 } else if(id==fIdSens[5]) {
5000 id=gMC->CurrentVolOffID(1,copy);
5003 gMC->TrackPosition(position);
5004 gMC->TrackMomentum(momentum);
5005 hits[0]=position[0];
5006 hits[1]=position[1];
5007 hits[2]=position[2];
5008 hits[3]=momentum[0];
5009 hits[4]=momentum[1];
5010 hits[5]=momentum[2];
5011 hits[6]=gMC->Edep();
5012 hits[7]=gMC->TrackTime();
5013 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
5014 #if ALIITSPRINTGEOM==1
5015 if(printit[vol[0]][vol[2]][vol[1]]){
5016 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
5017 xl[0] = xl[1] = xl[2] = 0.0;
5018 gMC->Gdtom(xl,xt,1);
5019 for(i=0;i<9;i++) mat[i] = 0.0;
5020 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
5023 gMC->Gdtom(xl,&(mat[0]),2);
5026 gMC->Gdtom(xl,&(mat[3]),2);
5029 gMC->Gdtom(xl,&(mat[6]),2);
5031 angl[0] = TMath::ACos(mat[2]);
5032 if(mat[2]==1.0) angl[0] = 0.0;
5033 angl[1] = TMath::ATan2(mat[1],mat[0]);
5034 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5036 angl[2] = TMath::ACos(mat[5]);
5037 if(mat[5]==1.0) angl[2] = 0.0;
5038 angl[3] = TMath::ATan2(mat[4],mat[3]);
5039 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5041 angl[4] = TMath::ACos(mat[8]);
5042 if(mat[8]==1.0) angl[4] = 0.0;
5043 angl[5] = TMath::ATan2(mat[7],mat[6]);
5044 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5046 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5047 // i = gMC->CurrentVolID(copy);
5048 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5049 fp = fopen("ITSgeometry_v5.det","a");
5050 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5051 vol[0],vol[2],vol[1], // layer ladder detector
5052 xt[0],xt[1],xt[2], // Translation vector
5053 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5056 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5057 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5058 ); // Adding the rotation matrix.
5061 } // end if printit[layer][ladder][detector]
5065 //____________________________________________________________________________
5066 void AliITSv3::Streamer(TBuffer &R__b){
5067 ////////////////////////////////////////////////////////////////////////
5068 // A dummy Streamer function for this class AliITSv3. By default it
5069 // only streams the AliITS class as it is required. Since this class
5070 // dosen't contain any "real" data to be saved, it doesn't.
5071 ////////////////////////////////////////////////////////////////////////
5073 if (R__b.IsReading()) {
5074 Version_t R__v = R__b.ReadVersion();
5076 AliITS::Streamer(R__b);
5078 AliITS::Streamer(R__b);
5081 R__b.WriteVersion(AliITSv3::IsA());
5082 AliITS::Streamer(R__b);
5083 } // end if R__b.IsReading()