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.19 2000/10/05 20:49:59 nilsen
19 Now using root generated streamers.
21 Revision 1.11.4.10 2000/07/31 13:50:51 barbera
22 Updated from the release
24 Revision 1.17 2000/07/10 16:07:19 fca
25 Release version of ITS code
27 Revision 1.11.4.4 2000/05/19 10:09:51 nilsen
28 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
30 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
31 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
32 <=23 (was <=24). This may not be the final version.
34 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
35 Fixed up the comments/documentation.
37 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
38 This is the version of the files after the merging done in December 1999.
39 See the ReadMe110100.txt file for details
41 Revision 1.11 1999/10/22 08:25:25 fca
42 remove double definition of destructors
44 Revision 1.10 1999/10/22 08:16:49 fca
45 Correct destructors, thanks to I.Hrivnacova
47 Revision 1.9 1999/10/06 19:56:50 fca
50 Revision 1.8 1999/10/05 08:05:09 fca
51 Minor corrections for uninitialised variables.
53 Revision 1.7 1999/09/29 09:24:20 fca
54 Introduction of the Copyright and cvs Log
58 ///////////////////////////////////////////////////////////////////////////////
60 // Inner Traking System version 3
61 // This class contains the base procedures for the Inner Tracking System
63 // Authors: R. Barbera, A. Morsch.
67 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
68 // WORK with the geometry or module classes or any analysis classes. You are
69 // strongly encouraged to uses AliITSv5.
71 ///////////////////////////////////////////////////////////////////////////////
73 // See AliITSv3::StepManager().
74 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
75 //#define ALIITSPRINTGEOM 1 // print out geometry information
80 #include <TGeometry.h>
83 #include <TFile.h> // only required for Tracking function?
85 #include <TObjArray.h>
86 #include <TObjString.h>
87 #include <TClonesArray.h>
93 #include "AliITShit.h"
99 //_____________________________________________________________________________
100 AliITSv3::AliITSv3() {
101 ////////////////////////////////////////////////////////////////////////
102 // Standard default constructor for the ITS version 3.
103 ////////////////////////////////////////////////////////////////////////
111 //____________________________________________________________________________
112 AliITSv3::AliITSv3(const AliITSv3 &source){
113 ////////////////////////////////////////////////////////////////////////
114 // Copy Constructor for ITS version 3.
115 ////////////////////////////////////////////////////////////////////////
116 if(&source == this) return;
117 printf("Not allowed to copy AliITSv3\n");
120 //_____________________________________________________________________________
121 AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
122 ////////////////////////////////////////////////////////////////////////
123 // Assignment operator for the ITS version 3.
124 ////////////////////////////////////////////////////////////////////////
125 if(&source == this) return *this;
126 printf("Not allowed to copy AliITSv3\n");
129 //_____________________________________________________________________________
130 AliITSv3::~AliITSv3() {
131 ////////////////////////////////////////////////////////////////////////
132 // Standard destructor for the ITS version 3.
133 ////////////////////////////////////////////////////////////////////////
135 //_____________________________________________________________________________
136 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
137 ////////////////////////////////////////////////////////////////////////
138 // Standard constructor for the ITS version 3.
139 ////////////////////////////////////////////////////////////////////////
143 // TObjArray of TObjStrings
144 fIdName = new TObjArray(fIdN);
145 fIdName->AddAt(new TObjString("ITS1"),0);
146 fIdName->AddAt(new TObjString("ITS2"),1);
147 fIdName->AddAt(new TObjString("ITS3"),2);
148 fIdName->AddAt(new TObjString("ITS4"),3);
149 fIdName->AddAt(new TObjString("ITS5"),4);
150 fIdName->AddAt(new TObjString("ITS6"),5);
152 // Array of TStrings.
153 fIdName = new TString[fIdN];
160 fIdSens = new Int_t[fIdN];
161 for (Int_t i=0;i<fIdN;i++) fIdSens[i] = 0;
164 }//__________________________________________________________________________
165 void AliITSv3::BuildGeometry(){
166 ////////////////////////////////////////////////////////////////////////
167 // Geometry builder for the ITS version 3.
168 ////////////////////////////////////////////////////////////////////////
170 const int kColorITS=kYellow;
172 top = gAlice->GetGeometry()->GetNode("alice");
174 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
176 node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
177 node->SetLineColor(kColorITS);
180 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
182 node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
183 node->SetLineColor(kColorITS);
186 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
188 node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
189 node->SetLineColor(kColorITS);
192 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
194 node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
195 node->SetLineColor(kColorITS);
198 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
200 node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
201 node->SetLineColor(kColorITS);
204 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
206 node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
207 node->SetLineColor(kColorITS);
210 //_____________________________________________________________________________
211 void AliITSv3::CreateGeometry(){
212 ////////////////////////////////////////////////////////////////////////
213 // This routine creates and defines the version 3 geometry of the ITS.
214 ////////////////////////////////////////////////////////////////////////
216 const Float_t kxx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
217 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
219 const Float_t kyy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
220 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
222 const Float_t kxbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
223 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
225 const Float_t kybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
226 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
228 const Float_t kxend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
229 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
231 const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
232 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
234 const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
235 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
237 const Float_t kyarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
238 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
240 const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
241 0.5,0.7,0.5,0.7,0.5,0.5 };
242 const Float_t krr = 4.064516;
243 const Float_t ktteta = 63.00;
244 const Float_t kpphi = -35.00;
245 const Float_t kgteta = 87.78;
246 const Double_t kdegrad = kPI/180.;
247 const Double_t kraddeg = 180./kPI;
248 const Double_t ktwopi = 2*kPI;
251 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
252 dfra[10], dcer[3], dkap[3], dpla[3],
253 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
254 atheta1011, dbus[3], dtub[3], dwat[3],
255 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
256 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
257 Double_t biga1, bigb1;
258 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
259 dtra1[3], dtra2[3], dtra3[3],
260 dtra4[3], dbox1[3], dbox2[3];
262 Float_t xtra1[6], ytra1[6], ztra1[6];
264 Float_t xpos1, ypos1;
266 Float_t angle, dcone[5], dtube[3], dpgon[10];
267 Float_t rzero, xzero, yzero;
268 Double_t coeffa, coeffb, coeffc;
270 Float_t atheta, offset;
271 Float_t offset1, offset2, dgh[15];
272 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
273 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
276 Double_t xcc1, ycc1, xcc2, ycc2;
278 const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
279 "TR05","TR06","TR07","TR08"};
280 const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
281 "TR15","TR16","TR17","TR18",
282 "TR19","TR20","TR21","TR22",
283 "TR23","TR24","TR25","TR26"};
284 const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
285 const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
286 const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
287 "TR57","TR58","TR59","TR60","TR61","TR62",
288 "TR63","TR64","TR65","TR66"};
290 Int_t *idtmed = fIdtmed->GetArray()-199;
292 // --- Define a ghost volume containing the whole ITS and fill it with air
310 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
312 // --- Place the ghost volume in its mother volume (ALIC) and make it
315 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
316 gMC->Gsatt("ITSV", "SEEN", 0);
318 //************************************************************************
323 //************************************************************************
325 // GOTO 2345 ! skip ITS layer no. 1 and 2
327 // --- Define a ghost volume containing the Silicon Pixel Detectors
328 // (layer #1 and #2) and fill it with air or vacuum
330 xxm = (49.999-3)/(70-25);
334 dgh[3] = -25.-(9.-3.01)/xxm;
343 dgh[12] = 25+(9-3.01)/xxm;
346 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
348 // --- Place the ghost volume in its mother volume (ITSV) and make it
351 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
352 gMC->Gsatt("IT12", "SEEN", 0);
354 // --- Define a ghost volume containing a single element of layer #1
355 // and fill it with air or vacuum
357 dbox1[0] = 0.005+0.01+0.0075;
360 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
362 //--Divide each element of layer #1 in three ladders along the beam direction
364 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
366 // --- Make the ghost volumes invisible
368 gMC->Gsatt("IPV1", "SEEN", 0);
369 gMC->Gsatt("IPB1", "SEEN", 0);
371 // --- Define a volume containing the chip of pixels (silicon, layer #1)
375 dchi[2] = dbox1[2] / 3.;
376 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
378 // --- Define a volume containing the bus of pixels (silicon, layer #1)
383 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
385 // --- Define a volume containing the sensitive part of pixels
386 // (silicon, layer #1)
391 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
393 // --- Place the chip into its mother (IPB1)
395 xpos = dbox1[0] - dchi[0];
398 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
400 // --- Place the sensitive volume into its mother (IPB1)
402 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
403 ypos = dchi[1] - dits[1];
404 zpos = -(dchi[2] - dits[2]);
405 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
407 // --- Place the bus into its mother (IPB1)
409 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
410 ypos = dchi[1] - dbus[1];
411 zpos = -(dchi[2] - dbus[2]);
412 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
414 // --- Define a ghost volume containing a single element of layer #2
415 // and fill it with air or vacuum
417 dbox2[0] = 0.005+0.01+0.0075;
420 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
422 //--Divide each element of layer #2 in four ladders along the beam direction
424 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
426 // --- Make the ghost volumes invisible
428 gMC->Gsatt("IPV2", "SEEN", 0);
429 gMC->Gsatt("IPB2", "SEEN", 0);
431 // --- Define a volume containing the chip of pixels (silicon, layer #2)
435 dchi[2] = dbox2[2] / 4.;
436 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
438 // --- Define a volume containing the bus of pixels (silicon, layer #2)
443 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
445 // --- Define a volume containing the sensitive part of pixels
446 // (silicon, layer #2)
451 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
453 // --- Place the chip into its mother (IPB2)
455 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
458 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
460 // --- Place the sensitive volume into its mother (IPB2)
462 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
463 ypos = -(dchi[1] - dits[1]);
464 zpos = -(dchi[2] - dits[2]);
465 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
467 // --- Place the bus into its mother (IPB2)
469 xpos = dbox1[0] - dbus[0];
470 ypos = -(dchi[1] - dbus[1]);
471 zpos = -(dchi[2] - dbus[2]);
472 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
474 // --- Define a generic segment of an element of the mechanical support
479 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
481 // --- Define a generic arc of an element of the mechanical support
486 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
488 // --- Define the mechanical supports of layers #1 and #2 and place the
489 // elements of the layers in it
492 // counter over the number of elements of layer #1 (
495 // counter over the number of elements of layer #2 (
496 for (i = 1; i <= 10; ++i) {
498 // --- Place part # 1-2 (see sketch)
500 // number of carbon fiber supports (see sketch)
503 dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) +
504 (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0]) ) / 20.;
506 xcc = ( kxx[0] + kxx[1]) / 20.;
507 ycc = ( kyy[0] + kyy[1]) / 20.;
508 xccc = (kxbeg[0] + kxend[0]) / 20.;
509 yccc = (kybeg[0] + kyend[0]) / 20.;
510 if (kxx[0] == kxx[1]) {
513 r1 = kyy[1] - kyy[0];
514 r2 = kxx[1] - kxx[0];
515 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
516 } // end if kxx[0] == kxx[1]
517 aphi = (kpphi + (i-1) * 36.) * kdegrad;
518 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
519 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
520 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
521 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
522 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
523 ypos1 * TMath::Sin(kgteta *kdegrad);
524 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
525 ypos1 * TMath::Cos(kgteta * kdegrad);
527 atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
528 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
529 atheta12 + 90., 0., 0.);
530 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
531 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
533 // --- Place part # 2-3 (see sketch)
537 dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) +
538 (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
540 xcc = ( kxx[1] + kxx[2]) / 20.;
541 ycc = ( kyy[1] + kyy[2]) / 20.;
542 xccc = (kxbeg[1] + kxend[1]) / 20.;
543 yccc = (kybeg[1] + kyend[1]) / 20.;
544 if (kxx[1] == kxx[2]) {
547 r1 = kyy[2] - kyy[1];
548 r2 = kxx[2] - kxx[1];
549 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
550 } // end if kxx[1] == kxx[2]
551 aphi = (kpphi + (i-1) * 36.) * kdegrad;
552 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
553 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
554 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
555 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
556 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
557 ypos1 * TMath::Sin(kgteta * kdegrad);
558 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
559 ypos1 * TMath::Cos(kgteta * kdegrad);
561 atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
562 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
563 atheta23 + 90., 0., 0.);
564 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
565 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
567 // --- Place an element of layer #2
569 biga = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
570 bigb = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
571 coeffa = biga * biga + 1.;
572 coeffb = biga * bigb - biga * ycc - xcc;
573 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
574 bigb * bigb - 0.08964*0.08964;
575 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
577 ycc1 = biga * xcc1 + bigb;
579 bigb1 = xcc1 / biga + ycc1;
580 coeffa = biga1 * biga1 + 1.;
581 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
582 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
583 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
584 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
586 ycc2 = biga1 * xcc2 + bigb1;
587 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
588 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
589 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
590 ypos1 * TMath::Sin(kgteta *kdegrad);
591 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
592 ypos1 * TMath::Cos(kgteta * kdegrad);
595 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
596 idrotm[(i-1) * 13 + 1101], "ONLY");
598 // --- Place part # 3-4 (see sketch)
602 dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) +
603 (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
605 xcc = (kxx[1] + kxx[2]) / 20.;
606 ycc = (kyy[1] + kyy[2]) / 20.;
607 xccc = (kxbeg[2] + kxend[2]) / 20.;
608 yccc = (kybeg[2] + kyend[2]) / 20.;
609 if (kxx[2] == kxx[3]) {
612 r1 = kyy[3] - kyy[2];
613 r2 = kxx[3] - kxx[2];
614 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
615 } // end if kxx[2] == kxx[3]
616 aphi = (kpphi + (i-1) * 36.) * kdegrad;
617 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
618 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
619 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
620 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
621 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
622 ypos1 * TMath::Sin(kgteta *kdegrad);
623 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
624 ypos1 * TMath::Cos(kgteta * kdegrad);
626 atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
627 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
628 atheta34 + 90., 0., 0.);
629 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
630 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
632 // --- Place part # 4-5 (see sketch)
636 dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) +
637 (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
639 xcc = ( kxx[3] + kxx[4]) / 20.;
640 ycc = ( kyy[3] + kyy[4]) / 20.;
641 xccc = (kxbeg[3] + kxend[3]) / 20.;
642 yccc = (kybeg[3] + kyend[3]) / 20.;
643 if (kxx[3] == kxx[4]) {
646 r1 = kyy[4] - kyy[3];
647 r2 = kxx[4] - kxx[3];
648 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
649 } // end if kxx[3] == kxx[4]
650 aphi = (kpphi + (i-1) * 36.) * kdegrad;
651 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
652 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
653 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
654 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
655 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
656 ypos1 * TMath::Sin(kgteta *kdegrad);
657 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
658 ypos1 * TMath::Cos(kgteta * kdegrad);
660 atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
661 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
662 atheta45 + 90., 0., 0.);
663 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
664 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
666 // --- Place an element of layer #2
668 biga = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
669 bigb = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
670 coeffa = biga * biga + 1.;
671 coeffb = biga * bigb - biga * ycc - xcc;
672 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
673 bigb * bigb - .014285030400000001;
674 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
676 ycc1 = biga * xcc1 + bigb;
678 bigb1 = xcc1 / biga + ycc1;
679 coeffa = biga1 * biga1 + 1.;
680 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
681 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
682 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
683 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
685 ycc2 = biga1 * xcc2 + bigb1;
686 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
687 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
688 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
689 ypos1 * TMath::Sin(kgteta *kdegrad);
690 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
691 ypos1 * TMath::Cos(kgteta * kdegrad);
694 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
695 idrotm[(i-1) * 13 + 1103], "ONLY");
697 // --- Place part # 5-6 (see sketch)
701 dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) +
702 (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
704 xcc = (kxx[4] + kxx[5]) / 20.;
705 ycc = (kyy[4] + kyy[5]) / 20.;
706 xccc = (kxbeg[4] + kxend[4]) / 20.;
707 yccc = (kybeg[4] + kyend[4]) / 20.;
708 if (kxx[4] == kxx[5]) {
711 r1 = kyy[5] - kyy[4];
712 r2 = kxx[5] - kxx[4];
713 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
715 aphi = (kpphi + (i-1) * 36.) * kdegrad;
716 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
717 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
718 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
719 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
720 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
721 ypos1 * TMath::Sin(kgteta *kdegrad);
722 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
723 ypos1 * TMath::Cos(kgteta * kdegrad);
725 atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
726 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
727 atheta56 + 90., 0., 0.);
728 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
729 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
731 // --- Place part # 6-7 (see sketch)
735 dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) +
736 (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
738 xcc = (kxx[5] + kxx[6]) / 20.;
739 ycc = (kyy[5] + kyy[6]) / 20.;
740 xccc = (kxbeg[5] + kxend[5]) / 20.;
741 yccc = (kybeg[5] + kyend[5]) / 20.;
742 if (kxx[5] == kxx[6]) {
745 r1 = kyy[6] - kyy[5];
746 r2 = kxx[6] - kxx[5];
747 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
748 } // end if kxx[5] == kxx[6]
749 aphi = (kpphi + (i-1) * 36.) * kdegrad;
750 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
751 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
752 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
753 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
754 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
755 ypos1 * TMath::Sin(kgteta *kdegrad);
756 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
757 ypos1 * TMath::Cos(kgteta * kdegrad);
759 atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
760 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
761 atheta67 + 90., 0., 0.);
762 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
763 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
765 // --- Place an element of layer #2
767 biga = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
768 bigb = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
769 coeffa = biga * biga + 1.;
770 coeffb = biga * bigb - biga * ycc - xcc;
771 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
772 bigb * bigb - .014285030400000001;
773 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
775 ycc1 = biga * xcc1 + bigb;
777 bigb1 = xcc1 / biga + ycc1;
778 coeffa = biga1 * biga1 + 1.;
779 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
780 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
781 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
782 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
784 ycc2 = biga1 * xcc2 + bigb1;
785 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
786 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
787 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
788 ypos1 * TMath::Sin(kgteta *kdegrad);
789 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
790 ypos1 * TMath::Cos(kgteta * kdegrad);
793 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
794 idrotm[(i-1) * 13 + 1105], "ONLY");
796 // --- Place part # 7-8 (see sketch)
800 dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
801 (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
803 xcc = (kxx[6] + kxx[7]) / 20.;
804 ycc = (kyy[6] + kyy[7]) / 20.;
805 xccc = (kxbeg[6] + kxend[6]) / 20.;
806 yccc = (kybeg[6] + kyend[6]) / 20.;
807 if (kxx[6] == kxx[7]) {
810 r1 = kyy[7] - kyy[6];
811 r2 = kxx[7] - kxx[6];
812 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
814 aphi = (kpphi + (i-1) * 36.) * kdegrad;
815 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
816 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
817 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
818 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
819 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
820 ypos1 * TMath::Sin(kgteta *kdegrad);
821 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
822 ypos1 * TMath::Cos(kgteta * kdegrad);
824 atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
825 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
826 atheta78 + 90., 0., 0.);
827 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
828 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
830 // --- Place part # 8-9 (see sketch)
834 dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) +
835 (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
837 xcc = (kxx[7] + kxx[8]) / 20.;
838 ycc = (kyy[7] + kyy[8]) / 20.;
839 xccc = (kxbeg[7] + kxend[7]) / 20.;
840 yccc = (kybeg[7] + kyend[7]) / 20.;
841 if (kxx[1] == kxx[2]) {
844 r1 = kyy[8] - kyy[7];
845 r2 = kxx[8] - kxx[7];
846 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
848 aphi = (kpphi + (i-1) * 36.) * kdegrad;
849 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
850 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
851 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
852 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
853 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
854 ypos1 * TMath::Sin(kgteta *kdegrad);
855 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
856 ypos1 * TMath::Cos(kgteta * kdegrad);
858 atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
859 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
860 atheta89 + 90., 0., 0.);
861 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
862 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
864 // --- Place an element of layer #2
866 biga = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
867 bigb = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
868 coeffa = biga * biga + 1.;
869 coeffb = biga * bigb - biga * ycc - xcc;
870 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
871 bigb * bigb - .014285030400000001;
872 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
874 ycc1 = biga * xcc1 + bigb;
876 bigb1 = xcc1 / biga + ycc1;
877 coeffa = biga1 * biga1 + 1.;
878 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
879 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
880 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
881 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
883 ycc2 = biga1 * xcc2 + bigb1;
884 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
885 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
886 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
887 ypos1 * TMath::Sin(kgteta *kdegrad);
888 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
889 ypos1 * TMath::Cos(kgteta * kdegrad);
892 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
893 idrotm[(i-1) * 13 + 1107], "ONLY");
895 // --- Place part # 9-10 (see sketch)
899 dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
900 (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
902 xcc = (kxx[8] + kxx[9]) / 20.;
903 ycc = (kyy[8] + kyy[9]) / 20.;
904 xccc = (kxbeg[8] + kxend[8]) / 20.;
905 yccc = (kybeg[8] + kyend[8]) / 20.;
906 if (kxx[8] == kxx[9]) {
909 r1 = kyy[9] - kyy[8];
910 r2 = kxx[9] - kxx[8];
911 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
913 aphi = (kpphi + (i-1) * 36.) * kdegrad;
914 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
915 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
916 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
917 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
918 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
919 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
921 atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
922 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
923 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
925 // --- Place part # 10-11 (see sketch)
929 dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
931 xcc = (kxx[9] + kxx[10]) / 20.;
932 ycc = (kyy[9] + kyy[10]) / 20.;
933 xccc = (kxbeg[9] + kxend[9]) / 20.;
934 yccc = (kybeg[9] + kyend[9]) / 20.;
935 if (kxx[9] == kxx[10]) {
938 r1 = kyy[10] - kyy[9];
939 r2 = kxx[10] - kxx[9];
940 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
942 aphi = (kpphi + (i-1) * 36.) * kdegrad;
943 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
944 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
945 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
946 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
947 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
948 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
950 atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
951 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
952 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
954 // --- Place part # 13-14 (see sketch)
958 dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
960 xcc = (kxx[12] + kxx[13]) / 20.;
961 ycc = (kyy[12] + kyy[13]) / 20.;
962 xccc = (kxbeg[12] + kxend[12]) / 20.;
963 yccc = (kybeg[12] + kyend[12]) / 20.;
964 if (kxx[12] == kxx[13]) {
967 r1 = kyy[12] - kyy[13];
968 r2 = kxx[12] - kxx[13];
969 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
971 aphi = (kpphi + (i-1) * 36.) * kdegrad;
972 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
973 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
974 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
975 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
976 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
977 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
979 atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
980 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
981 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
983 // --- Place an element of layer #1
985 biga = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
986 bigb = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
987 coeffa = biga * biga + 1.;
988 coeffb = biga * bigb - biga * ycc - xcc;
989 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
990 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
991 ycc1 = biga * xcc1 + bigb;
993 bigb1 = xcc1 / biga + ycc1;
994 coeffa = biga1 * biga1 + 1.;
995 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
996 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
997 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
998 ycc2 = biga1 * xcc2 + bigb1;
999 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1000 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1001 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1002 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1005 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
1007 // --- Place part # 12-13 (see sketch)
1011 dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
1013 xcc = (kxx[11] + kxx[12]) / 20.;
1014 ycc = (kyy[11] + kyy[12]) / 20.;
1015 xccc = (kxbeg[11] + kxend[11]) / 20.;
1016 yccc = (kybeg[11] + kyend[11]) / 20.;
1017 if (kxx[11] == kxx[12]) {
1020 r1 = kyy[12] - kyy[11];
1021 r2 = kxx[12] - kxx[11];
1022 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1024 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1025 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1026 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1027 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1028 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1029 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1030 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1032 atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
1033 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
1034 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
1036 // --- Place part # 11-12 (see sketch)
1040 dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
1042 xcc = (kxx[10] + kxx[11]) / 20.;
1043 ycc = (kyy[10] + kyy[11]) / 20.;
1044 xccc = (kxbeg[10] + kxend[10]) / 20.;
1045 yccc = (kybeg[10] + kyend[10]) / 20.;
1046 if (kxx[10] == kxx[11]) {
1049 r1 = kyy[11] - kyy[10];
1050 r2 = kxx[11] - kxx[10];
1051 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1053 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1054 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1055 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1056 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1057 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1058 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1059 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1061 atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
1062 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1063 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1065 // --- Place an element of layer #1
1067 biga = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
1068 bigb = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
1069 coeffa = biga * biga + 1.;
1070 coeffb = biga * bigb - biga * ycc - xcc;
1071 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1072 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1073 ycc1 = biga * xcc1 + bigb;
1075 bigb1 = xcc1 / biga + ycc1;
1076 coeffa = biga1 * biga1 + 1.;
1077 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1078 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1079 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1080 ycc2 = biga1 * xcc2 + bigb1;
1081 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1082 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1083 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1084 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1087 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1089 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1091 darc[0] = krarc[12] / 10. - .02;
1092 darc[1] = krarc[12] / 10.;
1094 darc[3] = atheta12 - (i-1) * 36.;
1095 darc[4] = atheta23 - (i-1) * 36.;
1096 xcc = kxarc[12] / 10.;
1097 ycc = kyarc[12] / 10.;
1098 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1099 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1100 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1101 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1102 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1103 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1104 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1106 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1108 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1110 darc[0] = krarc[11] / 10. - .02;
1111 darc[1] = krarc[11] / 10.;
1113 darc[3] = atheta23 + 90. - (i-1) * 36.;
1114 darc[4] = atheta34 + 90. - (i-1) * 36.;
1115 xcc = kxarc[11] / 10.;
1116 ycc = kyarc[11] / 10.;
1117 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1118 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1119 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1120 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1121 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1122 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1123 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1125 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1127 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1129 darc[0] = krarc[10] / 10. - .02;
1130 darc[1] = krarc[10] / 10.;
1132 darc[3] = atheta45 + 180. - (i-1) * 36.;
1133 darc[4] = atheta34 + 180. - (i-1) * 36.;
1134 xcc = kxarc[10] / 10.;
1135 ycc = kyarc[10] / 10.;
1136 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1137 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1138 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1139 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1140 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1141 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1142 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1144 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1146 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1148 darc[0] = krarc[9] / 10. - .02;
1149 darc[1] = krarc[9] / 10.;
1151 darc[3] = atheta45 - 90. - (i-1) * 36.;
1152 darc[4] = atheta56 - 90. - (i-1) * 36.;
1153 xcc = kxarc[9] / 10.;
1154 ycc = kyarc[9] / 10.;
1155 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1156 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1157 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1158 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1159 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1160 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1161 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1163 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1165 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1167 darc[0] = krarc[8] / 10. - .02;
1168 darc[1] = krarc[8] / 10.;
1170 darc[3] = atheta67 + 45. - (i-1) * 36.;
1171 darc[4] = atheta56 + 45. - (i-1) * 36.;
1172 xcc = kxarc[8] / 10.;
1173 ycc = kyarc[8] / 10.;
1174 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1175 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1176 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1177 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1178 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1179 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1180 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1182 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1184 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1186 darc[0] = krarc[7] / 10. - .02;
1187 darc[1] = krarc[7] / 10.;
1189 darc[3] = atheta67 - (i-1) * 36.;
1190 darc[4] = atheta78 - (i-1) * 36.;
1191 xcc = kxarc[7] / 10.;
1192 ycc = kyarc[7] / 10.;
1193 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1194 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1195 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1196 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1197 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1198 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1199 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1201 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1203 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1205 darc[0] = krarc[6] / 10. - .02;
1206 darc[1] = krarc[6] / 10.;
1208 darc[3] = atheta89 + 45. - (i-1) * 36.;
1209 darc[4] = atheta78 + 45. - (i-1) * 36.;
1210 xcc = kxarc[6] / 10.;
1211 ycc = kyarc[6] / 10.;
1212 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1213 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1214 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1215 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1216 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1217 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1218 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1220 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1222 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1224 darc[0] = krarc[5] / 10. - .02;
1225 darc[1] = krarc[5] / 10.;
1227 darc[3] = atheta89 + 45. - (i-1) * 36.;
1228 darc[4] = atheta910 + 45. - (i-1) * 36.;
1229 xcc = kxarc[5] / 10.;
1230 ycc = kyarc[5] / 10.;
1231 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1232 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1233 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1234 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1235 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1236 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1237 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1239 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1241 // --- Place arc # 5 (between part 9-10 and part 10-11)
1244 darc[0] = krarc[4] / 10. - .02;
1245 darc[1] = krarc[4] / 10.;
1247 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1248 darc[4] = atheta910 + 45. - (i-1) * 36.;
1249 xcc = kxarc[4] / 10.;
1250 ycc = kyarc[4] / 10.;
1251 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1252 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1253 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1254 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1255 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1256 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1257 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1259 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1261 // --- Place arc # 4 (between part 10-11 and part 11-12)
1264 darc[0] = krarc[3] / 10. - .02;
1265 darc[1] = krarc[3] / 10.;
1267 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1268 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1269 xcc = kxarc[3] / 10.;
1270 ycc = kyarc[3] / 10.;
1271 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1272 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1273 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1274 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1275 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1276 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1277 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1279 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1281 // --- Place arc # 3 (between part 11-12 and part 12-13)
1284 darc[0] = krarc[2] / 10. - .02;
1285 darc[1] = krarc[2] / 10.;
1287 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1288 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1289 xcc = kxarc[2] / 10.;
1290 ycc = kyarc[2] / 10.;
1291 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1292 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1293 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1294 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1295 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1296 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1297 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1299 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1301 // --- Place arc # 2 (between part 12-13 and part 13-14)
1304 darc[0] = krarc[1] / 10. - .02;
1305 darc[1] = krarc[1] / 10.;
1307 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1308 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1309 xcc = kxarc[1] / 10.;
1310 ycc = kyarc[1] / 10.;
1311 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1312 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1313 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1314 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1315 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1316 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1317 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1319 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1321 // --- Place arc # 1 (between part 13-14 and part 1-2)
1324 darc[0] = krarc[0] / 10. - .02;
1325 darc[1] = krarc[0] / 10.;
1327 darc[3] = atheta12 + 45. - (i-1) * 36.;
1328 darc[4] = atheta1314 - (i-1) * 36.;
1329 xcc = kxarc[0] / 10.;
1330 ycc = kyarc[0] / 10.;
1331 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1332 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1333 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1334 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1335 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1336 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1337 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1339 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1342 //************************************************************************
1347 //************************************************************************
1349 // --- Define a ghost volume containing the Silicon Drift Detectors
1350 // (layer #3 and #4) and fill it with air or vacuum
1352 xxm = (49.999-3.)/(70.-25.);
1356 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1359 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1362 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1365 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1368 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1370 // --- Place the ghost volume in its mother volume (ITSV) and make it
1373 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1374 gMC->Gsatt("IT34", "SEEN", 0);
1378 // GOTO 3456 ! skip ITS layer no. 3
1380 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1381 // smaller lenght of ribs) and fill it with air or vacuum
1383 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1385 // the widest element is the sensitive element
1386 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1387 // 7.5 cm is the lenght
1388 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1390 // --- Make the ghost volume invisible
1392 gMC->Gsatt("IDV1", "SEEN", 0);
1394 // --- Define a volume containing the sensitive part of drifts
1395 // (silicon, layer #3)
1398 // see material budget report by G. Feofilov
1401 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1403 //--- Define the part of the (smaller) rib between two sensitive parts made of
1404 // carbon (layer #3)
1406 dsup[0] = .5 - dits[0];
1408 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1409 // 7.5 cm is the lenght
1410 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1412 //--- Define the first part of the (smaller) rib between two sensitive parts
1413 // made of aluminum (layer #3)
1415 dal1[0] = .5 - dits[0];
1416 dal1[1] = 0.00096/2.;
1417 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1418 // 7.5 cm is the lenght
1419 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1421 //--- Define the part of the (smaller) rib between two sensitive parts made of
1422 // kapton (layer #3)
1424 dkap[0] = .5 - dits[0];
1426 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1427 // 7.5 cm is the lenght
1428 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1430 //--- Define the second part of the (smaller) rib between two sensitive parts
1431 // made of aluminum (layer #3)
1433 dal2[0] = .5 - dits[0];
1434 dal2[1] = 0.0027/2.;
1435 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1436 // 7.5 cm is the lenght
1437 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1439 // --- Define the part of the (smaller) rib between two sensitive parts
1440 // made of silicon (the electronics) (layer #3)
1442 dchi[0] = .5 - dits[0];
1443 dchi[1] = 0.0071/2.;
1444 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1445 // 7.5 cm is the lenght
1446 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1448 // --- Define the part of the (smaller) rib between two sensitive parts
1449 // made of water (the cooler) (layer #3)
1451 dwat[0] = .5 - dits[0];
1452 dwat[1] = 0.0093/2.;
1453 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1454 // 7.5 cm is the lenght
1455 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1457 //--- Define the third part of the (smaller) rib between two sensitive parts
1458 // made of aluminum (the cooling tubes) (layer #3)
1460 dtub[0] = .5 - dits[0];
1461 dtub[1] = 0.00134/2.;
1462 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1463 // 7.5 cm is the lenght
1464 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1466 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1469 // twice the foreseen thickness
1472 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1474 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1477 // twice the foreseen thickness
1480 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1482 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1485 // twice the foreseen thickness
1488 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1490 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1493 // twice the foreseen thickness
1496 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1498 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1502 for (j = 1; j <= 5; ++j) {
1503 // odd elements are up and even elements are down
1505 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1506 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1507 } else if (j == 2) {
1508 xpos = -dbox1[0] + dits[0];
1509 zpos = 0. - dits[2] + 1. - dits[2];
1510 } else if (j == 3) {
1511 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1513 } else if (j == 4) {
1514 xpos = -dbox1[0] + dits[0];
1515 zpos = dits[2] + 0. - 1. + dits[2];
1516 } else if (j == 5) {
1517 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1518 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1520 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1523 // --- Place the smaller ribs into their mother (IDV1)
1525 // --- Right ribs (just a matter of convention)
1527 xpos = .5 - dbox1[0] + dits[0];
1533 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1537 ypos = dsup[1] + 2.81 + dal1[1];
1538 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1542 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1543 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1547 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1548 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1550 // --- Silicon (chip)
1552 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1553 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1557 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1558 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1562 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1564 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1566 // --- Right ribs (just a matter of convention)
1571 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1575 ypos = -(dsup[1] + 2.81 + dal1[1]);
1576 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1580 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1581 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1585 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1586 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1588 // --- Silicon (chip)
1590 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1591 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1595 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1596 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1600 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1601 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1602 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1604 // --- Place the end-ladder stuff into its mother (IDV1)
1607 // --- Negative-Z end-ladder
1610 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1614 xpos = dbox1[0] - dpcb[0];
1615 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1619 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1620 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1624 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1625 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1627 // --- Silicon (bus)
1629 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1630 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1632 // --- Positive-Z end-ladder
1635 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1639 xpos = dbox1[0] - dpcb[0];
1640 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1644 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1645 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1649 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1650 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1652 // --- Silicon (bus)
1654 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1655 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1657 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1658 // larger lenght of ribs) and fill it with air or vacuum
1660 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1662 // the widest element is the sensitive element
1663 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1664 // 7.5 cm is the lenght
1665 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1667 // --- Make the ghost volume invisible
1669 gMC->Gsatt("IDV2", "SEEN", 0);
1671 //--- Define the part of the (larger) rib between two sensitive parts madeof
1672 // carbon (layer #3)
1674 dsup[0] = .65 - dits[0];
1676 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1677 // 7.5 cm is the lenght
1678 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1680 //--- Define the first part of the (larger) rib between two sensitive parts
1681 // made of aluminum (layer #3)
1683 dal1[0] = .65 - dits[0];
1684 dal1[1] = 0.00096/2.;
1685 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1686 // 7.5 cm is the lenght
1687 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1689 //--- Define the part of the (larger) rib between two sensitive parts madeof
1690 // kapton (layer #3)
1692 dkap[0] = .65 - dits[0];
1693 dkap[1] = 0.0317/2.;
1694 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1695 // 7.5 cm is the lenght
1696 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1698 //--- Define the second part of the (larger) rib between two sensitive parts
1699 // made of aluminum (layer #3)
1701 dal2[0] = .65 - dits[0];
1702 dal2[1] = 0.0027/2.;
1703 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1704 // 7.5 cm is the lenght
1705 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1707 // --- Define the part of the (larger) rib between two sensitive parts
1708 // made of silicon (the electronics) (layer #3)
1710 dchi[0] = .65 - dits[0];
1711 dchi[1] = 0.0071/2.;
1712 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1713 // 7.5 cm is the lenght
1714 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1716 // --- Define the part of the (larger) rib between two sensitive parts
1717 // made of water (the cooler) (layer #3)
1719 dwat[0] = .65 - dits[0];
1720 dwat[1] = 0.0093/2.;
1721 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1722 // 7.5 cm is the lenght
1723 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1725 //--- Define the third part of the (larger) rib between two sensitive parts
1726 // made of aluminum (the cooling tubes) (layer #3)
1728 dtub[0] = .65 - dits[0];
1729 dtub[1] = 0.00134/2.;
1730 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1731 // 7.5 cm is the lenght
1732 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1734 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1738 for (j = 1; j <= 5; ++j) {
1739 // odd element are up and even elements are down
1741 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1742 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1743 } else if (j == 2) {
1744 xpos = -dbox2[0] + dits[0];
1745 zpos = 0. - dits[2] + 1. - dits[2];
1746 } else if (j == 3) {
1747 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1749 } else if (j == 4) {
1750 xpos = -dbox2[0] + dits[0];
1751 zpos = dits[2] + 0. - 1. + dits[2];
1752 } else if (j == 5) {
1753 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1754 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1756 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1759 // --- Place the larger ribs into their mother (IDV2)
1762 // --- Right ribs (just a matter of convention)
1764 xpos = .65 - dbox2[0] + dits[0];
1770 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1774 ypos = dsup[1] + 2.81 + dal1[1];
1775 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1779 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1780 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1784 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1785 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1787 // --- Silicon (chip)
1789 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1790 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1794 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1795 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1799 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1800 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1802 // --- Right ribs (just a matter of convention)
1807 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1811 ypos = -(dsup[1] + 2.81 + dal1[1]);
1812 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1816 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1817 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1821 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1822 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1824 // --- Silicon (chip)
1826 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1827 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1831 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1832 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1836 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1837 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1839 // --- Place the end-ladder stuff into its mother (IDV1)
1842 // --- Negative-Z end-ladder
1845 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1849 xpos = dbox2[0] - dpcb[0];
1850 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1854 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1855 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1859 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1860 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1862 // --- Silicon (bus)
1864 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1865 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1867 // --- Positive-Z end-ladder
1870 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1874 xpos = dbox2[0] - dpcb[0];
1875 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1879 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1880 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1884 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1885 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1887 // --- Silicon (bus)
1889 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1890 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1892 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1893 // mother volume (IT34)
1894 // Odd elements have large ribs and even elements have small ribs
1896 for (i = 1; i <= 12; ++i) {
1897 atheta = (i-1) * 30.;
1898 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1901 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1902 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1904 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1907 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1908 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1910 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1917 // GOTO 4567 ! skip ITS layer no. 4
1919 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1920 // smaller lenght of ribs) and fill it with air or vacuum
1922 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1924 // the widest element is the end-ladder stuff
1925 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1926 // 7.5 cm is the lenght
1927 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1929 // --- Make the ghost volume invisible
1931 gMC->Gsatt("IDV3", "SEEN", 0);
1933 // --- Define a volume containing the sensitive part of drifts
1934 // (silicon, layer #4)
1937 // see material budget report by G. Feofilov
1940 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1942 //--- Define the part of the (smaller) rib between two sensitive parts made of
1943 // carbon (layer #4)
1945 dsup[0] = .5 - dits[0];
1947 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1948 // 7.5 cm is the lengh
1949 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1951 //--- Define the first part of the (smaller) rib between two sensitive parts
1952 // made of aluminum (layer #4)
1954 dal1[0] = .5 - dits[0];
1955 dal1[1] = 0.00096/2.;
1956 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1957 // 7.5 cm is the lengh
1958 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1960 //--- Define the part of the (smaller) rib between two sensitive parts made of
1961 // kapton (layer #4)
1963 dkap[0] = .5 - dits[0];
1964 dkap[1] = 0.0317/2.;
1965 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1966 // 7.5 cm is the lengh
1967 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1969 //--- Define the second part of the (smaller) rib between two sensitive parts
1970 // made of aluminum (layer #4)
1972 dal2[0] = .5 - dits[0];
1973 dal2[1] = 0.0027/2.;
1974 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1975 // 7.5 cm is the lengh
1976 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1978 // --- Define the part of the (smaller) rib between two sensitive parts
1979 // made of silicon (the electronics) (layer #4)
1981 dchi[0] = .5 - dits[0];
1982 dchi[1] = 0.0071/2.;
1983 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1984 // 7.5 cm is the lengh
1985 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1987 // --- Define the part of the (smaller) rib between two sensitive parts
1988 // made of water (the cooler) (layer #4)
1990 dwat[0] = .5 - dits[0];
1991 dwat[1] = 0.0093/2.;
1992 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1993 // 7.5 cm is the lenght
1994 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1996 //--- Define the third part of the (smaller) rib between two sensitive parts
1997 // made of aluminum (the cooling tubes) (layer #4)
1999 dtub[0] = .5 - dits[0];
2000 dtub[1] = 0.00134/2.;
2001 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2002 // 7.5 cm is the lengh
2003 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
2005 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
2008 // twice the foreseen thickness
2011 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
2013 // --- Define the part of the end-ladder stuff made of copper (layer #4)
2016 // twice the foreseen thickness
2019 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
2021 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
2024 // twice the foreseen thickness
2027 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
2029 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
2032 // twice the foreseen thickness
2035 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
2037 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2041 for (j = 1; j <= 7; ++j) {
2042 // odd elements are down and even elements are up
2044 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2045 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2046 } else if (j == 2) {
2047 xpos = -dbox1[0] + dits[0];
2048 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2049 } else if (j == 3) {
2050 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2051 zpos = 0. - dits[2] + .7 - dits[2];
2052 } else if (j == 4) {
2053 xpos = -dbox1[0] + dits[0];
2055 } else if (j == 5) {
2056 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2057 zpos = dits[2] + 0. - .7 + dits[2];
2058 } else if (j == 6) {
2059 xpos = -dbox1[0] + dits[0];
2060 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2061 } else if (j == 7) {
2062 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2063 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2065 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2068 // --- Place the smaller ribs into their mother (IDV3)
2070 // --- Right ribs (just a matter of convention)
2072 xpos = .5 - dbox1[0] + dits[0];
2078 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2082 ypos = dsup[1] + 2.81 + dal1[1];
2083 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2087 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2088 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2092 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2093 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2095 // --- Silicon (chip)
2097 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2098 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2102 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2103 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2107 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2109 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2111 // --- Right ribs (just a matter of convention)
2116 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2120 ypos = -(dsup[1] + 2.81 + dal1[1]);
2121 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2125 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2126 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2130 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2132 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2134 // --- Silicon (chip)
2136 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2137 2. + dal2[1] * 2. + dchi[1]);
2138 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2142 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2143 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2144 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2148 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2149 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2151 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2153 // --- Place the end-ladder stuff into its mother (IDV1)
2156 // --- Negative-Z end-ladder
2159 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2163 xpos = dbox1[0] - dpcb[0];
2164 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2168 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2169 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2173 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2174 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2176 // --- Silicon (bus)
2178 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2179 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2181 // --- Positive-Z end-ladder
2184 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2188 xpos = dbox1[0] - dpcb[0];
2189 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2193 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2194 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2198 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2199 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2201 // --- Silicon (bus)
2203 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2204 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2206 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2207 // larger lenght of ribs) and fill it with air or vacuum
2209 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2211 // the widest element is the end-ladder stuff
2212 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2213 // 7.5 cm is the lenght
2214 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2216 // --- Make the ghost volume invisible
2218 gMC->Gsatt("IDV4", "SEEN", 0);
2220 //--- Define the part of the (larger) rib between two sensitive parts madeof
2221 // carbon (layer #4)
2223 dsup[0] = .65 - dits[0];
2225 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2226 // 7.5 cm is the lengh
2227 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2229 //--- Define the first part of the (larger) rib between two sensitive parts
2230 // made of aluminum (layer #4)
2232 dal1[0] = .65 - dits[0];
2233 dal1[1] = 0.00096/2.;
2234 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2235 // 7.5 cm is the lengh
2236 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2238 //--- Define the part of the (larger) rib between two sensitive parts madeof
2239 // kapton (layer #4)
2241 dkap[0] = .65 - dits[0];
2242 dkap[1] = 0.0317/2.;
2243 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2244 // 7.5 cm is the lengh
2245 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2247 //--- Define the second part of the (larger) rib between two sensitive parts
2248 // made of aluminum (layer #4)
2250 dal2[0] = .65 - dits[0];
2251 dal2[1] = 0.0027/2.;
2252 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2253 // 7.5 cm is the lengh
2254 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2256 // --- Define the part of the (larger) rib between two sensitive parts
2257 // made of silicon (the electronics) (layer #4)
2259 dchi[0] = .65 - dits[0];
2260 dchi[1] = 0.0071/2.;
2261 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2262 // 7.5 cm is the lengh
2263 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2265 // --- Define the part of the (larger) rib between two sensitive parts
2266 // made of water (the cooler) (layer #4)
2268 dwat[0] = .65 - dits[0];
2269 dwat[1] = 0.0093/2.;
2270 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2271 // 7.5 cm is the lengh
2272 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2274 //--- Define the third part of the (larger) rib between two sensitive parts
2275 // made of aluminum (the cooling tubes) (layer #4)
2277 dtub[0] = .65 - dits[0];
2278 dtub[1] = 0.00134/2.;
2279 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2280 // 7.5 cm is the lengh
2281 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2283 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2287 for (j = 1; j <= 7; ++j) {
2288 // odd elements are down and even elements are up
2290 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2291 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2292 } else if (j == 2) {
2293 xpos = -dbox2[0] + dits[0];
2294 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2295 } else if (j == 3) {
2296 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2297 zpos = 0. - dits[2] + .7 - dits[2];
2298 } else if (j == 4) {
2299 xpos = -dbox2[0] + dits[0];
2301 } else if (j == 5) {
2302 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2303 zpos = dits[2] + 0. - .7 + dits[2];
2304 } else if (j == 6) {
2305 xpos = -dbox2[0] + dits[0];
2306 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2307 } else if (j == 7) {
2308 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2309 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2311 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2314 // --- Place the larger ribs into their mother (IDV4)
2317 // --- Right ribs (just a matter of convention)
2319 xpos = .65 - dbox2[0] + dits[0];
2325 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2329 ypos = dsup[1] + 2.81 + dal1[1];
2330 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2334 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2335 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2339 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2340 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2342 // --- Silicon (chip)
2344 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2345 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2349 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2350 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2354 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2356 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2358 // --- Right ribs (just a matter of convention)
2363 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2367 ypos = -(dsup[1] + 2.81 + dal1[1]);
2368 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2372 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2373 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2377 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2379 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2381 // --- Silicon (chip)
2383 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2384 2. + dal2[1] * 2. + dchi[1]);
2385 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2389 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2390 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2391 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2395 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2396 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2397 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2399 // --- Place the end-ladder stuff into its mother (IDV1)
2402 // --- Negative-Z end-ladder
2405 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2409 xpos = dbox2[0] - dpcb[0];
2410 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2414 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2415 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2419 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2420 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2422 // --- Silicon (bus)
2424 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2425 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2427 // --- Positive-Z end-ladder
2430 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2434 xpos = dbox2[0] - dpcb[0];
2435 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2439 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2440 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2444 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2445 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2447 // --- Silicon (bus)
2449 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2450 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2452 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2453 // mother volume (IT34)
2454 // Odd elements have large ribs and even elements have small ribs
2456 for (i = 1; i <= 24; ++i) {
2457 atheta = (i-1) * 15.;
2458 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2461 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2462 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2464 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2466 rzero = (24.0+22.8)/2.;
2467 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2468 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2470 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2474 //************************************************************************
2479 //************************************************************************
2481 // --- Define SSD with the 35+39 lay-out
2483 if (fMinorVersion < 3) {
2485 //--- Define ghost volume containing the Strip Detectors and fill it with air
2488 xxm = (49.999-3.)/(70.-25.);
2492 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2493 (37.-27)/xxm-(49.998-37.)/xxm;
2496 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2500 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2504 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2505 (37.-27)/xxm+(49.998-37.)/xxm;
2508 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2509 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2510 gMC->Gsatt("IT56", "SEEN", 0);
2514 // GOTO 5678 ! skip ITS layer no. 5
2516 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2517 // it with air or vacuum
2519 dbox1[0] = (0.0600+2.*0.0150)/2.;
2521 dbox1[2] = 90.22/2.;
2522 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2524 // --- Make the ghost volume invisible
2526 gMC->Gsatt("ISV1", "SEEN", 0);
2528 // --- Define a ghost volume containing the electronics and cooling of
2529 // a single ladder of layer #5 and fill it with air or vacuum
2531 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2534 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2536 // --- Make the ghost volume invisible
2538 gMC->Gsatt("SSV1", "SEEN", 0);
2540 // --- Define a ghost volume containing the end-ladder stuff of
2541 // a single ladder of layer #5 and fill it with air or vacuum
2546 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2548 // --- Make the ghost volume invisible
2550 gMC->Gsatt("ELL5", "SEEN", 0);
2552 // --- Define a volume containing the sensitive part of the strips
2553 // (silicon, layer #5)
2558 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2560 // --- Define a volume containing the electronics of the strips
2561 // (silicon, layer #5)
2566 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2568 // --- Define the cooling tubes (aluminum, layer #5)
2571 dtub[1] = dtub[0] + .01;
2573 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2575 // --- Define the cooling fluid (water or freon, layer #5)
2580 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2581 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2583 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2591 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2592 dfra[6] = dfra[5] + .03;
2596 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2598 // --- Define the element connecting the triangles of the heat bridge
2599 // (carbon, layer #5)
2604 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2606 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2609 dpla[0] = (10./(8.*7.))/2.;
2612 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2614 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2616 dcop[0] = (2./(8.*7.))/2.;
2619 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2621 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2623 depx[0] = (30./(8.*7.))/2.;
2626 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2628 // --- Define the part of the end-ladder stuff made of silicon (bus)
2631 dsil[0] = (20./(8.*7.))/2.;
2634 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2636 // --- Place the end-ladder stuff into its mother (ELL5)
2638 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2644 xpos = -dela[0] + dpla[0];
2645 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2649 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2650 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2654 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2655 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2657 // --- Silicon (bus)
2659 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2660 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2662 // --- Place the sensitive part of the strips into its mother (ISV1)
2665 for (j = 1; j <= 23; ++j) {
2666 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2667 else xpos = -dbox1[0] + dits[0];
2668 zpos = ((j - 1) - 11.) * 3.91;
2669 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2672 // --- Place the electronics of the strips into its mother (SSV1)
2675 for (j = 1; j <= 23; ++j) {
2676 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2677 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2678 zpos = ((j - 1) - 11.) * 3.91 + .85;
2679 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2682 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2684 xpos = -dsrv[0] + .41;
2687 // --- Left tube (just a matter of convention)
2690 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2691 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2693 // --- Right tube (just a matter of convention)
2696 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2697 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2699 // --- Place the heat bridge elements into their mother (SSV1)
2701 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2703 for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2704 // volume SSV1. This is the same number of
2705 // elements as SCH5 above. Done Bjorn S. Nilsen
2706 // April 4 2000. Error found by Ivana
2707 // Hrivnacova March 29 2000.
2708 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2709 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2712 // --- Place the elements connecting the triangles of the heat bridge
2713 // into their mother (SSV1)
2717 // --- Left element (just a matter of convention)
2719 xpos = -dsrv[0] + .47;
2720 ypos = -(2.1+0.015);
2721 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2723 // --- Right element
2725 xpos = -dsrv[0] + .47;
2727 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2731 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2733 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2735 // --- Place the ghost volumes containing the strip ladders (ISV1),
2736 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2737 // their mother volume (IT56)
2739 offset1 = TMath::ATan2(.9, 40.);
2741 rzero = dbox1[0] + 40.;
2742 runo = dbox1[0] * 2. + 40. + dsrv[0];
2743 rtwo = dbox1[0] * 2. + 40. + dela[0];
2744 for (i = 1; i <= 35; ++i) {
2745 atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
2746 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2748 // --- Strip ladders
2750 xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2751 ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2753 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2755 // --- Electronics/cooling
2757 xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2758 ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2760 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2762 // --- End-ladders (nagative-Z and positive-Z)
2764 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2765 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2766 zpos = -(dbox1[2] + dela[2] + 6.);
2767 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2768 zpos = dbox1[2] + dela[2] + 6.;
2769 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2775 // GOTO 5778 ! skip ITS layer no. 6
2777 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2778 // it with air or vacuum
2780 dbox2[0] = (0.0600+2.*0.0150)/2.;
2782 dbox2[2] = 101.95/2.;
2783 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2785 // --- Make the ghost volume invisible
2787 gMC->Gsatt("ISV2", "SEEN", 0);
2789 // --- Define a ghost volume containing the electronics and cooling of
2790 // a single ladder of layer #6 and fill it with air or vacuum
2792 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2794 dsrv[2] = 101.95/2.;
2795 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2797 // --- Make the ghost volume invisible
2799 gMC->Gsatt("SSV2", "SEEN", 0);
2801 // --- Define a ghost volume containing the end-ladder stuff of
2802 // a single ladder of layer #6 and fill it with air or vacuum
2807 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2809 // --- Make the ghost volume invisible
2811 gMC->Gsatt("ELL6", "SEEN", 0);
2813 // --- Define a volume containing the sensitive part of the strips
2814 // (silicon, layer #6)
2819 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2821 // --- Define a volume containing the electronics of the strips
2822 // (silicon, layer #6)
2827 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2829 // --- Define the cooling tubes (aluminum, layer #6)
2832 dtub[1] = dtub[0] + .01;
2833 dtub[2] = 101.95/2.;
2834 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2836 // --- Define the cooling fluid (water or freon, layer #6)
2840 dwat[2] = 101.95/2.;
2841 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2842 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2844 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2852 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2853 dfra[6] = dfra[5] + .03;
2857 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2859 // --- Define the element connecting the triangles of the heat bridge
2860 // (carbon, layer #6)
2864 dcei[2] = 101.95/2.;
2865 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2867 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2870 dpla[0] = (10./(8.*7.))/2.;
2873 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2875 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2877 dcop[0] = (2./(8.*7.))/2.;
2880 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2882 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2884 depx[0] = (30./(8.*7.))/2.;
2887 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2889 // --- Define the part of the end-ladder stuff made of silicon (bus)
2892 dsil[0] = (20./(8.*7.))/2.;
2895 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2897 // --- Place the end-ladder stuff into its mother (ELL5)
2899 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2905 xpos = -dela[0] + dpla[0];
2906 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2910 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2911 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2915 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2916 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2918 // --- Silicon (bus)
2920 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2921 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2923 // --- Place the sensitive part of the strips into its mother (ISV2)
2926 for (j = 1; j <= 26; ++j) {
2927 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2928 else xpos = -dbox2[0] + dits[0];
2929 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2930 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2933 // --- Place the electronics of the strips into its mother (SSV2)
2936 for (j = 1; j <= 26; ++j) {
2937 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2938 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2939 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2940 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2943 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2945 xpos = -dsrv[0] + .41;
2948 // --- Left tube (just a matter of convention)
2951 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2952 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2954 // --- Right tube (just a matter of convention)
2957 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2958 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2960 // --- Place the heat bridge elements into their mother (SSV2)
2962 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2964 for (j = 1; j <= 27; ++j) {
2965 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2966 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2969 // --- Place the elements connecting the triangles of the heat bridge
2970 // into their mother (SSV2)
2974 // --- Left element (just a matter of convention)
2976 xpos = -dsrv[0] + .47;
2977 ypos = -(2.1+0.015);
2978 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2980 // --- Right element
2982 xpos = -dsrv[0] + .47;
2984 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2988 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2990 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2992 // --- Place the ghost volumes containing the strip ladders (ISV2),
2993 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2994 // their mother volume (IT56)
2996 offset1 = TMath::ATan2(1., 45.);
2998 rzero = dbox2[0] + 45.;
2999 runo = dbox2[0] * 2. + 45. + dsrv[0];
3000 rtwo = dbox2[0] * 2. + 45. + dela[0];
3001 for (i = 1; i <= 39; ++i) {
3002 atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
3003 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3005 // --- Strip ladders
3007 xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3008 ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3010 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3012 // --- Electronics/cooling
3014 xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3015 ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3017 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3019 // --- End-ladders (nagative-Z and positive-Z)
3021 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3022 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3023 zpos = -(dbox2[2] + dela[2] + 6.);
3024 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3025 zpos = dbox2[2] + dela[2] + 6.;
3026 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3031 // --- Define SSD with the 32+36 lay-out
3033 if (fMinorVersion >2 && fMinorVersion < 6) {
3035 //--- Define ghost volume containing the Strip Detectors and fill it with air
3038 xxm = (49.999-3.)/(70.-25.);
3042 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
3043 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3046 dgh[6] = -25. - (9.-3.01) / xxm -
3047 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3050 dgh[9] = (9.-3.01) / xxm + 25. +
3051 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3054 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3055 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3058 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3059 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3060 gMC->Gsatt("IT56", "SEEN", 0);
3064 // GOTO 6678 ! skip ITS layer no. 5
3066 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3067 // it with air or vacuum
3069 dbox1[0] = (0.0600+2.*0.0150)/2.;
3071 dbox1[2] = 86.31/2.;
3072 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3074 // --- Make the ghost volume invisible
3076 gMC->Gsatt("ISV1", "SEEN", 0);
3078 // --- Define a ghost volume containing the electronics and cooling of
3079 // a single ladder of layer #5 and fill it with air or vacuum
3081 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3084 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3086 // --- Make the ghost volume invisible
3088 gMC->Gsatt("SSV1", "SEEN", 0);
3090 // --- Define a ghost volume containing the end-ladder stuff of
3091 // a single ladder of layer #5 and fill it with air or vacuum
3096 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3098 // --- Make the ghost volume invisible
3100 gMC->Gsatt("ELL5", "SEEN", 0);
3102 // --- Define a volume containing the sensitive part of the strips
3103 // (silicon, layer #5)
3108 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3110 // --- Define a volume containing the electronics of the strips
3111 // (silicon, layer #5)
3116 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3118 // --- Define the cooling tubes (aluminum, layer #5)
3121 dtub[1] = dtub[0] + .01;
3123 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3125 // --- Define the cooling fluid (water or freon, layer #5)
3130 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3131 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3133 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3141 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3142 dfra[6] = dfra[5] + .03;
3146 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3148 // --- Define the element connecting the triangles of the heat bridge
3149 // (carbon, layer #5)
3154 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3156 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3159 dpla[0] = (10./(8.*7.))/2;
3162 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3164 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3166 dcop[0] = (2./(8.*7.))/2;
3169 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3171 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3173 depx[0] = (30./(8.*7.))/2.;
3176 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3178 // --- Define the part of the end-ladder stuff made of silicon (bus)
3181 dsil[0] = (20./(8.*7.))/2.;
3184 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3186 // --- Place the end-ladder stuff into its mother (ELL5)
3188 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3194 xpos = -dela[0] + dpla[0];
3195 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3199 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3200 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3204 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3205 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3207 // --- Silicon (bus)
3209 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3210 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3212 // --- Place the sensitive part of the strips into its mother (ISV1)
3215 for (j = 1; j <= 22; ++j) {
3216 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3217 else xpos = -dbox1[0] + dits[0];
3218 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3219 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3222 // --- Place the electronics of the strips into its mother (SSV1)
3225 for (j = 1; j <= 22; ++j) {
3226 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3227 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3228 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3229 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3232 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3234 xpos = -dsrv[0] + .41;
3237 // --- Left tube (just a matter of convention)
3240 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3241 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3243 // --- Right tube (just a matter of convention)
3246 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3247 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3249 // --- Place the heat bridge elements into their mother (SSV1)
3251 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3253 for (j = 1; j <= 23; ++j) {
3254 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3255 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3258 // --- Place the elements connecting the triangles of the heat bridge
3259 // into their mother (SSV1)
3263 // --- Left element (just a matter of convention)
3265 xpos = -dsrv[0] + .47;
3266 ypos = -(2.1+0.015);
3267 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3269 // --- Right element
3271 xpos = -dsrv[0] + .47;
3273 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3277 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3279 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3281 // --- Place the ghost volumes containing the strip ladders (ISV1),
3282 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3283 // their mother volume (IT56)
3285 offset1 = TMath::ATan2(.8, 36.6);
3287 rzero = dbox1[0] + 36.6;
3288 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3289 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3290 for (i = 1; i <= 32; ++i) {
3291 atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
3292 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3294 // --- Strip ladders
3296 xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3297 ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3299 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3301 // --- Electronics/cooling
3303 xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3304 ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3306 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3308 // --- End-ladders (nagative-Z and positive-Z)
3310 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3311 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3312 zpos = -(dbox1[2] + dela[2] + 6.);
3313 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3314 zpos = dbox1[2] + dela[2] + 6.;
3315 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3321 // GOTO 6778 ! skip ITS layer no. 6
3323 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3324 // it with air or vacuum
3326 dbox2[0] = (0.0600+2.*0.0150)/2.;
3328 dbox2[2] = 94.13/2.;
3329 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3331 // --- Make the ghost volume invisible
3333 gMC->Gsatt("ISV2", "SEEN", 0);
3335 // --- Define a ghost volume containing the electronics and cooling of
3336 // a single ladder of layer #6 and fill it with air or vacuum
3338 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3341 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3343 // --- Make the ghost volume invisible
3345 gMC->Gsatt("SSV2", "SEEN", 0);
3347 // --- Define a ghost volume containing the end-ladder stuff of
3348 // a single ladder of layer #6 and fill it with air or vacuum
3353 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3355 // --- Make the ghost volume invisible
3357 gMC->Gsatt("ELL6", "SEEN", 0);
3359 // --- Define a volume containing the sensitive part of the strips
3360 // (silicon, layer #6)
3365 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3367 // --- Define a volume containing the electronics of the strips
3368 // (silicon, layer #6)
3373 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3375 // --- Define the cooling tubes (aluminum, layer #6)
3378 dtub[1] = dtub[0] + .01;
3380 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3382 // --- Define the cooling fluid (water or freon, layer #6)
3387 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3388 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3390 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3398 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3399 dfra[6] = dfra[5] + .03;
3403 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3405 // --- Define the element connecting the triangles of the heat bridge
3406 // (carbon, layer #6)
3411 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3413 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3416 dpla[0] = (10./(8.*7.))/2;
3419 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3421 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3423 dcop[0] = (2./(8.*7.))/2;
3426 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3428 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3430 depx[0] = (30./(8.*7.))/2.;
3433 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3435 // --- Define the part of the end-ladder stuff made of silicon (bus)
3438 dsil[0] = (20./(8.*7.))/2.;
3441 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3443 // --- Place the end-ladder stuff into its mother (ELL5)
3445 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3451 xpos = -dela[0] + dpla[0];
3452 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3456 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3457 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3461 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3462 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3464 // --- Silicon (bus)
3466 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3467 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3469 // --- Place the sensitive part of the strips into its mother (ISV2)
3472 for (j = 1; j <= 24; ++j) {
3473 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3474 else xpos = dbox2[0] - dits[0];
3475 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3476 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3479 // --- Place the electronics of the strips into its mother (SSV2)
3482 for (j = 1; j <= 24; ++j) {
3483 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3484 else xpos = -dsrv[0] + .28;
3485 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3486 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3489 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3491 xpos = -dsrv[0] + .41;
3494 // --- Left tube (just a matter of convention)
3497 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3498 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3500 // --- Right tube (just a matter of convention)
3503 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3504 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3506 // --- Place the heat bridge elements into their mother (SSV2)
3508 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3510 for (j = 1; j <= 25; ++j) {
3511 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3512 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3515 // --- Place the elements connecting the triangles of the heat bridge
3516 // into their mother (SSV2)
3520 // --- Left element (just a matter of convention)
3522 xpos = -dsrv[0] + .47;
3523 ypos = -(2.1+0.015);
3524 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3526 // --- Right element
3528 xpos = -dsrv[0] + .47;
3530 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3534 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3536 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3538 // --- Place the ghost volumes containing the strip ladders (ISV2),
3539 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3540 // their mother volume (IT56)
3542 offset1 = TMath::ATan2(.9, 41.2);
3544 rzero = dbox2[0] + 41.2;
3545 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3546 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3547 for (i = 1; i <= 36; ++i) {
3548 atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
3549 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3551 // --- Strip ladders
3553 xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3554 ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3556 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3558 // --- Electronics/cooling
3560 xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3561 ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3563 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3565 // --- End-ladders (nagative-Z and positive-Z)
3567 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3568 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3569 zpos = -(dbox2[2] + dela[2] + 6.);
3570 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3571 zpos = dbox2[2] + dela[2] + 6.;
3572 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3578 //************************************************************************
3580 //* E N D - C A P S A N D F R A M E S *
3581 //* ========================================= *
3583 //************************************************************************
3585 // --- Define a dummy cylinder for multiple scattering tests
3587 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3590 // DITS(2)=DITS(1)+0.1
3592 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3593 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3596 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3598 // GOTO 8901 ! skip outer wall
3600 if (fMinorVersion == 0 || fMinorVersion == 3) {
3603 dits[1] = dits[0] + .06926;
3604 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3606 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3607 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3612 // --- The frame between the end-caps (octagonal lay-out) ---
3614 // GOTO 9012 ! skip octagonal frame
3616 if (fMinorVersion == 1) {
3621 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3624 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3626 offset = angle / 2.;
3627 for (i = 0; i < 8; ++i) {
3628 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3629 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3631 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3632 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3636 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;
3637 aphi2 = 180. - aphi1;
3638 xpos = (xtra[0] + xtra[1]) / 2.;
3639 ypos = (ytra[0] + ytra[1]) / 2.;
3640 zpos = dtra[2] / 2.;
3641 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3644 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3645 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3646 zpos = -dtra[2] / 2.;
3647 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3650 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3651 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3654 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;
3655 aphi1 = 180. - aphi2;
3656 xpos = (xtra[1] + xtra[2]) / 2.;
3657 ypos = (ytra[1] + ytra[2]) / 2.;
3658 zpos = dtra[2] / 2.;
3659 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3662 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3663 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3664 zpos = -dtra[2] / 2.;
3665 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3668 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3669 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3672 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;
3673 aphi2 = 180. - aphi1;
3674 xpos = (xtra[2] + xtra[3]) / 2.;
3675 ypos = (ytra[2] + ytra[3]) / 2.;
3676 zpos = dtra[2] / 2.;
3677 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3680 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3681 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3682 zpos = -dtra[2] / 2.;
3683 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3686 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3687 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3690 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;
3691 aphi1 = 180. - aphi2;
3692 xpos = (xtra[3] + xtra[4]) / 2.;
3693 ypos = (ytra[3] + ytra[4]) / 2.;
3694 zpos = dtra[2] / 2.;
3695 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3698 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3699 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3700 zpos = -dtra[2] / 2.;
3701 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3704 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3705 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3708 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;
3709 aphi1 = 180. - aphi2;
3710 xpos = (xtra[4] + xtra[5]) / 2.;
3711 ypos = (ytra[4] + ytra[5]) / 2.;
3712 zpos = dtra[2] / 2.;
3713 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3716 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3717 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3718 zpos = -dtra[2] / 2.;
3719 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3722 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3723 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3726 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;
3727 aphi2 = 180. - aphi1;
3728 xpos = (xtra[5] + xtra[6]) / 2.;
3729 ypos = (ytra[5] + ytra[6]) / 2.;
3730 zpos = dtra[2] / 2.;
3731 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3734 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3735 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3736 zpos = -dtra[2] / 2.;
3737 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3740 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3741 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3744 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;
3745 aphi1 = 180. - aphi2;
3746 xpos = (xtra[6] + xtra[7]) / 2.;
3747 ypos = (ytra[6] + ytra[7]) / 2.;
3748 zpos = dtra[2] / 2.;
3749 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3752 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3753 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3754 zpos = -dtra[2] / 2.;
3755 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3758 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3759 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3762 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;
3763 aphi2 = 180. - aphi1;
3764 xpos = (xtra[7] + xtra[0]) / 2.;
3765 ypos = (ytra[7] + ytra[0]) / 2.;
3766 zpos = dtra[2] / 2.;
3767 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3770 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3771 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3772 zpos = -dtra[2] / 2.;
3773 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3776 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3777 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3780 } else if (fMinorVersion == 4) {
3786 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3789 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3791 offset = angle / 2.;
3792 for (i = 0; i < 8; ++i) {
3793 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3794 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3796 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3797 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3801 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;
3802 aphi2 = 180. - aphi1;
3803 xpos = (xtra[0] + xtra[1]) / 2.;
3804 ypos = (ytra[0] + ytra[1]) / 2.;
3805 zpos = dtra[2] / 2.;
3806 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3809 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3810 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3811 zpos = -dtra[2] / 2.;
3812 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3815 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3816 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3819 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;
3820 aphi1 = 180. - aphi2;
3821 xpos = (xtra[1] + xtra[2]) / 2.;
3822 ypos = (ytra[1] + ytra[2]) / 2.;
3823 zpos = dtra[2] / 2.;
3824 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3827 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3828 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3829 zpos = -dtra[2] / 2.;
3830 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3833 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3834 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3837 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;
3838 aphi2 = 180. - aphi1;
3839 xpos = (xtra[2] + xtra[3]) / 2.;
3840 ypos = (ytra[2] + ytra[3]) / 2.;
3841 zpos = dtra[2] / 2.;
3842 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3845 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3846 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3847 zpos = -dtra[2] / 2.;
3848 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3851 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3852 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3855 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;
3856 aphi1 = 180. - aphi2;
3857 xpos = (xtra[3] + xtra[4]) / 2.;
3858 ypos = (ytra[3] + ytra[4]) / 2.;
3859 zpos = dtra[2] / 2.;
3860 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3863 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3864 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3865 zpos = -dtra[2] / 2.;
3866 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3869 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3870 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3873 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;
3874 aphi1 = 180. - aphi2;
3875 xpos = (xtra[4] + xtra[5]) / 2.;
3876 ypos = (ytra[4] + ytra[5]) / 2.;
3877 zpos = dtra[2] / 2.;
3878 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3881 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3882 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3883 zpos = -dtra[2] / 2.;
3884 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3887 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3888 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3891 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;
3892 aphi2 = 180. - aphi1;
3893 xpos = (xtra[5] + xtra[6]) / 2.;
3894 ypos = (ytra[5] + ytra[6]) / 2.;
3895 zpos = dtra[2] / 2.;
3896 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3899 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3900 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3901 zpos = -dtra[2] / 2.;
3902 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3905 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3906 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3909 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;
3910 aphi1 = 180. - aphi2;
3911 xpos = (xtra[6] + xtra[7]) / 2.;
3912 ypos = (ytra[6] + ytra[7]) / 2.;
3913 zpos = dtra[2] / 2.;
3914 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3917 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3918 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3919 zpos = -dtra[2] / 2.;
3920 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3923 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3924 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3927 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;
3928 aphi2 = 180. - aphi1;
3929 xpos = (xtra[7] + xtra[0]) / 2.;
3930 ypos = (ytra[7] + ytra[0]) / 2.;
3931 zpos = dtra[2] / 2.;
3932 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3935 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3936 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3937 zpos = -dtra[2] / 2.;
3938 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3941 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3942 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3948 // --- The frame between the end-caps (hexagonal lay-out) ---
3950 // GOTO 9123 ! skip hexagonal frame
3952 if (fMinorVersion == 2) {
3957 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3963 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3965 offset = angle / 2.;
3966 for (i = 0; i < 6; ++i) {
3967 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
3968 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
3970 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
3971 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3976 xpos = (xtra1[0] + xtra1[1]) / 2.;
3977 ypos = (ytra1[0] + ytra1[1]) / 2.;
3979 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
3982 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3983 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3987 xpos = (xtra1[1] + xtra1[2]) / 2.;
3988 ypos = (ytra1[1] + ytra1[2]) / 2.;
3990 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
3993 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3994 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3998 xpos = (xtra1[2] + xtra1[3]) / 2.;
3999 ypos = (ytra1[2] + ytra1[3]) / 2.;
4001 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4004 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4005 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4009 xpos = (xtra1[3] + xtra1[4]) / 2.;
4010 ypos = (ytra1[3] + ytra1[4]) / 2.;
4012 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4015 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4016 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4020 xpos = (xtra1[4] + xtra1[5]) / 2.;
4021 ypos = (ytra1[4] + ytra1[5]) / 2.;
4023 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4026 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4027 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4031 xpos = (xtra1[5] + xtra1[0]) / 2.;
4032 ypos = (ytra1[5] + ytra1[0]) / 2.;
4034 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4037 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4038 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4041 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4042 aphi1 = 180. - aphi2;
4043 xpos = (xtra1[0] + xtra1[1]) / 2.;
4044 ypos = (ytra1[0] + ytra1[1]) / 2.;
4045 zpos = dtra2[2] / 2.;
4046 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4049 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4050 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4051 zpos = -dtra2[2] / 2.;
4052 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4055 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4056 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4059 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4060 aphi2 = 180. - aphi1;
4061 xpos = (xtra1[1] + xtra1[2]) / 2.;
4062 ypos = (ytra1[1] + ytra1[2]) / 2.;
4063 zpos = dtra2[2] / 2.;
4064 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4067 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4068 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4069 zpos = -dtra2[2] / 2.;
4070 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4073 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4074 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4077 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4078 aphi1 = 180. - aphi2;
4079 xpos = (xtra1[2] + xtra1[3]) / 2.;
4080 ypos = (ytra1[2] + ytra1[3]) / 2.;
4081 zpos = dtra2[2] / 2.;
4082 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4085 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4086 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4087 zpos = -dtra2[2] / 2.;
4088 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4091 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4092 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4094 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))
4095 - 50.*50.))) * kraddeg;
4096 aphi2 = 180. - aphi1;
4097 xpos = (xtra1[2] + xtra1[3]) / 2.;
4098 ypos = (ytra1[2] + ytra1[3]) / 2.;
4099 zpos = dtra2[2] / 2.;
4100 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4103 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4104 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4105 zpos = -dtra2[2] / 2.;
4106 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4109 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4110 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4113 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4114 aphi1 = 180. - aphi2;
4115 xpos = (xtra1[3] + xtra1[4]) / 2.;
4116 ypos = (ytra1[3] + ytra1[4]) / 2.;
4117 zpos = dtra2[2] / 2.;
4118 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4121 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4122 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4123 zpos = -dtra2[2] / 2.;
4124 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4127 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4128 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4131 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4132 aphi2 = 180. - aphi1;
4133 xpos = (xtra1[4] + xtra1[5]) / 2.;
4134 ypos = (ytra1[4] + ytra1[5]) / 2.;
4135 zpos = dtra2[2] / 2.;
4136 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4139 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4140 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4141 zpos = -dtra2[2] / 2.;
4142 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4145 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4146 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4149 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4150 aphi1 = 180. - aphi2;
4151 xpos = (xtra1[5] + xtra1[0]) / 2.;
4152 ypos = (ytra1[5] + ytra1[0]) / 2.;
4153 zpos = dtra2[2] / 2.;
4154 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4157 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4158 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4159 zpos = -dtra2[2] / 2.;
4160 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4163 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4164 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4166 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4167 aphi2 = 180. - aphi1;
4168 xpos = (xtra1[5] + xtra1[0]) / 2.;
4169 ypos = (ytra1[5] + ytra1[0]) / 2.;
4170 zpos = dtra2[2] / 2.;
4171 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4174 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4175 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4176 zpos = -dtra2[2] / 2.;
4177 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4180 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4181 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4184 } else if (fMinorVersion == 5) {
4190 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4196 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4198 offset = angle / 2.;
4199 for (i = 0; i < 6; ++i) {
4200 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
4201 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
4203 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
4204 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4209 xpos = (xtra1[0] + xtra1[1]) / 2.;
4210 ypos = (ytra1[0] + ytra1[1]) / 2.;
4212 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
4215 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4216 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4220 xpos = (xtra1[1] + xtra1[2]) / 2.;
4221 ypos = (ytra1[1] + ytra1[2]) / 2.;
4223 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4226 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4227 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4231 xpos = (xtra1[2] + xtra1[3]) / 2.;
4232 ypos = (ytra1[2] + ytra1[3]) / 2.;
4234 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4237 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4238 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4242 xpos = (xtra1[3] + xtra1[4]) / 2.;
4243 ypos = (ytra1[3] + ytra1[4]) / 2.;
4245 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4248 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4249 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4253 xpos = (xtra1[4] + xtra1[5]) / 2.;
4254 ypos = (ytra1[4] + ytra1[5]) / 2.;
4256 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4259 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4260 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4264 xpos = (xtra1[5] + xtra1[0]) / 2.;
4265 ypos = (ytra1[5] + ytra1[0]) / 2.;
4267 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4270 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4271 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4274 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4275 aphi1 = 180. - aphi2;
4276 xpos = (xtra1[0] + xtra1[1]) / 2.;
4277 ypos = (ytra1[0] + ytra1[1]) / 2.;
4278 zpos = dtra2[2] / 2.;
4279 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4282 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4283 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4284 zpos = -dtra2[2] / 2.;
4285 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4288 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4289 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4292 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4293 aphi2 = 180. - aphi1;
4294 xpos = (xtra1[1] + xtra1[2]) / 2.;
4295 ypos = (ytra1[1] + ytra1[2]) / 2.;
4296 zpos = dtra2[2] / 2.;
4297 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4300 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4301 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4302 zpos = -dtra2[2] / 2.;
4303 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4306 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4307 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4310 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4311 aphi1 = 180. - aphi2;
4312 xpos = (xtra1[2] + xtra1[3]) / 2.;
4313 ypos = (ytra1[2] + ytra1[3]) / 2.;
4314 zpos = dtra2[2] / 2.;
4315 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4318 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4319 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4320 zpos = -dtra2[2] / 2.;
4321 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4324 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4325 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4327 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4328 aphi2 = 180. - aphi1;
4329 xpos = (xtra1[2] + xtra1[3]) / 2.;
4330 ypos = (ytra1[2] + ytra1[3]) / 2.;
4331 zpos = dtra2[2] / 2.;
4332 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4335 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4336 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4337 zpos = -dtra2[2] / 2.;
4338 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4341 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4342 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4345 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4346 aphi1 = 180. - aphi2;
4347 xpos = (xtra1[3] + xtra1[4]) / 2.;
4348 ypos = (ytra1[3] + ytra1[4]) / 2.;
4349 zpos = dtra2[2] / 2.;
4350 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4353 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4354 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4355 zpos = -dtra2[2] / 2.;
4356 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4359 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4360 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4363 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4364 aphi2 = 180. - aphi1;
4365 xpos = (xtra1[4] + xtra1[5]) / 2.;
4366 ypos = (ytra1[4] + ytra1[5]) / 2.;
4367 zpos = dtra2[2] / 2.;
4368 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4371 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4372 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4373 zpos = -dtra2[2] / 2.;
4374 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4377 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4378 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4381 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4382 aphi1 = 180. - aphi2;
4383 xpos = (xtra1[5] + xtra1[0]) / 2.;
4384 ypos = (ytra1[5] + ytra1[0]) / 2.;
4385 zpos = dtra2[2] / 2.;
4386 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4389 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4390 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4391 zpos = -dtra2[2] / 2.;
4392 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4395 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4396 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4398 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4399 aphi2 = 180. - aphi1;
4400 xpos = (xtra1[5] + xtra1[0]) / 2.;
4401 ypos = (ytra1[5] + ytra1[0]) / 2.;
4402 zpos = dtra2[2] / 2.;
4403 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4406 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4407 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4408 zpos = -dtra2[2] / 2.;
4409 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4412 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4413 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4419 // --- Define the end-caps
4421 // GOTO 9234 ! skip both end-caps
4423 // --- Define the Z>0 end-cap
4425 // GOTO 9345 ! skip the Z>0 end-cap
4430 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4431 dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4434 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4435 // end-ladder electro
4436 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4437 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4439 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4441 // In the Simonetti's drawings 52. In the TP 50.
4445 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4446 // end-ladder electro
4447 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4448 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4452 dtube[2] = 26.8/2./10.;
4455 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4457 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4458 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4464 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4465 // end-ladder electron
4468 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4469 // end-ladder electronics
4475 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4476 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4482 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4486 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4493 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4494 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4496 if (fMinorVersion < 3 ) {
4498 dpgon[0] = offset2 + 360./(2.*35.);
4502 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4506 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4513 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4514 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4516 dpgon[0] = offset2 + 360./(2.*39.);
4520 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4524 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4531 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4532 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4534 if (fMinorVersion > 2 && fMinorVersion < 6) {
4536 dpgon[0] = offset2 + 5.625;
4540 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4541 // end-ladder electronics
4544 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4545 // end-ladder electr
4551 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4552 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4554 dpgon[0] = offset2 + 5.;
4558 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4559 // end-ladder electronics
4562 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4563 // end-ladder electr
4569 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4570 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4575 // --- Define the Z<0 end-cap
4577 // GOTO 9456 ! skip the Z<0 end-cap
4580 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4581 dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4586 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4587 // end-ladder electr
4588 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4590 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4592 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4594 // In the Simonetti's drawings 52. In the TP 50.
4598 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4599 // end-ladder electr
4600 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4602 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4606 dtube[2] = 26.8/2./10.;
4609 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4611 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4613 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4619 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4620 // end-ladder electronics
4623 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4624 // end-ladder electro
4630 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4631 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4637 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4641 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4648 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4649 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4651 if (fMinorVersion < 3) {
4653 dpgon[0] = offset2 + 360./(2.*35.);
4657 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4661 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4668 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4669 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4671 dpgon[0] = offset2 + 360./(2.*39.);
4675 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4679 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4686 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4687 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4689 if (fMinorVersion > 2 && fMinorVersion < 6) {
4691 dpgon[0] = offset2 + 5.625;
4695 dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4696 // end-ladder electronics
4699 dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4700 // end-ladder electr
4706 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4707 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4709 dpgon[0] = offset2 + 5.;
4713 dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4714 // end-ladder electronics
4717 dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4718 // end-ladder electr
4724 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4725 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4731 // --- Outputs the geometry tree in the EUCLID/CAD format
4734 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4737 //_____________________________________________________________________________
4738 void AliITSv3::CreateMaterials(){
4739 ////////////////////////////////////////////////////////////////////////
4741 // Create ITS materials
4742 // This function defines the default materials used in the Geant
4743 // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
4744 // In general it is automatically replaced by
4745 // the CreatMaterials routine defined in AliITSv?. Should the function
4746 // CreateMaterials not exist for the geometry version you are using this
4747 // one is used. See the definition found in AliITSv5 or the other routine
4748 // for a complete definition.
4751 Float_t awat[2] = { 1.00794,15.9994 };
4752 Float_t zwat[2] = { 1.,8. };
4753 Float_t wwat[2] = { 2.,1. };
4754 Float_t denswat = 1.;
4756 Float_t afre[2] = { 12.011,18.9984032 };
4757 Float_t zfre[2] = { 6.,9. };
4758 Float_t wfre[2] = { 5.,12. };
4759 Float_t densfre = 1.5;
4761 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4762 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4763 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4764 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4765 Float_t denscer = 3.6;
4767 // 60% SiO2 , 40% G10FR4
4769 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4770 Float_t zpcb[3] = { 14.,8.,8.875 };
4771 Float_t wpcb[3] = { .28,.32,.4 };
4772 Float_t denspcb = 1.8;
4774 Float_t apoly[2] = { 12.01,1. };
4775 Float_t zpoly[2] = { 6.,1. };
4776 Float_t wpoly[2] = { .33,.67 };
4778 Float_t zserv[4] = { 1.,6.,26.,29. };
4779 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4780 Float_t wserv[4] = { .014,.086,.42,.48 };
4782 Int_t isxfld = gAlice->Field()->Integ();
4783 Float_t sxmgmx = gAlice->Field()->Max();
4786 // --- Define the various materials for GEANT ---
4788 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4790 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4791 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4792 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4793 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4795 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4796 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4797 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4798 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4799 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4801 AliMedium(0, "SPD Si$", 0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4802 AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4803 AliMedium(2, "SPD Si bus$", 2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4804 AliMedium(3, "SPD C$", 3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4805 AliMedium(4, "SPD Air$", 4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4806 AliMedium(5, "SPD Vacuum$", 5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4807 AliMedium(6, "SPD Al$", 6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4808 AliMedium(7, "SPD Water $", 7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4809 AliMedium(8, "SPD Freon$", 8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4811 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4813 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4814 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4815 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4816 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4818 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4819 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4820 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4821 // After a call with ratios by number (negative number of elements),
4822 // the ratio array is changed to the ratio by weight, so all successive
4823 // calls with the same array must specify the number of elements as
4825 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4826 // After a call with ratios by number (negative number of elements),
4827 // the ratio array is changed to the ratio by weight, so all successive
4828 // calls with the same array must specify the number of elements as
4830 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4831 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4832 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4833 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4834 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4837 AliMedium(25, "SDD Si$", 25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4838 AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4839 AliMedium(27, "SDD Si bus$", 27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4840 AliMedium(28, "SDD C$", 28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4841 AliMedium(29, "SDD Air$", 29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4842 AliMedium(30, "SDD Vacuum$", 30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4843 AliMedium(31, "SDD Al$", 31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4844 AliMedium(32, "SDD Water $", 32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4845 AliMedium(33, "SDD Freon$", 33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4846 AliMedium(34, "SDD PCB$", 34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4847 AliMedium(35, "SDD Copper$", 35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4848 AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4849 AliMedium(37, "SDD Kapton$", 37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4851 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4853 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4854 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4855 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4856 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4858 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4859 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4860 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4861 // After a call with ratios by number (negative number of elements),
4862 // the ratio array is changed to the ratio by weight, so all successive
4863 // calls with the same array must specify the number of elements as
4865 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
4866 // After a call with ratios by number (negative number of elements),
4867 // the ratio array is changed to the ratio by weight, so all successive
4868 // calls with the same array must specify the number of elements as
4870 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4871 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4872 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4873 // After a call with ratios by number (negative number of elements),
4874 // the ratio array is changed to the ratio by weight, so all successive
4875 // calls with the same array must specify the number of elements as
4877 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4878 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4880 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4882 AliMedium(50, "SSD Si$", 50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4883 AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4884 AliMedium(52, "SSD Si bus$", 52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4885 AliMedium(53, "SSD C$", 53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4886 AliMedium(54, "SSD Air$", 54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4887 AliMedium(55, "SSD Vacuum$", 55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4888 AliMedium(56, "SSD Al$", 56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4889 AliMedium(57, "SSD Water $", 57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4890 AliMedium(58, "SSD Freon$", 58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4891 AliMedium(59, "SSD PCB$", 59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4892 AliMedium(60, "SSD Copper$", 60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4893 AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4894 AliMedium(62, "SSD Kapton$", 62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4895 AliMedium(63, "SSD G10FR4$", 63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4897 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4899 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4901 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4902 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4903 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4904 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4905 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4906 // After a call with ratios by number (negative number of elements),
4907 // the ratio array is changed to the ratio by weight, so all successive
4908 // calls with the same array must specify the number of elements as
4910 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4912 AliMedium(75,"GEN C$", 75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4913 AliMedium(76,"GEN Air$", 76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4914 AliMedium(77,"GEN Vacuum$", 77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
4915 AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4916 AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4917 AliMedium(80,"GEN Copper$", 80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4918 AliMedium(81,"GEN Water $", 81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4920 //_____________________________________________________________________________
4921 void AliITSv3::Init(){
4922 ////////////////////////////////////////////////////////////////////////
4923 // Initialise the ITS after it has been created.
4924 ////////////////////////////////////////////////////////////////////////
4929 //_____________________________________________________________________________
4930 void AliITSv3::StepManager(){
4931 ////////////////////////////////////////////////////////////////////////
4932 // Called for every step in the ITS, then calles the AliITShit class
4933 // creator with the information to be recoreded about that hit.
4934 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4935 // printing of information to a file which can be used to create a .det
4936 // file read in by the routine CreateGeometry(). If set to 0 or any other
4937 // value except 1, the default behavior, then no such file is created nor
4938 // it the extra variables and the like used in the printing allocated.
4939 ////////////////////////////////////////////////////////////////////////
4943 TLorentzVector position, momentum;
4944 TClonesArray &lhits = *fHits;
4945 #if ALIITSPRINTGEOM==1
4948 Float_t xl[3],xt[3],angl[6];
4949 // Float_t par[20],att[20];
4951 static Bool_t first=kTRUE,printit[6][50][50];
4952 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4953 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4961 if(gMC->IsTrackInside()) vol[3] += 1;
4962 if(gMC->IsTrackEntering()) vol[3] += 2;
4963 if(gMC->IsTrackExiting()) vol[3] += 4;
4964 if(gMC->IsTrackOut()) vol[3] += 8;
4965 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4966 if(gMC->IsTrackStop()) vol[3] += 32;
4967 if(gMC->IsTrackAlive()) vol[3] += 64;
4969 // Fill hit structure.
4970 if(!(gMC->TrackCharge())) return;
4972 // Only entering charged tracks
4973 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4975 id=gMC->CurrentVolOffID(1,copy);
4977 id=gMC->CurrentVolOffID(2,copy);
4979 } else if(id==fIdSens[1]) {
4981 id=gMC->CurrentVolOffID(1,copy);
4983 id=gMC->CurrentVolOffID(2,copy);
4985 } else if(id==fIdSens[2]) {
4988 id=gMC->CurrentVolOffID(1,copy);
4990 } else if(id==fIdSens[3]) {
4993 id=gMC->CurrentVolOffID(1,copy);
4995 } else if(id==fIdSens[4]) {
4998 id=gMC->CurrentVolOffID(1,copy);
5000 } else if(id==fIdSens[5]) {
5003 id=gMC->CurrentVolOffID(1,copy);
5006 gMC->TrackPosition(position);
5007 gMC->TrackMomentum(momentum);
5008 hits[0]=position[0];
5009 hits[1]=position[1];
5010 hits[2]=position[2];
5011 hits[3]=momentum[0];
5012 hits[4]=momentum[1];
5013 hits[5]=momentum[2];
5014 hits[6]=gMC->Edep();
5015 hits[7]=gMC->TrackTime();
5016 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
5017 #if ALIITSPRINTGEOM==1
5018 if(printit[vol[0]][vol[2]][vol[1]]){
5019 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
5020 xl[0] = xl[1] = xl[2] = 0.0;
5021 gMC->Gdtom(xl,xt,1);
5022 for(i=0;i<9;i++) mat[i] = 0.0;
5023 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
5026 gMC->Gdtom(xl,&(mat[0]),2);
5029 gMC->Gdtom(xl,&(mat[3]),2);
5032 gMC->Gdtom(xl,&(mat[6]),2);
5034 angl[0] = TMath::ACos(mat[2]);
5035 if(mat[2]==1.0) angl[0] = 0.0;
5036 angl[1] = TMath::ATan2(mat[1],mat[0]);
5037 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5039 angl[2] = TMath::ACos(mat[5]);
5040 if(mat[5]==1.0) angl[2] = 0.0;
5041 angl[3] = TMath::ATan2(mat[4],mat[3]);
5042 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5044 angl[4] = TMath::ACos(mat[8]);
5045 if(mat[8]==1.0) angl[4] = 0.0;
5046 angl[5] = TMath::ATan2(mat[7],mat[6]);
5047 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5049 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5050 // i = gMC->CurrentVolID(copy);
5051 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5052 fp = fopen("ITSgeometry_v5.det","a");
5053 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5054 vol[0],vol[2],vol[1], // layer ladder detector
5055 xt[0],xt[1],xt[2], // Translation vector
5056 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5059 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5060 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5061 ); // Adding the rotation matrix.
5064 } // end if printit[layer][ladder][detector]
5068 //____________________________________________________________________________
5069 void AliITSv3::Streamer(TBuffer &R__b){
5070 ////////////////////////////////////////////////////////////////////////
5071 // A dummy Streamer function for this class AliITSv3. By default it
5072 // only streams the AliITS class as it is required. Since this class
5073 // dosen't contain any "real" data to be saved, it doesn't.
5074 ////////////////////////////////////////////////////////////////////////
5076 if (R__b.IsReading()) {
5077 Version_t R__v = R__b.ReadVersion();
5079 AliITS::Streamer(R__b);
5081 AliITS::Streamer(R__b);
5084 R__b.WriteVersion(AliITSv3::IsA());
5085 AliITS::Streamer(R__b);
5086 } // end if R__b.IsReading()