1 ///////////////////////////////////////////////////////////////////////////////
3 // Inner Traking System version 4 //
7 <img src="picts/AliITSv4Class.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 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliCallf77.h"
29 # define its_geo4 its_geo4_
30 extern "C" void type_of_call its_geo4(Int_t&, Int_t*);
34 //_____________________________________________________________________________
35 AliITSv4::AliITSv4() : AliITS()
38 // Default constructor for the ITS
43 //_____________________________________________________________________________
44 AliITSv4::AliITSv4(const char *name, const char *title)
48 // Standard constructor
53 //_____________________________________________________________________________
54 void AliITSv4::CreateGeometry()
57 // Create geometry for its version 4
60 Int_t ivers=4*10+fMinorVersion;
61 its_geo4(ivers, fIdtmed->GetArray()-200;
63 // *** DEFINITION OF THE GEOMETRY OF THE ITS ***
64 // *** RB APR-1990 CATANIA ***
65 // ORIGIN : ROBERTO BARBERA
67 Float_t xx[13] = { 0.,0.,-4.824,-4.833,-22.167,-22.585,-28.07,-27.626,
68 -38.139,-19.749,-13.449,-14.726,0. };
69 Float_t yy[13] = { 0.,34.028,34.064,
70 32.594,29.984,30.914,29.18,27.777,22.522,-7.918,-4.769,-2.216,0. };
71 Float_t xbeg[12] = { 0.,-.497,-4.827,-5.425,-22.395,-23.009,-27.919,
72 -28.161,-37.859,-19.337,-13.673,-13.773 };
73 Float_t ybeg[12] = { .43,34.032,33.564,
74 32.505,30.493,30.781,28.702,27.509,22.058,-7.711,-4.322,-2.073 };
75 Float_t xend[12] = { 0.,-4.323,-4.83,-21.643,-22.395,-27.593,-27.807,
76 -37.655,-19.988,-13.897,-14.294,-.425 };
77 Float_t yend[12] = { 33.531,34.06,33.192,
78 30.064,30.493,29.33,28.347,22.764,-7.523,-4.992,-3.077,-.064 };
79 Float_t xarc[12] = { -19.56,-14.12,-13.669,-.5,-.5,-4.327,-5.529,-21.746,
80 -22.858,-27.442,-28.474,-37.431 };
81 Float_t yarc[12] = { -7.264,-4.545,-2.765,
82 .431,33.531,33.56,33.197,30.756,30.304,28.854,28.136,22.316 };
83 Float_t rarc[12] = { .5,.5,.7,.5,.5,.5,.7,.7,.5,.5,.7,.5 };
89 static Double_t biga, bigb;
90 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5], dfra[10], dcer[3], dkap[3], dpla[3], xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
91 atheta1213, dbus[3], dtub[3], dwat[3], depx[3], dits[3], atheta1112, atheta1011, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
92 static Double_t biga1, bigb1;
93 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3], dtra4[3], dbox1[3], dbox2[3];
95 Float_t xtra1[6], ytra1[6], ztra1[6];
99 Float_t angle, dcone[5], dtube[3], dpgon[10];
100 Float_t rzero, xzero, yzero;
101 static Double_t coeffa, coeffb, coeffc;
103 Float_t atheta, offset;
104 Float_t offset1, offset2, dgh[15];
105 extern Double_t atg_(Float_t *, real *);
106 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56, atheta67, atheta78, atheta89, yos, xxm, dal1[3], dal2[3];
108 static Double_t xcc1, ycc1, xcc2, ycc2;
111 Int_t *idtmed = fIdtmed->GetArray()-199;
113 #define natra_ref(a_0,a_1) &natra[(a_1)*4 + a_0 - 4]
114 #define natra1_ref(a_0,a_1) &natra1[(a_1)*4 + a_0 - 4]
115 #define natra2_ref(a_0,a_1) &natra2[(a_1)*4 + a_0 - 4]
116 #define natra3_ref(a_0,a_1) &natra3[(a_1)*4 + a_0 - 4]
117 #define natra4_ref(a_0,a_1) &natra4[(a_1)*4 + a_0 - 4]
120 // --- Define ghost volume containing the whole ITS and fill it with air
139 geant->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
141 // --- Place the ghost volume in its mother volume (ALIC) and make it
144 geant->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
145 geant->Gsatt("ITSV", "SEEN", 0);
147 //************************************************************************
152 //************************************************************************
154 // GOTO 2345 ! skip ITS layer no. 1 and 2
156 //--- Define ghost volume containing the Pixel Detectors and fill it with air
159 xxm = 1.0444222222222224;
163 dgh[3] = -25. - 5.9900000000000002 / xxm;
172 dgh[12] = 5.9900000000000002 / xxm + 25.;
175 geant->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
177 // --- Place the ghost volume in its mother volume (ITSV) and make it
180 geant->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
181 geant->Gsatt("IT12", "SEEN", 0);
183 // --- Define a ghost volume containing a single element of layer #1
184 // and fill it with air or vacuum
186 dbox1[0] = .022499999999999999;
189 geant->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
192 //--- Divide each element of layer #1 in three ladders along the beam direction
194 geant->Gsdvn("IPB1", "IPV1", 3, 3);
196 // --- Make the ghost volumes invisible
198 geant->Gsatt("IPV1", "SEEN", 0);
199 geant->Gsatt("IPB1", "SEEN", 0);
201 // --- Define a volume containing the chip of pixels (silicon, layer #1)
205 dchi[2] = dbox1[2] / 3.;
206 geant->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
208 // --- Define a volume containing the bus of pixels (silicon, layer #1)
213 geant->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
215 // --- Define a volume containing the sensitive part of pixels
216 // (silicon, layer #1)
221 geant->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
223 // --- Place the chip into its mother (IPB1)
225 xpos = dbox1[0] - dchi[0];
228 geant->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
230 // --- Place the sensitive volume into its mother (IPB1)
232 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
233 ypos = dchi[1] - dits[1];
234 zpos = -(dchi[2] - dits[2]);
235 geant->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
237 // --- Place the bus into its mother (IPB1)
239 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
240 ypos = dchi[1] - dbus[1];
241 zpos = -(dchi[2] - dbus[2]);
242 geant->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
244 // --- Define a ghost volume containing a single element of layer #2
245 // and fill it with air or vacuum
247 dbox2[0] = .022499999999999999;
250 geant->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
253 //--- Divide each element of layer #2 in four ladders along the beam direction
255 geant->Gsdvn("IPB2", "IPV2", 4, 3);
257 // --- Make the ghost volumes invisible
259 geant->Gsatt("IPV2", "SEEN", 0);
260 geant->Gsatt("IPB2", "SEEN", 0);
262 // --- Define a volume containing the chip of pixels (silicon, layer #2)
266 dchi[2] = dbox2[2] / 4.;
267 geant->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
269 // --- Define a volume containing the bus of pixels (silicon, layer #2)
274 geant->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
276 // --- Define a volume containing the sensitive part of pixels
277 // (silicon, layer #2)
282 geant->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
284 // --- Place the chip into its mother (IPB2)
286 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
289 geant->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
291 // --- Place the sensitive volume into its mother (IPB2)
293 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
294 ypos = -(dchi[1] - dits[1]);
295 zpos = -(dchi[2] - dits[2]);
296 geant->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
298 // --- Place the bus into its mother (IPB2)
300 xpos = dbox1[0] - dbus[0];
301 ypos = -(dchi[1] - dbus[1]);
302 zpos = -(dchi[2] - dbus[2]);
303 geant->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
305 // --- Define a generic segment of an element of the mechanical support
310 geant->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
312 // --- Define a generic arc of an element of the mechanical support
317 geant->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
319 // --- Define the mechanical supports of layers #1 and #2 and place the
320 // elements of the layers in it
323 // counter over the number of elements of layer #1 (
326 // counter over the number of elements of layer #2 (
327 for (i = 1; i <= 10; ++i) {
329 // --- Place part # 1-2 (see sketch)
331 // number of carbon fiber supports (see sketch)
334 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
336 xcc = (xx[0] + xx[1]) / 20.;
337 ycc = (yy[0] + yy[1]) / 20.;
338 xccc = (xbeg[0] + xend[0]) / 20.;
339 yccc = (ybeg[0] + yend[0]) / 20.;
340 if (xx[0] == xx[1]) {
344 offset2 = atg_(&yy[1] - yy[0], &r2) * raddeg - 90.;
346 aphi = (pphi + (i-1) * 36.) * degrad;
347 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
348 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
349 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
350 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
351 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
352 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
354 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
355 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
356 geant->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
358 // --- Place part # 2-3 (see sketch)
362 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
364 xcc = (xx[1] + xx[2]) / 20.;
365 ycc = (yy[1] + yy[2]) / 20.;
366 xccc = (xbeg[1] + xend[1]) / 20.;
367 yccc = (ybeg[1] + yend[1]) / 20.;
368 if (xx[1] == xx[2]) {
372 offset2 = atg_(&yy[2] - yy[1], &r2) * raddeg - 90.;
374 aphi = (pphi + (i-1) * 36.) * degrad;
375 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
376 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
377 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
378 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
379 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
380 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
382 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
383 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
384 geant->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
386 // --- Place an element of layer #2
388 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
389 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
390 coeffa = biga * biga + 1.;
391 coeffb = biga * bigb - biga * ycc - xcc;
392 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0022212369;
393 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
394 ycc1 = biga * xcc1 + bigb;
396 bigb1 = xcc1 / biga + ycc1;
397 coeffa = biga1 * biga1 + 1.;
398 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
399 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
400 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
401 ycc2 = biga1 * xcc2 + bigb1;
402 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
403 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
404 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
405 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
408 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
410 // --- Place part # 3-4 (see sketch)
414 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
416 xcc = (xx[1] + xx[2]) / 20.;
417 ycc = (yy[1] + yy[2]) / 20.;
418 xccc = (xbeg[2] + xend[2]) / 20.;
419 yccc = (ybeg[2] + yend[2]) / 20.;
420 if (xx[2] == xx[3]) {
424 offset2 = atg_(&yy[3] - yy[2], &r2) * raddeg - 90.;
426 aphi = (pphi + (i-1) * 36.) * degrad;
427 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
428 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
429 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
430 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
431 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
432 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
434 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
435 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
436 geant->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
438 // --- Place part # 4-5 (see sketch)
442 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
444 xcc = (xx[3] + xx[4]) / 20.;
445 ycc = (yy[3] + yy[4]) / 20.;
446 xccc = (xbeg[3] + xend[3]) / 20.;
447 yccc = (ybeg[3] + yend[3]) / 20.;
448 if (xx[3] == xx[4]) {
452 offset2 = atg_(&yy[4] - yy[3], &r2) * raddeg - 90.;
454 aphi = (pphi + (i-1) * 36.) * degrad;
455 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
456 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
457 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
458 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
459 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
460 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
462 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
463 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
464 geant->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
466 // --- Place an element of layer #2
468 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
469 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
470 coeffa = biga * biga + 1.;
471 coeffb = biga * bigb - biga * ycc - xcc;
472 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb + 0.;
476 bigb1 = xcc1 / biga + ycc1;
477 coeffa = biga1 * biga1 + 1.;
478 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
479 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
480 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
481 ycc2 = biga1 * xcc2 + bigb1;
482 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
483 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
484 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
485 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
488 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
490 // --- Place part # 5-6 (see sketch)
494 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
496 xcc = (xx[4] + xx[5]) / 20.;
497 ycc = (yy[4] + yy[5]) / 20.;
498 xccc = (xbeg[4] + xend[4]) / 20.;
499 yccc = (ybeg[4] + yend[4]) / 20.;
500 if (xx[4] == xx[5]) {
504 offset2 = atg_(&yy[5] - yy[4], &r2) * raddeg - 90.;
506 aphi = (pphi + (i-1) * 36.) * degrad;
507 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
508 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
509 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
510 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
511 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
512 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
514 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
515 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
516 geant->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
518 // --- Place part # 6-7 (see sketch)
522 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
524 xcc = (xx[5] + xx[6]) / 20.;
525 ycc = (yy[5] + yy[6]) / 20.;
526 xccc = (xbeg[5] + xend[5]) / 20.;
527 yccc = (ybeg[5] + yend[5]) / 20.;
528 if (xx[5] == xx[6]) {
532 offset2 = atg_(&yy[6] - yy[5], &r2) * raddeg - 90.;
534 aphi = (pphi + (i-1) * 36.) * degrad;
535 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
536 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
537 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
538 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
539 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
540 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
542 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
543 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
544 geant->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
546 // --- Place an element of layer #2
548 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
549 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
550 coeffa = biga * biga + 1.;
551 coeffb = biga * bigb - biga * ycc - xcc;
552 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb + 0.;
556 bigb1 = xcc1 / biga + ycc1;
557 coeffa = biga1 * biga1 + 1.;
558 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
559 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
560 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
561 ycc2 = biga1 * xcc2 + bigb1;
562 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
563 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
564 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
565 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
568 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
570 // --- Place part # 7-8 (see sketch)
574 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
576 xcc = (xx[6] + xx[7]) / 20.;
577 ycc = (yy[6] + yy[7]) / 20.;
578 xccc = (xbeg[6] + xend[6]) / 20.;
579 yccc = (ybeg[6] + yend[6]) / 20.;
580 if (xx[6] == xx[7]) {
584 offset2 = atg_(&yy[7] - yy[6], &r2) * raddeg - 90.;
586 aphi = (pphi + (i-1) * 36.) * degrad;
587 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
588 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
589 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
590 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
591 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
592 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
594 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
595 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
596 geant->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
598 // --- Place part # 8-9 (see sketch)
602 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
604 xcc = (xx[7] + xx[8]) / 20.;
605 ycc = (yy[7] + yy[8]) / 20.;
606 xccc = (xbeg[7] + xend[7]) / 20.;
607 yccc = (ybeg[7] + yend[7]) / 20.;
608 if (xx[1] == xx[2]) {
612 offset2 = atg_(&yy[8] - yy[7], &r2) * raddeg - 90.;
614 aphi = (pphi + (i-1) * 36.) * degrad;
615 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
616 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
617 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
618 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
619 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
620 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
622 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
623 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
624 geant->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
626 // --- Place an element of layer #2
628 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
629 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
630 coeffa = biga * biga + 1.;
631 coeffb = biga * bigb - biga * ycc - xcc;
632 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .055526209599999994;
633 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
634 ycc1 = biga * xcc1 + bigb;
636 bigb1 = xcc1 / biga + ycc1;
637 coeffa = biga1 * biga1 + 1.;
638 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
639 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
640 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
641 ycc2 = biga1 * xcc2 + bigb1;
642 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
643 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
644 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
645 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
648 geant->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
650 // --- Place part # 9-10 (see sketch)
654 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
656 xcc = (xx[8] + xx[9]) / 20.;
657 ycc = (yy[8] + yy[9]) / 20.;
658 xccc = (xbeg[8] + xend[8]) / 20.;
659 yccc = (ybeg[8] + yend[8]) / 20.;
660 if (xx[8] == xx[9]) {
664 offset2 = atg_(&yy[9] - yy[8], &r2) * raddeg - 90.;
666 aphi = (pphi + (i-1) * 36.) * degrad;
667 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
668 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
669 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
670 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
671 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
672 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
674 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
675 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
676 geant->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
678 // --- Place part # 12-13 (see sketch)
682 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
684 xcc = (xx[11] + xx[12]) / 20.;
685 ycc = (yy[11] + yy[12]) / 20.;
686 xccc = (xbeg[11] + xend[11]) / 20.;
687 yccc = (ybeg[11] + yend[11]) / 20.;
688 if (xx[11] == xx[12]) {
691 r2 = xx[12] - xx[11];
692 offset2 = atg_(&yy[12] - yy[11], &r2) * raddeg - 90.;
694 aphi = (pphi + (i-1) * 36.) * degrad;
695 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
696 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
697 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
698 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
699 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
700 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
702 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
703 AliMatrix(idrotm[(i-1) * 13 + 1111], 270., atheta1213, 90., atheta1213 + 270., 0., 0.);
704 geant->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
706 // --- Place an element of layer #1
708 biga = (yy[12] - yy[11]) / (xx[12] - xx[11]);
709 bigb = (xx[12] * yy[11] - xx[11] * yy[12]) / (xx[12] - xx[11]) / 10.;
710 coeffa = biga * biga + 1.;
711 coeffb = biga * bigb - biga * ycc - xcc;
712 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .015792948900000003;
713 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
714 ycc1 = biga * xcc1 + bigb;
716 bigb1 = xcc1 / biga + ycc1;
717 coeffa = biga1 * biga1 + 1.;
718 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
719 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
720 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
721 ycc2 = biga1 * xcc2 + bigb1;
722 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
723 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
724 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
725 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
728 geant->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY");
730 // --- Place part # 11-12 (see sketch)
734 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
736 xcc = (xx[10] + xx[11]) / 20.;
737 ycc = (yy[10] + yy[11]) / 20.;
738 xccc = (xbeg[10] + xend[10]) / 20.;
739 yccc = (ybeg[10] + yend[10]) / 20.;
740 if (xx[10] == xx[11]) {
743 r2 = xx[11] - xx[10];
744 offset2 = atg_(&yy[11] - yy[10], &r2) * raddeg - 90.;
746 aphi = (pphi + (i-1) * 36.) * degrad;
747 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
748 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
749 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
750 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
751 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
752 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
754 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
755 AliMatrix(idrotm[(i-1) * 13 + 1110], 90., atheta1112, 90.,atheta1112 + 90., 0., 0.);
756 geant->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
758 // --- Place part # 10-11 (see sketch)
762 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
764 xcc = (xx[9] + xx[10]) / 20.;
765 ycc = (yy[9] + yy[10]) / 20.;
766 xccc = (xbeg[9] + xend[9]) / 20.;
767 yccc = (ybeg[9] + yend[9]) / 20.;
768 if (xx[9] == xx[10]) {
772 offset2 = atg_(&yy[10] - yy[9], &r2) * raddeg - 90.;
774 aphi = (pphi + (i-1) * 36.) * degrad;
775 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
776 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
777 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
778 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
779 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
780 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
782 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
783 AliMatrix(idrotm[(i-1) * 13 + 1109], 270., atheta1011, 90., atheta1011 + 270., 0., 0.);
784 geant->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
786 // --- Place an element of layer #1
788 biga = (yy[10] - yy[9]) / (xx[10] - xx[9]);
789 bigb = (xx[10] * yy[9] - xx[9] * yy[10]) / (xx[10] - xx[9]) / 10.;
790 coeffa = biga * biga + 1.;
791 coeffb = biga * bigb - biga * ycc - xcc;
792 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 9.9999999999999995e-7;
793 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
794 ycc1 = biga * xcc1 + bigb;
796 bigb1 = xcc1 / biga + ycc1;
797 coeffa = biga1 * biga1 + 1.;
798 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
799 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
800 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
801 ycc2 = biga1 * xcc2 + bigb1;
802 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
803 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
804 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
805 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
808 geant->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY");
810 // --- Place arc # 5 (between part 1-2 and part 2-3) (see sketch)
812 darc[0] = rarc[4] / 10. - .02;
813 darc[1] = rarc[4] / 10.;
815 darc[3] = atheta12 + 90. - (i-1) * 36.;
816 darc[4] = atheta23 + 90. - (i-1) * 36.;
819 aphi = (pphi + (i-1) * 36.) * degrad;
820 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
821 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
822 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
823 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
824 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
825 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
827 geant->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
829 // --- Place arc # 6 (between part 2-3 and part 3-4) (see sketch)
831 darc[0] = rarc[5] / 10. - .02;
832 darc[1] = rarc[5] / 10.;
834 darc[3] = atheta23 - (i-1) * 36.;
835 darc[4] = atheta34 - (i-1) * 36.;
838 aphi = (pphi + (i-1) * 36.) * degrad;
839 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
840 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
841 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
842 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
843 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
844 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
846 geant->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
848 // --- Place arc # 7 (between part 3-4 and part 4-5) (see sketch)
850 darc[0] = rarc[6] / 10. - .02;
851 darc[1] = rarc[6] / 10.;
853 darc[3] = atheta45 + 90. - (i-1) * 36.;
854 darc[4] = atheta34 + 90. - (i-1) * 36.;
857 aphi = (pphi + (i-1) * 36.) * degrad;
858 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
859 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
860 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
861 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
862 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
863 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
865 geant->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
867 // --- Place arc # 8 (between part 4-5 and part 5-6) (see sketch)
869 darc[0] = rarc[7] / 10. - .02;
870 darc[1] = rarc[7] / 10.;
872 darc[3] = atheta56 + 180. - (i-1) * 36.;
873 darc[4] = atheta45 + 180. - (i-1) * 36.;
876 aphi = (pphi + (i-1) * 36.) * degrad;
877 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
878 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
879 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
880 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
881 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
882 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
884 geant->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
886 // --- Place arc # 9 (between part 5-6 and part 6-7) (see sketch)
888 darc[0] = rarc[8] / 10. - .02;
889 darc[1] = rarc[8] / 10.;
891 darc[3] = atheta56 - 90. - (i-1) * 36.;
892 darc[4] = atheta67 - 90. - (i-1) * 36.;
895 aphi = (pphi + (i-1) * 36.) * degrad;
896 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
897 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
898 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
899 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
900 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
901 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
903 geant->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
905 // --- Place arc # 10 (between part 6-7 and part 7-8) (see sketch)
907 darc[0] = rarc[9] / 10. - .02;
908 darc[1] = rarc[9] / 10.;
910 darc[3] = atheta67 - (i-1) * 36.;
911 darc[4] = atheta78 - (i-1) * 36.;
914 aphi = (pphi + (i-1) * 36.) * degrad;
915 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
916 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
917 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
918 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
919 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
920 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
922 geant->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
924 // --- Place arc # 11 (between part 7-8 and part 8-9) (see sketch)
926 darc[0] = rarc[10] / 10. - .02;
927 darc[1] = rarc[10] / 10.;
929 darc[3] = atheta89 - 90. - (i-1) * 36.;
930 darc[4] = atheta78 - 90. - (i-1) * 36.;
931 xcc = xarc[10] / 10.;
932 ycc = yarc[10] / 10.;
933 aphi = (pphi + (i-1) * 36.) * degrad;
934 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
935 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
936 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
937 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
938 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
939 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
941 geant->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
943 // --- Place arc # 12 (between part 8-9 and part 9-10) (see sketch)
945 darc[0] = rarc[11] / 10. - .02;
946 darc[1] = rarc[11] / 10.;
948 darc[3] = atheta89 - (i-1) * 36.;
949 darc[4] = atheta910 - (i-1) * 36.;
950 xcc = xarc[11] / 10.;
951 ycc = yarc[11] / 10.;
952 aphi = (pphi + (i-1) * 36.) * degrad;
953 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
954 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
955 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
956 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
957 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
958 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
960 geant->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
962 // --- Place arc # 1 (between part 9-10 and part 10-11) (see sketch)
964 darc[0] = rarc[0] / 10. - .02;
965 darc[1] = rarc[0] / 10.;
967 darc[3] = atheta1011 + 10. - (i-1) * 36.;
968 darc[4] = atheta910 - 120. - (i-1) * 36.;
971 aphi = (pphi + (i-1) * 36.) * degrad;
972 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
973 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
974 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
975 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
976 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
977 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
979 geant->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
981 // --- Place arc # 2 (between part 10-11 and part 11-12) (see sketch)
983 darc[0] = rarc[1] / 10. - .02;
984 darc[1] = rarc[1] / 10.;
986 darc[3] = atheta1011 - (i-1) * 36.;
987 darc[4] = atheta1112 + 45. - (i-1) * 36.;
990 aphi = (pphi + (i-1) * 36.) * degrad;
991 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
992 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
993 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
994 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
995 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
996 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
998 geant->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1000 // --- Place arc # 3 (between part 11-12 and part 12-13) (see sketch)
1002 darc[0] = rarc[2] / 10. - .02;
1003 darc[1] = rarc[2] / 10.;
1005 darc[3] = atheta1213 + 115. - (i-1) * 36.;
1006 darc[4] = atheta1112 + 115. - (i-1) * 36.;
1007 xcc = xarc[2] / 10.;
1008 ycc = yarc[2] / 10.;
1009 aphi = (pphi + (i-1) * 36.) * degrad;
1010 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1011 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1012 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1013 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1014 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1015 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1017 geant->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1019 // --- Place arc # 4 (between part 12-13 and part 1-2) (see sketch)
1021 darc[0] = rarc[3] / 10. - .02;
1022 darc[1] = rarc[3] / 10.;
1024 darc[3] = atheta1213 - (i-1) * 36.;
1025 darc[4] = atheta12 - (i-1) * 36.;
1026 xcc = xarc[3] / 10.;
1027 ycc = yarc[3] / 10.;
1028 aphi = (pphi + (i-1) * 36.) * degrad;
1029 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1030 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1031 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1032 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1033 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1034 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1036 geant->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1040 //************************************************************************
1045 //************************************************************************
1047 // --- Define a ghost volume containing the Silicon Drift Detectors
1048 // (layer #3 and #4) and fill it with air or vacuum
1050 xxm = 1.0444222222222224;
1054 dgh[3] = -25. - 5.9900000000000002 / xxm -
1055 .0099999999999997868 / xxm - 17.990000000000002 / xxm;
1058 dgh[6] = -25. - 5.9900000000000002 / xxm - .0099999999999997868 / xxm;
1061 dgh[9] = 5.9900000000000002 / xxm + 25. + .0099999999999997868 / xxm;
1064 dgh[12] = 5.9900000000000002 / xxm + 25. +
1065 .0099999999999997868 / xxm + 17.990000000000002 / xxm;
1068 geant->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1070 // --- Place the ghost volume in its mother volume (ITSV) and make it
1073 geant->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1074 geant->Gsatt("IT34", "SEEN", 0);
1078 // GOTO 3456 ! skip ITS layer no. 3
1080 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1081 // smaller lenght of ribs) and fill it with air or vacuum
1083 dbox1[0] = .61539999999999995;
1085 // the widest element is the sensitive element
1086 dbox1[2] = 35.850000000000001;
1087 // 7.5 cm is the lenght
1088 geant->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1090 // --- Make the ghost volume invisible
1092 geant->Gsatt("IDV1", "SEEN", 0);
1094 // --- Define a volume containing the sensitive part of drifts
1095 // (silicon, layer #3)
1098 // see material budget report by G. Feofilov
1101 geant->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1103 //--- Define the part of the (smaller) rib between two sensitive parts made of
1104 // carbon (layer #3)
1106 dsup[0] = .5 - dits[0];
1108 dsup[2] = 35.850000000000001;
1109 // 7.5 cm is the lenght
1110 geant->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1112 //--- Define the first part of the (smaller) rib between two sensitive parts
1113 // made of aluminum (layer #3)
1115 dal1[0] = .5 - dits[0];
1116 dal1[1] = 4.8000000000000001e-4;
1117 dal1[2] = 35.850000000000001;
1118 // 7.5 cm is the lenght
1119 geant->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1121 //--- Define the part of the (smaller) rib between two sensitive parts made of
1122 // kapton (layer #3)
1124 dkap[0] = .5 - dits[0];
1126 dkap[2] = 35.850000000000001;
1127 // 7.5 cm is the lenght
1128 geant->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1130 //--- Define the second part of the (smaller) rib between two sensitive parts
1131 // made of aluminum (layer #3)
1133 dal2[0] = .5 - dits[0];
1134 dal2[1] = .0013500000000000001;
1135 dal2[2] = 35.850000000000001;
1136 // 7.5 cm is the lenght
1137 geant->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1139 // --- Define the part of the (smaller) rib between two sensitive parts
1140 // made of silicon (the electronics) (layer #3)
1142 dchi[0] = .5 - dits[0];
1143 dchi[1] = .0035500000000000002;
1144 dchi[2] = 35.850000000000001;
1145 // 7.5 cm is the lenght
1146 geant->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1148 // --- Define the part of the (smaller) rib between two sensitive parts
1149 // made of water (the cooler) (layer #3)
1151 dwat[0] = .5 - dits[0];
1152 dwat[1] = .0046499999999999996;
1153 dwat[2] = 35.850000000000001;
1154 // 7.5 cm is the lenght
1155 geant->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1157 //--- Define the third part of the (smaller) rib between two sensitive parts
1158 // made of aluminum (the cooling tubes) (layer #3)
1160 dtub[0] = .5 - dits[0];
1161 dtub[1] = 6.7000000000000002e-4;
1162 dtub[2] = 35.850000000000001;
1163 // 7.5 cm is the lenght
1164 geant->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1166 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1169 // twice the foreseen thickness
1172 geant->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1174 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1177 // twice the foreseen thickness
1180 geant->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1182 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1186 // twice the foreseen thickness
1189 geant->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1191 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1194 // twice the foreseen thickness
1197 geant->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1199 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1203 for (j = 1; j <= 5; ++j) {
1204 // odd elements are up and even elements are down
1206 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1207 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1208 } else if (j == 2) {
1209 xpos = -dbox1[0] + dits[0];
1210 zpos = 0. - dits[2] + 1. - dits[2];
1211 } else if (j == 3) {
1212 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1214 } else if (j == 4) {
1215 xpos = -dbox1[0] + dits[0];
1216 zpos = dits[2] + 0. - 1. + dits[2];
1217 } else if (j == 5) {
1218 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1219 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1221 geant->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1224 // --- Place the smaller ribs into their mother (IDV1)
1226 // --- Right ribs (just a matter of convention)
1228 xpos = .5 - dbox1[0] + dits[0];
1234 geant->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1238 ypos = dsup[1] + 2.81 + dal1[1];
1239 geant->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1243 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1244 geant->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1248 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1249 geant->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1251 // --- Silicon (chip)
1253 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1254 geant->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1258 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1259 geant->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1263 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1265 geant->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1267 // --- Right ribs (just a matter of convention)
1272 geant->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1276 ypos = -(dsup[1] + 2.81 + dal1[1]);
1277 geant->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1281 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1282 geant->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1286 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1288 geant->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1290 // --- Silicon (chip)
1292 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1293 2. + dal2[1] * 2. + dchi[1]);
1294 geant->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1298 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1299 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1300 geant->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1304 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1305 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1306 geant->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1308 // --- Place the end-ladder stuff into its mother (IDV1)
1311 // --- Negative-Z end-ladder
1314 zpos = -28.350000000000001;
1318 xpos = dbox1[0] - dpcb[0];
1319 geant->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1323 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1324 geant->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1328 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1329 geant->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1331 // --- Silicon (bus)
1333 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1334 geant->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1336 // --- Positive-Z end-ladder
1339 zpos = 28.350000000000001;
1343 xpos = dbox1[0] - dpcb[0];
1344 geant->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1348 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1349 geant->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1353 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1354 geant->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1356 // --- Silicon (bus)
1358 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1359 geant->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1361 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1362 // larger lenght of ribs) and fill it with air or vacuum
1364 dbox2[0] = .76540000000000008;
1366 // the widest element is the sensitive element
1367 dbox2[2] = 35.850000000000001;
1368 // 7.5 cm is the lenght
1369 geant->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1371 // --- Make the ghost volume invisible
1373 geant->Gsatt("IDV2", "SEEN", 0);
1375 //--- Define the part of the (larger) rib between two sensitive parts madeof
1376 // carbon (layer #3)
1378 dsup[0] = .65 - dits[0];
1380 dsup[2] = 35.850000000000001;
1381 // 7.5 cm is the lenght
1382 geant->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1384 //--- Define the first part of the (larger) rib between two sensitive parts
1385 // made of aluminum (layer #3)
1387 dal1[0] = .65 - dits[0];
1388 dal1[1] = 4.8000000000000001e-4;
1389 dal1[2] = 35.850000000000001;
1390 // 7.5 cm is the lenght
1391 geant->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1393 //--- Define the part of the (larger) rib between two sensitive parts madeof
1394 // kapton (layer #3)
1396 dkap[0] = .65 - dits[0];
1398 dkap[2] = 35.850000000000001;
1399 // 7.5 cm is the lenght
1400 geant->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1402 //--- Define the second part of the (larger) rib between two sensitive parts
1403 // made of aluminum (layer #3)
1405 dal2[0] = .65 - dits[0];
1406 dal2[1] = .0013500000000000001;
1407 dal2[2] = 35.850000000000001;
1408 // 7.5 cm is the lenght
1409 geant->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1411 // --- Define the part of the (larger) rib between two sensitive parts
1412 // made of silicon (the electronics) (layer #3)
1414 dchi[0] = .65 - dits[0];
1415 dchi[1] = .0035500000000000002;
1416 dchi[2] = 35.850000000000001;
1417 // 7.5 cm is the lenght
1418 geant->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1420 // --- Define the part of the (larger) rib between two sensitive parts
1421 // made of water (the cooler) (layer #3)
1423 dwat[0] = .65 - dits[0];
1424 dwat[1] = .0046499999999999996;
1425 dwat[2] = 35.850000000000001;
1426 // 7.5 cm is the lenght
1427 geant->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1429 //--- Define the third part of the (larger) rib between two sensitive parts
1430 // made of aluminum (the cooling tubes) (layer #3)
1432 dtub[0] = .65 - dits[0];
1433 dtub[1] = 6.7000000000000002e-4;
1434 dtub[2] = 35.850000000000001;
1435 // 7.5 cm is the lenght
1436 geant->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1438 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1442 for (j = 1; j <= 5; ++j) {
1443 // odd element are up and even elements are down
1445 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1446 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1447 } else if (j == 2) {
1448 xpos = -dbox2[0] + dits[0];
1449 zpos = 0. - dits[2] + 1. - dits[2];
1450 } else if (j == 3) {
1451 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1453 } else if (j == 4) {
1454 xpos = -dbox2[0] + dits[0];
1455 zpos = dits[2] + 0. - 1. + dits[2];
1456 } else if (j == 5) {
1457 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1458 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1460 geant->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1463 // --- Place the larger ribs into their mother (IDV2)
1466 // --- Right ribs (just a matter of convention)
1468 xpos = .65 - dbox2[0] + dits[0];
1474 geant->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1478 ypos = dsup[1] + 2.81 + dal1[1];
1479 geant->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1483 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1484 geant->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1488 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1489 geant->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1491 // --- Silicon (chip)
1493 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1494 geant->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1498 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1499 geant->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1503 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1505 geant->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1507 // --- Right ribs (just a matter of convention)
1512 geant->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1516 ypos = -(dsup[1] + 2.81 + dal1[1]);
1517 geant->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1521 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1522 geant->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1526 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1528 geant->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1530 // --- Silicon (chip)
1532 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1533 2. + dal2[1] * 2. + dchi[1]);
1534 geant->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1538 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1539 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1540 geant->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1544 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1545 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1546 geant->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1548 // --- Place the end-ladder stuff into its mother (IDV1)
1551 // --- Negative-Z end-ladder
1554 zpos = -28.350000000000001;
1558 xpos = dbox2[0] - dpcb[0];
1559 geant->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1563 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1564 geant->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1568 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1569 geant->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1571 // --- Silicon (bus)
1573 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1574 geant->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1576 // --- Positive-Z end-ladder
1579 zpos = 28.350000000000001;
1583 xpos = dbox2[0] - dpcb[0];
1584 geant->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1588 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1589 geant->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1593 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1594 geant->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1596 // --- Silicon (bus)
1598 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1599 geant->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1601 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1602 // mother volume (IT34)
1603 // Odd elements have large ribs and even elements have small ribs
1605 for (i = 1; i <= 12; ++i) {
1606 atheta = (i-1) * 30.;
1607 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1610 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1611 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1613 geant->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1616 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1617 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1619 geant->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1626 // GOTO 4567 ! skip ITS layer no. 4
1628 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1629 // smaller lenght of ribs) and fill it with air or vacuum
1631 dbox1[0] = .61539999999999995;
1633 // the widest element is the end-ladder stuff
1634 dbox1[2] = 43.449999999999996;
1635 // 7.5 cm is the lenght
1636 geant->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1638 // --- Make the ghost volume invisible
1640 geant->Gsatt("IDV3", "SEEN", 0);
1642 // --- Define a volume containing the sensitive part of drifts
1643 // (silicon, layer #4)
1646 // see material budget report by G. Feofilov
1649 geant->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1651 //--- Define the part of the (smaller) rib between two sensitive parts made of
1652 // carbon (layer #4)
1654 dsup[0] = .5 - dits[0];
1656 dsup[2] = 43.449999999999996;
1657 // 7.5 cm is the lengh
1658 geant->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1660 //--- Define the first part of the (smaller) rib between two sensitive parts
1661 // made of aluminum (layer #4)
1663 dal1[0] = .5 - dits[0];
1664 dal1[1] = 4.8000000000000001e-4;
1665 dal1[2] = 43.449999999999996;
1666 // 7.5 cm is the lengh
1667 geant->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1669 //--- Define the part of the (smaller) rib between two sensitive parts made of
1670 // kapton (layer #4)
1672 dkap[0] = .5 - dits[0];
1674 dkap[2] = 43.449999999999996;
1675 // 7.5 cm is the lengh
1676 geant->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1678 //--- Define the second part of the (smaller) rib between two sensitive parts
1679 // made of aluminum (layer #4)
1681 dal2[0] = .5 - dits[0];
1682 dal2[1] = .0013500000000000001;
1683 dal2[2] = 43.449999999999996;
1684 // 7.5 cm is the lengh
1685 geant->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1687 // --- Define the part of the (smaller) rib between two sensitive parts
1688 // made of silicon (the electronics) (layer #4)
1690 dchi[0] = .5 - dits[0];
1691 dchi[1] = .0035500000000000002;
1692 dchi[2] = 43.449999999999996;
1693 // 7.5 cm is the lengh
1694 geant->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1696 // --- Define the part of the (smaller) rib between two sensitive parts
1697 // made of water (the cooler) (layer #4)
1699 dwat[0] = .5 - dits[0];
1700 dwat[1] = .0046499999999999996;
1701 dwat[2] = 43.449999999999996;
1702 // 7.5 cm is the lenght
1703 geant->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1705 //--- Define the third part of the (smaller) rib between two sensitive parts
1706 // made of aluminum (the cooling tubes) (layer #4)
1708 dtub[0] = .5 - dits[0];
1709 dtub[1] = 6.7000000000000002e-4;
1710 dtub[2] = 43.449999999999996;
1711 // 7.5 cm is the lengh
1712 geant->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1714 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1717 // twice the foreseen thickness
1720 geant->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1722 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1725 // twice the foreseen thickness
1728 geant->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1730 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1734 // twice the foreseen thickness
1737 geant->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1739 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1742 // twice the foreseen thickness
1745 geant->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1747 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1751 for (j = 1; j <= 7; ++j) {
1752 // odd elements are down and even elements are up
1754 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1755 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1756 } else if (j == 2) {
1757 xpos = -dbox1[0] + dits[0];
1758 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1759 } else if (j == 3) {
1760 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1761 zpos = 0. - dits[2] + .7 - dits[2];
1762 } else if (j == 4) {
1763 xpos = -dbox1[0] + dits[0];
1765 } else if (j == 5) {
1766 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1767 zpos = dits[2] + 0. - .7 + dits[2];
1768 } else if (j == 6) {
1769 xpos = -dbox1[0] + dits[0];
1770 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1771 } else if (j == 7) {
1772 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1773 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1775 geant->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1778 // --- Place the smaller ribs into their mother (IDV3)
1780 // --- Right ribs (just a matter of convention)
1782 xpos = .5 - dbox1[0] + dits[0];
1788 geant->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1792 ypos = dsup[1] + 2.81 + dal1[1];
1793 geant->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1797 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1798 geant->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1802 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1803 geant->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1805 // --- Silicon (chip)
1807 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1808 geant->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1812 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1813 geant->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1817 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1819 geant->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1821 // --- Right ribs (just a matter of convention)
1826 geant->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1830 ypos = -(dsup[1] + 2.81 + dal1[1]);
1831 geant->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1835 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1836 geant->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1840 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1841 geant->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1843 // --- Silicon (chip)
1845 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1846 geant->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1850 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1851 geant->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1855 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1856 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1857 geant->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1859 // --- Place the end-ladder stuff into its mother (IDV1)
1862 // --- Negative-Z end-ladder
1865 zpos = -35.949999999999996;
1869 xpos = dbox1[0] - dpcb[0];
1870 geant->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1874 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1875 geant->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1879 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1880 geant->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1882 // --- Silicon (bus)
1884 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1885 geant->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1887 // --- Positive-Z end-ladder
1890 zpos = 35.949999999999996;
1894 xpos = dbox1[0] - dpcb[0];
1895 geant->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1899 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1900 geant->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1904 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1905 geant->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1907 // --- Silicon (bus)
1909 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1910 geant->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1912 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1913 // larger lenght of ribs) and fill it with air or vacuum
1915 dbox2[0] = .76540000000000008;
1917 // the widest element is the end-ladder stuff
1918 dbox2[2] = 43.449999999999996;
1919 // 7.5 cm is the lenght
1920 geant->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
1922 // --- Make the ghost volume invisible
1924 geant->Gsatt("IDV4", "SEEN", 0);
1926 //--- Define the part of the (larger) rib between two sensitive parts madeof
1927 // carbon (layer #4)
1929 dsup[0] = .65 - dits[0];
1931 dsup[2] = 43.449999999999996;
1932 // 7.5 cm is the lengh
1933 geant->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
1935 //--- Define the first part of the (larger) rib between two sensitive parts
1936 // made of aluminum (layer #4)
1938 dal1[0] = .65 - dits[0];
1939 dal1[1] = 4.8000000000000001e-4;
1940 dal1[2] = 43.449999999999996;
1941 // 7.5 cm is the lengh
1942 geant->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
1944 //--- Define the part of the (larger) rib between two sensitive parts madeof
1945 // kapton (layer #4)
1947 dkap[0] = .65 - dits[0];
1949 dkap[2] = 43.449999999999996;
1950 // 7.5 cm is the lengh
1951 geant->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
1953 //--- Define the second part of the (larger) rib between two sensitive parts
1954 // made of aluminum (layer #4)
1956 dal2[0] = .65 - dits[0];
1957 dal2[1] = .0013500000000000001;
1958 dal2[2] = 43.449999999999996;
1959 // 7.5 cm is the lengh
1960 geant->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
1962 // --- Define the part of the (larger) rib between two sensitive parts
1963 // made of silicon (the electronics) (layer #4)
1965 dchi[0] = .65 - dits[0];
1966 dchi[1] = .0035500000000000002;
1967 dchi[2] = 43.449999999999996;
1968 // 7.5 cm is the lengh
1969 geant->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
1971 // --- Define the part of the (larger) rib between two sensitive parts
1972 // made of water (the cooler) (layer #4)
1974 dwat[0] = .65 - dits[0];
1975 dwat[1] = .0046499999999999996;
1976 dwat[2] = 43.449999999999996;
1977 // 7.5 cm is the lengh
1978 geant->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
1980 //--- Define the third part of the (larger) rib between two sensitive parts
1981 // made of aluminum (the cooling tubes) (layer #4)
1983 dtub[0] = .65 - dits[0];
1984 dtub[1] = 6.7000000000000002e-4;
1985 dtub[2] = 43.449999999999996;
1986 // 7.5 cm is the lengh
1987 geant->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
1989 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1993 for (j = 1; j <= 7; ++j) {
1994 // odd elements are down and even elements are up
1996 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1997 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1998 } else if (j == 2) {
1999 xpos = -dbox2[0] + dits[0];
2000 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2001 } else if (j == 3) {
2002 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2003 zpos = 0. - dits[2] + .7 - dits[2];
2004 } else if (j == 4) {
2005 xpos = -dbox2[0] + dits[0];
2007 } else if (j == 5) {
2008 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2009 zpos = dits[2] + 0. - .7 + dits[2];
2010 } else if (j == 6) {
2011 xpos = -dbox2[0] + dits[0];
2012 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2013 } else if (j == 7) {
2014 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2015 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2017 geant->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2020 // --- Place the larger ribs into their mother (IDV4)
2023 // --- Right ribs (just a matter of convention)
2025 xpos = .65 - dbox2[0] + dits[0];
2031 geant->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2035 ypos = dsup[1] + 2.81 + dal1[1];
2036 geant->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2040 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2041 geant->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2045 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2046 geant->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2048 // --- Silicon (chip)
2050 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2051 geant->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2055 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2056 geant->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2060 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2062 geant->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2064 // --- Right ribs (just a matter of convention)
2069 geant->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2073 ypos = -(dsup[1] + 2.81 + dal1[1]);
2074 geant->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2078 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2079 geant->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2083 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2085 geant->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2087 // --- Silicon (chip)
2089 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2090 2. + dal2[1] * 2. + dchi[1]);
2091 geant->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2095 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2096 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2097 geant->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2101 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2102 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2103 geant->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2105 // --- Place the end-ladder stuff into its mother (IDV1)
2108 // --- Negative-Z end-ladder
2111 zpos = -35.949999999999996;
2115 xpos = dbox2[0] - dpcb[0];
2116 geant->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2120 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2121 geant->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2125 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2126 geant->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2128 // --- Silicon (bus)
2130 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2131 geant->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2133 // --- Positive-Z end-ladder
2136 zpos = 35.949999999999996;
2140 xpos = dbox2[0] - dpcb[0];
2141 geant->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2145 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2146 geant->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2150 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2151 geant->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2153 // --- Silicon (bus)
2155 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2156 geant->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2158 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2159 // mother volume (IT34)
2160 // Odd elements have large ribs and even elements have small ribs
2162 for (i = 1; i <= 24; ++i) {
2163 atheta = (i-1) * 15.;
2164 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2167 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2168 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2170 geant->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2172 rzero = 23.399999999999999;
2173 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2174 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2176 geant->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2181 //************************************************************************
2186 //************************************************************************
2188 // --- Define SSD with the 35+39 lay-out
2190 if (fMinorVersion == 0 || fMinorVersion == 1 || fMinorVersion ==2) {
2192 //--- Define ghost volume containing the Strip Detectors and fill it with air
2195 xxm = 1.0444222222222224;
2199 dgh[3] = -25. - 5.9900000000000002 / xxm -
2200 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 10. / xxm - 12.997999999999998 / xxm;
2203 dgh[6] = -25. - 5.9900000000000002 / xxm -
2204 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 10. / xxm;
2207 dgh[9] = 5.9900000000000002 / xxm + 25. +
2208 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 10. / xxm;
2211 dgh[12] = 5.9900000000000002 / xxm + 25. +
2212 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 10. / xxm + 12.997999999999998 / xxm;
2215 geant->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2216 geant->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2217 geant->Gsatt("IT56", "SEEN", 0);
2221 // GOTO 5678 ! skip ITS layer no. 5
2223 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2224 // it with air or vacuum
2226 dbox1[0] = .044999999999999998;
2228 dbox1[2] = 45.109999999999999;
2229 geant->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2231 // --- Make the ghost volume invisible
2233 geant->Gsatt("ISV1", "SEEN", 0);
2235 // --- Define a ghost volume containing the electronics and cooling of
2236 // a single ladder of layer #5 and fill it with air or vacuum
2238 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2240 dsrv[2] = 45.109999999999999;
2241 geant->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2243 // --- Make the ghost volume invisible
2245 geant->Gsatt("SSV1", "SEEN", 0);
2247 // --- Define a ghost volume containing the end-ladder stuff of
2248 // a single ladder of layer #5 and fill it with air or vacuum
2253 geant->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2255 // --- Make the ghost volume invisible
2257 geant->Gsatt("ELL5", "SEEN", 0);
2259 // --- Define a volume containing the sensitive part of the strips
2260 // (silicon, layer #5)
2265 geant->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2267 // --- Define a volume containing the electronics of the strips
2268 // (silicon, layer #5)
2273 geant->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2275 // --- Define the cooling tubes (aluminum, layer #5)
2278 dtub[1] = dtub[0] + .01;
2279 dtub[2] = 45.109999999999999;
2280 geant->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2282 // --- Define the cooling fluid (water or freon, layer #5)
2286 dwat[2] = 45.109999999999999;
2287 geant->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2288 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2290 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2298 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2299 dfra[6] = dfra[5] + .03;
2303 geant->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2305 // --- Define the element connecting the triangles of the heat bridge
2306 // (carbon, layer #5)
2310 dcei[2] = 45.109999999999999;
2311 geant->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2313 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2316 dpla[0] = .089285714285714288;
2319 geant->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2321 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2323 dcop[0] = .017857142857142856;
2326 geant->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2328 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2330 depx[0] = .26785714285714285;
2333 geant->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2335 // --- Define the part of the end-ladder stuff made of silicon (bus)
2338 dsil[0] = .17857142857142858;
2341 geant->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2343 // --- Place the end-ladder stuff into its mother (ELL5)
2345 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2351 xpos = -dela[0] + dpla[0];
2352 geant->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2356 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2357 geant->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2361 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2362 geant->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2364 // --- Silicon (bus)
2366 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2367 geant->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2369 // --- Place the sensitive part of the strips into its mother (ISV1)
2372 for (j = 1; j <= 23; ++j) {
2373 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2374 else xpos = -dbox1[0] + dits[0];
2375 zpos = ((j - 1) - 11.) * 3.91;
2376 geant->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2379 // --- Place the electronics of the strips into its mother (SSV1)
2382 for (j = 1; j <= 23; ++j) {
2383 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2384 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2385 zpos = ((j - 1) - 11.) * 3.91 + .85;
2386 geant->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2389 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2391 xpos = -dsrv[0] + .41;
2394 // --- Left tube (just a matter of convention)
2396 ypos = -2.3500000000000001;
2397 geant->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2398 geant->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2400 // --- Right tube (just a matter of convention)
2402 ypos = 2.3500000000000001;
2403 geant->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2404 geant->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2406 // --- Place the heat bridge elements into their mother (SSV1)
2408 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2410 for (j = 1; j <= 24; ++j) {
2411 zpos = ((j - 1) - 11.) * 3.91 - 2.1000000000000001;
2412 geant->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2415 // --- Place the elements connecting the triangles of the heat bridge
2416 // into their mother (SSV1)
2420 // --- Left element (just a matter of convention)
2422 xpos = -dsrv[0] + .47;
2423 ypos = -2.1150000000000002;
2424 geant->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2426 // --- Right element
2428 xpos = -dsrv[0] + .47;
2429 ypos = 2.1150000000000002;
2430 geant->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2434 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2436 geant->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2438 // --- Place the ghost volumes containing the strip ladders (ISV1),
2439 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2440 // their mother volume (IT56)
2442 offset1 = atg_(.9, 40.);
2444 rzero = dbox1[0] + 40.;
2445 runo = dbox1[0] * 2. + 40. + dsrv[0];
2446 rtwo = dbox1[0] * 2. + 40. + dela[0];
2447 for (i = 1; i <= 35; ++i) {
2448 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2449 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2451 // --- Strip ladders
2453 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2454 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2456 geant->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2458 // --- Electronics/cooling
2460 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2461 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2463 geant->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2465 // --- End-ladders (nagative-Z and positive-Z)
2467 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2468 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2469 zpos = -(dbox1[2] + dela[2] + 6.);
2470 geant->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2471 zpos = dbox1[2] + dela[2] + 6.;
2472 geant->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2478 // GOTO 5778 ! skip ITS layer no. 6
2480 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2481 // it with air or vacuum
2483 dbox2[0] = .044999999999999998;
2485 dbox2[2] = 50.975000000000001;
2486 geant->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2488 // --- Make the ghost volume invisible
2490 geant->Gsatt("ISV2", "SEEN", 0);
2492 // --- Define a ghost volume containing the electronics and cooling of
2493 // a single ladder of layer #6 and fill it with air or vacuum
2495 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2497 dsrv[2] = 50.975000000000001;
2498 geant->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2500 // --- Make the ghost volume invisible
2502 geant->Gsatt("SSV2", "SEEN", 0);
2504 // --- Define a ghost volume containing the end-ladder stuff of
2505 // a single ladder of layer #6 and fill it with air or vacuum
2510 geant->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2512 // --- Make the ghost volume invisible
2514 geant->Gsatt("ELL6", "SEEN", 0);
2516 // --- Define a volume containing the sensitive part of the strips
2517 // (silicon, layer #6)
2522 geant->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2524 // --- Define a volume containing the electronics of the strips
2525 // (silicon, layer #6)
2530 geant->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2532 // --- Define the cooling tubes (aluminum, layer #6)
2535 dtub[1] = dtub[0] + .01;
2536 dtub[2] = 50.975000000000001;
2537 geant->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2539 // --- Define the cooling fluid (water or freon, layer #6)
2543 dwat[2] = 50.975000000000001;
2544 geant->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2545 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2547 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2555 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2556 dfra[6] = dfra[5] + .03;
2560 geant->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2562 // --- Define the element connecting the triangles of the heat bridge
2563 // (carbon, layer #6)
2567 dcei[2] = 50.975000000000001;
2568 geant->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2570 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2573 dpla[0] = .089285714285714288;
2576 geant->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2578 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2580 dcop[0] = .017857142857142856;
2583 geant->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2585 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2587 depx[0] = .26785714285714285;
2590 geant->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2592 // --- Define the part of the end-ladder stuff made of silicon (bus)
2595 dsil[0] = .17857142857142858;
2598 geant->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2600 // --- Place the end-ladder stuff into its mother (ELL5)
2602 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2608 xpos = -dela[0] + dpla[0];
2609 geant->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2613 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2614 geant->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2618 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2619 geant->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2621 // --- Silicon (bus)
2623 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2624 geant->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2626 // --- Place the sensitive part of the strips into its mother (ISV2)
2629 for (j = 1; j <= 26; ++j) {
2630 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2631 else xpos = -dbox2[0] + dits[0];
2632 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2633 geant->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2636 // --- Place the electronics of the strips into its mother (SSV2)
2639 for (j = 1; j <= 26; ++j) {
2640 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2641 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2642 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2643 geant->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2646 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2648 xpos = -dsrv[0] + .41;
2651 // --- Left tube (just a matter of convention)
2653 ypos = -2.3500000000000001;
2654 geant->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2655 geant->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2657 // --- Right tube (just a matter of convention)
2659 ypos = 2.3500000000000001;
2660 geant->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2661 geant->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2663 // --- Place the heat bridge elements into their mother (SSV2)
2665 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2667 for (j = 1; j <= 27; ++j) {
2668 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 2.1000000000000001;
2669 geant->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2672 // --- Place the elements connecting the triangles of the heat bridge
2673 // into their mother (SSV2)
2677 // --- Left element (just a matter of convention)
2679 xpos = -dsrv[0] + .47;
2680 ypos = -2.1150000000000002;
2681 geant->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2683 // --- Right element
2685 xpos = -dsrv[0] + .47;
2686 ypos = 2.1150000000000002;
2687 geant->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2691 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2693 geant->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2695 // --- Place the ghost volumes containing the strip ladders (ISV2),
2696 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2697 // their mother volume (IT56)
2699 offset1 = atg_(1., 45.);
2701 rzero = dbox2[0] + 45.;
2702 runo = dbox2[0] * 2. + 45. + dsrv[0];
2703 rtwo = dbox2[0] * 2. + 45. + dela[0];
2704 for (i = 1; i <= 39; ++i) {
2705 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2706 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2708 // --- Strip ladders
2710 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2711 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2713 geant->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2715 // --- Electronics/cooling
2717 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2718 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2720 geant->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2722 // --- End-ladders (nagative-Z and positive-Z)
2724 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2725 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2726 zpos = -(dbox2[2] + dela[2] + 6.);
2727 geant->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2728 zpos = dbox2[2] + dela[2] + 6.;
2729 geant->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2735 // --- Define SSD with the 32+36 lay-out
2737 if (fMinorVersion == 3 || fMinorVersion == 4 || fMinorVersion == 5) {
2739 //--- Define ghost volume containing the Strip Detectors and fill it with air
2742 xxm = 1.0444222222222224;
2746 dgh[3] = -25. - 5.9900000000000002 / xxm -
2747 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 9. / xxm - 13.997999999999998 / xxm;
2750 dgh[6] = -25. - 5.9900000000000002 / xxm -
2751 .0099999999999997868 / xxm - 17.990000000000002 / xxm - 9. / xxm;
2754 dgh[9] = 5.9900000000000002 / xxm + 25. +
2755 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 9. / xxm;
2758 dgh[12] = 5.9900000000000002 / xxm + 25. +
2759 .0099999999999997868 / xxm + 17.990000000000002 / xxm + 9. / xxm + 13.997999999999998 / xxm;
2762 geant->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2763 geant->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2764 geant->Gsatt("IT56", "SEEN", 0);
2768 // GOTO 6678 ! skip ITS layer no. 5
2770 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2771 // it with air or vacuum
2773 dbox1[0] = .044999999999999998;
2775 dbox1[2] = 43.155000000000001;
2776 geant->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2778 // --- Make the ghost volume invisible
2780 geant->Gsatt("ISV1", "SEEN", 0);
2782 // --- Define a ghost volume containing the electronics and cooling of
2783 // a single ladder of layer #5 and fill it with air or vacuum
2785 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2787 dsrv[2] = 43.155000000000001;
2788 geant->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2790 // --- Make the ghost volume invisible
2792 geant->Gsatt("SSV1", "SEEN", 0);
2794 // --- Define a ghost volume containing the end-ladder stuff of
2795 // a single ladder of layer #5 and fill it with air or vacuum
2800 geant->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2802 // --- Make the ghost volume invisible
2804 geant->Gsatt("ELL5", "SEEN", 0);
2806 // --- Define a volume containing the sensitive part of the strips
2807 // (silicon, layer #5)
2812 geant->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2814 // --- Define a volume containing the electronics of the strips
2815 // (silicon, layer #5)
2820 geant->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2822 // --- Define the cooling tubes (aluminum, layer #5)
2825 dtub[1] = dtub[0] + .01;
2826 dtub[2] = 43.155000000000001;
2827 geant->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2829 // --- Define the cooling fluid (water or freon, layer #5)
2833 dwat[2] = 43.155000000000001;
2834 geant->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2835 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2837 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2845 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2846 dfra[6] = dfra[5] + .03;
2850 geant->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2852 // --- Define the element connecting the triangles of the heat bridge
2853 // (carbon, layer #5)
2857 dcei[2] = 43.155000000000001;
2858 geant->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2860 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2863 dpla[0] = .089285714285714288;
2866 geant->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2868 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2870 dcop[0] = .017857142857142856;
2873 geant->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2875 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2877 depx[0] = .26785714285714285;
2880 geant->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2882 // --- Define the part of the end-ladder stuff made of silicon (bus)
2885 dsil[0] = .17857142857142858;
2888 geant->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2890 // --- Place the end-ladder stuff into its mother (ELL5)
2892 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2898 xpos = -dela[0] + dpla[0];
2899 geant->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2903 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2904 geant->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2908 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2909 geant->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2911 // --- Silicon (bus)
2913 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2914 geant->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2916 // --- Place the sensitive part of the strips into its mother (ISV1)
2919 for (j = 1; j <= 22; ++j) {
2920 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2921 else xpos = -dbox1[0] + dits[0];
2922 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
2923 geant->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2926 // --- Place the electronics of the strips into its mother (SSV1)
2929 for (j = 1; j <= 22; ++j) {
2930 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2931 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2932 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
2933 geant->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2936 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2938 xpos = -dsrv[0] + .41;
2941 // --- Left tube (just a matter of convention)
2943 ypos = -2.3500000000000001;
2944 geant->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2945 geant->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2947 // --- Right tube (just a matter of convention)
2949 ypos = 2.3500000000000001;
2950 geant->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2951 geant->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2953 // --- Place the heat bridge elements into their mother (SSV1)
2955 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2957 for (j = 1; j <= 23; ++j) {
2958 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 2.1000000000000001;
2959 geant->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2962 // --- Place the elements connecting the triangles of the heat bridge
2963 // into their mother (SSV1)
2967 // --- Left element (just a matter of convention)
2969 xpos = -dsrv[0] + .47;
2970 ypos = -2.1150000000000002;
2971 geant->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2973 // --- Right element
2975 xpos = -dsrv[0] + .47;
2976 ypos = 2.1150000000000002;
2977 geant->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2981 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2983 geant->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2985 // --- Place the ghost volumes containing the strip ladders (ISV1),
2986 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2987 // their mother volume (IT56)
2989 offset1 = atg_(.8, 36.6);
2991 rzero = dbox1[0] + 36.6;
2992 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
2993 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
2994 for (i = 1; i <= 32; ++i) {
2995 atheta = (i-1) * twopi * raddeg / 32. + offset2;
2996 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2998 // --- Strip ladders
3000 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3001 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3003 geant->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3005 // --- Electronics/cooling
3007 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3008 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3010 geant->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3012 // --- End-ladders (nagative-Z and positive-Z)
3014 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3015 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3016 zpos = -(dbox1[2] + dela[2] + 6.);
3017 geant->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3018 zpos = dbox1[2] + dela[2] + 6.;
3019 geant->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3025 // GOTO 6778 ! skip ITS layer no. 6
3027 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3028 // it with air or vacuum
3030 dbox2[0] = .044999999999999998;
3032 dbox2[2] = 47.064999999999998;
3033 geant->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3035 // --- Make the ghost volume invisible
3037 geant->Gsatt("ISV2", "SEEN", 0);
3039 // --- Define a ghost volume containing the electronics and cooling of
3040 // a single ladder of layer #6 and fill it with air or vacuum
3042 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3044 dsrv[2] = 47.064999999999998;
3045 geant->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3047 // --- Make the ghost volume invisible
3049 geant->Gsatt("SSV2", "SEEN", 0);
3051 // --- Define a ghost volume containing the end-ladder stuff of
3052 // a single ladder of layer #6 and fill it with air or vacuum
3057 geant->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3059 // --- Make the ghost volume invisible
3061 geant->Gsatt("ELL6", "SEEN", 0);
3063 // --- Define a volume containing the sensitive part of the strips
3064 // (silicon, layer #6)
3069 geant->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3071 // --- Define a volume containing the electronics of the strips
3072 // (silicon, layer #6)
3077 geant->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3079 // --- Define the cooling tubes (aluminum, layer #6)
3082 dtub[1] = dtub[0] + .01;
3083 dtub[2] = 47.064999999999998;
3084 geant->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3086 // --- Define the cooling fluid (water or freon, layer #6)
3090 dwat[2] = 47.064999999999998;
3091 geant->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3092 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3094 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3102 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3103 dfra[6] = dfra[5] + .03;
3107 geant->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3109 // --- Define the element connecting the triangles of the heat bridge
3110 // (carbon, layer #6)
3114 dcei[2] = 47.064999999999998;
3115 geant->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3117 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3120 dpla[0] = .089285714285714288;
3123 geant->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3125 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3127 dcop[0] = .017857142857142856;
3130 geant->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3132 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3134 depx[0] = .26785714285714285;
3137 geant->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3139 // --- Define the part of the end-ladder stuff made of silicon (bus)
3142 dsil[0] = .17857142857142858;
3145 geant->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3147 // --- Place the end-ladder stuff into its mother (ELL5)
3149 sep= (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3155 xpos = -dela[0] + dpla[0];
3156 geant->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3160 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3161 geant->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3165 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3166 geant->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3168 // --- Silicon (bus)
3170 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3171 geant->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3173 // --- Place the sensitive part of the strips into its mother (ISV2)
3176 for (j = 1; j <= 24; ++j) {
3177 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3178 else xpos = dbox2[0] - dits[0];
3179 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3180 geant->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3183 // --- Place the electronics of the strips into its mother (SSV2)
3186 for (j = 1; j <= 24; ++j) {
3187 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3188 else xpos = -dsrv[0] + .28;
3189 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3190 geant->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3193 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3195 xpos = -dsrv[0] + .41;
3198 // --- Left tube (just a matter of convention)
3200 ypos = -2.3500000000000001;
3201 geant->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3202 geant->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3204 // --- Right tube (just a matter of convention)
3206 ypos = 2.3500000000000001;
3207 geant->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3208 geant->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3210 // --- Place the heat bridge elements into their mother (SSV2)
3212 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3214 for (j = 1; j <= 25; ++j) {
3215 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 2.1000000000000001;
3216 geant->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3219 // --- Place the elements connecting the triangles of the heat bridge
3220 // into their mother (SSV2)
3224 // --- Left element (just a matter of convention)
3226 xpos = -dsrv[0] + .47;
3227 ypos = -2.1150000000000002;
3228 geant->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3230 // --- Right element
3232 xpos = -dsrv[0] + .47;
3233 ypos = 2.1150000000000002;
3234 geant->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3238 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3240 geant->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3242 // --- Place the ghost volumes containing the strip ladders (ISV2),
3243 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3244 // their mother volume (IT56)
3246 offset1 = atg_(.9, 41.2);
3248 rzero = dbox2[0] + 41.2;
3249 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3250 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3251 for (i = 1; i <= 36; ++i) {
3252 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3253 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3255 // --- Strip ladders
3257 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3258 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3260 geant->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3262 // --- Electronics/cooling
3264 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3265 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3267 geant->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3269 // --- End-ladders (nagative-Z and positive-Z)
3271 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3272 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3273 zpos = -(dbox2[2] + dela[2] + 6.);
3274 geant->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3275 zpos = dbox2[2] + dela[2] + 6.;
3276 geant->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3282 //************************************************************************
3284 //* E N D - C A P S A N D F R A M E S *
3285 //* ========================================= *
3287 //************************************************************************
3289 // --- Define a dummy cylinder for multiple scattering tests
3291 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3294 // DITS(2)=DITS(1)+0.1
3296 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3297 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3300 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3302 if (fMinorVersion == 0 || fMinorVersion == 3) {
3304 // GOTO 8901 ! skip outer wall
3307 dits[1] = dits[0] + .06926;
3308 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3310 geant->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3311 geant->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3316 // --- The frame between the end-caps (octagonal lay-out) ---
3318 // GOTO 9012 ! skip octagonal frame
3320 if (fMinorVersion == 1) {
3325 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3328 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + 518.90999999999985) / 2.;
3330 offset = angle / 2.;
3331 for (i = 1; i <= 8; ++i) {
3332 xtra[i - 1] = rzero * TMath::Cos((i-1) * angle * degrad);
3333 ytra[i - 1] = rzero * TMath::Sin((i-1) * angle * degrad);
3335 geant->Gsvolu(natra_ref(0, i), "TUBE", idtmed[274], dtra, 3);
3336 geant->Gspos(natra_ref(0, i), 1, "ITSV", xtra[i - 1], ytra[i - 1], ztra[i - 1], 0, "ONLY");
3340 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3341 - 2550.25))) * raddeg;
3342 aphi2 = 180. - aphi1;
3343 xpos = (xtra[0] + xtra[1]) / 2.;
3344 ypos = (ytra[0] + ytra[1]) / 2.;
3345 zpos = dtra[2] / 2.;
3346 geant->Gsvolu(natra1_ref(0, 1), "TUBE", idtmed[274], dtra1, 3);
3349 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3350 geant->Gspos(natra1_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3351 zpos = -dtra[2] / 2.;
3352 geant->Gsvolu(natra1_ref(0, 2), "TUBE", idtmed[274], dtra1, 3);
3355 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3356 geant->Gspos(natra1_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3359 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3360 - 2550.25))) * raddeg;
3361 aphi1 = 180. - aphi2;
3362 xpos = (xtra[1] + xtra[2]) / 2.;
3363 ypos = (ytra[1] + ytra[2]) / 2.;
3364 zpos = dtra[2] / 2.;
3365 geant->Gsvolu(natra1_ref(0, 3), "TUBE", idtmed[274], dtra1, 3);
3368 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3369 geant->Gspos(natra1_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3370 zpos = -dtra[2] / 2.;
3371 geant->Gsvolu(natra1_ref(0, 4), "TUBE", idtmed[274], dtra1, 3);
3374 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3375 geant->Gspos(natra1_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3378 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3379 - 2550.25))) * raddeg;
3380 aphi2 = 180. - aphi1;
3381 xpos = (xtra[2] + xtra[3]) / 2.;
3382 ypos = (ytra[2] + ytra[3]) / 2.;
3383 zpos = dtra[2] / 2.;
3384 geant->Gsvolu(natra1_ref(0, 5), "TUBE", idtmed[274], dtra1, 3);
3387 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3388 geant->Gspos(natra1_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3389 zpos = -dtra[2] / 2.;
3390 geant->Gsvolu(natra1_ref(0, 6), "TUBE", idtmed[274], dtra1, 3);
3393 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3394 geant->Gspos(natra1_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3397 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3398 - 2550.25))) * raddeg;
3399 aphi1 = 180. - aphi2;
3400 xpos = (xtra[3] + xtra[4]) / 2.;
3401 ypos = (ytra[3] + ytra[4]) / 2.;
3402 zpos = dtra[2] / 2.;
3403 geant->Gsvolu(natra1_ref(0, 7), "TUBE", idtmed[274], dtra1, 3);
3406 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3407 geant->Gspos(natra1_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3408 zpos = -dtra[2] / 2.;
3409 geant->Gsvolu(natra1_ref(0, 8), "TUBE", idtmed[274], dtra1, 3);
3412 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3413 geant->Gspos(natra1_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3416 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3417 - 2550.25))) * raddeg;
3418 aphi1 = 180. - aphi2;
3419 xpos = (xtra[4] + xtra[5]) / 2.;
3420 ypos = (ytra[4] + ytra[5]) / 2.;
3421 zpos = dtra[2] / 2.;
3422 geant->Gsvolu(natra1_ref(0, 9), "TUBE", idtmed[274], dtra1, 3);
3425 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3426 geant->Gspos(natra1_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3427 zpos = -dtra[2] / 2.;
3428 geant->Gsvolu(natra1_ref(0, 10), "TUBE", idtmed[274], dtra1, 3);
3431 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3432 geant->Gspos(natra1_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3435 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3436 - 2550.25))) * raddeg;
3437 aphi2 = 180. - aphi1;
3438 xpos = (xtra[5] + xtra[6]) / 2.;
3439 ypos = (ytra[5] + ytra[6]) / 2.;
3440 zpos = dtra[2] / 2.;
3441 geant->Gsvolu(natra1_ref(0, 11), "TUBE", idtmed[274], dtra1, 3);
3444 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3445 geant->Gspos(natra1_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3446 zpos = -dtra[2] / 2.;
3447 geant->Gsvolu(natra1_ref(0, 12), "TUBE", idtmed[274], dtra1, 3);
3450 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3451 geant->Gspos(natra1_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3454 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3455 - 2550.25))) * raddeg;
3456 aphi1 = 180. - aphi2;
3457 xpos = (xtra[6] + xtra[7]) / 2.;
3458 ypos = (ytra[6] + ytra[7]) / 2.;
3459 zpos = dtra[2] / 2.;
3460 geant->Gsvolu(natra1_ref(0, 13), "TUBE", idtmed[274], dtra1, 3);
3463 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3464 geant->Gspos(natra1_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3465 zpos = -dtra[2] / 2.;
3466 geant->Gsvolu(natra1_ref(0, 14), "TUBE", idtmed[274], dtra1, 3);
3469 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3470 geant->Gspos(natra1_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3473 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3474 - 2550.25))) * raddeg;
3475 aphi2 = 180. - aphi1;
3476 xpos = (xtra[7] + xtra[0]) / 2.;
3477 ypos = (ytra[7] + ytra[0]) / 2.;
3478 zpos = dtra[2] / 2.;
3479 geant->Gsvolu(natra1_ref(0, 15), "TUBE", idtmed[274], dtra1, 3);
3482 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3483 geant->Gspos(natra1_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3484 zpos = -dtra[2] / 2.;
3485 geant->Gsvolu(natra1_ref(0, 16), "TUBE", idtmed[274], dtra1, 3);
3488 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3489 geant->Gspos(natra1_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3492 } else if (fMinorVersion == 4) {
3498 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3501 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + 518.91) / 2.;
3503 offset = angle / 2.;
3504 for (i = 1; i <= 8; ++i) {
3505 xtra[i - 1] = rzero * TMath::Cos((i-1) * angle * degrad);
3506 ytra[i - 1] = rzero * TMath::Sin((i-1) * angle * degrad);
3508 geant->Gsvolu(natra_ref(0, i), "TUBE", idtmed[274], dtra, 3);
3509 geant->Gspos(natra_ref(0, i), 1, "ITSV", xtra[i - 1], ytra[i - 1], ztra[i - 1], 0, "ONLY");
3513 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3514 - 2550.25))) * raddeg;
3515 aphi2 = 180. - aphi1;
3516 xpos = (xtra[0] + xtra[1]) / 2.;
3517 ypos = (ytra[0] + ytra[1]) / 2.;
3518 zpos = dtra[2] / 2.;
3519 geant->Gsvolu(natra1_ref(0, 1), "TUBE", idtmed[274], dtra1, 3);
3522 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3523 geant->Gspos(natra1_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3524 zpos = -dtra[2] / 2.;
3525 geant->Gsvolu(natra1_ref(0, 2), "TUBE", idtmed[274], dtra1, 3);
3528 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3529 geant->Gspos(natra1_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3532 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3533 - 2550.25))) * raddeg;
3534 aphi1 = 180. - aphi2;
3535 xpos = (xtra[1] + xtra[2]) / 2.;
3536 ypos = (ytra[1] + ytra[2]) / 2.;
3537 zpos = dtra[2] / 2.;
3538 geant->Gsvolu(natra1_ref(0, 3), "TUBE", idtmed[274], dtra1, 3);
3541 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3542 geant->Gspos(natra1_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3543 zpos = -dtra[2] / 2.;
3544 geant->Gsvolu(natra1_ref(0, 4), "TUBE", idtmed[274], dtra1, 3);
3547 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3548 geant->Gspos(natra1_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3551 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3552 - 2550.25))) * raddeg;
3553 aphi2 = 180. - aphi1;
3554 xpos = (xtra[2] + xtra[3]) / 2.;
3555 ypos = (ytra[2] + ytra[3]) / 2.;
3556 zpos = dtra[2] / 2.;
3557 geant->Gsvolu(natra1_ref(0, 5), "TUBE", idtmed[274], dtra1, 3);
3560 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3561 geant->Gspos(natra1_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3562 zpos = -dtra[2] / 2.;
3563 geant->Gsvolu(natra1_ref(0, 6), "TUBE", idtmed[274], dtra1, 3);
3566 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3567 geant->Gspos(natra1_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3570 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3571 - 2550.25))) * raddeg;
3572 aphi1 = 180. - aphi2;
3573 xpos = (xtra[3] + xtra[4]) / 2.;
3574 ypos = (ytra[3] + ytra[4]) / 2.;
3575 zpos = dtra[2] / 2.;
3576 geant->Gsvolu(natra1_ref(0, 7), "TUBE", idtmed[274], dtra1, 3);
3579 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3580 geant->Gspos(natra1_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3581 zpos = -dtra[2] / 2.;
3582 geant->Gsvolu(natra1_ref(0, 8), "TUBE", idtmed[274], dtra1, 3);
3585 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3586 geant->Gspos(natra1_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3589 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3590 - 2550.25))) * raddeg;
3591 aphi1 = 180. - aphi2;
3592 xpos = (xtra[4] + xtra[5]) / 2.;
3593 ypos = (ytra[4] + ytra[5]) / 2.;
3594 zpos = dtra[2] / 2.;
3595 geant->Gsvolu(natra1_ref(0, 9), "TUBE", idtmed[274], dtra1, 3);
3598 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3599 geant->Gspos(natra1_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3600 zpos = -dtra[2] / 2.;
3601 geant->Gsvolu(natra1_ref(0, 10), "TUBE", idtmed[274], dtra1, 3);
3604 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3605 geant->Gspos(natra1_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3608 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3609 - 2550.25))) * raddeg;
3610 aphi2 = 180. - aphi1;
3611 xpos = (xtra[5] + xtra[6]) / 2.;
3612 ypos = (ytra[5] + ytra[6]) / 2.;
3613 zpos = dtra[2] / 2.;
3614 geant->Gsvolu(natra1_ref(0, 11), "TUBE", idtmed[274], dtra1, 3);
3617 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3618 geant->Gspos(natra1_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3619 zpos = -dtra[2] / 2.;
3620 geant->Gsvolu(natra1_ref(0, 12), "TUBE", idtmed[274], dtra1, 3);
3623 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3624 geant->Gspos(natra1_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3627 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3628 - 2550.25))) * raddeg;
3629 aphi1 = 180. - aphi2;
3630 xpos = (xtra[6] + xtra[7]) / 2.;
3631 ypos = (ytra[6] + ytra[7]) / 2.;
3632 zpos = dtra[2] / 2.;
3633 geant->Gsvolu(natra1_ref(0, 13), "TUBE", idtmed[274], dtra1, 3);
3636 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3637 geant->Gspos(natra1_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3638 zpos = -dtra[2] / 2.;
3639 geant->Gsvolu(natra1_ref(0, 14), "TUBE", idtmed[274], dtra1, 3);
3642 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3643 geant->Gspos(natra1_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3646 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(.48869219055841229) * (50.5 / cos(.48869219055841229))
3647 - 2550.25))) * raddeg;
3648 aphi2 = 180. - aphi1;
3649 xpos = (xtra[7] + xtra[0]) / 2.;
3650 ypos = (ytra[7] + ytra[0]) / 2.;
3651 zpos = dtra[2] / 2.;
3652 geant->Gsvolu(natra1_ref(0, 15), "TUBE", idtmed[274], dtra1, 3);
3655 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3656 geant->Gspos(natra1_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3657 zpos = -dtra[2] / 2.;
3658 geant->Gsvolu(natra1_ref(0, 16), "TUBE", idtmed[274], dtra1, 3);
3661 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3662 geant->Gspos(natra1_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3669 // --- The frame between the end-caps (hexagonal lay-out) ---
3671 // GOTO 9123 ! skip hexagonal frame
3673 if (fMinorVersion == 2) {
3678 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3684 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + 1088.0099999999998) / 2.;
3686 offset = angle / 2.;
3687 for (i = 1; i <= 6; ++i) {
3688 xtra1[i - 1] = rzero * TMath::Cos(((i-1) * angle + offset) *degrad);
3689 ytra1[i - 1] = rzero * TMath::Sin(((i-1) * angle + offset) *degrad);
3691 geant->Gsvolu(natra2_ref(0, i), "TUBE", idtmed[274], dtra2, 3);
3692 geant->Gspos(natra2_ref(0, i), 1, "ITSV", xtra1[i - 1], ytra1[i - 1], ztra1[i - 1], 0, "ONLY");
3697 xpos = (xtra1[0] + xtra1[1]) / 2.;
3698 ypos = (ytra1[0] + ytra1[1]) / 2.;
3700 geant->Gsvolu(natra3_ref(0, 1), "TUBE", idtmed[274], dtra3, 3);
3703 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3704 geant->Gspos(natra3_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3708 xpos = (xtra1[1] + xtra1[2]) / 2.;
3709 ypos = (ytra1[1] + ytra1[2]) / 2.;
3711 geant->Gsvolu(natra3_ref(0, 2), "TUBE", idtmed[274], dtra3, 3);
3714 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3715 geant->Gspos(natra3_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3719 xpos = (xtra1[2] + xtra1[3]) / 2.;
3720 ypos = (ytra1[2] + ytra1[3]) / 2.;
3722 geant->Gsvolu(natra3_ref(0, 3), "TUBE", idtmed[274], dtra3, 3);
3725 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3726 geant->Gspos(natra3_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3730 xpos = (xtra1[3] + xtra1[4]) / 2.;
3731 ypos = (ytra1[3] + ytra1[4]) / 2.;
3733 geant->Gsvolu(natra3_ref(0, 4), "TUBE", idtmed[274], dtra3, 3);
3736 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3737 geant->Gspos(natra3_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3741 xpos = (xtra1[4] + xtra1[5]) / 2.;
3742 ypos = (ytra1[4] + ytra1[5]) / 2.;
3744 geant->Gsvolu(natra3_ref(0, 5), "TUBE", idtmed[274], dtra3, 3);
3747 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3748 geant->Gspos(natra3_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3752 xpos = (xtra1[5] + xtra1[0]) / 2.;
3753 ypos = (ytra1[5] + ytra1[0]) / 2.;
3755 geant->Gsvolu(natra3_ref(0, 6), "TUBE", idtmed[274], dtra3, 3);
3758 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3759 geant->Gspos(natra3_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3762 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3763 - 2500.))) * raddeg;
3764 aphi1 = 180. - aphi2;
3765 xpos = (xtra1[0] + xtra1[1]) / 2.;
3766 ypos = (ytra1[0] + ytra1[1]) / 2.;
3767 zpos = dtra2[2] / 2.;
3768 geant->Gsvolu(natra4_ref(0, 1), "TUBE", idtmed[274], dtra4, 3);
3771 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3772 geant->Gspos(natra4_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3773 zpos = -dtra2[2] / 2.;
3774 geant->Gsvolu(natra4_ref(0, 2), "TUBE", idtmed[274], dtra4, 3);
3777 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3778 geant->Gspos(natra4_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3781 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3782 - 2500.))) * raddeg;
3783 aphi2 = 180. - aphi1;
3784 xpos = (xtra1[1] + xtra1[2]) / 2.;
3785 ypos = (ytra1[1] + ytra1[2]) / 2.;
3786 zpos = dtra2[2] / 2.;
3787 geant->Gsvolu(natra4_ref(0, 3), "TUBE", idtmed[274], dtra4, 3);
3790 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3791 geant->Gspos(natra4_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3792 zpos = -dtra2[2] / 2.;
3793 geant->Gsvolu(natra4_ref(0, 4), "TUBE", idtmed[274], dtra4, 3);
3796 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3797 geant->Gspos(natra4_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
3800 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3801 - 2500.))) * raddeg;
3802 aphi1 = 180. - aphi2;
3803 xpos = (xtra1[2] + xtra1[3]) / 2.;
3804 ypos = (ytra1[2] + ytra1[3]) / 2.;
3805 zpos = dtra2[2] / 2.;
3806 geant->Gsvolu(natra4_ref(0, 5), "TUBE", idtmed[274], dtra4, 3);
3809 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3810 geant->Gspos(natra4_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
3811 zpos = -dtra2[2] / 2.;
3812 geant->Gsvolu(natra4_ref(0, 6), "TUBE", idtmed[274], dtra4, 3);
3815 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3816 geant->Gspos(natra4_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
3818 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3819 - 2500.))) * raddeg;
3820 aphi2 = 180. - aphi1;
3821 xpos = (xtra1[2] + xtra1[3]) / 2.;
3822 ypos = (ytra1[2] + ytra1[3]) / 2.;
3823 zpos = dtra2[2] / 2.;
3824 geant->Gsvolu(natra4_ref(0, 7), "TUBE", idtmed[274], dtra4, 3);
3827 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3828 geant->Gspos(natra4_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
3829 zpos = -dtra2[2] / 2.;
3830 geant->Gsvolu(natra4_ref(0, 8), "TUBE", idtmed[274], dtra4, 3);
3833 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3834 geant->Gspos(natra4_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
3837 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3838 - 2500.))) * raddeg;
3839 aphi1 = 180. - aphi2;
3840 xpos = (xtra1[3] + xtra1[4]) / 2.;
3841 ypos = (ytra1[3] + ytra1[4]) / 2.;
3842 zpos = dtra2[2] / 2.;
3843 geant->Gsvolu(natra4_ref(0, 9), "TUBE", idtmed[274], dtra4, 3);
3846 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3847 geant->Gspos(natra4_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
3848 zpos = -dtra2[2] / 2.;
3849 geant->Gsvolu(natra4_ref(0, 10), "TUBE", idtmed[274], dtra4, 3);
3852 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3853 geant->Gspos(natra4_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
3856 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3857 - 2500.))) * raddeg;
3858 aphi2 = 180. - aphi1;
3859 xpos = (xtra1[4] + xtra1[5]) / 2.;
3860 ypos = (ytra1[4] + ytra1[5]) / 2.;
3861 zpos = dtra2[2] / 2.;
3862 geant->Gsvolu(natra4_ref(0, 11), "TUBE", idtmed[274], dtra4, 3);
3865 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3866 geant->Gspos(natra4_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
3867 zpos = -dtra2[2] / 2.;
3868 geant->Gsvolu(natra4_ref(0, 12), "TUBE", idtmed[274], dtra4, 3);
3871 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3872 geant->Gspos(natra4_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
3875 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3876 - 2500.))) * raddeg;
3877 aphi1 = 180. - aphi2;
3878 xpos = (xtra1[5] + xtra1[0]) / 2.;
3879 ypos = (ytra1[5] + ytra1[0]) / 2.;
3880 zpos = dtra2[2] / 2.;
3881 geant->Gsvolu(natra4_ref(0, 13), "TUBE", idtmed[274], dtra4, 3);
3884 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3885 geant->Gspos(natra4_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
3886 zpos = -dtra2[2] / 2.;
3887 geant->Gsvolu(natra4_ref(0, 14), "TUBE", idtmed[274], dtra4, 3);
3890 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3891 geant->Gspos(natra4_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
3893 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
3894 - 2500.))) * raddeg;
3895 aphi2 = 180. - aphi1;
3896 xpos = (xtra1[5] + xtra1[0]) / 2.;
3897 ypos = (ytra1[5] + ytra1[0]) / 2.;
3898 zpos = dtra2[2] / 2.;
3899 geant->Gsvolu(natra4_ref(0, 15), "TUBE", idtmed[274], dtra4, 3);
3902 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3903 geant->Gspos(natra4_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
3904 zpos = -dtra2[2] / 2.;
3905 geant->Gsvolu(natra4_ref(0, 16), "TUBE", idtmed[274], dtra4, 3);
3908 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3909 geant->Gspos(natra4_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
3912 } else if (fMinorVersion == 5) {
3918 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3924 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + 1088.0099999999998) / 2.;
3926 offset = angle / 2.;
3927 for (i = 1; i <= 6; ++i) {
3928 xtra1[i - 1] = rzero * TMath::Cos(((i-1) * angle + offset) *degrad);
3929 ytra1[i - 1] = rzero * TMath::Sin(((i-1) * angle + offset) *degrad);
3931 geant->Gsvolu(natra2_ref(0, i), "TUBE", idtmed[274], dtra2, 3);
3932 geant->Gspos(natra2_ref(0, i), 1, "ITSV", xtra1[i - 1], ytra1[i - 1], ztra1[i - 1], 0, "ONLY");
3937 xpos = (xtra1[0] + xtra1[1]) / 2.;
3938 ypos = (ytra1[0] + ytra1[1]) / 2.;
3940 geant->Gsvolu(natra3_ref(0, 1), "TUBE", idtmed[274], dtra3, 3);
3943 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3944 geant->Gspos(natra3_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3948 xpos = (xtra1[1] + xtra1[2]) / 2.;
3949 ypos = (ytra1[1] + ytra1[2]) / 2.;
3951 geant->Gsvolu(natra3_ref(0, 2), "TUBE", idtmed[274], dtra3, 3);
3954 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3955 geant->Gspos(natra3_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3959 xpos = (xtra1[2] + xtra1[3]) / 2.;
3960 ypos = (ytra1[2] + ytra1[3]) / 2.;
3962 geant->Gsvolu(natra3_ref(0, 3), "TUBE", idtmed[274], dtra3, 3);
3965 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3966 geant->Gspos(natra3_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3970 xpos = (xtra1[3] + xtra1[4]) / 2.;
3971 ypos = (ytra1[3] + ytra1[4]) / 2.;
3973 geant->Gsvolu(natra3_ref(0, 4), "TUBE", idtmed[274], dtra3, 3);
3976 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3977 geant->Gspos(natra3_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3981 xpos = (xtra1[4] + xtra1[5]) / 2.;
3982 ypos = (ytra1[4] + ytra1[5]) / 2.;
3984 geant->Gsvolu(natra3_ref(0, 5), "TUBE", idtmed[274], dtra3, 3);
3987 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3988 geant->Gspos(natra3_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3992 xpos = (xtra1[5] + xtra1[0]) / 2.;
3993 ypos = (ytra1[5] + ytra1[0]) / 2.;
3995 geant->Gsvolu(natra3_ref(0, 6), "TUBE", idtmed[274], dtra3, 3);
3998 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3999 geant->Gspos(natra3_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
4002 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4003 - 2500.))) * raddeg;
4004 aphi1 = 180. - aphi2;
4005 xpos = (xtra1[0] + xtra1[1]) / 2.;
4006 ypos = (ytra1[0] + ytra1[1]) / 2.;
4007 zpos = dtra2[2] / 2.;
4008 geant->Gsvolu(natra4_ref(0, 1), "TUBE", idtmed[274], dtra4, 3);
4011 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4012 geant->Gspos(natra4_ref(0, 1), 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
4013 zpos = -dtra2[2] / 2.;
4014 geant->Gsvolu(natra4_ref(0, 2), "TUBE", idtmed[274], dtra4, 3);
4017 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4018 geant->Gspos(natra4_ref(0, 2), 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
4021 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4022 - 2500.))) * raddeg;
4023 aphi2 = 180. - aphi1;
4024 xpos = (xtra1[1] + xtra1[2]) / 2.;
4025 ypos = (ytra1[1] + ytra1[2]) / 2.;
4026 zpos = dtra2[2] / 2.;
4027 geant->Gsvolu(natra4_ref(0, 3), "TUBE", idtmed[274], dtra4, 3);
4030 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4031 geant->Gspos(natra4_ref(0, 3), 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
4032 zpos = -dtra2[2] / 2.;
4033 geant->Gsvolu(natra4_ref(0, 4), "TUBE", idtmed[274], dtra4, 3);
4036 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4037 geant->Gspos(natra4_ref(0, 4), 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
4040 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4041 - 2500.))) * raddeg;
4042 aphi1 = 180. - aphi2;
4043 xpos = (xtra1[2] + xtra1[3]) / 2.;
4044 ypos = (ytra1[2] + ytra1[3]) / 2.;
4045 zpos = dtra2[2] / 2.;
4046 geant->Gsvolu(natra4_ref(0, 5), "TUBE", idtmed[274], dtra4, 3);
4049 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4050 geant->Gspos(natra4_ref(0, 5), 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
4051 zpos = -dtra2[2] / 2.;
4052 geant->Gsvolu(natra4_ref(0, 6), "TUBE", idtmed[274], dtra4, 3);
4055 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4056 geant->Gspos(natra4_ref(0, 6), 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
4058 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4059 - 2500.))) * raddeg;
4060 aphi2 = 180. - aphi1;
4061 xpos = (xtra1[2] + xtra1[3]) / 2.;
4062 ypos = (ytra1[2] + ytra1[3]) / 2.;
4063 zpos = dtra2[2] / 2.;
4064 geant->Gsvolu(natra4_ref(0, 7), "TUBE", idtmed[274], dtra4, 3);
4067 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4068 geant->Gspos(natra4_ref(0, 7), 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
4069 zpos = -dtra2[2] / 2.;
4070 geant->Gsvolu(natra4_ref(0, 8), "TUBE", idtmed[274], dtra4, 3);
4073 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4074 geant->Gspos(natra4_ref(0, 8), 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
4077 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4078 - 2500.))) * raddeg;
4079 aphi1 = 180. - aphi2;
4080 xpos = (xtra1[3] + xtra1[4]) / 2.;
4081 ypos = (ytra1[3] + ytra1[4]) / 2.;
4082 zpos = dtra2[2] / 2.;
4083 geant->Gsvolu(natra4_ref(0, 9), "TUBE", idtmed[274], dtra4, 3);
4086 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4087 geant->Gspos(natra4_ref(0, 9), 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
4088 zpos = -dtra2[2] / 2.;
4089 geant->Gsvolu(natra4_ref(0, 10), "TUBE", idtmed[274], dtra4, 3);
4092 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4093 geant->Gspos(natra4_ref(0, 10), 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
4096 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4097 - 2500.))) * raddeg;
4098 aphi2 = 180. - aphi1;
4099 xpos = (xtra1[4] + xtra1[5]) / 2.;
4100 ypos = (ytra1[4] + ytra1[5]) / 2.;
4101 zpos = dtra2[2] / 2.;
4102 geant->Gsvolu(natra4_ref(0, 11), "TUBE", idtmed[274], dtra4, 3);
4105 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4106 geant->Gspos(natra4_ref(0, 11), 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
4107 zpos = -dtra2[2] / 2.;
4108 geant->Gsvolu(natra4_ref(0, 12), "TUBE", idtmed[274], dtra4, 3);
4111 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4112 geant->Gspos(natra4_ref(0, 12), 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
4115 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4116 - 2500.))) * raddeg;
4117 aphi1 = 180. - aphi2;
4118 xpos = (xtra1[5] + xtra1[0]) / 2.;
4119 ypos = (ytra1[5] + ytra1[0]) / 2.;
4120 zpos = dtra2[2] / 2.;
4121 geant->Gsvolu(natra4_ref(0, 13), "TUBE", idtmed[274], dtra4, 3);
4124 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4125 geant->Gspos(natra4_ref(0, 13), 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
4126 zpos = -dtra2[2] / 2.;
4127 geant->Gsvolu(natra4_ref(0, 14), "TUBE", idtmed[274], dtra4, 3);
4130 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4131 geant->Gspos(natra4_ref(0, 14), 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
4133 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(.59341194567807209) * (50. / cos(.59341194567807209))
4134 - 2500.))) * raddeg;
4135 aphi2 = 180. - aphi1;
4136 xpos = (xtra1[5] + xtra1[0]) / 2.;
4137 ypos = (ytra1[5] + ytra1[0]) / 2.;
4138 zpos = dtra2[2] / 2.;
4139 geant->Gsvolu(natra4_ref(0, 15), "TUBE", idtmed[274], dtra4, 3);
4142 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
4143 geant->Gspos(natra4_ref(0, 15), 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
4144 zpos = -dtra2[2] / 2.;
4145 geant->Gsvolu(natra4_ref(0, 16), "TUBE", idtmed[274], dtra4, 3);
4148 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
4149 geant->Gspos(natra4_ref(0, 16), 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
4155 // --- Define the end-caps
4157 // GOTO 9234 ! skip both end-caps
4159 // --- Define the Z>0 end-cap
4161 // GOTO 9345 ! skip the Z>0 end-cap
4166 dcone[3] = 46.899999999999999;
4167 dcone[4] = .02 / TMath::Cos(.78539816339744828) + 46.899999999999999;
4170 zpos = dpcb[2] * 2. + 45.899999999999999 - 10.5;
4171 // end-ladder electro
4172 geant->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4174 geant->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4176 dtube[0] = .02 / TMath::Cos(.78539816339744828) +
4179 // In the Simonetti's drawings 52. In the TP 50.
4183 zpos = dpcb[2] * 2. + 62.799999999999997 - 10.5;
4184 // end-ladder electro
4185 geant->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4187 geant->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4191 dtube[2] = 1.3400000000000001;
4194 zpos = dpcb[2] * 2. + 21.59 - 10.5;
4196 geant->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4198 geant->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4204 dpgon[4] = dpcb[2] * 2. + 22.93 - 10.5;
4205 // end-ladder electron
4208 dpgon[7] = dpcb[2] * 2. + 29.149999999999999 - 10.5;
4209 // end-ladder electronics
4215 geant->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4216 geant->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4222 dpgon[4] = dpcb[2] * 2. + 35.649999999999999 - 10.5;
4226 dpgon[7] = dpcb[2] * 2. + 37.149999999999999 - 10.5;
4233 geant->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4234 geant->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4236 if (fMinorVersion == 0 || fMinorVersion == 1 || fMinorVersion ==2) {
4238 dpgon[0] = offset2 + 5.1428571428571432;
4242 dpgon[4] = dpcb[2] * 2. + 52.350000000000001 - 10.5;
4246 dpgon[7] = dpcb[2] * 2. + 53.850000000000001 - 10.5;
4253 geant->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4254 geant->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4256 dpgon[0] = offset2 + 4.615384615384615;
4260 dpgon[4] = dpcb[2] * 2. + 57.350000000000001 - 10.5;
4264 dpgon[7] = dpcb[2] * 2. + 58.850000000000001 - 10.5;
4271 geant->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4272 geant->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4274 if (fMinorVersion == 3 || fMinorVersion == 4 || fMinorVersion == 5) {
4276 dpgon[0] = offset2 + 5.625;
4280 dpgon[4] = 52.350000000000001 - 3.3999999999999986 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4281 // end-ladder electronics
4284 dpgon[7] = 53.850000000000001 - 3.3999999999999986 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4285 // end-ladder electr
4291 geant->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4292 geant->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4294 dpgon[0] = offset2 + 5.;
4298 dpgon[4] = 57.350000000000001 - 3.7999999999999972 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4299 // end-ladder electronics
4302 dpgon[7] = 58.850000000000001 - 3.7999999999999972 / TMath::Tan(.78539816339744828) + dpcb[2] * 2. - 10.5;
4303 // end-ladder electr
4309 geant->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4310 geant->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4315 // --- Define the Z<0 end-cap
4317 // GOTO 9456 ! skip the Z<0 end-cap
4320 dcone[1] = 46.899999999999999;
4321 dcone[2] = .02 / TMath::Cos(.78539816339744828) + 46.899999999999999;
4326 zpos = -45.899999999999999 - dpcb[2] * 2. + 10.5;
4327 // end-ladder electr
4328 geant->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
4330 geant->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4332 dtube[0] = .02 / TMath::Cos(.78539816339744828) +
4335 // In the Simonetti's drawings 52. In the TP 50.
4339 zpos = -62.799999999999997 - dpcb[2] * 2. + 10.5;
4340 // end-ladder electr
4341 geant->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
4343 geant->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4347 dtube[2] = 1.3400000000000001;
4350 zpos = -21.59 - dpcb[2] * 2. + 10.5;
4352 geant->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
4354 geant->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4360 dpgon[4] = -29.149999999999999 - dpcb[2] * 2. + 10.5;
4361 // end-ladder electronics
4364 dpgon[7] = -22.93 - dpcb[2] * 2. + 10.5;
4365 // end-ladder electro
4371 geant->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4372 geant->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4378 dpgon[4] = -37.149999999999999 - dpcb[2] * 2. + 10.5;
4382 dpgon[7] = -35.649999999999999 - dpcb[2] * 2. + 10.5;
4389 geant->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4390 geant->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4392 if (fMinorVersion == 0 || fMinorVersion == 1 || fMinorVersion ==2) {
4394 dpgon[0] = offset2 + 5.1428571428571432;
4398 dpgon[4] = -52.350000000000001 - dpcb[2] * 2. + 10.5;
4402 dpgon[7] = -53.850000000000001 - dpcb[2] * 2. + 10.5;
4409 geant->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4410 geant->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4412 dpgon[0] = offset2 + 4.615384615384615;
4416 dpgon[4] = -57.350000000000001 - dpcb[2] * 2. + 10.5;
4420 dpgon[7] = -58.850000000000001 - dpcb[2] * 2. + 10.5;
4427 geant->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4428 geant->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4430 if (fMinorVersion == 3 || fMinorVersion == 4 || fMinorVersion == 5) {
4432 dpgon[0] = offset2 + 5.625;
4436 dpgon[4] = 3.4 / TMath::Tan(.78539816339744828) - 52.35 - dpcb[2] * 2. + 10.5;
4437 // end-ladder electronics
4440 dpgon[7] = 3.4 / TMath::Tan(.78539816339744828) - 53.85 - dpcb[2] * 2. + 10.5;
4441 // end-ladder electr
4447 geant->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4448 geant->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4450 dpgon[0] = offset2 + 5.;
4454 dpgon[4] = 3.8 / TMath::Tan(.78539816339744828) - 57.35 - dpcb[2] * 2. + 10.5;
4455 // end-ladder electronics
4458 dpgon[7] = 3.8 / TMath::Tan(.78539816339744828) - 58.85 - dpcb[2] * 2. + 10.5;
4459 // end-ladder electr
4465 geant->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4466 geant->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
4472 // --- Outputs the geometry tree in the EUCLID/CAD format
4475 geant->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4478 // --- Outputs the geometry tree in the EUCLID/CAD format
4481 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
4485 //_____________________________________________________________________________
4486 void AliITSv4::CreateMaterials()
4489 // Create Materials for ITS
4491 AliITS::CreateMaterials();
4494 //_____________________________________________________________________________
4495 void AliITSv4::Init()
4498 // Initialise ITS after it has been created
4500 fIdSens1=gMC->VolId("ITS1");
4501 fIdSens2=gMC->VolId("ITS2");
4502 fIdSens3=gMC->VolId("ITS3");
4503 fIdSens4=gMC->VolId("ITS4");
4504 fIdSens5=gMC->VolId("ITS5");
4505 fIdSens6=gMC->VolId("ITS6");
4508 //_____________________________________________________________________________
4509 void AliITSv4::StepManager()
4512 // Called at every step in the ITS
4517 Float_t position[3];
4518 Float_t momentum[4];
4519 TClonesArray &lhits = *fHits;
4521 if(gMC->TrackCharge() && gMC->Edep()) {
4523 // Only entering charged tracks
4524 if((id=gMC->CurrentVol(0,copy))==fIdSens1) {
4526 id=gMC->CurrentVolOff(1,0,copy);
4528 id=gMC->CurrentVolOff(2,0,copy);
4530 } else if(id==fIdSens2) {
4532 id=gMC->CurrentVolOff(1,0,copy);
4534 id=gMC->CurrentVolOff(2,0,copy);
4536 } else if(id==fIdSens3) {
4539 id=gMC->CurrentVolOff(1,0,copy);
4541 } else if(id==fIdSens4) {
4544 id=gMC->CurrentVolOff(1,0,copy);
4546 } else if(id==fIdSens5) {
4549 id=gMC->CurrentVolOff(1,0,copy);
4551 } else if(id==fIdSens6) {
4554 id=gMC->CurrentVolOff(1,0,copy);
4557 gMC->TrackPosition(position);
4558 gMC->TrackMomentum(momentum);
4559 hits[0]=position[0];
4560 hits[1]=position[1];
4561 hits[2]=position[2];
4562 hits[3]=momentum[0];
4563 hits[4]=momentum[1];
4564 hits[5]=momentum[2];
4565 hits[6]=gMC->Edep();
4566 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);