1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.11.4.4 2000/05/19 10:09:51 nilsen
19 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
21 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
22 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
23 <=23 (was <=24). This may not be the final version.
25 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
26 Fixed up the comments/documentation.
28 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
29 This is the version of the files after the merging done in December 1999.
30 See the ReadMe110100.txt file for details
32 Revision 1.11 1999/10/22 08:25:25 fca
33 remove double definition of destructors
35 Revision 1.10 1999/10/22 08:16:49 fca
36 Correct destructors, thanks to I.Hrivnacova
38 Revision 1.9 1999/10/06 19:56:50 fca
41 Revision 1.8 1999/10/05 08:05:09 fca
42 Minor corrections for uninitialised variables.
44 Revision 1.7 1999/09/29 09:24:20 fca
45 Introduction of the Copyright and cvs Log
49 ///////////////////////////////////////////////////////////////////////////////
51 // Inner Traking System version 3
52 // This class contains the base procedures for the Inner Tracking System
54 // Authors: R. Barbera, A. Morsch.
58 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
59 // WORK with the geometry or module classes or any analysis classes. You are
60 // strongly encouraged to uses AliITSv5.
62 ///////////////////////////////////////////////////////////////////////////////
64 // See AliITSv3::StepManager().
65 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
66 //#define ALIITSPRINTGEOM 1 // print out geometry information
71 #include <TGeometry.h>
74 #include <TFile.h> // only required for Tracking function?
76 #include <TObjArray.h>
77 #include <TClonesArray.h>
82 #include "AliITShit.h"
91 //_____________________________________________________________________________
92 AliITSv3::AliITSv3() {
93 ////////////////////////////////////////////////////////////////////////
94 // Standard default constructor for the ITS version 3.
95 ////////////////////////////////////////////////////////////////////////
98 fIdName = new TString[fIdN];
105 fIdSens = new Int_t[fIdN];
106 for (Int_t i=0;i<fIdN;i++) fIdSens[i]=fIdName[i].Length();
109 //____________________________________________________________________________
110 AliITSv3::AliITSv3(const AliITSv3 &source){
111 ////////////////////////////////////////////////////////////////////////
112 // Copy Constructor for ITS version 3.
113 ////////////////////////////////////////////////////////////////////////
114 if(&source == this) return;
115 printf("Not allowed to copy AliITSv3\n");
118 //_____________________________________________________________________________
119 AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
120 ////////////////////////////////////////////////////////////////////////
121 // Assignment operator for the ITS version 3.
122 ////////////////////////////////////////////////////////////////////////
123 if(&source == this) return *this;
124 printf("Not allowed to copy AliITSv3\n");
127 //_____________________________________________________________________________
128 AliITSv3::~AliITSv3() {
129 ////////////////////////////////////////////////////////////////////////
130 // Standard destructor for the ITS version 3.
131 ////////////////////////////////////////////////////////////////////////
133 //_____________________________________________________________________________
134 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
135 ////////////////////////////////////////////////////////////////////////
136 // Standard constructor for the ITS version 3.
137 ////////////////////////////////////////////////////////////////////////
139 fIdName = new TString[fIdN];
146 fIdSens = new Int_t[fIdN];
147 for (Int_t i=0;i<fIdN;i++) fIdSens[i]=fIdName[i].Length();
149 }//__________________________________________________________________________
150 void AliITSv3::BuildGeometry(){
151 ////////////////////////////////////////////////////////////////////////
152 // Geometry builder for the ITS version 3.
153 ////////////////////////////////////////////////////////////////////////
155 const int kColorITS=kYellow;
157 top = gAlice->GetGeometry()->GetNode("alice");
159 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
161 node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
162 node->SetLineColor(kColorITS);
165 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
167 node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
168 node->SetLineColor(kColorITS);
171 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
173 node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
174 node->SetLineColor(kColorITS);
177 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
179 node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
180 node->SetLineColor(kColorITS);
183 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
185 node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
186 node->SetLineColor(kColorITS);
189 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
191 node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
192 node->SetLineColor(kColorITS);
195 //_____________________________________________________________________________
196 void AliITSv3::CreateGeometry(){
197 ////////////////////////////////////////////////////////////////////////
198 // This routine creates and defines the version 3 geometry of the ITS.
199 ////////////////////////////////////////////////////////////////////////
201 const Float_t kxx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
202 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
204 const Float_t kyy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
205 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
207 const Float_t kxbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
208 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
210 const Float_t kybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
211 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
213 const Float_t kxend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
214 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
216 const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
217 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
219 const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
220 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
222 const Float_t kyarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
223 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
225 const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
226 0.5,0.7,0.5,0.7,0.5,0.5 };
227 const Float_t krr = 4.064516;
228 const Float_t ktteta = 63.00;
229 const Float_t kpphi = -35.00;
230 const Float_t kgteta = 87.78;
231 const Double_t kdegrad = kPI/180.;
232 const Double_t kraddeg = 180./kPI;
233 const Double_t ktwopi = 2*kPI;
236 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
237 dfra[10], dcer[3], dkap[3], dpla[3],
238 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
239 atheta1011, dbus[3], dtub[3], dwat[3],
240 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
241 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
242 Double_t biga1, bigb1;
243 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
244 dtra1[3], dtra2[3], dtra3[3],
245 dtra4[3], dbox1[3], dbox2[3];
247 Float_t xtra1[6], ytra1[6], ztra1[6];
249 Float_t xpos1, ypos1;
251 Float_t angle, dcone[5], dtube[3], dpgon[10];
252 Float_t rzero, xzero, yzero;
253 Double_t coeffa, coeffb, coeffc;
255 Float_t atheta, offset;
256 Float_t offset1, offset2, dgh[15];
257 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
258 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
261 Double_t xcc1, ycc1, xcc2, ycc2;
263 const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
264 "TR05","TR06","TR07","TR08"};
265 const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
266 "TR15","TR16","TR17","TR18",
267 "TR19","TR20","TR21","TR22",
268 "TR23","TR24","TR25","TR26"};
269 const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
270 const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
271 const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
272 "TR57","TR58","TR59","TR60","TR61","TR62",
273 "TR63","TR64","TR65","TR66"};
275 Int_t *idtmed = fIdtmed->GetArray()-199;
277 // --- Define a ghost volume containing the whole ITS and fill it with air
295 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
297 // --- Place the ghost volume in its mother volume (ALIC) and make it
300 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
301 gMC->Gsatt("ITSV", "SEEN", 0);
303 //************************************************************************
308 //************************************************************************
310 // GOTO 2345 ! skip ITS layer no. 1 and 2
312 // --- Define a ghost volume containing the Silicon Pixel Detectors
313 // (layer #1 and #2) and fill it with air or vacuum
315 xxm = (49.999-3)/(70-25);
319 dgh[3] = -25.-(9.-3.01)/xxm;
328 dgh[12] = 25+(9-3.01)/xxm;
331 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
333 // --- Place the ghost volume in its mother volume (ITSV) and make it
336 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
337 gMC->Gsatt("IT12", "SEEN", 0);
339 // --- Define a ghost volume containing a single element of layer #1
340 // and fill it with air or vacuum
342 dbox1[0] = 0.005+0.01+0.0075;
345 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
347 //--Divide each element of layer #1 in three ladders along the beam direction
349 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
351 // --- Make the ghost volumes invisible
353 gMC->Gsatt("IPV1", "SEEN", 0);
354 gMC->Gsatt("IPB1", "SEEN", 0);
356 // --- Define a volume containing the chip of pixels (silicon, layer #1)
360 dchi[2] = dbox1[2] / 3.;
361 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
363 // --- Define a volume containing the bus of pixels (silicon, layer #1)
368 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
370 // --- Define a volume containing the sensitive part of pixels
371 // (silicon, layer #1)
376 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
378 // --- Place the chip into its mother (IPB1)
380 xpos = dbox1[0] - dchi[0];
383 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
385 // --- Place the sensitive volume into its mother (IPB1)
387 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
388 ypos = dchi[1] - dits[1];
389 zpos = -(dchi[2] - dits[2]);
390 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
392 // --- Place the bus into its mother (IPB1)
394 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
395 ypos = dchi[1] - dbus[1];
396 zpos = -(dchi[2] - dbus[2]);
397 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
399 // --- Define a ghost volume containing a single element of layer #2
400 // and fill it with air or vacuum
402 dbox2[0] = 0.005+0.01+0.0075;
405 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
407 //--Divide each element of layer #2 in four ladders along the beam direction
409 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
411 // --- Make the ghost volumes invisible
413 gMC->Gsatt("IPV2", "SEEN", 0);
414 gMC->Gsatt("IPB2", "SEEN", 0);
416 // --- Define a volume containing the chip of pixels (silicon, layer #2)
420 dchi[2] = dbox2[2] / 4.;
421 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
423 // --- Define a volume containing the bus of pixels (silicon, layer #2)
428 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
430 // --- Define a volume containing the sensitive part of pixels
431 // (silicon, layer #2)
436 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
438 // --- Place the chip into its mother (IPB2)
440 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
443 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
445 // --- Place the sensitive volume into its mother (IPB2)
447 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
448 ypos = -(dchi[1] - dits[1]);
449 zpos = -(dchi[2] - dits[2]);
450 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
452 // --- Place the bus into its mother (IPB2)
454 xpos = dbox1[0] - dbus[0];
455 ypos = -(dchi[1] - dbus[1]);
456 zpos = -(dchi[2] - dbus[2]);
457 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
459 // --- Define a generic segment of an element of the mechanical support
464 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
466 // --- Define a generic arc of an element of the mechanical support
471 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
473 // --- Define the mechanical supports of layers #1 and #2 and place the
474 // elements of the layers in it
477 // counter over the number of elements of layer #1 (
480 // counter over the number of elements of layer #2 (
481 for (i = 1; i <= 10; ++i) {
483 // --- Place part # 1-2 (see sketch)
485 // number of carbon fiber supports (see sketch)
488 dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) +
489 (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0]) ) / 20.;
491 xcc = ( kxx[0] + kxx[1]) / 20.;
492 ycc = ( kyy[0] + kyy[1]) / 20.;
493 xccc = (kxbeg[0] + kxend[0]) / 20.;
494 yccc = (kybeg[0] + kyend[0]) / 20.;
495 if (kxx[0] == kxx[1]) {
498 r1 = kyy[1] - kyy[0];
499 r2 = kxx[1] - kxx[0];
500 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
501 } // end if kxx[0] == kxx[1]
502 aphi = (kpphi + (i-1) * 36.) * kdegrad;
503 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
504 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
505 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
506 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
507 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
508 ypos1 * TMath::Sin(kgteta *kdegrad);
509 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
510 ypos1 * TMath::Cos(kgteta * kdegrad);
512 atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
513 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
514 atheta12 + 90., 0., 0.);
515 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
516 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
518 // --- Place part # 2-3 (see sketch)
522 dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) +
523 (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
525 xcc = ( kxx[1] + kxx[2]) / 20.;
526 ycc = ( kyy[1] + kyy[2]) / 20.;
527 xccc = (kxbeg[1] + kxend[1]) / 20.;
528 yccc = (kybeg[1] + kyend[1]) / 20.;
529 if (kxx[1] == kxx[2]) {
532 r1 = kyy[2] - kyy[1];
533 r2 = kxx[2] - kxx[1];
534 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
535 } // end if kxx[1] == kxx[2]
536 aphi = (kpphi + (i-1) * 36.) * kdegrad;
537 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
538 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
539 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
540 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
541 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
542 ypos1 * TMath::Sin(kgteta * kdegrad);
543 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
544 ypos1 * TMath::Cos(kgteta * kdegrad);
546 atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
547 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
548 atheta23 + 90., 0., 0.);
549 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
550 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
552 // --- Place an element of layer #2
554 biga = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
555 bigb = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
556 coeffa = biga * biga + 1.;
557 coeffb = biga * bigb - biga * ycc - xcc;
558 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
559 bigb * bigb - 0.08964*0.08964;
560 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
562 ycc1 = biga * xcc1 + bigb;
564 bigb1 = xcc1 / biga + ycc1;
565 coeffa = biga1 * biga1 + 1.;
566 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
567 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
568 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
569 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
571 ycc2 = biga1 * xcc2 + bigb1;
572 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
573 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
574 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
575 ypos1 * TMath::Sin(kgteta *kdegrad);
576 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
577 ypos1 * TMath::Cos(kgteta * kdegrad);
580 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
581 idrotm[(i-1) * 13 + 1101], "ONLY");
583 // --- Place part # 3-4 (see sketch)
587 dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) +
588 (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
590 xcc = (kxx[1] + kxx[2]) / 20.;
591 ycc = (kyy[1] + kyy[2]) / 20.;
592 xccc = (kxbeg[2] + kxend[2]) / 20.;
593 yccc = (kybeg[2] + kyend[2]) / 20.;
594 if (kxx[2] == kxx[3]) {
597 r1 = kyy[3] - kyy[2];
598 r2 = kxx[3] - kxx[2];
599 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
600 } // end if kxx[2] == kxx[3]
601 aphi = (kpphi + (i-1) * 36.) * kdegrad;
602 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
603 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
604 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
605 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
606 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
607 ypos1 * TMath::Sin(kgteta *kdegrad);
608 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
609 ypos1 * TMath::Cos(kgteta * kdegrad);
611 atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
612 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
613 atheta34 + 90., 0., 0.);
614 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
615 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
617 // --- Place part # 4-5 (see sketch)
621 dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) +
622 (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
624 xcc = ( kxx[3] + kxx[4]) / 20.;
625 ycc = ( kyy[3] + kyy[4]) / 20.;
626 xccc = (kxbeg[3] + kxend[3]) / 20.;
627 yccc = (kybeg[3] + kyend[3]) / 20.;
628 if (kxx[3] == kxx[4]) {
631 r1 = kyy[4] - kyy[3];
632 r2 = kxx[4] - kxx[3];
633 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
634 } // end if kxx[3] == kxx[4]
635 aphi = (kpphi + (i-1) * 36.) * kdegrad;
636 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
637 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
638 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
639 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
640 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
641 ypos1 * TMath::Sin(kgteta *kdegrad);
642 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
643 ypos1 * TMath::Cos(kgteta * kdegrad);
645 atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
646 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
647 atheta45 + 90., 0., 0.);
648 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
649 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
651 // --- Place an element of layer #2
653 biga = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
654 bigb = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
655 coeffa = biga * biga + 1.;
656 coeffb = biga * bigb - biga * ycc - xcc;
657 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
658 bigb * bigb - .014285030400000001;
659 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
661 ycc1 = biga * xcc1 + bigb;
663 bigb1 = xcc1 / biga + ycc1;
664 coeffa = biga1 * biga1 + 1.;
665 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
666 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
667 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
668 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
670 ycc2 = biga1 * xcc2 + bigb1;
671 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
672 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
673 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
674 ypos1 * TMath::Sin(kgteta *kdegrad);
675 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
676 ypos1 * TMath::Cos(kgteta * kdegrad);
679 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
680 idrotm[(i-1) * 13 + 1103], "ONLY");
682 // --- Place part # 5-6 (see sketch)
686 dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) +
687 (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
689 xcc = (kxx[4] + kxx[5]) / 20.;
690 ycc = (kyy[4] + kyy[5]) / 20.;
691 xccc = (kxbeg[4] + kxend[4]) / 20.;
692 yccc = (kybeg[4] + kyend[4]) / 20.;
693 if (kxx[4] == kxx[5]) {
696 r1 = kyy[5] - kyy[4];
697 r2 = kxx[5] - kxx[4];
698 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
700 aphi = (kpphi + (i-1) * 36.) * kdegrad;
701 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
702 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
703 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
704 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
705 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
706 ypos1 * TMath::Sin(kgteta *kdegrad);
707 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
708 ypos1 * TMath::Cos(kgteta * kdegrad);
710 atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
711 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
712 atheta56 + 90., 0., 0.);
713 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
714 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
716 // --- Place part # 6-7 (see sketch)
720 dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) +
721 (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
723 xcc = (kxx[5] + kxx[6]) / 20.;
724 ycc = (kyy[5] + kyy[6]) / 20.;
725 xccc = (kxbeg[5] + kxend[5]) / 20.;
726 yccc = (kybeg[5] + kyend[5]) / 20.;
727 if (kxx[5] == kxx[6]) {
730 r1 = kyy[6] - kyy[5];
731 r2 = kxx[6] - kxx[5];
732 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
733 } // end if kxx[5] == kxx[6]
734 aphi = (kpphi + (i-1) * 36.) * kdegrad;
735 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
736 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
737 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
738 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
739 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
740 ypos1 * TMath::Sin(kgteta *kdegrad);
741 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
742 ypos1 * TMath::Cos(kgteta * kdegrad);
744 atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
745 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
746 atheta67 + 90., 0., 0.);
747 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
748 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
750 // --- Place an element of layer #2
752 biga = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
753 bigb = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
754 coeffa = biga * biga + 1.;
755 coeffb = biga * bigb - biga * ycc - xcc;
756 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
757 bigb * bigb - .014285030400000001;
758 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
760 ycc1 = biga * xcc1 + bigb;
762 bigb1 = xcc1 / biga + ycc1;
763 coeffa = biga1 * biga1 + 1.;
764 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
765 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
766 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
767 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
769 ycc2 = biga1 * xcc2 + bigb1;
770 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
771 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
772 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
773 ypos1 * TMath::Sin(kgteta *kdegrad);
774 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
775 ypos1 * TMath::Cos(kgteta * kdegrad);
778 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
779 idrotm[(i-1) * 13 + 1105], "ONLY");
781 // --- Place part # 7-8 (see sketch)
785 dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
786 (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
788 xcc = (kxx[6] + kxx[7]) / 20.;
789 ycc = (kyy[6] + kyy[7]) / 20.;
790 xccc = (kxbeg[6] + kxend[6]) / 20.;
791 yccc = (kybeg[6] + kyend[6]) / 20.;
792 if (kxx[6] == kxx[7]) {
795 r1 = kyy[7] - kyy[6];
796 r2 = kxx[7] - kxx[6];
797 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
799 aphi = (kpphi + (i-1) * 36.) * kdegrad;
800 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
801 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
802 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
803 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
804 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
805 ypos1 * TMath::Sin(kgteta *kdegrad);
806 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
807 ypos1 * TMath::Cos(kgteta * kdegrad);
809 atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
810 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
811 atheta78 + 90., 0., 0.);
812 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
813 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
815 // --- Place part # 8-9 (see sketch)
819 dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) +
820 (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
822 xcc = (kxx[7] + kxx[8]) / 20.;
823 ycc = (kyy[7] + kyy[8]) / 20.;
824 xccc = (kxbeg[7] + kxend[7]) / 20.;
825 yccc = (kybeg[7] + kyend[7]) / 20.;
826 if (kxx[1] == kxx[2]) {
829 r1 = kyy[8] - kyy[7];
830 r2 = kxx[8] - kxx[7];
831 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
833 aphi = (kpphi + (i-1) * 36.) * kdegrad;
834 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
835 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
836 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
837 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
838 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
839 ypos1 * TMath::Sin(kgteta *kdegrad);
840 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
841 ypos1 * TMath::Cos(kgteta * kdegrad);
843 atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
844 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
845 atheta89 + 90., 0., 0.);
846 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
847 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
849 // --- Place an element of layer #2
851 biga = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
852 bigb = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
853 coeffa = biga * biga + 1.;
854 coeffb = biga * bigb - biga * ycc - xcc;
855 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
856 bigb * bigb - .014285030400000001;
857 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
859 ycc1 = biga * xcc1 + bigb;
861 bigb1 = xcc1 / biga + ycc1;
862 coeffa = biga1 * biga1 + 1.;
863 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
864 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
865 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
866 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
868 ycc2 = biga1 * xcc2 + bigb1;
869 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
870 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
871 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
872 ypos1 * TMath::Sin(kgteta *kdegrad);
873 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
874 ypos1 * TMath::Cos(kgteta * kdegrad);
877 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
878 idrotm[(i-1) * 13 + 1107], "ONLY");
880 // --- Place part # 9-10 (see sketch)
884 dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
885 (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
887 xcc = (kxx[8] + kxx[9]) / 20.;
888 ycc = (kyy[8] + kyy[9]) / 20.;
889 xccc = (kxbeg[8] + kxend[8]) / 20.;
890 yccc = (kybeg[8] + kyend[8]) / 20.;
891 if (kxx[8] == kxx[9]) {
894 r1 = kyy[9] - kyy[8];
895 r2 = kxx[9] - kxx[8];
896 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
898 aphi = (kpphi + (i-1) * 36.) * kdegrad;
899 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
900 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
901 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
902 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
903 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
904 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
906 atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
907 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
908 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
910 // --- Place part # 10-11 (see sketch)
914 dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
916 xcc = (kxx[9] + kxx[10]) / 20.;
917 ycc = (kyy[9] + kyy[10]) / 20.;
918 xccc = (kxbeg[9] + kxend[9]) / 20.;
919 yccc = (kybeg[9] + kyend[9]) / 20.;
920 if (kxx[9] == kxx[10]) {
923 r1 = kyy[10] - kyy[9];
924 r2 = kxx[10] - kxx[9];
925 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
927 aphi = (kpphi + (i-1) * 36.) * kdegrad;
928 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
929 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
930 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
931 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
932 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
933 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
935 atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
936 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
937 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
939 // --- Place part # 13-14 (see sketch)
943 dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
945 xcc = (kxx[12] + kxx[13]) / 20.;
946 ycc = (kyy[12] + kyy[13]) / 20.;
947 xccc = (kxbeg[12] + kxend[12]) / 20.;
948 yccc = (kybeg[12] + kyend[12]) / 20.;
949 if (kxx[12] == kxx[13]) {
952 r1 = kyy[12] - kyy[13];
953 r2 = kxx[12] - kxx[13];
954 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
956 aphi = (kpphi + (i-1) * 36.) * kdegrad;
957 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
958 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
959 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
960 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
961 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
962 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
964 atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
965 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
966 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
968 // --- Place an element of layer #1
970 biga = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
971 bigb = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
972 coeffa = biga * biga + 1.;
973 coeffb = biga * bigb - biga * ycc - xcc;
974 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
975 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
976 ycc1 = biga * xcc1 + bigb;
978 bigb1 = xcc1 / biga + ycc1;
979 coeffa = biga1 * biga1 + 1.;
980 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
981 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
982 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
983 ycc2 = biga1 * xcc2 + bigb1;
984 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
985 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
986 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
987 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
990 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
992 // --- Place part # 12-13 (see sketch)
996 dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
998 xcc = (kxx[11] + kxx[12]) / 20.;
999 ycc = (kyy[11] + kyy[12]) / 20.;
1000 xccc = (kxbeg[11] + kxend[11]) / 20.;
1001 yccc = (kybeg[11] + kyend[11]) / 20.;
1002 if (kxx[11] == kxx[12]) {
1005 r1 = kyy[12] - kyy[11];
1006 r2 = kxx[12] - kxx[11];
1007 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1009 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1010 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1011 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1012 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1013 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1014 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1015 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1017 atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
1018 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
1019 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
1021 // --- Place part # 11-12 (see sketch)
1025 dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
1027 xcc = (kxx[10] + kxx[11]) / 20.;
1028 ycc = (kyy[10] + kyy[11]) / 20.;
1029 xccc = (kxbeg[10] + kxend[10]) / 20.;
1030 yccc = (kybeg[10] + kyend[10]) / 20.;
1031 if (kxx[10] == kxx[11]) {
1034 r1 = kyy[11] - kyy[10];
1035 r2 = kxx[11] - kxx[10];
1036 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1038 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1039 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1040 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1041 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1042 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1043 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1044 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1046 atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
1047 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1048 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1050 // --- Place an element of layer #1
1052 biga = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
1053 bigb = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
1054 coeffa = biga * biga + 1.;
1055 coeffb = biga * bigb - biga * ycc - xcc;
1056 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1057 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1058 ycc1 = biga * xcc1 + bigb;
1060 bigb1 = xcc1 / biga + ycc1;
1061 coeffa = biga1 * biga1 + 1.;
1062 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1063 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1064 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1065 ycc2 = biga1 * xcc2 + bigb1;
1066 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1067 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1068 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1069 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1072 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1074 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1076 darc[0] = krarc[12] / 10. - .02;
1077 darc[1] = krarc[12] / 10.;
1079 darc[3] = atheta12 - (i-1) * 36.;
1080 darc[4] = atheta23 - (i-1) * 36.;
1081 xcc = kxarc[12] / 10.;
1082 ycc = kyarc[12] / 10.;
1083 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1084 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1085 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1086 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1087 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1088 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1089 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1091 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1093 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1095 darc[0] = krarc[11] / 10. - .02;
1096 darc[1] = krarc[11] / 10.;
1098 darc[3] = atheta23 + 90. - (i-1) * 36.;
1099 darc[4] = atheta34 + 90. - (i-1) * 36.;
1100 xcc = kxarc[11] / 10.;
1101 ycc = kyarc[11] / 10.;
1102 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1103 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1104 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1105 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1106 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1107 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1108 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1110 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1112 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1114 darc[0] = krarc[10] / 10. - .02;
1115 darc[1] = krarc[10] / 10.;
1117 darc[3] = atheta45 + 180. - (i-1) * 36.;
1118 darc[4] = atheta34 + 180. - (i-1) * 36.;
1119 xcc = kxarc[10] / 10.;
1120 ycc = kyarc[10] / 10.;
1121 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1122 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1123 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1124 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1125 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1126 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1127 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1129 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1131 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1133 darc[0] = krarc[9] / 10. - .02;
1134 darc[1] = krarc[9] / 10.;
1136 darc[3] = atheta45 - 90. - (i-1) * 36.;
1137 darc[4] = atheta56 - 90. - (i-1) * 36.;
1138 xcc = kxarc[9] / 10.;
1139 ycc = kyarc[9] / 10.;
1140 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1141 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1142 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1143 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1144 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1145 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1146 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1148 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1150 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1152 darc[0] = krarc[8] / 10. - .02;
1153 darc[1] = krarc[8] / 10.;
1155 darc[3] = atheta67 + 45. - (i-1) * 36.;
1156 darc[4] = atheta56 + 45. - (i-1) * 36.;
1157 xcc = kxarc[8] / 10.;
1158 ycc = kyarc[8] / 10.;
1159 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1160 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1161 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1162 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1163 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1164 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1165 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1167 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1169 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1171 darc[0] = krarc[7] / 10. - .02;
1172 darc[1] = krarc[7] / 10.;
1174 darc[3] = atheta67 - (i-1) * 36.;
1175 darc[4] = atheta78 - (i-1) * 36.;
1176 xcc = kxarc[7] / 10.;
1177 ycc = kyarc[7] / 10.;
1178 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1179 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1180 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1181 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1182 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1183 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1184 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1186 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1188 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1190 darc[0] = krarc[6] / 10. - .02;
1191 darc[1] = krarc[6] / 10.;
1193 darc[3] = atheta89 + 45. - (i-1) * 36.;
1194 darc[4] = atheta78 + 45. - (i-1) * 36.;
1195 xcc = kxarc[6] / 10.;
1196 ycc = kyarc[6] / 10.;
1197 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1198 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1199 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1200 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1201 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1202 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1203 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1205 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1207 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1209 darc[0] = krarc[5] / 10. - .02;
1210 darc[1] = krarc[5] / 10.;
1212 darc[3] = atheta89 + 45. - (i-1) * 36.;
1213 darc[4] = atheta910 + 45. - (i-1) * 36.;
1214 xcc = kxarc[5] / 10.;
1215 ycc = kyarc[5] / 10.;
1216 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1217 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1218 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1219 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1220 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1221 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1222 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1224 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1226 // --- Place arc # 5 (between part 9-10 and part 10-11)
1229 darc[0] = krarc[4] / 10. - .02;
1230 darc[1] = krarc[4] / 10.;
1232 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1233 darc[4] = atheta910 + 45. - (i-1) * 36.;
1234 xcc = kxarc[4] / 10.;
1235 ycc = kyarc[4] / 10.;
1236 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1237 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1238 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1239 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1240 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1241 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1242 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1244 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1246 // --- Place arc # 4 (between part 10-11 and part 11-12)
1249 darc[0] = krarc[3] / 10. - .02;
1250 darc[1] = krarc[3] / 10.;
1252 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1253 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1254 xcc = kxarc[3] / 10.;
1255 ycc = kyarc[3] / 10.;
1256 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1257 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1258 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1259 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1260 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1261 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1262 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1264 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1266 // --- Place arc # 3 (between part 11-12 and part 12-13)
1269 darc[0] = krarc[2] / 10. - .02;
1270 darc[1] = krarc[2] / 10.;
1272 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1273 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1274 xcc = kxarc[2] / 10.;
1275 ycc = kyarc[2] / 10.;
1276 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1277 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1278 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1279 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1280 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1281 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1282 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1284 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1286 // --- Place arc # 2 (between part 12-13 and part 13-14)
1289 darc[0] = krarc[1] / 10. - .02;
1290 darc[1] = krarc[1] / 10.;
1292 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1293 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1294 xcc = kxarc[1] / 10.;
1295 ycc = kyarc[1] / 10.;
1296 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1297 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1298 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1299 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1300 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1301 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1302 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1304 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1306 // --- Place arc # 1 (between part 13-14 and part 1-2)
1309 darc[0] = krarc[0] / 10. - .02;
1310 darc[1] = krarc[0] / 10.;
1312 darc[3] = atheta12 + 45. - (i-1) * 36.;
1313 darc[4] = atheta1314 - (i-1) * 36.;
1314 xcc = kxarc[0] / 10.;
1315 ycc = kyarc[0] / 10.;
1316 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1317 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1318 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1319 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1320 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1321 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1322 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1324 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1327 //************************************************************************
1332 //************************************************************************
1334 // --- Define a ghost volume containing the Silicon Drift Detectors
1335 // (layer #3 and #4) and fill it with air or vacuum
1337 xxm = (49.999-3.)/(70.-25.);
1341 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1344 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1347 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1350 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1353 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1355 // --- Place the ghost volume in its mother volume (ITSV) and make it
1358 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1359 gMC->Gsatt("IT34", "SEEN", 0);
1363 // GOTO 3456 ! skip ITS layer no. 3
1365 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1366 // smaller lenght of ribs) and fill it with air or vacuum
1368 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1370 // the widest element is the sensitive element
1371 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1372 // 7.5 cm is the lenght
1373 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1375 // --- Make the ghost volume invisible
1377 gMC->Gsatt("IDV1", "SEEN", 0);
1379 // --- Define a volume containing the sensitive part of drifts
1380 // (silicon, layer #3)
1383 // see material budget report by G. Feofilov
1386 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1388 //--- Define the part of the (smaller) rib between two sensitive parts made of
1389 // carbon (layer #3)
1391 dsup[0] = .5 - dits[0];
1393 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1394 // 7.5 cm is the lenght
1395 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1397 //--- Define the first part of the (smaller) rib between two sensitive parts
1398 // made of aluminum (layer #3)
1400 dal1[0] = .5 - dits[0];
1401 dal1[1] = 0.00096/2.;
1402 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1403 // 7.5 cm is the lenght
1404 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1406 //--- Define the part of the (smaller) rib between two sensitive parts made of
1407 // kapton (layer #3)
1409 dkap[0] = .5 - dits[0];
1411 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1412 // 7.5 cm is the lenght
1413 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1415 //--- Define the second part of the (smaller) rib between two sensitive parts
1416 // made of aluminum (layer #3)
1418 dal2[0] = .5 - dits[0];
1419 dal2[1] = 0.0027/2.;
1420 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1421 // 7.5 cm is the lenght
1422 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1424 // --- Define the part of the (smaller) rib between two sensitive parts
1425 // made of silicon (the electronics) (layer #3)
1427 dchi[0] = .5 - dits[0];
1428 dchi[1] = 0.0071/2.;
1429 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1430 // 7.5 cm is the lenght
1431 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1433 // --- Define the part of the (smaller) rib between two sensitive parts
1434 // made of water (the cooler) (layer #3)
1436 dwat[0] = .5 - dits[0];
1437 dwat[1] = 0.0093/2.;
1438 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1439 // 7.5 cm is the lenght
1440 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1442 //--- Define the third part of the (smaller) rib between two sensitive parts
1443 // made of aluminum (the cooling tubes) (layer #3)
1445 dtub[0] = .5 - dits[0];
1446 dtub[1] = 0.00134/2.;
1447 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1448 // 7.5 cm is the lenght
1449 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1451 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1454 // twice the foreseen thickness
1457 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1459 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1462 // twice the foreseen thickness
1465 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1467 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1470 // twice the foreseen thickness
1473 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1475 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1478 // twice the foreseen thickness
1481 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1483 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1487 for (j = 1; j <= 5; ++j) {
1488 // odd elements are up and even elements are down
1490 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1491 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1492 } else if (j == 2) {
1493 xpos = -dbox1[0] + dits[0];
1494 zpos = 0. - dits[2] + 1. - dits[2];
1495 } else if (j == 3) {
1496 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1498 } else if (j == 4) {
1499 xpos = -dbox1[0] + dits[0];
1500 zpos = dits[2] + 0. - 1. + dits[2];
1501 } else if (j == 5) {
1502 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1503 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1505 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1508 // --- Place the smaller ribs into their mother (IDV1)
1510 // --- Right ribs (just a matter of convention)
1512 xpos = .5 - dbox1[0] + dits[0];
1518 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1522 ypos = dsup[1] + 2.81 + dal1[1];
1523 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1527 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1528 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1532 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1533 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1535 // --- Silicon (chip)
1537 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1538 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1542 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1543 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1547 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1549 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1551 // --- Right ribs (just a matter of convention)
1556 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1560 ypos = -(dsup[1] + 2.81 + dal1[1]);
1561 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1565 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1566 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1570 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1571 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1573 // --- Silicon (chip)
1575 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1576 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1580 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1581 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1585 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1586 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1587 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1589 // --- Place the end-ladder stuff into its mother (IDV1)
1592 // --- Negative-Z end-ladder
1595 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1599 xpos = dbox1[0] - dpcb[0];
1600 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1604 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1605 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1609 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1610 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1612 // --- Silicon (bus)
1614 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1615 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1617 // --- Positive-Z end-ladder
1620 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1624 xpos = dbox1[0] - dpcb[0];
1625 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1629 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1630 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1634 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1635 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1637 // --- Silicon (bus)
1639 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1640 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1642 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1643 // larger lenght of ribs) and fill it with air or vacuum
1645 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1647 // the widest element is the sensitive element
1648 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1649 // 7.5 cm is the lenght
1650 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1652 // --- Make the ghost volume invisible
1654 gMC->Gsatt("IDV2", "SEEN", 0);
1656 //--- Define the part of the (larger) rib between two sensitive parts madeof
1657 // carbon (layer #3)
1659 dsup[0] = .65 - dits[0];
1661 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1662 // 7.5 cm is the lenght
1663 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1665 //--- Define the first part of the (larger) rib between two sensitive parts
1666 // made of aluminum (layer #3)
1668 dal1[0] = .65 - dits[0];
1669 dal1[1] = 0.00096/2.;
1670 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1671 // 7.5 cm is the lenght
1672 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1674 //--- Define the part of the (larger) rib between two sensitive parts madeof
1675 // kapton (layer #3)
1677 dkap[0] = .65 - dits[0];
1678 dkap[1] = 0.0317/2.;
1679 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1680 // 7.5 cm is the lenght
1681 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1683 //--- Define the second part of the (larger) rib between two sensitive parts
1684 // made of aluminum (layer #3)
1686 dal2[0] = .65 - dits[0];
1687 dal2[1] = 0.0027/2.;
1688 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1689 // 7.5 cm is the lenght
1690 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1692 // --- Define the part of the (larger) rib between two sensitive parts
1693 // made of silicon (the electronics) (layer #3)
1695 dchi[0] = .65 - dits[0];
1696 dchi[1] = 0.0071/2.;
1697 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1698 // 7.5 cm is the lenght
1699 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1701 // --- Define the part of the (larger) rib between two sensitive parts
1702 // made of water (the cooler) (layer #3)
1704 dwat[0] = .65 - dits[0];
1705 dwat[1] = 0.0093/2.;
1706 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1707 // 7.5 cm is the lenght
1708 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1710 //--- Define the third part of the (larger) rib between two sensitive parts
1711 // made of aluminum (the cooling tubes) (layer #3)
1713 dtub[0] = .65 - dits[0];
1714 dtub[1] = 0.00134/2.;
1715 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1716 // 7.5 cm is the lenght
1717 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1719 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1723 for (j = 1; j <= 5; ++j) {
1724 // odd element are up and even elements are down
1726 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1727 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1728 } else if (j == 2) {
1729 xpos = -dbox2[0] + dits[0];
1730 zpos = 0. - dits[2] + 1. - dits[2];
1731 } else if (j == 3) {
1732 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1734 } else if (j == 4) {
1735 xpos = -dbox2[0] + dits[0];
1736 zpos = dits[2] + 0. - 1. + dits[2];
1737 } else if (j == 5) {
1738 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1739 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1741 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1744 // --- Place the larger ribs into their mother (IDV2)
1747 // --- Right ribs (just a matter of convention)
1749 xpos = .65 - dbox2[0] + dits[0];
1755 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1759 ypos = dsup[1] + 2.81 + dal1[1];
1760 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1764 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1765 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1769 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1770 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1772 // --- Silicon (chip)
1774 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1775 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1779 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1780 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1784 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1785 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1787 // --- Right ribs (just a matter of convention)
1792 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1796 ypos = -(dsup[1] + 2.81 + dal1[1]);
1797 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1801 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1802 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1806 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1807 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1809 // --- Silicon (chip)
1811 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1812 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1816 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1817 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1821 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1822 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1824 // --- Place the end-ladder stuff into its mother (IDV1)
1827 // --- Negative-Z end-ladder
1830 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1834 xpos = dbox2[0] - dpcb[0];
1835 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1839 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1840 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1844 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1845 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1847 // --- Silicon (bus)
1849 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1850 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1852 // --- Positive-Z end-ladder
1855 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1859 xpos = dbox2[0] - dpcb[0];
1860 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1864 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1865 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1869 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1870 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1872 // --- Silicon (bus)
1874 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1875 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1877 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1878 // mother volume (IT34)
1879 // Odd elements have large ribs and even elements have small ribs
1881 for (i = 1; i <= 12; ++i) {
1882 atheta = (i-1) * 30.;
1883 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1886 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1887 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1889 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1892 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1893 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1895 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1902 // GOTO 4567 ! skip ITS layer no. 4
1904 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1905 // smaller lenght of ribs) and fill it with air or vacuum
1907 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1909 // the widest element is the end-ladder stuff
1910 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1911 // 7.5 cm is the lenght
1912 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1914 // --- Make the ghost volume invisible
1916 gMC->Gsatt("IDV3", "SEEN", 0);
1918 // --- Define a volume containing the sensitive part of drifts
1919 // (silicon, layer #4)
1922 // see material budget report by G. Feofilov
1925 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1927 //--- Define the part of the (smaller) rib between two sensitive parts made of
1928 // carbon (layer #4)
1930 dsup[0] = .5 - dits[0];
1932 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1933 // 7.5 cm is the lengh
1934 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1936 //--- Define the first part of the (smaller) rib between two sensitive parts
1937 // made of aluminum (layer #4)
1939 dal1[0] = .5 - dits[0];
1940 dal1[1] = 0.00096/2.;
1941 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1942 // 7.5 cm is the lengh
1943 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1945 //--- Define the part of the (smaller) rib between two sensitive parts made of
1946 // kapton (layer #4)
1948 dkap[0] = .5 - dits[0];
1949 dkap[1] = 0.0317/2.;
1950 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1951 // 7.5 cm is the lengh
1952 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1954 //--- Define the second part of the (smaller) rib between two sensitive parts
1955 // made of aluminum (layer #4)
1957 dal2[0] = .5 - dits[0];
1958 dal2[1] = 0.0027/2.;
1959 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1960 // 7.5 cm is the lengh
1961 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1963 // --- Define the part of the (smaller) rib between two sensitive parts
1964 // made of silicon (the electronics) (layer #4)
1966 dchi[0] = .5 - dits[0];
1967 dchi[1] = 0.0071/2.;
1968 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1969 // 7.5 cm is the lengh
1970 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1972 // --- Define the part of the (smaller) rib between two sensitive parts
1973 // made of water (the cooler) (layer #4)
1975 dwat[0] = .5 - dits[0];
1976 dwat[1] = 0.0093/2.;
1977 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1978 // 7.5 cm is the lenght
1979 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1981 //--- Define the third part of the (smaller) rib between two sensitive parts
1982 // made of aluminum (the cooling tubes) (layer #4)
1984 dtub[0] = .5 - dits[0];
1985 dtub[1] = 0.00134/2.;
1986 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1987 // 7.5 cm is the lengh
1988 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1990 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1993 // twice the foreseen thickness
1996 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1998 // --- Define the part of the end-ladder stuff made of copper (layer #4)
2001 // twice the foreseen thickness
2004 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
2006 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
2009 // twice the foreseen thickness
2012 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
2014 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
2017 // twice the foreseen thickness
2020 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
2022 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2026 for (j = 1; j <= 7; ++j) {
2027 // odd elements are down and even elements are up
2029 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2030 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2031 } else if (j == 2) {
2032 xpos = -dbox1[0] + dits[0];
2033 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2034 } else if (j == 3) {
2035 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2036 zpos = 0. - dits[2] + .7 - dits[2];
2037 } else if (j == 4) {
2038 xpos = -dbox1[0] + dits[0];
2040 } else if (j == 5) {
2041 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2042 zpos = dits[2] + 0. - .7 + dits[2];
2043 } else if (j == 6) {
2044 xpos = -dbox1[0] + dits[0];
2045 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2046 } else if (j == 7) {
2047 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2048 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2050 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2053 // --- Place the smaller ribs into their mother (IDV3)
2055 // --- Right ribs (just a matter of convention)
2057 xpos = .5 - dbox1[0] + dits[0];
2063 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2067 ypos = dsup[1] + 2.81 + dal1[1];
2068 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2072 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2073 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2077 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2078 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2080 // --- Silicon (chip)
2082 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2083 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2087 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2088 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2092 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2094 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2096 // --- Right ribs (just a matter of convention)
2101 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2105 ypos = -(dsup[1] + 2.81 + dal1[1]);
2106 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2110 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2111 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2115 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2117 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2119 // --- Silicon (chip)
2121 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2122 2. + dal2[1] * 2. + dchi[1]);
2123 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2127 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2128 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2129 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2133 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2134 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2136 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2138 // --- Place the end-ladder stuff into its mother (IDV1)
2141 // --- Negative-Z end-ladder
2144 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2148 xpos = dbox1[0] - dpcb[0];
2149 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2153 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2154 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2158 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2159 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2161 // --- Silicon (bus)
2163 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2164 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2166 // --- Positive-Z end-ladder
2169 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2173 xpos = dbox1[0] - dpcb[0];
2174 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2178 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2179 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2183 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2184 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2186 // --- Silicon (bus)
2188 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2189 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2191 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2192 // larger lenght of ribs) and fill it with air or vacuum
2194 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2196 // the widest element is the end-ladder stuff
2197 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2198 // 7.5 cm is the lenght
2199 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2201 // --- Make the ghost volume invisible
2203 gMC->Gsatt("IDV4", "SEEN", 0);
2205 //--- Define the part of the (larger) rib between two sensitive parts madeof
2206 // carbon (layer #4)
2208 dsup[0] = .65 - dits[0];
2210 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2211 // 7.5 cm is the lengh
2212 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2214 //--- Define the first part of the (larger) rib between two sensitive parts
2215 // made of aluminum (layer #4)
2217 dal1[0] = .65 - dits[0];
2218 dal1[1] = 0.00096/2.;
2219 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2220 // 7.5 cm is the lengh
2221 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2223 //--- Define the part of the (larger) rib between two sensitive parts madeof
2224 // kapton (layer #4)
2226 dkap[0] = .65 - dits[0];
2227 dkap[1] = 0.0317/2.;
2228 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2229 // 7.5 cm is the lengh
2230 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2232 //--- Define the second part of the (larger) rib between two sensitive parts
2233 // made of aluminum (layer #4)
2235 dal2[0] = .65 - dits[0];
2236 dal2[1] = 0.0027/2.;
2237 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2238 // 7.5 cm is the lengh
2239 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2241 // --- Define the part of the (larger) rib between two sensitive parts
2242 // made of silicon (the electronics) (layer #4)
2244 dchi[0] = .65 - dits[0];
2245 dchi[1] = 0.0071/2.;
2246 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2247 // 7.5 cm is the lengh
2248 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2250 // --- Define the part of the (larger) rib between two sensitive parts
2251 // made of water (the cooler) (layer #4)
2253 dwat[0] = .65 - dits[0];
2254 dwat[1] = 0.0093/2.;
2255 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2256 // 7.5 cm is the lengh
2257 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2259 //--- Define the third part of the (larger) rib between two sensitive parts
2260 // made of aluminum (the cooling tubes) (layer #4)
2262 dtub[0] = .65 - dits[0];
2263 dtub[1] = 0.00134/2.;
2264 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2265 // 7.5 cm is the lengh
2266 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2268 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2272 for (j = 1; j <= 7; ++j) {
2273 // odd elements are down and even elements are up
2275 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2276 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2277 } else if (j == 2) {
2278 xpos = -dbox2[0] + dits[0];
2279 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2280 } else if (j == 3) {
2281 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2282 zpos = 0. - dits[2] + .7 - dits[2];
2283 } else if (j == 4) {
2284 xpos = -dbox2[0] + dits[0];
2286 } else if (j == 5) {
2287 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2288 zpos = dits[2] + 0. - .7 + dits[2];
2289 } else if (j == 6) {
2290 xpos = -dbox2[0] + dits[0];
2291 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2292 } else if (j == 7) {
2293 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2294 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2296 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2299 // --- Place the larger ribs into their mother (IDV4)
2302 // --- Right ribs (just a matter of convention)
2304 xpos = .65 - dbox2[0] + dits[0];
2310 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2314 ypos = dsup[1] + 2.81 + dal1[1];
2315 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2319 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2320 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2324 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2325 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2327 // --- Silicon (chip)
2329 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2330 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2334 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2335 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2339 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2341 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2343 // --- Right ribs (just a matter of convention)
2348 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2352 ypos = -(dsup[1] + 2.81 + dal1[1]);
2353 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2357 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2358 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2362 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2364 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2366 // --- Silicon (chip)
2368 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2369 2. + dal2[1] * 2. + dchi[1]);
2370 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2374 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2375 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2376 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2380 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2381 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2382 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2384 // --- Place the end-ladder stuff into its mother (IDV1)
2387 // --- Negative-Z end-ladder
2390 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2394 xpos = dbox2[0] - dpcb[0];
2395 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2399 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2400 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2404 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2405 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2407 // --- Silicon (bus)
2409 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2410 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2412 // --- Positive-Z end-ladder
2415 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2419 xpos = dbox2[0] - dpcb[0];
2420 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2424 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2425 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2429 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2430 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2432 // --- Silicon (bus)
2434 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2435 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2437 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2438 // mother volume (IT34)
2439 // Odd elements have large ribs and even elements have small ribs
2441 for (i = 1; i <= 24; ++i) {
2442 atheta = (i-1) * 15.;
2443 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2446 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2447 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2449 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2451 rzero = (24.0+22.8)/2.;
2452 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2453 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2455 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2459 //************************************************************************
2464 //************************************************************************
2466 // --- Define SSD with the 35+39 lay-out
2468 if (fMinorVersionV3 < 3) {
2470 //--- Define ghost volume containing the Strip Detectors and fill it with air
2473 xxm = (49.999-3.)/(70.-25.);
2477 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2478 (37.-27)/xxm-(49.998-37.)/xxm;
2481 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2485 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2489 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2490 (37.-27)/xxm+(49.998-37.)/xxm;
2493 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2494 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2495 gMC->Gsatt("IT56", "SEEN", 0);
2499 // GOTO 5678 ! skip ITS layer no. 5
2501 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2502 // it with air or vacuum
2504 dbox1[0] = (0.0600+2.*0.0150)/2.;
2506 dbox1[2] = 90.22/2.;
2507 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2509 // --- Make the ghost volume invisible
2511 gMC->Gsatt("ISV1", "SEEN", 0);
2513 // --- Define a ghost volume containing the electronics and cooling of
2514 // a single ladder of layer #5 and fill it with air or vacuum
2516 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2519 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2521 // --- Make the ghost volume invisible
2523 gMC->Gsatt("SSV1", "SEEN", 0);
2525 // --- Define a ghost volume containing the end-ladder stuff of
2526 // a single ladder of layer #5 and fill it with air or vacuum
2531 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2533 // --- Make the ghost volume invisible
2535 gMC->Gsatt("ELL5", "SEEN", 0);
2537 // --- Define a volume containing the sensitive part of the strips
2538 // (silicon, layer #5)
2543 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2545 // --- Define a volume containing the electronics of the strips
2546 // (silicon, layer #5)
2551 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2553 // --- Define the cooling tubes (aluminum, layer #5)
2556 dtub[1] = dtub[0] + .01;
2558 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2560 // --- Define the cooling fluid (water or freon, layer #5)
2565 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2566 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2568 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2576 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2577 dfra[6] = dfra[5] + .03;
2581 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2583 // --- Define the element connecting the triangles of the heat bridge
2584 // (carbon, layer #5)
2589 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2591 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2594 dpla[0] = (10./(8.*7.))/2.;
2597 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2599 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2601 dcop[0] = (2./(8.*7.))/2.;
2604 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2606 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2608 depx[0] = (30./(8.*7.))/2.;
2611 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2613 // --- Define the part of the end-ladder stuff made of silicon (bus)
2616 dsil[0] = (20./(8.*7.))/2.;
2619 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2621 // --- Place the end-ladder stuff into its mother (ELL5)
2623 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2629 xpos = -dela[0] + dpla[0];
2630 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2634 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2635 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2639 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2640 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2642 // --- Silicon (bus)
2644 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2645 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2647 // --- Place the sensitive part of the strips into its mother (ISV1)
2650 for (j = 1; j <= 23; ++j) {
2651 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2652 else xpos = -dbox1[0] + dits[0];
2653 zpos = ((j - 1) - 11.) * 3.91;
2654 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2657 // --- Place the electronics of the strips into its mother (SSV1)
2660 for (j = 1; j <= 23; ++j) {
2661 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2662 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2663 zpos = ((j - 1) - 11.) * 3.91 + .85;
2664 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2667 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2669 xpos = -dsrv[0] + .41;
2672 // --- Left tube (just a matter of convention)
2675 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2676 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2678 // --- Right tube (just a matter of convention)
2681 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2682 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2684 // --- Place the heat bridge elements into their mother (SSV1)
2686 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2688 for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2689 // volume SSV1. This is the same number of
2690 // elements as SCH5 above. Done Bjorn S. Nilsen
2691 // April 4 2000. Error found by Ivana
2692 // Hrivnacova March 29 2000.
2693 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2694 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2697 // --- Place the elements connecting the triangles of the heat bridge
2698 // into their mother (SSV1)
2702 // --- Left element (just a matter of convention)
2704 xpos = -dsrv[0] + .47;
2705 ypos = -(2.1+0.015);
2706 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2708 // --- Right element
2710 xpos = -dsrv[0] + .47;
2712 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2716 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2718 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2720 // --- Place the ghost volumes containing the strip ladders (ISV1),
2721 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2722 // their mother volume (IT56)
2724 offset1 = TMath::ATan2(.9, 40.);
2726 rzero = dbox1[0] + 40.;
2727 runo = dbox1[0] * 2. + 40. + dsrv[0];
2728 rtwo = dbox1[0] * 2. + 40. + dela[0];
2729 for (i = 1; i <= 35; ++i) {
2730 atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
2731 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2733 // --- Strip ladders
2735 xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2736 ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2738 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2740 // --- Electronics/cooling
2742 xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2743 ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2745 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2747 // --- End-ladders (nagative-Z and positive-Z)
2749 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2750 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2751 zpos = -(dbox1[2] + dela[2] + 6.);
2752 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2753 zpos = dbox1[2] + dela[2] + 6.;
2754 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2760 // GOTO 5778 ! skip ITS layer no. 6
2762 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2763 // it with air or vacuum
2765 dbox2[0] = (0.0600+2.*0.0150)/2.;
2767 dbox2[2] = 101.95/2.;
2768 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2770 // --- Make the ghost volume invisible
2772 gMC->Gsatt("ISV2", "SEEN", 0);
2774 // --- Define a ghost volume containing the electronics and cooling of
2775 // a single ladder of layer #6 and fill it with air or vacuum
2777 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2779 dsrv[2] = 101.95/2.;
2780 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2782 // --- Make the ghost volume invisible
2784 gMC->Gsatt("SSV2", "SEEN", 0);
2786 // --- Define a ghost volume containing the end-ladder stuff of
2787 // a single ladder of layer #6 and fill it with air or vacuum
2792 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2794 // --- Make the ghost volume invisible
2796 gMC->Gsatt("ELL6", "SEEN", 0);
2798 // --- Define a volume containing the sensitive part of the strips
2799 // (silicon, layer #6)
2804 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2806 // --- Define a volume containing the electronics of the strips
2807 // (silicon, layer #6)
2812 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2814 // --- Define the cooling tubes (aluminum, layer #6)
2817 dtub[1] = dtub[0] + .01;
2818 dtub[2] = 101.95/2.;
2819 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2821 // --- Define the cooling fluid (water or freon, layer #6)
2825 dwat[2] = 101.95/2.;
2826 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2827 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2829 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2837 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2838 dfra[6] = dfra[5] + .03;
2842 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2844 // --- Define the element connecting the triangles of the heat bridge
2845 // (carbon, layer #6)
2849 dcei[2] = 101.95/2.;
2850 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2852 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2855 dpla[0] = (10./(8.*7.))/2.;
2858 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2860 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2862 dcop[0] = (2./(8.*7.))/2.;
2865 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2867 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2869 depx[0] = (30./(8.*7.))/2.;
2872 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2874 // --- Define the part of the end-ladder stuff made of silicon (bus)
2877 dsil[0] = (20./(8.*7.))/2.;
2880 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2882 // --- Place the end-ladder stuff into its mother (ELL5)
2884 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2890 xpos = -dela[0] + dpla[0];
2891 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2895 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2896 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2900 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2901 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2903 // --- Silicon (bus)
2905 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2906 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2908 // --- Place the sensitive part of the strips into its mother (ISV2)
2911 for (j = 1; j <= 26; ++j) {
2912 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2913 else xpos = -dbox2[0] + dits[0];
2914 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2915 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2918 // --- Place the electronics of the strips into its mother (SSV2)
2921 for (j = 1; j <= 26; ++j) {
2922 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2923 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2924 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2925 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2928 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2930 xpos = -dsrv[0] + .41;
2933 // --- Left tube (just a matter of convention)
2936 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2937 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2939 // --- Right tube (just a matter of convention)
2942 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2943 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2945 // --- Place the heat bridge elements into their mother (SSV2)
2947 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2949 for (j = 1; j <= 27; ++j) {
2950 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2951 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2954 // --- Place the elements connecting the triangles of the heat bridge
2955 // into their mother (SSV2)
2959 // --- Left element (just a matter of convention)
2961 xpos = -dsrv[0] + .47;
2962 ypos = -(2.1+0.015);
2963 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2965 // --- Right element
2967 xpos = -dsrv[0] + .47;
2969 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2973 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2975 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2977 // --- Place the ghost volumes containing the strip ladders (ISV2),
2978 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2979 // their mother volume (IT56)
2981 offset1 = TMath::ATan2(1., 45.);
2983 rzero = dbox2[0] + 45.;
2984 runo = dbox2[0] * 2. + 45. + dsrv[0];
2985 rtwo = dbox2[0] * 2. + 45. + dela[0];
2986 for (i = 1; i <= 39; ++i) {
2987 atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
2988 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2990 // --- Strip ladders
2992 xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
2993 ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
2995 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2997 // --- Electronics/cooling
2999 xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3000 ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3002 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3004 // --- End-ladders (nagative-Z and positive-Z)
3006 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3007 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3008 zpos = -(dbox2[2] + dela[2] + 6.);
3009 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3010 zpos = dbox2[2] + dela[2] + 6.;
3011 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3016 // --- Define SSD with the 32+36 lay-out
3018 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
3020 //--- Define ghost volume containing the Strip Detectors and fill it with air
3023 xxm = (49.999-3.)/(70.-25.);
3027 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
3028 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3031 dgh[6] = -25. - (9.-3.01) / xxm -
3032 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3035 dgh[9] = (9.-3.01) / xxm + 25. +
3036 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3039 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3040 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3043 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3044 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3045 gMC->Gsatt("IT56", "SEEN", 0);
3049 // GOTO 6678 ! skip ITS layer no. 5
3051 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3052 // it with air or vacuum
3054 dbox1[0] = (0.0600+2.*0.0150)/2.;
3056 dbox1[2] = 86.31/2.;
3057 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3059 // --- Make the ghost volume invisible
3061 gMC->Gsatt("ISV1", "SEEN", 0);
3063 // --- Define a ghost volume containing the electronics and cooling of
3064 // a single ladder of layer #5 and fill it with air or vacuum
3066 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3069 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3071 // --- Make the ghost volume invisible
3073 gMC->Gsatt("SSV1", "SEEN", 0);
3075 // --- Define a ghost volume containing the end-ladder stuff of
3076 // a single ladder of layer #5 and fill it with air or vacuum
3081 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3083 // --- Make the ghost volume invisible
3085 gMC->Gsatt("ELL5", "SEEN", 0);
3087 // --- Define a volume containing the sensitive part of the strips
3088 // (silicon, layer #5)
3093 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3095 // --- Define a volume containing the electronics of the strips
3096 // (silicon, layer #5)
3101 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3103 // --- Define the cooling tubes (aluminum, layer #5)
3106 dtub[1] = dtub[0] + .01;
3108 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3110 // --- Define the cooling fluid (water or freon, layer #5)
3115 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3116 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3118 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3126 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3127 dfra[6] = dfra[5] + .03;
3131 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3133 // --- Define the element connecting the triangles of the heat bridge
3134 // (carbon, layer #5)
3139 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3141 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3144 dpla[0] = (10./(8.*7.))/2;
3147 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3149 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3151 dcop[0] = (2./(8.*7.))/2;
3154 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3156 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3158 depx[0] = (30./(8.*7.))/2.;
3161 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3163 // --- Define the part of the end-ladder stuff made of silicon (bus)
3166 dsil[0] = (20./(8.*7.))/2.;
3169 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3171 // --- Place the end-ladder stuff into its mother (ELL5)
3173 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3179 xpos = -dela[0] + dpla[0];
3180 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3184 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3185 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3189 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3190 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3192 // --- Silicon (bus)
3194 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3195 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3197 // --- Place the sensitive part of the strips into its mother (ISV1)
3200 for (j = 1; j <= 22; ++j) {
3201 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3202 else xpos = -dbox1[0] + dits[0];
3203 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3204 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3207 // --- Place the electronics of the strips into its mother (SSV1)
3210 for (j = 1; j <= 22; ++j) {
3211 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3212 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3213 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3214 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3217 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3219 xpos = -dsrv[0] + .41;
3222 // --- Left tube (just a matter of convention)
3225 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3226 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3228 // --- Right tube (just a matter of convention)
3231 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3232 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3234 // --- Place the heat bridge elements into their mother (SSV1)
3236 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3238 for (j = 1; j <= 23; ++j) {
3239 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3240 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3243 // --- Place the elements connecting the triangles of the heat bridge
3244 // into their mother (SSV1)
3248 // --- Left element (just a matter of convention)
3250 xpos = -dsrv[0] + .47;
3251 ypos = -(2.1+0.015);
3252 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3254 // --- Right element
3256 xpos = -dsrv[0] + .47;
3258 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3262 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3264 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3266 // --- Place the ghost volumes containing the strip ladders (ISV1),
3267 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3268 // their mother volume (IT56)
3270 offset1 = TMath::ATan2(.8, 36.6);
3272 rzero = dbox1[0] + 36.6;
3273 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3274 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3275 for (i = 1; i <= 32; ++i) {
3276 atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
3277 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3279 // --- Strip ladders
3281 xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3282 ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3284 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3286 // --- Electronics/cooling
3288 xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3289 ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3291 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3293 // --- End-ladders (nagative-Z and positive-Z)
3295 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3296 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3297 zpos = -(dbox1[2] + dela[2] + 6.);
3298 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3299 zpos = dbox1[2] + dela[2] + 6.;
3300 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3306 // GOTO 6778 ! skip ITS layer no. 6
3308 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3309 // it with air or vacuum
3311 dbox2[0] = (0.0600+2.*0.0150)/2.;
3313 dbox2[2] = 94.13/2.;
3314 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3316 // --- Make the ghost volume invisible
3318 gMC->Gsatt("ISV2", "SEEN", 0);
3320 // --- Define a ghost volume containing the electronics and cooling of
3321 // a single ladder of layer #6 and fill it with air or vacuum
3323 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3326 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3328 // --- Make the ghost volume invisible
3330 gMC->Gsatt("SSV2", "SEEN", 0);
3332 // --- Define a ghost volume containing the end-ladder stuff of
3333 // a single ladder of layer #6 and fill it with air or vacuum
3338 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3340 // --- Make the ghost volume invisible
3342 gMC->Gsatt("ELL6", "SEEN", 0);
3344 // --- Define a volume containing the sensitive part of the strips
3345 // (silicon, layer #6)
3350 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3352 // --- Define a volume containing the electronics of the strips
3353 // (silicon, layer #6)
3358 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3360 // --- Define the cooling tubes (aluminum, layer #6)
3363 dtub[1] = dtub[0] + .01;
3365 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3367 // --- Define the cooling fluid (water or freon, layer #6)
3372 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3373 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3375 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3383 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3384 dfra[6] = dfra[5] + .03;
3388 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3390 // --- Define the element connecting the triangles of the heat bridge
3391 // (carbon, layer #6)
3396 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3398 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3401 dpla[0] = (10./(8.*7.))/2;
3404 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3406 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3408 dcop[0] = (2./(8.*7.))/2;
3411 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3413 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3415 depx[0] = (30./(8.*7.))/2.;
3418 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3420 // --- Define the part of the end-ladder stuff made of silicon (bus)
3423 dsil[0] = (20./(8.*7.))/2.;
3426 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3428 // --- Place the end-ladder stuff into its mother (ELL5)
3430 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3436 xpos = -dela[0] + dpla[0];
3437 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3441 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3442 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3446 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3447 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3449 // --- Silicon (bus)
3451 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3452 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3454 // --- Place the sensitive part of the strips into its mother (ISV2)
3457 for (j = 1; j <= 24; ++j) {
3458 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3459 else xpos = dbox2[0] - dits[0];
3460 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3461 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3464 // --- Place the electronics of the strips into its mother (SSV2)
3467 for (j = 1; j <= 24; ++j) {
3468 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3469 else xpos = -dsrv[0] + .28;
3470 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3471 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3474 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3476 xpos = -dsrv[0] + .41;
3479 // --- Left tube (just a matter of convention)
3482 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3483 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3485 // --- Right tube (just a matter of convention)
3488 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3489 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3491 // --- Place the heat bridge elements into their mother (SSV2)
3493 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3495 for (j = 1; j <= 25; ++j) {
3496 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3497 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3500 // --- Place the elements connecting the triangles of the heat bridge
3501 // into their mother (SSV2)
3505 // --- Left element (just a matter of convention)
3507 xpos = -dsrv[0] + .47;
3508 ypos = -(2.1+0.015);
3509 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3511 // --- Right element
3513 xpos = -dsrv[0] + .47;
3515 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3519 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3521 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3523 // --- Place the ghost volumes containing the strip ladders (ISV2),
3524 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3525 // their mother volume (IT56)
3527 offset1 = TMath::ATan2(.9, 41.2);
3529 rzero = dbox2[0] + 41.2;
3530 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3531 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3532 for (i = 1; i <= 36; ++i) {
3533 atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
3534 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3536 // --- Strip ladders
3538 xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3539 ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3541 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3543 // --- Electronics/cooling
3545 xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3546 ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3548 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3550 // --- End-ladders (nagative-Z and positive-Z)
3552 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3553 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3554 zpos = -(dbox2[2] + dela[2] + 6.);
3555 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3556 zpos = dbox2[2] + dela[2] + 6.;
3557 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3563 //************************************************************************
3565 //* E N D - C A P S A N D F R A M E S *
3566 //* ========================================= *
3568 //************************************************************************
3570 // --- Define a dummy cylinder for multiple scattering tests
3572 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3575 // DITS(2)=DITS(1)+0.1
3577 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3578 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3581 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3583 // GOTO 8901 ! skip outer wall
3585 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3588 dits[1] = dits[0] + .06926;
3589 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3591 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3592 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3597 // --- The frame between the end-caps (octagonal lay-out) ---
3599 // GOTO 9012 ! skip octagonal frame
3601 if (fMinorVersionV3 == 1) {
3606 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3609 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3611 offset = angle / 2.;
3612 for (i = 0; i < 8; ++i) {
3613 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3614 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3616 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3617 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3621 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;
3622 aphi2 = 180. - aphi1;
3623 xpos = (xtra[0] + xtra[1]) / 2.;
3624 ypos = (ytra[0] + ytra[1]) / 2.;
3625 zpos = dtra[2] / 2.;
3626 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3629 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3630 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3631 zpos = -dtra[2] / 2.;
3632 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3635 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3636 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3639 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;
3640 aphi1 = 180. - aphi2;
3641 xpos = (xtra[1] + xtra[2]) / 2.;
3642 ypos = (ytra[1] + ytra[2]) / 2.;
3643 zpos = dtra[2] / 2.;
3644 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3647 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3648 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3649 zpos = -dtra[2] / 2.;
3650 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3653 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3654 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3657 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;
3658 aphi2 = 180. - aphi1;
3659 xpos = (xtra[2] + xtra[3]) / 2.;
3660 ypos = (ytra[2] + ytra[3]) / 2.;
3661 zpos = dtra[2] / 2.;
3662 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3665 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3666 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3667 zpos = -dtra[2] / 2.;
3668 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3671 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3672 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3675 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;
3676 aphi1 = 180. - aphi2;
3677 xpos = (xtra[3] + xtra[4]) / 2.;
3678 ypos = (ytra[3] + ytra[4]) / 2.;
3679 zpos = dtra[2] / 2.;
3680 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3683 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3684 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3685 zpos = -dtra[2] / 2.;
3686 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3689 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3690 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3693 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;
3694 aphi1 = 180. - aphi2;
3695 xpos = (xtra[4] + xtra[5]) / 2.;
3696 ypos = (ytra[4] + ytra[5]) / 2.;
3697 zpos = dtra[2] / 2.;
3698 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3701 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3702 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3703 zpos = -dtra[2] / 2.;
3704 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3707 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3708 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3711 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;
3712 aphi2 = 180. - aphi1;
3713 xpos = (xtra[5] + xtra[6]) / 2.;
3714 ypos = (ytra[5] + ytra[6]) / 2.;
3715 zpos = dtra[2] / 2.;
3716 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3719 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3720 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3721 zpos = -dtra[2] / 2.;
3722 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3725 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3726 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3729 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;
3730 aphi1 = 180. - aphi2;
3731 xpos = (xtra[6] + xtra[7]) / 2.;
3732 ypos = (ytra[6] + ytra[7]) / 2.;
3733 zpos = dtra[2] / 2.;
3734 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3737 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3738 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3739 zpos = -dtra[2] / 2.;
3740 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3743 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3744 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3747 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;
3748 aphi2 = 180. - aphi1;
3749 xpos = (xtra[7] + xtra[0]) / 2.;
3750 ypos = (ytra[7] + ytra[0]) / 2.;
3751 zpos = dtra[2] / 2.;
3752 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3755 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3756 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3757 zpos = -dtra[2] / 2.;
3758 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3761 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3762 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3765 } else if (fMinorVersionV3 == 4) {
3771 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3774 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3776 offset = angle / 2.;
3777 for (i = 0; i < 8; ++i) {
3778 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3779 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3781 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3782 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3786 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;
3787 aphi2 = 180. - aphi1;
3788 xpos = (xtra[0] + xtra[1]) / 2.;
3789 ypos = (ytra[0] + ytra[1]) / 2.;
3790 zpos = dtra[2] / 2.;
3791 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3794 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3795 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3796 zpos = -dtra[2] / 2.;
3797 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3800 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3801 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3804 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;
3805 aphi1 = 180. - aphi2;
3806 xpos = (xtra[1] + xtra[2]) / 2.;
3807 ypos = (ytra[1] + ytra[2]) / 2.;
3808 zpos = dtra[2] / 2.;
3809 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3812 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3813 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3814 zpos = -dtra[2] / 2.;
3815 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3818 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3819 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3822 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;
3823 aphi2 = 180. - aphi1;
3824 xpos = (xtra[2] + xtra[3]) / 2.;
3825 ypos = (ytra[2] + ytra[3]) / 2.;
3826 zpos = dtra[2] / 2.;
3827 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3830 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3831 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3832 zpos = -dtra[2] / 2.;
3833 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3836 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3837 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3840 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;
3841 aphi1 = 180. - aphi2;
3842 xpos = (xtra[3] + xtra[4]) / 2.;
3843 ypos = (ytra[3] + ytra[4]) / 2.;
3844 zpos = dtra[2] / 2.;
3845 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3848 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3849 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3850 zpos = -dtra[2] / 2.;
3851 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3854 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3855 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3858 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;
3859 aphi1 = 180. - aphi2;
3860 xpos = (xtra[4] + xtra[5]) / 2.;
3861 ypos = (ytra[4] + ytra[5]) / 2.;
3862 zpos = dtra[2] / 2.;
3863 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3866 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3867 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3868 zpos = -dtra[2] / 2.;
3869 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3872 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3873 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3876 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;
3877 aphi2 = 180. - aphi1;
3878 xpos = (xtra[5] + xtra[6]) / 2.;
3879 ypos = (ytra[5] + ytra[6]) / 2.;
3880 zpos = dtra[2] / 2.;
3881 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3884 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3885 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3886 zpos = -dtra[2] / 2.;
3887 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3890 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3891 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3894 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;
3895 aphi1 = 180. - aphi2;
3896 xpos = (xtra[6] + xtra[7]) / 2.;
3897 ypos = (ytra[6] + ytra[7]) / 2.;
3898 zpos = dtra[2] / 2.;
3899 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3902 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3903 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3904 zpos = -dtra[2] / 2.;
3905 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3908 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3909 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3912 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;
3913 aphi2 = 180. - aphi1;
3914 xpos = (xtra[7] + xtra[0]) / 2.;
3915 ypos = (ytra[7] + ytra[0]) / 2.;
3916 zpos = dtra[2] / 2.;
3917 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3920 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3921 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3922 zpos = -dtra[2] / 2.;
3923 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3926 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3927 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3933 // --- The frame between the end-caps (hexagonal lay-out) ---
3935 // GOTO 9123 ! skip hexagonal frame
3937 if (fMinorVersionV3 == 2) {
3942 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3948 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3950 offset = angle / 2.;
3951 for (i = 0; i < 6; ++i) {
3952 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
3953 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
3955 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
3956 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3961 xpos = (xtra1[0] + xtra1[1]) / 2.;
3962 ypos = (ytra1[0] + ytra1[1]) / 2.;
3964 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
3967 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3968 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3972 xpos = (xtra1[1] + xtra1[2]) / 2.;
3973 ypos = (ytra1[1] + ytra1[2]) / 2.;
3975 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
3978 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3979 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3983 xpos = (xtra1[2] + xtra1[3]) / 2.;
3984 ypos = (ytra1[2] + ytra1[3]) / 2.;
3986 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
3989 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3990 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3994 xpos = (xtra1[3] + xtra1[4]) / 2.;
3995 ypos = (ytra1[3] + ytra1[4]) / 2.;
3997 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4000 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4001 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4005 xpos = (xtra1[4] + xtra1[5]) / 2.;
4006 ypos = (ytra1[4] + ytra1[5]) / 2.;
4008 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4011 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4012 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4016 xpos = (xtra1[5] + xtra1[0]) / 2.;
4017 ypos = (ytra1[5] + ytra1[0]) / 2.;
4019 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4022 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4023 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4026 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4027 aphi1 = 180. - aphi2;
4028 xpos = (xtra1[0] + xtra1[1]) / 2.;
4029 ypos = (ytra1[0] + ytra1[1]) / 2.;
4030 zpos = dtra2[2] / 2.;
4031 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4034 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4035 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4036 zpos = -dtra2[2] / 2.;
4037 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4040 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4041 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4044 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4045 aphi2 = 180. - aphi1;
4046 xpos = (xtra1[1] + xtra1[2]) / 2.;
4047 ypos = (ytra1[1] + ytra1[2]) / 2.;
4048 zpos = dtra2[2] / 2.;
4049 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4052 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4053 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4054 zpos = -dtra2[2] / 2.;
4055 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4058 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4059 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4062 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4063 aphi1 = 180. - aphi2;
4064 xpos = (xtra1[2] + xtra1[3]) / 2.;
4065 ypos = (ytra1[2] + ytra1[3]) / 2.;
4066 zpos = dtra2[2] / 2.;
4067 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4070 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4071 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4072 zpos = -dtra2[2] / 2.;
4073 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4076 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4077 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4079 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))
4080 - 50.*50.))) * kraddeg;
4081 aphi2 = 180. - aphi1;
4082 xpos = (xtra1[2] + xtra1[3]) / 2.;
4083 ypos = (ytra1[2] + ytra1[3]) / 2.;
4084 zpos = dtra2[2] / 2.;
4085 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4088 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4089 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4090 zpos = -dtra2[2] / 2.;
4091 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4094 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4095 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4098 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4099 aphi1 = 180. - aphi2;
4100 xpos = (xtra1[3] + xtra1[4]) / 2.;
4101 ypos = (ytra1[3] + ytra1[4]) / 2.;
4102 zpos = dtra2[2] / 2.;
4103 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4106 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4107 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4108 zpos = -dtra2[2] / 2.;
4109 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4112 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4113 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4116 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4117 aphi2 = 180. - aphi1;
4118 xpos = (xtra1[4] + xtra1[5]) / 2.;
4119 ypos = (ytra1[4] + ytra1[5]) / 2.;
4120 zpos = dtra2[2] / 2.;
4121 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4124 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4125 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4126 zpos = -dtra2[2] / 2.;
4127 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4130 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4131 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4134 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4135 aphi1 = 180. - aphi2;
4136 xpos = (xtra1[5] + xtra1[0]) / 2.;
4137 ypos = (ytra1[5] + ytra1[0]) / 2.;
4138 zpos = dtra2[2] / 2.;
4139 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4142 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4143 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4144 zpos = -dtra2[2] / 2.;
4145 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4148 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4149 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4151 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4152 aphi2 = 180. - aphi1;
4153 xpos = (xtra1[5] + xtra1[0]) / 2.;
4154 ypos = (ytra1[5] + ytra1[0]) / 2.;
4155 zpos = dtra2[2] / 2.;
4156 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4159 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4160 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4161 zpos = -dtra2[2] / 2.;
4162 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4165 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4166 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4169 } else if (fMinorVersionV3 == 5) {
4175 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4181 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4183 offset = angle / 2.;
4184 for (i = 0; i < 6; ++i) {
4185 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
4186 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
4188 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
4189 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4194 xpos = (xtra1[0] + xtra1[1]) / 2.;
4195 ypos = (ytra1[0] + ytra1[1]) / 2.;
4197 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
4200 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4201 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4205 xpos = (xtra1[1] + xtra1[2]) / 2.;
4206 ypos = (ytra1[1] + ytra1[2]) / 2.;
4208 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4211 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4212 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4216 xpos = (xtra1[2] + xtra1[3]) / 2.;
4217 ypos = (ytra1[2] + ytra1[3]) / 2.;
4219 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4222 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4223 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4227 xpos = (xtra1[3] + xtra1[4]) / 2.;
4228 ypos = (ytra1[3] + ytra1[4]) / 2.;
4230 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4233 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4234 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4238 xpos = (xtra1[4] + xtra1[5]) / 2.;
4239 ypos = (ytra1[4] + ytra1[5]) / 2.;
4241 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4244 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4245 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4249 xpos = (xtra1[5] + xtra1[0]) / 2.;
4250 ypos = (ytra1[5] + ytra1[0]) / 2.;
4252 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4255 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4256 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4259 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4260 aphi1 = 180. - aphi2;
4261 xpos = (xtra1[0] + xtra1[1]) / 2.;
4262 ypos = (ytra1[0] + ytra1[1]) / 2.;
4263 zpos = dtra2[2] / 2.;
4264 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4267 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4268 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4269 zpos = -dtra2[2] / 2.;
4270 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4273 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4274 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4277 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4278 aphi2 = 180. - aphi1;
4279 xpos = (xtra1[1] + xtra1[2]) / 2.;
4280 ypos = (ytra1[1] + ytra1[2]) / 2.;
4281 zpos = dtra2[2] / 2.;
4282 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4285 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4286 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4287 zpos = -dtra2[2] / 2.;
4288 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4291 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4292 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4295 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4296 aphi1 = 180. - aphi2;
4297 xpos = (xtra1[2] + xtra1[3]) / 2.;
4298 ypos = (ytra1[2] + ytra1[3]) / 2.;
4299 zpos = dtra2[2] / 2.;
4300 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4303 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4304 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4305 zpos = -dtra2[2] / 2.;
4306 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4309 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4310 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4312 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4313 aphi2 = 180. - aphi1;
4314 xpos = (xtra1[2] + xtra1[3]) / 2.;
4315 ypos = (ytra1[2] + ytra1[3]) / 2.;
4316 zpos = dtra2[2] / 2.;
4317 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4320 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4321 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4322 zpos = -dtra2[2] / 2.;
4323 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4326 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4327 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4330 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4331 aphi1 = 180. - aphi2;
4332 xpos = (xtra1[3] + xtra1[4]) / 2.;
4333 ypos = (ytra1[3] + ytra1[4]) / 2.;
4334 zpos = dtra2[2] / 2.;
4335 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4338 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4339 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4340 zpos = -dtra2[2] / 2.;
4341 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4344 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4345 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4348 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4349 aphi2 = 180. - aphi1;
4350 xpos = (xtra1[4] + xtra1[5]) / 2.;
4351 ypos = (ytra1[4] + ytra1[5]) / 2.;
4352 zpos = dtra2[2] / 2.;
4353 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4356 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4357 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4358 zpos = -dtra2[2] / 2.;
4359 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4362 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4363 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4366 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4367 aphi1 = 180. - aphi2;
4368 xpos = (xtra1[5] + xtra1[0]) / 2.;
4369 ypos = (ytra1[5] + ytra1[0]) / 2.;
4370 zpos = dtra2[2] / 2.;
4371 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4374 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4375 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4376 zpos = -dtra2[2] / 2.;
4377 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4380 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4381 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4383 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4384 aphi2 = 180. - aphi1;
4385 xpos = (xtra1[5] + xtra1[0]) / 2.;
4386 ypos = (ytra1[5] + ytra1[0]) / 2.;
4387 zpos = dtra2[2] / 2.;
4388 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4391 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4392 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4393 zpos = -dtra2[2] / 2.;
4394 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4397 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4398 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4404 // --- Define the end-caps
4406 // GOTO 9234 ! skip both end-caps
4408 // --- Define the Z>0 end-cap
4410 // GOTO 9345 ! skip the Z>0 end-cap
4415 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4416 dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4419 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4420 // end-ladder electro
4421 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4422 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4424 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4426 // In the Simonetti's drawings 52. In the TP 50.
4430 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4431 // end-ladder electro
4432 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4433 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4437 dtube[2] = 26.8/2./10.;
4440 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4442 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4443 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4449 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4450 // end-ladder electron
4453 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4454 // end-ladder electronics
4460 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4461 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4467 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4471 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4478 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4479 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4481 if (fMinorVersionV3 < 3 ) {
4483 dpgon[0] = offset2 + 360./(2.*35.);
4487 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4491 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4498 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4499 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4501 dpgon[0] = offset2 + 360./(2.*39.);
4505 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4509 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4516 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4517 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4519 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4521 dpgon[0] = offset2 + 5.625;
4525 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4526 // end-ladder electronics
4529 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4530 // end-ladder electr
4536 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4537 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4539 dpgon[0] = offset2 + 5.;
4543 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4544 // end-ladder electronics
4547 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4548 // end-ladder electr
4554 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4555 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4560 // --- Define the Z<0 end-cap
4562 // GOTO 9456 ! skip the Z<0 end-cap
4565 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4566 dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4571 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4572 // end-ladder electr
4573 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4575 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4577 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4579 // In the Simonetti's drawings 52. In the TP 50.
4583 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4584 // end-ladder electr
4585 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4587 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4591 dtube[2] = 26.8/2./10.;
4594 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4596 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4598 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4604 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4605 // end-ladder electronics
4608 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4609 // end-ladder electro
4615 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4616 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4622 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4626 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4633 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4634 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4636 if (fMinorVersionV3 < 3) {
4638 dpgon[0] = offset2 + 360./(2.*35.);
4642 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4646 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4653 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4654 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4656 dpgon[0] = offset2 + 360./(2.*39.);
4660 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4664 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4671 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4672 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4674 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4676 dpgon[0] = offset2 + 5.625;
4680 dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4681 // end-ladder electronics
4684 dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4685 // end-ladder electr
4691 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4692 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4694 dpgon[0] = offset2 + 5.;
4698 dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4699 // end-ladder electronics
4702 dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4703 // end-ladder electr
4709 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4710 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4716 // --- Outputs the geometry tree in the EUCLID/CAD format
4719 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4721 fMinorVersion = fMinorVersionV3;
4723 //_____________________________________________________________________________
4724 void AliITSv3::CreateMaterials(){
4725 ////////////////////////////////////////////////////////////////////////
4727 // Create ITS materials
4728 // This function defines the default materials used in the Geant
4729 // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
4730 // In general it is automatically replaced by
4731 // the CreatMaterials routine defined in AliITSv?. Should the function
4732 // CreateMaterials not exist for the geometry version you are using this
4733 // one is used. See the definition found in AliITSv5 or the other routine
4734 // for a complete definition.
4737 Float_t awat[2] = { 1.00794,15.9994 };
4738 Float_t zwat[2] = { 1.,8. };
4739 Float_t wwat[2] = { 2.,1. };
4740 Float_t denswat = 1.;
4742 Float_t afre[2] = { 12.011,18.9984032 };
4743 Float_t zfre[2] = { 6.,9. };
4744 Float_t wfre[2] = { 5.,12. };
4745 Float_t densfre = 1.5;
4747 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4748 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4749 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4750 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4751 Float_t denscer = 3.6;
4753 // 60% SiO2 , 40% G10FR4
4755 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4756 Float_t zpcb[3] = { 14.,8.,8.875 };
4757 Float_t wpcb[3] = { .28,.32,.4 };
4758 Float_t denspcb = 1.8;
4760 Float_t apoly[2] = { 12.01,1. };
4761 Float_t zpoly[2] = { 6.,1. };
4762 Float_t wpoly[2] = { .33,.67 };
4764 Float_t zserv[4] = { 1.,6.,26.,29. };
4765 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4766 Float_t wserv[4] = { .014,.086,.42,.48 };
4768 Int_t isxfld = gAlice->Field()->Integ();
4769 Float_t sxmgmx = gAlice->Field()->Max();
4772 // --- Define the various materials for GEANT ---
4774 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4776 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4777 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4778 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4779 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4781 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4782 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4783 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4784 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4785 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4787 AliMedium(0, "SPD Si$", 0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4788 AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4789 AliMedium(2, "SPD Si bus$", 2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4790 AliMedium(3, "SPD C$", 3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4791 AliMedium(4, "SPD Air$", 4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4792 AliMedium(5, "SPD Vacuum$", 5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4793 AliMedium(6, "SPD Al$", 6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4794 AliMedium(7, "SPD Water $", 7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4795 AliMedium(8, "SPD Freon$", 8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4797 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4799 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4800 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4801 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4802 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4804 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4805 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4806 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4807 // After a call with ratios by number (negative number of elements),
4808 // the ratio array is changed to the ratio by weight, so all successive
4809 // calls with the same array must specify the number of elements as
4811 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4812 // After a call with ratios by number (negative number of elements),
4813 // the ratio array is changed to the ratio by weight, so all successive
4814 // calls with the same array must specify the number of elements as
4816 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4817 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4818 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4819 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4820 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4823 AliMedium(25, "SDD Si$", 25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4824 AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4825 AliMedium(27, "SDD Si bus$", 27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4826 AliMedium(28, "SDD C$", 28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4827 AliMedium(29, "SDD Air$", 29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4828 AliMedium(30, "SDD Vacuum$", 30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4829 AliMedium(31, "SDD Al$", 31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4830 AliMedium(32, "SDD Water $", 32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4831 AliMedium(33, "SDD Freon$", 33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4832 AliMedium(34, "SDD PCB$", 34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4833 AliMedium(35, "SDD Copper$", 35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4834 AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4835 AliMedium(37, "SDD Kapton$", 37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4837 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4839 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4840 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4841 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4842 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4844 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4845 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4846 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4847 // After a call with ratios by number (negative number of elements),
4848 // the ratio array is changed to the ratio by weight, so all successive
4849 // calls with the same array must specify the number of elements as
4851 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
4852 // After a call with ratios by number (negative number of elements),
4853 // the ratio array is changed to the ratio by weight, so all successive
4854 // calls with the same array must specify the number of elements as
4856 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4857 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4858 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4859 // After a call with ratios by number (negative number of elements),
4860 // the ratio array is changed to the ratio by weight, so all successive
4861 // calls with the same array must specify the number of elements as
4863 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4864 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4866 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4868 AliMedium(50, "SSD Si$", 50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4869 AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4870 AliMedium(52, "SSD Si bus$", 52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4871 AliMedium(53, "SSD C$", 53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4872 AliMedium(54, "SSD Air$", 54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4873 AliMedium(55, "SSD Vacuum$", 55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4874 AliMedium(56, "SSD Al$", 56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4875 AliMedium(57, "SSD Water $", 57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4876 AliMedium(58, "SSD Freon$", 58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4877 AliMedium(59, "SSD PCB$", 59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4878 AliMedium(60, "SSD Copper$", 60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4879 AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4880 AliMedium(62, "SSD Kapton$", 62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4881 AliMedium(63, "SSD G10FR4$", 63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4883 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4885 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4887 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4888 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4889 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4890 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4891 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4892 // After a call with ratios by number (negative number of elements),
4893 // the ratio array is changed to the ratio by weight, so all successive
4894 // calls with the same array must specify the number of elements as
4896 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4898 AliMedium(75,"GEN C$", 75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4899 AliMedium(76,"GEN Air$", 76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4900 AliMedium(77,"GEN Vacuum$", 77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
4901 AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4902 AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4903 AliMedium(80,"GEN Copper$", 80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4904 AliMedium(81,"GEN Water $", 81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4906 //_____________________________________________________________________________
4907 void AliITSv3::Init(){
4908 ////////////////////////////////////////////////////////////////////////
4909 // Initialise the ITS after it has been created.
4910 ////////////////////////////////////////////////////////////////////////
4914 fMinorVersion = fMinorVersionV3;
4916 //_____________________________________________________________________________
4917 void AliITSv3::StepManager(){
4918 ////////////////////////////////////////////////////////////////////////
4919 // Called for every step in the ITS, then calles the AliITShit class
4920 // creator with the information to be recoreded about that hit.
4921 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4922 // printing of information to a file which can be used to create a .det
4923 // file read in by the routine CreateGeometry(). If set to 0 or any other
4924 // value except 1, the default behavior, then no such file is created nor
4925 // it the extra variables and the like used in the printing allocated.
4926 ////////////////////////////////////////////////////////////////////////
4930 TLorentzVector position, momentum;
4931 TClonesArray &lhits = *fHits;
4932 #if ALIITSPRINTGEOM==1
4935 Float_t xl[3],xt[3],angl[6];
4936 // Float_t par[20],att[20];
4938 static Bool_t first=kTRUE,printit[6][50][50];
4939 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4940 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4948 if(gMC->IsTrackInside()) vol[3] += 1;
4949 if(gMC->IsTrackEntering()) vol[3] += 2;
4950 if(gMC->IsTrackExiting()) vol[3] += 4;
4951 if(gMC->IsTrackOut()) vol[3] += 8;
4952 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4953 if(gMC->IsTrackStop()) vol[3] += 32;
4954 if(gMC->IsTrackAlive()) vol[3] += 64;
4956 // Fill hit structure.
4957 if(!(gMC->TrackCharge())) return;
4959 // Only entering charged tracks
4960 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4962 id=gMC->CurrentVolOffID(1,copy);
4964 id=gMC->CurrentVolOffID(2,copy);
4966 } else if(id==fIdSens[1]) {
4968 id=gMC->CurrentVolOffID(1,copy);
4970 id=gMC->CurrentVolOffID(2,copy);
4972 } else if(id==fIdSens[2]) {
4975 id=gMC->CurrentVolOffID(1,copy);
4977 } else if(id==fIdSens[3]) {
4980 id=gMC->CurrentVolOffID(1,copy);
4982 } else if(id==fIdSens[4]) {
4985 id=gMC->CurrentVolOffID(1,copy);
4987 } else if(id==fIdSens[5]) {
4990 id=gMC->CurrentVolOffID(1,copy);
4993 gMC->TrackPosition(position);
4994 gMC->TrackMomentum(momentum);
4995 hits[0]=position[0];
4996 hits[1]=position[1];
4997 hits[2]=position[2];
4998 hits[3]=momentum[0];
4999 hits[4]=momentum[1];
5000 hits[5]=momentum[2];
5001 hits[6]=gMC->Edep();
5002 hits[7]=gMC->TrackTime();
5003 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
5004 #if ALIITSPRINTGEOM==1
5005 if(printit[vol[0]][vol[2]][vol[1]]){
5006 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
5007 xl[0] = xl[1] = xl[2] = 0.0;
5008 gMC->Gdtom(xl,xt,1);
5009 for(i=0;i<9;i++) mat[i] = 0.0;
5010 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
5013 gMC->Gdtom(xl,&(mat[0]),2);
5016 gMC->Gdtom(xl,&(mat[3]),2);
5019 gMC->Gdtom(xl,&(mat[6]),2);
5021 angl[0] = TMath::ACos(mat[2]);
5022 if(mat[2]==1.0) angl[0] = 0.0;
5023 angl[1] = TMath::ATan2(mat[1],mat[0]);
5024 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5026 angl[2] = TMath::ACos(mat[5]);
5027 if(mat[5]==1.0) angl[2] = 0.0;
5028 angl[3] = TMath::ATan2(mat[4],mat[3]);
5029 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5031 angl[4] = TMath::ACos(mat[8]);
5032 if(mat[8]==1.0) angl[4] = 0.0;
5033 angl[5] = TMath::ATan2(mat[7],mat[6]);
5034 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5036 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5037 // i = gMC->CurrentVolID(copy);
5038 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5039 fp = fopen("ITSgeometry_v5.det","a");
5040 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5041 vol[0],vol[2],vol[1], // layer ladder detector
5042 xt[0],xt[1],xt[2], // Translation vector
5043 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5046 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5047 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5048 ); // Adding the rotation matrix.
5051 } // end if printit[layer][ladder][detector]
5054 //____________________________________________________________________________
5055 void AliITSv3::Streamer(TBuffer &R__b){
5056 ////////////////////////////////////////////////////////////////////////
5057 // A dummy Streamer function for this class AliITSv3. By default it
5058 // only streams the AliITS class as it is required. Since this class
5059 // dosen't contain any "real" data to be saved, it doesn't.
5060 ////////////////////////////////////////////////////////////////////////
5062 if (R__b.IsReading()) {
5063 Version_t R__v = R__b.ReadVersion();
5065 AliITS::Streamer(R__b);
5067 AliITS::Streamer(R__b);
5070 R__b.WriteVersion(AliITSv3::IsA());
5071 AliITS::Streamer(R__b);
5072 } // end if R__b.IsReading()