Variable number of modules introduced
[u/mrichter/AliRoot.git] / ITS / AliITSv3.cxx
CommitLineData
fe4da5cc 1///////////////////////////////////////////////////////////////////////////////
2// //
3// Inner Traking System version 3 //
4// //
5//Begin_Html
6/*
1439f98e 7<img src="picts/AliITSv3Class.gif">
fe4da5cc 8</pre>
9<br clear=left>
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>.
13</font>
14<pre>
15*/
16//End_Html
17// //
18///////////////////////////////////////////////////////////////////////////////
19
20#include <TMath.h>
21#include <TRandom.h>
22#include <TVector.h>
23#include "AliITSv3.h"
24#include "AliRun.h"
25
26#include "AliMC.h"
27#include "AliConst.h"
28
29ClassImp(AliITSv3)
30
31//_____________________________________________________________________________
32AliITSv3::AliITSv3() : AliITS()
33{
34 //
35 // Default constructor for ITS
36 //
37 fMinorVersion=1;
38}
39
40//_____________________________________________________________________________
41AliITSv3::AliITSv3(const char *name, const char *title)
42 : AliITS(name, title)
43{
44 //
45 // Standard constructor for ITS
46 //
47 fMinorVersion=1;
48}
49
50//_____________________________________________________________________________
51void AliITSv3::CreateGeometry()
52{
53 //
54 // Create ITS geometry for version 3
55 //
56 //Begin_Html
57 /*
1439f98e 58 <img src="picts/AliITSv3Tree.gif">
fe4da5cc 59 */
60 //End_Html
61 //Begin_Html
62 /*
1439f98e 63 <img src="picts/AliITSv3.gif">
fe4da5cc 64 */
65 //End_Html
66
67 AliMC* pMC = AliMC::GetMC();
68
69 const Float_t xx[14] = { 0.,0.,-14.002,-6.288,-25.212,-16.292,-35.713,-26.401,
70 -45.34,-36.772,-18.74,-12.814,-14.358,0. };
71 const Float_t yy[14] = { 0.,27.056,31.408,
72 25.019,27.768,22.664,22.42,18.727,15.479,13.68,-9.984,-6.175,-3.775,0. };
73 const Float_t xbeg[13] = { 0.,-.352,-12.055,-8.755,-23.035,-19.085,-33.362,
74 -28.859,-42.774,-36.644,-18.352,-13.085,-13.426 };
75 const Float_t ybeg[13] = { .386,27.165,29.795,
76 25.377,26.48,22.632,21.487,18.305,14.94,13.509,-9.735,-5.755,-3.53 };
77 const Float_t xend[13] = { 0.,-11.588,-8.208,-22.709,-18.738,-33.184,-28.719,
78 -42.756,-37.027,-19.002,-13.235,-13.837,-.373 };
79 const Float_t yend[13] = { 26.688,30.658,26.609,
80 27.405,23.935,22.452,19.646,15.922,13.733,-9.639,-6.446,-4.585,-.098 };
81 const Float_t xarc[13] = { -.5,-13.248,-13.505,-18.622,-37.171,-42.671,-28.977,
82 -33.178,-19.094,-22.781,-8.655,-11.736,-.5 };
83 const Float_t yarc[13] = { .5,-4.093,-5.911,
84 -9.2,13.162,15.543,19.109,22.066,23.446,27.024,26.184,30.294,26.802 };
85 const Float_t rarc[13] = { .5,.7,.5,.5,.7,.5,.7,.5,.7,.5,.7,.5,.5 };
86 const Float_t rr = 4.064516;
87 const Float_t tteta = 63.;
88 const Float_t pphi = -35.;
89 const Float_t gteta = 87.78;
90 const Double_t degrad = kPI/180.;
91 const Double_t raddeg = 180./kPI;
92 const Double_t twopi = 2*kPI;
93
94 Double_t biga, bigb;
95 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5], dfra[10], dcer[3], dkap[3], dpla[3],
96 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3], atheta1011, dbus[3], dtub[3], dwat[3],
97 depx[3], dits[3], atheta1314, atheta1213, atheta1112, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
98 Double_t biga1, bigb1;
99 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3],
100 dtra4[3], dbox1[3], dbox2[3];
101 Int_t jbox1, jbox2;
102 Float_t xtra1[6], ytra1[6], ztra1[6];
103 Int_t i;
104 Float_t xpos1, ypos1;
105 Int_t j;
106 Float_t angle, dcone[5], dtube[3], dpgon[10];
107 Float_t rzero, xzero, yzero;
108 Double_t coeffa, coeffb, coeffc;
109 Int_t idrotm[5250];
110 Float_t atheta, offset;
111 Float_t offset1, offset2, dgh[15];
112 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
113 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
114 //Float_t yos;
115 Float_t r1, r2, r3;
116 Double_t xcc1, ycc1, xcc2, ycc2;
117 Float_t atheta910;
118 const char natra[][5] =
119 { "TR01","TR02","TR03","TR04","TR05","TR06","TR07","TR08"};
120 const char natra1[][5] =
121 {"TR11","TR12","TR13","TR14","TR15","TR16","TR17","TR18",
122 "TR19","TR20","TR21","TR22","TR23","TR24","TR25","TR26"};
123 const char natra2[][5] =
124 {"TR31","TR32","TR33","TR34","TR35","TR36"};
125 const char natra3[][5] =
126 {"TR41","TR42","TR43","TR44","TR45","TR46"};
127 const char natra4[][5] =
128 {"TR51","TR52","TR53","TR54","TR55","TR56","TR57","TR58",
129 "TR59","TR60","TR61","TR62","TR63","TR64","TR65","TR66"};
130
ad51aeb0 131 Int_t *idtmed = fIdtmed->GetArray()-199;
fe4da5cc 132
133 // --- Define a ghost volume containing the whole ITS and fill it with air
134 // or vacuum
135
136 dgh[0] = 0;
137 dgh[1] = 360;
138 dgh[2] = 4;
139 dgh[3] = -70;
140 dgh[4] = 49.999;
141 dgh[5] = 49.999;
142 dgh[6] = -25;
143 dgh[7] = 3;
144 dgh[8] = 49.999;
145 dgh[9] = 25;
146 dgh[10] = 3;
147 dgh[11] = 49.999;
148 dgh[12] = 70;
149 dgh[13] = 49.999;
150 dgh[14] = 49.999;
151 pMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
152
153 // --- Place the ghost volume in its mother volume (ALIC) and make it
154 // invisible
155
156 pMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
157 pMC->Gsatt("ITSV", "SEEN", 0);
158
159 //************************************************************************
160 //* *
161 //* P I X E L S *
162 //* =========== *
163 //* *
164 //************************************************************************
165
166 // GOTO 2345 ! skip ITS layer no. 1 and 2
167
168 // --- Define a ghost volume containing the Silicon Pixel Detectors
169 // (layer #1 and #2) and fill it with air or vacuum
170
171 xxm = (49.999-3)/(70-25);
172 dgh[0] = 0.;
173 dgh[1] = 360;
174 dgh[2] = 4;
175 dgh[3] = -25.-(9.-3.01)/xxm;
176 dgh[4] = 9;
177 dgh[5] = 9;
178 dgh[6] = -25;
179 dgh[7] = 3.01;
180 dgh[8] = 9;
181 dgh[9] = 25;
182 dgh[10] = 3.01;
183 dgh[11] = 9;
184 dgh[12] = 25+(9-3.01)/xxm;
185 dgh[13] = 9;
186 dgh[14] = 9;
187 pMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
188
189 // --- Place the ghost volume in its mother volume (ITSV) and make it
190 // invisible
191
192 pMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
193 pMC->Gsatt("IT12", "SEEN", 0);
194
195 // --- Define a ghost volume containing a single element of layer #1
196 // and fill it with air or vacuum
197
198 dbox1[0] = 0.005+0.01+0.0075;
199 dbox1[1] = .79;
200 dbox1[2] = 12.67;
201 pMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
202
203 //--- Divide each element of layer #1 in three ladders along the beam direction
204
205 pMC->Gsdvn("IPB1", "IPV1", 3, 3);
206
207 // --- Make the ghost volumes invisible
208
209 pMC->Gsatt("IPV1", "SEEN", 0);
210 pMC->Gsatt("IPB1", "SEEN", 0);
211
212 // --- Define a volume containing the chip of pixels (silicon, layer #1)
213
214 dchi[0] = .005;
215 dchi[1] = .79;
216 dchi[2] = dbox1[2] / 3.;
217 pMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
218
219 // --- Define a volume containing the bus of pixels (silicon, layer #1)
220
221 dbus[0] = .01;
222 dbus[1] = .64;
223 dbus[2] = 4.19;
224 pMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
225
226 // --- Define a volume containing the sensitive part of pixels
227 // (silicon, layer #1)
228
229 dits[0] = .0075;
230 dits[1] = .64;
231 dits[2] = 4.19;
232 pMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
233
234 // --- Place the chip into its mother (IPB1)
235
236 xpos = dbox1[0] - dchi[0];
237 ypos = 0.;
238 zpos = 0.;
239 pMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
240
241 // --- Place the sensitive volume into its mother (IPB1)
242
243 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
244 ypos = dchi[1] - dits[1];
245 zpos = -(dchi[2] - dits[2]);
246 pMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
247
248 // --- Place the bus into its mother (IPB1)
249
250 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
251 ypos = dchi[1] - dbus[1];
252 zpos = -(dchi[2] - dbus[2]);
253 pMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
254
255 // --- Define a ghost volume containing a single element of layer #2
256 // and fill it with air or vacuum
257
258 dbox2[0] = 0.005+0.01+0.0075;
259 dbox2[1] = .79;
260 dbox2[2] = 16.91;
261 pMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
262
263 //--- Divide each element of layer #2 in four ladders along the beam direction
264
265 pMC->Gsdvn("IPB2", "IPV2", 4, 3);
266
267 // --- Make the ghost volumes invisible
268
269 pMC->Gsatt("IPV2", "SEEN", 0);
270 pMC->Gsatt("IPB2", "SEEN", 0);
271
272 // --- Define a volume containing the chip of pixels (silicon, layer #2)
273
274 dchi[0] = .005;
275 dchi[1] = .79;
276 dchi[2] = dbox2[2] / 4.;
277 pMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
278
279 // --- Define a volume containing the bus of pixels (silicon, layer #2)
280
281 dbus[0] = .01;
282 dbus[1] = .64;
283 dbus[2] = 4.19;
284 pMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
285
286 // --- Define a volume containing the sensitive part of pixels
287 // (silicon, layer #2)
288
289 dits[0] = .0075;
290 dits[1] = .64;
291 dits[2] = 4.19;
292 pMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
293
294 // --- Place the chip into its mother (IPB2)
295
296 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
297 ypos = 0.;
298 zpos = 0.;
299 pMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
300
301 // --- Place the sensitive volume into its mother (IPB2)
302
303 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
304 ypos = -(dchi[1] - dits[1]);
305 zpos = -(dchi[2] - dits[2]);
306 pMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
307
308 // --- Place the bus into its mother (IPB2)
309
310 xpos = dbox1[0] - dbus[0];
311 ypos = -(dchi[1] - dbus[1]);
312 zpos = -(dchi[2] - dbus[2]);
313 pMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
314
315 // --- Define a generic segment of an element of the mechanical support
316
317 dsup[0] = 0.;
318 dsup[1] = 0.;
319 dsup[2] = 0.;
320 pMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
321
322 // --- Define a generic arc of an element of the mechanical support
323
324 darc[0] = 0.;
325 darc[1] = 0.;
326 darc[2] = 0.;
327 pMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
328
329 // --- Define the mechanical supports of layers #1 and #2 and place the
330 // elements of the layers in it
331
332 jbox1 = 0;
333 // counter over the number of elements of layer #1 (
334 jbox2 = 0;
335
336 // counter over the number of elements of layer #2 (
337 for (i = 1; i <= 10; ++i) {
338
339 // --- Place part # 1-2 (see sketch)
340
341 // number of carbon fiber supports (see sketch)
342 offset1 = -35.;
343 dsup[0] = .01;
344 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
345 dsup[2] = 25.;
346 xcc = (xx[0] + xx[1]) / 20.;
347 ycc = (yy[0] + yy[1]) / 20.;
348 xccc = (xbeg[0] + xend[0]) / 20.;
349 yccc = (ybeg[0] + yend[0]) / 20.;
350 if (xx[0] == xx[1]) {
351 offset2 = 0.;
352 } else {
353 r1 = yy[1] - yy[0];
354 r2 = xx[1] - xx[0];
355 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
356 }
357 aphi = (pphi + (i-1) * 36.) * degrad;
358 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
359 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
360 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
361 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
362 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
363 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
364 zpos = 0.;
365 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
366 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
367 pMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
368
369 // --- Place part # 2-3 (see sketch)
370
371 offset1 = -35.;
372 dsup[0] = .01;
373 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
374 dsup[2] = 25.;
375 xcc = (xx[1] + xx[2]) / 20.;
376 ycc = (yy[1] + yy[2]) / 20.;
377 xccc = (xbeg[1] + xend[1]) / 20.;
378 yccc = (ybeg[1] + yend[1]) / 20.;
379 if (xx[1] == xx[2]) {
380 offset2 = 0.;
381 } else {
382 r1 = yy[2] - yy[1];
383 r2 = xx[2] - xx[1];
384 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
385 }
386 aphi = (pphi + (i-1) * 36.) * degrad;
387 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
388 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
389 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
390 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
391 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
392 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
393 zpos = 0.;
394 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
395 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
396 pMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
397
398 // --- Place an element of layer #2
399
400 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
401 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
402 coeffa = biga * biga + 1.;
403 coeffb = biga * bigb - biga * ycc - xcc;
404 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 0.08964*0.08964;
405 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
406 ycc1 = biga * xcc1 + bigb;
407 biga1 = -1. / biga;
408 bigb1 = xcc1 / biga + ycc1;
409 coeffa = biga1 * biga1 + 1.;
410 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
411 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
412 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
413 ycc2 = biga1 * xcc2 + bigb1;
414 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
415 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
416 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
417 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
418 zpos = 0.;
419 ++jbox2;
420 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
421
422 // --- Place part # 3-4 (see sketch)
423
424 offset1 = -35.;
425 dsup[0] = .01;
426 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
427 dsup[2] = 25.;
428 xcc = (xx[1] + xx[2]) / 20.;
429 ycc = (yy[1] + yy[2]) / 20.;
430 xccc = (xbeg[2] + xend[2]) / 20.;
431 yccc = (ybeg[2] + yend[2]) / 20.;
432 if (xx[2] == xx[3]) {
433 offset2 = 0.;
434 } else {
435 r1 = yy[3] - yy[2];
436 r2 = xx[3] - xx[2];
437 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
438 }
439 aphi = (pphi + (i-1) * 36.) * degrad;
440 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
441 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
442 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
443 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
444 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
445 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
446 zpos = 0.;
447 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
448 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
449 pMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
450
451 // --- Place part # 4-5 (see sketch)
452
453 offset1 = -35.;
454 dsup[0] = .01;
455 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
456 dsup[2] = 25.;
457 xcc = (xx[3] + xx[4]) / 20.;
458 ycc = (yy[3] + yy[4]) / 20.;
459 xccc = (xbeg[3] + xend[3]) / 20.;
460 yccc = (ybeg[3] + yend[3]) / 20.;
461 if (xx[3] == xx[4]) {
462 offset2 = 0.;
463 } else {
464 r1 = yy[4] - yy[3];
465 r2 = xx[4] - xx[3];
466 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
467 }
468 aphi = (pphi + (i-1) * 36.) * degrad;
469 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
470 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
471 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
472 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
473 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
474 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
475 zpos = 0.;
476 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
477 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
478 pMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
479
480 // --- Place an element of layer #2
481
482 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
483 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
484 coeffa = biga * biga + 1.;
485 coeffb = biga * bigb - biga * ycc - xcc;
486 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
487 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
488 ycc1 = biga * xcc1 + bigb;
489 biga1 = -1. / biga;
490 bigb1 = xcc1 / biga + ycc1;
491 coeffa = biga1 * biga1 + 1.;
492 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
493 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
494 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
495 ycc2 = biga1 * xcc2 + bigb1;
496 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
497 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
498 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
499 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
500 zpos = 0.;
501 ++jbox2;
502 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
503
504 // --- Place part # 5-6 (see sketch)
505
506 offset1 = -35.;
507 dsup[0] = .01;
508 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
509 dsup[2] = 25.;
510 xcc = (xx[4] + xx[5]) / 20.;
511 ycc = (yy[4] + yy[5]) / 20.;
512 xccc = (xbeg[4] + xend[4]) / 20.;
513 yccc = (ybeg[4] + yend[4]) / 20.;
514 if (xx[4] == xx[5]) {
515 offset2 = 0.;
516 } else {
517 r1 = yy[5] - yy[4];
518 r2 = xx[5] - xx[4];
519 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
520 }
521 aphi = (pphi + (i-1) * 36.) * degrad;
522 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
523 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
524 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
525 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
526 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
527 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
528 zpos = 0.;
529 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
530 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
531 pMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
532
533 // --- Place part # 6-7 (see sketch)
534
535 offset1 = -35.;
536 dsup[0] = .01;
537 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
538 dsup[2] = 25.;
539 xcc = (xx[5] + xx[6]) / 20.;
540 ycc = (yy[5] + yy[6]) / 20.;
541 xccc = (xbeg[5] + xend[5]) / 20.;
542 yccc = (ybeg[5] + yend[5]) / 20.;
543 if (xx[5] == xx[6]) {
544 offset2 = 0.;
545 } else {
546 r1 = yy[6] - yy[5];
547 r2 = xx[6] - xx[5];
548 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
549 }
550 aphi = (pphi + (i-1) * 36.) * degrad;
551 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
552 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
553 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
554 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
555 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
556 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
557 zpos = 0.;
558 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
559 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
560 pMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
561
562 // --- Place an element of layer #2
563
564 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
565 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
566 coeffa = biga * biga + 1.;
567 coeffb = biga * bigb - biga * ycc - xcc;
568 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
569 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
570 ycc1 = biga * xcc1 + bigb;
571 biga1 = -1. / biga;
572 bigb1 = xcc1 / biga + ycc1;
573 coeffa = biga1 * biga1 + 1.;
574 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
575 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
576 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
577 ycc2 = biga1 * xcc2 + bigb1;
578 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
579 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
580 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
581 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
582 zpos = 0.;
583 ++jbox2;
584 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
585
586 // --- Place part # 7-8 (see sketch)
587
588 offset1 = -35.;
589 dsup[0] = .01;
590 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
591 dsup[2] = 25.;
592 xcc = (xx[6] + xx[7]) / 20.;
593 ycc = (yy[6] + yy[7]) / 20.;
594 xccc = (xbeg[6] + xend[6]) / 20.;
595 yccc = (ybeg[6] + yend[6]) / 20.;
596 if (xx[6] == xx[7]) {
597 offset2 = 0.;
598 } else {
599 r1 = yy[7] - yy[6];
600 r2 = xx[7] - xx[6];
601 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
602 }
603 aphi = (pphi + (i-1) * 36.) * degrad;
604 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
605 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
606 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
607 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
608 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
609 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
610 zpos = 0.;
611 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
612 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
613 pMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
614
615 // --- Place part # 8-9 (see sketch)
616
617 offset1 = -35.;
618 dsup[0] = .01;
619 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
620 dsup[2] = 25.;
621 xcc = (xx[7] + xx[8]) / 20.;
622 ycc = (yy[7] + yy[8]) / 20.;
623 xccc = (xbeg[7] + xend[7]) / 20.;
624 yccc = (ybeg[7] + yend[7]) / 20.;
625 if (xx[1] == xx[2]) {
626 offset2 = 0.;
627 } else {
628 r1 = yy[8] - yy[7];
629 r2 = xx[8] - xx[7];
630 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
631 }
632 aphi = (pphi + (i-1) * 36.) * degrad;
633 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
634 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
635 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
636 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
637 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
638 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
639 zpos = 0.;
640 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
641 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
642 pMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
643
644 // --- Place an element of layer #2
645
646 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
647 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
648 coeffa = biga * biga + 1.;
649 coeffb = biga * bigb - biga * ycc - xcc;
650 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
651 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
652 ycc1 = biga * xcc1 + bigb;
653 biga1 = -1. / biga;
654 bigb1 = xcc1 / biga + ycc1;
655 coeffa = biga1 * biga1 + 1.;
656 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
657 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
658 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
659 ycc2 = biga1 * xcc2 + bigb1;
660 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
661 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
662 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
663 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
664 zpos = 0.;
665 ++jbox2;
666 pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
667
668 // --- Place part # 9-10 (see sketch)
669
670 offset1 = -35.;
671 dsup[0] = .01;
672 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
673 dsup[2] = 25.;
674 xcc = (xx[8] + xx[9]) / 20.;
675 ycc = (yy[8] + yy[9]) / 20.;
676 xccc = (xbeg[8] + xend[8]) / 20.;
677 yccc = (ybeg[8] + yend[8]) / 20.;
678 if (xx[8] == xx[9]) {
679 offset2 = 0.;
680 } else {
681 r1 = yy[9] - yy[8];
682 r2 = xx[9] - xx[8];
683 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
684 }
685 aphi = (pphi + (i-1) * 36.) * degrad;
686 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
687 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
688 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
689 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
690 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
691 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
692 zpos = 0.;
693 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
694 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
695 pMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
696
697 // --- Place part # 10-11 (see sketch)
698
699 offset1 = -35.;
700 dsup[0] = .01;
701 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
702 dsup[2] = 25.;
703 xcc = (xx[9] + xx[10]) / 20.;
704 ycc = (yy[9] + yy[10]) / 20.;
705 xccc = (xbeg[9] + xend[9]) / 20.;
706 yccc = (ybeg[9] + yend[9]) / 20.;
707 if (xx[9] == xx[10]) {
708 offset2 = 0.;
709 } else {
710 r1 = yy[10] - yy[9];
711 r2 = xx[10] - xx[9];
712 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
713 }
714 aphi = (pphi + (i-1) * 36.) * degrad;
715 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
716 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
717 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
718 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
719 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
720 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
721 zpos = 0.;
722 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
723 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
724 pMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
725
726 // --- Place part # 13-14 (see sketch)
727
728 offset1 = -35.;
729 dsup[0] = .01;
730 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
731 dsup[2] = 25.;
732 xcc = (xx[12] + xx[13]) / 20.;
733 ycc = (yy[12] + yy[13]) / 20.;
734 xccc = (xbeg[12] + xend[12]) / 20.;
735 yccc = (ybeg[12] + yend[12]) / 20.;
736 if (xx[12] == xx[13]) {
737 offset2 = 0.;
738 } else {
739 r1 = yy[12] - yy[13];
740 r2 = xx[12] - xx[13];
741 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
742 }
743 aphi = (pphi + (i-1) * 36.) * degrad;
744 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
745 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
746 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
747 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
748 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
749 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
750 zpos = 0.;
751 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
752 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
753 pMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
754
755 // --- Place an element of layer #1
756
757 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
758 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
759 coeffa = biga * biga + 1.;
760 coeffb = biga * bigb - biga * ycc - xcc;
761 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
762 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
763 ycc1 = biga * xcc1 + bigb;
764 biga1 = -1. / biga;
765 bigb1 = xcc1 / biga + ycc1;
766 coeffa = biga1 * biga1 + 1.;
767 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
768 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
769 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
770 ycc2 = biga1 * xcc2 + bigb1;
771 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
772 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
773 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
774 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
775 zpos = 0.;
776 ++jbox1;
777 pMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
778
779 // --- Place part # 12-13 (see sketch)
780
781 offset1 = -35.;
782 dsup[0] = .01;
783 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
784 dsup[2] = 25.;
785 xcc = (xx[11] + xx[12]) / 20.;
786 ycc = (yy[11] + yy[12]) / 20.;
787 xccc = (xbeg[11] + xend[11]) / 20.;
788 yccc = (ybeg[11] + yend[11]) / 20.;
789 if (xx[11] == xx[12]) {
790 offset2 = 0.;
791 } else {
792 r1 = yy[12] - yy[11];
793 r2 = xx[12] - xx[11];
794 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
795 }
796 aphi = (pphi + (i-1) * 36.) * degrad;
797 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
798 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
799 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
800 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
801 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
802 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
803 zpos = 0.;
804 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
805 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
806 pMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
807
808 // --- Place part # 11-12 (see sketch)
809
810 offset1 = -35.;
811 dsup[0] = .01;
812 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
813 dsup[2] = 25.;
814 xcc = (xx[10] + xx[11]) / 20.;
815 ycc = (yy[10] + yy[11]) / 20.;
816 xccc = (xbeg[10] + xend[10]) / 20.;
817 yccc = (ybeg[10] + yend[10]) / 20.;
818 if (xx[10] == xx[11]) {
819 offset2 = 0.;
820 } else {
821 r1 = yy[11] - yy[10];
822 r2 = xx[11] - xx[10];
823 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
824 }
825 aphi = (pphi + (i-1) * 36.) * degrad;
826 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
827 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
828 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
829 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
830 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
831 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
832 zpos = 0.;
833 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
834 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
835 pMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
836
837 // --- Place an element of layer #1
838
839 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
840 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
841 coeffa = biga * biga + 1.;
842 coeffb = biga * bigb - biga * ycc - xcc;
843 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
844 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
845 ycc1 = biga * xcc1 + bigb;
846 biga1 = -1. / biga;
847 bigb1 = xcc1 / biga + ycc1;
848 coeffa = biga1 * biga1 + 1.;
849 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
850 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
851 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
852 ycc2 = biga1 * xcc2 + bigb1;
853 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
854 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
855 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
856 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
857 zpos = 0.;
858 ++jbox1;
859 pMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
860
861 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
862
863 darc[0] = rarc[12] / 10. - .02;
864 darc[1] = rarc[12] / 10.;
865 darc[2] = 25.;
866 darc[3] = atheta12 - (i-1) * 36.;
867 darc[4] = atheta23 - (i-1) * 36.;
868 xcc = xarc[12] / 10.;
869 ycc = yarc[12] / 10.;
870 aphi = (pphi + (i-1) * 36.) * degrad;
871 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
872 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
873 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
874 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
875 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
876 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
877 zpos = 0.;
878 pMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
879
880 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
881
882 darc[0] = rarc[11] / 10. - .02;
883 darc[1] = rarc[11] / 10.;
884 darc[2] = 25.;
885 darc[3] = atheta23 + 90. - (i-1) * 36.;
886 darc[4] = atheta34 + 90. - (i-1) * 36.;
887 xcc = xarc[11] / 10.;
888 ycc = yarc[11] / 10.;
889 aphi = (pphi + (i-1) * 36.) * degrad;
890 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
891 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
892 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
893 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
894 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
895 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
896 zpos = 0.;
897 pMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
898
899 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
900
901 darc[0] = rarc[10] / 10. - .02;
902 darc[1] = rarc[10] / 10.;
903 darc[2] = 25.;
904 darc[3] = atheta45 + 180. - (i-1) * 36.;
905 darc[4] = atheta34 + 180. - (i-1) * 36.;
906 xcc = xarc[10] / 10.;
907 ycc = yarc[10] / 10.;
908 aphi = (pphi + (i-1) * 36.) * degrad;
909 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
910 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
911 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
912 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
913 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
914 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
915 zpos = 0.;
916 pMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
917
918 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
919
920 darc[0] = rarc[9] / 10. - .02;
921 darc[1] = rarc[9] / 10.;
922 darc[2] = 25.;
923 darc[3] = atheta45 - 90. - (i-1) * 36.;
924 darc[4] = atheta56 - 90. - (i-1) * 36.;
925 xcc = xarc[9] / 10.;
926 ycc = yarc[9] / 10.;
927 aphi = (pphi + (i-1) * 36.) * degrad;
928 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
929 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
930 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
931 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
932 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
933 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
934 zpos = 0.;
935 pMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
936
937 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
938
939 darc[0] = rarc[8] / 10. - .02;
940 darc[1] = rarc[8] / 10.;
941 darc[2] = 25.;
942 darc[3] = atheta67 + 45. - (i-1) * 36.;
943 darc[4] = atheta56 + 45. - (i-1) * 36.;
944 xcc = xarc[8] / 10.;
945 ycc = yarc[8] / 10.;
946 aphi = (pphi + (i-1) * 36.) * degrad;
947 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
948 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
949 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
950 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
951 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
952 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
953 zpos = 0.;
954 pMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
955
956 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
957
958 darc[0] = rarc[7] / 10. - .02;
959 darc[1] = rarc[7] / 10.;
960 darc[2] = 25.;
961 darc[3] = atheta67 - (i-1) * 36.;
962 darc[4] = atheta78 - (i-1) * 36.;
963 xcc = xarc[7] / 10.;
964 ycc = yarc[7] / 10.;
965 aphi = (pphi + (i-1) * 36.) * degrad;
966 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
967 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
968 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
969 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
970 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
971 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
972 zpos = 0.;
973 pMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
974
975 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
976
977 darc[0] = rarc[6] / 10. - .02;
978 darc[1] = rarc[6] / 10.;
979 darc[2] = 25.;
980 darc[3] = atheta89 + 45. - (i-1) * 36.;
981 darc[4] = atheta78 + 45. - (i-1) * 36.;
982 xcc = xarc[6] / 10.;
983 ycc = yarc[6] / 10.;
984 aphi = (pphi + (i-1) * 36.) * degrad;
985 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
986 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
987 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
988 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
989 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
990 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
991 zpos = 0.;
992 pMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
993
994 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
995
996 darc[0] = rarc[5] / 10. - .02;
997 darc[1] = rarc[5] / 10.;
998 darc[2] = 25.;
999 darc[3] = atheta89 + 45. - (i-1) * 36.;
1000 darc[4] = atheta910 + 45. - (i-1) * 36.;
1001 xcc = xarc[5] / 10.;
1002 ycc = yarc[5] / 10.;
1003 aphi = (pphi + (i-1) * 36.) * degrad;
1004 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1005 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1006 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1007 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1008 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1009 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1010 zpos = 0.;
1011 pMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
1012
1013 // --- Place arc # 5 (between part 9-10 and part 10-11)
1014 // (see sketch)
1015
1016 darc[0] = rarc[4] / 10. - .02;
1017 darc[1] = rarc[4] / 10.;
1018 darc[2] = 25.;
1019 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1020 darc[4] = atheta910 + 45. - (i-1) * 36.;
1021 xcc = xarc[4] / 10.;
1022 ycc = yarc[4] / 10.;
1023 aphi = (pphi + (i-1) * 36.) * degrad;
1024 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1025 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1026 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1027 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1028 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1029 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1030 zpos = 0.;
1031 pMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
1032
1033 // --- Place arc # 4 (between part 10-11 and part 11-12)
1034 // (see sketch)
1035
1036 darc[0] = rarc[3] / 10. - .02;
1037 darc[1] = rarc[3] / 10.;
1038 darc[2] = 25.;
1039 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1040 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1041 xcc = xarc[3] / 10.;
1042 ycc = yarc[3] / 10.;
1043 aphi = (pphi + (i-1) * 36.) * degrad;
1044 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1045 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1046 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1047 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1048 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1049 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1050 zpos = 0.;
1051 pMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
1052
1053 // --- Place arc # 3 (between part 11-12 and part 12-13)
1054 // (see sketch)
1055
1056 darc[0] = rarc[2] / 10. - .02;
1057 darc[1] = rarc[2] / 10.;
1058 darc[2] = 25.;
1059 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1060 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1061 xcc = xarc[2] / 10.;
1062 ycc = yarc[2] / 10.;
1063 aphi = (pphi + (i-1) * 36.) * degrad;
1064 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1065 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1066 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1067 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1068 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1069 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1070 zpos = 0.;
1071 pMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
1072
1073 // --- Place arc # 2 (between part 12-13 and part 13-14)
1074 // (see sketch)
1075
1076 darc[0] = rarc[1] / 10. - .02;
1077 darc[1] = rarc[1] / 10.;
1078 darc[2] = 25.;
1079 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1080 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1081 xcc = xarc[1] / 10.;
1082 ycc = yarc[1] / 10.;
1083 aphi = (pphi + (i-1) * 36.) * degrad;
1084 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1085 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1086 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1087 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1088 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1089 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1090 zpos = 0.;
1091 pMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
1092
1093 // --- Place arc # 1 (between part 13-14 and part 1-2)
1094 // (see sketch)
1095
1096 darc[0] = rarc[0] / 10. - .02;
1097 darc[1] = rarc[0] / 10.;
1098 darc[2] = 25.;
1099 darc[3] = atheta12 + 45. - (i-1) * 36.;
1100 darc[4] = atheta1314 - (i-1) * 36.;
1101 xcc = xarc[0] / 10.;
1102 ycc = yarc[0] / 10.;
1103 aphi = (pphi + (i-1) * 36.) * degrad;
1104 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1105 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1106 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1107 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1108 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1109 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1110 zpos = 0.;
1111 pMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
1112
1113 }
1114 //************************************************************************
1115 //* *
1116 //* D R I F T S *
1117 //* =========== *
1118 //* *
1119 //************************************************************************
1120
1121 // --- Define a ghost volume containing the Silicon Drift Detectors
1122 // (layer #3 and #4) and fill it with air or vacuum
1123
1124 xxm = (49.999-3.)/(70.-25.);
1125 dgh[0] = 0;
1126 dgh[1] = 360;
1127 dgh[2] = 4;
1128 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1129 dgh[4] = 27.;
1130 dgh[5] = 27.;
1131 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1132 dgh[7] = 9.01;
1133 dgh[8] = 27.;
1134 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1135 dgh[10] = 9.01;
1136 dgh[11] = 27.;
1137 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1138 dgh[13] = 27.;
1139 dgh[14] = 27.;
1140 pMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
1141
1142 // --- Place the ghost volume in its mother volume (ITSV) and make it
1143 // invisible
1144
1145 pMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1146 pMC->Gsatt("IT34", "SEEN", 0);
1147
1148 // --- Layer #3
1149
1150 // GOTO 3456 ! skip ITS layer no. 3
1151
1152 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1153 // smaller lenght of ribs) and fill it with air or vacuum
1154
1155 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1156 dbox1[1] = 3.85;
1157 // the widest element is the sensitive element
1158 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1159 // 7.5 cm is the lenght
1160 pMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
1161
1162 // --- Make the ghost volume invisible
1163
1164 pMC->Gsatt("IDV1", "SEEN", 0);
1165
1166 // --- Define a volume containing the sensitive part of drifts
1167 // (silicon, layer #3)
1168
1169 dits[0] = .0172;
1170 // see material budget report by G. Feofilov
1171 dits[1] = 3.85;
1172 dits[2] = 4.35;
1173 pMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
1174
1175 //--- Define the part of the (smaller) rib between two sensitive parts made of
1176 // carbon (layer #3)
1177
1178 dsup[0] = .5 - dits[0];
1179 dsup[1] = .01;
1180 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1181 // 7.5 cm is the lenght
1182 pMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
1183
1184 //--- Define the first part of the (smaller) rib between two sensitive parts
1185 // made of aluminum (layer #3)
1186
1187 dal1[0] = .5 - dits[0];
1188 dal1[1] = 0.00096/2.;
1189 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1190 // 7.5 cm is the lenght
1191 pMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
1192
1193 //--- Define the part of the (smaller) rib between two sensitive parts made of
1194 // kapton (layer #3)
1195
1196 dkap[0] = .5 - dits[0];
1197 dkap[1] = .01585;
1198 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1199 // 7.5 cm is the lenght
1200 pMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
1201
1202 //--- Define the second part of the (smaller) rib between two sensitive parts
1203 // made of aluminum (layer #3)
1204
1205 dal2[0] = .5 - dits[0];
1206 dal2[1] = 0.0027/2.;
1207 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1208 // 7.5 cm is the lenght
1209 pMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
1210
1211 // --- Define the part of the (smaller) rib between two sensitive parts
1212 // made of silicon (the electronics) (layer #3)
1213
1214 dchi[0] = .5 - dits[0];
1215 dchi[1] = 0.0071/2.;
1216 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1217 // 7.5 cm is the lenght
1218 pMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
1219
1220 // --- Define the part of the (smaller) rib between two sensitive parts
1221 // made of water (the cooler) (layer #3)
1222
1223 dwat[0] = .5 - dits[0];
1224 dwat[1] = 0.0093/2.;
1225 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1226 // 7.5 cm is the lenght
1227 pMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
1228
1229 //--- Define the third part of the (smaller) rib between two sensitive parts
1230 // made of aluminum (the cooling tubes) (layer #3)
1231
1232 dtub[0] = .5 - dits[0];
1233 dtub[1] = 0.00134/2.;
1234 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1235 // 7.5 cm is the lenght
1236 pMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
1237
1238 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1239
1240 dpcb[0] = .03;
1241 // twice the foreseen thickness
1242 dpcb[1] = 3.5;
1243 dpcb[2] = 7.5;
1244 pMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
1245
1246 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1247
1248 dcop[0] = .0252;
1249 // twice the foreseen thickness
1250 dcop[1] = 3.5;
1251 dcop[2] = 7.5;
1252 pMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
1253
1254 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1255
1256 dcer[0] = .04;
1257 // twice the foreseen thickness
1258 dcer[1] = 3.5;
1259 dcer[2] = 7.5;
1260 pMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
1261
1262 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1263
1264 dsil[0] = .003;
1265 // twice the foreseen thickness
1266 dsil[1] = 3.5;
1267 dsil[2] = 7.5;
1268 pMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
1269
1270 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1271 // (IDV1)
1272
1273 ypos = 0.;
1274 for (j = 1; j <= 5; ++j) {
1275 // odd elements are up and even elements are down
1276 if (j == 1) {
1277 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1278 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1279 } else if (j == 2) {
1280 xpos = -dbox1[0] + dits[0];
1281 zpos = 0. - dits[2] + 1. - dits[2];
1282 } else if (j == 3) {
1283 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1284 zpos = 0.;
1285 } else if (j == 4) {
1286 xpos = -dbox1[0] + dits[0];
1287 zpos = dits[2] + 0. - 1. + dits[2];
1288 } else if (j == 5) {
1289 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1290 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1291 }
1292 pMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1293 }
1294
1295 // --- Place the smaller ribs into their mother (IDV1)
1296
1297 // --- Right ribs (just a matter of convention)
1298
1299 xpos = .5 - dbox1[0] + dits[0];
1300 zpos = 0.;
1301
1302 // --- Carbon
1303
1304 ypos = 2.81;
1305 pMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1306
1307 // --- Aluminum #1
1308
1309 ypos = dsup[1] + 2.81 + dal1[1];
1310 pMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1311
1312 // --- Kapton
1313
1314 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1315 pMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1316
1317 // --- Aluminum #2
1318
1319 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1320 pMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1321
1322 // --- Silicon (chip)
1323
1324 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1325 pMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1326
1327 // --- Water
1328
1329 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1330 pMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1331
1332 // --- Aluminum #3
1333
1334 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1335 + dtub[1];
1336 pMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1337
1338 // --- Right ribs (just a matter of convention)
1339
1340 // --- Carbon
1341
1342 ypos = -2.81;
1343 pMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1344
1345 // --- Aluminum #1
1346
1347 ypos = -(dsup[1] + 2.81 + dal1[1]);
1348 pMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1349
1350 // --- Kapton
1351
1352 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1353 pMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1354
1355 // --- Aluminum #2
1356
1357 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1358 pMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1359
1360 // --- Silicon (chip)
1361
1362 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1363 pMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1364
1365 // --- Water
1366
1367 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1368 pMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1369
1370 // --- Aluminum #3
1371
1372 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1373 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1374 pMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1375
1376 // --- Place the end-ladder stuff into its mother (IDV1)
1377
1378
1379 // --- Negative-Z end-ladder
1380
1381 ypos = 0.;
1382 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1383
1384 // --- PCB
1385
1386 xpos = dbox1[0] - dpcb[0];
1387 pMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1388
1389 // --- Copper
1390
1391 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1392 pMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1393
1394 // --- Ceramics
1395
1396 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1397 pMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1398
1399 // --- Silicon (bus)
1400
1401 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1402 pMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1403
1404 // --- Positive-Z end-ladder
1405
1406 ypos = 0.;
1407 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1408
1409 // --- PCB
1410
1411 xpos = dbox1[0] - dpcb[0];
1412 pMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1413
1414 // --- Copper
1415
1416 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1417 pMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1418
1419 // --- Ceramics
1420
1421 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1422 pMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1423
1424 // --- Silicon (bus)
1425
1426 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1427 pMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1428
1429 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1430 // larger lenght of ribs) and fill it with air or vacuum
1431
1432 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1433 dbox2[1] = 3.85;
1434 // the widest element is the sensitive element
1435 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1436 // 7.5 cm is the lenght
1437 pMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
1438
1439 // --- Make the ghost volume invisible
1440
1441 pMC->Gsatt("IDV2", "SEEN", 0);
1442
1443 //--- Define the part of the (larger) rib between two sensitive parts madeof
1444 // carbon (layer #3)
1445
1446 dsup[0] = .65 - dits[0];
1447 dsup[1] = .01;
1448 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1449 // 7.5 cm is the lenght
1450 pMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
1451
1452 //--- Define the first part of the (larger) rib between two sensitive parts
1453 // made of aluminum (layer #3)
1454
1455 dal1[0] = .65 - dits[0];
1456 dal1[1] = 0.00096/2.;
1457 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1458 // 7.5 cm is the lenght
1459 pMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
1460
1461 //--- Define the part of the (larger) rib between two sensitive parts madeof
1462 // kapton (layer #3)
1463
1464 dkap[0] = .65 - dits[0];
1465 dkap[1] = 0.0317/2.;
1466 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1467 // 7.5 cm is the lenght
1468 pMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
1469
1470 //--- Define the second part of the (larger) rib between two sensitive parts
1471 // made of aluminum (layer #3)
1472
1473 dal2[0] = .65 - dits[0];
1474 dal2[1] = 0.0027/2.;
1475 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1476 // 7.5 cm is the lenght
1477 pMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
1478
1479 // --- Define the part of the (larger) rib between two sensitive parts
1480 // made of silicon (the electronics) (layer #3)
1481
1482 dchi[0] = .65 - dits[0];
1483 dchi[1] = 0.0071/2.;
1484 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1485 // 7.5 cm is the lenght
1486 pMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
1487
1488 // --- Define the part of the (larger) rib between two sensitive parts
1489 // made of water (the cooler) (layer #3)
1490
1491 dwat[0] = .65 - dits[0];
1492 dwat[1] = 0.0093/2.;
1493 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1494 // 7.5 cm is the lenght
1495 pMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
1496
1497 //--- Define the third part of the (larger) rib between two sensitive parts
1498 // made of aluminum (the cooling tubes) (layer #3)
1499
1500 dtub[0] = .65 - dits[0];
1501 dtub[1] = 0.00134/2.;
1502 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1503 // 7.5 cm is the lenght
1504 pMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
1505
1506 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1507 // (IDV2)
1508
1509 ypos = 0.;
1510 for (j = 1; j <= 5; ++j) {
1511 // odd element are up and even elements are down
1512 if (j == 1) {
1513 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1514 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1515 } else if (j == 2) {
1516 xpos = -dbox2[0] + dits[0];
1517 zpos = 0. - dits[2] + 1. - dits[2];
1518 } else if (j == 3) {
1519 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1520 zpos = 0.;
1521 } else if (j == 4) {
1522 xpos = -dbox2[0] + dits[0];
1523 zpos = dits[2] + 0. - 1. + dits[2];
1524 } else if (j == 5) {
1525 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1526 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1527 }
1528 pMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1529 }
1530
1531 // --- Place the larger ribs into their mother (IDV2)
1532
1533
1534 // --- Right ribs (just a matter of convention)
1535
1536 xpos = .65 - dbox2[0] + dits[0];
1537 zpos = 0.;
1538
1539 // --- Carbon
1540
1541 ypos = 2.81;
1542 pMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1543
1544 // --- Aluminum #1
1545
1546 ypos = dsup[1] + 2.81 + dal1[1];
1547 pMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1548
1549 // --- Kapton
1550
1551 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1552 pMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1553
1554 // --- Aluminum #2
1555
1556 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1557 pMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1558
1559 // --- Silicon (chip)
1560
1561 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1562 pMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1563
1564 // --- Water
1565
1566 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1567 pMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1568
1569 // --- Aluminum #3
1570
1571 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
1572 pMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1573
1574 // --- Right ribs (just a matter of convention)
1575
1576 // --- Carbon
1577
1578 ypos = -2.81;
1579 pMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1580
1581 // --- Aluminum #1
1582
1583 ypos = -(dsup[1] + 2.81 + dal1[1]);
1584 pMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1585
1586 // --- Kapton
1587
1588 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1589 pMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1590
1591 // --- Aluminum #2
1592
1593 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
1594 pMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1595
1596 // --- Silicon (chip)
1597
1598 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
1599 pMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1600
1601 // --- Water
1602
1603 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1604 pMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1605
1606 // --- Aluminum #3
1607
1608 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
1609 pMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1610
1611 // --- Place the end-ladder stuff into its mother (IDV1)
1612
1613
1614 // --- Negative-Z end-ladder
1615
1616 ypos = 0.;
1617 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1618
1619 // --- PCB
1620
1621 xpos = dbox2[0] - dpcb[0];
1622 pMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1623
1624 // --- Copper
1625
1626 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1627 pMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1628
1629 // --- Ceramics
1630
1631 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1632 pMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1633
1634 // --- Silicon (bus)
1635
1636 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1637 pMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
1638
1639 // --- Positive-Z end-ladder
1640
1641 //yos = 0.;
1642 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1643
1644 // --- PCB
1645
1646 xpos = dbox2[0] - dpcb[0];
1647 pMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1648
1649 // --- Copper
1650
1651 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
1652 pMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1653
1654 // --- Ceramics
1655
1656 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1657 pMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1658
1659 // --- Silicon (bus)
1660
1661 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1662 pMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
1663
1664 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1665 // mother volume (IT34)
1666 // Odd elements have large ribs and even elements have small ribs
1667
1668 for (i = 1; i <= 12; ++i) {
1669 atheta = (i-1) * 30.;
1670 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1671 if (i % 2 == 0) {
1672 rzero = 14.;
1673 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1674 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1675 zpos = 0.;
1676 pMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1677 } else {
1678 rzero = 13.85;
1679 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1680 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1681 zpos = 0.;
1682 pMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
1683 }
1684 }
1685
1686
1687 // --- Layer #4
1688
1689 // GOTO 4567 ! skip ITS layer no. 4
1690
1691 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1692 // smaller lenght of ribs) and fill it with air or vacuum
1693
1694 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1695 dbox1[1] = 3.5;
1696 // the widest element is the end-ladder stuff
1697 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1698 // 7.5 cm is the lenght
1699 pMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
1700
1701 // --- Make the ghost volume invisible
1702
1703 pMC->Gsatt("IDV3", "SEEN", 0);
1704
1705 // --- Define a volume containing the sensitive part of drifts
1706 // (silicon, layer #4)
1707
1708 dits[0] = .0172;
1709 // see material budget report by G. Feofilov
1710 dits[1] = 3.125;
1711 dits[2] = 4.35;
1712 pMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
1713
1714 //--- Define the part of the (smaller) rib between two sensitive parts made of
1715 // carbon (layer #4)
1716
1717 dsup[0] = .5 - dits[0];
1718 dsup[1] = .01;
1719 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1720 // 7.5 cm is the lengh
1721 pMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
1722
1723 //--- Define the first part of the (smaller) rib between two sensitive parts
1724 // made of aluminum (layer #4)
1725
1726 dal1[0] = .5 - dits[0];
1727 dal1[1] = 0.00096/2.;
1728 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1729 // 7.5 cm is the lengh
1730 pMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
1731
1732 //--- Define the part of the (smaller) rib between two sensitive parts made of
1733 // kapton (layer #4)
1734
1735 dkap[0] = .5 - dits[0];
1736 dkap[1] = 0.0317/2.;
1737 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1738 // 7.5 cm is the lengh
1739 pMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
1740
1741 //--- Define the second part of the (smaller) rib between two sensitive parts
1742 // made of aluminum (layer #4)
1743
1744 dal2[0] = .5 - dits[0];
1745 dal2[1] = 0.0027/2.;
1746 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1747 // 7.5 cm is the lengh
1748 pMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
1749
1750 // --- Define the part of the (smaller) rib between two sensitive parts
1751 // made of silicon (the electronics) (layer #4)
1752
1753 dchi[0] = .5 - dits[0];
1754 dchi[1] = 0.0071/2.;
1755 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1756 // 7.5 cm is the lengh
1757 pMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
1758
1759 // --- Define the part of the (smaller) rib between two sensitive parts
1760 // made of water (the cooler) (layer #4)
1761
1762 dwat[0] = .5 - dits[0];
1763 dwat[1] = 0.0093/2.;
1764 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1765 // 7.5 cm is the lenght
1766 pMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
1767
1768 //--- Define the third part of the (smaller) rib between two sensitive parts
1769 // made of aluminum (the cooling tubes) (layer #4)
1770
1771 dtub[0] = .5 - dits[0];
1772 dtub[1] = 0.00134/2.;
1773 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1774 // 7.5 cm is the lengh
1775 pMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
1776
1777 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1778
1779 dpcb[0] = .03;
1780 // twice the foreseen thickness
1781 dpcb[1] = 3.5;
1782 dpcb[2] = 7.5;
1783 pMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
1784
1785 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1786
1787 dcop[0] = .0252;
1788 // twice the foreseen thickness
1789 dcop[1] = 3.5;
1790 dcop[2] = 7.5;
1791 pMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
1792
1793 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1794
1795 dcer[0] = .04;
1796 // twice the foreseen thickness
1797 dcer[1] = 3.5;
1798 dcer[2] = 7.5;
1799 pMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
1800
1801 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1802
1803 dsil[0] = .003;
1804 // twice the foreseen thickness
1805 dsil[1] = 3.5;
1806 dsil[2] = 7.5;
1807 pMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
1808
1809 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1810 // (IDV3)
1811
1812 ypos = 0.;
1813 for (j = 1; j <= 7; ++j) {
1814 // odd elements are down and even elements are up
1815 if (j == 1) {
1816 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1817 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1818 } else if (j == 2) {
1819 xpos = -dbox1[0] + dits[0];
1820 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1821 } else if (j == 3) {
1822 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1823 zpos = 0. - dits[2] + .7 - dits[2];
1824 } else if (j == 4) {
1825 xpos = -dbox1[0] + dits[0];
1826 zpos = 0.;
1827 } else if (j == 5) {
1828 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1829 zpos = dits[2] + 0. - .7 + dits[2];
1830 } else if (j == 6) {
1831 xpos = -dbox1[0] + dits[0];
1832 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1833 } else if (j == 7) {
1834 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1835 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1836 }
1837 pMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1838 }
1839
1840 // --- Place the smaller ribs into their mother (IDV3)
1841
1842 // --- Right ribs (just a matter of convention)
1843
1844 xpos = .5 - dbox1[0] + dits[0];
1845 zpos = 0.;
1846
1847 // --- Carbon
1848
1849 ypos = 2.81;
1850 pMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1851
1852 // --- Aluminum #1
1853
1854 ypos = dsup[1] + 2.81 + dal1[1];
1855 pMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1856
1857 // --- Kapton
1858
1859 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
1860 pMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1861
1862 // --- Aluminum #2
1863
1864 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
1865 pMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1866
1867 // --- Silicon (chip)
1868
1869 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
1870 pMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1871
1872 // --- Water
1873
1874 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
1875 pMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1876
1877 // --- Aluminum #3
1878
1879 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1880 + dtub[1];
1881 pMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1882
1883 // --- Right ribs (just a matter of convention)
1884
1885 // --- Carbon
1886
1887 ypos = -2.81;
1888 pMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1889
1890 // --- Aluminum #1
1891
1892 ypos = -(dsup[1] + 2.81 + dal1[1]);
1893 pMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1894
1895 // --- Kapton
1896
1897 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
1898 pMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1899
1900 // --- Aluminum #2
1901
1902 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1903 2. + dal2[1]);
1904 pMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1905
1906 // --- Silicon (chip)
1907
1908 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1909 2. + dal2[1] * 2. + dchi[1]);
1910 pMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1911
1912 // --- Water
1913
1914 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1915 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
1916 pMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1917
1918 // --- Aluminum #3
1919
1920 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1921 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
1922 2. + dtub[1]);
1923 pMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1924
1925 // --- Place the end-ladder stuff into its mother (IDV1)
1926
1927
1928 // --- Negative-Z end-ladder
1929
1930 ypos = 0.;
1931 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
1932
1933 // --- PCB
1934
1935 xpos = dbox1[0] - dpcb[0];
1936 pMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1937
1938 // --- Copper
1939
1940 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1941 pMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1942
1943 // --- Ceramics
1944
1945 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1946 pMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1947
1948 // --- Silicon (bus)
1949
1950 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1951 pMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1952
1953 // --- Positive-Z end-ladder
1954
1955 ypos = 0.;
1956 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
1957
1958 // --- PCB
1959
1960 xpos = dbox1[0] - dpcb[0];
1961 pMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1962
1963 // --- Copper
1964
1965 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
1966 pMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1967
1968 // --- Ceramics
1969
1970 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
1971 pMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1972
1973 // --- Silicon (bus)
1974
1975 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
1976 pMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
1977
1978 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1979 // larger lenght of ribs) and fill it with air or vacuum
1980
1981 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1982 dbox2[1] = 3.5;
1983 // the widest element is the end-ladder stuff
1984 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1985 // 7.5 cm is the lenght
1986 pMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
1987
1988 // --- Make the ghost volume invisible
1989
1990 pMC->Gsatt("IDV4", "SEEN", 0);
1991
1992 //--- Define the part of the (larger) rib between two sensitive parts madeof
1993 // carbon (layer #4)
1994
1995 dsup[0] = .65 - dits[0];
1996 dsup[1] = .01;
1997 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1998 // 7.5 cm is the lengh
1999 pMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
2000
2001 //--- Define the first part of the (larger) rib between two sensitive parts
2002 // made of aluminum (layer #4)
2003
2004 dal1[0] = .65 - dits[0];
2005 dal1[1] = 0.00096/2.;
2006 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2007 // 7.5 cm is the lengh
2008 pMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
2009
2010 //--- Define the part of the (larger) rib between two sensitive parts madeof
2011 // kapton (layer #4)
2012
2013 dkap[0] = .65 - dits[0];
2014 dkap[1] = 0.0317/2.;
2015 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2016 // 7.5 cm is the lengh
2017 pMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
2018
2019 //--- Define the second part of the (larger) rib between two sensitive parts
2020 // made of aluminum (layer #4)
2021
2022 dal2[0] = .65 - dits[0];
2023 dal2[1] = 0.0027/2.;
2024 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2025 // 7.5 cm is the lengh
2026 pMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
2027
2028 // --- Define the part of the (larger) rib between two sensitive parts
2029 // made of silicon (the electronics) (layer #4)
2030
2031 dchi[0] = .65 - dits[0];
2032 dchi[1] = 0.0071/2.;
2033 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2034 // 7.5 cm is the lengh
2035 pMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
2036
2037 // --- Define the part of the (larger) rib between two sensitive parts
2038 // made of water (the cooler) (layer #4)
2039
2040 dwat[0] = .65 - dits[0];
2041 dwat[1] = 0.0093/2.;
2042 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2043 // 7.5 cm is the lengh
2044 pMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
2045
2046 //--- Define the third part of the (larger) rib between two sensitive parts
2047 // made of aluminum (the cooling tubes) (layer #4)
2048
2049 dtub[0] = .65 - dits[0];
2050 dtub[1] = 0.00134/2.;
2051 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2052 // 7.5 cm is the lengh
2053 pMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
2054
2055 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2056 // (IDV4)
2057
2058 ypos = 0.;
2059 for (j = 1; j <= 7; ++j) {
2060 // odd elements are down and even elements are up
2061 if (j == 1) {
2062 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2063 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2064 } else if (j == 2) {
2065 xpos = -dbox2[0] + dits[0];
2066 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2067 } else if (j == 3) {
2068 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2069 zpos = 0. - dits[2] + .7 - dits[2];
2070 } else if (j == 4) {
2071 xpos = -dbox2[0] + dits[0];
2072 zpos = 0.;
2073 } else if (j == 5) {
2074 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2075 zpos = dits[2] + 0. - .7 + dits[2];
2076 } else if (j == 6) {
2077 xpos = -dbox2[0] + dits[0];
2078 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2079 } else if (j == 7) {
2080 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2081 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2082 }
2083 pMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2084 }
2085
2086 // --- Place the larger ribs into their mother (IDV4)
2087
2088
2089 // --- Right ribs (just a matter of convention)
2090
2091 xpos = .65 - dbox2[0] + dits[0];
2092 zpos = 0.;
2093
2094 // --- Carbon
2095
2096 ypos = 2.81;
2097 pMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2098
2099 // --- Aluminum #1
2100
2101 ypos = dsup[1] + 2.81 + dal1[1];
2102 pMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2103
2104 // --- Kapton
2105
2106 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
2107 pMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2108
2109 // --- Aluminum #2
2110
2111 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
2112 pMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2113
2114 // --- Silicon (chip)
2115
2116 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
2117 pMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2118
2119 // --- Water
2120
2121 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
2122 pMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2123
2124 // --- Aluminum #3
2125
2126 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2127 + dtub[1];
2128 pMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2129
2130 // --- Right ribs (just a matter of convention)
2131
2132 // --- Carbon
2133
2134 ypos = -2.81;
2135 pMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2136
2137 // --- Aluminum #1
2138
2139 ypos = -(dsup[1] + 2.81 + dal1[1]);
2140 pMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2141
2142 // --- Kapton
2143
2144 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
2145 pMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2146
2147 // --- Aluminum #2
2148
2149 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2150 2. + dal2[1]);
2151 pMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2152
2153 // --- Silicon (chip)
2154
2155 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2156 2. + dal2[1] * 2. + dchi[1]);
2157 pMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2158
2159 // --- Water
2160
2161 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2162 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
2163 pMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2164
2165 // --- Aluminum #3
2166
2167 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2168 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
2169 pMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2170
2171 // --- Place the end-ladder stuff into its mother (IDV1)
2172
2173
2174 // --- Negative-Z end-ladder
2175
2176 ypos = 0.;
2177 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2178
2179 // --- PCB
2180
2181 xpos = dbox2[0] - dpcb[0];
2182 pMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2183
2184 // --- Copper
2185
2186 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2187 pMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2188
2189 // --- Ceramics
2190
2191 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2192 pMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2193
2194 // --- Silicon (bus)
2195
2196 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2197 pMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2198
2199 // --- Positive-Z end-ladder
2200
2201 //yos = 0.;
2202 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2203
2204 // --- PCB
2205
2206 xpos = dbox2[0] - dpcb[0];
2207 pMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2208
2209 // --- Copper
2210
2211 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
2212 pMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2213
2214 // --- Ceramics
2215
2216 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
2217 pMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2218
2219 // --- Silicon (bus)
2220
2221 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
2222 pMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
2223
2224 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2225 // mother volume (IT34)
2226 // Odd elements have large ribs and even elements have small ribs
2227
2228 for (i = 1; i <= 24; ++i) {
2229 atheta = (i-1) * 15.;
2230 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2231 if (i % 2 == 0) {
2232 rzero = 23.5;
2233 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2234 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2235 zpos = 0.;
2236 pMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2237 } else {
2238 rzero = (24.0+22.8)/2.;
2239 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2240 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2241 zpos = 0.;
2242 pMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
2243 }
2244 }
2245
2246 //************************************************************************
2247 //* *
2248 //* S T R I P S *
2249 //* =========== *
2250 //* *
2251 //************************************************************************
2252
2253 // --- Define SSD with the 35+39 lay-out
2254
2255 if (fMinorVersion < 3) {
2256
2257 //--- Define ghost volume containing the Strip Detectors and fill it with air
2258 // or vacuum
2259
2260 xxm = (49.999-3.)/(70.-25.);
2261 dgh[0] = 0.;
2262 dgh[1] = 360.;
2263 dgh[2] = 4.;
2264 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2265 (37.-27)/xxm-(49.998-37.)/xxm;
2266 dgh[4] = 49.998;
2267 dgh[5] = 49.998;
2268 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2269 (37.-27)/xxm;
2270 dgh[7] = 37.;
2271 dgh[8] = 49.998;
2272 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2273 (37.-27)/xxm;
2274 dgh[10] = 37.;
2275 dgh[11] = 49.998;
2276 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2277 (37.-27)/xxm+(49.998-37.)/xxm;
2278 dgh[13] = 49.998;
2279 dgh[14] = 49.998;
2280 pMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2281 pMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2282 pMC->Gsatt("IT56", "SEEN", 0);
2283
2284 // --- Layer #5
2285
2286 // GOTO 5678 ! skip ITS layer no. 5
2287
2288 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2289 // it with air or vacuum
2290
2291 dbox1[0] = (0.0600+2.*0.0150)/2.;
2292 dbox1[1] = 3.75;
2293 dbox1[2] = 90.22/2.;
2294 pMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2295
2296 // --- Make the ghost volume invisible
2297
2298 pMC->Gsatt("ISV1", "SEEN", 0);
2299
2300 // --- Define a ghost volume containing the electronics and cooling of
2301 // a single ladder of layer #5 and fill it with air or vacuum
2302
2303 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2304 dsrv[1] = 3.75;
2305 dsrv[2] = 90.22/2.;
2306 pMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2307
2308 // --- Make the ghost volume invisible
2309
2310 pMC->Gsatt("SSV1", "SEEN", 0);
2311
2312 // --- Define a ghost volume containing the end-ladder stuff of
2313 // a single ladder of layer #5 and fill it with air or vacuum
2314
2315 dela[0] = 2.;
2316 dela[1] = 3.5;
2317 dela[2] = 4.;
2318 pMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2319
2320 // --- Make the ghost volume invisible
2321
2322 pMC->Gsatt("ELL5", "SEEN", 0);
2323
2324 // --- Define a volume containing the sensitive part of the strips
2325 // (silicon, layer #5)
2326
2327 dits[0] = .015;
2328 dits[1] = 3.75;
2329 dits[2] = 2.1;
2330 pMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2331
2332 // --- Define a volume containing the electronics of the strips
2333 // (silicon, layer #5)
2334
2335 dchi[0] = .02;
2336 dchi[1] = 3.4;
2337 dchi[2] = .525;
2338 pMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2339
2340 // --- Define the cooling tubes (aluminum, layer #5)
2341
2342 dtub[0] = .09;
2343 dtub[1] = dtub[0] + .01;
2344 dtub[2] = 90.22/2.;
2345 pMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2346
2347 // --- Define the cooling fluid (water or freon, layer #5)
2348
2349 dwat[0] = 0.;
2350 dwat[1] = .09;
2351 dwat[2] = 90.22/2.;
2352 pMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2353 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2354
2355 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2356
2357 // water
2358 dfra[0] = 120.;
2359 dfra[1] = 360.;
2360 dfra[2] = 3.;
2361 dfra[3] = 2.;
2362 dfra[4] = -.015;
2363 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2364 dfra[6] = dfra[5] + .03;
2365 dfra[7] = .015;
2366 dfra[8] = dfra[5];
2367 dfra[9] = dfra[6];
2368 pMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2369
2370 // --- Define the element connecting the triangles of the heat bridge
2371 // (carbon, layer #5)
2372
2373 dcei[0] = 0.;
2374 dcei[1] = .03;
2375 dcei[2] = 90.22/2.;
2376 pMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2377
2378 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2379 // (layer #5)
2380
2381 dpla[0] = (10./(8.*7.))/2.;
2382 dpla[1] = 3.5;
2383 dpla[2] = 4.;
2384 pMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2385
2386 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2387
2388 dcop[0] = (2./(8.*7.))/2.;
2389 dcop[1] = 3.5;
2390 dcop[2] = 4.;
2391 pMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2392
2393 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2394
2395 depx[0] = (30./(8.*7.))/2.;
2396 depx[1] = 3.5;
2397 depx[2] = 4.;
2398 pMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2399
2400 // --- Define the part of the end-ladder stuff made of silicon (bus)
2401 // (layer #5)
2402
2403 dsil[0] = (20./(8.*7.))/2.;
2404 dsil[1] = 3.5;
2405 dsil[2] = 4.;
2406 pMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2407
2408 // --- Place the end-ladder stuff into its mother (ELL5)
2409
2410 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2411 ypos = 0.;
2412 zpos = 0.;
2413
2414 // --- Plastic
2415
2416 xpos = -dela[0] + dpla[0];
2417 pMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2418
2419 // --- Copper
2420
2421 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2422 pMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2423
2424 // --- Epoxy
2425
2426 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2427 pMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2428
2429 // --- Silicon (bus)
2430
2431 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2432 pMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2433
2434 // --- Place the sensitive part of the strips into its mother (ISV1)
2435
2436 ypos = 0.;
2437 for (j = 1; j <= 23; ++j) {
2438 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2439 else xpos = -dbox1[0] + dits[0];
2440 zpos = ((j - 1) - 11.) * 3.91;
2441 pMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2442 }
2443
2444 // --- Place the electronics of the strips into its mother (SSV1)
2445
2446 ypos = 0.;
2447 for (j = 1; j <= 23; ++j) {
2448 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2449 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2450 zpos = ((j - 1) - 11.) * 3.91 + .85;
2451 pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2452 }
2453
2454 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2455
2456 xpos = -dsrv[0] + .41;
2457 zpos = 0.;
2458
2459 // --- Left tube (just a matter of convention)
2460
2461 ypos = -2.25-0.1;
2462 pMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2463 pMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2464
2465 // --- Right tube (just a matter of convention)
2466
2467 ypos = 2.25+0.1;
2468 pMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2469 pMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2470
2471 // --- Place the heat bridge elements into their mother (SSV1)
2472
2473 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2474 ypos = 0.;
2475 for (j = 1; j <= 24; ++j) {
2476 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
2477 pMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2478 }
2479
2480 // --- Place the elements connecting the triangles of the heat bridge
2481 // into their mother (SSV1)
2482
2483 zpos = 0.;
2484
2485 // --- Left element (just a matter of convention)
2486
2487 xpos = -dsrv[0] + .47;
2488 ypos = -(2.1+0.015);
2489 pMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2490
2491 // --- Right element
2492
2493 xpos = -dsrv[0] + .47;
2494 ypos = 2.1+0.015;
2495 pMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2496
2497 // --- Top element
2498
2499 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2500 ypos = 0.;
2501 pMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2502
2503 // --- Place the ghost volumes containing the strip ladders (ISV1),
2504 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2505 // their mother volume (IT56)
2506
2507 offset1 = TMath::ATan2(.9, 40.);
2508 offset2 = 5.2;
2509 rzero = dbox1[0] + 40.;
2510 runo = dbox1[0] * 2. + 40. + dsrv[0];
2511 rtwo = dbox1[0] * 2. + 40. + dela[0];
2512 for (i = 1; i <= 35; ++i) {
2513 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2514 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2515
2516 // --- Strip ladders
2517
2518 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2519 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2520 zpos = 0.;
2521 pMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2522
2523 // --- Electronics/cooling
2524
2525 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2526 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2527 zpos = 0.;
2528 pMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2529
2530 // --- End-ladders (nagative-Z and positive-Z)
2531
2532 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2533 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2534 zpos = -(dbox1[2] + dela[2] + 6.);
2535 pMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2536 zpos = dbox1[2] + dela[2] + 6.;
2537 pMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
2538 }
2539
2540
2541 // --- Layer #6
2542
2543 // GOTO 5778 ! skip ITS layer no. 6
2544
2545 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2546 // it with air or vacuum
2547
2548 dbox2[0] = (0.0600+2.*0.0150)/2.;
2549 dbox2[1] = 3.75;
2550 dbox2[2] = 101.95/2.;
2551 pMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
2552
2553 // --- Make the ghost volume invisible
2554
2555 pMC->Gsatt("ISV2", "SEEN", 0);
2556
2557 // --- Define a ghost volume containing the electronics and cooling of
2558 // a single ladder of layer #6 and fill it with air or vacuum
2559
2560 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2561 dsrv[1] = 3.75;
2562 dsrv[2] = 101.95/2.;
2563 pMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
2564
2565 // --- Make the ghost volume invisible
2566
2567 pMC->Gsatt("SSV2", "SEEN", 0);
2568
2569 // --- Define a ghost volume containing the end-ladder stuff of
2570 // a single ladder of layer #6 and fill it with air or vacuum
2571
2572 dela[0] = 2.;
2573 dela[1] = 3.5;
2574 dela[2] = 4.;
2575 pMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
2576
2577 // --- Make the ghost volume invisible
2578
2579 pMC->Gsatt("ELL6", "SEEN", 0);
2580
2581 // --- Define a volume containing the sensitive part of the strips
2582 // (silicon, layer #6)
2583
2584 dits[0] = .015;
2585 dits[1] = 3.75;
2586 dits[2] = 2.1;
2587 pMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
2588
2589 // --- Define a volume containing the electronics of the strips
2590 // (silicon, layer #6)
2591
2592 dchi[0] = .02;
2593 dchi[1] = 3.4;
2594 dchi[2] = .525;
2595 pMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
2596
2597 // --- Define the cooling tubes (aluminum, layer #6)
2598
2599 dtub[0] = .09;
2600 dtub[1] = dtub[0] + .01;
2601 dtub[2] = 101.95/2.;
2602 pMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
2603
2604 // --- Define the cooling fluid (water or freon, layer #6)
2605
2606 dwat[0] = 0.;
2607 dwat[1] = .09;
2608 dwat[2] = 101.95/2.;
2609 pMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
2610 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2611
2612 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2613
2614 // water
2615 dfra[0] = 120.;
2616 dfra[1] = 360.;
2617 dfra[2] = 3.;
2618 dfra[3] = 2.;
2619 dfra[4] = -.015;
2620 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2621 dfra[6] = dfra[5] + .03;
2622 dfra[7] = .015;
2623 dfra[8] = dfra[5];
2624 dfra[9] = dfra[6];
2625 pMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
2626
2627 // --- Define the element connecting the triangles of the heat bridge
2628 // (carbon, layer #6)
2629
2630 dcei[0] = 0.;
2631 dcei[1] = .03;
2632 dcei[2] = 101.95/2.;
2633 pMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
2634
2635 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2636 // (layer #6)
2637
2638 dpla[0] = (10./(8.*7.))/2.;
2639 dpla[1] = 3.5;
2640 dpla[2] = 4.;
2641 pMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
2642
2643 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2644
2645 dcop[0] = (2./(8.*7.))/2.;
2646 dcop[1] = 3.5;
2647 dcop[2] = 4.;
2648 pMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
2649
2650 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2651
2652 depx[0] = (30./(8.*7.))/2.;
2653 depx[1] = 3.5;
2654 depx[2] = 4.;
2655 pMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
2656
2657 // --- Define the part of the end-ladder stuff made of silicon (bus)
2658 // (layer #6)
2659
2660 dsil[0] = (20./(8.*7.))/2.;
2661 dsil[1] = 3.5;
2662 dsil[2] = 4.;
2663 pMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
2664
2665 // --- Place the end-ladder stuff into its mother (ELL5)
2666
2667 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2668 ypos = 0.;
2669 zpos = 0.;
2670
2671 // --- Plastic
2672
2673 xpos = -dela[0] + dpla[0];
2674 pMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2675
2676 // --- Copper
2677
2678 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2679 pMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2680
2681 // --- Epoxy
2682
2683 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2684 pMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2685
2686 // --- Silicon (bus)
2687
2688 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2689 pMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
2690
2691 // --- Place the sensitive part of the strips into its mother (ISV2)
2692
2693 ypos = 0.;
2694 for (j = 1; j <= 26; ++j) {
2695 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2696 else xpos = -dbox2[0] + dits[0];
2697 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
2698 pMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
2699 }
2700
2701 // --- Place the electronics of the strips into its mother (SSV2)
2702
2703 ypos = 0.;
2704 for (j = 1; j <= 26; ++j) {
2705 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2706 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2707 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
2708 pMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2709 }
2710
2711 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2712
2713 xpos = -dsrv[0] + .41;
2714 zpos = 0.;
2715
2716 // --- Left tube (just a matter of convention)
2717
2718 ypos = -2.25-0.1;
2719 pMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2720 pMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2721
2722 // --- Right tube (just a matter of convention)
2723
2724 ypos = 2.25+0.;
2725 pMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2726 pMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2727
2728 // --- Place the heat bridge elements into their mother (SSV2)
2729
2730 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2731 ypos = 0.;
2732 for (j = 1; j <= 27; ++j) {
2733 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
2734 pMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2735 }
2736
2737 // --- Place the elements connecting the triangles of the heat bridge
2738 // into their mother (SSV2)
2739
2740 zpos = 0.;
2741
2742 // --- Left element (just a matter of convention)
2743
2744 xpos = -dsrv[0] + .47;
2745 ypos = -(2.1+0.015);
2746 pMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2747
2748 // --- Right element
2749
2750 xpos = -dsrv[0] + .47;
2751 ypos = 2.1+0.015;
2752 pMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2753
2754 // --- Top element
2755
2756 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2757 ypos = 0.;
2758 pMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2759
2760 // --- Place the ghost volumes containing the strip ladders (ISV2),
2761 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2762 // their mother volume (IT56)
2763
2764 offset1 = TMath::ATan2(1., 45.);
2765 offset2 = 5.2;
2766 rzero = dbox2[0] + 45.;
2767 runo = dbox2[0] * 2. + 45. + dsrv[0];
2768 rtwo = dbox2[0] * 2. + 45. + dela[0];
2769 for (i = 1; i <= 39; ++i) {
2770 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2771 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2772
2773 // --- Strip ladders
2774
2775 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2776 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2777 zpos = 0.;
2778 pMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2779
2780 // --- Electronics/cooling
2781
2782 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2783 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2784 zpos = 0.;
2785 pMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2786
2787 // --- End-ladders (nagative-Z and positive-Z)
2788
2789 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2790 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2791 zpos = -(dbox2[2] + dela[2] + 6.);
2792 pMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2793 zpos = dbox2[2] + dela[2] + 6.;
2794 pMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
2795 }
2796 //#ifdef NEVER
2797 }
2798
2799 // --- Define SSD with the 32+36 lay-out
2800
2801 if (fMinorVersion >2 && fMinorVersion < 6) {
2802
2803 //--- Define ghost volume containing the Strip Detectors and fill it with air
2804 // or vacuum
2805
2806 xxm = (49.999-3.)/(70.-25.);
2807 dgh[0] = 0.;
2808 dgh[1] = 360.;
2809 dgh[2] = 4.;
2810 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2811 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2812 dgh[4] = 49.998;
2813 dgh[5] = 49.998;
2814 dgh[6] = -25. - (9.-3.01) / xxm -
2815 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2816 dgh[7] = 36.;
2817 dgh[8] = 49.998;
2818 dgh[9] = (9.-3.01) / xxm + 25. +
2819 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2820 dgh[10] = 36.;
2821 dgh[11] = 49.998;
2822 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2823 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2824 dgh[13] = 49.998;
2825 dgh[14] = 49.998;
2826 pMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2827 pMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2828 pMC->Gsatt("IT56", "SEEN", 0);
2829
2830 // --- Layer #5
2831
2832 // GOTO 6678 ! skip ITS layer no. 5
2833
2834 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2835 // it with air or vacuum
2836
2837 dbox1[0] = (0.0600+2.*0.0150)/2.;
2838 dbox1[1] = 3.75;
2839 dbox1[2] = 86.31/2.;
2840 pMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
2841
2842 // --- Make the ghost volume invisible
2843
2844 pMC->Gsatt("ISV1", "SEEN", 0);
2845
2846 // --- Define a ghost volume containing the electronics and cooling of
2847 // a single ladder of layer #5 and fill it with air or vacuum
2848
2849 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2850 dsrv[1] = 3.75;
2851 dsrv[2] = 86.31/2.;
2852 pMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
2853
2854 // --- Make the ghost volume invisible
2855
2856 pMC->Gsatt("SSV1", "SEEN", 0);
2857
2858 // --- Define a ghost volume containing the end-ladder stuff of
2859 // a single ladder of layer #5 and fill it with air or vacuum
2860
2861 dela[0] = 2.;
2862 dela[1] = 3.5;
2863 dela[2] = 4.;
2864 pMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
2865
2866 // --- Make the ghost volume invisible
2867
2868 pMC->Gsatt("ELL5", "SEEN", 0);
2869
2870 // --- Define a volume containing the sensitive part of the strips
2871 // (silicon, layer #5)
2872
2873 dits[0] = .015;
2874 dits[1] = 3.75;
2875 dits[2] = 2.1;
2876 pMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
2877
2878 // --- Define a volume containing the electronics of the strips
2879 // (silicon, layer #5)
2880
2881 dchi[0] = .02;
2882 dchi[1] = 3.4;
2883 dchi[2] = .525;
2884 pMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
2885
2886 // --- Define the cooling tubes (aluminum, layer #5)
2887
2888 dtub[0] = .09;
2889 dtub[1] = dtub[0] + .01;
2890 dtub[2] = 86.31/2.;
2891 pMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
2892
2893 // --- Define the cooling fluid (water or freon, layer #5)
2894
2895 dwat[0] = 0.;
2896 dwat[1] = .09;
2897 dwat[2] = 86.31/2.;
2898 pMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
2899 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2900
2901 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2902
2903 // water
2904 dfra[0] = 120.;
2905 dfra[1] = 360.;
2906 dfra[2] = 3.;
2907 dfra[3] = 2.;
2908 dfra[4] = -.015;
2909 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2910 dfra[6] = dfra[5] + .03;
2911 dfra[7] = .015;
2912 dfra[8] = dfra[5];
2913 dfra[9] = dfra[6];
2914 pMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
2915
2916 // --- Define the element connecting the triangles of the heat bridge
2917 // (carbon, layer #5)
2918
2919 dcei[0] = 0.;
2920 dcei[1] = .03;
2921 dcei[2] = 86.31/2.;
2922 pMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
2923
2924 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2925 // (layer #5)
2926
2927 dpla[0] = (10./(8.*7.))/2;
2928 dpla[1] = 3.5;
2929 dpla[2] = 4.;
2930 pMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
2931
2932 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2933
2934 dcop[0] = (2./(8.*7.))/2;
2935 dcop[1] = 3.5;
2936 dcop[2] = 4.;
2937 pMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
2938
2939 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2940
2941 depx[0] = (30./(8.*7.))/2.;
2942 depx[1] = 3.5;
2943 depx[2] = 4.;
2944 pMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
2945
2946 // --- Define the part of the end-ladder stuff made of silicon (bus)
2947 // (layer #5)
2948
2949 dsil[0] = (20./(8.*7.))/2.;
2950 dsil[1] = 3.5;
2951 dsil[2] = 4.;
2952 pMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
2953
2954 // --- Place the end-ladder stuff into its mother (ELL5)
2955
2956 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2957 ypos = 0.;
2958 zpos = 0.;
2959
2960 // --- Plastic
2961
2962 xpos = -dela[0] + dpla[0];
2963 pMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2964
2965 // --- Copper
2966
2967 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
2968 pMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2969
2970 // --- Epoxy
2971
2972 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
2973 pMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2974
2975 // --- Silicon (bus)
2976
2977 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
2978 pMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
2979
2980 // --- Place the sensitive part of the strips into its mother (ISV1)
2981
2982 ypos = 0.;
2983 for (j = 1; j <= 22; ++j) {
2984 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2985 else xpos = -dbox1[0] + dits[0];
2986 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
2987 pMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
2988 }
2989
2990 // --- Place the electronics of the strips into its mother (SSV1)
2991
2992 ypos = 0.;
2993 for (j = 1; j <= 22; ++j) {
2994 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2995 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2996 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
2997 pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2998 }
2999
3000 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3001
3002 xpos = -dsrv[0] + .41;
3003 zpos = 0.;
3004
3005 // --- Left tube (just a matter of convention)
3006
3007 ypos = -(2.25+0.1);
3008 pMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3009 pMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3010
3011 // --- Right tube (just a matter of convention)
3012
3013 ypos = (2.25+0.1);
3014 pMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3015 pMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3016
3017 // --- Place the heat bridge elements into their mother (SSV1)
3018
3019 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3020 ypos = 0.;
3021 for (j = 1; j <= 23; ++j) {
3022 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
3023 pMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3024 }
3025
3026 // --- Place the elements connecting the triangles of the heat bridge
3027 // into their mother (SSV1)
3028
3029 zpos = 0.;
3030
3031 // --- Left element (just a matter of convention)
3032
3033 xpos = -dsrv[0] + .47;
3034 ypos = -(2.1+0.015);
3035 pMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3036
3037 // --- Right element
3038
3039 xpos = -dsrv[0] + .47;
3040 ypos = (2.1+0.015);
3041 pMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3042
3043 // --- Top element
3044
3045 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3046 ypos = 0.;
3047 pMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3048
3049 // --- Place the ghost volumes containing the strip ladders (ISV1),
3050 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3051 // their mother volume (IT56)
3052
3053 offset1 = TMath::ATan2(.8, 36.6);
3054 offset2 = 5.2;
3055 rzero = dbox1[0] + 36.6;
3056 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3057 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3058 for (i = 1; i <= 32; ++i) {
3059 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3060 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3061
3062 // --- Strip ladders
3063
3064 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3065 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3066 zpos = 0.;
3067 pMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3068
3069 // --- Electronics/cooling
3070
3071 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3072 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3073 zpos = 0.;
3074 pMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3075
3076 // --- End-ladders (nagative-Z and positive-Z)
3077
3078 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3079 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3080 zpos = -(dbox1[2] + dela[2] + 6.);
3081 pMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3082 zpos = dbox1[2] + dela[2] + 6.;
3083 pMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
3084 }
3085
3086
3087 // --- Layer #6
3088
3089 // GOTO 6778 ! skip ITS layer no. 6
3090
3091 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3092 // it with air or vacuum
3093
3094 dbox2[0] = (0.0600+2.*0.0150)/2.;
3095 dbox2[1] = 3.75;
3096 dbox2[2] = 94.13/2.;
3097 pMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
3098
3099 // --- Make the ghost volume invisible
3100
3101 pMC->Gsatt("ISV2", "SEEN", 0);
3102
3103 // --- Define a ghost volume containing the electronics and cooling of
3104 // a single ladder of layer #6 and fill it with air or vacuum
3105
3106 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3107 dsrv[1] = 3.75;
3108 dsrv[2] = 94.13/2.;
3109 pMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
3110
3111 // --- Make the ghost volume invisible
3112
3113 pMC->Gsatt("SSV2", "SEEN", 0);
3114
3115 // --- Define a ghost volume containing the end-ladder stuff of
3116 // a single ladder of layer #6 and fill it with air or vacuum
3117
3118 dela[0] = 2.;
3119 dela[1] = 3.5;
3120 dela[2] = 4.;
3121 pMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
3122
3123 // --- Make the ghost volume invisible
3124
3125 pMC->Gsatt("ELL6", "SEEN", 0);
3126
3127 // --- Define a volume containing the sensitive part of the strips
3128 // (silicon, layer #6)
3129
3130 dits[0] = .015;
3131 dits[1] = 3.75;
3132 dits[2] = 2.1;
3133 pMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
3134
3135 // --- Define a volume containing the electronics of the strips
3136 // (silicon, layer #6)
3137
3138 dchi[0] = .02;
3139 dchi[1] = 3.4;
3140 dchi[2] = .525;
3141 pMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
3142
3143 // --- Define the cooling tubes (aluminum, layer #6)
3144
3145 dtub[0] = .09;
3146 dtub[1] = dtub[0] + .01;
3147 dtub[2] = 94.13/2.;
3148 pMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
3149
3150 // --- Define the cooling fluid (water or freon, layer #6)
3151
3152 dwat[0] = 0.;
3153 dwat[1] = .09;
3154 dwat[2] = 94.13/2.;
3155 pMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
3156 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3157
3158 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3159
3160 // water
3161 dfra[0] = 120.;
3162 dfra[1] = 360.;
3163 dfra[2] = 3.;
3164 dfra[3] = 2.;
3165 dfra[4] = -.015;
3166 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3167 dfra[6] = dfra[5] + .03;
3168 dfra[7] = .015;
3169 dfra[8] = dfra[5];
3170 dfra[9] = dfra[6];
3171 pMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
3172
3173 // --- Define the element connecting the triangles of the heat bridge
3174 // (carbon, layer #6)
3175
3176 dcei[0] = 0.;
3177 dcei[1] = .03;
3178 dcei[2] = 94.13/2.;
3179 pMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
3180
3181 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3182 // (layer #6)
3183
3184 dpla[0] = (10./(8.*7.))/2;
3185 dpla[1] = 3.5;
3186 dpla[2] = 4.;
3187 pMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
3188
3189 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3190
3191 dcop[0] = (2./(8.*7.))/2;
3192 dcop[1] = 3.5;
3193 dcop[2] = 4.;
3194 pMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
3195
3196 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3197
3198 depx[0] = (30./(8.*7.))/2.;
3199 depx[1] = 3.5;
3200 depx[2] = 4.;
3201 pMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
3202
3203 // --- Define the part of the end-ladder stuff made of silicon (bus)
3204 // (layer #6)
3205
3206 dsil[0] = (20./(8.*7.))/2.;
3207 dsil[1] = 3.5;
3208 dsil[2] = 4.;
3209 pMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
3210
3211 // --- Place the end-ladder stuff into its mother (ELL5)
3212
3213 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3214 ypos = 0.;
3215 zpos = 0.;
3216
3217 // --- Plastic
3218
3219 xpos = -dela[0] + dpla[0];
3220 pMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3221
3222 // --- Copper
3223
3224 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
3225 pMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3226
3227 // --- Epoxy
3228
3229 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
3230 pMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3231
3232 // --- Silicon (bus)
3233
3234 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
3235 pMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
3236
3237 // --- Place the sensitive part of the strips into its mother (ISV2)
3238
3239 ypos = 0.;
3240 for (j = 1; j <= 24; ++j) {
3241 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3242 else xpos = dbox2[0] - dits[0];
3243 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
3244 pMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
3245 }
3246
3247 // --- Place the electronics of the strips into its mother (SSV2)
3248
3249 ypos = 0.;
3250 for (j = 1; j <= 24; ++j) {
3251 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3252 else xpos = -dsrv[0] + .28;
3253 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
3254 pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3255 }
3256
3257 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3258
3259 xpos = -dsrv[0] + .41;
3260 zpos = 0.;
3261
3262 // --- Left tube (just a matter of convention)
3263
3264 ypos = -(2.25+0.1);
3265 pMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3266 pMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3267
3268 // --- Right tube (just a matter of convention)
3269
3270 ypos = (2.25+0.1);
3271 pMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3272 pMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3273
3274 // --- Place the heat bridge elements into their mother (SSV2)
3275
3276 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3277 ypos = 0.;
3278 for (j = 1; j <= 25; ++j) {
3279 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
3280 pMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3281 }
3282
3283 // --- Place the elements connecting the triangles of the heat bridge
3284 // into their mother (SSV2)
3285
3286 zpos = 0.;
3287
3288 // --- Left element (just a matter of convention)
3289
3290 xpos = -dsrv[0] + .47;
3291 ypos = -(2.1+0.015);
3292 pMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3293
3294 // --- Right element
3295
3296 xpos = -dsrv[0] + .47;
3297 ypos = (2.1+0.015);
3298 pMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3299
3300 // --- Top element
3301
3302 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3303 ypos = 0.;
3304 pMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3305
3306 // --- Place the ghost volumes containing the strip ladders (ISV2),
3307 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3308 // their mother volume (IT56)
3309
3310 offset1 = TMath::ATan2(.9, 41.2);
3311 offset2 = 5.2;
3312 rzero = dbox2[0] + 41.2;
3313 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3314 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3315 for (i = 1; i <= 36; ++i) {
3316 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3317 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3318
3319 // --- Strip ladders
3320
3321 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3322 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3323 zpos = 0.;
3324 pMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3325
3326 // --- Electronics/cooling
3327
3328 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3329 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3330 zpos = 0.;
3331 pMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3332
3333 // --- End-ladders (nagative-Z and positive-Z)
3334
3335 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3336 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3337 zpos = -(dbox2[2] + dela[2] + 6.);
3338 pMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3339 zpos = dbox2[2] + dela[2] + 6.;
3340 pMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
3341 }
3342
3343
3344 }
3345
3346 //************************************************************************
3347 //* *
3348 //* E N D - C A P S A N D F R A M E S *
3349 //* ========================================= *
3350 //* *
3351 //************************************************************************
3352
3353 // --- Define a dummy cylinder for multiple scattering tests
3354
3355 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3356
3357 // DITS(1)=49.
3358 // DITS(2)=DITS(1)+0.1
3359 // DITS(3)=60.3
3360 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3361 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3362 // 7890 CONTINUE
3363
3364 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3365
3366 // GOTO 8901 ! skip outer wall
3367
3368 if (fMinorVersion == 0 || fMinorVersion == 3) {
3369
3370 dits[0] = 49.9;
3371 dits[1] = dits[0] + .06926;
3372 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3373 // old value 60.3
3374 pMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3375 pMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
3376 } else {
3377 goto L8901;
3378 }
3379 L8901:
3380 // --- The frame between the end-caps (octagonal lay-out) ---
3381
3382 // GOTO 9012 ! skip octagonal frame
3383
3384 if (fMinorVersion == 1) {
3385
3386 rzero = 34.;
3387 dtra[0] = .92;
3388 dtra[1] = 1.;
3389 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3390 dtra1[0] = .92;
3391 dtra1[1] = 1.;
3392 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3393 angle = 45.;
3394 offset = angle / 2.;
3395 for (i = 0; i < 8; ++i) {
3396 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3397 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3398 ztra[i] = 0.;
3399 pMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3400 pMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3401 }
3402
3403 atheta = 22.5;
3404 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3405 aphi2 = 180. - aphi1;
3406 xpos = (xtra[0] + xtra[1]) / 2.;
3407 ypos = (ytra[0] + ytra[1]) / 2.;
3408 zpos = dtra[2] / 2.;
3409 pMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3410 r2 = atheta + 90.;
3411 r3 = atheta + 90.;
3412 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3413 pMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3414 zpos = -dtra[2] / 2.;
3415 pMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3416 r2 = atheta + 90.;
3417 r3 = atheta + 90.;
3418 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3419 pMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3420
3421 atheta = 67.5;
3422 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3423 aphi1 = 180. - aphi2;
3424 xpos = (xtra[1] + xtra[2]) / 2.;
3425 ypos = (ytra[1] + ytra[2]) / 2.;
3426 zpos = dtra[2] / 2.;
3427 pMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3428 r2 = atheta + 90.;
3429 r3 = atheta + 90.;
3430 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3431 pMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3432 zpos = -dtra[2] / 2.;
3433 pMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3434 r2 = atheta + 90.;
3435 r3 = atheta + 90.;
3436 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3437 pMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3438
3439 atheta = 112.5;
3440 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3441 aphi2 = 180. - aphi1;
3442 xpos = (xtra[2] + xtra[3]) / 2.;
3443 ypos = (ytra[2] + ytra[3]) / 2.;
3444 zpos = dtra[2] / 2.;
3445 pMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3446 r2 = atheta + 90.;
3447 r3 = atheta + 90.;
3448 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3449 pMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3450 zpos = -dtra[2] / 2.;
3451 pMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3452 r2 = atheta + 90.;
3453 r3 = atheta + 90.;
3454 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3455 pMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3456
3457 atheta = 157.5;
3458 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3459 aphi1 = 180. - aphi2;
3460 xpos = (xtra[3] + xtra[4]) / 2.;
3461 ypos = (ytra[3] + ytra[4]) / 2.;
3462 zpos = dtra[2] / 2.;
3463 pMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3464 r2 = atheta + 90.;
3465 r3 = atheta + 90.;
3466 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3467 pMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3468 zpos = -dtra[2] / 2.;
3469 pMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3470 r2 = atheta + 90.;
3471 r3 = atheta + 90.;
3472 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3473 pMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3474
3475 atheta = 22.5;
3476 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3477 aphi1 = 180. - aphi2;
3478 xpos = (xtra[4] + xtra[5]) / 2.;
3479 ypos = (ytra[4] + ytra[5]) / 2.;
3480 zpos = dtra[2] / 2.;
3481 pMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3482 r2 = atheta + 90.;
3483 r3 = atheta + 90.;
3484 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3485 pMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3486 zpos = -dtra[2] / 2.;
3487 pMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3488 r2 = atheta + 90.;
3489 r3 = atheta + 90.;
3490 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3491 pMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3492
3493 atheta = 67.5;
3494 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3495 aphi2 = 180. - aphi1;
3496 xpos = (xtra[5] + xtra[6]) / 2.;
3497 ypos = (ytra[5] + ytra[6]) / 2.;
3498 zpos = dtra[2] / 2.;
3499 pMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3500 r2 = atheta + 90.;
3501 r3 = atheta + 90.;
3502 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3503 pMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3504 zpos = -dtra[2] / 2.;
3505 pMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3506 r2 = atheta + 90.;
3507 r3 = atheta + 90.;
3508 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3509 pMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3510
3511 atheta = 112.5;
3512 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3513 aphi1 = 180. - aphi2;
3514 xpos = (xtra[6] + xtra[7]) / 2.;
3515 ypos = (ytra[6] + ytra[7]) / 2.;
3516 zpos = dtra[2] / 2.;
3517 pMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3518 r2 = atheta + 90.;
3519 r3 = atheta + 90.;
3520 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3521 pMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3522 zpos = -dtra[2] / 2.;
3523 pMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3524 r2 = atheta + 90.;
3525 r3 = atheta + 90.;
3526 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3527 pMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3528
3529 atheta = 157.5;
3530 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3531 aphi2 = 180. - aphi1;
3532 xpos = (xtra[7] + xtra[0]) / 2.;
3533 ypos = (ytra[7] + ytra[0]) / 2.;
3534 zpos = dtra[2] / 2.;
3535 pMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3536 r2 = atheta + 90.;
3537 r3 = atheta + 90.;
3538 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3539 pMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3540 zpos = -dtra[2] / 2.;
3541 pMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3542 r2 = atheta + 90.;
3543 r3 = atheta + 90.;
3544 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3545 pMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3546
3547
3548 } else if (fMinorVersion == 4) {
3549
3550
3551 rzero = 34.;
3552 dtra[0] = .92;
3553 dtra[1] = 1.;
3554 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3555 dtra1[0] = .92;
3556 dtra1[1] = 1.;
3557 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3558 angle = 45.;
3559 offset = angle / 2.;
3560 for (i = 0; i < 8; ++i) {
3561 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3562 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3563 ztra[i] = 0.;
3564 pMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3565 pMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
3566 }
3567
3568 atheta = 22.5;
3569 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3570 aphi2 = 180. - aphi1;
3571 xpos = (xtra[0] + xtra[1]) / 2.;
3572 ypos = (ytra[0] + ytra[1]) / 2.;
3573 zpos = dtra[2] / 2.;
3574 pMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
3575 r2 = atheta + 90.;
3576 r3 = atheta + 90.;
3577 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3578 pMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
3579 zpos = -dtra[2] / 2.;
3580 pMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
3581 r2 = atheta + 90.;
3582 r3 = atheta + 90.;
3583 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3584 pMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
3585
3586 atheta = 67.5;
3587 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3588 aphi1 = 180. - aphi2;
3589 xpos = (xtra[1] + xtra[2]) / 2.;
3590 ypos = (ytra[1] + ytra[2]) / 2.;
3591 zpos = dtra[2] / 2.;
3592 pMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
3593 r2 = atheta + 90.;
3594 r3 = atheta + 90.;
3595 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3596 pMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
3597 zpos = -dtra[2] / 2.;
3598 pMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
3599 r2 = atheta + 90.;
3600 r3 = atheta + 90.;
3601 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3602 pMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
3603
3604 atheta = 112.5;
3605 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3606 aphi2 = 180. - aphi1;
3607 xpos = (xtra[2] + xtra[3]) / 2.;
3608 ypos = (ytra[2] + ytra[3]) / 2.;
3609 zpos = dtra[2] / 2.;
3610 pMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
3611 r2 = atheta + 90.;
3612 r3 = atheta + 90.;
3613 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3614 pMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
3615 zpos = -dtra[2] / 2.;
3616 pMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
3617 r2 = atheta + 90.;
3618 r3 = atheta + 90.;
3619 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3620 pMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
3621
3622 atheta = 157.5;
3623 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3624 aphi1 = 180. - aphi2;
3625 xpos = (xtra[3] + xtra[4]) / 2.;
3626 ypos = (ytra[3] + ytra[4]) / 2.;
3627 zpos = dtra[2] / 2.;
3628 pMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
3629 r2 = atheta + 90.;
3630 r3 = atheta + 90.;
3631 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3632 pMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
3633 zpos = -dtra[2] / 2.;
3634 pMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
3635 r2 = atheta + 90.;
3636 r3 = atheta + 90.;
3637 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3638 pMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
3639
3640 atheta = 22.5;
3641 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3642 aphi1 = 180. - aphi2;
3643 xpos = (xtra[4] + xtra[5]) / 2.;
3644 ypos = (ytra[4] + ytra[5]) / 2.;
3645 zpos = dtra[2] / 2.;
3646 pMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
3647 r2 = atheta + 90.;
3648 r3 = atheta + 90.;
3649 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3650 pMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
3651 zpos = -dtra[2] / 2.;
3652 pMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
3653 r2 = atheta + 90.;
3654 r3 = atheta + 90.;
3655 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3656 pMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
3657
3658 atheta = 67.5;
3659 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3660 aphi2 = 180. - aphi1;
3661 xpos = (xtra[5] + xtra[6]) / 2.;
3662 ypos = (ytra[5] + ytra[6]) / 2.;
3663 zpos = dtra[2] / 2.;
3664 pMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
3665 r2 = atheta + 90.;
3666 r3 = atheta + 90.;
3667 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3668 pMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
3669 zpos = -dtra[2] / 2.;
3670 pMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
3671 r2 = atheta + 90.;
3672 r3 = atheta + 90.;
3673 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3674 pMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
3675
3676 atheta = 112.5;
3677 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3678 aphi1 = 180. - aphi2;
3679 xpos = (xtra[6] + xtra[7]) / 2.;
3680 ypos = (ytra[6] + ytra[7]) / 2.;
3681 zpos = dtra[2] / 2.;
3682 pMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
3683 r2 = atheta + 90.;
3684 r3 = atheta + 90.;
3685 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3686 pMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
3687 zpos = -dtra[2] / 2.;
3688 pMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
3689 r2 = atheta + 90.;
3690 r3 = atheta + 90.;
3691 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3692 pMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
3693
3694 atheta = 157.5;
3695 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3696 aphi2 = 180. - aphi1;
3697 xpos = (xtra[7] + xtra[0]) / 2.;
3698 ypos = (ytra[7] + ytra[0]) / 2.;
3699 zpos = dtra[2] / 2.;
3700 pMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
3701 r2 = atheta + 90.;
3702 r3 = atheta + 90.;
3703 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3704 pMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
3705 zpos = -dtra[2] / 2.;
3706 pMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
3707 r2 = atheta + 90.;
3708 r3 = atheta + 90.;
3709 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3710 pMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
3711 } else {
3712 goto L9012;
3713 }
3714
3715 L9012:
3716 // --- The frame between the end-caps (hexagonal lay-out) ---
3717
3718 // GOTO 9123 ! skip hexagonal frame
3719
3720 if (fMinorVersion == 2) {
3721
3722 rzero = 33.5;
3723 dtra2[0] = .92;
3724 dtra2[1] = 1.;
3725 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3726 dtra3[0] = .92;
3727 dtra3[1] = 1.;
3728 dtra3[2] = 16.75;
3729 dtra4[0] = .92;
3730 dtra4[1] = 1.;
3731 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3732 angle = 60.;
3733 offset = angle / 2.;
3734 for (i = 0; i < 6; ++i) {
3735 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3736 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3737 ztra1[i] = 0.;
3738 pMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3739 pMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
3740 }
3741
3742 atheta = 60.;
3743 aphi = 90.;
3744 xpos = (xtra1[0] + xtra1[1]) / 2.;
3745 ypos = (ytra1[0] + ytra1[1]) / 2.;
3746 zpos = 0.;
3747 pMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
3748 r2 = atheta + 90.;
3749 r3 = atheta + 90.;
3750 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
3751 pMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
3752
3753 atheta = 120.;
3754 aphi = 90.;
3755 xpos = (xtra1[1] + xtra1[2]) / 2.;
3756 ypos = (ytra1[1] + ytra1[2]) / 2.;
3757 zpos = 0.;
3758 pMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
3759 r2 = atheta + 90.;
3760 r3 = atheta + 90.;
3761 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
3762 pMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
3763
3764 atheta = 180.;
3765 aphi = 90.;
3766 xpos = (xtra1[2] + xtra1[3]) / 2.;
3767 ypos = (ytra1[2] + ytra1[3]) / 2.;
3768 zpos = 0.;
3769 pMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
3770 r2 = atheta + 90.;
3771 r3 = atheta + 90.;
3772 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
3773 pMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
3774
3775 atheta = 60.;
3776 aphi = 90.;
3777 xpos = (xtra1[3] + xtra1[4]) / 2.;
3778 ypos = (ytra1[3] + ytra1[4]) / 2.;
3779 zpos = 0.;
3780 pMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
3781 r2 = atheta + 90.;
3782 r3 = atheta + 90.;
3783 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
3784 pMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
3785
3786 atheta = 120.;
3787 aphi = 90.;
3788 xpos = (xtra1[4] + xtra1[5]) / 2.;
3789 ypos = (ytra1[4] + ytra1[5]) / 2.;
3790 zpos = 0.;
3791 pMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
3792 r2 = atheta + 90.;
3793 r3 = atheta + 90.;
3794 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
3795 pMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
3796
3797 atheta = 180.;
3798 aphi = 90.;
3799 xpos = (xtra1[5] + xtra1[0]) / 2.;
3800 ypos = (ytra1[5] + ytra1[0]) / 2.;
3801 zpos = 0.;
3802 pMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
3803 r2 = atheta + 90.;
3804 r3 = atheta + 90.;
3805 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
3806 pMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
3807
3808 atheta = 60.;
3809 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3810 aphi1 = 180. - aphi2;
3811 xpos = (xtra1[0] + xtra1[1]) / 2.;
3812 ypos = (ytra1[0] + ytra1[1]) / 2.;
3813 zpos = dtra2[2] / 2.;
3814 pMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
3815 r2 = atheta + 90.;
3816 r3 = atheta + 90.;
3817 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3818 pMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
3819 zpos = -dtra2[2] / 2.;
3820 pMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
3821 r2 = atheta + 90.;
3822 r3 = atheta + 90.;
3823 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
3824 pMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
3825
3826 atheta = 120.;
3827 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3828 aphi2 = 180. - aphi1;
3829 xpos = (xtra1[1] + xtra1[2]) / 2.;
3830 ypos = (ytra1[1] + ytra1[2]) / 2.;
3831 zpos = dtra2[2] / 2.;
3832 pMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
3833 r2 = atheta + 90.;
3834 r3 = atheta + 90.;
3835 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
3836 pMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
3837 zpos = -dtra2[2] / 2.;
3838 pMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
3839 r2 = atheta + 90.;