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.21 2000/11/30 11:13:11 barbera
19 Added changes suggested by Federico Carminati on nov, 30, 2000
21 Revision 1.20 2000/10/07 17:29:51 nilsen
22 Blank Line added at end of file to remove a warning for hp compilers
25 Revision 1.19 2000/10/05 20:49:59 nilsen
26 Now using root generated streamers.
28 Revision 1.11.4.10 2000/07/31 13:50:51 barbera
29 Updated from the release
31 Revision 1.17 2000/07/10 16:07:19 fca
32 Release version of ITS code
34 Revision 1.11.4.4 2000/05/19 10:09:51 nilsen
35 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
37 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
38 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
39 <=23 (was <=24). This may not be the final version.
41 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
42 Fixed up the comments/documentation.
44 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
45 This is the version of the files after the merging done in December 1999.
46 See the ReadMe110100.txt file for details
48 Revision 1.11 1999/10/22 08:25:25 fca
49 remove double definition of destructors
51 Revision 1.10 1999/10/22 08:16:49 fca
52 Correct destructors, thanks to I.Hrivnacova
54 Revision 1.9 1999/10/06 19:56:50 fca
57 Revision 1.8 1999/10/05 08:05:09 fca
58 Minor corrections for uninitialised variables.
60 Revision 1.7 1999/09/29 09:24:20 fca
61 Introduction of the Copyright and cvs Log
65 ///////////////////////////////////////////////////////////////////////////////
67 // Inner Traking System version 3
68 // This class contains the base procedures for the Inner Tracking System
70 // Authors: R. Barbera, A. Morsch.
74 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
75 // WORK with the geometry or module classes or any analysis classes. You are
76 // strongly encouraged to uses AliITSv5.
78 ///////////////////////////////////////////////////////////////////////////////
80 // See AliITSv3::StepManager().
81 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
82 //#define ALIITSPRINTGEOM 1 // print out geometry information
87 #include <TGeometry.h>
90 #include <TFile.h> // only required for Tracking function?
92 #include <TObjArray.h>
93 #include <TObjString.h>
94 #include <TClonesArray.h>
95 #include <TLorentzVector.h>
100 #include "AliConst.h"
103 #include "AliITShit.h"
104 #include "AliITSv3.h"
109 //_____________________________________________________________________________
110 AliITSv3::AliITSv3() {
111 ////////////////////////////////////////////////////////////////////////
112 // Standard default constructor for the ITS version 3.
113 ////////////////////////////////////////////////////////////////////////
121 //____________________________________________________________________________
122 AliITSv3::AliITSv3(const AliITSv3 &source){
123 ////////////////////////////////////////////////////////////////////////
124 // Copy Constructor for ITS version 3.
125 ////////////////////////////////////////////////////////////////////////
126 if(&source == this) return;
127 printf("Not allowed to copy AliITSv3\n");
130 //_____________________________________________________________________________
131 AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
132 ////////////////////////////////////////////////////////////////////////
133 // Assignment operator for the ITS version 3.
134 ////////////////////////////////////////////////////////////////////////
135 if(&source == this) return *this;
136 printf("Not allowed to copy AliITSv3\n");
139 //_____________________________________________________________________________
140 AliITSv3::~AliITSv3() {
141 ////////////////////////////////////////////////////////////////////////
142 // Standard destructor for the ITS version 3.
143 ////////////////////////////////////////////////////////////////////////
145 //_____________________________________________________________________________
146 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
147 ////////////////////////////////////////////////////////////////////////
148 // Standard constructor for the ITS version 3.
149 ////////////////////////////////////////////////////////////////////////
153 // TObjArray of TObjStrings
154 fIdName = new TObjArray(fIdN);
155 fIdName->AddAt(new TObjString("ITS1"),0);
156 fIdName->AddAt(new TObjString("ITS2"),1);
157 fIdName->AddAt(new TObjString("ITS3"),2);
158 fIdName->AddAt(new TObjString("ITS4"),3);
159 fIdName->AddAt(new TObjString("ITS5"),4);
160 fIdName->AddAt(new TObjString("ITS6"),5);
162 // Array of TStrings.
163 fIdName = new TString[fIdN];
170 fIdSens = new Int_t[fIdN];
171 for (Int_t i=0;i<fIdN;i++) fIdSens[i] = 0;
174 }//__________________________________________________________________________
175 void AliITSv3::BuildGeometry(){
176 ////////////////////////////////////////////////////////////////////////
177 // Geometry builder for the ITS version 3.
178 ////////////////////////////////////////////////////////////////////////
180 const int kColorITS=kYellow;
182 top = gAlice->GetGeometry()->GetNode("alice");
184 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
186 node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
187 node->SetLineColor(kColorITS);
190 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
192 node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
193 node->SetLineColor(kColorITS);
196 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
198 node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
199 node->SetLineColor(kColorITS);
202 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
204 node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
205 node->SetLineColor(kColorITS);
208 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
210 node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
211 node->SetLineColor(kColorITS);
214 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
216 node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
217 node->SetLineColor(kColorITS);
220 //_____________________________________________________________________________
221 void AliITSv3::CreateGeometry(){
222 ////////////////////////////////////////////////////////////////////////
223 // This routine creates and defines the version 3 geometry of the ITS.
224 ////////////////////////////////////////////////////////////////////////
226 const Float_t kxx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
227 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
229 const Float_t kyy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
230 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
232 const Float_t kxbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
233 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
235 const Float_t kybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
236 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
238 const Float_t kxend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
239 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
241 const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
242 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
244 const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
245 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
247 const Float_t kyarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
248 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
250 const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
251 0.5,0.7,0.5,0.7,0.5,0.5 };
252 const Float_t krr = 4.064516;
253 const Float_t ktteta = 63.00;
254 const Float_t kpphi = -35.00;
255 const Float_t kgteta = 87.78;
256 const Double_t kdegrad = kPI/180.;
257 const Double_t kraddeg = 180./kPI;
258 const Double_t ktwopi = 2*kPI;
261 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
262 dfra[10], dcer[3], dkap[3], dpla[3],
263 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
264 atheta1011, dbus[3], dtub[3], dwat[3],
265 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
266 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
267 Double_t biga1, bigb1;
268 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
269 dtra1[3], dtra2[3], dtra3[3],
270 dtra4[3], dbox1[3], dbox2[3];
272 Float_t xtra1[6], ytra1[6], ztra1[6];
274 Float_t xpos1, ypos1;
276 Float_t angle, dcone[5], dtube[3], dpgon[10];
277 Float_t rzero, xzero, yzero;
278 Double_t coeffa, coeffb, coeffc;
280 Float_t atheta, offset;
281 Float_t offset1, offset2, dgh[15];
282 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
283 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
286 Double_t xcc1, ycc1, xcc2, ycc2;
288 const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
289 "TR05","TR06","TR07","TR08"};
290 const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
291 "TR15","TR16","TR17","TR18",
292 "TR19","TR20","TR21","TR22",
293 "TR23","TR24","TR25","TR26"};
294 const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
295 const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
296 const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
297 "TR57","TR58","TR59","TR60","TR61","TR62",
298 "TR63","TR64","TR65","TR66"};
300 Int_t *idtmed = fIdtmed->GetArray()-199;
302 // --- Define a ghost volume containing the whole ITS and fill it with air
320 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
322 // --- Place the ghost volume in its mother volume (ALIC) and make it
325 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
326 gMC->Gsatt("ITSV", "SEEN", 0);
328 //************************************************************************
333 //************************************************************************
335 // GOTO 2345 ! skip ITS layer no. 1 and 2
337 // --- Define a ghost volume containing the Silicon Pixel Detectors
338 // (layer #1 and #2) and fill it with air or vacuum
340 xxm = (49.999-3)/(70-25);
344 dgh[3] = -25.-(9.-3.01)/xxm;
353 dgh[12] = 25+(9-3.01)/xxm;
356 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
358 // --- Place the ghost volume in its mother volume (ITSV) and make it
361 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
362 gMC->Gsatt("IT12", "SEEN", 0);
364 // --- Define a ghost volume containing a single element of layer #1
365 // and fill it with air or vacuum
367 dbox1[0] = 0.005+0.01+0.0075;
370 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
372 //--Divide each element of layer #1 in three ladders along the beam direction
374 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
376 // --- Make the ghost volumes invisible
378 gMC->Gsatt("IPV1", "SEEN", 0);
379 gMC->Gsatt("IPB1", "SEEN", 0);
381 // --- Define a volume containing the chip of pixels (silicon, layer #1)
385 dchi[2] = dbox1[2] / 3.;
386 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
388 // --- Define a volume containing the bus of pixels (silicon, layer #1)
393 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
395 // --- Define a volume containing the sensitive part of pixels
396 // (silicon, layer #1)
401 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
403 // --- Place the chip into its mother (IPB1)
405 xpos = dbox1[0] - dchi[0];
408 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
410 // --- Place the sensitive volume into its mother (IPB1)
412 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
413 ypos = dchi[1] - dits[1];
414 zpos = -(dchi[2] - dits[2]);
415 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
417 // --- Place the bus into its mother (IPB1)
419 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
420 ypos = dchi[1] - dbus[1];
421 zpos = -(dchi[2] - dbus[2]);
422 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
424 // --- Define a ghost volume containing a single element of layer #2
425 // and fill it with air or vacuum
427 dbox2[0] = 0.005+0.01+0.0075;
430 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
432 //--Divide each element of layer #2 in four ladders along the beam direction
434 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
436 // --- Make the ghost volumes invisible
438 gMC->Gsatt("IPV2", "SEEN", 0);
439 gMC->Gsatt("IPB2", "SEEN", 0);
441 // --- Define a volume containing the chip of pixels (silicon, layer #2)
445 dchi[2] = dbox2[2] / 4.;
446 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
448 // --- Define a volume containing the bus of pixels (silicon, layer #2)
453 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
455 // --- Define a volume containing the sensitive part of pixels
456 // (silicon, layer #2)
461 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
463 // --- Place the chip into its mother (IPB2)
465 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
468 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
470 // --- Place the sensitive volume into its mother (IPB2)
472 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
473 ypos = -(dchi[1] - dits[1]);
474 zpos = -(dchi[2] - dits[2]);
475 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
477 // --- Place the bus into its mother (IPB2)
479 xpos = dbox1[0] - dbus[0];
480 ypos = -(dchi[1] - dbus[1]);
481 zpos = -(dchi[2] - dbus[2]);
482 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
484 // --- Define a generic segment of an element of the mechanical support
489 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
491 // --- Define a generic arc of an element of the mechanical support
496 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
498 // --- Define the mechanical supports of layers #1 and #2 and place the
499 // elements of the layers in it
502 // counter over the number of elements of layer #1 (
505 // counter over the number of elements of layer #2 (
506 for (i = 1; i <= 10; ++i) {
508 // --- Place part # 1-2 (see sketch)
510 // number of carbon fiber supports (see sketch)
513 dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) +
514 (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0]) ) / 20.;
516 xcc = ( kxx[0] + kxx[1]) / 20.;
517 ycc = ( kyy[0] + kyy[1]) / 20.;
518 xccc = (kxbeg[0] + kxend[0]) / 20.;
519 yccc = (kybeg[0] + kyend[0]) / 20.;
520 if (kxx[0] == kxx[1]) {
523 r1 = kyy[1] - kyy[0];
524 r2 = kxx[1] - kxx[0];
525 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
526 } // end if kxx[0] == kxx[1]
527 aphi = (kpphi + (i-1) * 36.) * kdegrad;
528 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
529 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
530 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
531 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
532 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
533 ypos1 * TMath::Sin(kgteta *kdegrad);
534 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
535 ypos1 * TMath::Cos(kgteta * kdegrad);
537 atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
538 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
539 atheta12 + 90., 0., 0.);
540 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
541 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
543 // --- Place part # 2-3 (see sketch)
547 dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) +
548 (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
550 xcc = ( kxx[1] + kxx[2]) / 20.;
551 ycc = ( kyy[1] + kyy[2]) / 20.;
552 xccc = (kxbeg[1] + kxend[1]) / 20.;
553 yccc = (kybeg[1] + kyend[1]) / 20.;
554 if (kxx[1] == kxx[2]) {
557 r1 = kyy[2] - kyy[1];
558 r2 = kxx[2] - kxx[1];
559 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
560 } // end if kxx[1] == kxx[2]
561 aphi = (kpphi + (i-1) * 36.) * kdegrad;
562 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
563 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
564 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
565 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
566 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
567 ypos1 * TMath::Sin(kgteta * kdegrad);
568 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
569 ypos1 * TMath::Cos(kgteta * kdegrad);
571 atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
572 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
573 atheta23 + 90., 0., 0.);
574 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
575 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
577 // --- Place an element of layer #2
579 biga = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
580 bigb = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
581 coeffa = biga * biga + 1.;
582 coeffb = biga * bigb - biga * ycc - xcc;
583 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
584 bigb * bigb - 0.08964*0.08964;
585 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
587 ycc1 = biga * xcc1 + bigb;
589 bigb1 = xcc1 / biga + ycc1;
590 coeffa = biga1 * biga1 + 1.;
591 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
592 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
593 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
594 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
596 ycc2 = biga1 * xcc2 + bigb1;
597 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
598 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
599 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
600 ypos1 * TMath::Sin(kgteta *kdegrad);
601 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
602 ypos1 * TMath::Cos(kgteta * kdegrad);
605 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
606 idrotm[(i-1) * 13 + 1101], "ONLY");
608 // --- Place part # 3-4 (see sketch)
612 dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) +
613 (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
615 xcc = (kxx[1] + kxx[2]) / 20.;
616 ycc = (kyy[1] + kyy[2]) / 20.;
617 xccc = (kxbeg[2] + kxend[2]) / 20.;
618 yccc = (kybeg[2] + kyend[2]) / 20.;
619 if (kxx[2] == kxx[3]) {
622 r1 = kyy[3] - kyy[2];
623 r2 = kxx[3] - kxx[2];
624 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
625 } // end if kxx[2] == kxx[3]
626 aphi = (kpphi + (i-1) * 36.) * kdegrad;
627 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
628 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
629 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
630 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
631 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
632 ypos1 * TMath::Sin(kgteta *kdegrad);
633 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
634 ypos1 * TMath::Cos(kgteta * kdegrad);
636 atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
637 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
638 atheta34 + 90., 0., 0.);
639 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
640 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
642 // --- Place part # 4-5 (see sketch)
646 dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) +
647 (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
649 xcc = ( kxx[3] + kxx[4]) / 20.;
650 ycc = ( kyy[3] + kyy[4]) / 20.;
651 xccc = (kxbeg[3] + kxend[3]) / 20.;
652 yccc = (kybeg[3] + kyend[3]) / 20.;
653 if (kxx[3] == kxx[4]) {
656 r1 = kyy[4] - kyy[3];
657 r2 = kxx[4] - kxx[3];
658 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
659 } // end if kxx[3] == kxx[4]
660 aphi = (kpphi + (i-1) * 36.) * kdegrad;
661 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
662 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
663 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
664 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
665 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
666 ypos1 * TMath::Sin(kgteta *kdegrad);
667 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
668 ypos1 * TMath::Cos(kgteta * kdegrad);
670 atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
671 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
672 atheta45 + 90., 0., 0.);
673 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
674 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
676 // --- Place an element of layer #2
678 biga = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
679 bigb = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
680 coeffa = biga * biga + 1.;
681 coeffb = biga * bigb - biga * ycc - xcc;
682 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
683 bigb * bigb - .014285030400000001;
684 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
686 ycc1 = biga * xcc1 + bigb;
688 bigb1 = xcc1 / biga + ycc1;
689 coeffa = biga1 * biga1 + 1.;
690 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
691 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
692 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
693 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
695 ycc2 = biga1 * xcc2 + bigb1;
696 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
697 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
698 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
699 ypos1 * TMath::Sin(kgteta *kdegrad);
700 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
701 ypos1 * TMath::Cos(kgteta * kdegrad);
704 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
705 idrotm[(i-1) * 13 + 1103], "ONLY");
707 // --- Place part # 5-6 (see sketch)
711 dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) +
712 (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
714 xcc = (kxx[4] + kxx[5]) / 20.;
715 ycc = (kyy[4] + kyy[5]) / 20.;
716 xccc = (kxbeg[4] + kxend[4]) / 20.;
717 yccc = (kybeg[4] + kyend[4]) / 20.;
718 if (kxx[4] == kxx[5]) {
721 r1 = kyy[5] - kyy[4];
722 r2 = kxx[5] - kxx[4];
723 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
725 aphi = (kpphi + (i-1) * 36.) * kdegrad;
726 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
727 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
728 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
729 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
730 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
731 ypos1 * TMath::Sin(kgteta *kdegrad);
732 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
733 ypos1 * TMath::Cos(kgteta * kdegrad);
735 atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
736 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
737 atheta56 + 90., 0., 0.);
738 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
739 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
741 // --- Place part # 6-7 (see sketch)
745 dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) +
746 (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
748 xcc = (kxx[5] + kxx[6]) / 20.;
749 ycc = (kyy[5] + kyy[6]) / 20.;
750 xccc = (kxbeg[5] + kxend[5]) / 20.;
751 yccc = (kybeg[5] + kyend[5]) / 20.;
752 if (kxx[5] == kxx[6]) {
755 r1 = kyy[6] - kyy[5];
756 r2 = kxx[6] - kxx[5];
757 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
758 } // end if kxx[5] == kxx[6]
759 aphi = (kpphi + (i-1) * 36.) * kdegrad;
760 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
761 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
762 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
763 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
764 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
765 ypos1 * TMath::Sin(kgteta *kdegrad);
766 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
767 ypos1 * TMath::Cos(kgteta * kdegrad);
769 atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
770 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
771 atheta67 + 90., 0., 0.);
772 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
773 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
775 // --- Place an element of layer #2
777 biga = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
778 bigb = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
779 coeffa = biga * biga + 1.;
780 coeffb = biga * bigb - biga * ycc - xcc;
781 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
782 bigb * bigb - .014285030400000001;
783 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
785 ycc1 = biga * xcc1 + bigb;
787 bigb1 = xcc1 / biga + ycc1;
788 coeffa = biga1 * biga1 + 1.;
789 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
790 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
791 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
792 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
794 ycc2 = biga1 * xcc2 + bigb1;
795 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
796 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
797 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
798 ypos1 * TMath::Sin(kgteta *kdegrad);
799 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
800 ypos1 * TMath::Cos(kgteta * kdegrad);
803 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
804 idrotm[(i-1) * 13 + 1105], "ONLY");
806 // --- Place part # 7-8 (see sketch)
810 dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
811 (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
813 xcc = (kxx[6] + kxx[7]) / 20.;
814 ycc = (kyy[6] + kyy[7]) / 20.;
815 xccc = (kxbeg[6] + kxend[6]) / 20.;
816 yccc = (kybeg[6] + kyend[6]) / 20.;
817 if (kxx[6] == kxx[7]) {
820 r1 = kyy[7] - kyy[6];
821 r2 = kxx[7] - kxx[6];
822 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
824 aphi = (kpphi + (i-1) * 36.) * kdegrad;
825 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
826 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
827 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
828 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
829 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
830 ypos1 * TMath::Sin(kgteta *kdegrad);
831 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
832 ypos1 * TMath::Cos(kgteta * kdegrad);
834 atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
835 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
836 atheta78 + 90., 0., 0.);
837 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
838 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
840 // --- Place part # 8-9 (see sketch)
844 dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) +
845 (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
847 xcc = (kxx[7] + kxx[8]) / 20.;
848 ycc = (kyy[7] + kyy[8]) / 20.;
849 xccc = (kxbeg[7] + kxend[7]) / 20.;
850 yccc = (kybeg[7] + kyend[7]) / 20.;
851 if (kxx[1] == kxx[2]) {
854 r1 = kyy[8] - kyy[7];
855 r2 = kxx[8] - kxx[7];
856 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
858 aphi = (kpphi + (i-1) * 36.) * kdegrad;
859 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
860 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
861 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
862 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
863 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
864 ypos1 * TMath::Sin(kgteta *kdegrad);
865 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
866 ypos1 * TMath::Cos(kgteta * kdegrad);
868 atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
869 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
870 atheta89 + 90., 0., 0.);
871 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
872 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
874 // --- Place an element of layer #2
876 biga = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
877 bigb = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
878 coeffa = biga * biga + 1.;
879 coeffb = biga * bigb - biga * ycc - xcc;
880 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
881 bigb * bigb - .014285030400000001;
882 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
884 ycc1 = biga * xcc1 + bigb;
886 bigb1 = xcc1 / biga + ycc1;
887 coeffa = biga1 * biga1 + 1.;
888 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
889 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
890 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
891 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
893 ycc2 = biga1 * xcc2 + bigb1;
894 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
895 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
896 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
897 ypos1 * TMath::Sin(kgteta *kdegrad);
898 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
899 ypos1 * TMath::Cos(kgteta * kdegrad);
902 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
903 idrotm[(i-1) * 13 + 1107], "ONLY");
905 // --- Place part # 9-10 (see sketch)
909 dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
910 (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
912 xcc = (kxx[8] + kxx[9]) / 20.;
913 ycc = (kyy[8] + kyy[9]) / 20.;
914 xccc = (kxbeg[8] + kxend[8]) / 20.;
915 yccc = (kybeg[8] + kyend[8]) / 20.;
916 if (kxx[8] == kxx[9]) {
919 r1 = kyy[9] - kyy[8];
920 r2 = kxx[9] - kxx[8];
921 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
923 aphi = (kpphi + (i-1) * 36.) * kdegrad;
924 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
925 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
926 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
927 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
928 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
929 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
931 atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
932 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
933 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
935 // --- Place part # 10-11 (see sketch)
939 dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
941 xcc = (kxx[9] + kxx[10]) / 20.;
942 ycc = (kyy[9] + kyy[10]) / 20.;
943 xccc = (kxbeg[9] + kxend[9]) / 20.;
944 yccc = (kybeg[9] + kyend[9]) / 20.;
945 if (kxx[9] == kxx[10]) {
948 r1 = kyy[10] - kyy[9];
949 r2 = kxx[10] - kxx[9];
950 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
952 aphi = (kpphi + (i-1) * 36.) * kdegrad;
953 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
954 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
955 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
956 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
957 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
958 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
960 atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
961 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
962 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
964 // --- Place part # 13-14 (see sketch)
968 dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
970 xcc = (kxx[12] + kxx[13]) / 20.;
971 ycc = (kyy[12] + kyy[13]) / 20.;
972 xccc = (kxbeg[12] + kxend[12]) / 20.;
973 yccc = (kybeg[12] + kyend[12]) / 20.;
974 if (kxx[12] == kxx[13]) {
977 r1 = kyy[12] - kyy[13];
978 r2 = kxx[12] - kxx[13];
979 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
981 aphi = (kpphi + (i-1) * 36.) * kdegrad;
982 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
983 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
984 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
985 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
986 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
987 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
989 atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
990 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
991 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
993 // --- Place an element of layer #1
995 biga = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
996 bigb = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
997 coeffa = biga * biga + 1.;
998 coeffb = biga * bigb - biga * ycc - xcc;
999 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
1000 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1001 ycc1 = biga * xcc1 + bigb;
1003 bigb1 = xcc1 / biga + ycc1;
1004 coeffa = biga1 * biga1 + 1.;
1005 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1006 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1007 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1008 ycc2 = biga1 * xcc2 + bigb1;
1009 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1010 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1011 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1012 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1015 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
1017 // --- Place part # 12-13 (see sketch)
1021 dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
1023 xcc = (kxx[11] + kxx[12]) / 20.;
1024 ycc = (kyy[11] + kyy[12]) / 20.;
1025 xccc = (kxbeg[11] + kxend[11]) / 20.;
1026 yccc = (kybeg[11] + kyend[11]) / 20.;
1027 if (kxx[11] == kxx[12]) {
1030 r1 = kyy[12] - kyy[11];
1031 r2 = kxx[12] - kxx[11];
1032 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1034 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1035 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1036 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1037 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1038 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1039 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1040 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1042 atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
1043 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
1044 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
1046 // --- Place part # 11-12 (see sketch)
1050 dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
1052 xcc = (kxx[10] + kxx[11]) / 20.;
1053 ycc = (kyy[10] + kyy[11]) / 20.;
1054 xccc = (kxbeg[10] + kxend[10]) / 20.;
1055 yccc = (kybeg[10] + kyend[10]) / 20.;
1056 if (kxx[10] == kxx[11]) {
1059 r1 = kyy[11] - kyy[10];
1060 r2 = kxx[11] - kxx[10];
1061 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1063 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1064 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1065 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1066 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1067 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1068 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1069 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1071 atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
1072 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1073 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1075 // --- Place an element of layer #1
1077 biga = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
1078 bigb = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
1079 coeffa = biga * biga + 1.;
1080 coeffb = biga * bigb - biga * ycc - xcc;
1081 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1082 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1083 ycc1 = biga * xcc1 + bigb;
1085 bigb1 = xcc1 / biga + ycc1;
1086 coeffa = biga1 * biga1 + 1.;
1087 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1088 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1089 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1090 ycc2 = biga1 * xcc2 + bigb1;
1091 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1092 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1093 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1094 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1097 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1099 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1101 darc[0] = krarc[12] / 10. - .02;
1102 darc[1] = krarc[12] / 10.;
1104 darc[3] = atheta12 - (i-1) * 36.;
1105 darc[4] = atheta23 - (i-1) * 36.;
1106 xcc = kxarc[12] / 10.;
1107 ycc = kyarc[12] / 10.;
1108 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1109 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1110 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1111 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1112 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1113 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1114 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1116 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1118 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1120 darc[0] = krarc[11] / 10. - .02;
1121 darc[1] = krarc[11] / 10.;
1123 darc[3] = atheta23 + 90. - (i-1) * 36.;
1124 darc[4] = atheta34 + 90. - (i-1) * 36.;
1125 xcc = kxarc[11] / 10.;
1126 ycc = kyarc[11] / 10.;
1127 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1128 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1129 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1130 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1131 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1132 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1133 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1135 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1137 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1139 darc[0] = krarc[10] / 10. - .02;
1140 darc[1] = krarc[10] / 10.;
1142 darc[3] = atheta45 + 180. - (i-1) * 36.;
1143 darc[4] = atheta34 + 180. - (i-1) * 36.;
1144 xcc = kxarc[10] / 10.;
1145 ycc = kyarc[10] / 10.;
1146 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1147 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1148 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1149 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1150 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1151 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1152 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1154 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1156 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1158 darc[0] = krarc[9] / 10. - .02;
1159 darc[1] = krarc[9] / 10.;
1161 darc[3] = atheta45 - 90. - (i-1) * 36.;
1162 darc[4] = atheta56 - 90. - (i-1) * 36.;
1163 xcc = kxarc[9] / 10.;
1164 ycc = kyarc[9] / 10.;
1165 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1166 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1167 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1168 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1169 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1170 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1171 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1173 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1175 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1177 darc[0] = krarc[8] / 10. - .02;
1178 darc[1] = krarc[8] / 10.;
1180 darc[3] = atheta67 + 45. - (i-1) * 36.;
1181 darc[4] = atheta56 + 45. - (i-1) * 36.;
1182 xcc = kxarc[8] / 10.;
1183 ycc = kyarc[8] / 10.;
1184 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1185 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1186 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1187 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1188 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1189 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1190 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1192 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1194 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1196 darc[0] = krarc[7] / 10. - .02;
1197 darc[1] = krarc[7] / 10.;
1199 darc[3] = atheta67 - (i-1) * 36.;
1200 darc[4] = atheta78 - (i-1) * 36.;
1201 xcc = kxarc[7] / 10.;
1202 ycc = kyarc[7] / 10.;
1203 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1204 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1205 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1206 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1207 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1208 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1209 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1211 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1213 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1215 darc[0] = krarc[6] / 10. - .02;
1216 darc[1] = krarc[6] / 10.;
1218 darc[3] = atheta89 + 45. - (i-1) * 36.;
1219 darc[4] = atheta78 + 45. - (i-1) * 36.;
1220 xcc = kxarc[6] / 10.;
1221 ycc = kyarc[6] / 10.;
1222 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1223 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1224 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1225 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1226 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1227 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1228 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1230 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1232 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1234 darc[0] = krarc[5] / 10. - .02;
1235 darc[1] = krarc[5] / 10.;
1237 darc[3] = atheta89 + 45. - (i-1) * 36.;
1238 darc[4] = atheta910 + 45. - (i-1) * 36.;
1239 xcc = kxarc[5] / 10.;
1240 ycc = kyarc[5] / 10.;
1241 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1242 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1243 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1244 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1245 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1246 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1247 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1249 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1251 // --- Place arc # 5 (between part 9-10 and part 10-11)
1254 darc[0] = krarc[4] / 10. - .02;
1255 darc[1] = krarc[4] / 10.;
1257 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1258 darc[4] = atheta910 + 45. - (i-1) * 36.;
1259 xcc = kxarc[4] / 10.;
1260 ycc = kyarc[4] / 10.;
1261 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1262 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1263 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1264 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1265 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1266 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1267 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1269 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1271 // --- Place arc # 4 (between part 10-11 and part 11-12)
1274 darc[0] = krarc[3] / 10. - .02;
1275 darc[1] = krarc[3] / 10.;
1277 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1278 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1279 xcc = kxarc[3] / 10.;
1280 ycc = kyarc[3] / 10.;
1281 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1282 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1283 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1284 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1285 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1286 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1287 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1289 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1291 // --- Place arc # 3 (between part 11-12 and part 12-13)
1294 darc[0] = krarc[2] / 10. - .02;
1295 darc[1] = krarc[2] / 10.;
1297 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1298 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1299 xcc = kxarc[2] / 10.;
1300 ycc = kyarc[2] / 10.;
1301 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1302 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1303 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1304 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1305 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1306 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1307 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1309 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1311 // --- Place arc # 2 (between part 12-13 and part 13-14)
1314 darc[0] = krarc[1] / 10. - .02;
1315 darc[1] = krarc[1] / 10.;
1317 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1318 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1319 xcc = kxarc[1] / 10.;
1320 ycc = kyarc[1] / 10.;
1321 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1322 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1323 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1324 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1325 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1326 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1327 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1329 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1331 // --- Place arc # 1 (between part 13-14 and part 1-2)
1334 darc[0] = krarc[0] / 10. - .02;
1335 darc[1] = krarc[0] / 10.;
1337 darc[3] = atheta12 + 45. - (i-1) * 36.;
1338 darc[4] = atheta1314 - (i-1) * 36.;
1339 xcc = kxarc[0] / 10.;
1340 ycc = kyarc[0] / 10.;
1341 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1342 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1343 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1344 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1345 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1346 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1347 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1349 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1352 //************************************************************************
1357 //************************************************************************
1359 // --- Define a ghost volume containing the Silicon Drift Detectors
1360 // (layer #3 and #4) and fill it with air or vacuum
1362 xxm = (49.999-3.)/(70.-25.);
1366 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1369 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1372 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1375 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1378 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1380 // --- Place the ghost volume in its mother volume (ITSV) and make it
1383 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1384 gMC->Gsatt("IT34", "SEEN", 0);
1388 // GOTO 3456 ! skip ITS layer no. 3
1390 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1391 // smaller lenght of ribs) and fill it with air or vacuum
1393 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1395 // the widest element is the sensitive element
1396 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1397 // 7.5 cm is the lenght
1398 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1400 // --- Make the ghost volume invisible
1402 gMC->Gsatt("IDV1", "SEEN", 0);
1404 // --- Define a volume containing the sensitive part of drifts
1405 // (silicon, layer #3)
1408 // see material budget report by G. Feofilov
1411 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1413 //--- Define the part of the (smaller) rib between two sensitive parts made of
1414 // carbon (layer #3)
1416 dsup[0] = .5 - dits[0];
1418 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1419 // 7.5 cm is the lenght
1420 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1422 //--- Define the first part of the (smaller) rib between two sensitive parts
1423 // made of aluminum (layer #3)
1425 dal1[0] = .5 - dits[0];
1426 dal1[1] = 0.00096/2.;
1427 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1428 // 7.5 cm is the lenght
1429 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1431 //--- Define the part of the (smaller) rib between two sensitive parts made of
1432 // kapton (layer #3)
1434 dkap[0] = .5 - dits[0];
1436 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1437 // 7.5 cm is the lenght
1438 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1440 //--- Define the second part of the (smaller) rib between two sensitive parts
1441 // made of aluminum (layer #3)
1443 dal2[0] = .5 - dits[0];
1444 dal2[1] = 0.0027/2.;
1445 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1446 // 7.5 cm is the lenght
1447 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1449 // --- Define the part of the (smaller) rib between two sensitive parts
1450 // made of silicon (the electronics) (layer #3)
1452 dchi[0] = .5 - dits[0];
1453 dchi[1] = 0.0071/2.;
1454 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1455 // 7.5 cm is the lenght
1456 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1458 // --- Define the part of the (smaller) rib between two sensitive parts
1459 // made of water (the cooler) (layer #3)
1461 dwat[0] = .5 - dits[0];
1462 dwat[1] = 0.0093/2.;
1463 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1464 // 7.5 cm is the lenght
1465 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1467 //--- Define the third part of the (smaller) rib between two sensitive parts
1468 // made of aluminum (the cooling tubes) (layer #3)
1470 dtub[0] = .5 - dits[0];
1471 dtub[1] = 0.00134/2.;
1472 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1473 // 7.5 cm is the lenght
1474 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1476 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1479 // twice the foreseen thickness
1482 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1484 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1487 // twice the foreseen thickness
1490 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1492 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1495 // twice the foreseen thickness
1498 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1500 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1503 // twice the foreseen thickness
1506 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1508 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1512 for (j = 1; j <= 5; ++j) {
1513 // odd elements are up and even elements are down
1515 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1516 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1517 } else if (j == 2) {
1518 xpos = -dbox1[0] + dits[0];
1519 zpos = 0. - dits[2] + 1. - dits[2];
1520 } else if (j == 3) {
1521 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1523 } else if (j == 4) {
1524 xpos = -dbox1[0] + dits[0];
1525 zpos = dits[2] + 0. - 1. + dits[2];
1526 } else if (j == 5) {
1527 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1528 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1530 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1533 // --- Place the smaller ribs into their mother (IDV1)
1535 // --- Right ribs (just a matter of convention)
1537 xpos = .5 - dbox1[0] + dits[0];
1543 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1547 ypos = dsup[1] + 2.81 + dal1[1];
1548 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1552 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1553 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1557 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1558 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1560 // --- Silicon (chip)
1562 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1563 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1567 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1568 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1572 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1574 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1576 // --- Right ribs (just a matter of convention)
1581 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1585 ypos = -(dsup[1] + 2.81 + dal1[1]);
1586 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1590 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1591 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1595 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1596 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1598 // --- Silicon (chip)
1600 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1601 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1605 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1606 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1610 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1611 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1612 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1614 // --- Place the end-ladder stuff into its mother (IDV1)
1617 // --- Negative-Z end-ladder
1620 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1624 xpos = dbox1[0] - dpcb[0];
1625 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1629 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1630 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1634 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1635 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1637 // --- Silicon (bus)
1639 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1640 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1642 // --- Positive-Z end-ladder
1645 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1649 xpos = dbox1[0] - dpcb[0];
1650 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1654 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1655 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1659 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1660 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1662 // --- Silicon (bus)
1664 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1665 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1667 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1668 // larger lenght of ribs) and fill it with air or vacuum
1670 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1672 // the widest element is the sensitive element
1673 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1674 // 7.5 cm is the lenght
1675 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1677 // --- Make the ghost volume invisible
1679 gMC->Gsatt("IDV2", "SEEN", 0);
1681 //--- Define the part of the (larger) rib between two sensitive parts madeof
1682 // carbon (layer #3)
1684 dsup[0] = .65 - dits[0];
1686 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1687 // 7.5 cm is the lenght
1688 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1690 //--- Define the first part of the (larger) rib between two sensitive parts
1691 // made of aluminum (layer #3)
1693 dal1[0] = .65 - dits[0];
1694 dal1[1] = 0.00096/2.;
1695 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1696 // 7.5 cm is the lenght
1697 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1699 //--- Define the part of the (larger) rib between two sensitive parts madeof
1700 // kapton (layer #3)
1702 dkap[0] = .65 - dits[0];
1703 dkap[1] = 0.0317/2.;
1704 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1705 // 7.5 cm is the lenght
1706 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1708 //--- Define the second part of the (larger) rib between two sensitive parts
1709 // made of aluminum (layer #3)
1711 dal2[0] = .65 - dits[0];
1712 dal2[1] = 0.0027/2.;
1713 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1714 // 7.5 cm is the lenght
1715 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1717 // --- Define the part of the (larger) rib between two sensitive parts
1718 // made of silicon (the electronics) (layer #3)
1720 dchi[0] = .65 - dits[0];
1721 dchi[1] = 0.0071/2.;
1722 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1723 // 7.5 cm is the lenght
1724 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1726 // --- Define the part of the (larger) rib between two sensitive parts
1727 // made of water (the cooler) (layer #3)
1729 dwat[0] = .65 - dits[0];
1730 dwat[1] = 0.0093/2.;
1731 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1732 // 7.5 cm is the lenght
1733 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1735 //--- Define the third part of the (larger) rib between two sensitive parts
1736 // made of aluminum (the cooling tubes) (layer #3)
1738 dtub[0] = .65 - dits[0];
1739 dtub[1] = 0.00134/2.;
1740 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1741 // 7.5 cm is the lenght
1742 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1744 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1748 for (j = 1; j <= 5; ++j) {
1749 // odd element are up and even elements are down
1751 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1752 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1753 } else if (j == 2) {
1754 xpos = -dbox2[0] + dits[0];
1755 zpos = 0. - dits[2] + 1. - dits[2];
1756 } else if (j == 3) {
1757 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1759 } else if (j == 4) {
1760 xpos = -dbox2[0] + dits[0];
1761 zpos = dits[2] + 0. - 1. + dits[2];
1762 } else if (j == 5) {
1763 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1764 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1766 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1769 // --- Place the larger ribs into their mother (IDV2)
1772 // --- Right ribs (just a matter of convention)
1774 xpos = .65 - dbox2[0] + dits[0];
1780 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1784 ypos = dsup[1] + 2.81 + dal1[1];
1785 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1789 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1790 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1794 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1795 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1797 // --- Silicon (chip)
1799 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1800 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1804 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1805 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1809 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1810 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1812 // --- Right ribs (just a matter of convention)
1817 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1821 ypos = -(dsup[1] + 2.81 + dal1[1]);
1822 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1826 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1827 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1831 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1832 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1834 // --- Silicon (chip)
1836 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1837 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1841 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1842 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1846 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1847 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1849 // --- Place the end-ladder stuff into its mother (IDV1)
1852 // --- Negative-Z end-ladder
1855 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1859 xpos = dbox2[0] - dpcb[0];
1860 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1864 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1865 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1869 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1870 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1872 // --- Silicon (bus)
1874 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1875 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1877 // --- Positive-Z end-ladder
1880 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1884 xpos = dbox2[0] - dpcb[0];
1885 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1889 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1890 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1894 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1895 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1897 // --- Silicon (bus)
1899 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1900 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1902 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1903 // mother volume (IT34)
1904 // Odd elements have large ribs and even elements have small ribs
1906 for (i = 1; i <= 12; ++i) {
1907 atheta = (i-1) * 30.;
1908 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1911 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1912 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1914 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1917 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1918 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1920 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1927 // GOTO 4567 ! skip ITS layer no. 4
1929 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1930 // smaller lenght of ribs) and fill it with air or vacuum
1932 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1934 // the widest element is the end-ladder stuff
1935 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1936 // 7.5 cm is the lenght
1937 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1939 // --- Make the ghost volume invisible
1941 gMC->Gsatt("IDV3", "SEEN", 0);
1943 // --- Define a volume containing the sensitive part of drifts
1944 // (silicon, layer #4)
1947 // see material budget report by G. Feofilov
1950 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1952 //--- Define the part of the (smaller) rib between two sensitive parts made of
1953 // carbon (layer #4)
1955 dsup[0] = .5 - dits[0];
1957 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1958 // 7.5 cm is the lengh
1959 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1961 //--- Define the first part of the (smaller) rib between two sensitive parts
1962 // made of aluminum (layer #4)
1964 dal1[0] = .5 - dits[0];
1965 dal1[1] = 0.00096/2.;
1966 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1967 // 7.5 cm is the lengh
1968 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1970 //--- Define the part of the (smaller) rib between two sensitive parts made of
1971 // kapton (layer #4)
1973 dkap[0] = .5 - dits[0];
1974 dkap[1] = 0.0317/2.;
1975 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1976 // 7.5 cm is the lengh
1977 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1979 //--- Define the second part of the (smaller) rib between two sensitive parts
1980 // made of aluminum (layer #4)
1982 dal2[0] = .5 - dits[0];
1983 dal2[1] = 0.0027/2.;
1984 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1985 // 7.5 cm is the lengh
1986 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1988 // --- Define the part of the (smaller) rib between two sensitive parts
1989 // made of silicon (the electronics) (layer #4)
1991 dchi[0] = .5 - dits[0];
1992 dchi[1] = 0.0071/2.;
1993 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1994 // 7.5 cm is the lengh
1995 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1997 // --- Define the part of the (smaller) rib between two sensitive parts
1998 // made of water (the cooler) (layer #4)
2000 dwat[0] = .5 - dits[0];
2001 dwat[1] = 0.0093/2.;
2002 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2003 // 7.5 cm is the lenght
2004 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
2006 //--- Define the third part of the (smaller) rib between two sensitive parts
2007 // made of aluminum (the cooling tubes) (layer #4)
2009 dtub[0] = .5 - dits[0];
2010 dtub[1] = 0.00134/2.;
2011 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2012 // 7.5 cm is the lengh
2013 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
2015 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
2018 // twice the foreseen thickness
2021 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
2023 // --- Define the part of the end-ladder stuff made of copper (layer #4)
2026 // twice the foreseen thickness
2029 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
2031 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
2034 // twice the foreseen thickness
2037 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
2039 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
2042 // twice the foreseen thickness
2045 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
2047 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2051 for (j = 1; j <= 7; ++j) {
2052 // odd elements are down and even elements are up
2054 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2055 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2056 } else if (j == 2) {
2057 xpos = -dbox1[0] + dits[0];
2058 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2059 } else if (j == 3) {
2060 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2061 zpos = 0. - dits[2] + .7 - dits[2];
2062 } else if (j == 4) {
2063 xpos = -dbox1[0] + dits[0];
2065 } else if (j == 5) {
2066 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2067 zpos = dits[2] + 0. - .7 + dits[2];
2068 } else if (j == 6) {
2069 xpos = -dbox1[0] + dits[0];
2070 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2071 } else if (j == 7) {
2072 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2073 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2075 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2078 // --- Place the smaller ribs into their mother (IDV3)
2080 // --- Right ribs (just a matter of convention)
2082 xpos = .5 - dbox1[0] + dits[0];
2088 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2092 ypos = dsup[1] + 2.81 + dal1[1];
2093 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2097 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2098 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2102 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2103 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2105 // --- Silicon (chip)
2107 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2108 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2112 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2113 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2117 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2119 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2121 // --- Right ribs (just a matter of convention)
2126 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2130 ypos = -(dsup[1] + 2.81 + dal1[1]);
2131 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2135 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2136 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2140 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2142 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2144 // --- Silicon (chip)
2146 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2147 2. + dal2[1] * 2. + dchi[1]);
2148 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2152 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2153 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2154 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2158 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2159 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2161 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2163 // --- Place the end-ladder stuff into its mother (IDV1)
2166 // --- Negative-Z end-ladder
2169 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2173 xpos = dbox1[0] - dpcb[0];
2174 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2178 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2179 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2183 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2184 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2186 // --- Silicon (bus)
2188 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2189 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2191 // --- Positive-Z end-ladder
2194 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2198 xpos = dbox1[0] - dpcb[0];
2199 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2203 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2204 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2208 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2209 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2211 // --- Silicon (bus)
2213 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2214 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2216 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2217 // larger lenght of ribs) and fill it with air or vacuum
2219 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2221 // the widest element is the end-ladder stuff
2222 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2223 // 7.5 cm is the lenght
2224 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2226 // --- Make the ghost volume invisible
2228 gMC->Gsatt("IDV4", "SEEN", 0);
2230 //--- Define the part of the (larger) rib between two sensitive parts madeof
2231 // carbon (layer #4)
2233 dsup[0] = .65 - dits[0];
2235 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2236 // 7.5 cm is the lengh
2237 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2239 //--- Define the first part of the (larger) rib between two sensitive parts
2240 // made of aluminum (layer #4)
2242 dal1[0] = .65 - dits[0];
2243 dal1[1] = 0.00096/2.;
2244 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2245 // 7.5 cm is the lengh
2246 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2248 //--- Define the part of the (larger) rib between two sensitive parts madeof
2249 // kapton (layer #4)
2251 dkap[0] = .65 - dits[0];
2252 dkap[1] = 0.0317/2.;
2253 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2254 // 7.5 cm is the lengh
2255 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2257 //--- Define the second part of the (larger) rib between two sensitive parts
2258 // made of aluminum (layer #4)
2260 dal2[0] = .65 - dits[0];
2261 dal2[1] = 0.0027/2.;
2262 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2263 // 7.5 cm is the lengh
2264 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2266 // --- Define the part of the (larger) rib between two sensitive parts
2267 // made of silicon (the electronics) (layer #4)
2269 dchi[0] = .65 - dits[0];
2270 dchi[1] = 0.0071/2.;
2271 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2272 // 7.5 cm is the lengh
2273 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2275 // --- Define the part of the (larger) rib between two sensitive parts
2276 // made of water (the cooler) (layer #4)
2278 dwat[0] = .65 - dits[0];
2279 dwat[1] = 0.0093/2.;
2280 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2281 // 7.5 cm is the lengh
2282 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2284 //--- Define the third part of the (larger) rib between two sensitive parts
2285 // made of aluminum (the cooling tubes) (layer #4)
2287 dtub[0] = .65 - dits[0];
2288 dtub[1] = 0.00134/2.;
2289 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2290 // 7.5 cm is the lengh
2291 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2293 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2297 for (j = 1; j <= 7; ++j) {
2298 // odd elements are down and even elements are up
2300 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2301 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2302 } else if (j == 2) {
2303 xpos = -dbox2[0] + dits[0];
2304 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2305 } else if (j == 3) {
2306 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2307 zpos = 0. - dits[2] + .7 - dits[2];
2308 } else if (j == 4) {
2309 xpos = -dbox2[0] + dits[0];
2311 } else if (j == 5) {
2312 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2313 zpos = dits[2] + 0. - .7 + dits[2];
2314 } else if (j == 6) {
2315 xpos = -dbox2[0] + dits[0];
2316 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2317 } else if (j == 7) {
2318 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2319 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2321 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2324 // --- Place the larger ribs into their mother (IDV4)
2327 // --- Right ribs (just a matter of convention)
2329 xpos = .65 - dbox2[0] + dits[0];
2335 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2339 ypos = dsup[1] + 2.81 + dal1[1];
2340 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2344 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2345 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2349 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2350 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2352 // --- Silicon (chip)
2354 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2355 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2359 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2360 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2364 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2366 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2368 // --- Right ribs (just a matter of convention)
2373 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2377 ypos = -(dsup[1] + 2.81 + dal1[1]);
2378 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2382 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2383 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2387 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2389 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2391 // --- Silicon (chip)
2393 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2394 2. + dal2[1] * 2. + dchi[1]);
2395 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2399 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2400 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2401 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2405 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2406 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2407 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2409 // --- Place the end-ladder stuff into its mother (IDV1)
2412 // --- Negative-Z end-ladder
2415 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2419 xpos = dbox2[0] - dpcb[0];
2420 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2424 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2425 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2429 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2430 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2432 // --- Silicon (bus)
2434 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2435 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2437 // --- Positive-Z end-ladder
2440 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2444 xpos = dbox2[0] - dpcb[0];
2445 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2449 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2450 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2454 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2455 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2457 // --- Silicon (bus)
2459 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2460 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2462 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2463 // mother volume (IT34)
2464 // Odd elements have large ribs and even elements have small ribs
2466 for (i = 1; i <= 24; ++i) {
2467 atheta = (i-1) * 15.;
2468 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2471 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2472 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2474 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2476 rzero = (24.0+22.8)/2.;
2477 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2478 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2480 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2484 //************************************************************************
2489 //************************************************************************
2491 // --- Define SSD with the 35+39 lay-out
2493 if (fMinorVersion < 3) {
2495 //--- Define ghost volume containing the Strip Detectors and fill it with air
2498 xxm = (49.999-3.)/(70.-25.);
2502 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2503 (37.-27)/xxm-(49.998-37.)/xxm;
2506 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2510 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2514 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2515 (37.-27)/xxm+(49.998-37.)/xxm;
2518 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2519 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2520 gMC->Gsatt("IT56", "SEEN", 0);
2524 // GOTO 5678 ! skip ITS layer no. 5
2526 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2527 // it with air or vacuum
2529 dbox1[0] = (0.0600+2.*0.0150)/2.;
2531 dbox1[2] = 90.22/2.;
2532 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2534 // --- Make the ghost volume invisible
2536 gMC->Gsatt("ISV1", "SEEN", 0);
2538 // --- Define a ghost volume containing the electronics and cooling of
2539 // a single ladder of layer #5 and fill it with air or vacuum
2541 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2544 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2546 // --- Make the ghost volume invisible
2548 gMC->Gsatt("SSV1", "SEEN", 0);
2550 // --- Define a ghost volume containing the end-ladder stuff of
2551 // a single ladder of layer #5 and fill it with air or vacuum
2556 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2558 // --- Make the ghost volume invisible
2560 gMC->Gsatt("ELL5", "SEEN", 0);
2562 // --- Define a volume containing the sensitive part of the strips
2563 // (silicon, layer #5)
2568 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2570 // --- Define a volume containing the electronics of the strips
2571 // (silicon, layer #5)
2576 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2578 // --- Define the cooling tubes (aluminum, layer #5)
2581 dtub[1] = dtub[0] + .01;
2583 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2585 // --- Define the cooling fluid (water or freon, layer #5)
2590 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2591 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2593 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2601 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2602 dfra[6] = dfra[5] + .03;
2606 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2608 // --- Define the element connecting the triangles of the heat bridge
2609 // (carbon, layer #5)
2614 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2616 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2619 dpla[0] = (10./(8.*7.))/2.;
2622 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2624 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2626 dcop[0] = (2./(8.*7.))/2.;
2629 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2631 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2633 depx[0] = (30./(8.*7.))/2.;
2636 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2638 // --- Define the part of the end-ladder stuff made of silicon (bus)
2641 dsil[0] = (20./(8.*7.))/2.;
2644 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2646 // --- Place the end-ladder stuff into its mother (ELL5)
2648 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2654 xpos = -dela[0] + dpla[0];
2655 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2659 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2660 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2664 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2665 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2667 // --- Silicon (bus)
2669 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2670 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2672 // --- Place the sensitive part of the strips into its mother (ISV1)
2675 for (j = 1; j <= 23; ++j) {
2676 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2677 else xpos = -dbox1[0] + dits[0];
2678 zpos = ((j - 1) - 11.) * 3.91;
2679 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2682 // --- Place the electronics of the strips into its mother (SSV1)
2685 for (j = 1; j <= 23; ++j) {
2686 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2687 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2688 zpos = ((j - 1) - 11.) * 3.91 + .85;
2689 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2692 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2694 xpos = -dsrv[0] + .41;
2697 // --- Left tube (just a matter of convention)
2700 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2701 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2703 // --- Right tube (just a matter of convention)
2706 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2707 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2709 // --- Place the heat bridge elements into their mother (SSV1)
2711 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2713 for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2714 // volume SSV1. This is the same number of
2715 // elements as SCH5 above. Done Bjorn S. Nilsen
2716 // April 4 2000. Error found by Ivana
2717 // Hrivnacova March 29 2000.
2718 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2719 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2722 // --- Place the elements connecting the triangles of the heat bridge
2723 // into their mother (SSV1)
2727 // --- Left element (just a matter of convention)
2729 xpos = -dsrv[0] + .47;
2730 ypos = -(2.1+0.015);
2731 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2733 // --- Right element
2735 xpos = -dsrv[0] + .47;
2737 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2741 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2743 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2745 // --- Place the ghost volumes containing the strip ladders (ISV1),
2746 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2747 // their mother volume (IT56)
2749 offset1 = TMath::ATan2(.9, 40.);
2751 rzero = dbox1[0] + 40.;
2752 runo = dbox1[0] * 2. + 40. + dsrv[0];
2753 rtwo = dbox1[0] * 2. + 40. + dela[0];
2754 for (i = 1; i <= 35; ++i) {
2755 atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
2756 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2758 // --- Strip ladders
2760 xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2761 ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2763 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2765 // --- Electronics/cooling
2767 xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2768 ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2770 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2772 // --- End-ladders (nagative-Z and positive-Z)
2774 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2775 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2776 zpos = -(dbox1[2] + dela[2] + 6.);
2777 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2778 zpos = dbox1[2] + dela[2] + 6.;
2779 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2785 // GOTO 5778 ! skip ITS layer no. 6
2787 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2788 // it with air or vacuum
2790 dbox2[0] = (0.0600+2.*0.0150)/2.;
2792 dbox2[2] = 101.95/2.;
2793 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2795 // --- Make the ghost volume invisible
2797 gMC->Gsatt("ISV2", "SEEN", 0);
2799 // --- Define a ghost volume containing the electronics and cooling of
2800 // a single ladder of layer #6 and fill it with air or vacuum
2802 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2804 dsrv[2] = 101.95/2.;
2805 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2807 // --- Make the ghost volume invisible
2809 gMC->Gsatt("SSV2", "SEEN", 0);
2811 // --- Define a ghost volume containing the end-ladder stuff of
2812 // a single ladder of layer #6 and fill it with air or vacuum
2817 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2819 // --- Make the ghost volume invisible
2821 gMC->Gsatt("ELL6", "SEEN", 0);
2823 // --- Define a volume containing the sensitive part of the strips
2824 // (silicon, layer #6)
2829 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2831 // --- Define a volume containing the electronics of the strips
2832 // (silicon, layer #6)
2837 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2839 // --- Define the cooling tubes (aluminum, layer #6)
2842 dtub[1] = dtub[0] + .01;
2843 dtub[2] = 101.95/2.;
2844 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2846 // --- Define the cooling fluid (water or freon, layer #6)
2850 dwat[2] = 101.95/2.;
2851 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2852 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2854 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2862 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2863 dfra[6] = dfra[5] + .03;
2867 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2869 // --- Define the element connecting the triangles of the heat bridge
2870 // (carbon, layer #6)
2874 dcei[2] = 101.95/2.;
2875 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2877 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2880 dpla[0] = (10./(8.*7.))/2.;
2883 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2885 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2887 dcop[0] = (2./(8.*7.))/2.;
2890 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2892 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2894 depx[0] = (30./(8.*7.))/2.;
2897 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2899 // --- Define the part of the end-ladder stuff made of silicon (bus)
2902 dsil[0] = (20./(8.*7.))/2.;
2905 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2907 // --- Place the end-ladder stuff into its mother (ELL5)
2909 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2915 xpos = -dela[0] + dpla[0];
2916 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2920 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2921 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2925 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2926 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2928 // --- Silicon (bus)
2930 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2931 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2933 // --- Place the sensitive part of the strips into its mother (ISV2)
2936 for (j = 1; j <= 26; ++j) {
2937 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2938 else xpos = -dbox2[0] + dits[0];
2939 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2940 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2943 // --- Place the electronics of the strips into its mother (SSV2)
2946 for (j = 1; j <= 26; ++j) {
2947 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2948 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2949 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2950 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2953 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2955 xpos = -dsrv[0] + .41;
2958 // --- Left tube (just a matter of convention)
2961 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2962 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2964 // --- Right tube (just a matter of convention)
2967 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2968 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2970 // --- Place the heat bridge elements into their mother (SSV2)
2972 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2974 for (j = 1; j <= 27; ++j) {
2975 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2976 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2979 // --- Place the elements connecting the triangles of the heat bridge
2980 // into their mother (SSV2)
2984 // --- Left element (just a matter of convention)
2986 xpos = -dsrv[0] + .47;
2987 ypos = -(2.1+0.015);
2988 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2990 // --- Right element
2992 xpos = -dsrv[0] + .47;
2994 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2998 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3000 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3002 // --- Place the ghost volumes containing the strip ladders (ISV2),
3003 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3004 // their mother volume (IT56)
3006 offset1 = TMath::ATan2(1., 45.);
3008 rzero = dbox2[0] + 45.;
3009 runo = dbox2[0] * 2. + 45. + dsrv[0];
3010 rtwo = dbox2[0] * 2. + 45. + dela[0];
3011 for (i = 1; i <= 39; ++i) {
3012 atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
3013 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3015 // --- Strip ladders
3017 xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3018 ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3020 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3022 // --- Electronics/cooling
3024 xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3025 ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3027 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3029 // --- End-ladders (nagative-Z and positive-Z)
3031 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3032 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3033 zpos = -(dbox2[2] + dela[2] + 6.);
3034 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3035 zpos = dbox2[2] + dela[2] + 6.;
3036 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3041 // --- Define SSD with the 32+36 lay-out
3043 if (fMinorVersion >2 && fMinorVersion < 6) {
3045 //--- Define ghost volume containing the Strip Detectors and fill it with air
3048 xxm = (49.999-3.)/(70.-25.);
3052 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
3053 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3056 dgh[6] = -25. - (9.-3.01) / xxm -
3057 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3060 dgh[9] = (9.-3.01) / xxm + 25. +
3061 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3064 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3065 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3068 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3069 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3070 gMC->Gsatt("IT56", "SEEN", 0);
3074 // GOTO 6678 ! skip ITS layer no. 5
3076 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3077 // it with air or vacuum
3079 dbox1[0] = (0.0600+2.*0.0150)/2.;
3081 dbox1[2] = 86.31/2.;
3082 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3084 // --- Make the ghost volume invisible
3086 gMC->Gsatt("ISV1", "SEEN", 0);
3088 // --- Define a ghost volume containing the electronics and cooling of
3089 // a single ladder of layer #5 and fill it with air or vacuum
3091 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3094 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3096 // --- Make the ghost volume invisible
3098 gMC->Gsatt("SSV1", "SEEN", 0);
3100 // --- Define a ghost volume containing the end-ladder stuff of
3101 // a single ladder of layer #5 and fill it with air or vacuum
3106 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3108 // --- Make the ghost volume invisible
3110 gMC->Gsatt("ELL5", "SEEN", 0);
3112 // --- Define a volume containing the sensitive part of the strips
3113 // (silicon, layer #5)
3118 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3120 // --- Define a volume containing the electronics of the strips
3121 // (silicon, layer #5)
3126 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3128 // --- Define the cooling tubes (aluminum, layer #5)
3131 dtub[1] = dtub[0] + .01;
3133 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3135 // --- Define the cooling fluid (water or freon, layer #5)
3140 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3141 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3143 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3151 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3152 dfra[6] = dfra[5] + .03;
3156 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3158 // --- Define the element connecting the triangles of the heat bridge
3159 // (carbon, layer #5)
3164 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3166 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3169 dpla[0] = (10./(8.*7.))/2;
3172 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3174 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3176 dcop[0] = (2./(8.*7.))/2;
3179 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3181 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3183 depx[0] = (30./(8.*7.))/2.;
3186 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3188 // --- Define the part of the end-ladder stuff made of silicon (bus)
3191 dsil[0] = (20./(8.*7.))/2.;
3194 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3196 // --- Place the end-ladder stuff into its mother (ELL5)
3198 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3204 xpos = -dela[0] + dpla[0];
3205 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3209 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3210 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3214 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3215 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3217 // --- Silicon (bus)
3219 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3220 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3222 // --- Place the sensitive part of the strips into its mother (ISV1)
3225 for (j = 1; j <= 22; ++j) {
3226 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3227 else xpos = -dbox1[0] + dits[0];
3228 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3229 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3232 // --- Place the electronics of the strips into its mother (SSV1)
3235 for (j = 1; j <= 22; ++j) {
3236 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3237 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3238 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3239 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3242 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3244 xpos = -dsrv[0] + .41;
3247 // --- Left tube (just a matter of convention)
3250 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3251 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3253 // --- Right tube (just a matter of convention)
3256 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3257 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3259 // --- Place the heat bridge elements into their mother (SSV1)
3261 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3263 for (j = 1; j <= 23; ++j) {
3264 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3265 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3268 // --- Place the elements connecting the triangles of the heat bridge
3269 // into their mother (SSV1)
3273 // --- Left element (just a matter of convention)
3275 xpos = -dsrv[0] + .47;
3276 ypos = -(2.1+0.015);
3277 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3279 // --- Right element
3281 xpos = -dsrv[0] + .47;
3283 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3287 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3289 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3291 // --- Place the ghost volumes containing the strip ladders (ISV1),
3292 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3293 // their mother volume (IT56)
3295 offset1 = TMath::ATan2(.8, 36.6);
3297 rzero = dbox1[0] + 36.6;
3298 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3299 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3300 for (i = 1; i <= 32; ++i) {
3301 atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
3302 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3304 // --- Strip ladders
3306 xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3307 ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3309 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3311 // --- Electronics/cooling
3313 xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3314 ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3316 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3318 // --- End-ladders (nagative-Z and positive-Z)
3320 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3321 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3322 zpos = -(dbox1[2] + dela[2] + 6.);
3323 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3324 zpos = dbox1[2] + dela[2] + 6.;
3325 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3331 // GOTO 6778 ! skip ITS layer no. 6
3333 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3334 // it with air or vacuum
3336 dbox2[0] = (0.0600+2.*0.0150)/2.;
3338 dbox2[2] = 94.13/2.;
3339 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3341 // --- Make the ghost volume invisible
3343 gMC->Gsatt("ISV2", "SEEN", 0);
3345 // --- Define a ghost volume containing the electronics and cooling of
3346 // a single ladder of layer #6 and fill it with air or vacuum
3348 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3351 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3353 // --- Make the ghost volume invisible
3355 gMC->Gsatt("SSV2", "SEEN", 0);
3357 // --- Define a ghost volume containing the end-ladder stuff of
3358 // a single ladder of layer #6 and fill it with air or vacuum
3363 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3365 // --- Make the ghost volume invisible
3367 gMC->Gsatt("ELL6", "SEEN", 0);
3369 // --- Define a volume containing the sensitive part of the strips
3370 // (silicon, layer #6)
3375 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3377 // --- Define a volume containing the electronics of the strips
3378 // (silicon, layer #6)
3383 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3385 // --- Define the cooling tubes (aluminum, layer #6)
3388 dtub[1] = dtub[0] + .01;
3390 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3392 // --- Define the cooling fluid (water or freon, layer #6)
3397 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3398 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3400 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3408 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3409 dfra[6] = dfra[5] + .03;
3413 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3415 // --- Define the element connecting the triangles of the heat bridge
3416 // (carbon, layer #6)
3421 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3423 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3426 dpla[0] = (10./(8.*7.))/2;
3429 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3431 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3433 dcop[0] = (2./(8.*7.))/2;
3436 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3438 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3440 depx[0] = (30./(8.*7.))/2.;
3443 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3445 // --- Define the part of the end-ladder stuff made of silicon (bus)
3448 dsil[0] = (20./(8.*7.))/2.;
3451 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3453 // --- Place the end-ladder stuff into its mother (ELL5)
3455 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3461 xpos = -dela[0] + dpla[0];
3462 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3466 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3467 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3471 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3472 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3474 // --- Silicon (bus)
3476 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3477 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3479 // --- Place the sensitive part of the strips into its mother (ISV2)
3482 for (j = 1; j <= 24; ++j) {
3483 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3484 else xpos = dbox2[0] - dits[0];
3485 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3486 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3489 // --- Place the electronics of the strips into its mother (SSV2)
3492 for (j = 1; j <= 24; ++j) {
3493 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3494 else xpos = -dsrv[0] + .28;
3495 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3496 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3499 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3501 xpos = -dsrv[0] + .41;
3504 // --- Left tube (just a matter of convention)
3507 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3508 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3510 // --- Right tube (just a matter of convention)
3513 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3514 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3516 // --- Place the heat bridge elements into their mother (SSV2)
3518 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3520 for (j = 1; j <= 25; ++j) {
3521 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3522 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3525 // --- Place the elements connecting the triangles of the heat bridge
3526 // into their mother (SSV2)
3530 // --- Left element (just a matter of convention)
3532 xpos = -dsrv[0] + .47;
3533 ypos = -(2.1+0.015);
3534 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3536 // --- Right element
3538 xpos = -dsrv[0] + .47;
3540 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3544 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3546 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3548 // --- Place the ghost volumes containing the strip ladders (ISV2),
3549 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3550 // their mother volume (IT56)
3552 offset1 = TMath::ATan2(.9, 41.2);
3554 rzero = dbox2[0] + 41.2;
3555 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3556 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3557 for (i = 1; i <= 36; ++i) {
3558 atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
3559 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3561 // --- Strip ladders
3563 xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3564 ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3566 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3568 // --- Electronics/cooling
3570 xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3571 ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3573 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3575 // --- End-ladders (nagative-Z and positive-Z)
3577 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3578 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3579 zpos = -(dbox2[2] + dela[2] + 6.);
3580 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3581 zpos = dbox2[2] + dela[2] + 6.;
3582 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3588 //************************************************************************
3590 //* E N D - C A P S A N D F R A M E S *
3591 //* ========================================= *
3593 //************************************************************************
3595 // --- Define a dummy cylinder for multiple scattering tests
3597 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3600 // DITS(2)=DITS(1)+0.1
3602 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3603 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3606 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3608 // GOTO 8901 ! skip outer wall
3610 if (fMinorVersion == 0 || fMinorVersion == 3) {
3613 dits[1] = dits[0] + .06926;
3614 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3616 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3617 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3622 // --- The frame between the end-caps (octagonal lay-out) ---
3624 // GOTO 9012 ! skip octagonal frame
3626 if (fMinorVersion == 1) {
3631 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3634 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3636 offset = angle / 2.;
3637 for (i = 0; i < 8; ++i) {
3638 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3639 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3641 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3642 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3646 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;
3647 aphi2 = 180. - aphi1;
3648 xpos = (xtra[0] + xtra[1]) / 2.;
3649 ypos = (ytra[0] + ytra[1]) / 2.;
3650 zpos = dtra[2] / 2.;
3651 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3654 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3655 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3656 zpos = -dtra[2] / 2.;
3657 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3660 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3661 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3664 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;
3665 aphi1 = 180. - aphi2;
3666 xpos = (xtra[1] + xtra[2]) / 2.;
3667 ypos = (ytra[1] + ytra[2]) / 2.;
3668 zpos = dtra[2] / 2.;
3669 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3672 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3673 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3674 zpos = -dtra[2] / 2.;
3675 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3678 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3679 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3682 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;
3683 aphi2 = 180. - aphi1;
3684 xpos = (xtra[2] + xtra[3]) / 2.;
3685 ypos = (ytra[2] + ytra[3]) / 2.;
3686 zpos = dtra[2] / 2.;
3687 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3690 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3691 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3692 zpos = -dtra[2] / 2.;
3693 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3696 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3697 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3700 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;
3701 aphi1 = 180. - aphi2;
3702 xpos = (xtra[3] + xtra[4]) / 2.;
3703 ypos = (ytra[3] + ytra[4]) / 2.;
3704 zpos = dtra[2] / 2.;
3705 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3708 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3709 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3710 zpos = -dtra[2] / 2.;
3711 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3714 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3715 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3718 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;
3719 aphi1 = 180. - aphi2;
3720 xpos = (xtra[4] + xtra[5]) / 2.;
3721 ypos = (ytra[4] + ytra[5]) / 2.;
3722 zpos = dtra[2] / 2.;
3723 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3726 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3727 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3728 zpos = -dtra[2] / 2.;
3729 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3732 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3733 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3736 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;
3737 aphi2 = 180. - aphi1;
3738 xpos = (xtra[5] + xtra[6]) / 2.;
3739 ypos = (ytra[5] + ytra[6]) / 2.;
3740 zpos = dtra[2] / 2.;
3741 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3744 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3745 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3746 zpos = -dtra[2] / 2.;
3747 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3750 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3751 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3754 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;
3755 aphi1 = 180. - aphi2;
3756 xpos = (xtra[6] + xtra[7]) / 2.;
3757 ypos = (ytra[6] + ytra[7]) / 2.;
3758 zpos = dtra[2] / 2.;
3759 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3762 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3763 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3764 zpos = -dtra[2] / 2.;
3765 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3768 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3769 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3772 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;
3773 aphi2 = 180. - aphi1;
3774 xpos = (xtra[7] + xtra[0]) / 2.;
3775 ypos = (ytra[7] + ytra[0]) / 2.;
3776 zpos = dtra[2] / 2.;
3777 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3780 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3781 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3782 zpos = -dtra[2] / 2.;
3783 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3786 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3787 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3790 } else if (fMinorVersion == 4) {
3796 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3799 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3801 offset = angle / 2.;
3802 for (i = 0; i < 8; ++i) {
3803 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3804 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3806 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3807 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3811 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;
3812 aphi2 = 180. - aphi1;
3813 xpos = (xtra[0] + xtra[1]) / 2.;
3814 ypos = (ytra[0] + ytra[1]) / 2.;
3815 zpos = dtra[2] / 2.;
3816 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3819 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3820 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3821 zpos = -dtra[2] / 2.;
3822 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3825 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3826 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3829 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;
3830 aphi1 = 180. - aphi2;
3831 xpos = (xtra[1] + xtra[2]) / 2.;
3832 ypos = (ytra[1] + ytra[2]) / 2.;
3833 zpos = dtra[2] / 2.;
3834 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3837 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3838 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3839 zpos = -dtra[2] / 2.;
3840 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3843 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3844 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3847 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;
3848 aphi2 = 180. - aphi1;
3849 xpos = (xtra[2] + xtra[3]) / 2.;
3850 ypos = (ytra[2] + ytra[3]) / 2.;
3851 zpos = dtra[2] / 2.;
3852 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3855 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3856 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3857 zpos = -dtra[2] / 2.;
3858 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3861 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3862 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3865 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;
3866 aphi1 = 180. - aphi2;
3867 xpos = (xtra[3] + xtra[4]) / 2.;
3868 ypos = (ytra[3] + ytra[4]) / 2.;
3869 zpos = dtra[2] / 2.;
3870 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3873 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3874 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3875 zpos = -dtra[2] / 2.;
3876 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3879 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3880 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3883 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;
3884 aphi1 = 180. - aphi2;
3885 xpos = (xtra[4] + xtra[5]) / 2.;
3886 ypos = (ytra[4] + ytra[5]) / 2.;
3887 zpos = dtra[2] / 2.;
3888 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3891 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3892 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3893 zpos = -dtra[2] / 2.;
3894 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3897 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3898 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3901 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;
3902 aphi2 = 180. - aphi1;
3903 xpos = (xtra[5] + xtra[6]) / 2.;
3904 ypos = (ytra[5] + ytra[6]) / 2.;
3905 zpos = dtra[2] / 2.;
3906 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3909 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3910 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3911 zpos = -dtra[2] / 2.;
3912 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3915 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3916 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3919 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;
3920 aphi1 = 180. - aphi2;
3921 xpos = (xtra[6] + xtra[7]) / 2.;
3922 ypos = (ytra[6] + ytra[7]) / 2.;
3923 zpos = dtra[2] / 2.;
3924 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3927 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3928 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3929 zpos = -dtra[2] / 2.;
3930 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3933 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3934 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3937 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;
3938 aphi2 = 180. - aphi1;
3939 xpos = (xtra[7] + xtra[0]) / 2.;
3940 ypos = (ytra[7] + ytra[0]) / 2.;
3941 zpos = dtra[2] / 2.;
3942 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3945 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3946 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3947 zpos = -dtra[2] / 2.;
3948 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3951 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3952 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3958 // --- The frame between the end-caps (hexagonal lay-out) ---
3960 // GOTO 9123 ! skip hexagonal frame
3962 if (fMinorVersion == 2) {
3967 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3973 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3975 offset = angle / 2.;
3976 for (i = 0; i < 6; ++i) {
3977 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
3978 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
3980 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
3981 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3986 xpos = (xtra1[0] + xtra1[1]) / 2.;
3987 ypos = (ytra1[0] + ytra1[1]) / 2.;
3989 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
3992 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3993 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3997 xpos = (xtra1[1] + xtra1[2]) / 2.;
3998 ypos = (ytra1[1] + ytra1[2]) / 2.;
4000 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4003 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4004 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4008 xpos = (xtra1[2] + xtra1[3]) / 2.;
4009 ypos = (ytra1[2] + ytra1[3]) / 2.;
4011 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4014 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4015 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4019 xpos = (xtra1[3] + xtra1[4]) / 2.;
4020 ypos = (ytra1[3] + ytra1[4]) / 2.;
4022 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4025 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4026 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4030 xpos = (xtra1[4] + xtra1[5]) / 2.;
4031 ypos = (ytra1[4] + ytra1[5]) / 2.;
4033 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4036 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4037 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4041 xpos = (xtra1[5] + xtra1[0]) / 2.;
4042 ypos = (ytra1[5] + ytra1[0]) / 2.;
4044 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4047 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4048 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4051 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4052 aphi1 = 180. - aphi2;
4053 xpos = (xtra1[0] + xtra1[1]) / 2.;
4054 ypos = (ytra1[0] + ytra1[1]) / 2.;
4055 zpos = dtra2[2] / 2.;
4056 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4059 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4060 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4061 zpos = -dtra2[2] / 2.;
4062 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4065 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4066 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4069 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4070 aphi2 = 180. - aphi1;
4071 xpos = (xtra1[1] + xtra1[2]) / 2.;
4072 ypos = (ytra1[1] + ytra1[2]) / 2.;
4073 zpos = dtra2[2] / 2.;
4074 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4077 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4078 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4079 zpos = -dtra2[2] / 2.;
4080 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4083 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4084 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4087 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4088 aphi1 = 180. - aphi2;
4089 xpos = (xtra1[2] + xtra1[3]) / 2.;
4090 ypos = (ytra1[2] + ytra1[3]) / 2.;
4091 zpos = dtra2[2] / 2.;
4092 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4095 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4096 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4097 zpos = -dtra2[2] / 2.;
4098 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4101 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4102 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4104 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))
4105 - 50.*50.))) * kraddeg;
4106 aphi2 = 180. - aphi1;
4107 xpos = (xtra1[2] + xtra1[3]) / 2.;
4108 ypos = (ytra1[2] + ytra1[3]) / 2.;
4109 zpos = dtra2[2] / 2.;
4110 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4113 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4114 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4115 zpos = -dtra2[2] / 2.;
4116 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4119 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4120 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4123 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4124 aphi1 = 180. - aphi2;
4125 xpos = (xtra1[3] + xtra1[4]) / 2.;
4126 ypos = (ytra1[3] + ytra1[4]) / 2.;
4127 zpos = dtra2[2] / 2.;
4128 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4131 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4132 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4133 zpos = -dtra2[2] / 2.;
4134 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4137 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4138 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4141 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4142 aphi2 = 180. - aphi1;
4143 xpos = (xtra1[4] + xtra1[5]) / 2.;
4144 ypos = (ytra1[4] + ytra1[5]) / 2.;
4145 zpos = dtra2[2] / 2.;
4146 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4149 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4150 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4151 zpos = -dtra2[2] / 2.;
4152 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4155 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4156 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4159 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4160 aphi1 = 180. - aphi2;
4161 xpos = (xtra1[5] + xtra1[0]) / 2.;
4162 ypos = (ytra1[5] + ytra1[0]) / 2.;
4163 zpos = dtra2[2] / 2.;
4164 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4167 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4168 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4169 zpos = -dtra2[2] / 2.;
4170 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4173 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4174 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4176 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4177 aphi2 = 180. - aphi1;
4178 xpos = (xtra1[5] + xtra1[0]) / 2.;
4179 ypos = (ytra1[5] + ytra1[0]) / 2.;
4180 zpos = dtra2[2] / 2.;
4181 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4184 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4185 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4186 zpos = -dtra2[2] / 2.;
4187 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4190 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4191 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4194 } else if (fMinorVersion == 5) {
4200 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4206 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4208 offset = angle / 2.;
4209 for (i = 0; i < 6; ++i) {
4210 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
4211 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
4213 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
4214 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4219 xpos = (xtra1[0] + xtra1[1]) / 2.;
4220 ypos = (ytra1[0] + ytra1[1]) / 2.;
4222 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
4225 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4226 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4230 xpos = (xtra1[1] + xtra1[2]) / 2.;
4231 ypos = (ytra1[1] + ytra1[2]) / 2.;
4233 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4236 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4237 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4241 xpos = (xtra1[2] + xtra1[3]) / 2.;
4242 ypos = (ytra1[2] + ytra1[3]) / 2.;
4244 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4247 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4248 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4252 xpos = (xtra1[3] + xtra1[4]) / 2.;
4253 ypos = (ytra1[3] + ytra1[4]) / 2.;
4255 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4258 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4259 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4263 xpos = (xtra1[4] + xtra1[5]) / 2.;
4264 ypos = (ytra1[4] + ytra1[5]) / 2.;
4266 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4269 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4270 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4274 xpos = (xtra1[5] + xtra1[0]) / 2.;
4275 ypos = (ytra1[5] + ytra1[0]) / 2.;
4277 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4280 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4281 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4284 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4285 aphi1 = 180. - aphi2;
4286 xpos = (xtra1[0] + xtra1[1]) / 2.;
4287 ypos = (ytra1[0] + ytra1[1]) / 2.;
4288 zpos = dtra2[2] / 2.;
4289 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4292 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4293 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4294 zpos = -dtra2[2] / 2.;
4295 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4298 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4299 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4302 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4303 aphi2 = 180. - aphi1;
4304 xpos = (xtra1[1] + xtra1[2]) / 2.;
4305 ypos = (ytra1[1] + ytra1[2]) / 2.;
4306 zpos = dtra2[2] / 2.;
4307 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4310 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4311 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4312 zpos = -dtra2[2] / 2.;
4313 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4316 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4317 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4320 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4321 aphi1 = 180. - aphi2;
4322 xpos = (xtra1[2] + xtra1[3]) / 2.;
4323 ypos = (ytra1[2] + ytra1[3]) / 2.;
4324 zpos = dtra2[2] / 2.;
4325 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4328 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4329 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4330 zpos = -dtra2[2] / 2.;
4331 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4334 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4335 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4337 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4338 aphi2 = 180. - aphi1;
4339 xpos = (xtra1[2] + xtra1[3]) / 2.;
4340 ypos = (ytra1[2] + ytra1[3]) / 2.;
4341 zpos = dtra2[2] / 2.;
4342 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4345 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4346 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4347 zpos = -dtra2[2] / 2.;
4348 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4351 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4352 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4355 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4356 aphi1 = 180. - aphi2;
4357 xpos = (xtra1[3] + xtra1[4]) / 2.;
4358 ypos = (ytra1[3] + ytra1[4]) / 2.;
4359 zpos = dtra2[2] / 2.;
4360 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4363 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4364 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4365 zpos = -dtra2[2] / 2.;
4366 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4369 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4370 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4373 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4374 aphi2 = 180. - aphi1;
4375 xpos = (xtra1[4] + xtra1[5]) / 2.;
4376 ypos = (ytra1[4] + ytra1[5]) / 2.;
4377 zpos = dtra2[2] / 2.;
4378 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4381 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4382 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4383 zpos = -dtra2[2] / 2.;
4384 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4387 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4388 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4391 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4392 aphi1 = 180. - aphi2;
4393 xpos = (xtra1[5] + xtra1[0]) / 2.;
4394 ypos = (ytra1[5] + ytra1[0]) / 2.;
4395 zpos = dtra2[2] / 2.;
4396 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4399 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4400 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4401 zpos = -dtra2[2] / 2.;
4402 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4405 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4406 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4408 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4409 aphi2 = 180. - aphi1;
4410 xpos = (xtra1[5] + xtra1[0]) / 2.;
4411 ypos = (ytra1[5] + ytra1[0]) / 2.;
4412 zpos = dtra2[2] / 2.;
4413 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4416 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4417 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4418 zpos = -dtra2[2] / 2.;
4419 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4422 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4423 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4429 // --- Define the end-caps
4431 // GOTO 9234 ! skip both end-caps
4433 // --- Define the Z>0 end-cap
4435 // GOTO 9345 ! skip the Z>0 end-cap
4440 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4441 dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4444 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4445 // end-ladder electro
4446 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4447 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4449 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4451 // In the Simonetti's drawings 52. In the TP 50.
4455 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4456 // end-ladder electro
4457 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4458 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4462 dtube[2] = 26.8/2./10.;
4465 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4467 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4468 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4474 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4475 // end-ladder electron
4478 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4479 // end-ladder electronics
4485 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4486 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4492 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4496 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4503 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4504 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4506 if (fMinorVersion < 3 ) {
4508 dpgon[0] = offset2 + 360./(2.*35.);
4512 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4516 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4523 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4524 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4526 dpgon[0] = offset2 + 360./(2.*39.);
4530 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4534 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4541 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4542 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4544 if (fMinorVersion > 2 && fMinorVersion < 6) {
4546 dpgon[0] = offset2 + 5.625;
4550 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4551 // end-ladder electronics
4554 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4555 // end-ladder electr
4561 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4562 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4564 dpgon[0] = offset2 + 5.;
4568 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4569 // end-ladder electronics
4572 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4573 // end-ladder electr
4579 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4580 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4585 // --- Define the Z<0 end-cap
4587 // GOTO 9456 ! skip the Z<0 end-cap
4590 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4591 dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4596 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4597 // end-ladder electr
4598 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4600 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4602 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4604 // In the Simonetti's drawings 52. In the TP 50.
4608 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4609 // end-ladder electr
4610 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4612 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4616 dtube[2] = 26.8/2./10.;
4619 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4621 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4623 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4629 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4630 // end-ladder electronics
4633 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4634 // end-ladder electro
4640 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4641 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4647 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4651 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4658 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4659 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4661 if (fMinorVersion < 3) {
4663 dpgon[0] = offset2 + 360./(2.*35.);
4667 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4671 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4678 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4679 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4681 dpgon[0] = offset2 + 360./(2.*39.);
4685 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4689 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4696 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4697 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4699 if (fMinorVersion > 2 && fMinorVersion < 6) {
4701 dpgon[0] = offset2 + 5.625;
4705 dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4706 // end-ladder electronics
4709 dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4710 // end-ladder electr
4716 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4717 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4719 dpgon[0] = offset2 + 5.;
4723 dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4724 // end-ladder electronics
4727 dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4728 // end-ladder electr
4734 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4735 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4741 // --- Outputs the geometry tree in the EUCLID/CAD format
4744 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4747 //_____________________________________________________________________________
4748 void AliITSv3::CreateMaterials(){
4749 ////////////////////////////////////////////////////////////////////////
4751 // Create ITS materials
4752 // This function defines the default materials used in the Geant
4753 // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
4754 // In general it is automatically replaced by
4755 // the CreatMaterials routine defined in AliITSv?. Should the function
4756 // CreateMaterials not exist for the geometry version you are using this
4757 // one is used. See the definition found in AliITSv5 or the other routine
4758 // for a complete definition.
4761 Float_t awat[2] = { 1.00794,15.9994 };
4762 Float_t zwat[2] = { 1.,8. };
4763 Float_t wwat[2] = { 2.,1. };
4764 Float_t denswat = 1.;
4766 Float_t afre[2] = { 12.011,18.9984032 };
4767 Float_t zfre[2] = { 6.,9. };
4768 Float_t wfre[2] = { 5.,12. };
4769 Float_t densfre = 1.5;
4771 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4772 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4773 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4774 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4775 Float_t denscer = 3.6;
4777 // 60% SiO2 , 40% G10FR4
4779 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4780 Float_t zpcb[3] = { 14.,8.,8.875 };
4781 Float_t wpcb[3] = { .28,.32,.4 };
4782 Float_t denspcb = 1.8;
4784 Float_t apoly[2] = { 12.01,1. };
4785 Float_t zpoly[2] = { 6.,1. };
4786 Float_t wpoly[2] = { .33,.67 };
4788 Float_t zserv[4] = { 1.,6.,26.,29. };
4789 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4790 Float_t wserv[4] = { .014,.086,.42,.48 };
4792 Int_t isxfld = gAlice->Field()->Integ();
4793 Float_t sxmgmx = gAlice->Field()->Max();
4796 // --- Define the various materials for GEANT ---
4798 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4800 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4801 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4802 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4803 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4805 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4806 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4807 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4808 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4809 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4811 AliMedium(0, "SPD Si$", 0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4812 AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4813 AliMedium(2, "SPD Si bus$", 2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4814 AliMedium(3, "SPD C$", 3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4815 AliMedium(4, "SPD Air$", 4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4816 AliMedium(5, "SPD Vacuum$", 5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4817 AliMedium(6, "SPD Al$", 6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4818 AliMedium(7, "SPD Water $", 7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4819 AliMedium(8, "SPD Freon$", 8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4821 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4823 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4824 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4825 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4826 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4828 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4829 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4830 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4831 // After a call with ratios by number (negative number of elements),
4832 // the ratio array is changed to the ratio by weight, so all successive
4833 // calls with the same array must specify the number of elements as
4835 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4836 // After a call with ratios by number (negative number of elements),
4837 // the ratio array is changed to the ratio by weight, so all successive
4838 // calls with the same array must specify the number of elements as
4840 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4841 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4842 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4843 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4844 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4847 AliMedium(25, "SDD Si$", 25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4848 AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4849 AliMedium(27, "SDD Si bus$", 27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4850 AliMedium(28, "SDD C$", 28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4851 AliMedium(29, "SDD Air$", 29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4852 AliMedium(30, "SDD Vacuum$", 30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4853 AliMedium(31, "SDD Al$", 31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4854 AliMedium(32, "SDD Water $", 32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4855 AliMedium(33, "SDD Freon$", 33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4856 AliMedium(34, "SDD PCB$", 34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4857 AliMedium(35, "SDD Copper$", 35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4858 AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4859 AliMedium(37, "SDD Kapton$", 37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4861 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4863 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4864 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4865 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4866 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4868 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4869 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4870 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4871 // After a call with ratios by number (negative number of elements),
4872 // the ratio array is changed to the ratio by weight, so all successive
4873 // calls with the same array must specify the number of elements as
4875 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
4876 // After a call with ratios by number (negative number of elements),
4877 // the ratio array is changed to the ratio by weight, so all successive
4878 // calls with the same array must specify the number of elements as
4880 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4881 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4882 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4883 // After a call with ratios by number (negative number of elements),
4884 // the ratio array is changed to the ratio by weight, so all successive
4885 // calls with the same array must specify the number of elements as
4887 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4888 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4890 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4892 AliMedium(50, "SSD Si$", 50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4893 AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4894 AliMedium(52, "SSD Si bus$", 52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4895 AliMedium(53, "SSD C$", 53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4896 AliMedium(54, "SSD Air$", 54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4897 AliMedium(55, "SSD Vacuum$", 55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4898 AliMedium(56, "SSD Al$", 56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4899 AliMedium(57, "SSD Water $", 57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4900 AliMedium(58, "SSD Freon$", 58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4901 AliMedium(59, "SSD PCB$", 59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4902 AliMedium(60, "SSD Copper$", 60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4903 AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4904 AliMedium(62, "SSD Kapton$", 62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4905 AliMedium(63, "SSD G10FR4$", 63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4907 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4909 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4911 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4912 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4913 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4914 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4915 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4916 // After a call with ratios by number (negative number of elements),
4917 // the ratio array is changed to the ratio by weight, so all successive
4918 // calls with the same array must specify the number of elements as
4920 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4922 AliMedium(75,"GEN C$", 75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4923 AliMedium(76,"GEN Air$", 76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4924 AliMedium(77,"GEN Vacuum$", 77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
4925 AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4926 AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4927 AliMedium(80,"GEN Copper$", 80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4928 AliMedium(81,"GEN Water $", 81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4930 //_____________________________________________________________________________
4931 void AliITSv3::Init(){
4932 ////////////////////////////////////////////////////////////////////////
4933 // Initialise the ITS after it has been created.
4934 ////////////////////////////////////////////////////////////////////////
4939 //_____________________________________________________________________________
4940 void AliITSv3::StepManager(){
4941 ////////////////////////////////////////////////////////////////////////
4942 // Called for every step in the ITS, then calles the AliITShit class
4943 // creator with the information to be recoreded about that hit.
4944 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4945 // printing of information to a file which can be used to create a .det
4946 // file read in by the routine CreateGeometry(). If set to 0 or any other
4947 // value except 1, the default behavior, then no such file is created nor
4948 // it the extra variables and the like used in the printing allocated.
4949 ////////////////////////////////////////////////////////////////////////
4953 TLorentzVector position, momentum;
4954 TClonesArray &lhits = *fHits;
4955 #if ALIITSPRINTGEOM==1
4958 Float_t xl[3],xt[3],angl[6];
4959 // Float_t par[20],att[20];
4961 static Bool_t first=kTRUE,printit[6][50][50];
4962 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4963 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4971 if(gMC->IsTrackInside()) vol[3] += 1;
4972 if(gMC->IsTrackEntering()) vol[3] += 2;
4973 if(gMC->IsTrackExiting()) vol[3] += 4;
4974 if(gMC->IsTrackOut()) vol[3] += 8;
4975 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4976 if(gMC->IsTrackStop()) vol[3] += 32;
4977 if(gMC->IsTrackAlive()) vol[3] += 64;
4979 // Fill hit structure.
4980 if(!(gMC->TrackCharge())) return;
4982 // Only entering charged tracks
4983 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4985 id=gMC->CurrentVolOffID(1,copy);
4987 id=gMC->CurrentVolOffID(2,copy);
4989 } else if(id==fIdSens[1]) {
4991 id=gMC->CurrentVolOffID(1,copy);
4993 id=gMC->CurrentVolOffID(2,copy);
4995 } else if(id==fIdSens[2]) {
4998 id=gMC->CurrentVolOffID(1,copy);
5000 } else if(id==fIdSens[3]) {
5003 id=gMC->CurrentVolOffID(1,copy);
5005 } else if(id==fIdSens[4]) {
5008 id=gMC->CurrentVolOffID(1,copy);
5010 } else if(id==fIdSens[5]) {
5013 id=gMC->CurrentVolOffID(1,copy);
5016 gMC->TrackPosition(position);
5017 gMC->TrackMomentum(momentum);
5018 hits[0]=position[0];
5019 hits[1]=position[1];
5020 hits[2]=position[2];
5021 hits[3]=momentum[0];
5022 hits[4]=momentum[1];
5023 hits[5]=momentum[2];
5024 hits[6]=gMC->Edep();
5025 hits[7]=gMC->TrackTime();
5026 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
5027 #if ALIITSPRINTGEOM==1
5028 if(printit[vol[0]][vol[2]][vol[1]]){
5029 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
5030 xl[0] = xl[1] = xl[2] = 0.0;
5031 gMC->Gdtom(xl,xt,1);
5032 for(i=0;i<9;i++) mat[i] = 0.0;
5033 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
5036 gMC->Gdtom(xl,&(mat[0]),2);
5039 gMC->Gdtom(xl,&(mat[3]),2);
5042 gMC->Gdtom(xl,&(mat[6]),2);
5044 angl[0] = TMath::ACos(mat[2]);
5045 if(mat[2]==1.0) angl[0] = 0.0;
5046 angl[1] = TMath::ATan2(mat[1],mat[0]);
5047 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5049 angl[2] = TMath::ACos(mat[5]);
5050 if(mat[5]==1.0) angl[2] = 0.0;
5051 angl[3] = TMath::ATan2(mat[4],mat[3]);
5052 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5054 angl[4] = TMath::ACos(mat[8]);
5055 if(mat[8]==1.0) angl[4] = 0.0;
5056 angl[5] = TMath::ATan2(mat[7],mat[6]);
5057 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5059 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5060 // i = gMC->CurrentVolID(copy);
5061 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5062 fp = fopen("ITSgeometry_v5.det","a");
5063 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5064 vol[0],vol[2],vol[1], // layer ladder detector
5065 xt[0],xt[1],xt[2], // Translation vector
5066 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5069 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5070 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5071 ); // Adding the rotation matrix.
5074 } // end if printit[layer][ladder][detector]