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