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">
67 AliMC* pMC = AliMC::GetMC();
69 const Float_t xx[14] = { 0.,0.,-14.002,-6.288,-25.212,-16.292,-35.713,-26.401,
70 -45.34,-36.772,-18.74,-12.814,-14.358,0. };
71 const Float_t yy[14] = { 0.,27.056,31.408,
72 25.019,27.768,22.664,22.42,18.727,15.479,13.68,-9.984,-6.175,-3.775,0. };
73 const Float_t xbeg[13] = { 0.,-.352,-12.055,-8.755,-23.035,-19.085,-33.362,
74 -28.859,-42.774,-36.644,-18.352,-13.085,-13.426 };
75 const Float_t ybeg[13] = { .386,27.165,29.795,
76 25.377,26.48,22.632,21.487,18.305,14.94,13.509,-9.735,-5.755,-3.53 };
77 const Float_t xend[13] = { 0.,-11.588,-8.208,-22.709,-18.738,-33.184,-28.719,
78 -42.756,-37.027,-19.002,-13.235,-13.837,-.373 };
79 const Float_t yend[13] = { 26.688,30.658,26.609,
80 27.405,23.935,22.452,19.646,15.922,13.733,-9.639,-6.446,-4.585,-.098 };
81 const Float_t xarc[13] = { -.5,-13.248,-13.505,-18.622,-37.171,-42.671,-28.977,
82 -33.178,-19.094,-22.781,-8.655,-11.736,-.5 };
83 const Float_t yarc[13] = { .5,-4.093,-5.911,
84 -9.2,13.162,15.543,19.109,22.066,23.446,27.024,26.184,30.294,26.802 };
85 const Float_t rarc[13] = { .5,.7,.5,.5,.7,.5,.7,.5,.7,.5,.7,.5,.5 };
86 const Float_t rr = 4.064516;
87 const Float_t tteta = 63.;
88 const Float_t pphi = -35.;
89 const Float_t gteta = 87.78;
90 const Double_t degrad = kPI/180.;
91 const Double_t raddeg = 180./kPI;
92 const Double_t twopi = 2*kPI;
95 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5], dfra[10], dcer[3], dkap[3], dpla[3],
96 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3], atheta1011, dbus[3], dtub[3], dwat[3],
97 depx[3], dits[3], atheta1314, atheta1213, atheta1112, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
98 Double_t biga1, bigb1;
99 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3],
100 dtra4[3], dbox1[3], dbox2[3];
102 Float_t xtra1[6], ytra1[6], ztra1[6];
104 Float_t xpos1, ypos1;
106 Float_t angle, dcone[5], dtube[3], dpgon[10];
107 Float_t rzero, xzero, yzero;
108 Double_t coeffa, coeffb, coeffc;
110 Float_t atheta, offset;
111 Float_t offset1, offset2, dgh[15];
112 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
113 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
116 Double_t xcc1, ycc1, xcc2, ycc2;
118 const char natra[][5] =
119 { "TR01","TR02","TR03","TR04","TR05","TR06","TR07","TR08"};
120 const char natra1[][5] =
121 {"TR11","TR12","TR13","TR14","TR15","TR16","TR17","TR18",
122 "TR19","TR20","TR21","TR22","TR23","TR24","TR25","TR26"};
123 const char natra2[][5] =
124 {"TR31","TR32","TR33","TR34","TR35","TR36"};
125 const char natra3[][5] =
126 {"TR41","TR42","TR43","TR44","TR45","TR46"};
127 const char natra4[][5] =
128 {"TR51","TR52","TR53","TR54","TR55","TR56","TR57","TR58",
129 "TR59","TR60","TR61","TR62","TR63","TR64","TR65","TR66"};
131 Int_t *idtmed = fIdtmed->GetArray()-199;
133 // --- Define a ghost volume containing the whole ITS and fill it with air
151 pMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
153 // --- Place the ghost volume in its mother volume (ALIC) and make it
156 pMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
157 pMC->Gsatt("ITSV", "SEEN", 0);
159 //************************************************************************
164 //************************************************************************
166 // GOTO 2345 ! skip ITS layer no. 1 and 2
168 // --- Define a ghost volume containing the Silicon Pixel Detectors
169 // (layer #1 and #2) and fill it with air or vacuum
171 xxm = (49.999-3)/(70-25);
175 dgh[3] = -25.-(9.-3.01)/xxm;
184 dgh[12] = 25+(9-3.01)/xxm;
187 pMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
189 // --- Place the ghost volume in its mother volume (ITSV) and make it
192 pMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
193 pMC->Gsatt("IT12", "SEEN", 0);
195 // --- Define a ghost volume containing a single element of layer #1
196 // and fill it with air or vacuum
198 dbox1[0] = 0.005+0.01+0.0075;
201 pMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
203 //--- Divide each element of layer #1 in three ladders along the beam direction
205 pMC->Gsdvn("IPB1", "IPV1", 3, 3);
207 // --- Make the ghost volumes invisible
209 pMC->Gsatt("IPV1", "SEEN", 0);
210 pMC->Gsatt("IPB1", "SEEN", 0);
212 // --- Define a volume containing the chip of pixels (silicon, layer #1)
216 dchi[2] = dbox1[2] / 3.;
217 pMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
219 // --- Define a volume containing the bus of pixels (silicon, layer #1)
224 pMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
226 // --- Define a volume containing the sensitive part of pixels
227 // (silicon, layer #1)
232 pMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
234 // --- Place the chip into its mother (IPB1)
236 xpos = dbox1[0] - dchi[0];
239 pMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
241 // --- Place the sensitive volume into its mother (IPB1)
243 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
244 ypos = dchi[1] - dits[1];
245 zpos = -(dchi[2] - dits[2]);
246 pMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
248 // --- Place the bus into its mother (IPB1)
250 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
251 ypos = dchi[1] - dbus[1];
252 zpos = -(dchi[2] - dbus[2]);
253 pMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
255 // --- Define a ghost volume containing a single element of layer #2
256 // and fill it with air or vacuum
258 dbox2[0] = 0.005+0.01+0.0075;
261 pMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
263 //--- Divide each element of layer #2 in four ladders along the beam direction
265 pMC->Gsdvn("IPB2", "IPV2", 4, 3);
267 // --- Make the ghost volumes invisible
269 pMC->Gsatt("IPV2", "SEEN", 0);
270 pMC->Gsatt("IPB2", "SEEN", 0);
272 // --- Define a volume containing the chip of pixels (silicon, layer #2)
276 dchi[2] = dbox2[2] / 4.;
277 pMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
279 // --- Define a volume containing the bus of pixels (silicon, layer #2)
284 pMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
286 // --- Define a volume containing the sensitive part of pixels
287 // (silicon, layer #2)
292 pMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
294 // --- Place the chip into its mother (IPB2)
296 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
299 pMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
301 // --- Place the sensitive volume into its mother (IPB2)
303 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
304 ypos = -(dchi[1] - dits[1]);
305 zpos = -(dchi[2] - dits[2]);
306 pMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
308 // --- Place the bus into its mother (IPB2)
310 xpos = dbox1[0] - dbus[0];
311 ypos = -(dchi[1] - dbus[1]);
312 zpos = -(dchi[2] - dbus[2]);
313 pMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
315 // --- Define a generic segment of an element of the mechanical support
320 pMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
322 // --- Define a generic arc of an element of the mechanical support
327 pMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
329 // --- Define the mechanical supports of layers #1 and #2 and place the
330 // elements of the layers in it
333 // counter over the number of elements of layer #1 (
336 // counter over the number of elements of layer #2 (
337 for (i = 1; i <= 10; ++i) {
339 // --- Place part # 1-2 (see sketch)
341 // number of carbon fiber supports (see sketch)
344 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
346 xcc = (xx[0] + xx[1]) / 20.;
347 ycc = (yy[0] + yy[1]) / 20.;
348 xccc = (xbeg[0] + xend[0]) / 20.;
349 yccc = (ybeg[0] + yend[0]) / 20.;
350 if (xx[0] == xx[1]) {
355 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
357 aphi = (pphi + (i-1) * 36.) * degrad;
358 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
359 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
360 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
361 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
362 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
363 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
365 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
366 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
367 pMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
369 // --- Place part # 2-3 (see sketch)
373 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
375 xcc = (xx[1] + xx[2]) / 20.;
376 ycc = (yy[1] + yy[2]) / 20.;
377 xccc = (xbeg[1] + xend[1]) / 20.;
378 yccc = (ybeg[1] + yend[1]) / 20.;
379 if (xx[1] == xx[2]) {
384 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
386 aphi = (pphi + (i-1) * 36.) * degrad;
387 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
388 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
389 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
390 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
391 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
392 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
394 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
395 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
396 pMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
398 // --- Place an element of layer #2
400 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
401 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
402 coeffa = biga * biga + 1.;
403 coeffb = biga * bigb - biga * ycc - xcc;
404 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 0.08964*0.08964;
405 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
406 ycc1 = biga * xcc1 + bigb;
408 bigb1 = xcc1 / biga + ycc1;
409 coeffa = biga1 * biga1 + 1.;
410 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
411 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
412 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
413 ycc2 = biga1 * xcc2 + bigb1;
414 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
415 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
416 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
417 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
420 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
422 // --- Place part # 3-4 (see sketch)
426 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
428 xcc = (xx[1] + xx[2]) / 20.;
429 ycc = (yy[1] + yy[2]) / 20.;
430 xccc = (xbeg[2] + xend[2]) / 20.;
431 yccc = (ybeg[2] + yend[2]) / 20.;
432 if (xx[2] == xx[3]) {
437 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
439 aphi = (pphi + (i-1) * 36.) * degrad;
440 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
441 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
442 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
443 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
444 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
445 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
447 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
448 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
449 pMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
451 // --- Place part # 4-5 (see sketch)
455 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
457 xcc = (xx[3] + xx[4]) / 20.;
458 ycc = (yy[3] + yy[4]) / 20.;
459 xccc = (xbeg[3] + xend[3]) / 20.;
460 yccc = (ybeg[3] + yend[3]) / 20.;
461 if (xx[3] == xx[4]) {
466 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
468 aphi = (pphi + (i-1) * 36.) * degrad;
469 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
470 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
471 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
472 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
473 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
474 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
476 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
477 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
478 pMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
480 // --- Place an element of layer #2
482 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
483 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
484 coeffa = biga * biga + 1.;
485 coeffb = biga * bigb - biga * ycc - xcc;
486 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
487 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
488 ycc1 = biga * xcc1 + bigb;
490 bigb1 = xcc1 / biga + ycc1;
491 coeffa = biga1 * biga1 + 1.;
492 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
493 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
494 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
495 ycc2 = biga1 * xcc2 + bigb1;
496 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
497 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
498 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
499 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
502 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
504 // --- Place part # 5-6 (see sketch)
508 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
510 xcc = (xx[4] + xx[5]) / 20.;
511 ycc = (yy[4] + yy[5]) / 20.;
512 xccc = (xbeg[4] + xend[4]) / 20.;
513 yccc = (ybeg[4] + yend[4]) / 20.;
514 if (xx[4] == xx[5]) {
519 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
521 aphi = (pphi + (i-1) * 36.) * degrad;
522 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
523 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
524 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
525 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
526 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
527 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
529 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
530 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
531 pMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
533 // --- Place part # 6-7 (see sketch)
537 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
539 xcc = (xx[5] + xx[6]) / 20.;
540 ycc = (yy[5] + yy[6]) / 20.;
541 xccc = (xbeg[5] + xend[5]) / 20.;
542 yccc = (ybeg[5] + yend[5]) / 20.;
543 if (xx[5] == xx[6]) {
548 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
550 aphi = (pphi + (i-1) * 36.) * degrad;
551 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
552 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
553 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
554 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
555 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
556 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
558 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
559 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
560 pMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
562 // --- Place an element of layer #2
564 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
565 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
566 coeffa = biga * biga + 1.;
567 coeffb = biga * bigb - biga * ycc - xcc;
568 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
569 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
570 ycc1 = biga * xcc1 + bigb;
572 bigb1 = xcc1 / biga + ycc1;
573 coeffa = biga1 * biga1 + 1.;
574 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
575 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
576 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
577 ycc2 = biga1 * xcc2 + bigb1;
578 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
579 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
580 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
581 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
584 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
586 // --- Place part # 7-8 (see sketch)
590 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
592 xcc = (xx[6] + xx[7]) / 20.;
593 ycc = (yy[6] + yy[7]) / 20.;
594 xccc = (xbeg[6] + xend[6]) / 20.;
595 yccc = (ybeg[6] + yend[6]) / 20.;
596 if (xx[6] == xx[7]) {
601 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
603 aphi = (pphi + (i-1) * 36.) * degrad;
604 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
605 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
606 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
607 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
608 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
609 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
611 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
612 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
613 pMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
615 // --- Place part # 8-9 (see sketch)
619 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
621 xcc = (xx[7] + xx[8]) / 20.;
622 ycc = (yy[7] + yy[8]) / 20.;
623 xccc = (xbeg[7] + xend[7]) / 20.;
624 yccc = (ybeg[7] + yend[7]) / 20.;
625 if (xx[1] == xx[2]) {
630 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
632 aphi = (pphi + (i-1) * 36.) * degrad;
633 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
634 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
635 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
636 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
637 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
638 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
640 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
641 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
642 pMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
644 // --- Place an element of layer #2
646 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
647 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
648 coeffa = biga * biga + 1.;
649 coeffb = biga * bigb - biga * ycc - xcc;
650 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
651 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
652 ycc1 = biga * xcc1 + bigb;
654 bigb1 = xcc1 / biga + ycc1;
655 coeffa = biga1 * biga1 + 1.;
656 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
657 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
658 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
659 ycc2 = biga1 * xcc2 + bigb1;
660 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
661 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
662 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
663 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
666 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
668 // --- Place part # 9-10 (see sketch)
672 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
674 xcc = (xx[8] + xx[9]) / 20.;
675 ycc = (yy[8] + yy[9]) / 20.;
676 xccc = (xbeg[8] + xend[8]) / 20.;
677 yccc = (ybeg[8] + yend[8]) / 20.;
678 if (xx[8] == xx[9]) {
683 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
685 aphi = (pphi + (i-1) * 36.) * degrad;
686 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
687 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
688 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
689 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
690 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
691 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
693 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
694 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
695 pMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
697 // --- Place part # 10-11 (see sketch)
701 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
703 xcc = (xx[9] + xx[10]) / 20.;
704 ycc = (yy[9] + yy[10]) / 20.;
705 xccc = (xbeg[9] + xend[9]) / 20.;
706 yccc = (ybeg[9] + yend[9]) / 20.;
707 if (xx[9] == xx[10]) {
712 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
714 aphi = (pphi + (i-1) * 36.) * degrad;
715 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
716 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
717 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
718 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
719 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
720 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
722 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
723 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
724 pMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
726 // --- Place part # 13-14 (see sketch)
730 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
732 xcc = (xx[12] + xx[13]) / 20.;
733 ycc = (yy[12] + yy[13]) / 20.;
734 xccc = (xbeg[12] + xend[12]) / 20.;
735 yccc = (ybeg[12] + yend[12]) / 20.;
736 if (xx[12] == xx[13]) {
739 r1 = yy[12] - yy[13];
740 r2 = xx[12] - xx[13];
741 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
743 aphi = (pphi + (i-1) * 36.) * degrad;
744 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
745 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
746 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
747 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
748 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
749 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
751 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
752 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
753 pMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
755 // --- Place an element of layer #1
757 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
758 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
759 coeffa = biga * biga + 1.;
760 coeffb = biga * bigb - biga * ycc - xcc;
761 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
762 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
763 ycc1 = biga * xcc1 + bigb;
765 bigb1 = xcc1 / biga + ycc1;
766 coeffa = biga1 * biga1 + 1.;
767 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
768 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
769 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
770 ycc2 = biga1 * xcc2 + bigb1;
771 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
772 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
773 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
774 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
777 pMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
779 // --- Place part # 12-13 (see sketch)
783 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
785 xcc = (xx[11] + xx[12]) / 20.;
786 ycc = (yy[11] + yy[12]) / 20.;
787 xccc = (xbeg[11] + xend[11]) / 20.;
788 yccc = (ybeg[11] + yend[11]) / 20.;
789 if (xx[11] == xx[12]) {
792 r1 = yy[12] - yy[11];
793 r2 = xx[12] - xx[11];
794 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
796 aphi = (pphi + (i-1) * 36.) * degrad;
797 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
798 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
799 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
800 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
801 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
802 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
804 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
805 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
806 pMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
808 // --- Place part # 11-12 (see sketch)
812 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
814 xcc = (xx[10] + xx[11]) / 20.;
815 ycc = (yy[10] + yy[11]) / 20.;
816 xccc = (xbeg[10] + xend[10]) / 20.;
817 yccc = (ybeg[10] + yend[10]) / 20.;
818 if (xx[10] == xx[11]) {
821 r1 = yy[11] - yy[10];
822 r2 = xx[11] - xx[10];
823 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
825 aphi = (pphi + (i-1) * 36.) * degrad;
826 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
827 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
828 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
829 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
830 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
831 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
833 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
834 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
835 pMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
837 // --- Place an element of layer #1
839 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
840 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
841 coeffa = biga * biga + 1.;
842 coeffb = biga * bigb - biga * ycc - xcc;
843 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
844 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
845 ycc1 = biga * xcc1 + bigb;
847 bigb1 = xcc1 / biga + ycc1;
848 coeffa = biga1 * biga1 + 1.;
849 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
850 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
851 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
852 ycc2 = biga1 * xcc2 + bigb1;
853 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
854 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
855 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
856 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
859 pMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
861 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
863 darc[0] = rarc[12] / 10. - .02;
864 darc[1] = rarc[12] / 10.;
866 darc[3] = atheta12 - (i-1) * 36.;
867 darc[4] = atheta23 - (i-1) * 36.;
868 xcc = xarc[12] / 10.;
869 ycc = yarc[12] / 10.;
870 aphi = (pphi + (i-1) * 36.) * degrad;
871 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
872 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
873 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
874 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
875 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
876 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
878 pMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
880 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
882 darc[0] = rarc[11] / 10. - .02;
883 darc[1] = rarc[11] / 10.;
885 darc[3] = atheta23 + 90. - (i-1) * 36.;
886 darc[4] = atheta34 + 90. - (i-1) * 36.;
887 xcc = xarc[11] / 10.;
888 ycc = yarc[11] / 10.;
889 aphi = (pphi + (i-1) * 36.) * degrad;
890 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
891 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
892 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
893 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
894 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
895 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
897 pMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
899 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
901 darc[0] = rarc[10] / 10. - .02;
902 darc[1] = rarc[10] / 10.;
904 darc[3] = atheta45 + 180. - (i-1) * 36.;
905 darc[4] = atheta34 + 180. - (i-1) * 36.;
906 xcc = xarc[10] / 10.;
907 ycc = yarc[10] / 10.;
908 aphi = (pphi + (i-1) * 36.) * degrad;
909 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
910 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
911 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
912 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
913 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
914 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
916 pMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
918 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
920 darc[0] = rarc[9] / 10. - .02;
921 darc[1] = rarc[9] / 10.;
923 darc[3] = atheta45 - 90. - (i-1) * 36.;
924 darc[4] = atheta56 - 90. - (i-1) * 36.;
927 aphi = (pphi + (i-1) * 36.) * degrad;
928 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
929 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
930 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
931 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
932 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
933 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
935 pMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
937 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
939 darc[0] = rarc[8] / 10. - .02;
940 darc[1] = rarc[8] / 10.;
942 darc[3] = atheta67 + 45. - (i-1) * 36.;
943 darc[4] = atheta56 + 45. - (i-1) * 36.;
946 aphi = (pphi + (i-1) * 36.) * degrad;
947 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
948 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
949 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
950 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
951 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
952 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
954 pMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
956 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
958 darc[0] = rarc[7] / 10. - .02;
959 darc[1] = rarc[7] / 10.;
961 darc[3] = atheta67 - (i-1) * 36.;
962 darc[4] = atheta78 - (i-1) * 36.;
965 aphi = (pphi + (i-1) * 36.) * degrad;
966 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
967 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
968 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
969 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
970 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
971 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
973 pMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
975 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
977 darc[0] = rarc[6] / 10. - .02;
978 darc[1] = rarc[6] / 10.;
980 darc[3] = atheta89 + 45. - (i-1) * 36.;
981 darc[4] = atheta78 + 45. - (i-1) * 36.;
984 aphi = (pphi + (i-1) * 36.) * degrad;
985 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
986 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
987 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
988 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
989 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
990 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
992 pMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
994 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
996 darc[0] = rarc[5] / 10. - .02;
997 darc[1] = rarc[5] / 10.;
999 darc[3] = atheta89 + 45. - (i-1) * 36.;
1000 darc[4] = atheta910 + 45. - (i-1) * 36.;
1001 xcc = xarc[5] / 10.;
1002 ycc = yarc[5] / 10.;
1003 aphi = (pphi + (i-1) * 36.) * degrad;
1004 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1005 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1006 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1007 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1008 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1009 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1011 pMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1013 // --- Place arc # 5 (between part 9-10 and part 10-11)
1016 darc[0] = rarc[4] / 10. - .02;
1017 darc[1] = rarc[4] / 10.;
1019 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1020 darc[4] = atheta910 + 45. - (i-1) * 36.;
1021 xcc = xarc[4] / 10.;
1022 ycc = yarc[4] / 10.;
1023 aphi = (pphi + (i-1) * 36.) * degrad;
1024 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1025 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1026 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1027 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1028 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1029 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1031 pMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1033 // --- Place arc # 4 (between part 10-11 and part 11-12)
1036 darc[0] = rarc[3] / 10. - .02;
1037 darc[1] = rarc[3] / 10.;
1039 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1040 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1041 xcc = xarc[3] / 10.;
1042 ycc = yarc[3] / 10.;
1043 aphi = (pphi + (i-1) * 36.) * degrad;
1044 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1045 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1046 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1047 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1048 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1049 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1051 pMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1053 // --- Place arc # 3 (between part 11-12 and part 12-13)
1056 darc[0] = rarc[2] / 10. - .02;
1057 darc[1] = rarc[2] / 10.;
1059 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1060 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1061 xcc = xarc[2] / 10.;
1062 ycc = yarc[2] / 10.;
1063 aphi = (pphi + (i-1) * 36.) * degrad;
1064 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1065 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1066 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1067 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1068 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1069 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1071 pMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1073 // --- Place arc # 2 (between part 12-13 and part 13-14)
1076 darc[0] = rarc[1] / 10. - .02;
1077 darc[1] = rarc[1] / 10.;
1079 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1080 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1081 xcc = xarc[1] / 10.;
1082 ycc = yarc[1] / 10.;
1083 aphi = (pphi + (i-1) * 36.) * degrad;
1084 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1085 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1086 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1087 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1088 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1089 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1091 pMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1093 // --- Place arc # 1 (between part 13-14 and part 1-2)
1096 darc[0] = rarc[0] / 10. - .02;
1097 darc[1] = rarc[0] / 10.;
1099 darc[3] = atheta12 + 45. - (i-1) * 36.;
1100 darc[4] = atheta1314 - (i-1) * 36.;
1101 xcc = xarc[0] / 10.;
1102 ycc = yarc[0] / 10.;
1103 aphi = (pphi + (i-1) * 36.) * degrad;
1104 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1105 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1106 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1107 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1108 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1109 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1111 pMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1114 //************************************************************************
1119 //************************************************************************
1121 // --- Define a ghost volume containing the Silicon Drift Detectors
1122 // (layer #3 and #4) and fill it with air or vacuum
1124 xxm = (49.999-3.)/(70.-25.);
1128 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1131 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1134 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1137 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1140 pMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1142 // --- Place the ghost volume in its mother volume (ITSV) and make it
1145 pMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1146 pMC->Gsatt("IT34", "SEEN", 0);
1150 // GOTO 3456 ! skip ITS layer no. 3
1152 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1153 // smaller lenght of ribs) and fill it with air or vacuum
1155 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1157 // the widest element is the sensitive element
1158 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1159 // 7.5 cm is the lenght
1160 pMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1162 // --- Make the ghost volume invisible
1164 pMC->Gsatt("IDV1", "SEEN", 0);
1166 // --- Define a volume containing the sensitive part of drifts
1167 // (silicon, layer #3)
1170 // see material budget report by G. Feofilov
1173 pMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1175 //--- Define the part of the (smaller) rib between two sensitive parts made of
1176 // carbon (layer #3)
1178 dsup[0] = .5 - dits[0];
1180 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1181 // 7.5 cm is the lenght
1182 pMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1184 //--- Define the first part of the (smaller) rib between two sensitive parts
1185 // made of aluminum (layer #3)
1187 dal1[0] = .5 - dits[0];
1188 dal1[1] = 0.00096/2.;
1189 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1190 // 7.5 cm is the lenght
1191 pMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1193 //--- Define the part of the (smaller) rib between two sensitive parts made of
1194 // kapton (layer #3)
1196 dkap[0] = .5 - dits[0];
1198 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1199 // 7.5 cm is the lenght
1200 pMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1202 //--- Define the second part of the (smaller) rib between two sensitive parts
1203 // made of aluminum (layer #3)
1205 dal2[0] = .5 - dits[0];
1206 dal2[1] = 0.0027/2.;
1207 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1208 // 7.5 cm is the lenght
1209 pMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1211 // --- Define the part of the (smaller) rib between two sensitive parts
1212 // made of silicon (the electronics) (layer #3)
1214 dchi[0] = .5 - dits[0];
1215 dchi[1] = 0.0071/2.;
1216 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1217 // 7.5 cm is the lenght
1218 pMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1220 // --- Define the part of the (smaller) rib between two sensitive parts
1221 // made of water (the cooler) (layer #3)
1223 dwat[0] = .5 - dits[0];
1224 dwat[1] = 0.0093/2.;
1225 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1226 // 7.5 cm is the lenght
1227 pMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1229 //--- Define the third part of the (smaller) rib between two sensitive parts
1230 // made of aluminum (the cooling tubes) (layer #3)
1232 dtub[0] = .5 - dits[0];
1233 dtub[1] = 0.00134/2.;
1234 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1235 // 7.5 cm is the lenght
1236 pMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1238 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1241 // twice the foreseen thickness
1244 pMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1246 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1249 // twice the foreseen thickness
1252 pMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1254 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1257 // twice the foreseen thickness
1260 pMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1262 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1265 // twice the foreseen thickness
1268 pMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1270 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1274 for (j = 1; j <= 5; ++j) {
1275 // odd elements are up and even elements are down
1277 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1278 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1279 } else if (j == 2) {
1280 xpos = -dbox1[0] + dits[0];
1281 zpos = 0. - dits[2] + 1. - dits[2];
1282 } else if (j == 3) {
1283 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1285 } else if (j == 4) {
1286 xpos = -dbox1[0] + dits[0];
1287 zpos = dits[2] + 0. - 1. + dits[2];
1288 } else if (j == 5) {
1289 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1290 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1292 pMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1295 // --- Place the smaller ribs into their mother (IDV1)
1297 // --- Right ribs (just a matter of convention)
1299 xpos = .5 - dbox1[0] + dits[0];
1305 pMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1309 ypos = dsup[1] + 2.81 + dal1[1];
1310 pMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1314 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1315 pMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1319 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1320 pMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1322 // --- Silicon (chip)
1324 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1325 pMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1329 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1330 pMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1334 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1336 pMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1338 // --- Right ribs (just a matter of convention)
1343 pMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1347 ypos = -(dsup[1] + 2.81 + dal1[1]);
1348 pMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1352 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1353 pMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1357 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1358 pMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1360 // --- Silicon (chip)
1362 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1363 pMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1367 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1368 pMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1372 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1373 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1374 pMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1376 // --- Place the end-ladder stuff into its mother (IDV1)
1379 // --- Negative-Z end-ladder
1382 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1386 xpos = dbox1[0] - dpcb[0];
1387 pMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1391 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1392 pMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1396 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1397 pMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1399 // --- Silicon (bus)
1401 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1402 pMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1404 // --- Positive-Z end-ladder
1407 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1411 xpos = dbox1[0] - dpcb[0];
1412 pMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1416 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1417 pMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1421 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1422 pMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1424 // --- Silicon (bus)
1426 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1427 pMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1429 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1430 // larger lenght of ribs) and fill it with air or vacuum
1432 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1434 // the widest element is the sensitive element
1435 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1436 // 7.5 cm is the lenght
1437 pMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1439 // --- Make the ghost volume invisible
1441 pMC->Gsatt("IDV2", "SEEN", 0);
1443 //--- Define the part of the (larger) rib between two sensitive parts madeof
1444 // carbon (layer #3)
1446 dsup[0] = .65 - dits[0];
1448 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1449 // 7.5 cm is the lenght
1450 pMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1452 //--- Define the first part of the (larger) rib between two sensitive parts
1453 // made of aluminum (layer #3)
1455 dal1[0] = .65 - dits[0];
1456 dal1[1] = 0.00096/2.;
1457 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1458 // 7.5 cm is the lenght
1459 pMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1461 //--- Define the part of the (larger) rib between two sensitive parts madeof
1462 // kapton (layer #3)
1464 dkap[0] = .65 - dits[0];
1465 dkap[1] = 0.0317/2.;
1466 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1467 // 7.5 cm is the lenght
1468 pMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1470 //--- Define the second part of the (larger) rib between two sensitive parts
1471 // made of aluminum (layer #3)
1473 dal2[0] = .65 - dits[0];
1474 dal2[1] = 0.0027/2.;
1475 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1476 // 7.5 cm is the lenght
1477 pMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1479 // --- Define the part of the (larger) rib between two sensitive parts
1480 // made of silicon (the electronics) (layer #3)
1482 dchi[0] = .65 - dits[0];
1483 dchi[1] = 0.0071/2.;
1484 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1485 // 7.5 cm is the lenght
1486 pMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1488 // --- Define the part of the (larger) rib between two sensitive parts
1489 // made of water (the cooler) (layer #3)
1491 dwat[0] = .65 - dits[0];
1492 dwat[1] = 0.0093/2.;
1493 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1494 // 7.5 cm is the lenght
1495 pMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1497 //--- Define the third part of the (larger) rib between two sensitive parts
1498 // made of aluminum (the cooling tubes) (layer #3)
1500 dtub[0] = .65 - dits[0];
1501 dtub[1] = 0.00134/2.;
1502 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1503 // 7.5 cm is the lenght
1504 pMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1506 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1510 for (j = 1; j <= 5; ++j) {
1511 // odd element are up and even elements are down
1513 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1514 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1515 } else if (j == 2) {
1516 xpos = -dbox2[0] + dits[0];
1517 zpos = 0. - dits[2] + 1. - dits[2];
1518 } else if (j == 3) {
1519 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1521 } else if (j == 4) {
1522 xpos = -dbox2[0] + dits[0];
1523 zpos = dits[2] + 0. - 1. + dits[2];
1524 } else if (j == 5) {
1525 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1526 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1528 pMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1531 // --- Place the larger ribs into their mother (IDV2)
1534 // --- Right ribs (just a matter of convention)
1536 xpos = .65 - dbox2[0] + dits[0];
1542 pMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1546 ypos = dsup[1] + 2.81 + dal1[1];
1547 pMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1551 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1552 pMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1556 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1557 pMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1559 // --- Silicon (chip)
1561 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1562 pMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1566 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1567 pMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1571 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1572 pMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1574 // --- Right ribs (just a matter of convention)
1579 pMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1583 ypos = -(dsup[1] + 2.81 + dal1[1]);
1584 pMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1588 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1589 pMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1593 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1594 pMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1596 // --- Silicon (chip)
1598 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1599 pMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1603 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1604 pMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1608 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1609 pMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1611 // --- Place the end-ladder stuff into its mother (IDV1)
1614 // --- Negative-Z end-ladder
1617 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1621 xpos = dbox2[0] - dpcb[0];
1622 pMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1626 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1627 pMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1631 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1632 pMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1634 // --- Silicon (bus)
1636 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1637 pMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1639 // --- Positive-Z end-ladder
1642 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1646 xpos = dbox2[0] - dpcb[0];
1647 pMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1651 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1652 pMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1656 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1657 pMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1659 // --- Silicon (bus)
1661 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1662 pMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1664 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1665 // mother volume (IT34)
1666 // Odd elements have large ribs and even elements have small ribs
1668 for (i = 1; i <= 12; ++i) {
1669 atheta = (i-1) * 30.;
1670 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1673 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1674 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1676 pMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1679 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1680 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1682 pMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1689 // GOTO 4567 ! skip ITS layer no. 4
1691 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1692 // smaller lenght of ribs) and fill it with air or vacuum
1694 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1696 // the widest element is the end-ladder stuff
1697 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1698 // 7.5 cm is the lenght
1699 pMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1701 // --- Make the ghost volume invisible
1703 pMC->Gsatt("IDV3", "SEEN", 0);
1705 // --- Define a volume containing the sensitive part of drifts
1706 // (silicon, layer #4)
1709 // see material budget report by G. Feofilov
1712 pMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1714 //--- Define the part of the (smaller) rib between two sensitive parts made of
1715 // carbon (layer #4)
1717 dsup[0] = .5 - dits[0];
1719 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1720 // 7.5 cm is the lengh
1721 pMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1723 //--- Define the first part of the (smaller) rib between two sensitive parts
1724 // made of aluminum (layer #4)
1726 dal1[0] = .5 - dits[0];
1727 dal1[1] = 0.00096/2.;
1728 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1729 // 7.5 cm is the lengh
1730 pMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1732 //--- Define the part of the (smaller) rib between two sensitive parts made of
1733 // kapton (layer #4)
1735 dkap[0] = .5 - dits[0];
1736 dkap[1] = 0.0317/2.;
1737 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1738 // 7.5 cm is the lengh
1739 pMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1741 //--- Define the second part of the (smaller) rib between two sensitive parts
1742 // made of aluminum (layer #4)
1744 dal2[0] = .5 - dits[0];
1745 dal2[1] = 0.0027/2.;
1746 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1747 // 7.5 cm is the lengh
1748 pMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1750 // --- Define the part of the (smaller) rib between two sensitive parts
1751 // made of silicon (the electronics) (layer #4)
1753 dchi[0] = .5 - dits[0];
1754 dchi[1] = 0.0071/2.;
1755 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1756 // 7.5 cm is the lengh
1757 pMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1759 // --- Define the part of the (smaller) rib between two sensitive parts
1760 // made of water (the cooler) (layer #4)
1762 dwat[0] = .5 - dits[0];
1763 dwat[1] = 0.0093/2.;
1764 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1765 // 7.5 cm is the lenght
1766 pMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1768 //--- Define the third part of the (smaller) rib between two sensitive parts
1769 // made of aluminum (the cooling tubes) (layer #4)
1771 dtub[0] = .5 - dits[0];
1772 dtub[1] = 0.00134/2.;
1773 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1774 // 7.5 cm is the lengh
1775 pMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1777 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1780 // twice the foreseen thickness
1783 pMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1785 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1788 // twice the foreseen thickness
1791 pMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1793 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1796 // twice the foreseen thickness
1799 pMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1801 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1804 // twice the foreseen thickness
1807 pMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1809 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1813 for (j = 1; j <= 7; ++j) {
1814 // odd elements are down and even elements are up
1816 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1817 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1818 } else if (j == 2) {
1819 xpos = -dbox1[0] + dits[0];
1820 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1821 } else if (j == 3) {
1822 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1823 zpos = 0. - dits[2] + .7 - dits[2];
1824 } else if (j == 4) {
1825 xpos = -dbox1[0] + dits[0];
1827 } else if (j == 5) {
1828 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1829 zpos = dits[2] + 0. - .7 + dits[2];
1830 } else if (j == 6) {
1831 xpos = -dbox1[0] + dits[0];
1832 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1833 } else if (j == 7) {
1834 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1835 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1837 pMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1840 // --- Place the smaller ribs into their mother (IDV3)
1842 // --- Right ribs (just a matter of convention)
1844 xpos = .5 - dbox1[0] + dits[0];
1850 pMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1854 ypos = dsup[1] + 2.81 + dal1[1];
1855 pMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1859 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1860 pMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1864 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1865 pMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1867 // --- Silicon (chip)
1869 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1870 pMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1874 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1875 pMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1879 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1881 pMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1883 // --- Right ribs (just a matter of convention)
1888 pMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1892 ypos = -(dsup[1] + 2.81 + dal1[1]);
1893 pMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1897 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1898 pMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1902 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1904 pMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1906 // --- Silicon (chip)
1908 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1909 2. + dal2[1] * 2. + dchi[1]);
1910 pMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1914 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1915 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1916 pMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1920 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1921 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
1923 pMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1925 // --- Place the end-ladder stuff into its mother (IDV1)
1928 // --- Negative-Z end-ladder
1931 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
1935 xpos = dbox1[0] - dpcb[0];
1936 pMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1940 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1941 pMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1945 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1946 pMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1948 // --- Silicon (bus)
1950 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1951 pMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1953 // --- Positive-Z end-ladder
1956 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
1960 xpos = dbox1[0] - dpcb[0];
1961 pMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1965 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1966 pMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1970 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1971 pMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1973 // --- Silicon (bus)
1975 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1976 pMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1978 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1979 // larger lenght of ribs) and fill it with air or vacuum
1981 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1983 // the widest element is the end-ladder stuff
1984 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1985 // 7.5 cm is the lenght
1986 pMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
1988 // --- Make the ghost volume invisible
1990 pMC->Gsatt("IDV4", "SEEN", 0);
1992 //--- Define the part of the (larger) rib between two sensitive parts madeof
1993 // carbon (layer #4)
1995 dsup[0] = .65 - dits[0];
1997 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1998 // 7.5 cm is the lengh
1999 pMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2001 //--- Define the first part of the (larger) rib between two sensitive parts
2002 // made of aluminum (layer #4)
2004 dal1[0] = .65 - dits[0];
2005 dal1[1] = 0.00096/2.;
2006 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2007 // 7.5 cm is the lengh
2008 pMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2010 //--- Define the part of the (larger) rib between two sensitive parts madeof
2011 // kapton (layer #4)
2013 dkap[0] = .65 - dits[0];
2014 dkap[1] = 0.0317/2.;
2015 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2016 // 7.5 cm is the lengh
2017 pMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2019 //--- Define the second part of the (larger) rib between two sensitive parts
2020 // made of aluminum (layer #4)
2022 dal2[0] = .65 - dits[0];
2023 dal2[1] = 0.0027/2.;
2024 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2025 // 7.5 cm is the lengh
2026 pMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2028 // --- Define the part of the (larger) rib between two sensitive parts
2029 // made of silicon (the electronics) (layer #4)
2031 dchi[0] = .65 - dits[0];
2032 dchi[1] = 0.0071/2.;
2033 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2034 // 7.5 cm is the lengh
2035 pMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2037 // --- Define the part of the (larger) rib between two sensitive parts
2038 // made of water (the cooler) (layer #4)
2040 dwat[0] = .65 - dits[0];
2041 dwat[1] = 0.0093/2.;
2042 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2043 // 7.5 cm is the lengh
2044 pMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2046 //--- Define the third part of the (larger) rib between two sensitive parts
2047 // made of aluminum (the cooling tubes) (layer #4)
2049 dtub[0] = .65 - dits[0];
2050 dtub[1] = 0.00134/2.;
2051 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2052 // 7.5 cm is the lengh
2053 pMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2055 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2059 for (j = 1; j <= 7; ++j) {
2060 // odd elements are down and even elements are up
2062 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2063 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2064 } else if (j == 2) {
2065 xpos = -dbox2[0] + dits[0];
2066 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2067 } else if (j == 3) {
2068 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2069 zpos = 0. - dits[2] + .7 - dits[2];
2070 } else if (j == 4) {
2071 xpos = -dbox2[0] + dits[0];
2073 } else if (j == 5) {
2074 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2075 zpos = dits[2] + 0. - .7 + dits[2];
2076 } else if (j == 6) {
2077 xpos = -dbox2[0] + dits[0];
2078 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2079 } else if (j == 7) {
2080 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2081 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2083 pMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2086 // --- Place the larger ribs into their mother (IDV4)
2089 // --- Right ribs (just a matter of convention)
2091 xpos = .65 - dbox2[0] + dits[0];
2097 pMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2101 ypos = dsup[1] + 2.81 + dal1[1];
2102 pMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2106 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2107 pMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2111 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2112 pMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2114 // --- Silicon (chip)
2116 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2117 pMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2121 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2122 pMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2126 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2128 pMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2130 // --- Right ribs (just a matter of convention)
2135 pMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2139 ypos = -(dsup[1] + 2.81 + dal1[1]);
2140 pMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2144 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2145 pMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2149 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2151 pMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2153 // --- Silicon (chip)
2155 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2156 2. + dal2[1] * 2. + dchi[1]);
2157 pMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2161 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2162 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2163 pMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2167 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2168 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2169 pMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2171 // --- Place the end-ladder stuff into its mother (IDV1)
2174 // --- Negative-Z end-ladder
2177 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2181 xpos = dbox2[0] - dpcb[0];
2182 pMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2186 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2187 pMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2191 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2192 pMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2194 // --- Silicon (bus)
2196 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2197 pMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2199 // --- Positive-Z end-ladder
2202 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2206 xpos = dbox2[0] - dpcb[0];
2207 pMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2211 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2212 pMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2216 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2217 pMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2219 // --- Silicon (bus)
2221 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2222 pMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2224 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2225 // mother volume (IT34)
2226 // Odd elements have large ribs and even elements have small ribs
2228 for (i = 1; i <= 24; ++i) {
2229 atheta = (i-1) * 15.;
2230 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2233 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2234 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2236 pMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2238 rzero = (24.0+22.8)/2.;
2239 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2240 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2242 pMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2246 //************************************************************************
2251 //************************************************************************
2253 // --- Define SSD with the 35+39 lay-out
2255 if (fMinorVersion < 3) {
2257 //--- Define ghost volume containing the Strip Detectors and fill it with air
2260 xxm = (49.999-3.)/(70.-25.);
2264 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2265 (37.-27)/xxm-(49.998-37.)/xxm;
2268 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2272 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2276 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2277 (37.-27)/xxm+(49.998-37.)/xxm;
2280 pMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2281 pMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2282 pMC->Gsatt("IT56", "SEEN", 0);
2286 // GOTO 5678 ! skip ITS layer no. 5
2288 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2289 // it with air or vacuum
2291 dbox1[0] = (0.0600+2.*0.0150)/2.;
2293 dbox1[2] = 90.22/2.;
2294 pMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2296 // --- Make the ghost volume invisible
2298 pMC->Gsatt("ISV1", "SEEN", 0);
2300 // --- Define a ghost volume containing the electronics and cooling of
2301 // a single ladder of layer #5 and fill it with air or vacuum
2303 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2306 pMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2308 // --- Make the ghost volume invisible
2310 pMC->Gsatt("SSV1", "SEEN", 0);
2312 // --- Define a ghost volume containing the end-ladder stuff of
2313 // a single ladder of layer #5 and fill it with air or vacuum
2318 pMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2320 // --- Make the ghost volume invisible
2322 pMC->Gsatt("ELL5", "SEEN", 0);
2324 // --- Define a volume containing the sensitive part of the strips
2325 // (silicon, layer #5)
2330 pMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2332 // --- Define a volume containing the electronics of the strips
2333 // (silicon, layer #5)
2338 pMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2340 // --- Define the cooling tubes (aluminum, layer #5)
2343 dtub[1] = dtub[0] + .01;
2345 pMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2347 // --- Define the cooling fluid (water or freon, layer #5)
2352 pMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2353 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2355 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2363 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2364 dfra[6] = dfra[5] + .03;
2368 pMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2370 // --- Define the element connecting the triangles of the heat bridge
2371 // (carbon, layer #5)
2376 pMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2378 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2381 dpla[0] = (10./(8.*7.))/2.;
2384 pMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2386 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2388 dcop[0] = (2./(8.*7.))/2.;
2391 pMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2393 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2395 depx[0] = (30./(8.*7.))/2.;
2398 pMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2400 // --- Define the part of the end-ladder stuff made of silicon (bus)
2403 dsil[0] = (20./(8.*7.))/2.;
2406 pMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2408 // --- Place the end-ladder stuff into its mother (ELL5)
2410 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2416 xpos = -dela[0] + dpla[0];
2417 pMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2421 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2422 pMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2426 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2427 pMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2429 // --- Silicon (bus)
2431 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2432 pMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2434 // --- Place the sensitive part of the strips into its mother (ISV1)
2437 for (j = 1; j <= 23; ++j) {
2438 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2439 else xpos = -dbox1[0] + dits[0];
2440 zpos = ((j - 1) - 11.) * 3.91;
2441 pMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2444 // --- Place the electronics of the strips into its mother (SSV1)
2447 for (j = 1; j <= 23; ++j) {
2448 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2449 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2450 zpos = ((j - 1) - 11.) * 3.91 + .85;
2451 pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2454 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2456 xpos = -dsrv[0] + .41;
2459 // --- Left tube (just a matter of convention)
2462 pMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2463 pMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2465 // --- Right tube (just a matter of convention)
2468 pMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2469 pMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2471 // --- Place the heat bridge elements into their mother (SSV1)
2473 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2475 for (j = 1; j <= 24; ++j) {
2476 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2477 pMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2480 // --- Place the elements connecting the triangles of the heat bridge
2481 // into their mother (SSV1)
2485 // --- Left element (just a matter of convention)
2487 xpos = -dsrv[0] + .47;
2488 ypos = -(2.1+0.015);
2489 pMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2491 // --- Right element
2493 xpos = -dsrv[0] + .47;
2495 pMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2499 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2501 pMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2503 // --- Place the ghost volumes containing the strip ladders (ISV1),
2504 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2505 // their mother volume (IT56)
2507 offset1 = TMath::ATan2(.9, 40.);
2509 rzero = dbox1[0] + 40.;
2510 runo = dbox1[0] * 2. + 40. + dsrv[0];
2511 rtwo = dbox1[0] * 2. + 40. + dela[0];
2512 for (i = 1; i <= 35; ++i) {
2513 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2514 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2516 // --- Strip ladders
2518 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2519 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2521 pMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2523 // --- Electronics/cooling
2525 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2526 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2528 pMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2530 // --- End-ladders (nagative-Z and positive-Z)
2532 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2533 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2534 zpos = -(dbox1[2] + dela[2] + 6.);
2535 pMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2536 zpos = dbox1[2] + dela[2] + 6.;
2537 pMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2543 // GOTO 5778 ! skip ITS layer no. 6
2545 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2546 // it with air or vacuum
2548 dbox2[0] = (0.0600+2.*0.0150)/2.;
2550 dbox2[2] = 101.95/2.;
2551 pMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2553 // --- Make the ghost volume invisible
2555 pMC->Gsatt("ISV2", "SEEN", 0);
2557 // --- Define a ghost volume containing the electronics and cooling of
2558 // a single ladder of layer #6 and fill it with air or vacuum
2560 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2562 dsrv[2] = 101.95/2.;
2563 pMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2565 // --- Make the ghost volume invisible
2567 pMC->Gsatt("SSV2", "SEEN", 0);
2569 // --- Define a ghost volume containing the end-ladder stuff of
2570 // a single ladder of layer #6 and fill it with air or vacuum
2575 pMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2577 // --- Make the ghost volume invisible
2579 pMC->Gsatt("ELL6", "SEEN", 0);
2581 // --- Define a volume containing the sensitive part of the strips
2582 // (silicon, layer #6)
2587 pMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2589 // --- Define a volume containing the electronics of the strips
2590 // (silicon, layer #6)
2595 pMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2597 // --- Define the cooling tubes (aluminum, layer #6)
2600 dtub[1] = dtub[0] + .01;
2601 dtub[2] = 101.95/2.;
2602 pMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2604 // --- Define the cooling fluid (water or freon, layer #6)
2608 dwat[2] = 101.95/2.;
2609 pMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2610 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2612 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2620 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2621 dfra[6] = dfra[5] + .03;
2625 pMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2627 // --- Define the element connecting the triangles of the heat bridge
2628 // (carbon, layer #6)
2632 dcei[2] = 101.95/2.;
2633 pMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2635 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2638 dpla[0] = (10./(8.*7.))/2.;
2641 pMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2643 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2645 dcop[0] = (2./(8.*7.))/2.;
2648 pMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2650 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2652 depx[0] = (30./(8.*7.))/2.;
2655 pMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2657 // --- Define the part of the end-ladder stuff made of silicon (bus)
2660 dsil[0] = (20./(8.*7.))/2.;
2663 pMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2665 // --- Place the end-ladder stuff into its mother (ELL5)
2667 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2673 xpos = -dela[0] + dpla[0];
2674 pMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2678 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2679 pMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2683 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2684 pMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2686 // --- Silicon (bus)
2688 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2689 pMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2691 // --- Place the sensitive part of the strips into its mother (ISV2)
2694 for (j = 1; j <= 26; ++j) {
2695 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2696 else xpos = -dbox2[0] + dits[0];
2697 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2698 pMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2701 // --- Place the electronics of the strips into its mother (SSV2)
2704 for (j = 1; j <= 26; ++j) {
2705 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2706 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2707 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2708 pMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2711 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2713 xpos = -dsrv[0] + .41;
2716 // --- Left tube (just a matter of convention)
2719 pMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2720 pMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2722 // --- Right tube (just a matter of convention)
2725 pMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2726 pMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2728 // --- Place the heat bridge elements into their mother (SSV2)
2730 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2732 for (j = 1; j <= 27; ++j) {
2733 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2734 pMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2737 // --- Place the elements connecting the triangles of the heat bridge
2738 // into their mother (SSV2)
2742 // --- Left element (just a matter of convention)
2744 xpos = -dsrv[0] + .47;
2745 ypos = -(2.1+0.015);
2746 pMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2748 // --- Right element
2750 xpos = -dsrv[0] + .47;
2752 pMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2756 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2758 pMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2760 // --- Place the ghost volumes containing the strip ladders (ISV2),
2761 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2762 // their mother volume (IT56)
2764 offset1 = TMath::ATan2(1., 45.);
2766 rzero = dbox2[0] + 45.;
2767 runo = dbox2[0] * 2. + 45. + dsrv[0];
2768 rtwo = dbox2[0] * 2. + 45. + dela[0];
2769 for (i = 1; i <= 39; ++i) {
2770 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2771 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2773 // --- Strip ladders
2775 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2776 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2778 pMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2780 // --- Electronics/cooling
2782 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2783 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2785 pMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2787 // --- End-ladders (nagative-Z and positive-Z)
2789 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2790 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2791 zpos = -(dbox2[2] + dela[2] + 6.);
2792 pMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2793 zpos = dbox2[2] + dela[2] + 6.;
2794 pMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2799 // --- Define SSD with the 32+36 lay-out
2801 if (fMinorVersion >2 && fMinorVersion < 6) {
2803 //--- Define ghost volume containing the Strip Detectors and fill it with air
2806 xxm = (49.999-3.)/(70.-25.);
2810 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2811 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2814 dgh[6] = -25. - (9.-3.01) / xxm -
2815 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2818 dgh[9] = (9.-3.01) / xxm + 25. +
2819 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2822 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2823 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2826 pMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2827 pMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2828 pMC->Gsatt("IT56", "SEEN", 0);
2832 // GOTO 6678 ! skip ITS layer no. 5
2834 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2835 // it with air or vacuum
2837 dbox1[0] = (0.0600+2.*0.0150)/2.;
2839 dbox1[2] = 86.31/2.;
2840 pMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2842 // --- Make the ghost volume invisible
2844 pMC->Gsatt("ISV1", "SEEN", 0);
2846 // --- Define a ghost volume containing the electronics and cooling of
2847 // a single ladder of layer #5 and fill it with air or vacuum
2849 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2852 pMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2854 // --- Make the ghost volume invisible
2856 pMC->Gsatt("SSV1", "SEEN", 0);
2858 // --- Define a ghost volume containing the end-ladder stuff of
2859 // a single ladder of layer #5 and fill it with air or vacuum
2864 pMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2866 // --- Make the ghost volume invisible
2868 pMC->Gsatt("ELL5", "SEEN", 0);
2870 // --- Define a volume containing the sensitive part of the strips
2871 // (silicon, layer #5)
2876 pMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2878 // --- Define a volume containing the electronics of the strips
2879 // (silicon, layer #5)
2884 pMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2886 // --- Define the cooling tubes (aluminum, layer #5)
2889 dtub[1] = dtub[0] + .01;
2891 pMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2893 // --- Define the cooling fluid (water or freon, layer #5)
2898 pMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2899 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2901 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2909 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2910 dfra[6] = dfra[5] + .03;
2914 pMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2916 // --- Define the element connecting the triangles of the heat bridge
2917 // (carbon, layer #5)
2922 pMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2924 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2927 dpla[0] = (10./(8.*7.))/2;
2930 pMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2932 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2934 dcop[0] = (2./(8.*7.))/2;
2937 pMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2939 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2941 depx[0] = (30./(8.*7.))/2.;
2944 pMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2946 // --- Define the part of the end-ladder stuff made of silicon (bus)
2949 dsil[0] = (20./(8.*7.))/2.;
2952 pMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2954 // --- Place the end-ladder stuff into its mother (ELL5)
2956 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2962 xpos = -dela[0] + dpla[0];
2963 pMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2967 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2968 pMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2972 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2973 pMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2975 // --- Silicon (bus)
2977 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2978 pMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2980 // --- Place the sensitive part of the strips into its mother (ISV1)
2983 for (j = 1; j <= 22; ++j) {
2984 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2985 else xpos = -dbox1[0] + dits[0];
2986 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
2987 pMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2990 // --- Place the electronics of the strips into its mother (SSV1)
2993 for (j = 1; j <= 22; ++j) {
2994 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2995 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2996 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
2997 pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3000 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3002 xpos = -dsrv[0] + .41;
3005 // --- Left tube (just a matter of convention)
3008 pMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3009 pMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3011 // --- Right tube (just a matter of convention)
3014 pMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3015 pMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3017 // --- Place the heat bridge elements into their mother (SSV1)
3019 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3021 for (j = 1; j <= 23; ++j) {
3022 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3023 pMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3026 // --- Place the elements connecting the triangles of the heat bridge
3027 // into their mother (SSV1)
3031 // --- Left element (just a matter of convention)
3033 xpos = -dsrv[0] + .47;
3034 ypos = -(2.1+0.015);
3035 pMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3037 // --- Right element
3039 xpos = -dsrv[0] + .47;
3041 pMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3045 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3047 pMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3049 // --- Place the ghost volumes containing the strip ladders (ISV1),
3050 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3051 // their mother volume (IT56)
3053 offset1 = TMath::ATan2(.8, 36.6);
3055 rzero = dbox1[0] + 36.6;
3056 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3057 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3058 for (i = 1; i <= 32; ++i) {
3059 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3060 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3062 // --- Strip ladders
3064 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3065 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3067 pMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3069 // --- Electronics/cooling
3071 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3072 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3074 pMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3076 // --- End-ladders (nagative-Z and positive-Z)
3078 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3079 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3080 zpos = -(dbox1[2] + dela[2] + 6.);
3081 pMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3082 zpos = dbox1[2] + dela[2] + 6.;
3083 pMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3089 // GOTO 6778 ! skip ITS layer no. 6
3091 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3092 // it with air or vacuum
3094 dbox2[0] = (0.0600+2.*0.0150)/2.;
3096 dbox2[2] = 94.13/2.;
3097 pMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3099 // --- Make the ghost volume invisible
3101 pMC->Gsatt("ISV2", "SEEN", 0);
3103 // --- Define a ghost volume containing the electronics and cooling of
3104 // a single ladder of layer #6 and fill it with air or vacuum
3106 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3109 pMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3111 // --- Make the ghost volume invisible
3113 pMC->Gsatt("SSV2", "SEEN", 0);
3115 // --- Define a ghost volume containing the end-ladder stuff of
3116 // a single ladder of layer #6 and fill it with air or vacuum
3121 pMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3123 // --- Make the ghost volume invisible
3125 pMC->Gsatt("ELL6", "SEEN", 0);
3127 // --- Define a volume containing the sensitive part of the strips
3128 // (silicon, layer #6)
3133 pMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3135 // --- Define a volume containing the electronics of the strips
3136 // (silicon, layer #6)
3141 pMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3143 // --- Define the cooling tubes (aluminum, layer #6)
3146 dtub[1] = dtub[0] + .01;
3148 pMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3150 // --- Define the cooling fluid (water or freon, layer #6)
3155 pMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3156 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3158 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3166 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3167 dfra[6] = dfra[5] + .03;
3171 pMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3173 // --- Define the element connecting the triangles of the heat bridge
3174 // (carbon, layer #6)
3179 pMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3181 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3184 dpla[0] = (10./(8.*7.))/2;
3187 pMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3189 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3191 dcop[0] = (2./(8.*7.))/2;
3194 pMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3196 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3198 depx[0] = (30./(8.*7.))/2.;
3201 pMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3203 // --- Define the part of the end-ladder stuff made of silicon (bus)
3206 dsil[0] = (20./(8.*7.))/2.;
3209 pMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3211 // --- Place the end-ladder stuff into its mother (ELL5)
3213 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3219 xpos = -dela[0] + dpla[0];
3220 pMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3224 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3225 pMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3229 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3230 pMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3232 // --- Silicon (bus)
3234 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3235 pMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3237 // --- Place the sensitive part of the strips into its mother (ISV2)
3240 for (j = 1; j <= 24; ++j) {
3241 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3242 else xpos = dbox2[0] - dits[0];
3243 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3244 pMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3247 // --- Place the electronics of the strips into its mother (SSV2)
3250 for (j = 1; j <= 24; ++j) {
3251 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3252 else xpos = -dsrv[0] + .28;
3253 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3254 pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3257 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3259 xpos = -dsrv[0] + .41;
3262 // --- Left tube (just a matter of convention)
3265 pMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3266 pMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3268 // --- Right tube (just a matter of convention)
3271 pMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3272 pMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3274 // --- Place the heat bridge elements into their mother (SSV2)
3276 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3278 for (j = 1; j <= 25; ++j) {
3279 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3280 pMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3283 // --- Place the elements connecting the triangles of the heat bridge
3284 // into their mother (SSV2)
3288 // --- Left element (just a matter of convention)
3290 xpos = -dsrv[0] + .47;
3291 ypos = -(2.1+0.015);
3292 pMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3294 // --- Right element
3296 xpos = -dsrv[0] + .47;
3298 pMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3302 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3304 pMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3306 // --- Place the ghost volumes containing the strip ladders (ISV2),
3307 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3308 // their mother volume (IT56)
3310 offset1 = TMath::ATan2(.9, 41.2);
3312 rzero = dbox2[0] + 41.2;
3313 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3314 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3315 for (i = 1; i <= 36; ++i) {
3316 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3317 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3319 // --- Strip ladders
3321 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3322 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3324 pMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3326 // --- Electronics/cooling
3328 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3329 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3331 pMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3333 // --- End-ladders (nagative-Z and positive-Z)
3335 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3336 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3337 zpos = -(dbox2[2] + dela[2] + 6.);
3338 pMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3339 zpos = dbox2[2] + dela[2] + 6.;
3340 pMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3346 //************************************************************************
3348 //* E N D - C A P S A N D F R A M E S *
3349 //* ========================================= *
3351 //************************************************************************
3353 // --- Define a dummy cylinder for multiple scattering tests
3355 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3358 // DITS(2)=DITS(1)+0.1
3360 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3361 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3364 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3366 // GOTO 8901 ! skip outer wall
3368 if (fMinorVersion == 0 || fMinorVersion == 3) {
3371 dits[1] = dits[0] + .06926;
3372 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3374 pMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3375 pMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3380 // --- The frame between the end-caps (octagonal lay-out) ---
3382 // GOTO 9012 ! skip octagonal frame
3384 if (fMinorVersion == 1) {
3389 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3392 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3394 offset = angle / 2.;
3395 for (i = 0; i < 8; ++i) {
3396 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3397 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3399 pMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3400 pMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3404 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;
3405 aphi2 = 180. - aphi1;
3406 xpos = (xtra[0] + xtra[1]) / 2.;
3407 ypos = (ytra[0] + ytra[1]) / 2.;
3408 zpos = dtra[2] / 2.;
3409 pMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3412 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3413 pMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3414 zpos = -dtra[2] / 2.;
3415 pMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3418 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3419 pMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3422 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;
3423 aphi1 = 180. - aphi2;
3424 xpos = (xtra[1] + xtra[2]) / 2.;
3425 ypos = (ytra[1] + ytra[2]) / 2.;
3426 zpos = dtra[2] / 2.;
3427 pMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3430 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3431 pMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3432 zpos = -dtra[2] / 2.;
3433 pMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3436 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3437 pMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3440 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;
3441 aphi2 = 180. - aphi1;
3442 xpos = (xtra[2] + xtra[3]) / 2.;
3443 ypos = (ytra[2] + ytra[3]) / 2.;
3444 zpos = dtra[2] / 2.;
3445 pMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3448 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3449 pMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3450 zpos = -dtra[2] / 2.;
3451 pMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3454 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3455 pMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3458 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;
3459 aphi1 = 180. - aphi2;
3460 xpos = (xtra[3] + xtra[4]) / 2.;
3461 ypos = (ytra[3] + ytra[4]) / 2.;
3462 zpos = dtra[2] / 2.;
3463 pMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3466 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3467 pMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3468 zpos = -dtra[2] / 2.;
3469 pMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3472 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3473 pMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3476 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;
3477 aphi1 = 180. - aphi2;
3478 xpos = (xtra[4] + xtra[5]) / 2.;
3479 ypos = (ytra[4] + ytra[5]) / 2.;
3480 zpos = dtra[2] / 2.;
3481 pMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3484 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3485 pMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3486 zpos = -dtra[2] / 2.;
3487 pMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3490 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3491 pMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3494 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;
3495 aphi2 = 180. - aphi1;
3496 xpos = (xtra[5] + xtra[6]) / 2.;
3497 ypos = (ytra[5] + ytra[6]) / 2.;
3498 zpos = dtra[2] / 2.;
3499 pMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3502 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3503 pMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3504 zpos = -dtra[2] / 2.;
3505 pMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3508 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3509 pMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3512 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;
3513 aphi1 = 180. - aphi2;
3514 xpos = (xtra[6] + xtra[7]) / 2.;
3515 ypos = (ytra[6] + ytra[7]) / 2.;
3516 zpos = dtra[2] / 2.;
3517 pMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3520 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3521 pMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3522 zpos = -dtra[2] / 2.;
3523 pMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3526 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3527 pMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3530 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;
3531 aphi2 = 180. - aphi1;
3532 xpos = (xtra[7] + xtra[0]) / 2.;
3533 ypos = (ytra[7] + ytra[0]) / 2.;
3534 zpos = dtra[2] / 2.;
3535 pMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3538 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3539 pMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3540 zpos = -dtra[2] / 2.;
3541 pMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3544 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3545 pMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3548 } else if (fMinorVersion == 4) {
3554 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3557 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3559 offset = angle / 2.;
3560 for (i = 0; i < 8; ++i) {
3561 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3562 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3564 pMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3565 pMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3569 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;
3570 aphi2 = 180. - aphi1;
3571 xpos = (xtra[0] + xtra[1]) / 2.;
3572 ypos = (ytra[0] + ytra[1]) / 2.;
3573 zpos = dtra[2] / 2.;
3574 pMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3577 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3578 pMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3579 zpos = -dtra[2] / 2.;
3580 pMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3583 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3584 pMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3587 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;
3588 aphi1 = 180. - aphi2;
3589 xpos = (xtra[1] + xtra[2]) / 2.;
3590 ypos = (ytra[1] + ytra[2]) / 2.;
3591 zpos = dtra[2] / 2.;
3592 pMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3595 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3596 pMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3597 zpos = -dtra[2] / 2.;
3598 pMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3601 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3602 pMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3605 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;
3606 aphi2 = 180. - aphi1;
3607 xpos = (xtra[2] + xtra[3]) / 2.;
3608 ypos = (ytra[2] + ytra[3]) / 2.;
3609 zpos = dtra[2] / 2.;
3610 pMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3613 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3614 pMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3615 zpos = -dtra[2] / 2.;
3616 pMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3619 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3620 pMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3623 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;
3624 aphi1 = 180. - aphi2;
3625 xpos = (xtra[3] + xtra[4]) / 2.;
3626 ypos = (ytra[3] + ytra[4]) / 2.;
3627 zpos = dtra[2] / 2.;
3628 pMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3631 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3632 pMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3633 zpos = -dtra[2] / 2.;
3634 pMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3637 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3638 pMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3641 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;
3642 aphi1 = 180. - aphi2;
3643 xpos = (xtra[4] + xtra[5]) / 2.;
3644 ypos = (ytra[4] + ytra[5]) / 2.;
3645 zpos = dtra[2] / 2.;
3646 pMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3649 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3650 pMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3651 zpos = -dtra[2] / 2.;
3652 pMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3655 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3656 pMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3659 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;
3660 aphi2 = 180. - aphi1;
3661 xpos = (xtra[5] + xtra[6]) / 2.;
3662 ypos = (ytra[5] + ytra[6]) / 2.;
3663 zpos = dtra[2] / 2.;
3664 pMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3667 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3668 pMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3669 zpos = -dtra[2] / 2.;
3670 pMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3673 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3674 pMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3677 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;
3678 aphi1 = 180. - aphi2;
3679 xpos = (xtra[6] + xtra[7]) / 2.;
3680 ypos = (ytra[6] + ytra[7]) / 2.;
3681 zpos = dtra[2] / 2.;
3682 pMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3685 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3686 pMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3687 zpos = -dtra[2] / 2.;
3688 pMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3691 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3692 pMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3695 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;
3696 aphi2 = 180. - aphi1;
3697 xpos = (xtra[7] + xtra[0]) / 2.;
3698 ypos = (ytra[7] + ytra[0]) / 2.;
3699 zpos = dtra[2] / 2.;
3700 pMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3703 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3704 pMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3705 zpos = -dtra[2] / 2.;
3706 pMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3709 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3710 pMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3716 // --- The frame between the end-caps (hexagonal lay-out) ---
3718 // GOTO 9123 ! skip hexagonal frame
3720 if (fMinorVersion == 2) {
3725 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3731 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3733 offset = angle / 2.;
3734 for (i = 0; i < 6; ++i) {
3735 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3736 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3738 pMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3739 pMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3744 xpos = (xtra1[0] + xtra1[1]) / 2.;
3745 ypos = (ytra1[0] + ytra1[1]) / 2.;
3747 pMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3750 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3751 pMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3755 xpos = (xtra1[1] + xtra1[2]) / 2.;
3756 ypos = (ytra1[1] + ytra1[2]) / 2.;
3758 pMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3761 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3762 pMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3766 xpos = (xtra1[2] + xtra1[3]) / 2.;
3767 ypos = (ytra1[2] + ytra1[3]) / 2.;
3769 pMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3772 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3773 pMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3777 xpos = (xtra1[3] + xtra1[4]) / 2.;
3778 ypos = (ytra1[3] + ytra1[4]) / 2.;
3780 pMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3783 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3784 pMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3788 xpos = (xtra1[4] + xtra1[5]) / 2.;
3789 ypos = (ytra1[4] + ytra1[5]) / 2.;
3791 pMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3794 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3795 pMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3799 xpos = (xtra1[5] + xtra1[0]) / 2.;
3800 ypos = (ytra1[5] + ytra1[0]) / 2.;
3802 pMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3805 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3806 pMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3809 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3810 aphi1 = 180. - aphi2;
3811 xpos = (xtra1[0] + xtra1[1]) / 2.;
3812 ypos = (ytra1[0] + ytra1[1]) / 2.;
3813 zpos = dtra2[2] / 2.;
3814 pMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
3817 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3818 pMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3819 zpos = -dtra2[2] / 2.;
3820 pMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
3823 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3824 pMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3827 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3828 aphi2 = 180. - aphi1;
3829 xpos = (xtra1[1] + xtra1[2]) / 2.;
3830 ypos = (ytra1[1] + ytra1[2]) / 2.;
3831 zpos = dtra2[2] / 2.;
3832 pMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
3835 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3836 pMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3837 zpos = -dtra2[2] / 2.;
3838 pMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
3841 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3842 pMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3845 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3846 aphi1 = 180. - aphi2;
3847 xpos = (xtra1[2] + xtra1[3]) / 2.;
3848 ypos = (ytra1[2] + ytra1[3]) / 2.;
3849 zpos = dtra2[2] / 2.;
3850 pMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
3853 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3854 pMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3855 zpos = -dtra2[2] / 2.;
3856 pMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
3859 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3860 pMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3862 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
3863 - 50.*50.))) * raddeg;
3864 aphi2 = 180. - aphi1;
3865 xpos = (xtra1[2] + xtra1[3]) / 2.;
3866 ypos = (ytra1[2] + ytra1[3]) / 2.;
3867 zpos = dtra2[2] / 2.;
3868 pMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
3871 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3872 pMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
3873 zpos = -dtra2[2] / 2.;
3874 pMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
3877 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3878 pMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
3881 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3882 aphi1 = 180. - aphi2;
3883 xpos = (xtra1[3] + xtra1[4]) / 2.;
3884 ypos = (ytra1[3] + ytra1[4]) / 2.;
3885 zpos = dtra2[2] / 2.;
3886 pMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
3889 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3890 pMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
3891 zpos = -dtra2[2] / 2.;
3892 pMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
3895 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3896 pMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
3899 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3900 aphi2 = 180. - aphi1;
3901 xpos = (xtra1[4] + xtra1[5]) / 2.;
3902 ypos = (ytra1[4] + ytra1[5]) / 2.;
3903 zpos = dtra2[2] / 2.;
3904 pMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
3907 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3908 pMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
3909 zpos = -dtra2[2] / 2.;
3910 pMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
3913 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3914 pMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
3917 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3918 aphi1 = 180. - aphi2;
3919 xpos = (xtra1[5] + xtra1[0]) / 2.;
3920 ypos = (ytra1[5] + ytra1[0]) / 2.;
3921 zpos = dtra2[2] / 2.;
3922 pMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
3925 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3926 pMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
3927 zpos = -dtra2[2] / 2.;
3928 pMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
3931 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3932 pMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
3934 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3935 aphi2 = 180. - aphi1;
3936 xpos = (xtra1[5] + xtra1[0]) / 2.;
3937 ypos = (ytra1[5] + ytra1[0]) / 2.;
3938 zpos = dtra2[2] / 2.;
3939 pMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
3942 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3943 pMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
3944 zpos = -dtra2[2] / 2.;
3945 pMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
3948 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3949 pMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
3952 } else if (fMinorVersion == 5) {
3958 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3964 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3966 offset = angle / 2.;
3967 for (i = 0; i < 6; ++i) {
3968 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3969 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3971 pMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3972 pMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3977 xpos = (xtra1[0] + xtra1[1]) / 2.;
3978 ypos = (ytra1[0] + ytra1[1]) / 2.;
3980 pMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3983 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3984 pMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3988 xpos = (xtra1[1] + xtra1[2]) / 2.;
3989 ypos = (ytra1[1] + ytra1[2]) / 2.;
3991 pMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3994 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3995 pMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3999 xpos = (xtra1[2] + xtra1[3]) / 2.;
4000 ypos = (ytra1[2] + ytra1[3]) / 2.;
4002 pMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
4005 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
4006 pMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
4010 xpos = (xtra1[3] + xtra1[4]) / 2.;
4011 ypos = (ytra1[3] + ytra1[4]) / 2.;
4013 pMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
4016 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
4017 pMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
4021 xpos = (xtra1[4] + xtra1[5]) / 2.;
4022 ypos = (ytra1[4] + ytra1[5]) / 2.;
4024 pMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
4027 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
4028 pMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
4032 xpos = (xtra1[5] + xtra1[0]) / 2.;
4033 ypos = (ytra1[5] + ytra1[0]) / 2.;
4035 pMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
4038 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
4039 pMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4042 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4043 aphi1 = 180. - aphi2;
4044 xpos = (xtra1[0] + xtra1[1]) / 2.;
4045 ypos = (ytra1[0] + ytra1[1]) / 2.;
4046 zpos = dtra2[2] / 2.;
4047 pMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
4050 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4051 pMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4052 zpos = -dtra2[2] / 2.;
4053 pMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
4056 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4057 pMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4060 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4061 aphi2 = 180. - aphi1;
4062 xpos = (xtra1[1] + xtra1[2]) / 2.;
4063 ypos = (ytra1[1] + ytra1[2]) / 2.;
4064 zpos = dtra2[2] / 2.;
4065 pMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
4068 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4069 pMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4070 zpos = -dtra2[2] / 2.;
4071 pMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
4074 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4075 pMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4078 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4079 aphi1 = 180. - aphi2;
4080 xpos = (xtra1[2] + xtra1[3]) / 2.;
4081 ypos = (ytra1[2] + ytra1[3]) / 2.;
4082 zpos = dtra2[2] / 2.;
4083 pMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
4086 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4087 pMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4088 zpos = -dtra2[2] / 2.;
4089 pMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
4092 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4093 pMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4095 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4096 aphi2 = 180. - aphi1;
4097 xpos = (xtra1[2] + xtra1[3]) / 2.;
4098 ypos = (ytra1[2] + ytra1[3]) / 2.;
4099 zpos = dtra2[2] / 2.;
4100 pMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
4103 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4104 pMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4105 zpos = -dtra2[2] / 2.;
4106 pMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
4109 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4110 pMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4113 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4114 aphi1 = 180. - aphi2;
4115 xpos = (xtra1[3] + xtra1[4]) / 2.;
4116 ypos = (ytra1[3] + ytra1[4]) / 2.;
4117 zpos = dtra2[2] / 2.;
4118 pMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
4121 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4122 pMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4123 zpos = -dtra2[2] / 2.;
4124 pMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
4127 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4128 pMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4131 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4132 aphi2 = 180. - aphi1;
4133 xpos = (xtra1[4] + xtra1[5]) / 2.;
4134 ypos = (ytra1[4] + ytra1[5]) / 2.;
4135 zpos = dtra2[2] / 2.;
4136 pMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
4139 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4140 pMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4141 zpos = -dtra2[2] / 2.;
4142 pMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
4145 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4146 pMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4149 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4150 aphi1 = 180. - aphi2;
4151 xpos = (xtra1[5] + xtra1[0]) / 2.;
4152 ypos = (ytra1[5] + ytra1[0]) / 2.;
4153 zpos = dtra2[2] / 2.;
4154 pMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
4157 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4158 pMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4159 zpos = -dtra2[2] / 2.;
4160 pMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
4163 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4164 pMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4166 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4167 aphi2 = 180. - aphi1;
4168 xpos = (xtra1[5] + xtra1[0]) / 2.;
4169 ypos = (ytra1[5] + ytra1[0]) / 2.;
4170 zpos = dtra2[2] / 2.;
4171 pMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
4174 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4175 pMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4176 zpos = -dtra2[2] / 2.;
4177 pMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
4180 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4181 pMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4187 // --- Define the end-caps
4189 // GOTO 9234 ! skip both end-caps
4191 // --- Define the Z>0 end-cap
4193 // GOTO 9345 ! skip the Z>0 end-cap
4198 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4199 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4202 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4203 // end-ladder electro
4204 pMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4205 pMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4207 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4209 // In the Simonetti's drawings 52. In the TP 50.
4213 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4214 // end-ladder electro
4215 pMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4216 pMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4220 dtube[2] = 26.8/2./10.;
4223 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4225 pMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4226 pMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4232 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4233 // end-ladder electron
4236 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4237 // end-ladder electronics
4243 pMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4244 pMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4250 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4254 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4261 pMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4262 pMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4264 if (fMinorVersion < 3 ) {
4266 dpgon[0] = offset2 + 360./(2.*35.);
4270 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4274 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4281 pMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4282 pMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4284 dpgon[0] = offset2 + 360./(2.*39.);
4288 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4292 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4299 pMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4300 pMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4302 if (fMinorVersion > 2 && fMinorVersion < 6) {
4304 dpgon[0] = offset2 + 5.625;
4308 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4309 // end-ladder electronics
4312 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4313 // end-ladder electr
4319 pMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4320 pMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4322 dpgon[0] = offset2 + 5.;
4326 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4327 // end-ladder electronics
4330 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4331 // end-ladder electr
4337 pMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4338 pMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4343 // --- Define the Z<0 end-cap
4345 // GOTO 9456 ! skip the Z<0 end-cap
4348 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4349 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4354 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4355 // end-ladder electr
4356 pMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4358 pMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4360 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4362 // In the Simonetti's drawings 52. In the TP 50.
4366 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4367 // end-ladder electr
4368 pMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4370 pMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4374 dtube[2] = 26.8/2./10.;
4377 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4379 pMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4381 pMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4387 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4388 // end-ladder electronics
4391 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4392 // end-ladder electro
4398 pMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4399 pMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4405 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4409 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4416 pMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4417 pMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4419 if (fMinorVersion < 3) {
4421 dpgon[0] = offset2 + 360./(2.*35.);
4425 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4429 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4436 pMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4437 pMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4439 dpgon[0] = offset2 + 360./(2.*39.);
4443 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4447 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4454 pMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4455 pMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4457 if (fMinorVersion > 2 && fMinorVersion < 6) {
4459 dpgon[0] = offset2 + 5.625;
4463 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4464 // end-ladder electronics
4467 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4468 // end-ladder electr
4474 pMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4475 pMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4477 dpgon[0] = offset2 + 5.;
4481 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4482 // end-ladder electronics
4485 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4486 // end-ladder electr
4492 pMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4493 pMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4499 // --- Outputs the geometry tree in the EUCLID/CAD format
4502 pMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4506 //_____________________________________________________________________________
4507 void AliITSv3::CreateMaterials()
4510 // Create Materials for ITS
4512 AliITS::CreateMaterials();
4515 //_____________________________________________________________________________
4516 void AliITSv3::Init()
4519 // Initialise its after it is built
4524 //_____________________________________________________________________________
4525 void AliITSv3::StepManager()
4528 // Called at every step in ITS
4533 Float_t position[3];
4534 Float_t momentum[4];
4535 TClonesArray &lhits = *fHits;
4536 AliMC* pMC = AliMC::GetMC();
4538 if(pMC->TrackCharge() && pMC->Edep()) {
4540 // Only entering charged tracks
4541 if((id=pMC->CurrentVol(0,copy))==fIdSens1) {
4543 id=pMC->CurrentVolOff(1,0,copy);
4545 id=pMC->CurrentVolOff(2,0,copy);
4547 } else if(id==fIdSens2) {
4549 id=pMC->CurrentVolOff(1,0,copy);
4551 id=pMC->CurrentVolOff(2,0,copy);
4553 } else if(id==fIdSens3) {
4556 id=pMC->CurrentVolOff(1,0,copy);
4558 } else if(id==fIdSens4) {
4561 id=pMC->CurrentVolOff(1,0,copy);
4563 } else if(id==fIdSens5) {
4566 id=pMC->CurrentVolOff(1,0,copy);
4568 } else if(id==fIdSens6) {
4571 id=pMC->CurrentVolOff(1,0,copy);
4574 pMC->TrackPosition(position);
4575 pMC->TrackMomentum(momentum);
4576 hits[0]=position[0];
4577 hits[1]=position[1];
4578 hits[2]=position[2];
4579 hits[3]=momentum[0]*momentum[3];
4580 hits[4]=momentum[1]*momentum[3];
4581 hits[5]=momentum[2]*momentum[3];
4582 hits[6]=pMC->Edep();
4583 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);