1 ///////////////////////////////////////////////////////////////////////////////
3 // Inner Traking System version 3 //
7 <img src="picts/AliITSv3Class.gif">
10 <font size=+2 color=red>
11 <p>The responsible person for this module is
12 <a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
18 ///////////////////////////////////////////////////////////////////////////////
31 //_____________________________________________________________________________
32 AliITSv3::AliITSv3() : AliITS()
35 // Default constructor for ITS
40 //_____________________________________________________________________________
41 AliITSv3::AliITSv3(const char *name, const char *title)
45 // Standard constructor for ITS
50 //_____________________________________________________________________________
51 void AliITSv3::CreateGeometry()
54 // Create ITS geometry for version 3
58 <img src="picts/AliITSv3Tree.gif">
63 <img src="picts/AliITSv3.gif">
68 const Float_t xx[14] = { 0.,0.,-14.002,-6.288,-25.212,-16.292,-35.713,-26.401,
69 -45.34,-36.772,-18.74,-12.814,-14.358,0. };
70 const Float_t yy[14] = { 0.,27.056,31.408,
71 25.019,27.768,22.664,22.42,18.727,15.479,13.68,-9.984,-6.175,-3.775,0. };
72 const Float_t xbeg[13] = { 0.,-.352,-12.055,-8.755,-23.035,-19.085,-33.362,
73 -28.859,-42.774,-36.644,-18.352,-13.085,-13.426 };
74 const Float_t ybeg[13] = { .386,27.165,29.795,
75 25.377,26.48,22.632,21.487,18.305,14.94,13.509,-9.735,-5.755,-3.53 };
76 const Float_t xend[13] = { 0.,-11.588,-8.208,-22.709,-18.738,-33.184,-28.719,
77 -42.756,-37.027,-19.002,-13.235,-13.837,-.373 };
78 const Float_t yend[13] = { 26.688,30.658,26.609,
79 27.405,23.935,22.452,19.646,15.922,13.733,-9.639,-6.446,-4.585,-.098 };
80 const Float_t xarc[13] = { -.5,-13.248,-13.505,-18.622,-37.171,-42.671,-28.977,
81 -33.178,-19.094,-22.781,-8.655,-11.736,-.5 };
82 const Float_t yarc[13] = { .5,-4.093,-5.911,
83 -9.2,13.162,15.543,19.109,22.066,23.446,27.024,26.184,30.294,26.802 };
84 const Float_t rarc[13] = { .5,.7,.5,.5,.7,.5,.7,.5,.7,.5,.7,.5,.5 };
85 const Float_t rr = 4.064516;
86 const Float_t tteta = 63.;
87 const Float_t pphi = -35.;
88 const Float_t gteta = 87.78;
89 const Double_t degrad = kPI/180.;
90 const Double_t raddeg = 180./kPI;
91 const Double_t twopi = 2*kPI;
94 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5], dfra[10], dcer[3], dkap[3], dpla[3],
95 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3], atheta1011, dbus[3], dtub[3], dwat[3],
96 depx[3], dits[3], atheta1314, atheta1213, atheta1112, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
97 Double_t biga1, bigb1;
98 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3],
99 dtra4[3], dbox1[3], dbox2[3];
101 Float_t xtra1[6], ytra1[6], ztra1[6];
103 Float_t xpos1, ypos1;
105 Float_t angle, dcone[5], dtube[3], dpgon[10];
106 Float_t rzero, xzero, yzero;
107 Double_t coeffa, coeffb, coeffc;
109 Float_t atheta, offset;
110 Float_t offset1, offset2, dgh[15];
111 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
112 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
115 Double_t xcc1, ycc1, xcc2, ycc2;
117 const char natra[][5] =
118 { "TR01","TR02","TR03","TR04","TR05","TR06","TR07","TR08"};
119 const char natra1[][5] =
120 {"TR11","TR12","TR13","TR14","TR15","TR16","TR17","TR18",
121 "TR19","TR20","TR21","TR22","TR23","TR24","TR25","TR26"};
122 const char natra2[][5] =
123 {"TR31","TR32","TR33","TR34","TR35","TR36"};
124 const char natra3[][5] =
125 {"TR41","TR42","TR43","TR44","TR45","TR46"};
126 const char natra4[][5] =
127 {"TR51","TR52","TR53","TR54","TR55","TR56","TR57","TR58",
128 "TR59","TR60","TR61","TR62","TR63","TR64","TR65","TR66"};
130 Int_t *idtmed = fIdtmed->GetArray()-199;
132 // --- Define a ghost volume containing the whole ITS and fill it with air
150 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
152 // --- Place the ghost volume in its mother volume (ALIC) and make it
155 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
156 gMC->Gsatt("ITSV", "SEEN", 0);
158 //************************************************************************
163 //************************************************************************
165 // GOTO 2345 ! skip ITS layer no. 1 and 2
167 // --- Define a ghost volume containing the Silicon Pixel Detectors
168 // (layer #1 and #2) and fill it with air or vacuum
170 xxm = (49.999-3)/(70-25);
174 dgh[3] = -25.-(9.-3.01)/xxm;
183 dgh[12] = 25+(9-3.01)/xxm;
186 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
188 // --- Place the ghost volume in its mother volume (ITSV) and make it
191 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
192 gMC->Gsatt("IT12", "SEEN", 0);
194 // --- Define a ghost volume containing a single element of layer #1
195 // and fill it with air or vacuum
197 dbox1[0] = 0.005+0.01+0.0075;
200 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
202 //--- Divide each element of layer #1 in three ladders along the beam direction
204 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
206 // --- Make the ghost volumes invisible
208 gMC->Gsatt("IPV1", "SEEN", 0);
209 gMC->Gsatt("IPB1", "SEEN", 0);
211 // --- Define a volume containing the chip of pixels (silicon, layer #1)
215 dchi[2] = dbox1[2] / 3.;
216 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
218 // --- Define a volume containing the bus of pixels (silicon, layer #1)
223 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
225 // --- Define a volume containing the sensitive part of pixels
226 // (silicon, layer #1)
231 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
233 // --- Place the chip into its mother (IPB1)
235 xpos = dbox1[0] - dchi[0];
238 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
240 // --- Place the sensitive volume into its mother (IPB1)
242 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
243 ypos = dchi[1] - dits[1];
244 zpos = -(dchi[2] - dits[2]);
245 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
247 // --- Place the bus into its mother (IPB1)
249 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
250 ypos = dchi[1] - dbus[1];
251 zpos = -(dchi[2] - dbus[2]);
252 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
254 // --- Define a ghost volume containing a single element of layer #2
255 // and fill it with air or vacuum
257 dbox2[0] = 0.005+0.01+0.0075;
260 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
262 //--- Divide each element of layer #2 in four ladders along the beam direction
264 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
266 // --- Make the ghost volumes invisible
268 gMC->Gsatt("IPV2", "SEEN", 0);
269 gMC->Gsatt("IPB2", "SEEN", 0);
271 // --- Define a volume containing the chip of pixels (silicon, layer #2)
275 dchi[2] = dbox2[2] / 4.;
276 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
278 // --- Define a volume containing the bus of pixels (silicon, layer #2)
283 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
285 // --- Define a volume containing the sensitive part of pixels
286 // (silicon, layer #2)
291 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
293 // --- Place the chip into its mother (IPB2)
295 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
298 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
300 // --- Place the sensitive volume into its mother (IPB2)
302 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
303 ypos = -(dchi[1] - dits[1]);
304 zpos = -(dchi[2] - dits[2]);
305 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
307 // --- Place the bus into its mother (IPB2)
309 xpos = dbox1[0] - dbus[0];
310 ypos = -(dchi[1] - dbus[1]);
311 zpos = -(dchi[2] - dbus[2]);
312 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
314 // --- Define a generic segment of an element of the mechanical support
319 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
321 // --- Define a generic arc of an element of the mechanical support
326 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
328 // --- Define the mechanical supports of layers #1 and #2 and place the
329 // elements of the layers in it
332 // counter over the number of elements of layer #1 (
335 // counter over the number of elements of layer #2 (
336 for (i = 1; i <= 10; ++i) {
338 // --- Place part # 1-2 (see sketch)
340 // number of carbon fiber supports (see sketch)
343 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
345 xcc = (xx[0] + xx[1]) / 20.;
346 ycc = (yy[0] + yy[1]) / 20.;
347 xccc = (xbeg[0] + xend[0]) / 20.;
348 yccc = (ybeg[0] + yend[0]) / 20.;
349 if (xx[0] == xx[1]) {
354 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
356 aphi = (pphi + (i-1) * 36.) * degrad;
357 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
358 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
359 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
360 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
361 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
362 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
364 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
365 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
366 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
368 // --- Place part # 2-3 (see sketch)
372 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
374 xcc = (xx[1] + xx[2]) / 20.;
375 ycc = (yy[1] + yy[2]) / 20.;
376 xccc = (xbeg[1] + xend[1]) / 20.;
377 yccc = (ybeg[1] + yend[1]) / 20.;
378 if (xx[1] == xx[2]) {
383 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
385 aphi = (pphi + (i-1) * 36.) * degrad;
386 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
387 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
388 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
389 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
390 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
391 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
393 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
394 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
395 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
397 // --- Place an element of layer #2
399 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
400 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
401 coeffa = biga * biga + 1.;
402 coeffb = biga * bigb - biga * ycc - xcc;
403 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 0.08964*0.08964;
404 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
405 ycc1 = biga * xcc1 + bigb;
407 bigb1 = xcc1 / biga + ycc1;
408 coeffa = biga1 * biga1 + 1.;
409 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
410 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
411 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
412 ycc2 = biga1 * xcc2 + bigb1;
413 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
414 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
415 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
416 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
419 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
421 // --- Place part # 3-4 (see sketch)
425 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
427 xcc = (xx[1] + xx[2]) / 20.;
428 ycc = (yy[1] + yy[2]) / 20.;
429 xccc = (xbeg[2] + xend[2]) / 20.;
430 yccc = (ybeg[2] + yend[2]) / 20.;
431 if (xx[2] == xx[3]) {
436 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
438 aphi = (pphi + (i-1) * 36.) * degrad;
439 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
440 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
441 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
442 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
443 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
444 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
446 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
447 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
448 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
450 // --- Place part # 4-5 (see sketch)
454 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
456 xcc = (xx[3] + xx[4]) / 20.;
457 ycc = (yy[3] + yy[4]) / 20.;
458 xccc = (xbeg[3] + xend[3]) / 20.;
459 yccc = (ybeg[3] + yend[3]) / 20.;
460 if (xx[3] == xx[4]) {
465 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
467 aphi = (pphi + (i-1) * 36.) * degrad;
468 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
469 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
470 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
471 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
472 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
473 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
475 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
476 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
477 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
479 // --- Place an element of layer #2
481 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
482 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
483 coeffa = biga * biga + 1.;
484 coeffb = biga * bigb - biga * ycc - xcc;
485 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
486 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
487 ycc1 = biga * xcc1 + bigb;
489 bigb1 = xcc1 / biga + ycc1;
490 coeffa = biga1 * biga1 + 1.;
491 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
492 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
493 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
494 ycc2 = biga1 * xcc2 + bigb1;
495 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
496 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
497 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
498 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
501 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
503 // --- Place part # 5-6 (see sketch)
507 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
509 xcc = (xx[4] + xx[5]) / 20.;
510 ycc = (yy[4] + yy[5]) / 20.;
511 xccc = (xbeg[4] + xend[4]) / 20.;
512 yccc = (ybeg[4] + yend[4]) / 20.;
513 if (xx[4] == xx[5]) {
518 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
520 aphi = (pphi + (i-1) * 36.) * degrad;
521 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
522 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
523 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
524 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
525 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
526 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
528 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
529 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
530 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
532 // --- Place part # 6-7 (see sketch)
536 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
538 xcc = (xx[5] + xx[6]) / 20.;
539 ycc = (yy[5] + yy[6]) / 20.;
540 xccc = (xbeg[5] + xend[5]) / 20.;
541 yccc = (ybeg[5] + yend[5]) / 20.;
542 if (xx[5] == xx[6]) {
547 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
549 aphi = (pphi + (i-1) * 36.) * degrad;
550 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
551 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
552 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
553 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
554 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
555 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
557 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
558 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
559 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
561 // --- Place an element of layer #2
563 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
564 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
565 coeffa = biga * biga + 1.;
566 coeffb = biga * bigb - biga * ycc - xcc;
567 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
568 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
569 ycc1 = biga * xcc1 + bigb;
571 bigb1 = xcc1 / biga + ycc1;
572 coeffa = biga1 * biga1 + 1.;
573 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
574 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
575 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
576 ycc2 = biga1 * xcc2 + bigb1;
577 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
578 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
579 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
580 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
583 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
585 // --- Place part # 7-8 (see sketch)
589 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
591 xcc = (xx[6] + xx[7]) / 20.;
592 ycc = (yy[6] + yy[7]) / 20.;
593 xccc = (xbeg[6] + xend[6]) / 20.;
594 yccc = (ybeg[6] + yend[6]) / 20.;
595 if (xx[6] == xx[7]) {
600 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
602 aphi = (pphi + (i-1) * 36.) * degrad;
603 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
604 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
605 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
606 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
607 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
608 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
610 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
611 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
612 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
614 // --- Place part # 8-9 (see sketch)
618 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
620 xcc = (xx[7] + xx[8]) / 20.;
621 ycc = (yy[7] + yy[8]) / 20.;
622 xccc = (xbeg[7] + xend[7]) / 20.;
623 yccc = (ybeg[7] + yend[7]) / 20.;
624 if (xx[1] == xx[2]) {
629 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
631 aphi = (pphi + (i-1) * 36.) * degrad;
632 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
633 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
634 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
635 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
636 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
637 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
639 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
640 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
641 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
643 // --- Place an element of layer #2
645 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
646 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
647 coeffa = biga * biga + 1.;
648 coeffb = biga * bigb - biga * ycc - xcc;
649 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
650 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
651 ycc1 = biga * xcc1 + bigb;
653 bigb1 = xcc1 / biga + ycc1;
654 coeffa = biga1 * biga1 + 1.;
655 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
656 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
657 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
658 ycc2 = biga1 * xcc2 + bigb1;
659 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
660 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
661 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
662 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
665 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
667 // --- Place part # 9-10 (see sketch)
671 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
673 xcc = (xx[8] + xx[9]) / 20.;
674 ycc = (yy[8] + yy[9]) / 20.;
675 xccc = (xbeg[8] + xend[8]) / 20.;
676 yccc = (ybeg[8] + yend[8]) / 20.;
677 if (xx[8] == xx[9]) {
682 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
684 aphi = (pphi + (i-1) * 36.) * degrad;
685 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
686 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
687 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
688 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
689 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
690 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
692 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
693 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
694 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
696 // --- Place part # 10-11 (see sketch)
700 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
702 xcc = (xx[9] + xx[10]) / 20.;
703 ycc = (yy[9] + yy[10]) / 20.;
704 xccc = (xbeg[9] + xend[9]) / 20.;
705 yccc = (ybeg[9] + yend[9]) / 20.;
706 if (xx[9] == xx[10]) {
711 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
713 aphi = (pphi + (i-1) * 36.) * degrad;
714 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
715 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
716 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
717 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
718 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
719 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
721 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
722 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
723 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
725 // --- Place part # 13-14 (see sketch)
729 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
731 xcc = (xx[12] + xx[13]) / 20.;
732 ycc = (yy[12] + yy[13]) / 20.;
733 xccc = (xbeg[12] + xend[12]) / 20.;
734 yccc = (ybeg[12] + yend[12]) / 20.;
735 if (xx[12] == xx[13]) {
738 r1 = yy[12] - yy[13];
739 r2 = xx[12] - xx[13];
740 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
742 aphi = (pphi + (i-1) * 36.) * degrad;
743 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
744 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
745 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
746 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
747 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
748 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
750 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
751 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
752 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
754 // --- Place an element of layer #1
756 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
757 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
758 coeffa = biga * biga + 1.;
759 coeffb = biga * bigb - biga * ycc - xcc;
760 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
761 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
762 ycc1 = biga * xcc1 + bigb;
764 bigb1 = xcc1 / biga + ycc1;
765 coeffa = biga1 * biga1 + 1.;
766 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
767 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
768 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
769 ycc2 = biga1 * xcc2 + bigb1;
770 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
771 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
772 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
773 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
776 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
778 // --- Place part # 12-13 (see sketch)
782 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
784 xcc = (xx[11] + xx[12]) / 20.;
785 ycc = (yy[11] + yy[12]) / 20.;
786 xccc = (xbeg[11] + xend[11]) / 20.;
787 yccc = (ybeg[11] + yend[11]) / 20.;
788 if (xx[11] == xx[12]) {
791 r1 = yy[12] - yy[11];
792 r2 = xx[12] - xx[11];
793 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
795 aphi = (pphi + (i-1) * 36.) * degrad;
796 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
797 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
798 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
799 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
800 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
801 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
803 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
804 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
805 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
807 // --- Place part # 11-12 (see sketch)
811 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
813 xcc = (xx[10] + xx[11]) / 20.;
814 ycc = (yy[10] + yy[11]) / 20.;
815 xccc = (xbeg[10] + xend[10]) / 20.;
816 yccc = (ybeg[10] + yend[10]) / 20.;
817 if (xx[10] == xx[11]) {
820 r1 = yy[11] - yy[10];
821 r2 = xx[11] - xx[10];
822 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
824 aphi = (pphi + (i-1) * 36.) * degrad;
825 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
826 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
827 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
828 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
829 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
830 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
832 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
833 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
834 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
836 // --- Place an element of layer #1
838 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
839 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
840 coeffa = biga * biga + 1.;
841 coeffb = biga * bigb - biga * ycc - xcc;
842 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
843 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
844 ycc1 = biga * xcc1 + bigb;
846 bigb1 = xcc1 / biga + ycc1;
847 coeffa = biga1 * biga1 + 1.;
848 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
849 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
850 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
851 ycc2 = biga1 * xcc2 + bigb1;
852 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
853 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
854 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
855 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
858 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
860 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
862 darc[0] = rarc[12] / 10. - .02;
863 darc[1] = rarc[12] / 10.;
865 darc[3] = atheta12 - (i-1) * 36.;
866 darc[4] = atheta23 - (i-1) * 36.;
867 xcc = xarc[12] / 10.;
868 ycc = yarc[12] / 10.;
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 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
873 ypos1 = xcc * TMath::Sin(aphi) + ycc * 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 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
879 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
881 darc[0] = rarc[11] / 10. - .02;
882 darc[1] = rarc[11] / 10.;
884 darc[3] = atheta23 + 90. - (i-1) * 36.;
885 darc[4] = atheta34 + 90. - (i-1) * 36.;
886 xcc = xarc[11] / 10.;
887 ycc = yarc[11] / 10.;
888 aphi = (pphi + (i-1) * 36.) * degrad;
889 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
890 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
891 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
892 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
893 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
894 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
896 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
898 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
900 darc[0] = rarc[10] / 10. - .02;
901 darc[1] = rarc[10] / 10.;
903 darc[3] = atheta45 + 180. - (i-1) * 36.;
904 darc[4] = atheta34 + 180. - (i-1) * 36.;
905 xcc = xarc[10] / 10.;
906 ycc = yarc[10] / 10.;
907 aphi = (pphi + (i-1) * 36.) * degrad;
908 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
909 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
910 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
911 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
912 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
913 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
915 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
917 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
919 darc[0] = rarc[9] / 10. - .02;
920 darc[1] = rarc[9] / 10.;
922 darc[3] = atheta45 - 90. - (i-1) * 36.;
923 darc[4] = atheta56 - 90. - (i-1) * 36.;
926 aphi = (pphi + (i-1) * 36.) * degrad;
927 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
928 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
929 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
930 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
931 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
932 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
934 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
936 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
938 darc[0] = rarc[8] / 10. - .02;
939 darc[1] = rarc[8] / 10.;
941 darc[3] = atheta67 + 45. - (i-1) * 36.;
942 darc[4] = atheta56 + 45. - (i-1) * 36.;
945 aphi = (pphi + (i-1) * 36.) * degrad;
946 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
947 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
948 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
949 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
950 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
951 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
953 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
955 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
957 darc[0] = rarc[7] / 10. - .02;
958 darc[1] = rarc[7] / 10.;
960 darc[3] = atheta67 - (i-1) * 36.;
961 darc[4] = atheta78 - (i-1) * 36.;
964 aphi = (pphi + (i-1) * 36.) * degrad;
965 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
966 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
967 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
968 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
969 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
970 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
972 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
974 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
976 darc[0] = rarc[6] / 10. - .02;
977 darc[1] = rarc[6] / 10.;
979 darc[3] = atheta89 + 45. - (i-1) * 36.;
980 darc[4] = atheta78 + 45. - (i-1) * 36.;
983 aphi = (pphi + (i-1) * 36.) * degrad;
984 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
985 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
986 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
987 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
988 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
989 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
991 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
993 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
995 darc[0] = rarc[5] / 10. - .02;
996 darc[1] = rarc[5] / 10.;
998 darc[3] = atheta89 + 45. - (i-1) * 36.;
999 darc[4] = atheta910 + 45. - (i-1) * 36.;
1000 xcc = xarc[5] / 10.;
1001 ycc = yarc[5] / 10.;
1002 aphi = (pphi + (i-1) * 36.) * degrad;
1003 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1004 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1005 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1006 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1007 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1008 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1010 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1012 // --- Place arc # 5 (between part 9-10 and part 10-11)
1015 darc[0] = rarc[4] / 10. - .02;
1016 darc[1] = rarc[4] / 10.;
1018 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1019 darc[4] = atheta910 + 45. - (i-1) * 36.;
1020 xcc = xarc[4] / 10.;
1021 ycc = yarc[4] / 10.;
1022 aphi = (pphi + (i-1) * 36.) * degrad;
1023 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1024 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1025 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1026 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1027 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1028 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1030 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1032 // --- Place arc # 4 (between part 10-11 and part 11-12)
1035 darc[0] = rarc[3] / 10. - .02;
1036 darc[1] = rarc[3] / 10.;
1038 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1039 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1040 xcc = xarc[3] / 10.;
1041 ycc = yarc[3] / 10.;
1042 aphi = (pphi + (i-1) * 36.) * degrad;
1043 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1044 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1045 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1046 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1047 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1048 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1050 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1052 // --- Place arc # 3 (between part 11-12 and part 12-13)
1055 darc[0] = rarc[2] / 10. - .02;
1056 darc[1] = rarc[2] / 10.;
1058 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1059 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1060 xcc = xarc[2] / 10.;
1061 ycc = yarc[2] / 10.;
1062 aphi = (pphi + (i-1) * 36.) * degrad;
1063 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1064 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1065 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1066 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1067 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1068 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1070 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1072 // --- Place arc # 2 (between part 12-13 and part 13-14)
1075 darc[0] = rarc[1] / 10. - .02;
1076 darc[1] = rarc[1] / 10.;
1078 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1079 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1080 xcc = xarc[1] / 10.;
1081 ycc = yarc[1] / 10.;
1082 aphi = (pphi + (i-1) * 36.) * degrad;
1083 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1084 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1085 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1086 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1087 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1088 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1090 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1092 // --- Place arc # 1 (between part 13-14 and part 1-2)
1095 darc[0] = rarc[0] / 10. - .02;
1096 darc[1] = rarc[0] / 10.;
1098 darc[3] = atheta12 + 45. - (i-1) * 36.;
1099 darc[4] = atheta1314 - (i-1) * 36.;
1100 xcc = xarc[0] / 10.;
1101 ycc = yarc[0] / 10.;
1102 aphi = (pphi + (i-1) * 36.) * degrad;
1103 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1104 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1105 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1106 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1107 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1108 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1110 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1113 //************************************************************************
1118 //************************************************************************
1120 // --- Define a ghost volume containing the Silicon Drift Detectors
1121 // (layer #3 and #4) and fill it with air or vacuum
1123 xxm = (49.999-3.)/(70.-25.);
1127 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1130 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1133 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1136 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1139 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1141 // --- Place the ghost volume in its mother volume (ITSV) and make it
1144 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1145 gMC->Gsatt("IT34", "SEEN", 0);
1149 // GOTO 3456 ! skip ITS layer no. 3
1151 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1152 // smaller lenght of ribs) and fill it with air or vacuum
1154 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1156 // the widest element is the sensitive element
1157 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1158 // 7.5 cm is the lenght
1159 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1161 // --- Make the ghost volume invisible
1163 gMC->Gsatt("IDV1", "SEEN", 0);
1165 // --- Define a volume containing the sensitive part of drifts
1166 // (silicon, layer #3)
1169 // see material budget report by G. Feofilov
1172 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1174 //--- Define the part of the (smaller) rib between two sensitive parts made of
1175 // carbon (layer #3)
1177 dsup[0] = .5 - dits[0];
1179 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1180 // 7.5 cm is the lenght
1181 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1183 //--- Define the first part of the (smaller) rib between two sensitive parts
1184 // made of aluminum (layer #3)
1186 dal1[0] = .5 - dits[0];
1187 dal1[1] = 0.00096/2.;
1188 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1189 // 7.5 cm is the lenght
1190 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1192 //--- Define the part of the (smaller) rib between two sensitive parts made of
1193 // kapton (layer #3)
1195 dkap[0] = .5 - dits[0];
1197 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1198 // 7.5 cm is the lenght
1199 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1201 //--- Define the second part of the (smaller) rib between two sensitive parts
1202 // made of aluminum (layer #3)
1204 dal2[0] = .5 - dits[0];
1205 dal2[1] = 0.0027/2.;
1206 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1207 // 7.5 cm is the lenght
1208 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1210 // --- Define the part of the (smaller) rib between two sensitive parts
1211 // made of silicon (the electronics) (layer #3)
1213 dchi[0] = .5 - dits[0];
1214 dchi[1] = 0.0071/2.;
1215 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1216 // 7.5 cm is the lenght
1217 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1219 // --- Define the part of the (smaller) rib between two sensitive parts
1220 // made of water (the cooler) (layer #3)
1222 dwat[0] = .5 - dits[0];
1223 dwat[1] = 0.0093/2.;
1224 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1225 // 7.5 cm is the lenght
1226 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1228 //--- Define the third part of the (smaller) rib between two sensitive parts
1229 // made of aluminum (the cooling tubes) (layer #3)
1231 dtub[0] = .5 - dits[0];
1232 dtub[1] = 0.00134/2.;
1233 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1234 // 7.5 cm is the lenght
1235 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1237 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1240 // twice the foreseen thickness
1243 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1245 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1248 // twice the foreseen thickness
1251 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1253 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1256 // twice the foreseen thickness
1259 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1261 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1264 // twice the foreseen thickness
1267 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1269 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1273 for (j = 1; j <= 5; ++j) {
1274 // odd elements are up and even elements are down
1276 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1277 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1278 } else if (j == 2) {
1279 xpos = -dbox1[0] + dits[0];
1280 zpos = 0. - dits[2] + 1. - dits[2];
1281 } else if (j == 3) {
1282 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1284 } else if (j == 4) {
1285 xpos = -dbox1[0] + dits[0];
1286 zpos = dits[2] + 0. - 1. + dits[2];
1287 } else if (j == 5) {
1288 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1289 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1291 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1294 // --- Place the smaller ribs into their mother (IDV1)
1296 // --- Right ribs (just a matter of convention)
1298 xpos = .5 - dbox1[0] + dits[0];
1304 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1308 ypos = dsup[1] + 2.81 + dal1[1];
1309 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1313 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1314 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1318 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1319 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1321 // --- Silicon (chip)
1323 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1324 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1328 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1329 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1333 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1335 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1337 // --- Right ribs (just a matter of convention)
1342 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1346 ypos = -(dsup[1] + 2.81 + dal1[1]);
1347 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1351 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1352 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1356 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1357 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1359 // --- Silicon (chip)
1361 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1362 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1366 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1367 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1371 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1372 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1373 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1375 // --- Place the end-ladder stuff into its mother (IDV1)
1378 // --- Negative-Z end-ladder
1381 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1385 xpos = dbox1[0] - dpcb[0];
1386 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1390 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1391 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1395 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1396 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1398 // --- Silicon (bus)
1400 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1401 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1403 // --- Positive-Z end-ladder
1406 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1410 xpos = dbox1[0] - dpcb[0];
1411 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1415 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1416 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1420 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1421 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1423 // --- Silicon (bus)
1425 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1426 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1428 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1429 // larger lenght of ribs) and fill it with air or vacuum
1431 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1433 // the widest element is the sensitive element
1434 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1435 // 7.5 cm is the lenght
1436 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1438 // --- Make the ghost volume invisible
1440 gMC->Gsatt("IDV2", "SEEN", 0);
1442 //--- Define the part of the (larger) rib between two sensitive parts madeof
1443 // carbon (layer #3)
1445 dsup[0] = .65 - dits[0];
1447 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1448 // 7.5 cm is the lenght
1449 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1451 //--- Define the first part of the (larger) rib between two sensitive parts
1452 // made of aluminum (layer #3)
1454 dal1[0] = .65 - dits[0];
1455 dal1[1] = 0.00096/2.;
1456 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1457 // 7.5 cm is the lenght
1458 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1460 //--- Define the part of the (larger) rib between two sensitive parts madeof
1461 // kapton (layer #3)
1463 dkap[0] = .65 - dits[0];
1464 dkap[1] = 0.0317/2.;
1465 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1466 // 7.5 cm is the lenght
1467 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1469 //--- Define the second part of the (larger) rib between two sensitive parts
1470 // made of aluminum (layer #3)
1472 dal2[0] = .65 - dits[0];
1473 dal2[1] = 0.0027/2.;
1474 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1475 // 7.5 cm is the lenght
1476 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1478 // --- Define the part of the (larger) rib between two sensitive parts
1479 // made of silicon (the electronics) (layer #3)
1481 dchi[0] = .65 - dits[0];
1482 dchi[1] = 0.0071/2.;
1483 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1484 // 7.5 cm is the lenght
1485 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1487 // --- Define the part of the (larger) rib between two sensitive parts
1488 // made of water (the cooler) (layer #3)
1490 dwat[0] = .65 - dits[0];
1491 dwat[1] = 0.0093/2.;
1492 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1493 // 7.5 cm is the lenght
1494 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1496 //--- Define the third part of the (larger) rib between two sensitive parts
1497 // made of aluminum (the cooling tubes) (layer #3)
1499 dtub[0] = .65 - dits[0];
1500 dtub[1] = 0.00134/2.;
1501 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1502 // 7.5 cm is the lenght
1503 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1505 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1509 for (j = 1; j <= 5; ++j) {
1510 // odd element are up and even elements are down
1512 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1513 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1514 } else if (j == 2) {
1515 xpos = -dbox2[0] + dits[0];
1516 zpos = 0. - dits[2] + 1. - dits[2];
1517 } else if (j == 3) {
1518 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1520 } else if (j == 4) {
1521 xpos = -dbox2[0] + dits[0];
1522 zpos = dits[2] + 0. - 1. + dits[2];
1523 } else if (j == 5) {
1524 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1525 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1527 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1530 // --- Place the larger ribs into their mother (IDV2)
1533 // --- Right ribs (just a matter of convention)
1535 xpos = .65 - dbox2[0] + dits[0];
1541 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1545 ypos = dsup[1] + 2.81 + dal1[1];
1546 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1550 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1551 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1555 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1556 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1558 // --- Silicon (chip)
1560 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1561 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1565 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1566 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1570 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1571 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1573 // --- Right ribs (just a matter of convention)
1578 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1582 ypos = -(dsup[1] + 2.81 + dal1[1]);
1583 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1587 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1588 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1592 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1593 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1595 // --- Silicon (chip)
1597 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1598 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1602 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1603 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1607 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1608 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1610 // --- Place the end-ladder stuff into its mother (IDV1)
1613 // --- Negative-Z end-ladder
1616 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1620 xpos = dbox2[0] - dpcb[0];
1621 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1625 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1626 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1630 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1631 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1633 // --- Silicon (bus)
1635 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1636 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1638 // --- Positive-Z end-ladder
1641 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1645 xpos = dbox2[0] - dpcb[0];
1646 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1650 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1651 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1655 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1656 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1658 // --- Silicon (bus)
1660 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1661 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1663 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1664 // mother volume (IT34)
1665 // Odd elements have large ribs and even elements have small ribs
1667 for (i = 1; i <= 12; ++i) {
1668 atheta = (i-1) * 30.;
1669 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1672 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1673 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1675 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1678 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1679 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1681 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1688 // GOTO 4567 ! skip ITS layer no. 4
1690 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1691 // smaller lenght of ribs) and fill it with air or vacuum
1693 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1695 // the widest element is the end-ladder stuff
1696 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1697 // 7.5 cm is the lenght
1698 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1700 // --- Make the ghost volume invisible
1702 gMC->Gsatt("IDV3", "SEEN", 0);
1704 // --- Define a volume containing the sensitive part of drifts
1705 // (silicon, layer #4)
1708 // see material budget report by G. Feofilov
1711 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1713 //--- Define the part of the (smaller) rib between two sensitive parts made of
1714 // carbon (layer #4)
1716 dsup[0] = .5 - dits[0];
1718 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1719 // 7.5 cm is the lengh
1720 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1722 //--- Define the first part of the (smaller) rib between two sensitive parts
1723 // made of aluminum (layer #4)
1725 dal1[0] = .5 - dits[0];
1726 dal1[1] = 0.00096/2.;
1727 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1728 // 7.5 cm is the lengh
1729 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1731 //--- Define the part of the (smaller) rib between two sensitive parts made of
1732 // kapton (layer #4)
1734 dkap[0] = .5 - dits[0];
1735 dkap[1] = 0.0317/2.;
1736 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1737 // 7.5 cm is the lengh
1738 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1740 //--- Define the second part of the (smaller) rib between two sensitive parts
1741 // made of aluminum (layer #4)
1743 dal2[0] = .5 - dits[0];
1744 dal2[1] = 0.0027/2.;
1745 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1746 // 7.5 cm is the lengh
1747 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1749 // --- Define the part of the (smaller) rib between two sensitive parts
1750 // made of silicon (the electronics) (layer #4)
1752 dchi[0] = .5 - dits[0];
1753 dchi[1] = 0.0071/2.;
1754 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1755 // 7.5 cm is the lengh
1756 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1758 // --- Define the part of the (smaller) rib between two sensitive parts
1759 // made of water (the cooler) (layer #4)
1761 dwat[0] = .5 - dits[0];
1762 dwat[1] = 0.0093/2.;
1763 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1764 // 7.5 cm is the lenght
1765 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1767 //--- Define the third part of the (smaller) rib between two sensitive parts
1768 // made of aluminum (the cooling tubes) (layer #4)
1770 dtub[0] = .5 - dits[0];
1771 dtub[1] = 0.00134/2.;
1772 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1773 // 7.5 cm is the lengh
1774 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1776 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1779 // twice the foreseen thickness
1782 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1784 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1787 // twice the foreseen thickness
1790 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1792 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1795 // twice the foreseen thickness
1798 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1800 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1803 // twice the foreseen thickness
1806 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1808 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1812 for (j = 1; j <= 7; ++j) {
1813 // odd elements are down and even elements are up
1815 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1816 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1817 } else if (j == 2) {
1818 xpos = -dbox1[0] + dits[0];
1819 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1820 } else if (j == 3) {
1821 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1822 zpos = 0. - dits[2] + .7 - dits[2];
1823 } else if (j == 4) {
1824 xpos = -dbox1[0] + dits[0];
1826 } else if (j == 5) {
1827 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1828 zpos = dits[2] + 0. - .7 + dits[2];
1829 } else if (j == 6) {
1830 xpos = -dbox1[0] + dits[0];
1831 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1832 } else if (j == 7) {
1833 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1834 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1836 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1839 // --- Place the smaller ribs into their mother (IDV3)
1841 // --- Right ribs (just a matter of convention)
1843 xpos = .5 - dbox1[0] + dits[0];
1849 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1853 ypos = dsup[1] + 2.81 + dal1[1];
1854 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1858 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1859 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1863 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1864 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1866 // --- Silicon (chip)
1868 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1869 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1873 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1874 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1878 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1880 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1882 // --- Right ribs (just a matter of convention)
1887 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1891 ypos = -(dsup[1] + 2.81 + dal1[1]);
1892 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1896 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1897 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1901 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1903 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1905 // --- Silicon (chip)
1907 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1908 2. + dal2[1] * 2. + dchi[1]);
1909 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1913 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1914 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1915 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1919 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1920 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
1922 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1924 // --- Place the end-ladder stuff into its mother (IDV1)
1927 // --- Negative-Z end-ladder
1930 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
1934 xpos = dbox1[0] - dpcb[0];
1935 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1939 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1940 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1944 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1945 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1947 // --- Silicon (bus)
1949 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1950 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1952 // --- Positive-Z end-ladder
1955 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
1959 xpos = dbox1[0] - dpcb[0];
1960 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1964 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1965 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1969 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1970 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1972 // --- Silicon (bus)
1974 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1975 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1977 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1978 // larger lenght of ribs) and fill it with air or vacuum
1980 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1982 // the widest element is the end-ladder stuff
1983 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1984 // 7.5 cm is the lenght
1985 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
1987 // --- Make the ghost volume invisible
1989 gMC->Gsatt("IDV4", "SEEN", 0);
1991 //--- Define the part of the (larger) rib between two sensitive parts madeof
1992 // carbon (layer #4)
1994 dsup[0] = .65 - dits[0];
1996 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1997 // 7.5 cm is the lengh
1998 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2000 //--- Define the first part of the (larger) rib between two sensitive parts
2001 // made of aluminum (layer #4)
2003 dal1[0] = .65 - dits[0];
2004 dal1[1] = 0.00096/2.;
2005 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2006 // 7.5 cm is the lengh
2007 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2009 //--- Define the part of the (larger) rib between two sensitive parts madeof
2010 // kapton (layer #4)
2012 dkap[0] = .65 - dits[0];
2013 dkap[1] = 0.0317/2.;
2014 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2015 // 7.5 cm is the lengh
2016 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2018 //--- Define the second part of the (larger) rib between two sensitive parts
2019 // made of aluminum (layer #4)
2021 dal2[0] = .65 - dits[0];
2022 dal2[1] = 0.0027/2.;
2023 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2024 // 7.5 cm is the lengh
2025 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2027 // --- Define the part of the (larger) rib between two sensitive parts
2028 // made of silicon (the electronics) (layer #4)
2030 dchi[0] = .65 - dits[0];
2031 dchi[1] = 0.0071/2.;
2032 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2033 // 7.5 cm is the lengh
2034 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2036 // --- Define the part of the (larger) rib between two sensitive parts
2037 // made of water (the cooler) (layer #4)
2039 dwat[0] = .65 - dits[0];
2040 dwat[1] = 0.0093/2.;
2041 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2042 // 7.5 cm is the lengh
2043 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2045 //--- Define the third part of the (larger) rib between two sensitive parts
2046 // made of aluminum (the cooling tubes) (layer #4)
2048 dtub[0] = .65 - dits[0];
2049 dtub[1] = 0.00134/2.;
2050 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2051 // 7.5 cm is the lengh
2052 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2054 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2058 for (j = 1; j <= 7; ++j) {
2059 // odd elements are down and even elements are up
2061 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2062 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2063 } else if (j == 2) {
2064 xpos = -dbox2[0] + dits[0];
2065 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2066 } else if (j == 3) {
2067 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2068 zpos = 0. - dits[2] + .7 - dits[2];
2069 } else if (j == 4) {
2070 xpos = -dbox2[0] + dits[0];
2072 } else if (j == 5) {
2073 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2074 zpos = dits[2] + 0. - .7 + dits[2];
2075 } else if (j == 6) {
2076 xpos = -dbox2[0] + dits[0];
2077 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2078 } else if (j == 7) {
2079 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2080 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2082 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2085 // --- Place the larger ribs into their mother (IDV4)
2088 // --- Right ribs (just a matter of convention)
2090 xpos = .65 - dbox2[0] + dits[0];
2096 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2100 ypos = dsup[1] + 2.81 + dal1[1];
2101 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2105 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2106 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2110 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2111 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2113 // --- Silicon (chip)
2115 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2116 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2120 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2121 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2125 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2127 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2129 // --- Right ribs (just a matter of convention)
2134 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2138 ypos = -(dsup[1] + 2.81 + dal1[1]);
2139 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2143 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2144 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2148 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2150 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2152 // --- Silicon (chip)
2154 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2155 2. + dal2[1] * 2. + dchi[1]);
2156 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2160 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2161 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2162 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2166 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2167 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2168 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2170 // --- Place the end-ladder stuff into its mother (IDV1)
2173 // --- Negative-Z end-ladder
2176 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2180 xpos = dbox2[0] - dpcb[0];
2181 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2185 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2186 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2190 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2191 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2193 // --- Silicon (bus)
2195 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2196 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2198 // --- Positive-Z end-ladder
2201 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2205 xpos = dbox2[0] - dpcb[0];
2206 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2210 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2211 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2215 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2216 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2218 // --- Silicon (bus)
2220 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2221 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2223 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2224 // mother volume (IT34)
2225 // Odd elements have large ribs and even elements have small ribs
2227 for (i = 1; i <= 24; ++i) {
2228 atheta = (i-1) * 15.;
2229 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2232 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2233 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2235 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2237 rzero = (24.0+22.8)/2.;
2238 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2239 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2241 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2245 //************************************************************************
2250 //************************************************************************
2252 // --- Define SSD with the 35+39 lay-out
2254 if (fMinorVersion < 3) {
2256 //--- Define ghost volume containing the Strip Detectors and fill it with air
2259 xxm = (49.999-3.)/(70.-25.);
2263 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2264 (37.-27)/xxm-(49.998-37.)/xxm;
2267 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2271 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2275 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2276 (37.-27)/xxm+(49.998-37.)/xxm;
2279 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2280 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2281 gMC->Gsatt("IT56", "SEEN", 0);
2285 // GOTO 5678 ! skip ITS layer no. 5
2287 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2288 // it with air or vacuum
2290 dbox1[0] = (0.0600+2.*0.0150)/2.;
2292 dbox1[2] = 90.22/2.;
2293 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2295 // --- Make the ghost volume invisible
2297 gMC->Gsatt("ISV1", "SEEN", 0);
2299 // --- Define a ghost volume containing the electronics and cooling of
2300 // a single ladder of layer #5 and fill it with air or vacuum
2302 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2305 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2307 // --- Make the ghost volume invisible
2309 gMC->Gsatt("SSV1", "SEEN", 0);
2311 // --- Define a ghost volume containing the end-ladder stuff of
2312 // a single ladder of layer #5 and fill it with air or vacuum
2317 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2319 // --- Make the ghost volume invisible
2321 gMC->Gsatt("ELL5", "SEEN", 0);
2323 // --- Define a volume containing the sensitive part of the strips
2324 // (silicon, layer #5)
2329 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2331 // --- Define a volume containing the electronics of the strips
2332 // (silicon, layer #5)
2337 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2339 // --- Define the cooling tubes (aluminum, layer #5)
2342 dtub[1] = dtub[0] + .01;
2344 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2346 // --- Define the cooling fluid (water or freon, layer #5)
2351 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2352 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2354 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2362 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2363 dfra[6] = dfra[5] + .03;
2367 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2369 // --- Define the element connecting the triangles of the heat bridge
2370 // (carbon, layer #5)
2375 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2377 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2380 dpla[0] = (10./(8.*7.))/2.;
2383 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2385 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2387 dcop[0] = (2./(8.*7.))/2.;
2390 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2392 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2394 depx[0] = (30./(8.*7.))/2.;
2397 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2399 // --- Define the part of the end-ladder stuff made of silicon (bus)
2402 dsil[0] = (20./(8.*7.))/2.;
2405 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2407 // --- Place the end-ladder stuff into its mother (ELL5)
2409 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2415 xpos = -dela[0] + dpla[0];
2416 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2420 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2421 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2425 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2426 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2428 // --- Silicon (bus)
2430 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2431 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2433 // --- Place the sensitive part of the strips into its mother (ISV1)
2436 for (j = 1; j <= 23; ++j) {
2437 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2438 else xpos = -dbox1[0] + dits[0];
2439 zpos = ((j - 1) - 11.) * 3.91;
2440 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2443 // --- Place the electronics of the strips into its mother (SSV1)
2446 for (j = 1; j <= 23; ++j) {
2447 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2448 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2449 zpos = ((j - 1) - 11.) * 3.91 + .85;
2450 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2453 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2455 xpos = -dsrv[0] + .41;
2458 // --- Left tube (just a matter of convention)
2461 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2462 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2464 // --- Right tube (just a matter of convention)
2467 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2468 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2470 // --- Place the heat bridge elements into their mother (SSV1)
2472 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2474 for (j = 1; j <= 24; ++j) {
2475 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2476 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2479 // --- Place the elements connecting the triangles of the heat bridge
2480 // into their mother (SSV1)
2484 // --- Left element (just a matter of convention)
2486 xpos = -dsrv[0] + .47;
2487 ypos = -(2.1+0.015);
2488 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2490 // --- Right element
2492 xpos = -dsrv[0] + .47;
2494 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2498 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2500 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2502 // --- Place the ghost volumes containing the strip ladders (ISV1),
2503 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2504 // their mother volume (IT56)
2506 offset1 = TMath::ATan2(.9, 40.);
2508 rzero = dbox1[0] + 40.;
2509 runo = dbox1[0] * 2. + 40. + dsrv[0];
2510 rtwo = dbox1[0] * 2. + 40. + dela[0];
2511 for (i = 1; i <= 35; ++i) {
2512 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2513 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2515 // --- Strip ladders
2517 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2518 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2520 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2522 // --- Electronics/cooling
2524 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2525 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2527 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2529 // --- End-ladders (nagative-Z and positive-Z)
2531 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2532 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2533 zpos = -(dbox1[2] + dela[2] + 6.);
2534 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2535 zpos = dbox1[2] + dela[2] + 6.;
2536 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2542 // GOTO 5778 ! skip ITS layer no. 6
2544 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2545 // it with air or vacuum
2547 dbox2[0] = (0.0600+2.*0.0150)/2.;
2549 dbox2[2] = 101.95/2.;
2550 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2552 // --- Make the ghost volume invisible
2554 gMC->Gsatt("ISV2", "SEEN", 0);
2556 // --- Define a ghost volume containing the electronics and cooling of
2557 // a single ladder of layer #6 and fill it with air or vacuum
2559 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2561 dsrv[2] = 101.95/2.;
2562 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2564 // --- Make the ghost volume invisible
2566 gMC->Gsatt("SSV2", "SEEN", 0);
2568 // --- Define a ghost volume containing the end-ladder stuff of
2569 // a single ladder of layer #6 and fill it with air or vacuum
2574 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2576 // --- Make the ghost volume invisible
2578 gMC->Gsatt("ELL6", "SEEN", 0);
2580 // --- Define a volume containing the sensitive part of the strips
2581 // (silicon, layer #6)
2586 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2588 // --- Define a volume containing the electronics of the strips
2589 // (silicon, layer #6)
2594 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2596 // --- Define the cooling tubes (aluminum, layer #6)
2599 dtub[1] = dtub[0] + .01;
2600 dtub[2] = 101.95/2.;
2601 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2603 // --- Define the cooling fluid (water or freon, layer #6)
2607 dwat[2] = 101.95/2.;
2608 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2609 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2611 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2619 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2620 dfra[6] = dfra[5] + .03;
2624 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2626 // --- Define the element connecting the triangles of the heat bridge
2627 // (carbon, layer #6)
2631 dcei[2] = 101.95/2.;
2632 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2634 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2637 dpla[0] = (10./(8.*7.))/2.;
2640 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2642 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2644 dcop[0] = (2./(8.*7.))/2.;
2647 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2649 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2651 depx[0] = (30./(8.*7.))/2.;
2654 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2656 // --- Define the part of the end-ladder stuff made of silicon (bus)
2659 dsil[0] = (20./(8.*7.))/2.;
2662 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2664 // --- Place the end-ladder stuff into its mother (ELL5)
2666 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2672 xpos = -dela[0] + dpla[0];
2673 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2677 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2678 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2682 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2683 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2685 // --- Silicon (bus)
2687 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2688 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2690 // --- Place the sensitive part of the strips into its mother (ISV2)
2693 for (j = 1; j <= 26; ++j) {
2694 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2695 else xpos = -dbox2[0] + dits[0];
2696 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2697 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2700 // --- Place the electronics of the strips into its mother (SSV2)
2703 for (j = 1; j <= 26; ++j) {
2704 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2705 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2706 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2707 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2710 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2712 xpos = -dsrv[0] + .41;
2715 // --- Left tube (just a matter of convention)
2718 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2719 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2721 // --- Right tube (just a matter of convention)
2724 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2725 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2727 // --- Place the heat bridge elements into their mother (SSV2)
2729 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2731 for (j = 1; j <= 27; ++j) {
2732 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2733 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2736 // --- Place the elements connecting the triangles of the heat bridge
2737 // into their mother (SSV2)
2741 // --- Left element (just a matter of convention)
2743 xpos = -dsrv[0] + .47;
2744 ypos = -(2.1+0.015);
2745 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2747 // --- Right element
2749 xpos = -dsrv[0] + .47;
2751 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2755 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2757 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2759 // --- Place the ghost volumes containing the strip ladders (ISV2),
2760 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2761 // their mother volume (IT56)
2763 offset1 = TMath::ATan2(1., 45.);
2765 rzero = dbox2[0] + 45.;
2766 runo = dbox2[0] * 2. + 45. + dsrv[0];
2767 rtwo = dbox2[0] * 2. + 45. + dela[0];
2768 for (i = 1; i <= 39; ++i) {
2769 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2770 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2772 // --- Strip ladders
2774 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2775 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2777 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2779 // --- Electronics/cooling
2781 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2782 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2784 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2786 // --- End-ladders (nagative-Z and positive-Z)
2788 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2789 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2790 zpos = -(dbox2[2] + dela[2] + 6.);
2791 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2792 zpos = dbox2[2] + dela[2] + 6.;
2793 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2798 // --- Define SSD with the 32+36 lay-out
2800 if (fMinorVersion >2 && fMinorVersion < 6) {
2802 //--- Define ghost volume containing the Strip Detectors and fill it with air
2805 xxm = (49.999-3.)/(70.-25.);
2809 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2810 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2813 dgh[6] = -25. - (9.-3.01) / xxm -
2814 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2817 dgh[9] = (9.-3.01) / xxm + 25. +
2818 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2821 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2822 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2825 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2826 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2827 gMC->Gsatt("IT56", "SEEN", 0);
2831 // GOTO 6678 ! skip ITS layer no. 5
2833 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2834 // it with air or vacuum
2836 dbox1[0] = (0.0600+2.*0.0150)/2.;
2838 dbox1[2] = 86.31/2.;
2839 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2841 // --- Make the ghost volume invisible
2843 gMC->Gsatt("ISV1", "SEEN", 0);
2845 // --- Define a ghost volume containing the electronics and cooling of
2846 // a single ladder of layer #5 and fill it with air or vacuum
2848 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2851 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2853 // --- Make the ghost volume invisible
2855 gMC->Gsatt("SSV1", "SEEN", 0);
2857 // --- Define a ghost volume containing the end-ladder stuff of
2858 // a single ladder of layer #5 and fill it with air or vacuum
2863 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2865 // --- Make the ghost volume invisible
2867 gMC->Gsatt("ELL5", "SEEN", 0);
2869 // --- Define a volume containing the sensitive part of the strips
2870 // (silicon, layer #5)
2875 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2877 // --- Define a volume containing the electronics of the strips
2878 // (silicon, layer #5)
2883 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2885 // --- Define the cooling tubes (aluminum, layer #5)
2888 dtub[1] = dtub[0] + .01;
2890 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2892 // --- Define the cooling fluid (water or freon, layer #5)
2897 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2898 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2900 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2908 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2909 dfra[6] = dfra[5] + .03;
2913 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2915 // --- Define the element connecting the triangles of the heat bridge
2916 // (carbon, layer #5)
2921 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2923 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2926 dpla[0] = (10./(8.*7.))/2;
2929 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2931 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2933 dcop[0] = (2./(8.*7.))/2;
2936 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2938 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2940 depx[0] = (30./(8.*7.))/2.;
2943 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2945 // --- Define the part of the end-ladder stuff made of silicon (bus)
2948 dsil[0] = (20./(8.*7.))/2.;
2951 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2953 // --- Place the end-ladder stuff into its mother (ELL5)
2955 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2961 xpos = -dela[0] + dpla[0];
2962 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2966 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2967 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2971 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2972 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2974 // --- Silicon (bus)
2976 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2977 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2979 // --- Place the sensitive part of the strips into its mother (ISV1)
2982 for (j = 1; j <= 22; ++j) {
2983 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2984 else xpos = -dbox1[0] + dits[0];
2985 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
2986 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2989 // --- Place the electronics of the strips into its mother (SSV1)
2992 for (j = 1; j <= 22; ++j) {
2993 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2994 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2995 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
2996 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2999 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3001 xpos = -dsrv[0] + .41;
3004 // --- Left tube (just a matter of convention)
3007 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3008 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3010 // --- Right tube (just a matter of convention)
3013 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3014 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3016 // --- Place the heat bridge elements into their mother (SSV1)
3018 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3020 for (j = 1; j <= 23; ++j) {
3021 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3022 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3025 // --- Place the elements connecting the triangles of the heat bridge
3026 // into their mother (SSV1)
3030 // --- Left element (just a matter of convention)
3032 xpos = -dsrv[0] + .47;
3033 ypos = -(2.1+0.015);
3034 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3036 // --- Right element
3038 xpos = -dsrv[0] + .47;
3040 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3044 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3046 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3048 // --- Place the ghost volumes containing the strip ladders (ISV1),
3049 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3050 // their mother volume (IT56)
3052 offset1 = TMath::ATan2(.8, 36.6);
3054 rzero = dbox1[0] + 36.6;
3055 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3056 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3057 for (i = 1; i <= 32; ++i) {
3058 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3059 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3061 // --- Strip ladders
3063 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3064 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3066 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3068 // --- Electronics/cooling
3070 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3071 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3073 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3075 // --- End-ladders (nagative-Z and positive-Z)
3077 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3078 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3079 zpos = -(dbox1[2] + dela[2] + 6.);
3080 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3081 zpos = dbox1[2] + dela[2] + 6.;
3082 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3088 // GOTO 6778 ! skip ITS layer no. 6
3090 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3091 // it with air or vacuum
3093 dbox2[0] = (0.0600+2.*0.0150)/2.;
3095 dbox2[2] = 94.13/2.;
3096 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3098 // --- Make the ghost volume invisible
3100 gMC->Gsatt("ISV2", "SEEN", 0);
3102 // --- Define a ghost volume containing the electronics and cooling of
3103 // a single ladder of layer #6 and fill it with air or vacuum
3105 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3108 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3110 // --- Make the ghost volume invisible
3112 gMC->Gsatt("SSV2", "SEEN", 0);
3114 // --- Define a ghost volume containing the end-ladder stuff of
3115 // a single ladder of layer #6 and fill it with air or vacuum
3120 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3122 // --- Make the ghost volume invisible
3124 gMC->Gsatt("ELL6", "SEEN", 0);
3126 // --- Define a volume containing the sensitive part of the strips
3127 // (silicon, layer #6)
3132 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3134 // --- Define a volume containing the electronics of the strips
3135 // (silicon, layer #6)
3140 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3142 // --- Define the cooling tubes (aluminum, layer #6)
3145 dtub[1] = dtub[0] + .01;
3147 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3149 // --- Define the cooling fluid (water or freon, layer #6)
3154 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3155 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3157 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3165 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3166 dfra[6] = dfra[5] + .03;
3170 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3172 // --- Define the element connecting the triangles of the heat bridge
3173 // (carbon, layer #6)
3178 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3180 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3183 dpla[0] = (10./(8.*7.))/2;
3186 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3188 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3190 dcop[0] = (2./(8.*7.))/2;
3193 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3195 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3197 depx[0] = (30./(8.*7.))/2.;
3200 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3202 // --- Define the part of the end-ladder stuff made of silicon (bus)
3205 dsil[0] = (20./(8.*7.))/2.;
3208 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3210 // --- Place the end-ladder stuff into its mother (ELL5)
3212 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3218 xpos = -dela[0] + dpla[0];
3219 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3223 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3224 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3228 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3229 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3231 // --- Silicon (bus)
3233 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3234 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3236 // --- Place the sensitive part of the strips into its mother (ISV2)
3239 for (j = 1; j <= 24; ++j) {
3240 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3241 else xpos = dbox2[0] - dits[0];
3242 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3243 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3246 // --- Place the electronics of the strips into its mother (SSV2)
3249 for (j = 1; j <= 24; ++j) {
3250 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3251 else xpos = -dsrv[0] + .28;
3252 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3253 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3256 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3258 xpos = -dsrv[0] + .41;
3261 // --- Left tube (just a matter of convention)
3264 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3265 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3267 // --- Right tube (just a matter of convention)
3270 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3271 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3273 // --- Place the heat bridge elements into their mother (SSV2)
3275 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3277 for (j = 1; j <= 25; ++j) {
3278 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3279 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3282 // --- Place the elements connecting the triangles of the heat bridge
3283 // into their mother (SSV2)
3287 // --- Left element (just a matter of convention)
3289 xpos = -dsrv[0] + .47;
3290 ypos = -(2.1+0.015);
3291 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3293 // --- Right element
3295 xpos = -dsrv[0] + .47;
3297 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3301 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3303 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3305 // --- Place the ghost volumes containing the strip ladders (ISV2),
3306 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3307 // their mother volume (IT56)
3309 offset1 = TMath::ATan2(.9, 41.2);
3311 rzero = dbox2[0] + 41.2;
3312 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3313 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3314 for (i = 1; i <= 36; ++i) {
3315 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3316 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3318 // --- Strip ladders
3320 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3321 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3323 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3325 // --- Electronics/cooling
3327 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3328 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3330 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3332 // --- End-ladders (nagative-Z and positive-Z)
3334 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3335 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3336 zpos = -(dbox2[2] + dela[2] + 6.);
3337 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3338 zpos = dbox2[2] + dela[2] + 6.;
3339 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3345 //************************************************************************
3347 //* E N D - C A P S A N D F R A M E S *
3348 //* ========================================= *
3350 //************************************************************************
3352 // --- Define a dummy cylinder for multiple scattering tests
3354 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3357 // DITS(2)=DITS(1)+0.1
3359 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3360 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3363 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3365 // GOTO 8901 ! skip outer wall
3367 if (fMinorVersion == 0 || fMinorVersion == 3) {
3370 dits[1] = dits[0] + .06926;
3371 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3373 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3374 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3379 // --- The frame between the end-caps (octagonal lay-out) ---
3381 // GOTO 9012 ! skip octagonal frame
3383 if (fMinorVersion == 1) {
3388 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3391 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3393 offset = angle / 2.;
3394 for (i = 0; i < 8; ++i) {
3395 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3396 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3398 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3399 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3403 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;
3404 aphi2 = 180. - aphi1;
3405 xpos = (xtra[0] + xtra[1]) / 2.;
3406 ypos = (ytra[0] + ytra[1]) / 2.;
3407 zpos = dtra[2] / 2.;
3408 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3411 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3412 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3413 zpos = -dtra[2] / 2.;
3414 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3417 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3418 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3421 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;
3422 aphi1 = 180. - aphi2;
3423 xpos = (xtra[1] + xtra[2]) / 2.;
3424 ypos = (ytra[1] + ytra[2]) / 2.;
3425 zpos = dtra[2] / 2.;
3426 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3429 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3430 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3431 zpos = -dtra[2] / 2.;
3432 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3435 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3436 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3439 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;
3440 aphi2 = 180. - aphi1;
3441 xpos = (xtra[2] + xtra[3]) / 2.;
3442 ypos = (ytra[2] + ytra[3]) / 2.;
3443 zpos = dtra[2] / 2.;
3444 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3447 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3448 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3449 zpos = -dtra[2] / 2.;
3450 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3453 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3454 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3457 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;
3458 aphi1 = 180. - aphi2;
3459 xpos = (xtra[3] + xtra[4]) / 2.;
3460 ypos = (ytra[3] + ytra[4]) / 2.;
3461 zpos = dtra[2] / 2.;
3462 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3465 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3466 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3467 zpos = -dtra[2] / 2.;
3468 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3471 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3472 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3475 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;
3476 aphi1 = 180. - aphi2;
3477 xpos = (xtra[4] + xtra[5]) / 2.;
3478 ypos = (ytra[4] + ytra[5]) / 2.;
3479 zpos = dtra[2] / 2.;
3480 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3483 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3484 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3485 zpos = -dtra[2] / 2.;
3486 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3489 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3490 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3493 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;
3494 aphi2 = 180. - aphi1;
3495 xpos = (xtra[5] + xtra[6]) / 2.;
3496 ypos = (ytra[5] + ytra[6]) / 2.;
3497 zpos = dtra[2] / 2.;
3498 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3501 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3502 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3503 zpos = -dtra[2] / 2.;
3504 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3507 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3508 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3511 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;
3512 aphi1 = 180. - aphi2;
3513 xpos = (xtra[6] + xtra[7]) / 2.;
3514 ypos = (ytra[6] + ytra[7]) / 2.;
3515 zpos = dtra[2] / 2.;
3516 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3519 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3520 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3521 zpos = -dtra[2] / 2.;
3522 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3525 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3526 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3529 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;
3530 aphi2 = 180. - aphi1;
3531 xpos = (xtra[7] + xtra[0]) / 2.;
3532 ypos = (ytra[7] + ytra[0]) / 2.;
3533 zpos = dtra[2] / 2.;
3534 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3537 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3538 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3539 zpos = -dtra[2] / 2.;
3540 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3543 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3544 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3547 } else if (fMinorVersion == 4) {
3553 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3556 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3558 offset = angle / 2.;
3559 for (i = 0; i < 8; ++i) {
3560 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3561 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3563 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3564 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3568 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;
3569 aphi2 = 180. - aphi1;
3570 xpos = (xtra[0] + xtra[1]) / 2.;
3571 ypos = (ytra[0] + ytra[1]) / 2.;
3572 zpos = dtra[2] / 2.;
3573 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3576 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3577 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3578 zpos = -dtra[2] / 2.;
3579 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3582 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3583 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3586 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;
3587 aphi1 = 180. - aphi2;
3588 xpos = (xtra[1] + xtra[2]) / 2.;
3589 ypos = (ytra[1] + ytra[2]) / 2.;
3590 zpos = dtra[2] / 2.;
3591 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3594 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3595 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3596 zpos = -dtra[2] / 2.;
3597 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3600 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3601 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3604 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;
3605 aphi2 = 180. - aphi1;
3606 xpos = (xtra[2] + xtra[3]) / 2.;
3607 ypos = (ytra[2] + ytra[3]) / 2.;
3608 zpos = dtra[2] / 2.;
3609 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3612 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3613 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3614 zpos = -dtra[2] / 2.;
3615 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3618 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3619 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3622 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;
3623 aphi1 = 180. - aphi2;
3624 xpos = (xtra[3] + xtra[4]) / 2.;
3625 ypos = (ytra[3] + ytra[4]) / 2.;
3626 zpos = dtra[2] / 2.;
3627 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3630 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3631 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3632 zpos = -dtra[2] / 2.;
3633 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3636 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3637 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3640 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;
3641 aphi1 = 180. - aphi2;
3642 xpos = (xtra[4] + xtra[5]) / 2.;
3643 ypos = (ytra[4] + ytra[5]) / 2.;
3644 zpos = dtra[2] / 2.;
3645 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3648 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3649 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3650 zpos = -dtra[2] / 2.;
3651 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3654 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3655 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3658 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;
3659 aphi2 = 180. - aphi1;
3660 xpos = (xtra[5] + xtra[6]) / 2.;
3661 ypos = (ytra[5] + ytra[6]) / 2.;
3662 zpos = dtra[2] / 2.;
3663 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3666 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3667 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3668 zpos = -dtra[2] / 2.;
3669 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3672 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3673 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3676 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;
3677 aphi1 = 180. - aphi2;
3678 xpos = (xtra[6] + xtra[7]) / 2.;
3679 ypos = (ytra[6] + ytra[7]) / 2.;
3680 zpos = dtra[2] / 2.;
3681 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3684 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3685 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3686 zpos = -dtra[2] / 2.;
3687 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3690 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3691 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3694 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;
3695 aphi2 = 180. - aphi1;
3696 xpos = (xtra[7] + xtra[0]) / 2.;
3697 ypos = (ytra[7] + ytra[0]) / 2.;
3698 zpos = dtra[2] / 2.;
3699 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3702 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3703 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3704 zpos = -dtra[2] / 2.;
3705 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3708 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3709 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3715 // --- The frame between the end-caps (hexagonal lay-out) ---
3717 // GOTO 9123 ! skip hexagonal frame
3719 if (fMinorVersion == 2) {
3724 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3730 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3732 offset = angle / 2.;
3733 for (i = 0; i < 6; ++i) {
3734 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3735 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3737 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3738 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3743 xpos = (xtra1[0] + xtra1[1]) / 2.;
3744 ypos = (ytra1[0] + ytra1[1]) / 2.;
3746 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3749 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3750 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3754 xpos = (xtra1[1] + xtra1[2]) / 2.;
3755 ypos = (ytra1[1] + ytra1[2]) / 2.;
3757 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3760 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3761 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3765 xpos = (xtra1[2] + xtra1[3]) / 2.;
3766 ypos = (ytra1[2] + ytra1[3]) / 2.;
3768 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3771 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3772 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3776 xpos = (xtra1[3] + xtra1[4]) / 2.;
3777 ypos = (ytra1[3] + ytra1[4]) / 2.;
3779 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3782 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3783 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3787 xpos = (xtra1[4] + xtra1[5]) / 2.;
3788 ypos = (ytra1[4] + ytra1[5]) / 2.;
3790 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3793 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3794 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3798 xpos = (xtra1[5] + xtra1[0]) / 2.;
3799 ypos = (ytra1[5] + ytra1[0]) / 2.;
3801 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3804 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3805 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3808 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3809 aphi1 = 180. - aphi2;
3810 xpos = (xtra1[0] + xtra1[1]) / 2.;
3811 ypos = (ytra1[0] + ytra1[1]) / 2.;
3812 zpos = dtra2[2] / 2.;
3813 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
3816 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3817 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3818 zpos = -dtra2[2] / 2.;
3819 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
3822 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3823 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3826 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3827 aphi2 = 180. - aphi1;
3828 xpos = (xtra1[1] + xtra1[2]) / 2.;
3829 ypos = (ytra1[1] + ytra1[2]) / 2.;
3830 zpos = dtra2[2] / 2.;
3831 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
3834 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3835 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3836 zpos = -dtra2[2] / 2.;
3837 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
3840 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3841 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3844 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3845 aphi1 = 180. - aphi2;
3846 xpos = (xtra1[2] + xtra1[3]) / 2.;
3847 ypos = (ytra1[2] + ytra1[3]) / 2.;
3848 zpos = dtra2[2] / 2.;
3849 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
3852 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3853 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3854 zpos = -dtra2[2] / 2.;
3855 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
3858 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3859 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3861 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
3862 - 50.*50.))) * raddeg;
3863 aphi2 = 180. - aphi1;
3864 xpos = (xtra1[2] + xtra1[3]) / 2.;
3865 ypos = (ytra1[2] + ytra1[3]) / 2.;
3866 zpos = dtra2[2] / 2.;
3867 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
3870 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3871 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
3872 zpos = -dtra2[2] / 2.;
3873 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
3876 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3877 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
3880 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3881 aphi1 = 180. - aphi2;
3882 xpos = (xtra1[3] + xtra1[4]) / 2.;
3883 ypos = (ytra1[3] + ytra1[4]) / 2.;
3884 zpos = dtra2[2] / 2.;
3885 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
3888 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3889 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
3890 zpos = -dtra2[2] / 2.;
3891 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
3894 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3895 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
3898 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3899 aphi2 = 180. - aphi1;
3900 xpos = (xtra1[4] + xtra1[5]) / 2.;
3901 ypos = (ytra1[4] + ytra1[5]) / 2.;
3902 zpos = dtra2[2] / 2.;
3903 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
3906 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3907 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
3908 zpos = -dtra2[2] / 2.;
3909 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
3912 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3913 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
3916 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3917 aphi1 = 180. - aphi2;
3918 xpos = (xtra1[5] + xtra1[0]) / 2.;
3919 ypos = (ytra1[5] + ytra1[0]) / 2.;
3920 zpos = dtra2[2] / 2.;
3921 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
3924 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3925 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
3926 zpos = -dtra2[2] / 2.;
3927 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
3930 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3931 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
3933 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3934 aphi2 = 180. - aphi1;
3935 xpos = (xtra1[5] + xtra1[0]) / 2.;
3936 ypos = (ytra1[5] + ytra1[0]) / 2.;
3937 zpos = dtra2[2] / 2.;
3938 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
3941 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3942 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
3943 zpos = -dtra2[2] / 2.;
3944 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
3947 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3948 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
3951 } else if (fMinorVersion == 5) {
3957 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3963 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3965 offset = angle / 2.;
3966 for (i = 0; i < 6; ++i) {
3967 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3968 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3970 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3971 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3976 xpos = (xtra1[0] + xtra1[1]) / 2.;
3977 ypos = (ytra1[0] + ytra1[1]) / 2.;
3979 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3982 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3983 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3987 xpos = (xtra1[1] + xtra1[2]) / 2.;
3988 ypos = (ytra1[1] + ytra1[2]) / 2.;
3990 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3993 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3994 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3998 xpos = (xtra1[2] + xtra1[3]) / 2.;
3999 ypos = (ytra1[2] + ytra1[3]) / 2.;
4001 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
4004 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4005 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4009 xpos = (xtra1[3] + xtra1[4]) / 2.;
4010 ypos = (ytra1[3] + ytra1[4]) / 2.;
4012 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
4015 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4016 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4020 xpos = (xtra1[4] + xtra1[5]) / 2.;
4021 ypos = (ytra1[4] + ytra1[5]) / 2.;
4023 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
4026 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4027 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4031 xpos = (xtra1[5] + xtra1[0]) / 2.;
4032 ypos = (ytra1[5] + ytra1[0]) / 2.;
4034 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
4037 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4038 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4041 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4042 aphi1 = 180. - aphi2;
4043 xpos = (xtra1[0] + xtra1[1]) / 2.;
4044 ypos = (ytra1[0] + ytra1[1]) / 2.;
4045 zpos = dtra2[2] / 2.;
4046 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4049 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4050 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4051 zpos = -dtra2[2] / 2.;
4052 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4055 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4056 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4059 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4060 aphi2 = 180. - aphi1;
4061 xpos = (xtra1[1] + xtra1[2]) / 2.;
4062 ypos = (ytra1[1] + ytra1[2]) / 2.;
4063 zpos = dtra2[2] / 2.;
4064 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4067 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4068 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4069 zpos = -dtra2[2] / 2.;
4070 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4073 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4074 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4077 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4078 aphi1 = 180. - aphi2;
4079 xpos = (xtra1[2] + xtra1[3]) / 2.;
4080 ypos = (ytra1[2] + ytra1[3]) / 2.;
4081 zpos = dtra2[2] / 2.;
4082 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4085 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4086 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4087 zpos = -dtra2[2] / 2.;
4088 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4091 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4092 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4094 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4095 aphi2 = 180. - aphi1;
4096 xpos = (xtra1[2] + xtra1[3]) / 2.;
4097 ypos = (ytra1[2] + ytra1[3]) / 2.;
4098 zpos = dtra2[2] / 2.;
4099 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4102 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4103 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4104 zpos = -dtra2[2] / 2.;
4105 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4108 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4109 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4112 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4113 aphi1 = 180. - aphi2;
4114 xpos = (xtra1[3] + xtra1[4]) / 2.;
4115 ypos = (ytra1[3] + ytra1[4]) / 2.;
4116 zpos = dtra2[2] / 2.;
4117 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4120 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4121 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4122 zpos = -dtra2[2] / 2.;
4123 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4126 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4127 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4130 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4131 aphi2 = 180. - aphi1;
4132 xpos = (xtra1[4] + xtra1[5]) / 2.;
4133 ypos = (ytra1[4] + ytra1[5]) / 2.;
4134 zpos = dtra2[2] / 2.;
4135 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4138 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4139 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4140 zpos = -dtra2[2] / 2.;
4141 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4144 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4145 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4148 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4149 aphi1 = 180. - aphi2;
4150 xpos = (xtra1[5] + xtra1[0]) / 2.;
4151 ypos = (ytra1[5] + ytra1[0]) / 2.;
4152 zpos = dtra2[2] / 2.;
4153 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4156 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4157 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4158 zpos = -dtra2[2] / 2.;
4159 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4162 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4163 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4165 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4166 aphi2 = 180. - aphi1;
4167 xpos = (xtra1[5] + xtra1[0]) / 2.;
4168 ypos = (ytra1[5] + ytra1[0]) / 2.;
4169 zpos = dtra2[2] / 2.;
4170 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4173 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4174 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4175 zpos = -dtra2[2] / 2.;
4176 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4179 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4180 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4186 // --- Define the end-caps
4188 // GOTO 9234 ! skip both end-caps
4190 // --- Define the Z>0 end-cap
4192 // GOTO 9345 ! skip the Z>0 end-cap
4197 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4198 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4201 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4202 // end-ladder electro
4203 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4204 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4206 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4208 // In the Simonetti's drawings 52. In the TP 50.
4212 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4213 // end-ladder electro
4214 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4215 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4219 dtube[2] = 26.8/2./10.;
4222 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4224 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4225 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4231 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4232 // end-ladder electron
4235 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4236 // end-ladder electronics
4242 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4243 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4249 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4253 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4260 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4261 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4263 if (fMinorVersion < 3 ) {
4265 dpgon[0] = offset2 + 360./(2.*35.);
4269 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4273 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4280 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4281 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4283 dpgon[0] = offset2 + 360./(2.*39.);
4287 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4291 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4298 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4299 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4301 if (fMinorVersion > 2 && fMinorVersion < 6) {
4303 dpgon[0] = offset2 + 5.625;
4307 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4308 // end-ladder electronics
4311 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4312 // end-ladder electr
4318 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4319 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4321 dpgon[0] = offset2 + 5.;
4325 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4326 // end-ladder electronics
4329 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4330 // end-ladder electr
4336 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4337 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4342 // --- Define the Z<0 end-cap
4344 // GOTO 9456 ! skip the Z<0 end-cap
4347 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4348 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4353 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4354 // end-ladder electr
4355 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4357 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4359 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4361 // In the Simonetti's drawings 52. In the TP 50.
4365 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4366 // end-ladder electr
4367 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4369 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4373 dtube[2] = 26.8/2./10.;
4376 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4378 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4380 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4386 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4387 // end-ladder electronics
4390 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4391 // end-ladder electro
4397 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4398 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4404 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4408 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4415 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4416 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4418 if (fMinorVersion < 3) {
4420 dpgon[0] = offset2 + 360./(2.*35.);
4424 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4428 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4435 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4436 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4438 dpgon[0] = offset2 + 360./(2.*39.);
4442 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4446 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4453 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4454 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4456 if (fMinorVersion > 2 && fMinorVersion < 6) {
4458 dpgon[0] = offset2 + 5.625;
4462 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4463 // end-ladder electronics
4466 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4467 // end-ladder electr
4473 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4474 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4476 dpgon[0] = offset2 + 5.;
4480 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4481 // end-ladder electronics
4484 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4485 // end-ladder electr
4491 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4492 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4498 // --- Outputs the geometry tree in the EUCLID/CAD format
4501 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4505 //_____________________________________________________________________________
4506 void AliITSv3::CreateMaterials()
4509 // Create Materials for ITS
4511 AliITS::CreateMaterials();
4514 //_____________________________________________________________________________
4515 void AliITSv3::Init()
4518 // Initialise its after it is built
4523 //_____________________________________________________________________________
4524 void AliITSv3::StepManager()
4527 // Called at every step in ITS
4532 TLorentzVector position, momentum;
4533 TClonesArray &lhits = *fHits;
4535 if(gMC->TrackCharge() && gMC->Edep()) {
4537 // Only entering charged tracks
4538 if((id=gMC->CurrentVolID(copy))==fIdSens1) {
4540 id=gMC->CurrentVolOffID(1,copy);
4542 id=gMC->CurrentVolOffID(2,copy);
4544 } else if(id==fIdSens2) {
4546 id=gMC->CurrentVolOffID(1,copy);
4548 id=gMC->CurrentVolOffID(2,copy);
4550 } else if(id==fIdSens3) {
4553 id=gMC->CurrentVolOffID(1,copy);
4555 } else if(id==fIdSens4) {
4558 id=gMC->CurrentVolOffID(1,copy);
4560 } else if(id==fIdSens5) {
4563 id=gMC->CurrentVolOffID(1,copy);
4565 } else if(id==fIdSens6) {
4568 id=gMC->CurrentVolOffID(1,copy);
4571 gMC->TrackPosition(position);
4572 gMC->TrackMomentum(momentum);
4573 hits[0]=position[0];
4574 hits[1]=position[1];
4575 hits[2]=position[2];
4576 hits[3]=momentum[0];
4577 hits[4]=momentum[1];
4578 hits[5]=momentum[2];
4579 hits[6]=gMC->Edep();
4580 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);