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.8 2000/06/12 19:14:40 barbera
19 Remove partical transision to new Config.C calling convension. Bug Found.
21 Revision 1.11.4.7 2000/06/12 18:15:38 barbera
22 fixed posible compilation errors on HP unix. Modifided default constructor
23 for use with new calling requirements.
25 Revision 1.11.4.6 2000/06/11 20:37:41 barbera
26 coding convenstion update.
28 Revision 1.11.4.4 2000/05/19 10:09:51 nilsen
29 fix for bug with HP and Sun unix + fix for event display in ITS-working branch
31 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
32 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
33 <=23 (was <=24). This may not be the final version.
35 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
36 Fixed up the comments/documentation.
38 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
39 This is the version of the files after the merging done in December 1999.
40 See the ReadMe110100.txt file for details
42 Revision 1.11 1999/10/22 08:25:25 fca
43 remove double definition of destructors
45 Revision 1.10 1999/10/22 08:16:49 fca
46 Correct destructors, thanks to I.Hrivnacova
48 Revision 1.9 1999/10/06 19:56:50 fca
51 Revision 1.8 1999/10/05 08:05:09 fca
52 Minor corrections for uninitialised variables.
54 Revision 1.7 1999/09/29 09:24:20 fca
55 Introduction of the Copyright and cvs Log
59 ///////////////////////////////////////////////////////////////////////////////
61 // Inner Traking System version 3
62 // This class contains the base procedures for the Inner Tracking System
64 // Authors: R. Barbera, A. Morsch.
68 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
69 // WORK with the geometry or module classes or any analysis classes. You are
70 // strongly encouraged to uses AliITSv5.
72 ///////////////////////////////////////////////////////////////////////////////
74 // See AliITSv3::StepManager().
75 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
76 //#define ALIITSPRINTGEOM 1 // print out geometry information
81 #include <TGeometry.h>
84 #include <TFile.h> // only required for Tracking function?
86 #include <TObjArray.h>
87 #include <TClonesArray.h>
92 #include "AliITShit.h"
101 //_____________________________________________________________________________
102 AliITSv3::AliITSv3()/* : AliITS("ITS","TP version")*/{
103 ////////////////////////////////////////////////////////////////////////
104 // Standard default constructor for the ITS version 3.
105 ////////////////////////////////////////////////////////////////////////
107 fId3Name = new char*[fId3N];
108 fId3Name[0] = "ITS1";
109 fId3Name[1] = "ITS2";
110 fId3Name[2] = "ITS3";
111 fId3Name[3] = "ITS4";
112 fId3Name[4] = "ITS5";
113 fId3Name[5] = "ITS6";
115 printf("Created ITS TP Detailed version\n");
117 //____________________________________________________________________________
118 AliITSv3::AliITSv3(const AliITSv3 &source){
119 ////////////////////////////////////////////////////////////////////////
120 // Copy Constructor for ITS version 3.
121 ////////////////////////////////////////////////////////////////////////
122 if(&source == this) return;
123 this->fId3N = source.fId3N;
124 this->fId3Name = new char*[fId3N];
126 for(i=0;i<6;i++) strcpy(this->fId3Name[i],source.fId3Name[i]);
129 //_____________________________________________________________________________
130 AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
131 ////////////////////////////////////////////////////////////////////////
132 // Assignment operator for the ITS version 3.
133 ////////////////////////////////////////////////////////////////////////
134 if(&source == this) return *this;
135 this->fId3N = source.fId3N;
136 this->fId3Name = new char*[fId3N];
138 for(i=0;i<6;i++) strcpy(this->fId3Name[i],source.fId3Name[i]);
141 //_____________________________________________________________________________
142 AliITSv3::~AliITSv3() {
143 ////////////////////////////////////////////////////////////////////////
144 // Standard destructor for the ITS version 3.
145 ////////////////////////////////////////////////////////////////////////
148 //_____________________________________________________________________________
149 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
150 ////////////////////////////////////////////////////////////////////////
151 // Standard constructor for the ITS version 3.
152 ////////////////////////////////////////////////////////////////////////
154 fId3Name = new char*[fId3N];
155 fId3Name[0] = "ITS1";
156 fId3Name[1] = "ITS2";
157 fId3Name[2] = "ITS3";
158 fId3Name[3] = "ITS4";
159 fId3Name[4] = "ITS5";
160 fId3Name[5] = "ITS6";
162 printf("Created ITS TP Detailed version\n");
163 }//__________________________________________________________________________
164 void AliITSv3::BuildGeometry(){
165 ////////////////////////////////////////////////////////////////////////
166 // Geometry builder for the ITS version 3.
167 ////////////////////////////////////////////////////////////////////////
169 const Int_t kColorITS=kYellow;
171 top = gAlice->GetGeometry()->GetNode("alice");
173 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
175 node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
176 node->SetLineColor(kColorITS);
179 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
181 node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
182 node->SetLineColor(kColorITS);
185 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
187 node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
188 node->SetLineColor(kColorITS);
191 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
193 node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
194 node->SetLineColor(kColorITS);
197 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
199 node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
200 node->SetLineColor(kColorITS);
203 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
205 node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
206 node->SetLineColor(kColorITS);
209 //_____________________________________________________________________________
210 void AliITSv3::CreateGeometry(){
211 ////////////////////////////////////////////////////////////////////////
212 // This routine creates and defines the version 3 geometry of the ITS.
213 ////////////////////////////////////////////////////////////////////////
215 const Float_t kxx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
216 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
218 const Float_t kyy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
219 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
221 const Float_t kxbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
222 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
224 const Float_t kybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
225 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
227 const Float_t kxend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
228 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
230 const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
231 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
233 const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
234 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
236 const Float_t kyarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
237 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
239 const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
240 0.5,0.7,0.5,0.7,0.5,0.5 };
241 const Float_t krr = 4.064516;
242 const Float_t ktteta = 63.00;
243 const Float_t kpphi = -35.00;
244 const Float_t kgteta = 87.78;
245 const Double_t kdegrad = kPI/180.;
246 const Double_t kraddeg = 180./kPI;
247 const Double_t ktwopi = 2*kPI;
250 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
251 dfra[10], dcer[3], dkap[3], dpla[3],
252 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
253 atheta1011, dbus[3], dtub[3], dwat[3],
254 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
255 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
256 Double_t biga1, bigb1;
257 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
258 dtra1[3], dtra2[3], dtra3[3],
259 dtra4[3], dbox1[3], dbox2[3];
261 Float_t xtra1[6], ytra1[6], ztra1[6];
263 Float_t xpos1, ypos1;
265 Float_t angle, dcone[5], dtube[3], dpgon[10];
266 Float_t rzero, xzero, yzero;
267 Double_t coeffa, coeffb, coeffc;
269 Float_t atheta, offset;
270 Float_t offset1, offset2, dgh[15];
271 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
272 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
275 Double_t xcc1, ycc1, xcc2, ycc2;
277 const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
278 "TR05","TR06","TR07","TR08"};
279 const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
280 "TR15","TR16","TR17","TR18",
281 "TR19","TR20","TR21","TR22",
282 "TR23","TR24","TR25","TR26"};
283 const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
284 const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
285 const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
286 "TR57","TR58","TR59","TR60","TR61","TR62",
287 "TR63","TR64","TR65","TR66"};
289 Int_t *idtmed = fIdtmed->GetArray()-199;
291 // --- Define a ghost volume containing the whole ITS and fill it with air
309 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
311 // --- Place the ghost volume in its mother volume (ALIC) and make it
314 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
315 gMC->Gsatt("ITSV", "SEEN", 0);
317 //************************************************************************
322 //************************************************************************
324 // GOTO 2345 ! skip ITS layer no. 1 and 2
326 // --- Define a ghost volume containing the Silicon Pixel Detectors
327 // (layer #1 and #2) and fill it with air or vacuum
329 xxm = (49.999-3)/(70-25);
333 dgh[3] = -25.-(9.-3.01)/xxm;
342 dgh[12] = 25+(9-3.01)/xxm;
345 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
347 // --- Place the ghost volume in its mother volume (ITSV) and make it
350 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
351 gMC->Gsatt("IT12", "SEEN", 0);
353 // --- Define a ghost volume containing a single element of layer #1
354 // and fill it with air or vacuum
356 dbox1[0] = 0.005+0.01+0.0075;
359 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
361 //--Divide each element of layer #1 in three ladders along the beam direction
363 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
365 // --- Make the ghost volumes invisible
367 gMC->Gsatt("IPV1", "SEEN", 0);
368 gMC->Gsatt("IPB1", "SEEN", 0);
370 // --- Define a volume containing the chip of pixels (silicon, layer #1)
374 dchi[2] = dbox1[2] / 3.;
375 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
377 // --- Define a volume containing the bus of pixels (silicon, layer #1)
382 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
384 // --- Define a volume containing the sensitive part of pixels
385 // (silicon, layer #1)
390 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
392 // --- Place the chip into its mother (IPB1)
394 xpos = dbox1[0] - dchi[0];
397 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
399 // --- Place the sensitive volume into its mother (IPB1)
401 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
402 ypos = dchi[1] - dits[1];
403 zpos = -(dchi[2] - dits[2]);
404 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
406 // --- Place the bus into its mother (IPB1)
408 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
409 ypos = dchi[1] - dbus[1];
410 zpos = -(dchi[2] - dbus[2]);
411 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
413 // --- Define a ghost volume containing a single element of layer #2
414 // and fill it with air or vacuum
416 dbox2[0] = 0.005+0.01+0.0075;
419 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
421 //--Divide each element of layer #2 in four ladders along the beam direction
423 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
425 // --- Make the ghost volumes invisible
427 gMC->Gsatt("IPV2", "SEEN", 0);
428 gMC->Gsatt("IPB2", "SEEN", 0);
430 // --- Define a volume containing the chip of pixels (silicon, layer #2)
434 dchi[2] = dbox2[2] / 4.;
435 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
437 // --- Define a volume containing the bus of pixels (silicon, layer #2)
442 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
444 // --- Define a volume containing the sensitive part of pixels
445 // (silicon, layer #2)
450 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
452 // --- Place the chip into its mother (IPB2)
454 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
457 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
459 // --- Place the sensitive volume into its mother (IPB2)
461 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
462 ypos = -(dchi[1] - dits[1]);
463 zpos = -(dchi[2] - dits[2]);
464 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
466 // --- Place the bus into its mother (IPB2)
468 xpos = dbox1[0] - dbus[0];
469 ypos = -(dchi[1] - dbus[1]);
470 zpos = -(dchi[2] - dbus[2]);
471 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
473 // --- Define a generic segment of an element of the mechanical support
478 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
480 // --- Define a generic arc of an element of the mechanical support
485 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
487 // --- Define the mechanical supports of layers #1 and #2 and place the
488 // elements of the layers in it
491 // counter over the number of elements of layer #1 (
494 // counter over the number of elements of layer #2 (
495 for(i = 1; i <= 10; ++i) {
497 // --- Place part # 1-2 (see sketch)
499 // number of carbon fiber supports (see sketch)
502 dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) +
503 (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0]) ) / 20.;
505 xcc = ( kxx[0] + kxx[1]) / 20.;
506 ycc = ( kyy[0] + kyy[1]) / 20.;
507 xccc = (kxbeg[0] + kxend[0]) / 20.;
508 yccc = (kybeg[0] + kyend[0]) / 20.;
509 if (kxx[0] == kxx[1]) {
512 r1 = kyy[1] - kyy[0];
513 r2 = kxx[1] - kxx[0];
514 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
515 } // end if kxx[0] == kxx[1]
516 aphi = (kpphi + (i-1) * 36.) * kdegrad;
517 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
518 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
519 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
520 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
521 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
522 ypos1 * TMath::Sin(kgteta *kdegrad);
523 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
524 ypos1 * TMath::Cos(kgteta * kdegrad);
526 atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
527 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
528 atheta12 + 90., 0., 0.);
529 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
530 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
532 // --- Place part # 2-3 (see sketch)
536 dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) +
537 (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
539 xcc = ( kxx[1] + kxx[2]) / 20.;
540 ycc = ( kyy[1] + kyy[2]) / 20.;
541 xccc = (kxbeg[1] + kxend[1]) / 20.;
542 yccc = (kybeg[1] + kyend[1]) / 20.;
543 if (kxx[1] == kxx[2]) {
546 r1 = kyy[2] - kyy[1];
547 r2 = kxx[2] - kxx[1];
548 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
549 } // end if kxx[1] == kxx[2]
550 aphi = (kpphi + (i-1) * 36.) * kdegrad;
551 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
552 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
553 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
554 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
555 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
556 ypos1 * TMath::Sin(kgteta * kdegrad);
557 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
558 ypos1 * TMath::Cos(kgteta * kdegrad);
560 atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
561 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
562 atheta23 + 90., 0., 0.);
563 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
564 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
566 // --- Place an element of layer #2
568 biga = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
569 bigb = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
570 coeffa = biga * biga + 1.;
571 coeffb = biga * bigb - biga * ycc - xcc;
572 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
573 bigb * bigb - 0.08964*0.08964;
574 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
576 ycc1 = biga * xcc1 + bigb;
578 bigb1 = xcc1 / biga + ycc1;
579 coeffa = biga1 * biga1 + 1.;
580 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
581 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
582 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
583 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
585 ycc2 = biga1 * xcc2 + bigb1;
586 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
587 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
588 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
589 ypos1 * TMath::Sin(kgteta *kdegrad);
590 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
591 ypos1 * TMath::Cos(kgteta * kdegrad);
594 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
595 idrotm[(i-1) * 13 + 1101], "ONLY");
597 // --- Place part # 3-4 (see sketch)
601 dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) +
602 (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
604 xcc = (kxx[1] + kxx[2]) / 20.;
605 ycc = (kyy[1] + kyy[2]) / 20.;
606 xccc = (kxbeg[2] + kxend[2]) / 20.;
607 yccc = (kybeg[2] + kyend[2]) / 20.;
608 if (kxx[2] == kxx[3]) {
611 r1 = kyy[3] - kyy[2];
612 r2 = kxx[3] - kxx[2];
613 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
614 } // end if kxx[2] == kxx[3]
615 aphi = (kpphi + (i-1) * 36.) * kdegrad;
616 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
617 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
618 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
619 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
620 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
621 ypos1 * TMath::Sin(kgteta *kdegrad);
622 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
623 ypos1 * TMath::Cos(kgteta * kdegrad);
625 atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
626 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
627 atheta34 + 90., 0., 0.);
628 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
629 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
631 // --- Place part # 4-5 (see sketch)
635 dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) +
636 (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
638 xcc = ( kxx[3] + kxx[4]) / 20.;
639 ycc = ( kyy[3] + kyy[4]) / 20.;
640 xccc = (kxbeg[3] + kxend[3]) / 20.;
641 yccc = (kybeg[3] + kyend[3]) / 20.;
642 if (kxx[3] == kxx[4]) {
645 r1 = kyy[4] - kyy[3];
646 r2 = kxx[4] - kxx[3];
647 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
648 } // end if kxx[3] == kxx[4]
649 aphi = (kpphi + (i-1) * 36.) * kdegrad;
650 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
651 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
652 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
653 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
654 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
655 ypos1 * TMath::Sin(kgteta *kdegrad);
656 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
657 ypos1 * TMath::Cos(kgteta * kdegrad);
659 atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
660 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
661 atheta45 + 90., 0., 0.);
662 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
663 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
665 // --- Place an element of layer #2
667 biga = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
668 bigb = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
669 coeffa = biga * biga + 1.;
670 coeffb = biga * bigb - biga * ycc - xcc;
671 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
672 bigb * bigb - .014285030400000001;
673 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
675 ycc1 = biga * xcc1 + bigb;
677 bigb1 = xcc1 / biga + ycc1;
678 coeffa = biga1 * biga1 + 1.;
679 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
680 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
681 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
682 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
684 ycc2 = biga1 * xcc2 + bigb1;
685 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
686 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
687 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
688 ypos1 * TMath::Sin(kgteta *kdegrad);
689 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
690 ypos1 * TMath::Cos(kgteta * kdegrad);
693 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
694 idrotm[(i-1) * 13 + 1103], "ONLY");
696 // --- Place part # 5-6 (see sketch)
700 dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) +
701 (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
703 xcc = (kxx[4] + kxx[5]) / 20.;
704 ycc = (kyy[4] + kyy[5]) / 20.;
705 xccc = (kxbeg[4] + kxend[4]) / 20.;
706 yccc = (kybeg[4] + kyend[4]) / 20.;
707 if (kxx[4] == kxx[5]) {
710 r1 = kyy[5] - kyy[4];
711 r2 = kxx[5] - kxx[4];
712 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
714 aphi = (kpphi + (i-1) * 36.) * kdegrad;
715 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
716 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
717 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
718 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
719 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
720 ypos1 * TMath::Sin(kgteta *kdegrad);
721 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
722 ypos1 * TMath::Cos(kgteta * kdegrad);
724 atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
725 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
726 atheta56 + 90., 0., 0.);
727 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
728 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
730 // --- Place part # 6-7 (see sketch)
734 dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) +
735 (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
737 xcc = (kxx[5] + kxx[6]) / 20.;
738 ycc = (kyy[5] + kyy[6]) / 20.;
739 xccc = (kxbeg[5] + kxend[5]) / 20.;
740 yccc = (kybeg[5] + kyend[5]) / 20.;
741 if (kxx[5] == kxx[6]) {
744 r1 = kyy[6] - kyy[5];
745 r2 = kxx[6] - kxx[5];
746 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
747 } // end if kxx[5] == kxx[6]
748 aphi = (kpphi + (i-1) * 36.) * kdegrad;
749 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
750 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
751 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
752 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
753 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
754 ypos1 * TMath::Sin(kgteta *kdegrad);
755 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
756 ypos1 * TMath::Cos(kgteta * kdegrad);
758 atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
759 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
760 atheta67 + 90., 0., 0.);
761 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
762 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
764 // --- Place an element of layer #2
766 biga = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
767 bigb = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
768 coeffa = biga * biga + 1.;
769 coeffb = biga * bigb - biga * ycc - xcc;
770 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
771 bigb * bigb - .014285030400000001;
772 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
774 ycc1 = biga * xcc1 + bigb;
776 bigb1 = xcc1 / biga + ycc1;
777 coeffa = biga1 * biga1 + 1.;
778 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
779 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
780 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
781 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
783 ycc2 = biga1 * xcc2 + bigb1;
784 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
785 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
786 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
787 ypos1 * TMath::Sin(kgteta *kdegrad);
788 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
789 ypos1 * TMath::Cos(kgteta * kdegrad);
792 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
793 idrotm[(i-1) * 13 + 1105], "ONLY");
795 // --- Place part # 7-8 (see sketch)
799 dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
800 (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
802 xcc = (kxx[6] + kxx[7]) / 20.;
803 ycc = (kyy[6] + kyy[7]) / 20.;
804 xccc = (kxbeg[6] + kxend[6]) / 20.;
805 yccc = (kybeg[6] + kyend[6]) / 20.;
806 if (kxx[6] == kxx[7]) {
809 r1 = kyy[7] - kyy[6];
810 r2 = kxx[7] - kxx[6];
811 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
813 aphi = (kpphi + (i-1) * 36.) * kdegrad;
814 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
815 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
816 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
817 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
818 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
819 ypos1 * TMath::Sin(kgteta *kdegrad);
820 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
821 ypos1 * TMath::Cos(kgteta * kdegrad);
823 atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
824 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
825 atheta78 + 90., 0., 0.);
826 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
827 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
829 // --- Place part # 8-9 (see sketch)
833 dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) +
834 (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
836 xcc = (kxx[7] + kxx[8]) / 20.;
837 ycc = (kyy[7] + kyy[8]) / 20.;
838 xccc = (kxbeg[7] + kxend[7]) / 20.;
839 yccc = (kybeg[7] + kyend[7]) / 20.;
840 if (kxx[1] == kxx[2]) {
843 r1 = kyy[8] - kyy[7];
844 r2 = kxx[8] - kxx[7];
845 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
847 aphi = (kpphi + (i-1) * 36.) * kdegrad;
848 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
849 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
850 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
851 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
852 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
853 ypos1 * TMath::Sin(kgteta *kdegrad);
854 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
855 ypos1 * TMath::Cos(kgteta * kdegrad);
857 atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
858 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
859 atheta89 + 90., 0., 0.);
860 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
861 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
863 // --- Place an element of layer #2
865 biga = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
866 bigb = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
867 coeffa = biga * biga + 1.;
868 coeffb = biga * bigb - biga * ycc - xcc;
869 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
870 bigb * bigb - .014285030400000001;
871 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
873 ycc1 = biga * xcc1 + bigb;
875 bigb1 = xcc1 / biga + ycc1;
876 coeffa = biga1 * biga1 + 1.;
877 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
878 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
879 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
880 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
882 ycc2 = biga1 * xcc2 + bigb1;
883 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
884 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
885 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) +
886 ypos1 * TMath::Sin(kgteta *kdegrad);
887 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) +
888 ypos1 * TMath::Cos(kgteta * kdegrad);
891 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
892 idrotm[(i-1) * 13 + 1107], "ONLY");
894 // --- Place part # 9-10 (see sketch)
898 dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
899 (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
901 xcc = (kxx[8] + kxx[9]) / 20.;
902 ycc = (kyy[8] + kyy[9]) / 20.;
903 xccc = (kxbeg[8] + kxend[8]) / 20.;
904 yccc = (kybeg[8] + kyend[8]) / 20.;
905 if (kxx[8] == kxx[9]) {
908 r1 = kyy[9] - kyy[8];
909 r2 = kxx[9] - kxx[8];
910 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
912 aphi = (kpphi + (i-1) * 36.) * kdegrad;
913 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
914 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
915 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
916 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
917 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
918 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
920 atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
921 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
922 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
924 // --- Place part # 10-11 (see sketch)
928 dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
930 xcc = (kxx[9] + kxx[10]) / 20.;
931 ycc = (kyy[9] + kyy[10]) / 20.;
932 xccc = (kxbeg[9] + kxend[9]) / 20.;
933 yccc = (kybeg[9] + kyend[9]) / 20.;
934 if (kxx[9] == kxx[10]) {
937 r1 = kyy[10] - kyy[9];
938 r2 = kxx[10] - kxx[9];
939 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
941 aphi = (kpphi + (i-1) * 36.) * kdegrad;
942 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
943 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
944 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
945 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
946 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
947 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
949 atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
950 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
951 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
953 // --- Place part # 13-14 (see sketch)
957 dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
959 xcc = (kxx[12] + kxx[13]) / 20.;
960 ycc = (kyy[12] + kyy[13]) / 20.;
961 xccc = (kxbeg[12] + kxend[12]) / 20.;
962 yccc = (kybeg[12] + kyend[12]) / 20.;
963 if (kxx[12] == kxx[13]) {
966 r1 = kyy[12] - kyy[13];
967 r2 = kxx[12] - kxx[13];
968 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
970 aphi = (kpphi + (i-1) * 36.) * kdegrad;
971 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
972 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
973 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
974 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
975 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
976 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
978 atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
979 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
980 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
982 // --- Place an element of layer #1
984 biga = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
985 bigb = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
986 coeffa = biga * biga + 1.;
987 coeffb = biga * bigb - biga * ycc - xcc;
988 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
989 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
990 ycc1 = biga * xcc1 + bigb;
992 bigb1 = xcc1 / biga + ycc1;
993 coeffa = biga1 * biga1 + 1.;
994 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
995 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
996 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
997 ycc2 = biga1 * xcc2 + bigb1;
998 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
999 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1000 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1001 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1004 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
1006 // --- Place part # 12-13 (see sketch)
1010 dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
1012 xcc = (kxx[11] + kxx[12]) / 20.;
1013 ycc = (kyy[11] + kyy[12]) / 20.;
1014 xccc = (kxbeg[11] + kxend[11]) / 20.;
1015 yccc = (kybeg[11] + kyend[11]) / 20.;
1016 if (kxx[11] == kxx[12]) {
1019 r1 = kyy[12] - kyy[11];
1020 r2 = kxx[12] - kxx[11];
1021 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1023 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1024 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1025 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1026 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1027 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1028 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1029 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1031 atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
1032 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
1033 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
1035 // --- Place part # 11-12 (see sketch)
1039 dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
1041 xcc = (kxx[10] + kxx[11]) / 20.;
1042 ycc = (kyy[10] + kyy[11]) / 20.;
1043 xccc = (kxbeg[10] + kxend[10]) / 20.;
1044 yccc = (kybeg[10] + kyend[10]) / 20.;
1045 if (kxx[10] == kxx[11]) {
1048 r1 = kyy[11] - kyy[10];
1049 r2 = kxx[11] - kxx[10];
1050 offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
1052 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1053 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1054 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1055 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1056 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1057 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1058 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1060 atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
1061 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1062 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1064 // --- Place an element of layer #1
1066 biga = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
1067 bigb = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
1068 coeffa = biga * biga + 1.;
1069 coeffb = biga * bigb - biga * ycc - xcc;
1070 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1071 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1072 ycc1 = biga * xcc1 + bigb;
1074 bigb1 = xcc1 / biga + ycc1;
1075 coeffa = biga1 * biga1 + 1.;
1076 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1077 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1078 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1079 ycc2 = biga1 * xcc2 + bigb1;
1080 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1081 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1082 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1083 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1086 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1088 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1090 darc[0] = krarc[12] / 10. - .02;
1091 darc[1] = krarc[12] / 10.;
1093 darc[3] = atheta12 - (i-1) * 36.;
1094 darc[4] = atheta23 - (i-1) * 36.;
1095 xcc = kxarc[12] / 10.;
1096 ycc = kyarc[12] / 10.;
1097 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1098 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1099 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1100 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1101 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1102 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1103 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1105 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1107 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1109 darc[0] = krarc[11] / 10. - .02;
1110 darc[1] = krarc[11] / 10.;
1112 darc[3] = atheta23 + 90. - (i-1) * 36.;
1113 darc[4] = atheta34 + 90. - (i-1) * 36.;
1114 xcc = kxarc[11] / 10.;
1115 ycc = kyarc[11] / 10.;
1116 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1117 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1118 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1119 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1120 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1121 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1122 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1124 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1126 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1128 darc[0] = krarc[10] / 10. - .02;
1129 darc[1] = krarc[10] / 10.;
1131 darc[3] = atheta45 + 180. - (i-1) * 36.;
1132 darc[4] = atheta34 + 180. - (i-1) * 36.;
1133 xcc = kxarc[10] / 10.;
1134 ycc = kyarc[10] / 10.;
1135 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1136 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1137 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1138 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1139 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1140 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1141 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1143 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1145 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1147 darc[0] = krarc[9] / 10. - .02;
1148 darc[1] = krarc[9] / 10.;
1150 darc[3] = atheta45 - 90. - (i-1) * 36.;
1151 darc[4] = atheta56 - 90. - (i-1) * 36.;
1152 xcc = kxarc[9] / 10.;
1153 ycc = kyarc[9] / 10.;
1154 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1155 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1156 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1157 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1158 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1159 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1160 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1162 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1164 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1166 darc[0] = krarc[8] / 10. - .02;
1167 darc[1] = krarc[8] / 10.;
1169 darc[3] = atheta67 + 45. - (i-1) * 36.;
1170 darc[4] = atheta56 + 45. - (i-1) * 36.;
1171 xcc = kxarc[8] / 10.;
1172 ycc = kyarc[8] / 10.;
1173 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1174 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1175 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1176 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1177 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1178 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1179 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1181 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1183 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1185 darc[0] = krarc[7] / 10. - .02;
1186 darc[1] = krarc[7] / 10.;
1188 darc[3] = atheta67 - (i-1) * 36.;
1189 darc[4] = atheta78 - (i-1) * 36.;
1190 xcc = kxarc[7] / 10.;
1191 ycc = kyarc[7] / 10.;
1192 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1193 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1194 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1195 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1196 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1197 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1198 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1200 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1202 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1204 darc[0] = krarc[6] / 10. - .02;
1205 darc[1] = krarc[6] / 10.;
1207 darc[3] = atheta89 + 45. - (i-1) * 36.;
1208 darc[4] = atheta78 + 45. - (i-1) * 36.;
1209 xcc = kxarc[6] / 10.;
1210 ycc = kyarc[6] / 10.;
1211 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1212 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1213 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1214 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1215 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1216 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1217 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1219 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1221 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1223 darc[0] = krarc[5] / 10. - .02;
1224 darc[1] = krarc[5] / 10.;
1226 darc[3] = atheta89 + 45. - (i-1) * 36.;
1227 darc[4] = atheta910 + 45. - (i-1) * 36.;
1228 xcc = kxarc[5] / 10.;
1229 ycc = kyarc[5] / 10.;
1230 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1231 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1232 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1233 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1234 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1235 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1236 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1238 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1240 // --- Place arc # 5 (between part 9-10 and part 10-11)
1243 darc[0] = krarc[4] / 10. - .02;
1244 darc[1] = krarc[4] / 10.;
1246 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1247 darc[4] = atheta910 + 45. - (i-1) * 36.;
1248 xcc = kxarc[4] / 10.;
1249 ycc = kyarc[4] / 10.;
1250 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1251 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1252 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1253 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1254 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1255 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1256 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1258 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1260 // --- Place arc # 4 (between part 10-11 and part 11-12)
1263 darc[0] = krarc[3] / 10. - .02;
1264 darc[1] = krarc[3] / 10.;
1266 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1267 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1268 xcc = kxarc[3] / 10.;
1269 ycc = kyarc[3] / 10.;
1270 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1271 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1272 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1273 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1274 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1275 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1276 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1278 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1280 // --- Place arc # 3 (between part 11-12 and part 12-13)
1283 darc[0] = krarc[2] / 10. - .02;
1284 darc[1] = krarc[2] / 10.;
1286 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1287 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1288 xcc = kxarc[2] / 10.;
1289 ycc = kyarc[2] / 10.;
1290 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1291 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1292 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1293 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1294 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1295 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1296 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1298 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1300 // --- Place arc # 2 (between part 12-13 and part 13-14)
1303 darc[0] = krarc[1] / 10. - .02;
1304 darc[1] = krarc[1] / 10.;
1306 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1307 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1308 xcc = kxarc[1] / 10.;
1309 ycc = kyarc[1] / 10.;
1310 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1311 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1312 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1313 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1314 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1315 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1316 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1318 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1320 // --- Place arc # 1 (between part 13-14 and part 1-2)
1323 darc[0] = krarc[0] / 10. - .02;
1324 darc[1] = krarc[0] / 10.;
1326 darc[3] = atheta12 + 45. - (i-1) * 36.;
1327 darc[4] = atheta1314 - (i-1) * 36.;
1328 xcc = kxarc[0] / 10.;
1329 ycc = kyarc[0] / 10.;
1330 aphi = (kpphi + (i-1) * 36.) * kdegrad;
1331 xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
1332 yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
1333 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1334 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1335 xpos = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
1336 ypos = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
1338 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1341 //************************************************************************
1346 //************************************************************************
1348 // --- Define a ghost volume containing the Silicon Drift Detectors
1349 // (layer #3 and #4) and fill it with air or vacuum
1351 xxm = (49.999-3.)/(70.-25.);
1355 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1358 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1361 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1364 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1367 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1369 // --- Place the ghost volume in its mother volume (ITSV) and make it
1372 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1373 gMC->Gsatt("IT34", "SEEN", 0);
1377 // GOTO 3456 ! skip ITS layer no. 3
1379 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1380 // smaller lenght of ribs) and fill it with air or vacuum
1382 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1384 // the widest element is the sensitive element
1385 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1386 // 7.5 cm is the lenght
1387 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1389 // --- Make the ghost volume invisible
1391 gMC->Gsatt("IDV1", "SEEN", 0);
1393 // --- Define a volume containing the sensitive part of drifts
1394 // (silicon, layer #3)
1397 // see material budget report by G. Feofilov
1400 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1402 //--- Define the part of the (smaller) rib between two sensitive parts made of
1403 // carbon (layer #3)
1405 dsup[0] = .5 - dits[0];
1407 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1408 // 7.5 cm is the lenght
1409 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1411 //--- Define the first part of the (smaller) rib between two sensitive parts
1412 // made of aluminum (layer #3)
1414 dal1[0] = .5 - dits[0];
1415 dal1[1] = 0.00096/2.;
1416 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1417 // 7.5 cm is the lenght
1418 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1420 //--- Define the part of the (smaller) rib between two sensitive parts made of
1421 // kapton (layer #3)
1423 dkap[0] = .5 - dits[0];
1425 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1426 // 7.5 cm is the lenght
1427 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1429 //--- Define the second part of the (smaller) rib between two sensitive parts
1430 // made of aluminum (layer #3)
1432 dal2[0] = .5 - dits[0];
1433 dal2[1] = 0.0027/2.;
1434 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1435 // 7.5 cm is the lenght
1436 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1438 // --- Define the part of the (smaller) rib between two sensitive parts
1439 // made of silicon (the electronics) (layer #3)
1441 dchi[0] = .5 - dits[0];
1442 dchi[1] = 0.0071/2.;
1443 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1444 // 7.5 cm is the lenght
1445 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1447 // --- Define the part of the (smaller) rib between two sensitive parts
1448 // made of water (the cooler) (layer #3)
1450 dwat[0] = .5 - dits[0];
1451 dwat[1] = 0.0093/2.;
1452 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1453 // 7.5 cm is the lenght
1454 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1456 //--- Define the third part of the (smaller) rib between two sensitive parts
1457 // made of aluminum (the cooling tubes) (layer #3)
1459 dtub[0] = .5 - dits[0];
1460 dtub[1] = 0.00134/2.;
1461 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1462 // 7.5 cm is the lenght
1463 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1465 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1468 // twice the foreseen thickness
1471 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1473 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1476 // twice the foreseen thickness
1479 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1481 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1484 // twice the foreseen thickness
1487 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1489 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1492 // twice the foreseen thickness
1495 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1497 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1501 for(j = 1; j <= 5; ++j) {
1502 // odd elements are up and even elements are down
1504 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1505 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1506 } else if (j == 2) {
1507 xpos = -dbox1[0] + dits[0];
1508 zpos = 0. - dits[2] + 1. - dits[2];
1509 } else if (j == 3) {
1510 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1512 } else if (j == 4) {
1513 xpos = -dbox1[0] + dits[0];
1514 zpos = dits[2] + 0. - 1. + dits[2];
1515 } else if (j == 5) {
1516 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1517 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1519 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1522 // --- Place the smaller ribs into their mother (IDV1)
1524 // --- Right ribs (just a matter of convention)
1526 xpos = .5 - dbox1[0] + dits[0];
1532 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1536 ypos = dsup[1] + 2.81 + dal1[1];
1537 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1541 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1542 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1546 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1547 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1549 // --- Silicon (chip)
1551 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1552 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1556 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1557 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1561 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1563 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1565 // --- Right ribs (just a matter of convention)
1570 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1574 ypos = -(dsup[1] + 2.81 + dal1[1]);
1575 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1579 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1580 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1584 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1585 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1587 // --- Silicon (chip)
1589 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1590 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1594 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1595 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1599 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1600 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1601 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1603 // --- Place the end-ladder stuff into its mother (IDV1)
1606 // --- Negative-Z end-ladder
1609 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1613 xpos = dbox1[0] - dpcb[0];
1614 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1618 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1619 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1623 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1624 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1626 // --- Silicon (bus)
1628 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1629 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1631 // --- Positive-Z end-ladder
1634 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1638 xpos = dbox1[0] - dpcb[0];
1639 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1643 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1644 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1648 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1649 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1651 // --- Silicon (bus)
1653 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1654 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1656 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1657 // larger lenght of ribs) and fill it with air or vacuum
1659 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1661 // the widest element is the sensitive element
1662 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1663 // 7.5 cm is the lenght
1664 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1666 // --- Make the ghost volume invisible
1668 gMC->Gsatt("IDV2", "SEEN", 0);
1670 //--- Define the part of the (larger) rib between two sensitive parts madeof
1671 // carbon (layer #3)
1673 dsup[0] = .65 - dits[0];
1675 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1676 // 7.5 cm is the lenght
1677 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1679 //--- Define the first part of the (larger) rib between two sensitive parts
1680 // made of aluminum (layer #3)
1682 dal1[0] = .65 - dits[0];
1683 dal1[1] = 0.00096/2.;
1684 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1685 // 7.5 cm is the lenght
1686 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1688 //--- Define the part of the (larger) rib between two sensitive parts madeof
1689 // kapton (layer #3)
1691 dkap[0] = .65 - dits[0];
1692 dkap[1] = 0.0317/2.;
1693 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1694 // 7.5 cm is the lenght
1695 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1697 //--- Define the second part of the (larger) rib between two sensitive parts
1698 // made of aluminum (layer #3)
1700 dal2[0] = .65 - dits[0];
1701 dal2[1] = 0.0027/2.;
1702 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1703 // 7.5 cm is the lenght
1704 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1706 // --- Define the part of the (larger) rib between two sensitive parts
1707 // made of silicon (the electronics) (layer #3)
1709 dchi[0] = .65 - dits[0];
1710 dchi[1] = 0.0071/2.;
1711 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1712 // 7.5 cm is the lenght
1713 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1715 // --- Define the part of the (larger) rib between two sensitive parts
1716 // made of water (the cooler) (layer #3)
1718 dwat[0] = .65 - dits[0];
1719 dwat[1] = 0.0093/2.;
1720 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1721 // 7.5 cm is the lenght
1722 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1724 //--- Define the third part of the (larger) rib between two sensitive parts
1725 // made of aluminum (the cooling tubes) (layer #3)
1727 dtub[0] = .65 - dits[0];
1728 dtub[1] = 0.00134/2.;
1729 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1730 // 7.5 cm is the lenght
1731 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1733 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1737 for(j = 1; j <= 5; ++j) {
1738 // odd element are up and even elements are down
1740 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1741 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1742 } else if (j == 2) {
1743 xpos = -dbox2[0] + dits[0];
1744 zpos = 0. - dits[2] + 1. - dits[2];
1745 } else if (j == 3) {
1746 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1748 } else if (j == 4) {
1749 xpos = -dbox2[0] + dits[0];
1750 zpos = dits[2] + 0. - 1. + dits[2];
1751 } else if (j == 5) {
1752 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1753 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1755 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1758 // --- Place the larger ribs into their mother (IDV2)
1761 // --- Right ribs (just a matter of convention)
1763 xpos = .65 - dbox2[0] + dits[0];
1769 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1773 ypos = dsup[1] + 2.81 + dal1[1];
1774 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1778 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1779 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1783 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1784 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1786 // --- Silicon (chip)
1788 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1789 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1793 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1794 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1798 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1799 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1801 // --- Right ribs (just a matter of convention)
1806 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1810 ypos = -(dsup[1] + 2.81 + dal1[1]);
1811 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1815 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1816 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1820 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1821 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1823 // --- Silicon (chip)
1825 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1826 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1830 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1831 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1835 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1836 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1838 // --- Place the end-ladder stuff into its mother (IDV1)
1841 // --- Negative-Z end-ladder
1844 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1848 xpos = dbox2[0] - dpcb[0];
1849 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1853 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1854 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1858 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1859 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1861 // --- Silicon (bus)
1863 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1864 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1866 // --- Positive-Z end-ladder
1869 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1873 xpos = dbox2[0] - dpcb[0];
1874 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1878 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1879 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1883 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1884 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1886 // --- Silicon (bus)
1888 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1889 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1891 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1892 // mother volume (IT34)
1893 // Odd elements have large ribs and even elements have small ribs
1895 for(i = 1; i <= 12; ++i) {
1896 atheta = (i-1) * 30.;
1897 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1900 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1901 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1903 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1906 xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
1907 ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
1909 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1916 // GOTO 4567 ! skip ITS layer no. 4
1918 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1919 // smaller lenght of ribs) and fill it with air or vacuum
1921 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1923 // the widest element is the end-ladder stuff
1924 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1925 // 7.5 cm is the lenght
1926 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1928 // --- Make the ghost volume invisible
1930 gMC->Gsatt("IDV3", "SEEN", 0);
1932 // --- Define a volume containing the sensitive part of drifts
1933 // (silicon, layer #4)
1936 // see material budget report by G. Feofilov
1939 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1941 //--- Define the part of the (smaller) rib between two sensitive parts made of
1942 // carbon (layer #4)
1944 dsup[0] = .5 - dits[0];
1946 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1947 // 7.5 cm is the lengh
1948 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1950 //--- Define the first part of the (smaller) rib between two sensitive parts
1951 // made of aluminum (layer #4)
1953 dal1[0] = .5 - dits[0];
1954 dal1[1] = 0.00096/2.;
1955 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1956 // 7.5 cm is the lengh
1957 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1959 //--- Define the part of the (smaller) rib between two sensitive parts made of
1960 // kapton (layer #4)
1962 dkap[0] = .5 - dits[0];
1963 dkap[1] = 0.0317/2.;
1964 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1965 // 7.5 cm is the lengh
1966 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1968 //--- Define the second part of the (smaller) rib between two sensitive parts
1969 // made of aluminum (layer #4)
1971 dal2[0] = .5 - dits[0];
1972 dal2[1] = 0.0027/2.;
1973 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1974 // 7.5 cm is the lengh
1975 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1977 // --- Define the part of the (smaller) rib between two sensitive parts
1978 // made of silicon (the electronics) (layer #4)
1980 dchi[0] = .5 - dits[0];
1981 dchi[1] = 0.0071/2.;
1982 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1983 // 7.5 cm is the lengh
1984 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1986 // --- Define the part of the (smaller) rib between two sensitive parts
1987 // made of water (the cooler) (layer #4)
1989 dwat[0] = .5 - dits[0];
1990 dwat[1] = 0.0093/2.;
1991 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1992 // 7.5 cm is the lenght
1993 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1995 //--- Define the third part of the (smaller) rib between two sensitive parts
1996 // made of aluminum (the cooling tubes) (layer #4)
1998 dtub[0] = .5 - dits[0];
1999 dtub[1] = 0.00134/2.;
2000 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2001 // 7.5 cm is the lengh
2002 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
2004 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
2007 // twice the foreseen thickness
2010 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
2012 // --- Define the part of the end-ladder stuff made of copper (layer #4)
2015 // twice the foreseen thickness
2018 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
2020 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
2023 // twice the foreseen thickness
2026 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
2028 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
2031 // twice the foreseen thickness
2034 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
2036 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2040 for(j = 1; j <= 7; ++j) {
2041 // odd elements are down and even elements are up
2043 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2044 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2045 } else if (j == 2) {
2046 xpos = -dbox1[0] + dits[0];
2047 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2048 } else if (j == 3) {
2049 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2050 zpos = 0. - dits[2] + .7 - dits[2];
2051 } else if (j == 4) {
2052 xpos = -dbox1[0] + dits[0];
2054 } else if (j == 5) {
2055 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2056 zpos = dits[2] + 0. - .7 + dits[2];
2057 } else if (j == 6) {
2058 xpos = -dbox1[0] + dits[0];
2059 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2060 } else if (j == 7) {
2061 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2062 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2064 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2067 // --- Place the smaller ribs into their mother (IDV3)
2069 // --- Right ribs (just a matter of convention)
2071 xpos = .5 - dbox1[0] + dits[0];
2077 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2081 ypos = dsup[1] + 2.81 + dal1[1];
2082 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2086 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2087 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2091 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2092 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2094 // --- Silicon (chip)
2096 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2097 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2101 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2102 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2106 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2108 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2110 // --- Right ribs (just a matter of convention)
2115 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2119 ypos = -(dsup[1] + 2.81 + dal1[1]);
2120 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2124 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2125 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2129 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2131 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2133 // --- Silicon (chip)
2135 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2136 2. + dal2[1] * 2. + dchi[1]);
2137 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2141 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2142 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2143 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2147 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2148 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2150 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2152 // --- Place the end-ladder stuff into its mother (IDV1)
2155 // --- Negative-Z end-ladder
2158 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2162 xpos = dbox1[0] - dpcb[0];
2163 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2167 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2168 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2172 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2173 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2175 // --- Silicon (bus)
2177 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2178 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2180 // --- Positive-Z end-ladder
2183 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2187 xpos = dbox1[0] - dpcb[0];
2188 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2192 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2193 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2197 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2198 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2200 // --- Silicon (bus)
2202 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2203 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2205 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2206 // larger lenght of ribs) and fill it with air or vacuum
2208 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2210 // the widest element is the end-ladder stuff
2211 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2212 // 7.5 cm is the lenght
2213 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2215 // --- Make the ghost volume invisible
2217 gMC->Gsatt("IDV4", "SEEN", 0);
2219 //--- Define the part of the (larger) rib between two sensitive parts madeof
2220 // carbon (layer #4)
2222 dsup[0] = .65 - dits[0];
2224 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2225 // 7.5 cm is the lengh
2226 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2228 //--- Define the first part of the (larger) rib between two sensitive parts
2229 // made of aluminum (layer #4)
2231 dal1[0] = .65 - dits[0];
2232 dal1[1] = 0.00096/2.;
2233 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2234 // 7.5 cm is the lengh
2235 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2237 //--- Define the part of the (larger) rib between two sensitive parts madeof
2238 // kapton (layer #4)
2240 dkap[0] = .65 - dits[0];
2241 dkap[1] = 0.0317/2.;
2242 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2243 // 7.5 cm is the lengh
2244 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2246 //--- Define the second part of the (larger) rib between two sensitive parts
2247 // made of aluminum (layer #4)
2249 dal2[0] = .65 - dits[0];
2250 dal2[1] = 0.0027/2.;
2251 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2252 // 7.5 cm is the lengh
2253 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2255 // --- Define the part of the (larger) rib between two sensitive parts
2256 // made of silicon (the electronics) (layer #4)
2258 dchi[0] = .65 - dits[0];
2259 dchi[1] = 0.0071/2.;
2260 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2261 // 7.5 cm is the lengh
2262 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2264 // --- Define the part of the (larger) rib between two sensitive parts
2265 // made of water (the cooler) (layer #4)
2267 dwat[0] = .65 - dits[0];
2268 dwat[1] = 0.0093/2.;
2269 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2270 // 7.5 cm is the lengh
2271 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2273 //--- Define the third part of the (larger) rib between two sensitive parts
2274 // made of aluminum (the cooling tubes) (layer #4)
2276 dtub[0] = .65 - dits[0];
2277 dtub[1] = 0.00134/2.;
2278 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2279 // 7.5 cm is the lengh
2280 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2282 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2286 for(j = 1; j <= 7; ++j) {
2287 // odd elements are down and even elements are up
2289 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2290 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2291 } else if (j == 2) {
2292 xpos = -dbox2[0] + dits[0];
2293 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2294 } else if (j == 3) {
2295 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2296 zpos = 0. - dits[2] + .7 - dits[2];
2297 } else if (j == 4) {
2298 xpos = -dbox2[0] + dits[0];
2300 } else if (j == 5) {
2301 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2302 zpos = dits[2] + 0. - .7 + dits[2];
2303 } else if (j == 6) {
2304 xpos = -dbox2[0] + dits[0];
2305 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2306 } else if (j == 7) {
2307 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2308 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2310 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2313 // --- Place the larger ribs into their mother (IDV4)
2316 // --- Right ribs (just a matter of convention)
2318 xpos = .65 - dbox2[0] + dits[0];
2324 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2328 ypos = dsup[1] + 2.81 + dal1[1];
2329 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2333 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2334 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2338 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2339 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2341 // --- Silicon (chip)
2343 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2344 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2348 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2349 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2353 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2355 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2357 // --- Right ribs (just a matter of convention)
2362 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2366 ypos = -(dsup[1] + 2.81 + dal1[1]);
2367 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2371 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2372 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2376 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2378 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2380 // --- Silicon (chip)
2382 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2383 2. + dal2[1] * 2. + dchi[1]);
2384 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2388 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2389 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2390 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2394 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2395 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2396 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2398 // --- Place the end-ladder stuff into its mother (IDV1)
2401 // --- Negative-Z end-ladder
2404 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2408 xpos = dbox2[0] - dpcb[0];
2409 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2413 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2414 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2418 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2419 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2421 // --- Silicon (bus)
2423 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2424 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2426 // --- Positive-Z end-ladder
2429 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2433 xpos = dbox2[0] - dpcb[0];
2434 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2438 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2439 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2443 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2444 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2446 // --- Silicon (bus)
2448 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2449 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2451 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2452 // mother volume (IT34)
2453 // Odd elements have large ribs and even elements have small ribs
2455 for(i = 1; i <= 24; ++i) {
2456 atheta = (i-1) * 15.;
2457 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2460 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2461 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2463 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2465 rzero = (24.0+22.8)/2.;
2466 xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
2467 ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
2469 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2473 //************************************************************************
2478 //************************************************************************
2480 // --- Define SSD with the 35+39 lay-out
2482 if (fMinorVersionV3 < 3) {
2484 //--- Define ghost volume containing the Strip Detectors and fill it with air
2487 xxm = (49.999-3.)/(70.-25.);
2491 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2492 (37.-27)/xxm-(49.998-37.)/xxm;
2495 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2499 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2503 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2504 (37.-27)/xxm+(49.998-37.)/xxm;
2507 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2508 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2509 gMC->Gsatt("IT56", "SEEN", 0);
2513 // GOTO 5678 ! skip ITS layer no. 5
2515 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2516 // it with air or vacuum
2518 dbox1[0] = (0.0600+2.*0.0150)/2.;
2520 dbox1[2] = 90.22/2.;
2521 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2523 // --- Make the ghost volume invisible
2525 gMC->Gsatt("ISV1", "SEEN", 0);
2527 // --- Define a ghost volume containing the electronics and cooling of
2528 // a single ladder of layer #5 and fill it with air or vacuum
2530 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2533 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2535 // --- Make the ghost volume invisible
2537 gMC->Gsatt("SSV1", "SEEN", 0);
2539 // --- Define a ghost volume containing the end-ladder stuff of
2540 // a single ladder of layer #5 and fill it with air or vacuum
2545 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2547 // --- Make the ghost volume invisible
2549 gMC->Gsatt("ELL5", "SEEN", 0);
2551 // --- Define a volume containing the sensitive part of the strips
2552 // (silicon, layer #5)
2557 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2559 // --- Define a volume containing the electronics of the strips
2560 // (silicon, layer #5)
2565 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2567 // --- Define the cooling tubes (aluminum, layer #5)
2570 dtub[1] = dtub[0] + .01;
2572 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2574 // --- Define the cooling fluid (water or freon, layer #5)
2579 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2580 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2582 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2590 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2591 dfra[6] = dfra[5] + .03;
2595 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2597 // --- Define the element connecting the triangles of the heat bridge
2598 // (carbon, layer #5)
2603 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2605 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2608 dpla[0] = (10./(8.*7.))/2.;
2611 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2613 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2615 dcop[0] = (2./(8.*7.))/2.;
2618 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2620 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2622 depx[0] = (30./(8.*7.))/2.;
2625 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2627 // --- Define the part of the end-ladder stuff made of silicon (bus)
2630 dsil[0] = (20./(8.*7.))/2.;
2633 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2635 // --- Place the end-ladder stuff into its mother (ELL5)
2637 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2643 xpos = -dela[0] + dpla[0];
2644 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2648 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2649 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2653 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2654 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2656 // --- Silicon (bus)
2658 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2659 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2661 // --- Place the sensitive part of the strips into its mother (ISV1)
2664 for(j = 1; j <= 23; ++j) {
2665 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2666 else xpos = -dbox1[0] + dits[0];
2667 zpos = ((j - 1) - 11.) * 3.91;
2668 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2671 // --- Place the electronics of the strips into its mother (SSV1)
2674 for(j = 1; j <= 23; ++j) {
2675 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2676 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2677 zpos = ((j - 1) - 11.) * 3.91 + .85;
2678 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2681 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2683 xpos = -dsrv[0] + .41;
2686 // --- Left tube (just a matter of convention)
2689 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2690 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2692 // --- Right tube (just a matter of convention)
2695 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2696 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2698 // --- Place the heat bridge elements into their mother (SSV1)
2700 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2702 for(j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2703 // volume SSV1. This is the same number of
2704 // elements as SCH5 above. Done Bjorn S. Nilsen
2705 // April 4 2000. Error found by Ivana
2706 // Hrivnacova March 29 2000.
2707 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2708 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2711 // --- Place the elements connecting the triangles of the heat bridge
2712 // into their mother (SSV1)
2716 // --- Left element (just a matter of convention)
2718 xpos = -dsrv[0] + .47;
2719 ypos = -(2.1+0.015);
2720 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2722 // --- Right element
2724 xpos = -dsrv[0] + .47;
2726 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2730 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2732 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2734 // --- Place the ghost volumes containing the strip ladders (ISV1),
2735 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2736 // their mother volume (IT56)
2738 offset1 = TMath::ATan2(.9, 40.);
2740 rzero = dbox1[0] + 40.;
2741 runo = dbox1[0] * 2. + 40. + dsrv[0];
2742 rtwo = dbox1[0] * 2. + 40. + dela[0];
2743 for(i = 1; i <= 35; ++i) {
2744 atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
2745 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2747 // --- Strip ladders
2749 xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2750 ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2752 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2754 // --- Electronics/cooling
2756 xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2757 ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2759 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2761 // --- End-ladders (nagative-Z and positive-Z)
2763 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
2764 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
2765 zpos = -(dbox1[2] + dela[2] + 6.);
2766 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2767 zpos = dbox1[2] + dela[2] + 6.;
2768 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2774 // GOTO 5778 ! skip ITS layer no. 6
2776 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2777 // it with air or vacuum
2779 dbox2[0] = (0.0600+2.*0.0150)/2.;
2781 dbox2[2] = 101.95/2.;
2782 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2784 // --- Make the ghost volume invisible
2786 gMC->Gsatt("ISV2", "SEEN", 0);
2788 // --- Define a ghost volume containing the electronics and cooling of
2789 // a single ladder of layer #6 and fill it with air or vacuum
2791 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2793 dsrv[2] = 101.95/2.;
2794 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2796 // --- Make the ghost volume invisible
2798 gMC->Gsatt("SSV2", "SEEN", 0);
2800 // --- Define a ghost volume containing the end-ladder stuff of
2801 // a single ladder of layer #6 and fill it with air or vacuum
2806 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2808 // --- Make the ghost volume invisible
2810 gMC->Gsatt("ELL6", "SEEN", 0);
2812 // --- Define a volume containing the sensitive part of the strips
2813 // (silicon, layer #6)
2818 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2820 // --- Define a volume containing the electronics of the strips
2821 // (silicon, layer #6)
2826 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2828 // --- Define the cooling tubes (aluminum, layer #6)
2831 dtub[1] = dtub[0] + .01;
2832 dtub[2] = 101.95/2.;
2833 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2835 // --- Define the cooling fluid (water or freon, layer #6)
2839 dwat[2] = 101.95/2.;
2840 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2841 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2843 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2851 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2852 dfra[6] = dfra[5] + .03;
2856 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2858 // --- Define the element connecting the triangles of the heat bridge
2859 // (carbon, layer #6)
2863 dcei[2] = 101.95/2.;
2864 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2866 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2869 dpla[0] = (10./(8.*7.))/2.;
2872 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2874 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2876 dcop[0] = (2./(8.*7.))/2.;
2879 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2881 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2883 depx[0] = (30./(8.*7.))/2.;
2886 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2888 // --- Define the part of the end-ladder stuff made of silicon (bus)
2891 dsil[0] = (20./(8.*7.))/2.;
2894 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2896 // --- Place the end-ladder stuff into its mother (ELL5)
2898 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2904 xpos = -dela[0] + dpla[0];
2905 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2909 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2910 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2914 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2915 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2917 // --- Silicon (bus)
2919 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2920 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2922 // --- Place the sensitive part of the strips into its mother (ISV2)
2925 for(j = 1; j <= 26; ++j) {
2926 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2927 else xpos = -dbox2[0] + dits[0];
2928 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2929 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2932 // --- Place the electronics of the strips into its mother (SSV2)
2935 for(j = 1; j <= 26; ++j) {
2936 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2937 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2938 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2939 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2942 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2944 xpos = -dsrv[0] + .41;
2947 // --- Left tube (just a matter of convention)
2950 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2951 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2953 // --- Right tube (just a matter of convention)
2956 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2957 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2959 // --- Place the heat bridge elements into their mother (SSV2)
2961 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2963 for(j = 1; j <= 27; ++j) {
2964 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2965 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2968 // --- Place the elements connecting the triangles of the heat bridge
2969 // into their mother (SSV2)
2973 // --- Left element (just a matter of convention)
2975 xpos = -dsrv[0] + .47;
2976 ypos = -(2.1+0.015);
2977 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2979 // --- Right element
2981 xpos = -dsrv[0] + .47;
2983 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2987 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2989 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2991 // --- Place the ghost volumes containing the strip ladders (ISV2),
2992 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2993 // their mother volume (IT56)
2995 offset1 = TMath::ATan2(1., 45.);
2997 rzero = dbox2[0] + 45.;
2998 runo = dbox2[0] * 2. + 45. + dsrv[0];
2999 rtwo = dbox2[0] * 2. + 45. + dela[0];
3000 for(i = 1; i <= 39; ++i) {
3001 atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
3002 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3004 // --- Strip ladders
3006 xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3007 ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3009 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3011 // --- Electronics/cooling
3013 xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3014 ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3016 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3018 // --- End-ladders (nagative-Z and positive-Z)
3020 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
3021 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
3022 zpos = -(dbox2[2] + dela[2] + 6.);
3023 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3024 zpos = dbox2[2] + dela[2] + 6.;
3025 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3030 // --- Define SSD with the 32+36 lay-out
3032 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
3034 //--- Define ghost volume containing the Strip Detectors and fill it with air
3037 xxm = (49.999-3.)/(70.-25.);
3041 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
3042 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3045 dgh[6] = -25. - (9.-3.01) / xxm -
3046 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3049 dgh[9] = (9.-3.01) / xxm + 25. +
3050 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3053 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3054 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3057 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3058 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3059 gMC->Gsatt("IT56", "SEEN", 0);
3063 // GOTO 6678 ! skip ITS layer no. 5
3065 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3066 // it with air or vacuum
3068 dbox1[0] = (0.0600+2.*0.0150)/2.;
3070 dbox1[2] = 86.31/2.;
3071 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3073 // --- Make the ghost volume invisible
3075 gMC->Gsatt("ISV1", "SEEN", 0);
3077 // --- Define a ghost volume containing the electronics and cooling of
3078 // a single ladder of layer #5 and fill it with air or vacuum
3080 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3083 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3085 // --- Make the ghost volume invisible
3087 gMC->Gsatt("SSV1", "SEEN", 0);
3089 // --- Define a ghost volume containing the end-ladder stuff of
3090 // a single ladder of layer #5 and fill it with air or vacuum
3095 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3097 // --- Make the ghost volume invisible
3099 gMC->Gsatt("ELL5", "SEEN", 0);
3101 // --- Define a volume containing the sensitive part of the strips
3102 // (silicon, layer #5)
3107 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3109 // --- Define a volume containing the electronics of the strips
3110 // (silicon, layer #5)
3115 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3117 // --- Define the cooling tubes (aluminum, layer #5)
3120 dtub[1] = dtub[0] + .01;
3122 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3124 // --- Define the cooling fluid (water or freon, layer #5)
3129 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3130 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3132 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3140 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3141 dfra[6] = dfra[5] + .03;
3145 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3147 // --- Define the element connecting the triangles of the heat bridge
3148 // (carbon, layer #5)
3153 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3155 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3158 dpla[0] = (10./(8.*7.))/2;
3161 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3163 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3165 dcop[0] = (2./(8.*7.))/2;
3168 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3170 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3172 depx[0] = (30./(8.*7.))/2.;
3175 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3177 // --- Define the part of the end-ladder stuff made of silicon (bus)
3180 dsil[0] = (20./(8.*7.))/2.;
3183 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3185 // --- Place the end-ladder stuff into its mother (ELL5)
3187 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3193 xpos = -dela[0] + dpla[0];
3194 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3198 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3199 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3203 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3204 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3206 // --- Silicon (bus)
3208 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3209 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3211 // --- Place the sensitive part of the strips into its mother (ISV1)
3214 for(j = 1; j <= 22; ++j) {
3215 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3216 else xpos = -dbox1[0] + dits[0];
3217 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3218 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3221 // --- Place the electronics of the strips into its mother (SSV1)
3224 for(j = 1; j <= 22; ++j) {
3225 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3226 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3227 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3228 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3231 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3233 xpos = -dsrv[0] + .41;
3236 // --- Left tube (just a matter of convention)
3239 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3240 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3242 // --- Right tube (just a matter of convention)
3245 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3246 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3248 // --- Place the heat bridge elements into their mother (SSV1)
3250 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3252 for(j = 1; j <= 23; ++j) {
3253 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3254 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3257 // --- Place the elements connecting the triangles of the heat bridge
3258 // into their mother (SSV1)
3262 // --- Left element (just a matter of convention)
3264 xpos = -dsrv[0] + .47;
3265 ypos = -(2.1+0.015);
3266 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3268 // --- Right element
3270 xpos = -dsrv[0] + .47;
3272 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3276 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3278 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3280 // --- Place the ghost volumes containing the strip ladders (ISV1),
3281 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3282 // their mother volume (IT56)
3284 offset1 = TMath::ATan2(.8, 36.6);
3286 rzero = dbox1[0] + 36.6;
3287 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3288 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3289 for(i = 1; i <= 32; ++i) {
3290 atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
3291 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3293 // --- Strip ladders
3295 xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3296 ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3298 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3300 // --- Electronics/cooling
3302 xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3303 ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3305 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3307 // --- End-ladders (nagative-Z and positive-Z)
3309 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
3310 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
3311 zpos = -(dbox1[2] + dela[2] + 6.);
3312 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3313 zpos = dbox1[2] + dela[2] + 6.;
3314 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3320 // GOTO 6778 ! skip ITS layer no. 6
3322 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3323 // it with air or vacuum
3325 dbox2[0] = (0.0600+2.*0.0150)/2.;
3327 dbox2[2] = 94.13/2.;
3328 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3330 // --- Make the ghost volume invisible
3332 gMC->Gsatt("ISV2", "SEEN", 0);
3334 // --- Define a ghost volume containing the electronics and cooling of
3335 // a single ladder of layer #6 and fill it with air or vacuum
3337 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3340 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3342 // --- Make the ghost volume invisible
3344 gMC->Gsatt("SSV2", "SEEN", 0);
3346 // --- Define a ghost volume containing the end-ladder stuff of
3347 // a single ladder of layer #6 and fill it with air or vacuum
3352 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3354 // --- Make the ghost volume invisible
3356 gMC->Gsatt("ELL6", "SEEN", 0);
3358 // --- Define a volume containing the sensitive part of the strips
3359 // (silicon, layer #6)
3364 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3366 // --- Define a volume containing the electronics of the strips
3367 // (silicon, layer #6)
3372 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3374 // --- Define the cooling tubes (aluminum, layer #6)
3377 dtub[1] = dtub[0] + .01;
3379 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3381 // --- Define the cooling fluid (water or freon, layer #6)
3386 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3387 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3389 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3397 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3398 dfra[6] = dfra[5] + .03;
3402 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3404 // --- Define the element connecting the triangles of the heat bridge
3405 // (carbon, layer #6)
3410 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3412 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3415 dpla[0] = (10./(8.*7.))/2;
3418 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3420 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3422 dcop[0] = (2./(8.*7.))/2;
3425 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3427 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3429 depx[0] = (30./(8.*7.))/2.;
3432 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3434 // --- Define the part of the end-ladder stuff made of silicon (bus)
3437 dsil[0] = (20./(8.*7.))/2.;
3440 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3442 // --- Place the end-ladder stuff into its mother (ELL5)
3444 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3450 xpos = -dela[0] + dpla[0];
3451 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3455 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3456 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3460 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3461 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3463 // --- Silicon (bus)
3465 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3466 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3468 // --- Place the sensitive part of the strips into its mother (ISV2)
3471 for(j = 1; j <= 24; ++j) {
3472 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3473 else xpos = dbox2[0] - dits[0];
3474 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3475 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3478 // --- Place the electronics of the strips into its mother (SSV2)
3481 for(j = 1; j <= 24; ++j) {
3482 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3483 else xpos = -dsrv[0] + .28;
3484 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3485 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3488 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3490 xpos = -dsrv[0] + .41;
3493 // --- Left tube (just a matter of convention)
3496 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3497 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3499 // --- Right tube (just a matter of convention)
3502 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3503 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3505 // --- Place the heat bridge elements into their mother (SSV2)
3507 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3509 for(j = 1; j <= 25; ++j) {
3510 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3511 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3514 // --- Place the elements connecting the triangles of the heat bridge
3515 // into their mother (SSV2)
3519 // --- Left element (just a matter of convention)
3521 xpos = -dsrv[0] + .47;
3522 ypos = -(2.1+0.015);
3523 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3525 // --- Right element
3527 xpos = -dsrv[0] + .47;
3529 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3533 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3535 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3537 // --- Place the ghost volumes containing the strip ladders (ISV2),
3538 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3539 // their mother volume (IT56)
3541 offset1 = TMath::ATan2(.9, 41.2);
3543 rzero = dbox2[0] + 41.2;
3544 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3545 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3546 for(i = 1; i <= 36; ++i) {
3547 atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
3548 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3550 // --- Strip ladders
3552 xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3553 ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3555 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3557 // --- Electronics/cooling
3559 xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3560 ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3562 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3564 // --- End-ladders (nagative-Z and positive-Z)
3566 xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
3567 ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
3568 zpos = -(dbox2[2] + dela[2] + 6.);
3569 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3570 zpos = dbox2[2] + dela[2] + 6.;
3571 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3577 //************************************************************************
3579 //* E N D - C A P S A N D F R A M E S *
3580 //* ========================================= *
3582 //************************************************************************
3584 // --- Define a dummy cylinder for multiple scattering tests
3586 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3589 // DITS(2)=DITS(1)+0.1
3591 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3592 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3595 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3597 // GOTO 8901 ! skip outer wall
3599 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3602 dits[1] = dits[0] + .06926;
3603 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3605 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3606 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3611 // --- The frame between the end-caps (octagonal lay-out) ---
3613 // GOTO 9012 ! skip octagonal frame
3615 if (fMinorVersionV3 == 1) {
3620 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3623 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3625 offset = angle / 2.;
3626 for(i = 0; i < 8; ++i) {
3627 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3628 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3630 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3631 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3635 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;
3636 aphi2 = 180. - aphi1;
3637 xpos = (xtra[0] + xtra[1]) / 2.;
3638 ypos = (ytra[0] + ytra[1]) / 2.;
3639 zpos = dtra[2] / 2.;
3640 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3643 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3644 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3645 zpos = -dtra[2] / 2.;
3646 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3649 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3650 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3653 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;
3654 aphi1 = 180. - aphi2;
3655 xpos = (xtra[1] + xtra[2]) / 2.;
3656 ypos = (ytra[1] + ytra[2]) / 2.;
3657 zpos = dtra[2] / 2.;
3658 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3661 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3662 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3663 zpos = -dtra[2] / 2.;
3664 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3667 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3668 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3671 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;
3672 aphi2 = 180. - aphi1;
3673 xpos = (xtra[2] + xtra[3]) / 2.;
3674 ypos = (ytra[2] + ytra[3]) / 2.;
3675 zpos = dtra[2] / 2.;
3676 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3679 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3680 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3681 zpos = -dtra[2] / 2.;
3682 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3685 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3686 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3689 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;
3690 aphi1 = 180. - aphi2;
3691 xpos = (xtra[3] + xtra[4]) / 2.;
3692 ypos = (ytra[3] + ytra[4]) / 2.;
3693 zpos = dtra[2] / 2.;
3694 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3697 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3698 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3699 zpos = -dtra[2] / 2.;
3700 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3703 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3704 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3707 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;
3708 aphi1 = 180. - aphi2;
3709 xpos = (xtra[4] + xtra[5]) / 2.;
3710 ypos = (ytra[4] + ytra[5]) / 2.;
3711 zpos = dtra[2] / 2.;
3712 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3715 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3716 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3717 zpos = -dtra[2] / 2.;
3718 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3721 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3722 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3725 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;
3726 aphi2 = 180. - aphi1;
3727 xpos = (xtra[5] + xtra[6]) / 2.;
3728 ypos = (ytra[5] + ytra[6]) / 2.;
3729 zpos = dtra[2] / 2.;
3730 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3733 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3734 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3735 zpos = -dtra[2] / 2.;
3736 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3739 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3740 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3743 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;
3744 aphi1 = 180. - aphi2;
3745 xpos = (xtra[6] + xtra[7]) / 2.;
3746 ypos = (ytra[6] + ytra[7]) / 2.;
3747 zpos = dtra[2] / 2.;
3748 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3751 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3752 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3753 zpos = -dtra[2] / 2.;
3754 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3757 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3758 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3761 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;
3762 aphi2 = 180. - aphi1;
3763 xpos = (xtra[7] + xtra[0]) / 2.;
3764 ypos = (ytra[7] + ytra[0]) / 2.;
3765 zpos = dtra[2] / 2.;
3766 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3769 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3770 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3771 zpos = -dtra[2] / 2.;
3772 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3775 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3776 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3779 } else if (fMinorVersionV3 == 4) {
3785 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3788 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3790 offset = angle / 2.;
3791 for(i = 0; i < 8; ++i) {
3792 xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
3793 ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
3795 gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
3796 gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3800 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;
3801 aphi2 = 180. - aphi1;
3802 xpos = (xtra[0] + xtra[1]) / 2.;
3803 ypos = (ytra[0] + ytra[1]) / 2.;
3804 zpos = dtra[2] / 2.;
3805 gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
3808 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3809 gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3810 zpos = -dtra[2] / 2.;
3811 gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
3814 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3815 gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3818 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;
3819 aphi1 = 180. - aphi2;
3820 xpos = (xtra[1] + xtra[2]) / 2.;
3821 ypos = (ytra[1] + ytra[2]) / 2.;
3822 zpos = dtra[2] / 2.;
3823 gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
3826 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3827 gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3828 zpos = -dtra[2] / 2.;
3829 gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
3832 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3833 gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3836 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;
3837 aphi2 = 180. - aphi1;
3838 xpos = (xtra[2] + xtra[3]) / 2.;
3839 ypos = (ytra[2] + ytra[3]) / 2.;
3840 zpos = dtra[2] / 2.;
3841 gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
3844 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3845 gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3846 zpos = -dtra[2] / 2.;
3847 gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
3850 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3851 gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3854 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;
3855 aphi1 = 180. - aphi2;
3856 xpos = (xtra[3] + xtra[4]) / 2.;
3857 ypos = (ytra[3] + ytra[4]) / 2.;
3858 zpos = dtra[2] / 2.;
3859 gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
3862 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3863 gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3864 zpos = -dtra[2] / 2.;
3865 gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
3868 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3869 gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3872 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;
3873 aphi1 = 180. - aphi2;
3874 xpos = (xtra[4] + xtra[5]) / 2.;
3875 ypos = (ytra[4] + ytra[5]) / 2.;
3876 zpos = dtra[2] / 2.;
3877 gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
3880 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3881 gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3882 zpos = -dtra[2] / 2.;
3883 gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
3886 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3887 gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3890 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;
3891 aphi2 = 180. - aphi1;
3892 xpos = (xtra[5] + xtra[6]) / 2.;
3893 ypos = (ytra[5] + ytra[6]) / 2.;
3894 zpos = dtra[2] / 2.;
3895 gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
3898 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3899 gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3900 zpos = -dtra[2] / 2.;
3901 gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
3904 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3905 gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3908 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;
3909 aphi1 = 180. - aphi2;
3910 xpos = (xtra[6] + xtra[7]) / 2.;
3911 ypos = (ytra[6] + ytra[7]) / 2.;
3912 zpos = dtra[2] / 2.;
3913 gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
3916 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3917 gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3918 zpos = -dtra[2] / 2.;
3919 gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
3922 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3923 gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3926 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;
3927 aphi2 = 180. - aphi1;
3928 xpos = (xtra[7] + xtra[0]) / 2.;
3929 ypos = (ytra[7] + ytra[0]) / 2.;
3930 zpos = dtra[2] / 2.;
3931 gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
3934 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3935 gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3936 zpos = -dtra[2] / 2.;
3937 gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
3940 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3941 gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3947 // --- The frame between the end-caps (hexagonal lay-out) ---
3949 // GOTO 9123 ! skip hexagonal frame
3951 if (fMinorVersionV3 == 2) {
3956 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3962 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3964 offset = angle / 2.;
3965 for(i = 0; i < 6; ++i) {
3966 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
3967 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
3969 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
3970 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3975 xpos = (xtra1[0] + xtra1[1]) / 2.;
3976 ypos = (ytra1[0] + ytra1[1]) / 2.;
3978 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
3981 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3982 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3986 xpos = (xtra1[1] + xtra1[2]) / 2.;
3987 ypos = (ytra1[1] + ytra1[2]) / 2.;
3989 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
3992 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3993 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3997 xpos = (xtra1[2] + xtra1[3]) / 2.;
3998 ypos = (ytra1[2] + ytra1[3]) / 2.;
4000 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4003 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4004 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4008 xpos = (xtra1[3] + xtra1[4]) / 2.;
4009 ypos = (ytra1[3] + ytra1[4]) / 2.;
4011 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4014 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4015 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4019 xpos = (xtra1[4] + xtra1[5]) / 2.;
4020 ypos = (ytra1[4] + ytra1[5]) / 2.;
4022 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4025 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4026 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4030 xpos = (xtra1[5] + xtra1[0]) / 2.;
4031 ypos = (ytra1[5] + ytra1[0]) / 2.;
4033 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4036 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4037 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4040 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4041 aphi1 = 180. - aphi2;
4042 xpos = (xtra1[0] + xtra1[1]) / 2.;
4043 ypos = (ytra1[0] + ytra1[1]) / 2.;
4044 zpos = dtra2[2] / 2.;
4045 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4048 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4049 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4050 zpos = -dtra2[2] / 2.;
4051 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4054 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4055 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4058 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4059 aphi2 = 180. - aphi1;
4060 xpos = (xtra1[1] + xtra1[2]) / 2.;
4061 ypos = (ytra1[1] + ytra1[2]) / 2.;
4062 zpos = dtra2[2] / 2.;
4063 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4066 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4067 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4068 zpos = -dtra2[2] / 2.;
4069 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4072 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4073 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4076 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4077 aphi1 = 180. - aphi2;
4078 xpos = (xtra1[2] + xtra1[3]) / 2.;
4079 ypos = (ytra1[2] + ytra1[3]) / 2.;
4080 zpos = dtra2[2] / 2.;
4081 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4084 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4085 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4086 zpos = -dtra2[2] / 2.;
4087 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4090 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4091 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4093 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))
4094 - 50.*50.))) * kraddeg;
4095 aphi2 = 180. - aphi1;
4096 xpos = (xtra1[2] + xtra1[3]) / 2.;
4097 ypos = (ytra1[2] + ytra1[3]) / 2.;
4098 zpos = dtra2[2] / 2.;
4099 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4102 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4103 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4104 zpos = -dtra2[2] / 2.;
4105 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4108 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4109 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4112 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4113 aphi1 = 180. - aphi2;
4114 xpos = (xtra1[3] + xtra1[4]) / 2.;
4115 ypos = (ytra1[3] + ytra1[4]) / 2.;
4116 zpos = dtra2[2] / 2.;
4117 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4120 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4121 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4122 zpos = -dtra2[2] / 2.;
4123 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4126 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4127 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4130 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4131 aphi2 = 180. - aphi1;
4132 xpos = (xtra1[4] + xtra1[5]) / 2.;
4133 ypos = (ytra1[4] + ytra1[5]) / 2.;
4134 zpos = dtra2[2] / 2.;
4135 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4138 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4139 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4140 zpos = -dtra2[2] / 2.;
4141 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4144 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4145 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4148 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4149 aphi1 = 180. - aphi2;
4150 xpos = (xtra1[5] + xtra1[0]) / 2.;
4151 ypos = (ytra1[5] + ytra1[0]) / 2.;
4152 zpos = dtra2[2] / 2.;
4153 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4156 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4157 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4158 zpos = -dtra2[2] / 2.;
4159 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4162 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4163 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4165 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4166 aphi2 = 180. - aphi1;
4167 xpos = (xtra1[5] + xtra1[0]) / 2.;
4168 ypos = (ytra1[5] + ytra1[0]) / 2.;
4169 zpos = dtra2[2] / 2.;
4170 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4173 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4174 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4175 zpos = -dtra2[2] / 2.;
4176 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4179 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4180 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4183 } else if (fMinorVersionV3 == 5) {
4189 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4195 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4197 offset = angle / 2.;
4198 for(i = 0; i < 6; ++i) {
4199 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
4200 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
4202 gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
4203 gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4208 xpos = (xtra1[0] + xtra1[1]) / 2.;
4209 ypos = (ytra1[0] + ytra1[1]) / 2.;
4211 gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
4214 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4215 gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4219 xpos = (xtra1[1] + xtra1[2]) / 2.;
4220 ypos = (ytra1[1] + ytra1[2]) / 2.;
4222 gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
4225 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4226 gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4230 xpos = (xtra1[2] + xtra1[3]) / 2.;
4231 ypos = (ytra1[2] + ytra1[3]) / 2.;
4233 gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
4236 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4237 gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4241 xpos = (xtra1[3] + xtra1[4]) / 2.;
4242 ypos = (ytra1[3] + ytra1[4]) / 2.;
4244 gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
4247 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4248 gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4252 xpos = (xtra1[4] + xtra1[5]) / 2.;
4253 ypos = (ytra1[4] + ytra1[5]) / 2.;
4255 gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
4258 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4259 gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4263 xpos = (xtra1[5] + xtra1[0]) / 2.;
4264 ypos = (ytra1[5] + ytra1[0]) / 2.;
4266 gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
4269 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4270 gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4273 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4274 aphi1 = 180. - aphi2;
4275 xpos = (xtra1[0] + xtra1[1]) / 2.;
4276 ypos = (ytra1[0] + ytra1[1]) / 2.;
4277 zpos = dtra2[2] / 2.;
4278 gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
4281 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4282 gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4283 zpos = -dtra2[2] / 2.;
4284 gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
4287 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4288 gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4291 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4292 aphi2 = 180. - aphi1;
4293 xpos = (xtra1[1] + xtra1[2]) / 2.;
4294 ypos = (ytra1[1] + ytra1[2]) / 2.;
4295 zpos = dtra2[2] / 2.;
4296 gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
4299 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4300 gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4301 zpos = -dtra2[2] / 2.;
4302 gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
4305 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4306 gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4309 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4310 aphi1 = 180. - aphi2;
4311 xpos = (xtra1[2] + xtra1[3]) / 2.;
4312 ypos = (ytra1[2] + ytra1[3]) / 2.;
4313 zpos = dtra2[2] / 2.;
4314 gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
4317 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4318 gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4319 zpos = -dtra2[2] / 2.;
4320 gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
4323 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4324 gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4326 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4327 aphi2 = 180. - aphi1;
4328 xpos = (xtra1[2] + xtra1[3]) / 2.;
4329 ypos = (ytra1[2] + ytra1[3]) / 2.;
4330 zpos = dtra2[2] / 2.;
4331 gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
4334 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4335 gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4336 zpos = -dtra2[2] / 2.;
4337 gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
4340 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4341 gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4344 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4345 aphi1 = 180. - aphi2;
4346 xpos = (xtra1[3] + xtra1[4]) / 2.;
4347 ypos = (ytra1[3] + ytra1[4]) / 2.;
4348 zpos = dtra2[2] / 2.;
4349 gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
4352 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4353 gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4354 zpos = -dtra2[2] / 2.;
4355 gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
4358 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4359 gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4362 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4363 aphi2 = 180. - aphi1;
4364 xpos = (xtra1[4] + xtra1[5]) / 2.;
4365 ypos = (ytra1[4] + ytra1[5]) / 2.;
4366 zpos = dtra2[2] / 2.;
4367 gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
4370 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4371 gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4372 zpos = -dtra2[2] / 2.;
4373 gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
4376 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4377 gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4380 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4381 aphi1 = 180. - aphi2;
4382 xpos = (xtra1[5] + xtra1[0]) / 2.;
4383 ypos = (ytra1[5] + ytra1[0]) / 2.;
4384 zpos = dtra2[2] / 2.;
4385 gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
4388 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4389 gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4390 zpos = -dtra2[2] / 2.;
4391 gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
4394 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4395 gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4397 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
4398 aphi2 = 180. - aphi1;
4399 xpos = (xtra1[5] + xtra1[0]) / 2.;
4400 ypos = (ytra1[5] + ytra1[0]) / 2.;
4401 zpos = dtra2[2] / 2.;
4402 gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
4405 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4406 gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4407 zpos = -dtra2[2] / 2.;
4408 gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
4411 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4412 gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4418 // --- Define the end-caps
4420 // GOTO 9234 ! skip both end-caps
4422 // --- Define the Z>0 end-cap
4424 // GOTO 9345 ! skip the Z>0 end-cap
4429 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4430 dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4433 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4434 // end-ladder electro
4435 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4436 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4438 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4440 // In the Simonetti's drawings 52. In the TP 50.
4444 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4445 // end-ladder electro
4446 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4447 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4451 dtube[2] = 26.8/2./10.;
4454 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4456 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4457 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4463 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4464 // end-ladder electron
4467 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4468 // end-ladder electronics
4474 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4475 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4481 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4485 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4492 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4493 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4495 if (fMinorVersionV3 < 3 ) {
4497 dpgon[0] = offset2 + 360./(2.*35.);
4501 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4505 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4512 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4513 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4515 dpgon[0] = offset2 + 360./(2.*39.);
4519 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4523 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4530 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4531 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4533 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4535 dpgon[0] = offset2 + 5.625;
4539 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4540 // end-ladder electronics
4543 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4544 // end-ladder electr
4550 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4551 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4553 dpgon[0] = offset2 + 5.;
4557 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4558 // end-ladder electronics
4561 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
4562 // end-ladder electr
4568 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4569 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4574 // --- Define the Z<0 end-cap
4576 // GOTO 9456 ! skip the Z<0 end-cap
4579 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4580 dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4585 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4586 // end-ladder electr
4587 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4589 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4591 dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4593 // In the Simonetti's drawings 52. In the TP 50.
4597 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4598 // end-ladder electr
4599 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4601 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4605 dtube[2] = 26.8/2./10.;
4608 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4610 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4612 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4618 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4619 // end-ladder electronics
4622 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4623 // end-ladder electro
4629 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4630 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4636 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4640 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4647 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4648 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4650 if (fMinorVersionV3 < 3) {
4652 dpgon[0] = offset2 + 360./(2.*35.);
4656 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4660 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4667 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4668 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4670 dpgon[0] = offset2 + 360./(2.*39.);
4674 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4678 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4685 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4686 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4688 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4690 dpgon[0] = offset2 + 5.625;
4694 dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4695 // end-ladder electronics
4698 dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4699 // end-ladder electr
4705 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4706 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4708 dpgon[0] = offset2 + 5.;
4712 dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4713 // end-ladder electronics
4716 dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4717 // end-ladder electr
4723 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4724 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4730 // --- Outputs the geometry tree in the EUCLID/CAD format
4733 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4735 fMinorVersion = fMinorVersionV3;
4737 //_____________________________________________________________________________
4738 void AliITSv3::CreateMaterials(){
4739 ////////////////////////////////////////////////////////////////////////
4741 // Create ITS materials
4742 // This function defines the default materials used in the Geant
4743 // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
4744 // In general it is automatically replaced by
4745 // the CreatMaterials routine defined in AliITSv?. Should the function
4746 // CreateMaterials not exist for the geometry version you are using this
4747 // one is used. See the definition found in AliITSv5 or the other routine
4748 // for a complete definition.
4751 Float_t awat[2] = { 1.00794,15.9994 };
4752 Float_t zwat[2] = { 1.,8. };
4753 Float_t wwat[2] = { 2.,1. };
4754 Float_t denswat = 1.;
4756 Float_t afre[2] = { 12.011,18.9984032 };
4757 Float_t zfre[2] = { 6.,9. };
4758 Float_t wfre[2] = { 5.,12. };
4759 Float_t densfre = 1.5;
4761 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4762 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4763 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4764 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4765 Float_t denscer = 3.6;
4767 // 60% SiO2 , 40% G10FR4
4769 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4770 Float_t zpcb[3] = { 14.,8.,8.875 };
4771 Float_t wpcb[3] = { .28,.32,.4 };
4772 Float_t denspcb = 1.8;
4774 Float_t apoly[2] = { 12.01,1. };
4775 Float_t zpoly[2] = { 6.,1. };
4776 Float_t wpoly[2] = { .33,.67 };
4778 Float_t zserv[4] = { 1.,6.,26.,29. };
4779 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4780 Float_t wserv[4] = { .014,.086,.42,.48 };
4782 Int_t isxfld = gAlice->Field()->Integ();
4783 Float_t sxmgmx = gAlice->Field()->Max();
4786 // --- Define the various materials for GEANT ---
4788 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4790 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4791 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4792 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4793 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4795 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4796 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4797 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4798 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4799 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4801 AliMedium(0, "SPD Si$", 0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4802 AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4803 AliMedium(2, "SPD Si bus$", 2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4804 AliMedium(3, "SPD C$", 3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4805 AliMedium(4, "SPD Air$", 4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4806 AliMedium(5, "SPD Vacuum$", 5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4807 AliMedium(6, "SPD Al$", 6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4808 AliMedium(7, "SPD Water $", 7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4809 AliMedium(8, "SPD Freon$", 8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4811 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4813 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4814 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4815 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4816 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4818 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4819 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4820 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4821 // After a call with ratios by number (negative number of elements),
4822 // the ratio array is changed to the ratio by weight, so all successive
4823 // calls with the same array must specify the number of elements as
4825 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4826 // After a call with ratios by number (negative number of elements),
4827 // the ratio array is changed to the ratio by weight, so all successive
4828 // calls with the same array must specify the number of elements as
4830 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4831 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4832 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4833 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4834 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4837 AliMedium(25, "SDD Si$", 25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4838 AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4839 AliMedium(27, "SDD Si bus$", 27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4840 AliMedium(28, "SDD C$", 28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4841 AliMedium(29, "SDD Air$", 29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4842 AliMedium(30, "SDD Vacuum$", 30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4843 AliMedium(31, "SDD Al$", 31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4844 AliMedium(32, "SDD Water $", 32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4845 AliMedium(33, "SDD Freon$", 33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4846 AliMedium(34, "SDD PCB$", 34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4847 AliMedium(35, "SDD Copper$", 35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4848 AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4849 AliMedium(37, "SDD Kapton$", 37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4851 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4853 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4854 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4855 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4856 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4858 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4859 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4860 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4861 // After a call with ratios by number (negative number of elements),
4862 // the ratio array is changed to the ratio by weight, so all successive
4863 // calls with the same array must specify the number of elements as
4865 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
4866 // After a call with ratios by number (negative number of elements),
4867 // the ratio array is changed to the ratio by weight, so all successive
4868 // calls with the same array must specify the number of elements as
4870 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4871 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4872 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4873 // After a call with ratios by number (negative number of elements),
4874 // the ratio array is changed to the ratio by weight, so all successive
4875 // calls with the same array must specify the number of elements as
4877 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4878 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4880 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4882 AliMedium(50, "SSD Si$", 50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4883 AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4884 AliMedium(52, "SSD Si bus$", 52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4885 AliMedium(53, "SSD C$", 53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4886 AliMedium(54, "SSD Air$", 54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4887 AliMedium(55, "SSD Vacuum$", 55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
4888 AliMedium(56, "SSD Al$", 56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4889 AliMedium(57, "SSD Water $", 57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4890 AliMedium(58, "SSD Freon$", 58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4891 AliMedium(59, "SSD PCB$", 59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4892 AliMedium(60, "SSD Copper$", 60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4893 AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4894 AliMedium(62, "SSD Kapton$", 62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4895 AliMedium(63, "SSD G10FR4$", 63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4897 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4899 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4901 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4902 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4903 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4904 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4905 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4906 // After a call with ratios by number (negative number of elements),
4907 // the ratio array is changed to the ratio by weight, so all successive
4908 // calls with the same array must specify the number of elements as
4910 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4912 AliMedium(75,"GEN C$", 75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4913 AliMedium(76,"GEN Air$", 76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4914 AliMedium(77,"GEN Vacuum$", 77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
4915 AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4916 AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4917 AliMedium(80,"GEN Copper$", 80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4918 AliMedium(81,"GEN Water $", 81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
4920 //_____________________________________________________________________________
4921 void AliITSv3::Init(){
4922 ////////////////////////////////////////////////////////////////////////
4923 // Initialise the ITS after it has been created.
4924 ////////////////////////////////////////////////////////////////////////
4928 fIdName = new char*[fIdN];
4929 fIdSens = new Int_t[fIdN];
4930 for(i=0;i<fId3N;i++) {
4931 l = strlen(fId3Name[i]);
4932 fIdName[i] = new char[l+1];
4933 for(j=0;j<l;j++) fIdName[i][j] = fId3Name[i][j];
4934 fIdName[i][l] = '\0'; // Null terminate this string.
4939 fMinorVersion = fMinorVersionV3;
4941 //_____________________________________________________________________________
4942 void AliITSv3::StepManager(){
4943 ////////////////////////////////////////////////////////////////////////
4944 // Called for every step in the ITS, then calles the AliITShit class
4945 // creator with the information to be recoreded about that hit.
4946 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4947 // printing of information to a file which can be used to create a .det
4948 // file read in by the routine CreateGeometry(). If set to 0 or any other
4949 // value except 1, the default behavior, then no such file is created nor
4950 // it the extra variables and the like used in the printing allocated.
4951 ////////////////////////////////////////////////////////////////////////
4955 TLorentzVector position, momentum;
4956 TClonesArray &lhits = *fHits;
4957 #if ALIITSPRINTGEOM==1
4960 Float_t xl[3],xt[3],angl[6];
4961 // Float_t par[20],att[20];
4963 static Bool_t first=kTRUE,printit[6][50][50];
4964 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4965 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4973 if(gMC->IsTrackInside()) vol[3] += 1;
4974 if(gMC->IsTrackEntering()) vol[3] += 2;
4975 if(gMC->IsTrackExiting()) vol[3] += 4;
4976 if(gMC->IsTrackOut()) vol[3] += 8;
4977 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4978 if(gMC->IsTrackStop()) vol[3] += 32;
4979 if(gMC->IsTrackAlive()) vol[3] += 64;
4981 // Fill hit structure.
4982 if(!(gMC->TrackCharge())) return;
4984 // Only entering charged tracks
4985 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4987 id=gMC->CurrentVolOffID(1,copy);
4989 id=gMC->CurrentVolOffID(2,copy);
4991 } else if(id==fIdSens[1]) {
4993 id=gMC->CurrentVolOffID(1,copy);
4995 id=gMC->CurrentVolOffID(2,copy);
4997 } else if(id==fIdSens[2]) {
5000 id=gMC->CurrentVolOffID(1,copy);
5002 } else if(id==fIdSens[3]) {
5005 id=gMC->CurrentVolOffID(1,copy);
5007 } else if(id==fIdSens[4]) {
5010 id=gMC->CurrentVolOffID(1,copy);
5012 } else if(id==fIdSens[5]) {
5015 id=gMC->CurrentVolOffID(1,copy);
5018 gMC->TrackPosition(position);
5019 gMC->TrackMomentum(momentum);
5020 hits[0]=position[0];
5021 hits[1]=position[1];
5022 hits[2]=position[2];
5023 hits[3]=momentum[0];
5024 hits[4]=momentum[1];
5025 hits[5]=momentum[2];
5026 hits[6]=gMC->Edep();
5027 hits[7]=gMC->TrackTime();
5028 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
5029 #if ALIITSPRINTGEOM==1
5030 if(printit[vol[0]][vol[2]][vol[1]]){
5031 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
5032 xl[0] = xl[1] = xl[2] = 0.0;
5033 gMC->Gdtom(xl,xt,1);
5034 for(i=0;i<9;i++) mat[i] = 0.0;
5035 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
5038 gMC->Gdtom(xl,&(mat[0]),2);
5041 gMC->Gdtom(xl,&(mat[3]),2);
5044 gMC->Gdtom(xl,&(mat[6]),2);
5046 angl[0] = TMath::ACos(mat[2]);
5047 if(mat[2]==1.0) angl[0] = 0.0;
5048 angl[1] = TMath::ATan2(mat[1],mat[0]);
5049 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5051 angl[2] = TMath::ACos(mat[5]);
5052 if(mat[5]==1.0) angl[2] = 0.0;
5053 angl[3] = TMath::ATan2(mat[4],mat[3]);
5054 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5056 angl[4] = TMath::ACos(mat[8]);
5057 if(mat[8]==1.0) angl[4] = 0.0;
5058 angl[5] = TMath::ATan2(mat[7],mat[6]);
5059 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5061 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5062 // i = gMC->CurrentVolID(copy);
5063 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5064 fp = fopen("ITSgeometry_v5.det","a");
5065 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5066 vol[0],vol[2],vol[1], // layer ladder detector
5067 xt[0],xt[1],xt[2], // Translation vector
5068 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5071 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5072 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5073 ); // Adding the rotation matrix.
5076 } // end if printit[layer][ladder][detector]
5079 //____________________________________________________________________________
5080 void AliITSv3::Streamer(TBuffer &R__b){
5081 ////////////////////////////////////////////////////////////////////////
5082 // A dummy Streamer function for this class AliITSv3. By default it
5083 // only streams the AliITS class as it is required. Since this class
5084 // dosen't contain any "real" data to be saved, it doesn't.
5085 ////////////////////////////////////////////////////////////////////////
5087 printf("AliITSv3Streamer Starting\n");
5088 if (R__b.IsReading()) {
5089 Version_t R__v = R__b.ReadVersion();
5091 AliITS::Streamer(R__b);
5092 // This information does not need to be read. It is "hard wired"
5093 // into this class via its creators.
5095 //R__b.ReadArray(fId3Name);
5099 R__b.WriteVersion(AliITSv3::IsA());
5100 AliITS::Streamer(R__b);
5101 // This information does not need to be saved. It is "hard wired"
5102 // into this class via its creators.
5104 //R__b.WriteArray(fId3Name, __COUNTER__);
5105 } // end if R__b.IsReading()
5106 printf("AliITSv3Streamer Finishing\n");