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