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.13 2000/04/04 14:22:06 nilsen
19 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
20 <=23 (was <=24). This may not be the final version.
22 Revision 1.11.4.3 2000/04/04 14:18:03 nilsen
23 Fixed volume error with vomule SFR5. Loop positioning this volume is now from
24 <=23 (was <=24). This may not be the final version.
26 Revision 1.11.4.2 2000/03/04 23:46:02 nilsen
27 Fixed up the comments/documentation.
29 Revision 1.11.4.1 2000/01/12 19:03:33 nilsen
30 This is the version of the files after the merging done in December 1999.
31 See the ReadMe110100.txt file for details
33 Revision 1.11 1999/10/22 08:25:25 fca
34 remove double definition of destructors
36 Revision 1.10 1999/10/22 08:16:49 fca
37 Correct destructors, thanks to I.Hrivnacova
39 Revision 1.9 1999/10/06 19:56:50 fca
42 Revision 1.8 1999/10/05 08:05:09 fca
43 Minor corrections for uninitialised variables.
45 Revision 1.7 1999/09/29 09:24:20 fca
46 Introduction of the Copyright and cvs Log
50 ///////////////////////////////////////////////////////////////////////////////
52 // Inner Traking System version 3
53 // This class contains the base procedures for the Inner Tracking System
55 // Authors: R. Barbera, A. Morsch.
59 // NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
60 // WORK with the geometry or module classes or any analysis classes. You are
61 // strongly encouraged to uses AliITSv5.
63 ///////////////////////////////////////////////////////////////////////////////
65 // See AliITSv3::StepManager().
66 #define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
67 //#define ALIITSPRINTGEOM 1 // print out geometry information
72 #include <TGeometry.h>
79 #include "AliITShit.h"
86 //_____________________________________________________________________________
87 AliITSv3::AliITSv3() {
88 ////////////////////////////////////////////////////////////////////////
89 // Standard default constructor for the ITS version 3.
90 ////////////////////////////////////////////////////////////////////////
92 fId3Name = new char*[fId3N];
101 //_____________________________________________________________________________
102 AliITSv3::~AliITSv3() {
103 ////////////////////////////////////////////////////////////////////////
104 // Standard destructor for the ITS version 3.
105 ////////////////////////////////////////////////////////////////////////
109 //_____________________________________________________________________________
110 AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
111 ////////////////////////////////////////////////////////////////////////
112 // Standard constructor for the ITS version 3.
113 ////////////////////////////////////////////////////////////////////////
115 fId3Name = new char*[fId3N];
116 fId3Name[0] = "ITS1";
117 fId3Name[1] = "ITS2";
118 fId3Name[2] = "ITS3";
119 fId3Name[3] = "ITS4";
120 fId3Name[4] = "ITS5";
121 fId3Name[5] = "ITS6";
124 //__________________________________________________________________________
125 void AliITSv3::BuildGeometry(){
127 const int kColorITS=kYellow;
129 Top = gAlice->GetGeometry()->GetNode("alice");
131 new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+0.05475,12.25);
133 Node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
134 Node->SetLineColor(kColorITS); fNodes->Add(Node);
136 new TTUBE("S_layer2","Layer2 of ITS","void",7.6,7.6+0.05475,16.3);
138 Node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
139 Node->SetLineColor(kColorITS);
142 new TTUBE("S_layer3","Layer3 of ITS","void",14,14+0.05288,21.1);
144 Node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
145 Node->SetLineColor(kColorITS);
148 new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
150 Node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
151 Node->SetLineColor(kColorITS); fNodes->Add(Node);
153 new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
155 Node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
156 Node->SetLineColor(kColorITS);
159 new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
161 Node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
162 Node->SetLineColor(kColorITS);
166 //_____________________________________________________________________________
167 void AliITSv3::CreateGeometry(){
168 ////////////////////////////////////////////////////////////////////////
169 // This routine creates and defines the version 3 geometry of the ITS.
170 ////////////////////////////////////////////////////////////////////////
172 const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
173 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
175 const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
176 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
178 const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
179 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
181 const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
182 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
184 const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
185 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
187 const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
188 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
190 const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
191 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
193 const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
194 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
196 const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
197 0.5,0.7,0.5,0.7,0.5,0.5 };
198 const Float_t rr = 4.064516;
199 const Float_t tteta = 63.00;
200 const Float_t pphi = -35.00;
201 const Float_t gteta = 87.78;
202 const Double_t degrad = kPI/180.;
203 const Double_t raddeg = 180./kPI;
204 const Double_t twopi = 2*kPI;
207 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
208 dfra[10], dcer[3], dkap[3], dpla[3],
209 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
210 atheta1011, dbus[3], dtub[3], dwat[3],
211 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
212 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
213 Double_t biga1, bigb1;
214 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
215 dtra1[3], dtra2[3], dtra3[3],
216 dtra4[3], dbox1[3], dbox2[3];
218 Float_t xtra1[6], ytra1[6], ztra1[6];
220 Float_t xpos1, ypos1;
222 Float_t angle, dcone[5], dtube[3], dpgon[10];
223 Float_t rzero, xzero, yzero;
224 Double_t coeffa, coeffb, coeffc;
226 Float_t atheta, offset;
227 Float_t offset1, offset2, dgh[15];
228 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
229 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
232 Double_t xcc1, ycc1, xcc2, ycc2;
234 const char natra[][5] ={ "TR01","TR02","TR03","TR04",
235 "TR05","TR06","TR07","TR08"};
236 const char natra1[][5] ={"TR11","TR12","TR13","TR14",
237 "TR15","TR16","TR17","TR18",
238 "TR19","TR20","TR21","TR22",
239 "TR23","TR24","TR25","TR26"};
240 const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
241 const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
242 const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
243 "TR57","TR58","TR59","TR60","TR61","TR62",
244 "TR63","TR64","TR65","TR66"};
246 Int_t *idtmed = fIdtmed->GetArray()-199;
248 // --- Define a ghost volume containing the whole ITS and fill it with air
266 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
268 // --- Place the ghost volume in its mother volume (ALIC) and make it
271 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
272 gMC->Gsatt("ITSV", "SEEN", 0);
274 //************************************************************************
279 //************************************************************************
281 // GOTO 2345 ! skip ITS layer no. 1 and 2
283 // --- Define a ghost volume containing the Silicon Pixel Detectors
284 // (layer #1 and #2) and fill it with air or vacuum
286 xxm = (49.999-3)/(70-25);
290 dgh[3] = -25.-(9.-3.01)/xxm;
299 dgh[12] = 25+(9-3.01)/xxm;
302 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
304 // --- Place the ghost volume in its mother volume (ITSV) and make it
307 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
308 gMC->Gsatt("IT12", "SEEN", 0);
310 // --- Define a ghost volume containing a single element of layer #1
311 // and fill it with air or vacuum
313 dbox1[0] = 0.005+0.01+0.0075;
316 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
318 //--Divide each element of layer #1 in three ladders along the beam direction
320 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
322 // --- Make the ghost volumes invisible
324 gMC->Gsatt("IPV1", "SEEN", 0);
325 gMC->Gsatt("IPB1", "SEEN", 0);
327 // --- Define a volume containing the chip of pixels (silicon, layer #1)
331 dchi[2] = dbox1[2] / 3.;
332 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
334 // --- Define a volume containing the bus of pixels (silicon, layer #1)
339 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
341 // --- Define a volume containing the sensitive part of pixels
342 // (silicon, layer #1)
347 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
349 // --- Place the chip into its mother (IPB1)
351 xpos = dbox1[0] - dchi[0];
354 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
356 // --- Place the sensitive volume into its mother (IPB1)
358 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
359 ypos = dchi[1] - dits[1];
360 zpos = -(dchi[2] - dits[2]);
361 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
363 // --- Place the bus into its mother (IPB1)
365 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
366 ypos = dchi[1] - dbus[1];
367 zpos = -(dchi[2] - dbus[2]);
368 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
370 // --- Define a ghost volume containing a single element of layer #2
371 // and fill it with air or vacuum
373 dbox2[0] = 0.005+0.01+0.0075;
376 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
378 //--Divide each element of layer #2 in four ladders along the beam direction
380 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
382 // --- Make the ghost volumes invisible
384 gMC->Gsatt("IPV2", "SEEN", 0);
385 gMC->Gsatt("IPB2", "SEEN", 0);
387 // --- Define a volume containing the chip of pixels (silicon, layer #2)
391 dchi[2] = dbox2[2] / 4.;
392 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
394 // --- Define a volume containing the bus of pixels (silicon, layer #2)
399 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
401 // --- Define a volume containing the sensitive part of pixels
402 // (silicon, layer #2)
407 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
409 // --- Place the chip into its mother (IPB2)
411 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
414 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
416 // --- Place the sensitive volume into its mother (IPB2)
418 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
419 ypos = -(dchi[1] - dits[1]);
420 zpos = -(dchi[2] - dits[2]);
421 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
423 // --- Place the bus into its mother (IPB2)
425 xpos = dbox1[0] - dbus[0];
426 ypos = -(dchi[1] - dbus[1]);
427 zpos = -(dchi[2] - dbus[2]);
428 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
430 // --- Define a generic segment of an element of the mechanical support
435 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
437 // --- Define a generic arc of an element of the mechanical support
442 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
444 // --- Define the mechanical supports of layers #1 and #2 and place the
445 // elements of the layers in it
448 // counter over the number of elements of layer #1 (
451 // counter over the number of elements of layer #2 (
452 for (i = 1; i <= 10; ++i) {
454 // --- Place part # 1-2 (see sketch)
456 // number of carbon fiber supports (see sketch)
459 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
460 (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
462 xcc = ( xx[0] + xx[1]) / 20.;
463 ycc = ( yy[0] + yy[1]) / 20.;
464 xccc = (xbeg[0] + xend[0]) / 20.;
465 yccc = (ybeg[0] + yend[0]) / 20.;
466 if (xx[0] == xx[1]) {
471 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
472 } // end if xx[0] == xx[1]
473 aphi = (pphi + (i-1) * 36.) * degrad;
474 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
475 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
476 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
477 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
478 xpos = xpos1 * TMath::Cos(gteta * degrad) +
479 ypos1 * TMath::Sin(gteta *degrad);
480 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
481 ypos1 * TMath::Cos(gteta * degrad);
483 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
484 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
485 atheta12 + 90., 0., 0.);
486 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
487 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
489 // --- Place part # 2-3 (see sketch)
493 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
494 (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
496 xcc = ( xx[1] + xx[2]) / 20.;
497 ycc = ( yy[1] + yy[2]) / 20.;
498 xccc = (xbeg[1] + xend[1]) / 20.;
499 yccc = (ybeg[1] + yend[1]) / 20.;
500 if (xx[1] == xx[2]) {
505 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
506 } // end if xx[1] == xx[2]
507 aphi = (pphi + (i-1) * 36.) * degrad;
508 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
509 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
510 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
511 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
512 xpos = xpos1 * TMath::Cos(gteta * degrad) +
513 ypos1 * TMath::Sin(gteta * degrad);
514 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
515 ypos1 * TMath::Cos(gteta * degrad);
517 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
518 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
519 atheta23 + 90., 0., 0.);
520 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
521 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
523 // --- Place an element of layer #2
525 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
526 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
527 coeffa = biga * biga + 1.;
528 coeffb = biga * bigb - biga * ycc - xcc;
529 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
530 bigb * bigb - 0.08964*0.08964;
531 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
533 ycc1 = biga * xcc1 + bigb;
535 bigb1 = xcc1 / biga + ycc1;
536 coeffa = biga1 * biga1 + 1.;
537 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
538 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
539 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
540 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
542 ycc2 = biga1 * xcc2 + bigb1;
543 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
544 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
545 xpos = xpos1 * TMath::Cos(gteta * degrad) +
546 ypos1 * TMath::Sin(gteta *degrad);
547 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
548 ypos1 * TMath::Cos(gteta * degrad);
551 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
552 idrotm[(i-1) * 13 + 1101], "ONLY");
554 // --- Place part # 3-4 (see sketch)
558 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
559 (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
561 xcc = (xx[1] + xx[2]) / 20.;
562 ycc = (yy[1] + yy[2]) / 20.;
563 xccc = (xbeg[2] + xend[2]) / 20.;
564 yccc = (ybeg[2] + yend[2]) / 20.;
565 if (xx[2] == xx[3]) {
570 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
571 } // end if xx[2] == xx[3]
572 aphi = (pphi + (i-1) * 36.) * degrad;
573 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
574 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
575 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
576 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
577 xpos = xpos1 * TMath::Cos(gteta * degrad) +
578 ypos1 * TMath::Sin(gteta *degrad);
579 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
580 ypos1 * TMath::Cos(gteta * degrad);
582 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
583 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
584 atheta34 + 90., 0., 0.);
585 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
586 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
588 // --- Place part # 4-5 (see sketch)
592 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
593 (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
595 xcc = ( xx[3] + xx[4]) / 20.;
596 ycc = ( yy[3] + yy[4]) / 20.;
597 xccc = (xbeg[3] + xend[3]) / 20.;
598 yccc = (ybeg[3] + yend[3]) / 20.;
599 if (xx[3] == xx[4]) {
604 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
605 } // end if xx[3] == xx[4]
606 aphi = (pphi + (i-1) * 36.) * degrad;
607 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
608 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
609 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
610 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
611 xpos = xpos1 * TMath::Cos(gteta * degrad) +
612 ypos1 * TMath::Sin(gteta *degrad);
613 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
614 ypos1 * TMath::Cos(gteta * degrad);
616 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
617 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
618 atheta45 + 90., 0., 0.);
619 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
620 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
622 // --- Place an element of layer #2
624 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
625 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
626 coeffa = biga * biga + 1.;
627 coeffb = biga * bigb - biga * ycc - xcc;
628 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
629 bigb * bigb - .014285030400000001;
630 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
632 ycc1 = biga * xcc1 + bigb;
634 bigb1 = xcc1 / biga + ycc1;
635 coeffa = biga1 * biga1 + 1.;
636 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
637 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
638 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
639 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
641 ycc2 = biga1 * xcc2 + bigb1;
642 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
643 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
644 xpos = xpos1 * TMath::Cos(gteta * degrad) +
645 ypos1 * TMath::Sin(gteta *degrad);
646 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
647 ypos1 * TMath::Cos(gteta * degrad);
650 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
651 idrotm[(i-1) * 13 + 1103], "ONLY");
653 // --- Place part # 5-6 (see sketch)
657 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
658 (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
660 xcc = (xx[4] + xx[5]) / 20.;
661 ycc = (yy[4] + yy[5]) / 20.;
662 xccc = (xbeg[4] + xend[4]) / 20.;
663 yccc = (ybeg[4] + yend[4]) / 20.;
664 if (xx[4] == xx[5]) {
669 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
671 aphi = (pphi + (i-1) * 36.) * degrad;
672 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
673 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
674 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
675 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
676 xpos = xpos1 * TMath::Cos(gteta * degrad) +
677 ypos1 * TMath::Sin(gteta *degrad);
678 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
679 ypos1 * TMath::Cos(gteta * degrad);
681 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
682 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
683 atheta56 + 90., 0., 0.);
684 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
685 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
687 // --- Place part # 6-7 (see sketch)
691 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
692 (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
694 xcc = (xx[5] + xx[6]) / 20.;
695 ycc = (yy[5] + yy[6]) / 20.;
696 xccc = (xbeg[5] + xend[5]) / 20.;
697 yccc = (ybeg[5] + yend[5]) / 20.;
698 if (xx[5] == xx[6]) {
703 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
704 } // end if xx[5] == xx[6]
705 aphi = (pphi + (i-1) * 36.) * degrad;
706 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
707 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
708 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
709 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
710 xpos = xpos1 * TMath::Cos(gteta * degrad) +
711 ypos1 * TMath::Sin(gteta *degrad);
712 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
713 ypos1 * TMath::Cos(gteta * degrad);
715 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
716 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
717 atheta67 + 90., 0., 0.);
718 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
719 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
721 // --- Place an element of layer #2
723 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
724 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
725 coeffa = biga * biga + 1.;
726 coeffb = biga * bigb - biga * ycc - xcc;
727 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
728 bigb * bigb - .014285030400000001;
729 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
731 ycc1 = biga * xcc1 + bigb;
733 bigb1 = xcc1 / biga + ycc1;
734 coeffa = biga1 * biga1 + 1.;
735 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
736 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
737 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
738 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
740 ycc2 = biga1 * xcc2 + bigb1;
741 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
742 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
743 xpos = xpos1 * TMath::Cos(gteta * degrad) +
744 ypos1 * TMath::Sin(gteta *degrad);
745 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
746 ypos1 * TMath::Cos(gteta * degrad);
749 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
750 idrotm[(i-1) * 13 + 1105], "ONLY");
752 // --- Place part # 7-8 (see sketch)
756 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
757 (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
759 xcc = (xx[6] + xx[7]) / 20.;
760 ycc = (yy[6] + yy[7]) / 20.;
761 xccc = (xbeg[6] + xend[6]) / 20.;
762 yccc = (ybeg[6] + yend[6]) / 20.;
763 if (xx[6] == xx[7]) {
768 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
770 aphi = (pphi + (i-1) * 36.) * degrad;
771 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
772 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
773 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
774 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
775 xpos = xpos1 * TMath::Cos(gteta * degrad) +
776 ypos1 * TMath::Sin(gteta *degrad);
777 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
778 ypos1 * TMath::Cos(gteta * degrad);
780 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
781 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
782 atheta78 + 90., 0., 0.);
783 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
784 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
786 // --- Place part # 8-9 (see sketch)
790 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
791 (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
793 xcc = (xx[7] + xx[8]) / 20.;
794 ycc = (yy[7] + yy[8]) / 20.;
795 xccc = (xbeg[7] + xend[7]) / 20.;
796 yccc = (ybeg[7] + yend[7]) / 20.;
797 if (xx[1] == xx[2]) {
802 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
804 aphi = (pphi + (i-1) * 36.) * degrad;
805 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
806 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
807 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
808 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
809 xpos = xpos1 * TMath::Cos(gteta * degrad) +
810 ypos1 * TMath::Sin(gteta *degrad);
811 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
812 ypos1 * TMath::Cos(gteta * degrad);
814 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
815 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
816 atheta89 + 90., 0., 0.);
817 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
818 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
820 // --- Place an element of layer #2
822 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
823 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
824 coeffa = biga * biga + 1.;
825 coeffb = biga * bigb - biga * ycc - xcc;
826 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
827 bigb * bigb - .014285030400000001;
828 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
830 ycc1 = biga * xcc1 + bigb;
832 bigb1 = xcc1 / biga + ycc1;
833 coeffa = biga1 * biga1 + 1.;
834 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
835 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
836 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
837 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
839 ycc2 = biga1 * xcc2 + bigb1;
840 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
841 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
842 xpos = xpos1 * TMath::Cos(gteta * degrad) +
843 ypos1 * TMath::Sin(gteta *degrad);
844 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
845 ypos1 * TMath::Cos(gteta * degrad);
848 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
849 idrotm[(i-1) * 13 + 1107], "ONLY");
851 // --- Place part # 9-10 (see sketch)
855 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
856 (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
858 xcc = (xx[8] + xx[9]) / 20.;
859 ycc = (yy[8] + yy[9]) / 20.;
860 xccc = (xbeg[8] + xend[8]) / 20.;
861 yccc = (ybeg[8] + yend[8]) / 20.;
862 if (xx[8] == xx[9]) {
867 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
869 aphi = (pphi + (i-1) * 36.) * degrad;
870 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
871 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
872 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
873 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
874 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
875 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
877 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
878 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
879 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
881 // --- Place part # 10-11 (see sketch)
885 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
887 xcc = (xx[9] + xx[10]) / 20.;
888 ycc = (yy[9] + yy[10]) / 20.;
889 xccc = (xbeg[9] + xend[9]) / 20.;
890 yccc = (ybeg[9] + yend[9]) / 20.;
891 if (xx[9] == xx[10]) {
896 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
898 aphi = (pphi + (i-1) * 36.) * degrad;
899 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
900 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
901 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
902 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
903 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
904 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
906 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
907 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
908 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
910 // --- Place part # 13-14 (see sketch)
914 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
916 xcc = (xx[12] + xx[13]) / 20.;
917 ycc = (yy[12] + yy[13]) / 20.;
918 xccc = (xbeg[12] + xend[12]) / 20.;
919 yccc = (ybeg[12] + yend[12]) / 20.;
920 if (xx[12] == xx[13]) {
923 r1 = yy[12] - yy[13];
924 r2 = xx[12] - xx[13];
925 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
927 aphi = (pphi + (i-1) * 36.) * degrad;
928 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
929 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
930 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
931 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
932 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
933 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
935 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
936 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
937 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
939 // --- Place an element of layer #1
941 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
942 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
943 coeffa = biga * biga + 1.;
944 coeffb = biga * bigb - biga * ycc - xcc;
945 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
946 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
947 ycc1 = biga * xcc1 + bigb;
949 bigb1 = xcc1 / biga + ycc1;
950 coeffa = biga1 * biga1 + 1.;
951 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
952 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
953 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
954 ycc2 = biga1 * xcc2 + bigb1;
955 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
956 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
957 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
958 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
961 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
963 // --- Place part # 12-13 (see sketch)
967 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
969 xcc = (xx[11] + xx[12]) / 20.;
970 ycc = (yy[11] + yy[12]) / 20.;
971 xccc = (xbeg[11] + xend[11]) / 20.;
972 yccc = (ybeg[11] + yend[11]) / 20.;
973 if (xx[11] == xx[12]) {
976 r1 = yy[12] - yy[11];
977 r2 = xx[12] - xx[11];
978 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
980 aphi = (pphi + (i-1) * 36.) * degrad;
981 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
982 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
983 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
984 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
985 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
986 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
988 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
989 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
990 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
992 // --- Place part # 11-12 (see sketch)
996 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
998 xcc = (xx[10] + xx[11]) / 20.;
999 ycc = (yy[10] + yy[11]) / 20.;
1000 xccc = (xbeg[10] + xend[10]) / 20.;
1001 yccc = (ybeg[10] + yend[10]) / 20.;
1002 if (xx[10] == xx[11]) {
1005 r1 = yy[11] - yy[10];
1006 r2 = xx[11] - xx[10];
1007 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
1009 aphi = (pphi + (i-1) * 36.) * degrad;
1010 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1011 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1012 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
1013 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
1014 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1015 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1017 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
1018 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
1019 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
1021 // --- Place an element of layer #1
1023 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
1024 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
1025 coeffa = biga * biga + 1.;
1026 coeffb = biga * bigb - biga * ycc - xcc;
1027 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
1028 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1029 ycc1 = biga * xcc1 + bigb;
1031 bigb1 = xcc1 / biga + ycc1;
1032 coeffa = biga1 * biga1 + 1.;
1033 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
1034 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
1035 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
1036 ycc2 = biga1 * xcc2 + bigb1;
1037 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
1038 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
1039 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1040 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1043 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
1045 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
1047 darc[0] = rarc[12] / 10. - .02;
1048 darc[1] = rarc[12] / 10.;
1050 darc[3] = atheta12 - (i-1) * 36.;
1051 darc[4] = atheta23 - (i-1) * 36.;
1052 xcc = xarc[12] / 10.;
1053 ycc = yarc[12] / 10.;
1054 aphi = (pphi + (i-1) * 36.) * degrad;
1055 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1056 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1057 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1058 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1059 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1060 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1062 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
1064 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1066 darc[0] = rarc[11] / 10. - .02;
1067 darc[1] = rarc[11] / 10.;
1069 darc[3] = atheta23 + 90. - (i-1) * 36.;
1070 darc[4] = atheta34 + 90. - (i-1) * 36.;
1071 xcc = xarc[11] / 10.;
1072 ycc = yarc[11] / 10.;
1073 aphi = (pphi + (i-1) * 36.) * degrad;
1074 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1075 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1076 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1077 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1078 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1079 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1081 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
1083 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1085 darc[0] = rarc[10] / 10. - .02;
1086 darc[1] = rarc[10] / 10.;
1088 darc[3] = atheta45 + 180. - (i-1) * 36.;
1089 darc[4] = atheta34 + 180. - (i-1) * 36.;
1090 xcc = xarc[10] / 10.;
1091 ycc = yarc[10] / 10.;
1092 aphi = (pphi + (i-1) * 36.) * degrad;
1093 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1094 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1095 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1096 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1097 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1098 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1100 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
1102 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1104 darc[0] = rarc[9] / 10. - .02;
1105 darc[1] = rarc[9] / 10.;
1107 darc[3] = atheta45 - 90. - (i-1) * 36.;
1108 darc[4] = atheta56 - 90. - (i-1) * 36.;
1109 xcc = xarc[9] / 10.;
1110 ycc = yarc[9] / 10.;
1111 aphi = (pphi + (i-1) * 36.) * degrad;
1112 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1113 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1114 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1115 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1116 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1117 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1119 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
1121 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1123 darc[0] = rarc[8] / 10. - .02;
1124 darc[1] = rarc[8] / 10.;
1126 darc[3] = atheta67 + 45. - (i-1) * 36.;
1127 darc[4] = atheta56 + 45. - (i-1) * 36.;
1128 xcc = xarc[8] / 10.;
1129 ycc = yarc[8] / 10.;
1130 aphi = (pphi + (i-1) * 36.) * degrad;
1131 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1132 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1133 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1134 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1135 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1136 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1138 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
1140 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1142 darc[0] = rarc[7] / 10. - .02;
1143 darc[1] = rarc[7] / 10.;
1145 darc[3] = atheta67 - (i-1) * 36.;
1146 darc[4] = atheta78 - (i-1) * 36.;
1147 xcc = xarc[7] / 10.;
1148 ycc = yarc[7] / 10.;
1149 aphi = (pphi + (i-1) * 36.) * degrad;
1150 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1151 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1152 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1153 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1154 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1155 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1157 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
1159 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1161 darc[0] = rarc[6] / 10. - .02;
1162 darc[1] = rarc[6] / 10.;
1164 darc[3] = atheta89 + 45. - (i-1) * 36.;
1165 darc[4] = atheta78 + 45. - (i-1) * 36.;
1166 xcc = xarc[6] / 10.;
1167 ycc = yarc[6] / 10.;
1168 aphi = (pphi + (i-1) * 36.) * degrad;
1169 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1170 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1171 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1172 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1173 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1174 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1176 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
1178 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1180 darc[0] = rarc[5] / 10. - .02;
1181 darc[1] = rarc[5] / 10.;
1183 darc[3] = atheta89 + 45. - (i-1) * 36.;
1184 darc[4] = atheta910 + 45. - (i-1) * 36.;
1185 xcc = xarc[5] / 10.;
1186 ycc = yarc[5] / 10.;
1187 aphi = (pphi + (i-1) * 36.) * degrad;
1188 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1189 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1190 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1191 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1192 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1193 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1195 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1197 // --- Place arc # 5 (between part 9-10 and part 10-11)
1200 darc[0] = rarc[4] / 10. - .02;
1201 darc[1] = rarc[4] / 10.;
1203 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1204 darc[4] = atheta910 + 45. - (i-1) * 36.;
1205 xcc = xarc[4] / 10.;
1206 ycc = yarc[4] / 10.;
1207 aphi = (pphi + (i-1) * 36.) * degrad;
1208 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1209 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1210 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1211 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1212 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1213 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1215 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1217 // --- Place arc # 4 (between part 10-11 and part 11-12)
1220 darc[0] = rarc[3] / 10. - .02;
1221 darc[1] = rarc[3] / 10.;
1223 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1224 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1225 xcc = xarc[3] / 10.;
1226 ycc = yarc[3] / 10.;
1227 aphi = (pphi + (i-1) * 36.) * degrad;
1228 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1229 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1230 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1231 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1232 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1233 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1235 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1237 // --- Place arc # 3 (between part 11-12 and part 12-13)
1240 darc[0] = rarc[2] / 10. - .02;
1241 darc[1] = rarc[2] / 10.;
1243 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1244 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1245 xcc = xarc[2] / 10.;
1246 ycc = yarc[2] / 10.;
1247 aphi = (pphi + (i-1) * 36.) * degrad;
1248 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1249 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1250 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1251 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1252 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1253 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1255 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1257 // --- Place arc # 2 (between part 12-13 and part 13-14)
1260 darc[0] = rarc[1] / 10. - .02;
1261 darc[1] = rarc[1] / 10.;
1263 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1264 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1265 xcc = xarc[1] / 10.;
1266 ycc = yarc[1] / 10.;
1267 aphi = (pphi + (i-1) * 36.) * degrad;
1268 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1269 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1270 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1271 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1272 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1273 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1275 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1277 // --- Place arc # 1 (between part 13-14 and part 1-2)
1280 darc[0] = rarc[0] / 10. - .02;
1281 darc[1] = rarc[0] / 10.;
1283 darc[3] = atheta12 + 45. - (i-1) * 36.;
1284 darc[4] = atheta1314 - (i-1) * 36.;
1285 xcc = xarc[0] / 10.;
1286 ycc = yarc[0] / 10.;
1287 aphi = (pphi + (i-1) * 36.) * degrad;
1288 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1289 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1290 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1291 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1292 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1293 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1295 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1298 //************************************************************************
1303 //************************************************************************
1305 // --- Define a ghost volume containing the Silicon Drift Detectors
1306 // (layer #3 and #4) and fill it with air or vacuum
1308 xxm = (49.999-3.)/(70.-25.);
1312 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1315 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1318 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1321 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1324 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1326 // --- Place the ghost volume in its mother volume (ITSV) and make it
1329 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1330 gMC->Gsatt("IT34", "SEEN", 0);
1334 // GOTO 3456 ! skip ITS layer no. 3
1336 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1337 // smaller lenght of ribs) and fill it with air or vacuum
1339 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1341 // the widest element is the sensitive element
1342 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1343 // 7.5 cm is the lenght
1344 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1346 // --- Make the ghost volume invisible
1348 gMC->Gsatt("IDV1", "SEEN", 0);
1350 // --- Define a volume containing the sensitive part of drifts
1351 // (silicon, layer #3)
1354 // see material budget report by G. Feofilov
1357 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1359 //--- Define the part of the (smaller) rib between two sensitive parts made of
1360 // carbon (layer #3)
1362 dsup[0] = .5 - dits[0];
1364 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1365 // 7.5 cm is the lenght
1366 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1368 //--- Define the first part of the (smaller) rib between two sensitive parts
1369 // made of aluminum (layer #3)
1371 dal1[0] = .5 - dits[0];
1372 dal1[1] = 0.00096/2.;
1373 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1374 // 7.5 cm is the lenght
1375 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1377 //--- Define the part of the (smaller) rib between two sensitive parts made of
1378 // kapton (layer #3)
1380 dkap[0] = .5 - dits[0];
1382 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1383 // 7.5 cm is the lenght
1384 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1386 //--- Define the second part of the (smaller) rib between two sensitive parts
1387 // made of aluminum (layer #3)
1389 dal2[0] = .5 - dits[0];
1390 dal2[1] = 0.0027/2.;
1391 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1392 // 7.5 cm is the lenght
1393 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1395 // --- Define the part of the (smaller) rib between two sensitive parts
1396 // made of silicon (the electronics) (layer #3)
1398 dchi[0] = .5 - dits[0];
1399 dchi[1] = 0.0071/2.;
1400 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1401 // 7.5 cm is the lenght
1402 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1404 // --- Define the part of the (smaller) rib between two sensitive parts
1405 // made of water (the cooler) (layer #3)
1407 dwat[0] = .5 - dits[0];
1408 dwat[1] = 0.0093/2.;
1409 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1410 // 7.5 cm is the lenght
1411 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1413 //--- Define the third part of the (smaller) rib between two sensitive parts
1414 // made of aluminum (the cooling tubes) (layer #3)
1416 dtub[0] = .5 - dits[0];
1417 dtub[1] = 0.00134/2.;
1418 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1419 // 7.5 cm is the lenght
1420 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1422 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1425 // twice the foreseen thickness
1428 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1430 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1433 // twice the foreseen thickness
1436 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1438 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1441 // twice the foreseen thickness
1444 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1446 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1449 // twice the foreseen thickness
1452 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1454 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1458 for (j = 1; j <= 5; ++j) {
1459 // odd elements are up and even elements are down
1461 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1462 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1463 } else if (j == 2) {
1464 xpos = -dbox1[0] + dits[0];
1465 zpos = 0. - dits[2] + 1. - dits[2];
1466 } else if (j == 3) {
1467 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1469 } else if (j == 4) {
1470 xpos = -dbox1[0] + dits[0];
1471 zpos = dits[2] + 0. - 1. + dits[2];
1472 } else if (j == 5) {
1473 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1474 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1476 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1479 // --- Place the smaller ribs into their mother (IDV1)
1481 // --- Right ribs (just a matter of convention)
1483 xpos = .5 - dbox1[0] + dits[0];
1489 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1493 ypos = dsup[1] + 2.81 + dal1[1];
1494 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1498 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1499 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1503 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1504 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1506 // --- Silicon (chip)
1508 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1509 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1513 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1514 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1518 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1520 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1522 // --- Right ribs (just a matter of convention)
1527 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1531 ypos = -(dsup[1] + 2.81 + dal1[1]);
1532 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1536 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1537 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1541 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1542 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1544 // --- Silicon (chip)
1546 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1547 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1551 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1552 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1556 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1557 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1558 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1560 // --- Place the end-ladder stuff into its mother (IDV1)
1563 // --- Negative-Z end-ladder
1566 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1570 xpos = dbox1[0] - dpcb[0];
1571 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1575 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1576 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1580 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1581 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1583 // --- Silicon (bus)
1585 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1586 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1588 // --- Positive-Z end-ladder
1591 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1595 xpos = dbox1[0] - dpcb[0];
1596 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1600 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1601 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1605 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1606 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1608 // --- Silicon (bus)
1610 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1611 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1613 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1614 // larger lenght of ribs) and fill it with air or vacuum
1616 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1618 // the widest element is the sensitive element
1619 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1620 // 7.5 cm is the lenght
1621 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1623 // --- Make the ghost volume invisible
1625 gMC->Gsatt("IDV2", "SEEN", 0);
1627 //--- Define the part of the (larger) rib between two sensitive parts madeof
1628 // carbon (layer #3)
1630 dsup[0] = .65 - dits[0];
1632 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1633 // 7.5 cm is the lenght
1634 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1636 //--- Define the first part of the (larger) rib between two sensitive parts
1637 // made of aluminum (layer #3)
1639 dal1[0] = .65 - dits[0];
1640 dal1[1] = 0.00096/2.;
1641 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1642 // 7.5 cm is the lenght
1643 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1645 //--- Define the part of the (larger) rib between two sensitive parts madeof
1646 // kapton (layer #3)
1648 dkap[0] = .65 - dits[0];
1649 dkap[1] = 0.0317/2.;
1650 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1651 // 7.5 cm is the lenght
1652 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1654 //--- Define the second part of the (larger) rib between two sensitive parts
1655 // made of aluminum (layer #3)
1657 dal2[0] = .65 - dits[0];
1658 dal2[1] = 0.0027/2.;
1659 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1660 // 7.5 cm is the lenght
1661 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1663 // --- Define the part of the (larger) rib between two sensitive parts
1664 // made of silicon (the electronics) (layer #3)
1666 dchi[0] = .65 - dits[0];
1667 dchi[1] = 0.0071/2.;
1668 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1669 // 7.5 cm is the lenght
1670 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1672 // --- Define the part of the (larger) rib between two sensitive parts
1673 // made of water (the cooler) (layer #3)
1675 dwat[0] = .65 - dits[0];
1676 dwat[1] = 0.0093/2.;
1677 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1678 // 7.5 cm is the lenght
1679 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1681 //--- Define the third part of the (larger) rib between two sensitive parts
1682 // made of aluminum (the cooling tubes) (layer #3)
1684 dtub[0] = .65 - dits[0];
1685 dtub[1] = 0.00134/2.;
1686 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1687 // 7.5 cm is the lenght
1688 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1690 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1694 for (j = 1; j <= 5; ++j) {
1695 // odd element are up and even elements are down
1697 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1698 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1699 } else if (j == 2) {
1700 xpos = -dbox2[0] + dits[0];
1701 zpos = 0. - dits[2] + 1. - dits[2];
1702 } else if (j == 3) {
1703 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1705 } else if (j == 4) {
1706 xpos = -dbox2[0] + dits[0];
1707 zpos = dits[2] + 0. - 1. + dits[2];
1708 } else if (j == 5) {
1709 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1710 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1712 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1715 // --- Place the larger ribs into their mother (IDV2)
1718 // --- Right ribs (just a matter of convention)
1720 xpos = .65 - dbox2[0] + dits[0];
1726 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1730 ypos = dsup[1] + 2.81 + dal1[1];
1731 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1735 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1736 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1740 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1741 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1743 // --- Silicon (chip)
1745 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1746 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1750 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1751 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1755 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1756 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1758 // --- Right ribs (just a matter of convention)
1763 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1767 ypos = -(dsup[1] + 2.81 + dal1[1]);
1768 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1772 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1773 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1777 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1778 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1780 // --- Silicon (chip)
1782 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1783 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1787 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1788 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1792 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1793 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1795 // --- Place the end-ladder stuff into its mother (IDV1)
1798 // --- Negative-Z end-ladder
1801 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1805 xpos = dbox2[0] - dpcb[0];
1806 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1810 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1811 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1815 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1816 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1818 // --- Silicon (bus)
1820 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1821 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1823 // --- Positive-Z end-ladder
1826 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1830 xpos = dbox2[0] - dpcb[0];
1831 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1835 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1836 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1840 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1841 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1843 // --- Silicon (bus)
1845 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1846 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1848 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1849 // mother volume (IT34)
1850 // Odd elements have large ribs and even elements have small ribs
1852 for (i = 1; i <= 12; ++i) {
1853 atheta = (i-1) * 30.;
1854 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1857 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1858 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1860 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1863 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1864 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1866 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1873 // GOTO 4567 ! skip ITS layer no. 4
1875 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1876 // smaller lenght of ribs) and fill it with air or vacuum
1878 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1880 // the widest element is the end-ladder stuff
1881 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1882 // 7.5 cm is the lenght
1883 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1885 // --- Make the ghost volume invisible
1887 gMC->Gsatt("IDV3", "SEEN", 0);
1889 // --- Define a volume containing the sensitive part of drifts
1890 // (silicon, layer #4)
1893 // see material budget report by G. Feofilov
1896 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1898 //--- Define the part of the (smaller) rib between two sensitive parts made of
1899 // carbon (layer #4)
1901 dsup[0] = .5 - dits[0];
1903 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1904 // 7.5 cm is the lengh
1905 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1907 //--- Define the first part of the (smaller) rib between two sensitive parts
1908 // made of aluminum (layer #4)
1910 dal1[0] = .5 - dits[0];
1911 dal1[1] = 0.00096/2.;
1912 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1913 // 7.5 cm is the lengh
1914 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1916 //--- Define the part of the (smaller) rib between two sensitive parts made of
1917 // kapton (layer #4)
1919 dkap[0] = .5 - dits[0];
1920 dkap[1] = 0.0317/2.;
1921 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1922 // 7.5 cm is the lengh
1923 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1925 //--- Define the second part of the (smaller) rib between two sensitive parts
1926 // made of aluminum (layer #4)
1928 dal2[0] = .5 - dits[0];
1929 dal2[1] = 0.0027/2.;
1930 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1931 // 7.5 cm is the lengh
1932 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1934 // --- Define the part of the (smaller) rib between two sensitive parts
1935 // made of silicon (the electronics) (layer #4)
1937 dchi[0] = .5 - dits[0];
1938 dchi[1] = 0.0071/2.;
1939 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1940 // 7.5 cm is the lengh
1941 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1943 // --- Define the part of the (smaller) rib between two sensitive parts
1944 // made of water (the cooler) (layer #4)
1946 dwat[0] = .5 - dits[0];
1947 dwat[1] = 0.0093/2.;
1948 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1949 // 7.5 cm is the lenght
1950 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1952 //--- Define the third part of the (smaller) rib between two sensitive parts
1953 // made of aluminum (the cooling tubes) (layer #4)
1955 dtub[0] = .5 - dits[0];
1956 dtub[1] = 0.00134/2.;
1957 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1958 // 7.5 cm is the lengh
1959 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1961 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1964 // twice the foreseen thickness
1967 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1969 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1972 // twice the foreseen thickness
1975 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1977 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1980 // twice the foreseen thickness
1983 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1985 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1988 // twice the foreseen thickness
1991 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1993 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1997 for (j = 1; j <= 7; ++j) {
1998 // odd elements are down and even elements are up
2000 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2001 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2002 } else if (j == 2) {
2003 xpos = -dbox1[0] + dits[0];
2004 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2005 } else if (j == 3) {
2006 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2007 zpos = 0. - dits[2] + .7 - dits[2];
2008 } else if (j == 4) {
2009 xpos = -dbox1[0] + dits[0];
2011 } else if (j == 5) {
2012 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2013 zpos = dits[2] + 0. - .7 + dits[2];
2014 } else if (j == 6) {
2015 xpos = -dbox1[0] + dits[0];
2016 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2017 } else if (j == 7) {
2018 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2019 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2021 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2024 // --- Place the smaller ribs into their mother (IDV3)
2026 // --- Right ribs (just a matter of convention)
2028 xpos = .5 - dbox1[0] + dits[0];
2034 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2038 ypos = dsup[1] + 2.81 + dal1[1];
2039 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2043 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2044 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2048 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2049 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2051 // --- Silicon (chip)
2053 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2054 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2058 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2059 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2063 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2065 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2067 // --- Right ribs (just a matter of convention)
2072 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2076 ypos = -(dsup[1] + 2.81 + dal1[1]);
2077 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2081 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2082 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2086 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2088 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2090 // --- Silicon (chip)
2092 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2093 2. + dal2[1] * 2. + dchi[1]);
2094 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2098 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2099 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2100 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2104 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2105 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2107 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2109 // --- Place the end-ladder stuff into its mother (IDV1)
2112 // --- Negative-Z end-ladder
2115 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2119 xpos = dbox1[0] - dpcb[0];
2120 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2124 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2125 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2129 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2130 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2132 // --- Silicon (bus)
2134 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2135 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2137 // --- Positive-Z end-ladder
2140 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2144 xpos = dbox1[0] - dpcb[0];
2145 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2149 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
2150 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2154 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2155 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2157 // --- Silicon (bus)
2159 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2160 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
2162 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2163 // larger lenght of ribs) and fill it with air or vacuum
2165 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2167 // the widest element is the end-ladder stuff
2168 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2169 // 7.5 cm is the lenght
2170 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
2172 // --- Make the ghost volume invisible
2174 gMC->Gsatt("IDV4", "SEEN", 0);
2176 //--- Define the part of the (larger) rib between two sensitive parts madeof
2177 // carbon (layer #4)
2179 dsup[0] = .65 - dits[0];
2181 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2182 // 7.5 cm is the lengh
2183 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2185 //--- Define the first part of the (larger) rib between two sensitive parts
2186 // made of aluminum (layer #4)
2188 dal1[0] = .65 - dits[0];
2189 dal1[1] = 0.00096/2.;
2190 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2191 // 7.5 cm is the lengh
2192 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2194 //--- Define the part of the (larger) rib between two sensitive parts madeof
2195 // kapton (layer #4)
2197 dkap[0] = .65 - dits[0];
2198 dkap[1] = 0.0317/2.;
2199 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2200 // 7.5 cm is the lengh
2201 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2203 //--- Define the second part of the (larger) rib between two sensitive parts
2204 // made of aluminum (layer #4)
2206 dal2[0] = .65 - dits[0];
2207 dal2[1] = 0.0027/2.;
2208 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2209 // 7.5 cm is the lengh
2210 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2212 // --- Define the part of the (larger) rib between two sensitive parts
2213 // made of silicon (the electronics) (layer #4)
2215 dchi[0] = .65 - dits[0];
2216 dchi[1] = 0.0071/2.;
2217 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2218 // 7.5 cm is the lengh
2219 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2221 // --- Define the part of the (larger) rib between two sensitive parts
2222 // made of water (the cooler) (layer #4)
2224 dwat[0] = .65 - dits[0];
2225 dwat[1] = 0.0093/2.;
2226 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2227 // 7.5 cm is the lengh
2228 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2230 //--- Define the third part of the (larger) rib between two sensitive parts
2231 // made of aluminum (the cooling tubes) (layer #4)
2233 dtub[0] = .65 - dits[0];
2234 dtub[1] = 0.00134/2.;
2235 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2236 // 7.5 cm is the lengh
2237 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2239 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2243 for (j = 1; j <= 7; ++j) {
2244 // odd elements are down and even elements are up
2246 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2247 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2248 } else if (j == 2) {
2249 xpos = -dbox2[0] + dits[0];
2250 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2251 } else if (j == 3) {
2252 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2253 zpos = 0. - dits[2] + .7 - dits[2];
2254 } else if (j == 4) {
2255 xpos = -dbox2[0] + dits[0];
2257 } else if (j == 5) {
2258 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2259 zpos = dits[2] + 0. - .7 + dits[2];
2260 } else if (j == 6) {
2261 xpos = -dbox2[0] + dits[0];
2262 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2263 } else if (j == 7) {
2264 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2265 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2267 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2270 // --- Place the larger ribs into their mother (IDV4)
2273 // --- Right ribs (just a matter of convention)
2275 xpos = .65 - dbox2[0] + dits[0];
2281 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2285 ypos = dsup[1] + 2.81 + dal1[1];
2286 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2290 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2291 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2295 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2296 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2298 // --- Silicon (chip)
2300 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2301 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2305 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2306 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2310 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2312 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2314 // --- Right ribs (just a matter of convention)
2319 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2323 ypos = -(dsup[1] + 2.81 + dal1[1]);
2324 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2328 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2329 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2333 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2335 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2337 // --- Silicon (chip)
2339 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2340 2. + dal2[1] * 2. + dchi[1]);
2341 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2345 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2346 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2347 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2351 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2352 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2353 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2355 // --- Place the end-ladder stuff into its mother (IDV1)
2358 // --- Negative-Z end-ladder
2361 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2365 xpos = dbox2[0] - dpcb[0];
2366 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2370 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2371 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2375 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2376 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2378 // --- Silicon (bus)
2380 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2381 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2383 // --- Positive-Z end-ladder
2386 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2390 xpos = dbox2[0] - dpcb[0];
2391 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2395 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2396 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2400 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2401 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2403 // --- Silicon (bus)
2405 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2406 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2408 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2409 // mother volume (IT34)
2410 // Odd elements have large ribs and even elements have small ribs
2412 for (i = 1; i <= 24; ++i) {
2413 atheta = (i-1) * 15.;
2414 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2417 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2418 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2420 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2422 rzero = (24.0+22.8)/2.;
2423 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2424 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2426 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2430 //************************************************************************
2435 //************************************************************************
2437 // --- Define SSD with the 35+39 lay-out
2439 if (fMinorVersionV3 < 3) {
2441 //--- Define ghost volume containing the Strip Detectors and fill it with air
2444 xxm = (49.999-3.)/(70.-25.);
2448 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2449 (37.-27)/xxm-(49.998-37.)/xxm;
2452 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2456 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2460 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2461 (37.-27)/xxm+(49.998-37.)/xxm;
2464 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2465 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2466 gMC->Gsatt("IT56", "SEEN", 0);
2470 // GOTO 5678 ! skip ITS layer no. 5
2472 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2473 // it with air or vacuum
2475 dbox1[0] = (0.0600+2.*0.0150)/2.;
2477 dbox1[2] = 90.22/2.;
2478 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2480 // --- Make the ghost volume invisible
2482 gMC->Gsatt("ISV1", "SEEN", 0);
2484 // --- Define a ghost volume containing the electronics and cooling of
2485 // a single ladder of layer #5 and fill it with air or vacuum
2487 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2490 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2492 // --- Make the ghost volume invisible
2494 gMC->Gsatt("SSV1", "SEEN", 0);
2496 // --- Define a ghost volume containing the end-ladder stuff of
2497 // a single ladder of layer #5 and fill it with air or vacuum
2502 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2504 // --- Make the ghost volume invisible
2506 gMC->Gsatt("ELL5", "SEEN", 0);
2508 // --- Define a volume containing the sensitive part of the strips
2509 // (silicon, layer #5)
2514 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2516 // --- Define a volume containing the electronics of the strips
2517 // (silicon, layer #5)
2522 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2524 // --- Define the cooling tubes (aluminum, layer #5)
2527 dtub[1] = dtub[0] + .01;
2529 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2531 // --- Define the cooling fluid (water or freon, layer #5)
2536 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2537 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2539 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2547 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2548 dfra[6] = dfra[5] + .03;
2552 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2554 // --- Define the element connecting the triangles of the heat bridge
2555 // (carbon, layer #5)
2560 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2562 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2565 dpla[0] = (10./(8.*7.))/2.;
2568 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2570 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2572 dcop[0] = (2./(8.*7.))/2.;
2575 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2577 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2579 depx[0] = (30./(8.*7.))/2.;
2582 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2584 // --- Define the part of the end-ladder stuff made of silicon (bus)
2587 dsil[0] = (20./(8.*7.))/2.;
2590 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2592 // --- Place the end-ladder stuff into its mother (ELL5)
2594 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2600 xpos = -dela[0] + dpla[0];
2601 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2605 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2606 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2610 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2611 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2613 // --- Silicon (bus)
2615 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2616 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2618 // --- Place the sensitive part of the strips into its mother (ISV1)
2621 for (j = 1; j <= 23; ++j) {
2622 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2623 else xpos = -dbox1[0] + dits[0];
2624 zpos = ((j - 1) - 11.) * 3.91;
2625 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2628 // --- Place the electronics of the strips into its mother (SSV1)
2631 for (j = 1; j <= 23; ++j) {
2632 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2633 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2634 zpos = ((j - 1) - 11.) * 3.91 + .85;
2635 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2638 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2640 xpos = -dsrv[0] + .41;
2643 // --- Left tube (just a matter of convention)
2646 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2647 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2649 // --- Right tube (just a matter of convention)
2652 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2653 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2655 // --- Place the heat bridge elements into their mother (SSV1)
2657 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2659 for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
2660 // volume SSV1. This is the same number of
2661 // elements as SCH5 above. Done Bjorn S. Nilsen
2662 // April 4 2000. Error found by Ivana
2663 // Hrivnacova March 29 2000.
2664 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2665 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2668 // --- Place the elements connecting the triangles of the heat bridge
2669 // into their mother (SSV1)
2673 // --- Left element (just a matter of convention)
2675 xpos = -dsrv[0] + .47;
2676 ypos = -(2.1+0.015);
2677 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2679 // --- Right element
2681 xpos = -dsrv[0] + .47;
2683 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2687 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2689 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2691 // --- Place the ghost volumes containing the strip ladders (ISV1),
2692 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2693 // their mother volume (IT56)
2695 offset1 = TMath::ATan2(.9, 40.);
2697 rzero = dbox1[0] + 40.;
2698 runo = dbox1[0] * 2. + 40. + dsrv[0];
2699 rtwo = dbox1[0] * 2. + 40. + dela[0];
2700 for (i = 1; i <= 35; ++i) {
2701 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2702 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2704 // --- Strip ladders
2706 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2707 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2709 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2711 // --- Electronics/cooling
2713 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2714 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2716 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2718 // --- End-ladders (nagative-Z and positive-Z)
2720 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2721 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2722 zpos = -(dbox1[2] + dela[2] + 6.);
2723 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2724 zpos = dbox1[2] + dela[2] + 6.;
2725 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2731 // GOTO 5778 ! skip ITS layer no. 6
2733 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2734 // it with air or vacuum
2736 dbox2[0] = (0.0600+2.*0.0150)/2.;
2738 dbox2[2] = 101.95/2.;
2739 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2741 // --- Make the ghost volume invisible
2743 gMC->Gsatt("ISV2", "SEEN", 0);
2745 // --- Define a ghost volume containing the electronics and cooling of
2746 // a single ladder of layer #6 and fill it with air or vacuum
2748 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2750 dsrv[2] = 101.95/2.;
2751 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2753 // --- Make the ghost volume invisible
2755 gMC->Gsatt("SSV2", "SEEN", 0);
2757 // --- Define a ghost volume containing the end-ladder stuff of
2758 // a single ladder of layer #6 and fill it with air or vacuum
2763 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2765 // --- Make the ghost volume invisible
2767 gMC->Gsatt("ELL6", "SEEN", 0);
2769 // --- Define a volume containing the sensitive part of the strips
2770 // (silicon, layer #6)
2775 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2777 // --- Define a volume containing the electronics of the strips
2778 // (silicon, layer #6)
2783 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2785 // --- Define the cooling tubes (aluminum, layer #6)
2788 dtub[1] = dtub[0] + .01;
2789 dtub[2] = 101.95/2.;
2790 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2792 // --- Define the cooling fluid (water or freon, layer #6)
2796 dwat[2] = 101.95/2.;
2797 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2798 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2800 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2808 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2809 dfra[6] = dfra[5] + .03;
2813 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2815 // --- Define the element connecting the triangles of the heat bridge
2816 // (carbon, layer #6)
2820 dcei[2] = 101.95/2.;
2821 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2823 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2826 dpla[0] = (10./(8.*7.))/2.;
2829 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2831 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2833 dcop[0] = (2./(8.*7.))/2.;
2836 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2838 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2840 depx[0] = (30./(8.*7.))/2.;
2843 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2845 // --- Define the part of the end-ladder stuff made of silicon (bus)
2848 dsil[0] = (20./(8.*7.))/2.;
2851 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2853 // --- Place the end-ladder stuff into its mother (ELL5)
2855 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2861 xpos = -dela[0] + dpla[0];
2862 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2866 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2867 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2871 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2872 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2874 // --- Silicon (bus)
2876 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2877 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2879 // --- Place the sensitive part of the strips into its mother (ISV2)
2882 for (j = 1; j <= 26; ++j) {
2883 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2884 else xpos = -dbox2[0] + dits[0];
2885 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2886 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2889 // --- Place the electronics of the strips into its mother (SSV2)
2892 for (j = 1; j <= 26; ++j) {
2893 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2894 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2895 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2896 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2899 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2901 xpos = -dsrv[0] + .41;
2904 // --- Left tube (just a matter of convention)
2907 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2908 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2910 // --- Right tube (just a matter of convention)
2913 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2914 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2916 // --- Place the heat bridge elements into their mother (SSV2)
2918 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2920 for (j = 1; j <= 27; ++j) {
2921 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2922 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2925 // --- Place the elements connecting the triangles of the heat bridge
2926 // into their mother (SSV2)
2930 // --- Left element (just a matter of convention)
2932 xpos = -dsrv[0] + .47;
2933 ypos = -(2.1+0.015);
2934 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2936 // --- Right element
2938 xpos = -dsrv[0] + .47;
2940 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2944 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2946 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2948 // --- Place the ghost volumes containing the strip ladders (ISV2),
2949 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2950 // their mother volume (IT56)
2952 offset1 = TMath::ATan2(1., 45.);
2954 rzero = dbox2[0] + 45.;
2955 runo = dbox2[0] * 2. + 45. + dsrv[0];
2956 rtwo = dbox2[0] * 2. + 45. + dela[0];
2957 for (i = 1; i <= 39; ++i) {
2958 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2959 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2961 // --- Strip ladders
2963 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2964 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2966 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2968 // --- Electronics/cooling
2970 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2971 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2973 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2975 // --- End-ladders (nagative-Z and positive-Z)
2977 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2978 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2979 zpos = -(dbox2[2] + dela[2] + 6.);
2980 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2981 zpos = dbox2[2] + dela[2] + 6.;
2982 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2987 // --- Define SSD with the 32+36 lay-out
2989 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
2991 //--- Define ghost volume containing the Strip Detectors and fill it with air
2994 xxm = (49.999-3.)/(70.-25.);
2998 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2999 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
3002 dgh[6] = -25. - (9.-3.01) / xxm -
3003 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
3006 dgh[9] = (9.-3.01) / xxm + 25. +
3007 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
3010 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
3011 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
3014 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
3015 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3016 gMC->Gsatt("IT56", "SEEN", 0);
3020 // GOTO 6678 ! skip ITS layer no. 5
3022 //--- Define a ghost volume containing a single ladder of layer #5 andfill
3023 // it with air or vacuum
3025 dbox1[0] = (0.0600+2.*0.0150)/2.;
3027 dbox1[2] = 86.31/2.;
3028 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
3030 // --- Make the ghost volume invisible
3032 gMC->Gsatt("ISV1", "SEEN", 0);
3034 // --- Define a ghost volume containing the electronics and cooling of
3035 // a single ladder of layer #5 and fill it with air or vacuum
3037 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3040 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
3042 // --- Make the ghost volume invisible
3044 gMC->Gsatt("SSV1", "SEEN", 0);
3046 // --- Define a ghost volume containing the end-ladder stuff of
3047 // a single ladder of layer #5 and fill it with air or vacuum
3052 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
3054 // --- Make the ghost volume invisible
3056 gMC->Gsatt("ELL5", "SEEN", 0);
3058 // --- Define a volume containing the sensitive part of the strips
3059 // (silicon, layer #5)
3064 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
3066 // --- Define a volume containing the electronics of the strips
3067 // (silicon, layer #5)
3072 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
3074 // --- Define the cooling tubes (aluminum, layer #5)
3077 dtub[1] = dtub[0] + .01;
3079 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
3081 // --- Define the cooling fluid (water or freon, layer #5)
3086 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
3087 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3089 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3097 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3098 dfra[6] = dfra[5] + .03;
3102 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
3104 // --- Define the element connecting the triangles of the heat bridge
3105 // (carbon, layer #5)
3110 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
3112 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3115 dpla[0] = (10./(8.*7.))/2;
3118 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
3120 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3122 dcop[0] = (2./(8.*7.))/2;
3125 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
3127 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3129 depx[0] = (30./(8.*7.))/2.;
3132 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
3134 // --- Define the part of the end-ladder stuff made of silicon (bus)
3137 dsil[0] = (20./(8.*7.))/2.;
3140 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
3142 // --- Place the end-ladder stuff into its mother (ELL5)
3144 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3150 xpos = -dela[0] + dpla[0];
3151 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3155 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3156 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3160 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3161 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3163 // --- Silicon (bus)
3165 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3166 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
3168 // --- Place the sensitive part of the strips into its mother (ISV1)
3171 for (j = 1; j <= 22; ++j) {
3172 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3173 else xpos = -dbox1[0] + dits[0];
3174 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
3175 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
3178 // --- Place the electronics of the strips into its mother (SSV1)
3181 for (j = 1; j <= 22; ++j) {
3182 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3183 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3184 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
3185 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3188 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3190 xpos = -dsrv[0] + .41;
3193 // --- Left tube (just a matter of convention)
3196 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3197 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3199 // --- Right tube (just a matter of convention)
3202 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3203 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3205 // --- Place the heat bridge elements into their mother (SSV1)
3207 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3209 for (j = 1; j <= 23; ++j) {
3210 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3211 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3214 // --- Place the elements connecting the triangles of the heat bridge
3215 // into their mother (SSV1)
3219 // --- Left element (just a matter of convention)
3221 xpos = -dsrv[0] + .47;
3222 ypos = -(2.1+0.015);
3223 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3225 // --- Right element
3227 xpos = -dsrv[0] + .47;
3229 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3233 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3235 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3237 // --- Place the ghost volumes containing the strip ladders (ISV1),
3238 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3239 // their mother volume (IT56)
3241 offset1 = TMath::ATan2(.8, 36.6);
3243 rzero = dbox1[0] + 36.6;
3244 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3245 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3246 for (i = 1; i <= 32; ++i) {
3247 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3248 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3250 // --- Strip ladders
3252 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3253 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3255 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3257 // --- Electronics/cooling
3259 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3260 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3262 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3264 // --- End-ladders (nagative-Z and positive-Z)
3266 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3267 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3268 zpos = -(dbox1[2] + dela[2] + 6.);
3269 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3270 zpos = dbox1[2] + dela[2] + 6.;
3271 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3277 // GOTO 6778 ! skip ITS layer no. 6
3279 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3280 // it with air or vacuum
3282 dbox2[0] = (0.0600+2.*0.0150)/2.;
3284 dbox2[2] = 94.13/2.;
3285 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3287 // --- Make the ghost volume invisible
3289 gMC->Gsatt("ISV2", "SEEN", 0);
3291 // --- Define a ghost volume containing the electronics and cooling of
3292 // a single ladder of layer #6 and fill it with air or vacuum
3294 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3297 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3299 // --- Make the ghost volume invisible
3301 gMC->Gsatt("SSV2", "SEEN", 0);
3303 // --- Define a ghost volume containing the end-ladder stuff of
3304 // a single ladder of layer #6 and fill it with air or vacuum
3309 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3311 // --- Make the ghost volume invisible
3313 gMC->Gsatt("ELL6", "SEEN", 0);
3315 // --- Define a volume containing the sensitive part of the strips
3316 // (silicon, layer #6)
3321 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3323 // --- Define a volume containing the electronics of the strips
3324 // (silicon, layer #6)
3329 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3331 // --- Define the cooling tubes (aluminum, layer #6)
3334 dtub[1] = dtub[0] + .01;
3336 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3338 // --- Define the cooling fluid (water or freon, layer #6)
3343 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3344 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3346 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3354 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3355 dfra[6] = dfra[5] + .03;
3359 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3361 // --- Define the element connecting the triangles of the heat bridge
3362 // (carbon, layer #6)
3367 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3369 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3372 dpla[0] = (10./(8.*7.))/2;
3375 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3377 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3379 dcop[0] = (2./(8.*7.))/2;
3382 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3384 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3386 depx[0] = (30./(8.*7.))/2.;
3389 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3391 // --- Define the part of the end-ladder stuff made of silicon (bus)
3394 dsil[0] = (20./(8.*7.))/2.;
3397 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3399 // --- Place the end-ladder stuff into its mother (ELL5)
3401 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3407 xpos = -dela[0] + dpla[0];
3408 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3412 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3413 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3417 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3418 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3420 // --- Silicon (bus)
3422 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3423 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3425 // --- Place the sensitive part of the strips into its mother (ISV2)
3428 for (j = 1; j <= 24; ++j) {
3429 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3430 else xpos = dbox2[0] - dits[0];
3431 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3432 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3435 // --- Place the electronics of the strips into its mother (SSV2)
3438 for (j = 1; j <= 24; ++j) {
3439 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3440 else xpos = -dsrv[0] + .28;
3441 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3442 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3445 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3447 xpos = -dsrv[0] + .41;
3450 // --- Left tube (just a matter of convention)
3453 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3454 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3456 // --- Right tube (just a matter of convention)
3459 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3460 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3462 // --- Place the heat bridge elements into their mother (SSV2)
3464 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3466 for (j = 1; j <= 25; ++j) {
3467 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3468 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3471 // --- Place the elements connecting the triangles of the heat bridge
3472 // into their mother (SSV2)
3476 // --- Left element (just a matter of convention)
3478 xpos = -dsrv[0] + .47;
3479 ypos = -(2.1+0.015);
3480 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3482 // --- Right element
3484 xpos = -dsrv[0] + .47;
3486 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3490 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3492 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3494 // --- Place the ghost volumes containing the strip ladders (ISV2),
3495 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3496 // their mother volume (IT56)
3498 offset1 = TMath::ATan2(.9, 41.2);
3500 rzero = dbox2[0] + 41.2;
3501 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3502 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3503 for (i = 1; i <= 36; ++i) {
3504 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3505 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3507 // --- Strip ladders
3509 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3510 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3512 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3514 // --- Electronics/cooling
3516 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3517 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3519 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3521 // --- End-ladders (nagative-Z and positive-Z)
3523 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3524 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3525 zpos = -(dbox2[2] + dela[2] + 6.);
3526 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3527 zpos = dbox2[2] + dela[2] + 6.;
3528 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3534 //************************************************************************
3536 //* E N D - C A P S A N D F R A M E S *
3537 //* ========================================= *
3539 //************************************************************************
3541 // --- Define a dummy cylinder for multiple scattering tests
3543 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3546 // DITS(2)=DITS(1)+0.1
3548 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3549 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3552 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3554 // GOTO 8901 ! skip outer wall
3556 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
3559 dits[1] = dits[0] + .06926;
3560 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3562 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3563 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3568 // --- The frame between the end-caps (octagonal lay-out) ---
3570 // GOTO 9012 ! skip octagonal frame
3572 if (fMinorVersionV3 == 1) {
3577 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3580 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3582 offset = angle / 2.;
3583 for (i = 0; i < 8; ++i) {
3584 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3585 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3587 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3588 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3592 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3593 aphi2 = 180. - aphi1;
3594 xpos = (xtra[0] + xtra[1]) / 2.;
3595 ypos = (ytra[0] + ytra[1]) / 2.;
3596 zpos = dtra[2] / 2.;
3597 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3600 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3601 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3602 zpos = -dtra[2] / 2.;
3603 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3606 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3607 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3610 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3611 aphi1 = 180. - aphi2;
3612 xpos = (xtra[1] + xtra[2]) / 2.;
3613 ypos = (ytra[1] + ytra[2]) / 2.;
3614 zpos = dtra[2] / 2.;
3615 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3618 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3619 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3620 zpos = -dtra[2] / 2.;
3621 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3624 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3625 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3628 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3629 aphi2 = 180. - aphi1;
3630 xpos = (xtra[2] + xtra[3]) / 2.;
3631 ypos = (ytra[2] + ytra[3]) / 2.;
3632 zpos = dtra[2] / 2.;
3633 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3636 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3637 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3638 zpos = -dtra[2] / 2.;
3639 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3642 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3643 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3646 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3647 aphi1 = 180. - aphi2;
3648 xpos = (xtra[3] + xtra[4]) / 2.;
3649 ypos = (ytra[3] + ytra[4]) / 2.;
3650 zpos = dtra[2] / 2.;
3651 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3654 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3655 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3656 zpos = -dtra[2] / 2.;
3657 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3660 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3661 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3664 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3665 aphi1 = 180. - aphi2;
3666 xpos = (xtra[4] + xtra[5]) / 2.;
3667 ypos = (ytra[4] + ytra[5]) / 2.;
3668 zpos = dtra[2] / 2.;
3669 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3672 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3673 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3674 zpos = -dtra[2] / 2.;
3675 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3678 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3679 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3682 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3683 aphi2 = 180. - aphi1;
3684 xpos = (xtra[5] + xtra[6]) / 2.;
3685 ypos = (ytra[5] + ytra[6]) / 2.;
3686 zpos = dtra[2] / 2.;
3687 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3690 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3691 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3692 zpos = -dtra[2] / 2.;
3693 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3696 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3697 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3700 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3701 aphi1 = 180. - aphi2;
3702 xpos = (xtra[6] + xtra[7]) / 2.;
3703 ypos = (ytra[6] + ytra[7]) / 2.;
3704 zpos = dtra[2] / 2.;
3705 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3708 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3709 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3710 zpos = -dtra[2] / 2.;
3711 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3714 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3715 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3718 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3719 aphi2 = 180. - aphi1;
3720 xpos = (xtra[7] + xtra[0]) / 2.;
3721 ypos = (ytra[7] + ytra[0]) / 2.;
3722 zpos = dtra[2] / 2.;
3723 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3726 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3727 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3728 zpos = -dtra[2] / 2.;
3729 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3732 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3733 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3736 } else if (fMinorVersionV3 == 4) {
3742 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3745 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3747 offset = angle / 2.;
3748 for (i = 0; i < 8; ++i) {
3749 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3750 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3752 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3753 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3757 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3758 aphi2 = 180. - aphi1;
3759 xpos = (xtra[0] + xtra[1]) / 2.;
3760 ypos = (ytra[0] + ytra[1]) / 2.;
3761 zpos = dtra[2] / 2.;
3762 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3765 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3766 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3767 zpos = -dtra[2] / 2.;
3768 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3771 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3772 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3775 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3776 aphi1 = 180. - aphi2;
3777 xpos = (xtra[1] + xtra[2]) / 2.;
3778 ypos = (ytra[1] + ytra[2]) / 2.;
3779 zpos = dtra[2] / 2.;
3780 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3783 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3784 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3785 zpos = -dtra[2] / 2.;
3786 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3789 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3790 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3793 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3794 aphi2 = 180. - aphi1;
3795 xpos = (xtra[2] + xtra[3]) / 2.;
3796 ypos = (ytra[2] + ytra[3]) / 2.;
3797 zpos = dtra[2] / 2.;
3798 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3801 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3802 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3803 zpos = -dtra[2] / 2.;
3804 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3807 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3808 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3811 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3812 aphi1 = 180. - aphi2;
3813 xpos = (xtra[3] + xtra[4]) / 2.;
3814 ypos = (ytra[3] + ytra[4]) / 2.;
3815 zpos = dtra[2] / 2.;
3816 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3819 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3820 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3821 zpos = -dtra[2] / 2.;
3822 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3825 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3826 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3829 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3830 aphi1 = 180. - aphi2;
3831 xpos = (xtra[4] + xtra[5]) / 2.;
3832 ypos = (ytra[4] + ytra[5]) / 2.;
3833 zpos = dtra[2] / 2.;
3834 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3837 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3838 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3839 zpos = -dtra[2] / 2.;
3840 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3843 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3844 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3847 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3848 aphi2 = 180. - aphi1;
3849 xpos = (xtra[5] + xtra[6]) / 2.;
3850 ypos = (ytra[5] + ytra[6]) / 2.;
3851 zpos = dtra[2] / 2.;
3852 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3855 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3856 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3857 zpos = -dtra[2] / 2.;
3858 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3861 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3862 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3865 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3866 aphi1 = 180. - aphi2;
3867 xpos = (xtra[6] + xtra[7]) / 2.;
3868 ypos = (ytra[6] + ytra[7]) / 2.;
3869 zpos = dtra[2] / 2.;
3870 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3873 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3874 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3875 zpos = -dtra[2] / 2.;
3876 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3879 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3880 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3883 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3884 aphi2 = 180. - aphi1;
3885 xpos = (xtra[7] + xtra[0]) / 2.;
3886 ypos = (ytra[7] + ytra[0]) / 2.;
3887 zpos = dtra[2] / 2.;
3888 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3891 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3892 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3893 zpos = -dtra[2] / 2.;
3894 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3897 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3898 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3904 // --- The frame between the end-caps (hexagonal lay-out) ---
3906 // GOTO 9123 ! skip hexagonal frame
3908 if (fMinorVersionV3 == 2) {
3913 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3919 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3921 offset = angle / 2.;
3922 for (i = 0; i < 6; ++i) {
3923 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3924 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3926 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3927 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3932 xpos = (xtra1[0] + xtra1[1]) / 2.;
3933 ypos = (ytra1[0] + ytra1[1]) / 2.;
3935 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3938 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3939 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3943 xpos = (xtra1[1] + xtra1[2]) / 2.;
3944 ypos = (ytra1[1] + ytra1[2]) / 2.;
3946 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3949 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3950 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3954 xpos = (xtra1[2] + xtra1[3]) / 2.;
3955 ypos = (ytra1[2] + ytra1[3]) / 2.;
3957 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3960 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3961 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3965 xpos = (xtra1[3] + xtra1[4]) / 2.;
3966 ypos = (ytra1[3] + ytra1[4]) / 2.;
3968 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3971 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3972 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3976 xpos = (xtra1[4] + xtra1[5]) / 2.;
3977 ypos = (ytra1[4] + ytra1[5]) / 2.;
3979 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3982 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3983 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3987 xpos = (xtra1[5] + xtra1[0]) / 2.;
3988 ypos = (ytra1[5] + ytra1[0]) / 2.;
3990 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3993 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3994 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3997 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3998 aphi1 = 180. - aphi2;
3999 xpos = (xtra1[0] + xtra1[1]) / 2.;
4000 ypos = (ytra1[0] + ytra1[1]) / 2.;
4001 zpos = dtra2[2] / 2.;
4002 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4005 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4006 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4007 zpos = -dtra2[2] / 2.;
4008 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4011 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4012 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4015 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4016 aphi2 = 180. - aphi1;
4017 xpos = (xtra1[1] + xtra1[2]) / 2.;
4018 ypos = (ytra1[1] + ytra1[2]) / 2.;
4019 zpos = dtra2[2] / 2.;
4020 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4023 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4024 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4025 zpos = -dtra2[2] / 2.;
4026 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4029 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4030 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4033 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4034 aphi1 = 180. - aphi2;
4035 xpos = (xtra1[2] + xtra1[3]) / 2.;
4036 ypos = (ytra1[2] + ytra1[3]) / 2.;
4037 zpos = dtra2[2] / 2.;
4038 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4041 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4042 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4043 zpos = -dtra2[2] / 2.;
4044 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4047 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4048 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4050 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
4051 - 50.*50.))) * raddeg;
4052 aphi2 = 180. - aphi1;
4053 xpos = (xtra1[2] + xtra1[3]) / 2.;
4054 ypos = (ytra1[2] + ytra1[3]) / 2.;
4055 zpos = dtra2[2] / 2.;
4056 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4059 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4060 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4061 zpos = -dtra2[2] / 2.;
4062 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4065 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4066 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4069 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4070 aphi1 = 180. - aphi2;
4071 xpos = (xtra1[3] + xtra1[4]) / 2.;
4072 ypos = (ytra1[3] + ytra1[4]) / 2.;
4073 zpos = dtra2[2] / 2.;
4074 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4077 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4078 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4079 zpos = -dtra2[2] / 2.;
4080 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4083 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4084 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4087 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4088 aphi2 = 180. - aphi1;
4089 xpos = (xtra1[4] + xtra1[5]) / 2.;
4090 ypos = (ytra1[4] + ytra1[5]) / 2.;
4091 zpos = dtra2[2] / 2.;
4092 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4095 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4096 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4097 zpos = -dtra2[2] / 2.;
4098 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4101 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4102 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4105 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4106 aphi1 = 180. - aphi2;
4107 xpos = (xtra1[5] + xtra1[0]) / 2.;
4108 ypos = (ytra1[5] + ytra1[0]) / 2.;
4109 zpos = dtra2[2] / 2.;
4110 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4113 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4114 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4115 zpos = -dtra2[2] / 2.;
4116 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4119 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4120 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4122 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4123 aphi2 = 180. - aphi1;
4124 xpos = (xtra1[5] + xtra1[0]) / 2.;
4125 ypos = (ytra1[5] + ytra1[0]) / 2.;
4126 zpos = dtra2[2] / 2.;
4127 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4130 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4131 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4132 zpos = -dtra2[2] / 2.;
4133 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4136 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4137 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4140 } else if (fMinorVersionV3 == 5) {
4146 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4152 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4154 offset = angle / 2.;
4155 for (i = 0; i < 6; ++i) {
4156 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
4157 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
4159 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
4160 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
4165 xpos = (xtra1[0] + xtra1[1]) / 2.;
4166 ypos = (ytra1[0] + ytra1[1]) / 2.;
4168 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
4171 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
4172 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
4176 xpos = (xtra1[1] + xtra1[2]) / 2.;
4177 ypos = (ytra1[1] + ytra1[2]) / 2.;
4179 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
4182 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
4183 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
4187 xpos = (xtra1[2] + xtra1[3]) / 2.;
4188 ypos = (ytra1[2] + ytra1[3]) / 2.;
4190 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
4193 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4194 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4198 xpos = (xtra1[3] + xtra1[4]) / 2.;
4199 ypos = (ytra1[3] + ytra1[4]) / 2.;
4201 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
4204 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4205 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4209 xpos = (xtra1[4] + xtra1[5]) / 2.;
4210 ypos = (ytra1[4] + ytra1[5]) / 2.;
4212 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
4215 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4216 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4220 xpos = (xtra1[5] + xtra1[0]) / 2.;
4221 ypos = (ytra1[5] + ytra1[0]) / 2.;
4223 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
4226 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4227 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4230 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4231 aphi1 = 180. - aphi2;
4232 xpos = (xtra1[0] + xtra1[1]) / 2.;
4233 ypos = (ytra1[0] + ytra1[1]) / 2.;
4234 zpos = dtra2[2] / 2.;
4235 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4238 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4239 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4240 zpos = -dtra2[2] / 2.;
4241 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4244 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4245 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4248 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4249 aphi2 = 180. - aphi1;
4250 xpos = (xtra1[1] + xtra1[2]) / 2.;
4251 ypos = (ytra1[1] + ytra1[2]) / 2.;
4252 zpos = dtra2[2] / 2.;
4253 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4256 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4257 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4258 zpos = -dtra2[2] / 2.;
4259 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4262 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4263 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4266 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4267 aphi1 = 180. - aphi2;
4268 xpos = (xtra1[2] + xtra1[3]) / 2.;
4269 ypos = (ytra1[2] + ytra1[3]) / 2.;
4270 zpos = dtra2[2] / 2.;
4271 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4274 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4275 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4276 zpos = -dtra2[2] / 2.;
4277 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4280 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4281 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4283 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4284 aphi2 = 180. - aphi1;
4285 xpos = (xtra1[2] + xtra1[3]) / 2.;
4286 ypos = (ytra1[2] + ytra1[3]) / 2.;
4287 zpos = dtra2[2] / 2.;
4288 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4291 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4292 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4293 zpos = -dtra2[2] / 2.;
4294 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4297 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4298 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4301 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4302 aphi1 = 180. - aphi2;
4303 xpos = (xtra1[3] + xtra1[4]) / 2.;
4304 ypos = (ytra1[3] + ytra1[4]) / 2.;
4305 zpos = dtra2[2] / 2.;
4306 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4309 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4310 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4311 zpos = -dtra2[2] / 2.;
4312 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4315 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4316 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4319 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4320 aphi2 = 180. - aphi1;
4321 xpos = (xtra1[4] + xtra1[5]) / 2.;
4322 ypos = (ytra1[4] + ytra1[5]) / 2.;
4323 zpos = dtra2[2] / 2.;
4324 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4327 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4328 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4329 zpos = -dtra2[2] / 2.;
4330 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4333 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4334 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4337 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4338 aphi1 = 180. - aphi2;
4339 xpos = (xtra1[5] + xtra1[0]) / 2.;
4340 ypos = (ytra1[5] + ytra1[0]) / 2.;
4341 zpos = dtra2[2] / 2.;
4342 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4345 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4346 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4347 zpos = -dtra2[2] / 2.;
4348 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4351 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4352 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4354 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4355 aphi2 = 180. - aphi1;
4356 xpos = (xtra1[5] + xtra1[0]) / 2.;
4357 ypos = (ytra1[5] + ytra1[0]) / 2.;
4358 zpos = dtra2[2] / 2.;
4359 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4362 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4363 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4364 zpos = -dtra2[2] / 2.;
4365 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4368 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4369 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4375 // --- Define the end-caps
4377 // GOTO 9234 ! skip both end-caps
4379 // --- Define the Z>0 end-cap
4381 // GOTO 9345 ! skip the Z>0 end-cap
4386 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4387 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4390 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4391 // end-ladder electro
4392 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4393 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4395 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4397 // In the Simonetti's drawings 52. In the TP 50.
4401 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4402 // end-ladder electro
4403 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4404 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4408 dtube[2] = 26.8/2./10.;
4411 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4413 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4414 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4420 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4421 // end-ladder electron
4424 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4425 // end-ladder electronics
4431 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4432 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4438 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4442 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4449 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4450 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4452 if (fMinorVersionV3 < 3 ) {
4454 dpgon[0] = offset2 + 360./(2.*35.);
4458 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4462 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4469 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4470 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4472 dpgon[0] = offset2 + 360./(2.*39.);
4476 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4480 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4487 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4488 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4490 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4492 dpgon[0] = offset2 + 5.625;
4496 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4497 // end-ladder electronics
4500 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4501 // end-ladder electr
4507 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4508 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4510 dpgon[0] = offset2 + 5.;
4514 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4515 // end-ladder electronics
4518 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4519 // end-ladder electr
4525 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4526 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4531 // --- Define the Z<0 end-cap
4533 // GOTO 9456 ! skip the Z<0 end-cap
4536 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4537 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4542 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4543 // end-ladder electr
4544 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4546 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4548 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4550 // In the Simonetti's drawings 52. In the TP 50.
4554 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4555 // end-ladder electr
4556 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4558 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4562 dtube[2] = 26.8/2./10.;
4565 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4567 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4569 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4575 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4576 // end-ladder electronics
4579 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4580 // end-ladder electro
4586 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4587 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4593 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4597 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4604 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4605 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4607 if (fMinorVersionV3 < 3) {
4609 dpgon[0] = offset2 + 360./(2.*35.);
4613 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4617 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4624 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4625 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4627 dpgon[0] = offset2 + 360./(2.*39.);
4631 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4635 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4642 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4643 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4645 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
4647 dpgon[0] = offset2 + 5.625;
4651 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4652 // end-ladder electronics
4655 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4656 // end-ladder electr
4662 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4663 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4665 dpgon[0] = offset2 + 5.;
4669 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4670 // end-ladder electronics
4673 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4674 // end-ladder electr
4680 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4681 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4687 // --- Outputs the geometry tree in the EUCLID/CAD format
4690 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4692 fMinorVersion = fMinorVersionV3;
4694 //_____________________________________________________________________________
4695 void AliITSv3::CreateMaterials(){
4696 ////////////////////////////////////////////////////////////////////////
4698 // Create ITS materials
4699 // This function defines the default materials used in the Geant
4700 // Monte Carlo simulations. In general it is automatically replaced by
4701 // the CreatMaterials routine defined in AliITSv?. Should the function
4702 // CreateMaterials not exist for the geometry version you are using this
4703 // one is used. See the definition found in AliITSv5 or the other routine
4704 // for a complete definition.
4707 Float_t awat[2] = { 1.00794,15.9994 };
4708 Float_t zwat[2] = { 1.,8. };
4709 Float_t wwat[2] = { 2.,1. };
4710 Float_t denswat = 1.;
4712 Float_t afre[2] = { 12.011,18.9984032 };
4713 Float_t zfre[2] = { 6.,9. };
4714 Float_t wfre[2] = { 5.,12. };
4715 Float_t densfre = 1.5;
4717 // 94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
4718 Float_t acer[5] = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
4719 Float_t zcer[5] = { 13.,8.,14.,25., 24. };
4720 Float_t wcer[5] = { .49976,1.01233,.01307, .01782,.00342 };
4721 Float_t denscer = 3.6;
4723 // 60% SiO2 , 40% G10FR4
4725 Float_t apcb[3] = { 28.0855,15.9994,17.749 };
4726 Float_t zpcb[3] = { 14.,8.,8.875 };
4727 Float_t wpcb[3] = { .28,.32,.4 };
4728 Float_t denspcb = 1.8;
4730 Float_t apoly[2] = { 12.01,1. };
4731 Float_t zpoly[2] = { 6.,1. };
4732 Float_t wpoly[2] = { .33,.67 };
4734 Float_t zserv[4] = { 1.,6.,26.,29. };
4735 Float_t aserv[4] = { 1.,12.,55.8,63.5 };
4736 Float_t wserv[4] = { .014,.086,.42,.48 };
4738 Int_t ISXFLD = gAlice->Field()->Integ();
4739 Float_t SXMGMX = gAlice->Field()->Max();
4742 // --- Define the various materials for GEANT ---
4744 // 200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
4746 AliMaterial(0, "SPD Si$", 28.0855, 14., 2.33, 9.36, 999);
4747 AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4748 AliMaterial(2, "SPD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4749 AliMaterial(3, "SPD C$", 12.011, 6., 2.265,18.8, 999);
4751 AliMaterial(4, "SPD Air$", 14.61, 7.3, .001205, 30423., 999);
4752 AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4753 AliMaterial(6, "SPD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4754 AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
4755 AliMixture( 8, "SPD Freon$", afre, zfre, densfre, -2, wfre);
4757 AliMedium(0, "SPD Si$", 0, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4758 AliMedium(1, "SPD Si chip$", 1, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4759 AliMedium(2, "SPD Si bus$", 2, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4760 AliMedium(3, "SPD C$", 3, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4761 AliMedium(4, "SPD Air$", 4, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4762 AliMedium(5, "SPD Vacuum$", 5, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
4763 AliMedium(6, "SPD Al$", 6, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4764 AliMedium(7, "SPD Water $", 7, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4765 AliMedium(8, "SPD Freon$", 8, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4767 // 225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
4769 AliMaterial(25, "SDD Si$", 28.0855, 14., 2.33, 9.36, 999);
4770 AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
4771 AliMaterial(27, "SDD Si bus$", 28.0855, 14., 2.33, 9.36, 999);
4772 AliMaterial(28, "SDD C$", 12.011, 6., 2.265,18.8, 999);
4774 AliMaterial(29, "SDD Air$", 14.61, 7.3, .001205, 30423., 999);
4775 AliMaterial(30, "SDD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4776 AliMaterial(31, "SDD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4777 // After a call with ratios by number (negative number of elements),
4778 // the ratio array is changed to the ratio by weight, so all successive
4779 // calls with the same array must specify the number of elements as
4781 AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
4782 // After a call with ratios by number (negative number of elements),
4783 // the ratio array is changed to the ratio by weight, so all successive
4784 // calls with the same array must specify the number of elements as
4786 AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
4787 AliMixture( 34, "SDD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4788 AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
4789 AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
4790 AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
4793 AliMedium(25, "SDD Si$", 25, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4794 AliMedium(26, "SDD Si chip$", 26, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4795 AliMedium(27, "SDD Si bus$", 27, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4796 AliMedium(28, "SDD C$", 28, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4797 AliMedium(29, "SDD Air$", 29, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4798 AliMedium(30, "SDD Vacuum$", 30, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
4799 AliMedium(31, "SDD Al$", 31, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4800 AliMedium(32, "SDD Water $", 32, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4801 AliMedium(33, "SDD Freon$", 33, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4802 AliMedium(34, "SDD PCB$", 34, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4803 AliMedium(35, "SDD Copper$", 35, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4804 AliMedium(36, "SDD Ceramics$",36, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4805 AliMedium(37, "SDD Kapton$", 37, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4807 // 250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
4809 AliMaterial(50, "SSD Si$", 28.0855, 14., 2.33, 9.36, 999.);
4810 AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
4811 AliMaterial(52, "SSD Si bus$", 28.0855, 14., 2.33, 9.36, 999.);
4812 AliMaterial(53, "SSD C$", 12.011, 6., 2.265,18.8, 999.);
4814 AliMaterial(54, "SSD Air$", 14.61, 7.3, .001205, 30423., 999);
4815 AliMaterial(55, "SSD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4816 AliMaterial(56, "SSD Al$", 26.981539, 13., 2.6989, 8.9, 999);
4817 // After a call with ratios by number (negative number of elements),
4818 // the ratio array is changed to the ratio by weight, so all successive
4819 // calls with the same array must specify the number of elements as
4821 AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
4822 // After a call with ratios by number (negative number of elements),
4823 // the ratio array is changed to the ratio by weight, so all successive
4824 // calls with the same array must specify the number of elements as
4826 AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
4827 AliMixture(59, "SSD PCB$", apcb, zpcb, denspcb, 3, wpcb);
4828 AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
4829 // After a call with ratios by number (negative number of elements),
4830 // the ratio array is changed to the ratio by weight, so all successive
4831 // calls with the same array must specify the number of elements as
4833 AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
4834 AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
4836 AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
4838 AliMedium(50, "SSD Si$", 50, 1,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4839 AliMedium(51, "SSD Si chip$", 51, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4840 AliMedium(52, "SSD Si bus$", 52, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4841 AliMedium(53, "SSD C$", 53, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4842 AliMedium(54, "SSD Air$", 54, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4843 AliMedium(55, "SSD Vacuum$", 55, 0,ISXFLD,SXMGMX, 10.,1.00, .1, .100,10.00);
4844 AliMedium(56, "SSD Al$", 56, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4845 AliMedium(57, "SSD Water $", 57, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4846 AliMedium(58, "SSD Freon$", 58, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4847 AliMedium(59, "SSD PCB$", 59, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4848 AliMedium(60, "SSD Copper$", 60, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4849 AliMedium(61, "SSD Ceramics$",61, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4850 AliMedium(62, "SSD Kapton$", 62, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4851 AliMedium(63, "SSD G10FR4$", 63, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4853 // 275-299 --> General (end-caps, frames, cooling, cables, etc.)
4855 AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
4857 AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
4858 AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
4859 AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
4860 AliMixture( 79, "GEN SERVICES$", aserv, zserv, 4.68, 4, wserv);
4861 AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
4862 // After a call with ratios by number (negative number of elements),
4863 // the ratio array is changed to the ratio by weight, so all successive
4864 // calls with the same array must specify the number of elements as
4866 AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
4868 AliMedium(75,"GEN C$", 75, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4869 AliMedium(76,"GEN Air$", 76, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4870 AliMedium(77,"GEN Vacuum$", 77, 0,ISXFLD,SXMGMX, 10., .10, .1, .100,10.00);
4871 AliMedium(78,"GEN POLYETHYL$",78, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4872 AliMedium(79,"GEN SERVICES$", 79, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4873 AliMedium(80,"GEN Copper$", 80, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4874 AliMedium(81,"GEN Water $", 81, 0,ISXFLD,SXMGMX, 10., .01, .1, .003, .003);
4877 //_____________________________________________________________________________
4878 void AliITSv3::Init(){
4879 ////////////////////////////////////////////////////////////////////////
4880 // Initialise the ITS after it has been created.
4881 ////////////////////////////////////////////////////////////////////////
4885 fIdName = new char*[fIdN];
4886 fIdSens = new Int_t[fIdN];
4887 for(i=0;i<fId3N;i++) {
4888 l = strlen(fId3Name[i]);
4889 fIdName[i] = new char[l+1];
4890 for(j=0;j<l;j++) fIdName[i][j] = fId3Name[i][j];
4891 fIdName[i][l] = '\0'; // Null terminate this string.
4896 fMinorVersion = fMinorVersionV3;
4898 //_____________________________________________________________________________
4899 void AliITSv3::StepManager(){
4900 ////////////////////////////////////////////////////////////////////////
4901 // Called for every step in the ITS, then calles the AliITShit class
4902 // creator with the information to be recoreded about that hit.
4903 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
4904 // printing of information to a file which can be used to create a .det
4905 // file read in by the routine CreateGeometry(). If set to 0 or any other
4906 // value except 1, the default behavior, then no such file is created nor
4907 // it the extra variables and the like used in the printing allocated.
4908 ////////////////////////////////////////////////////////////////////////
4912 TLorentzVector position, momentum;
4913 TClonesArray &lhits = *fHits;
4914 #if ALIITSPRINTGEOM==1
4917 Float_t xl[3],xt[3],angl[6];
4918 // Float_t par[20],att[20];
4920 static Bool_t first=kTRUE,printit[6][50][50];
4921 if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
4922 for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
4930 if(gMC->IsTrackInside()) vol[3] += 1;
4931 if(gMC->IsTrackEntering()) vol[3] += 2;
4932 if(gMC->IsTrackExiting()) vol[3] += 4;
4933 if(gMC->IsTrackOut()) vol[3] += 8;
4934 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4935 if(gMC->IsTrackStop()) vol[3] += 32;
4936 if(gMC->IsTrackAlive()) vol[3] += 64;
4938 // Fill hit structure.
4939 if(!(gMC->TrackCharge())) return;
4941 // Only entering charged tracks
4942 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
4944 id=gMC->CurrentVolOffID(1,copy);
4946 id=gMC->CurrentVolOffID(2,copy);
4948 } else if(id==fIdSens[1]) {
4950 id=gMC->CurrentVolOffID(1,copy);
4952 id=gMC->CurrentVolOffID(2,copy);
4954 } else if(id==fIdSens[2]) {
4957 id=gMC->CurrentVolOffID(1,copy);
4959 } else if(id==fIdSens[3]) {
4962 id=gMC->CurrentVolOffID(1,copy);
4964 } else if(id==fIdSens[4]) {
4967 id=gMC->CurrentVolOffID(1,copy);
4969 } else if(id==fIdSens[5]) {
4972 id=gMC->CurrentVolOffID(1,copy);
4975 gMC->TrackPosition(position);
4976 gMC->TrackMomentum(momentum);
4977 hits[0]=position[0];
4978 hits[1]=position[1];
4979 hits[2]=position[2];
4980 hits[3]=momentum[0];
4981 hits[4]=momentum[1];
4982 hits[5]=momentum[2];
4983 hits[6]=gMC->Edep();
4984 hits[7]=gMC->TrackTime();
4985 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
4986 #if ALIITSPRINTGEOM==1
4987 if(printit[vol[0]][vol[2]][vol[1]]){
4988 printit[vol[0]][vol[2]][vol[1]] = kFALSE;
4989 xl[0] = xl[1] = xl[2] = 0.0;
4990 gMC->Gdtom(xl,xt,1);
4991 for(i=0;i<9;i++) mat[i] = 0.0;
4992 mat[0] = mat[4] = mat[8] = 1.0; // default with identity matrix
4995 gMC->Gdtom(xl,&(mat[0]),2);
4998 gMC->Gdtom(xl,&(mat[3]),2);
5001 gMC->Gdtom(xl,&(mat[6]),2);
5003 angl[0] = TMath::ACos(mat[2]);
5004 if(mat[2]==1.0) angl[0] = 0.0;
5005 angl[1] = TMath::ATan2(mat[1],mat[0]);
5006 if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
5008 angl[2] = TMath::ACos(mat[5]);
5009 if(mat[5]==1.0) angl[2] = 0.0;
5010 angl[3] = TMath::ATan2(mat[4],mat[3]);
5011 if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
5013 angl[4] = TMath::ACos(mat[8]);
5014 if(mat[8]==1.0) angl[4] = 0.0;
5015 angl[5] = TMath::ATan2(mat[7],mat[6]);
5016 if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
5018 for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
5019 // i = gMC->CurrentVolID(copy);
5020 // gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
5021 fp = fopen("ITSgeometry_v5.det","a");
5022 fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
5023 vol[0],vol[2],vol[1], // layer ladder detector
5024 xt[0],xt[1],xt[2], // Translation vector
5025 angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
5028 fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
5029 mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
5030 ); // Adding the rotation matrix.
5033 } // end if printit[layer][ladder][detector]
5036 //____________________________________________________________________________
5037 void AliITSv3::Streamer(TBuffer &R__b){
5038 ////////////////////////////////////////////////////////////////////////
5039 // A dummy Streamer function for this class AliITSv3. By default it
5040 // only streams the AliITS class as it is required. Since this class
5041 // dosen't contain any "real" data to be saved, it doesn't.
5042 ////////////////////////////////////////////////////////////////////////
5043 if (R__b.IsReading()) {
5044 Version_t R__v = R__b.ReadVersion();
5046 AliITS::Streamer(R__b);
5047 // This information does not need to be read. It is "hard wired"
5048 // into this class via its creators.
5050 //R__b.ReadArray(fId3Name);
5054 R__b.WriteVersion(AliITSv3::IsA());
5055 AliITS::Streamer(R__b);
5056 // This information does not need to be saved. It is "hard wired"
5057 // into this class via its creators.
5059 //R__b.WriteArray(fId3Name, __COUNTER__);
5060 } // end if R__b.IsReading()