]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSv3.cxx
Correct destructors, thanks to I.Hrivnacova
[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$
5b8cc8df 18Revision 1.9 1999/10/06 19:56:50 fca
19Add destructor
20
1c1b73f8 21Revision 1.8 1999/10/05 08:05:09 fca
22Minor corrections for uninitialised variables.
23
593d2ea1 24Revision 1.7 1999/09/29 09:24:20 fca
25Introduction of the Copyright and cvs Log
26
4c039060 27*/
28
fe4da5cc 29///////////////////////////////////////////////////////////////////////////////
30// //
31// Inner Traking System version 3 //
58005f18 32// This class contains the base procedures for the Inner Tracking System //
33// //
34// Authors: R. Barbera, A. Morsch.
35// version 3.
36// Created 1998.
37//
38// NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT
39// WORK with the geometry or module classes or any analysis classes. You are
40// strongly encouraged to uses AliITSv5.
fe4da5cc 41// //
fe4da5cc 42// //
43///////////////////////////////////////////////////////////////////////////////
44
45#include <TMath.h>
46#include <TRandom.h>
47#include <TVector.h>
58005f18 48#include "AliITShit.h"
fe4da5cc 49#include "AliITSv3.h"
50#include "AliRun.h"
51
52#include "AliMC.h"
53#include "AliConst.h"
54
55ClassImp(AliITSv3)
56
57//_____________________________________________________________________________
593d2ea1 58AliITSv3::AliITSv3() {
59 //
60 // Default constructor for ITS
61 //
62 fId3N = 6;
63 fId3Name = new char*[fId3N];
64 fId3Name[0] = "ITS1";
65 fId3Name[1] = "ITS2";
66 fId3Name[2] = "ITS3";
67 fId3Name[3] = "ITS4";
68 fId3Name[4] = "ITS5";
69 fId3Name[5] = "ITS6";
70 fMinorVersionV3=1;
fe4da5cc 71}
5b8cc8df 72//_____________________________________________________________________________
73AliITSv3::~AliITSv3() {
74 //
75 // Standard destructor for the ITS
76 //
77 delete [] fId3Name;
78}
1c1b73f8 79//_____________________________________________________________________________
80AliITSv3::~AliITSv3() {
81 //
82 // Standard destructor for the ITS
83 //
84 for (Int_t i=0;i<fId3N;++i) delete [] fId3Name[i];
85 delete [] fId3Name;
86 fId3Name = 0;
87}
88
fe4da5cc 89//_____________________________________________________________________________
58005f18 90AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
593d2ea1 91 //
92 // Standard constructor for ITS
93 //
94 fId3N = 6;
95 fId3Name = new char*[fId3N];
96 fId3Name[0] = "ITS1";
97 fId3Name[1] = "ITS2";
98 fId3Name[2] = "ITS3";
99 fId3Name[3] = "ITS4";
100 fId3Name[4] = "ITS5";
101 fId3Name[5] = "ITS6";
102 fMinorVersionV3=1;
fe4da5cc 103}
104
105//_____________________________________________________________________________
58005f18 106void AliITSv3::CreateGeometry(){
fe4da5cc 107 //
108 // Create ITS geometry for version 3
109 //
58005f18 110 //
fe4da5cc 111
fe4da5cc 112
58005f18 113 const Float_t xx[14] = { 0.000, 0.000,-14.002, -6.288,-25.212,-16.292,
114 -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
115 -14.358, 0.000};
116 const Float_t yy[14] = { 0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
117 22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
118 -3.775, 0.000 };
119 const Float_t xbeg[13] = { 0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
120 -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
121 -13.426 };
122 const Float_t ybeg[13] = { 0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
123 21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
124 -3.53 };
125 const Float_t xend[13] = { 0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
126 -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
127 -.373 };
128 const Float_t yend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
129 19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
130 -.098 };
131 const Float_t xarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
132 -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
133 -0.500 };
134 const Float_t yarc[13] = { 0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
135 19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
136 26.802 };
137 const Float_t rarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
138 0.5,0.7,0.5,0.7,0.5,0.5 };
139 const Float_t rr = 4.064516;
140 const Float_t tteta = 63.00;
141 const Float_t pphi = -35.00;
142 const Float_t gteta = 87.78;
fe4da5cc 143 const Double_t degrad = kPI/180.;
144 const Double_t raddeg = 180./kPI;
58005f18 145 const Double_t twopi = 2*kPI;
fe4da5cc 146
147 Double_t biga, bigb;
58005f18 148 Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5],
149 dfra[10], dcer[3], dkap[3], dpla[3],
150 xccc, yccc, aphi, dcop[3], dtra[3], dsil[3],
151 atheta1011, dbus[3], dtub[3], dwat[3],
152 depx[3], dits[3], atheta1314, atheta1213, atheta1112,
153 dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
fe4da5cc 154 Double_t biga1, bigb1;
58005f18 155 Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2,
156 dtra1[3], dtra2[3], dtra3[3],
157 dtra4[3], dbox1[3], dbox2[3];
158 Int_t jbox1, jbox2;
159 Float_t xtra1[6], ytra1[6], ztra1[6];
160 Int_t i;
161 Float_t xpos1, ypos1;
162 Int_t j;
163 Float_t angle, dcone[5], dtube[3], dpgon[10];
164 Float_t rzero, xzero, yzero;
fe4da5cc 165 Double_t coeffa, coeffb, coeffc;
58005f18 166 Int_t idrotm[5250];
167 Float_t atheta, offset;
168 Float_t offset1, offset2, dgh[15];
169 Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56,
170 atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
171 //Float_t yos;
172 Float_t r1, r2, r3;
fe4da5cc 173 Double_t xcc1, ycc1, xcc2, ycc2;
58005f18 174 Float_t atheta910;
175 const char natra[][5] ={ "TR01","TR02","TR03","TR04",
176 "TR05","TR06","TR07","TR08"};
177 const char natra1[][5] ={"TR11","TR12","TR13","TR14",
178 "TR15","TR16","TR17","TR18",
179 "TR19","TR20","TR21","TR22",
180 "TR23","TR24","TR25","TR26"};
181 const char natra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
182 const char natra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
183 const char natra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
184 "TR57","TR58","TR59","TR60","TR61","TR62",
185 "TR63","TR64","TR65","TR66"};
fe4da5cc 186
ad51aeb0 187 Int_t *idtmed = fIdtmed->GetArray()-199;
fe4da5cc 188
189 // --- Define a ghost volume containing the whole ITS and fill it with air
190 // or vacuum
191
58005f18 192 dgh[0] = 0.0;
193 dgh[1] = 360.0;
194 dgh[2] = 4.0;
195 dgh[3] = -70.0;
196 dgh[4] = 49.999;
197 dgh[5] = 49.999;
198 dgh[6] = -25.0;
199 dgh[7] = 3.0;
200 dgh[8] = 49.999;
201 dgh[9] = 25.0;
202 dgh[10] = 3.0;
fe4da5cc 203 dgh[11] = 49.999;
58005f18 204 dgh[12] = 70.0;
fe4da5cc 205 dgh[13] = 49.999;
206 dgh[14] = 49.999;
cfce8870 207 gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
fe4da5cc 208
209 // --- Place the ghost volume in its mother volume (ALIC) and make it
210 // invisible
211
cfce8870 212 gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
213 gMC->Gsatt("ITSV", "SEEN", 0);
fe4da5cc 214
215 //************************************************************************
216 //* *
217 //* P I X E L S *
218 //* =========== *
219 //* *
220 //************************************************************************
221
222 // GOTO 2345 ! skip ITS layer no. 1 and 2
223
224 // --- Define a ghost volume containing the Silicon Pixel Detectors
225 // (layer #1 and #2) and fill it with air or vacuum
226
58005f18 227 xxm = (49.999-3)/(70-25);
228 dgh[0] = 0.0;
229 dgh[1] = 360.0;
230 dgh[2] = 4.0;
231 dgh[3] = -25.-(9.-3.01)/xxm;
232 dgh[4] = 9.0;
233 dgh[5] = 9.0;
234 dgh[6] = -25.0;
235 dgh[7] = 3.01;
236 dgh[8] = 9.0;
237 dgh[9] = 25.0;
fe4da5cc 238 dgh[10] = 3.01;
58005f18 239 dgh[11] = 9.0;
fe4da5cc 240 dgh[12] = 25+(9-3.01)/xxm;
58005f18 241 dgh[13] = 9.0;
242 dgh[14] = 9.0;
cfce8870 243 gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
fe4da5cc 244
245 // --- Place the ghost volume in its mother volume (ITSV) and make it
246 // invisible
247
cfce8870 248 gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
249 gMC->Gsatt("IT12", "SEEN", 0);
fe4da5cc 250
251 // --- Define a ghost volume containing a single element of layer #1
252 // and fill it with air or vacuum
253
254 dbox1[0] = 0.005+0.01+0.0075;
255 dbox1[1] = .79;
256 dbox1[2] = 12.67;
cfce8870 257 gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
fe4da5cc 258
58005f18 259 //--Divide each element of layer #1 in three ladders along the beam direction
260
cfce8870 261 gMC->Gsdvn("IPB1", "IPV1", 3, 3);
fe4da5cc 262
263 // --- Make the ghost volumes invisible
264
cfce8870 265 gMC->Gsatt("IPV1", "SEEN", 0);
266 gMC->Gsatt("IPB1", "SEEN", 0);
fe4da5cc 267
58005f18 268 // --- Define a volume containing the chip of pixels (silicon, layer #1)
269
270 dchi[0] = 0.005;
271 dchi[1] = 0.79;
fe4da5cc 272 dchi[2] = dbox1[2] / 3.;
cfce8870 273 gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
fe4da5cc 274
275 // --- Define a volume containing the bus of pixels (silicon, layer #1)
276
58005f18 277 dbus[0] = 0.01;
278 dbus[1] = 0.64;
fe4da5cc 279 dbus[2] = 4.19;
cfce8870 280 gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
fe4da5cc 281
282 // --- Define a volume containing the sensitive part of pixels
283 // (silicon, layer #1)
284
58005f18 285 dits[0] = 0.0075;
286 dits[1] = 0.64;
fe4da5cc 287 dits[2] = 4.19;
cfce8870 288 gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
58005f18 289
fe4da5cc 290 // --- Place the chip into its mother (IPB1)
291
292 xpos = dbox1[0] - dchi[0];
58005f18 293 ypos = 0.0;
294 zpos = 0.0;
cfce8870 295 gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 296
297 // --- Place the sensitive volume into its mother (IPB1)
298
299 xpos = dbox1[0] - dchi[0] * 2. - dits[0];
300 ypos = dchi[1] - dits[1];
301 zpos = -(dchi[2] - dits[2]);
cfce8870 302 gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 303
304 // --- Place the bus into its mother (IPB1)
305
306 xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
307 ypos = dchi[1] - dbus[1];
308 zpos = -(dchi[2] - dbus[2]);
cfce8870 309 gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 310
311 // --- Define a ghost volume containing a single element of layer #2
312 // and fill it with air or vacuum
313
314 dbox2[0] = 0.005+0.01+0.0075;
58005f18 315 dbox2[1] = 0.79;
fe4da5cc 316 dbox2[2] = 16.91;
cfce8870 317 gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
58005f18 318
319 //--Divide each element of layer #2 in four ladders along the beam direction
fe4da5cc 320
cfce8870 321 gMC->Gsdvn("IPB2", "IPV2", 4, 3);
fe4da5cc 322
323 // --- Make the ghost volumes invisible
324
cfce8870 325 gMC->Gsatt("IPV2", "SEEN", 0);
326 gMC->Gsatt("IPB2", "SEEN", 0);
fe4da5cc 327
328 // --- Define a volume containing the chip of pixels (silicon, layer #2)
329
58005f18 330 dchi[0] = 0.005;
331 dchi[1] = 0.79;
fe4da5cc 332 dchi[2] = dbox2[2] / 4.;
cfce8870 333 gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
58005f18 334
fe4da5cc 335 // --- Define a volume containing the bus of pixels (silicon, layer #2)
336
58005f18 337 dbus[0] = 0.01;
338 dbus[1] = 0.64;
fe4da5cc 339 dbus[2] = 4.19;
cfce8870 340 gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
58005f18 341
fe4da5cc 342 // --- Define a volume containing the sensitive part of pixels
343 // (silicon, layer #2)
344
58005f18 345 dits[0] = 0.0075;
346 dits[1] = 0.64;
fe4da5cc 347 dits[2] = 4.19;
cfce8870 348 gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
58005f18 349
fe4da5cc 350 // --- Place the chip into its mother (IPB2)
351
352 xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
58005f18 353 ypos = 0.0;
354 zpos = 0.0;
cfce8870 355 gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 356
357 // --- Place the sensitive volume into its mother (IPB2)
358
359 xpos = dbox1[0] - dbus[0] * 2. - dits[0];
360 ypos = -(dchi[1] - dits[1]);
361 zpos = -(dchi[2] - dits[2]);
cfce8870 362 gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 363
364 // --- Place the bus into its mother (IPB2)
365
366 xpos = dbox1[0] - dbus[0];
367 ypos = -(dchi[1] - dbus[1]);
368 zpos = -(dchi[2] - dbus[2]);
cfce8870 369 gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 370
371 // --- Define a generic segment of an element of the mechanical support
372
58005f18 373 dsup[0] = 0.0;
374 dsup[1] = 0.0;
375 dsup[2] = 0.0;
cfce8870 376 gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
fe4da5cc 377
378 // --- Define a generic arc of an element of the mechanical support
379
58005f18 380 darc[0] = 0.0;
381 darc[1] = 0.0;
382 darc[2] = 0.0;
cfce8870 383 gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
fe4da5cc 384
385 // --- Define the mechanical supports of layers #1 and #2 and place the
386 // elements of the layers in it
387
388 jbox1 = 0;
389 // counter over the number of elements of layer #1 (
390 jbox2 = 0;
391
392 // counter over the number of elements of layer #2 (
393 for (i = 1; i <= 10; ++i) {
394
395 // --- Place part # 1-2 (see sketch)
396
397 // number of carbon fiber supports (see sketch)
398 offset1 = -35.;
399 dsup[0] = .01;
58005f18 400 dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) +
401 (yend[0] - ybeg[0]) * (yend[0] - ybeg[0]) ) / 20.;
402 dsup[2] = 25.0;
403 xcc = ( xx[0] + xx[1]) / 20.;
404 ycc = ( yy[0] + yy[1]) / 20.;
fe4da5cc 405 xccc = (xbeg[0] + xend[0]) / 20.;
406 yccc = (ybeg[0] + yend[0]) / 20.;
407 if (xx[0] == xx[1]) {
408 offset2 = 0.;
409 } else {
410 r1 = yy[1] - yy[0];
411 r2 = xx[1] - xx[0];
412 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
58005f18 413 } // end if xx[0] == xx[1]
fe4da5cc 414 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 415 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
416 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
417 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
418 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
419 xpos = xpos1 * TMath::Cos(gteta * degrad) +
420 ypos1 * TMath::Sin(gteta *degrad);
421 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
422 ypos1 * TMath::Cos(gteta * degrad);
423 zpos = 0.0;
fe4da5cc 424 atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 425 AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
426 atheta12 + 90., 0., 0.);
427 gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
428 idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
429
fe4da5cc 430 // --- Place part # 2-3 (see sketch)
431
58005f18 432 offset1 = -35.0;
433 dsup[0] = 0.01;
434 dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) +
435 (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
436 dsup[2] = 25.0;
437 xcc = ( xx[1] + xx[2]) / 20.;
438 ycc = ( yy[1] + yy[2]) / 20.;
fe4da5cc 439 xccc = (xbeg[1] + xend[1]) / 20.;
440 yccc = (ybeg[1] + yend[1]) / 20.;
441 if (xx[1] == xx[2]) {
442 offset2 = 0.;
443 } else {
444 r1 = yy[2] - yy[1];
445 r2 = xx[2] - xx[1];
446 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
58005f18 447 } // end if xx[1] == xx[2]
fe4da5cc 448 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 449 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
450 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
451 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
452 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
453 xpos = xpos1 * TMath::Cos(gteta * degrad) +
454 ypos1 * TMath::Sin(gteta * degrad);
455 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
456 ypos1 * TMath::Cos(gteta * degrad);
457 zpos = 0.0;
fe4da5cc 458 atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 459 AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
460 atheta23 + 90., 0., 0.);
461 gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
462 idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
463
464 // --- Place an element of layer #2
465
fe4da5cc 466 biga = (yy[2] - yy[1]) / (xx[2] - xx[1]);
467 bigb = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
468 coeffa = biga * biga + 1.;
469 coeffb = biga * bigb - biga * ycc - xcc;
58005f18 470 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
471 bigb * bigb - 0.08964*0.08964;
472 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
473 coeffa;
fe4da5cc 474 ycc1 = biga * xcc1 + bigb;
475 biga1 = -1. / biga;
476 bigb1 = xcc1 / biga + ycc1;
477 coeffa = biga1 * biga1 + 1.;
478 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
58005f18 479 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
480 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
481 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
482 coeffa;
483 ycc2 = biga1 * xcc2 + bigb1;
484 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
485 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
486 xpos = xpos1 * TMath::Cos(gteta * degrad) +
487 ypos1 * TMath::Sin(gteta *degrad);
488 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
489 ypos1 * TMath::Cos(gteta * degrad);
490 zpos = 0.0;
fe4da5cc 491 ++jbox2;
58005f18 492 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
493 idrotm[(i-1) * 13 + 1101], "ONLY");
494
495 // --- Place part # 3-4 (see sketch)
496
497 offset1 = -35.0;
498 dsup[0] = 0.01;
499 dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) +
500 (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
fe4da5cc 501 dsup[2] = 25.;
502 xcc = (xx[1] + xx[2]) / 20.;
503 ycc = (yy[1] + yy[2]) / 20.;
504 xccc = (xbeg[2] + xend[2]) / 20.;
505 yccc = (ybeg[2] + yend[2]) / 20.;
506 if (xx[2] == xx[3]) {
507 offset2 = 0.;
508 } else {
509 r1 = yy[3] - yy[2];
510 r2 = xx[3] - xx[2];
511 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
58005f18 512 } // end if xx[2] == xx[3]
fe4da5cc 513 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 514 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
515 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
516 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
517 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
518 xpos = xpos1 * TMath::Cos(gteta * degrad) +
519 ypos1 * TMath::Sin(gteta *degrad);
520 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
521 ypos1 * TMath::Cos(gteta * degrad);
522 zpos = 0.0;
fe4da5cc 523 atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 524 AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90.,
525 atheta34 + 90., 0., 0.);
526 gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos,
527 idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
528
529 // --- Place part # 4-5 (see sketch)
530
531 offset1 = -35.0;
532 dsup[0] = 0.01;
533 dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) +
534 (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
535 dsup[2] = 25.0;
536 xcc = ( xx[3] + xx[4]) / 20.;
537 ycc = ( yy[3] + yy[4]) / 20.;
fe4da5cc 538 xccc = (xbeg[3] + xend[3]) / 20.;
539 yccc = (ybeg[3] + yend[3]) / 20.;
540 if (xx[3] == xx[4]) {
541 offset2 = 0.;
542 } else {
543 r1 = yy[4] - yy[3];
544 r2 = xx[4] - xx[3];
545 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
58005f18 546 } // end if xx[3] == xx[4]
fe4da5cc 547 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 548 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
549 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
550 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
551 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
552 xpos = xpos1 * TMath::Cos(gteta * degrad) +
553 ypos1 * TMath::Sin(gteta *degrad);
554 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
555 ypos1 * TMath::Cos(gteta * degrad);
556 zpos = 0.0;
fe4da5cc 557 atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 558 AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90.,
559 atheta45 + 90., 0., 0.);
560 gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos,
561 idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
562
563 // --- Place an element of layer #2
564
fe4da5cc 565 biga = (yy[4] - yy[3]) / (xx[4] - xx[3]);
566 bigb = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
567 coeffa = biga * biga + 1.;
568 coeffb = biga * bigb - biga * ycc - xcc;
58005f18 569 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
570 bigb * bigb - .014285030400000001;
571 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
572 coeffa;
fe4da5cc 573 ycc1 = biga * xcc1 + bigb;
574 biga1 = -1. / biga;
575 bigb1 = xcc1 / biga + ycc1;
576 coeffa = biga1 * biga1 + 1.;
577 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
58005f18 578 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
579 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
580 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
581 coeffa;
582 ycc2 = biga1 * xcc2 + bigb1;
583 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
584 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
585 xpos = xpos1 * TMath::Cos(gteta * degrad) +
586 ypos1 * TMath::Sin(gteta *degrad);
587 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
588 ypos1 * TMath::Cos(gteta * degrad);
589 zpos = 0.0;
fe4da5cc 590 ++jbox2;
58005f18 591 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
592 idrotm[(i-1) * 13 + 1103], "ONLY");
593
fe4da5cc 594 // --- Place part # 5-6 (see sketch)
595
596 offset1 = -35.;
597 dsup[0] = .01;
58005f18 598 dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) +
599 (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
fe4da5cc 600 dsup[2] = 25.;
601 xcc = (xx[4] + xx[5]) / 20.;
602 ycc = (yy[4] + yy[5]) / 20.;
603 xccc = (xbeg[4] + xend[4]) / 20.;
604 yccc = (ybeg[4] + yend[4]) / 20.;
605 if (xx[4] == xx[5]) {
606 offset2 = 0.;
607 } else {
608 r1 = yy[5] - yy[4];
609 r2 = xx[5] - xx[4];
610 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
611 }
612 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 613 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
614 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
615 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
616 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
617 xpos = xpos1 * TMath::Cos(gteta * degrad) +
618 ypos1 * TMath::Sin(gteta *degrad);
619 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
620 ypos1 * TMath::Cos(gteta * degrad);
fe4da5cc 621 zpos = 0.;
622 atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 623 AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90.,
624 atheta56 + 90., 0., 0.);
625 gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
626 idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
627
fe4da5cc 628 // --- Place part # 6-7 (see sketch)
629
58005f18 630 offset1 = -35.0;
631 dsup[0] = 0.01;
632 dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) +
633 (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
634 dsup[2] = 25.0;
fe4da5cc 635 xcc = (xx[5] + xx[6]) / 20.;
636 ycc = (yy[5] + yy[6]) / 20.;
637 xccc = (xbeg[5] + xend[5]) / 20.;
638 yccc = (ybeg[5] + yend[5]) / 20.;
639 if (xx[5] == xx[6]) {
640 offset2 = 0.;
641 } else {
642 r1 = yy[6] - yy[5];
643 r2 = xx[6] - xx[5];
644 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
58005f18 645 } // end if xx[5] == xx[6]
fe4da5cc 646 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 647 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
648 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
649 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
650 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
651 xpos = xpos1 * TMath::Cos(gteta * degrad) +
652 ypos1 * TMath::Sin(gteta *degrad);
653 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
654 ypos1 * TMath::Cos(gteta * degrad);
fe4da5cc 655 zpos = 0.;
656 atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 657 AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90.,
658 atheta67 + 90., 0., 0.);
659 gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos,
660 idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
661
fe4da5cc 662 // --- Place an element of layer #2
663
664 biga = (yy[6] - yy[5]) / (xx[6] - xx[5]);
665 bigb = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
666 coeffa = biga * biga + 1.;
667 coeffb = biga * bigb - biga * ycc - xcc;
58005f18 668 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
669 bigb * bigb - .014285030400000001;
670 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
671 coeffa;
fe4da5cc 672 ycc1 = biga * xcc1 + bigb;
673 biga1 = -1. / biga;
674 bigb1 = xcc1 / biga + ycc1;
675 coeffa = biga1 * biga1 + 1.;
676 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
58005f18 677 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
678 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
679 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
680 coeffa;
681 ycc2 = biga1 * xcc2 + bigb1;
682 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
683 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
684 xpos = xpos1 * TMath::Cos(gteta * degrad) +
685 ypos1 * TMath::Sin(gteta *degrad);
686 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
687 ypos1 * TMath::Cos(gteta * degrad);
688 zpos = 0.0;
fe4da5cc 689 ++jbox2;
58005f18 690 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
691 idrotm[(i-1) * 13 + 1105], "ONLY");
fe4da5cc 692
693 // --- Place part # 7-8 (see sketch)
694
695 offset1 = -35.;
696 dsup[0] = .01;
58005f18 697 dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) +
698 (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
fe4da5cc 699 dsup[2] = 25.;
700 xcc = (xx[6] + xx[7]) / 20.;
701 ycc = (yy[6] + yy[7]) / 20.;
702 xccc = (xbeg[6] + xend[6]) / 20.;
703 yccc = (ybeg[6] + yend[6]) / 20.;
704 if (xx[6] == xx[7]) {
705 offset2 = 0.;
706 } else {
707 r1 = yy[7] - yy[6];
708 r2 = xx[7] - xx[6];
709 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
58005f18 710 } // end if
fe4da5cc 711 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 712 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
713 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
714 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
715 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
716 xpos = xpos1 * TMath::Cos(gteta * degrad) +
717 ypos1 * TMath::Sin(gteta *degrad);
718 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
719 ypos1 * TMath::Cos(gteta * degrad);
fe4da5cc 720 zpos = 0.;
721 atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 722 AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90.,
723 atheta78 + 90., 0., 0.);
724 gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos,
725 idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
fe4da5cc 726
727 // --- Place part # 8-9 (see sketch)
728
729 offset1 = -35.;
730 dsup[0] = .01;
58005f18 731 dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) +
732 (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
fe4da5cc 733 dsup[2] = 25.;
734 xcc = (xx[7] + xx[8]) / 20.;
735 ycc = (yy[7] + yy[8]) / 20.;
736 xccc = (xbeg[7] + xend[7]) / 20.;
737 yccc = (ybeg[7] + yend[7]) / 20.;
738 if (xx[1] == xx[2]) {
739 offset2 = 0.;
740 } else {
741 r1 = yy[8] - yy[7];
742 r2 = xx[8] - xx[7];
743 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
744 }
745 aphi = (pphi + (i-1) * 36.) * degrad;
58005f18 746 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
747 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
748 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
749 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
750 xpos = xpos1 * TMath::Cos(gteta * degrad) +
751 ypos1 * TMath::Sin(gteta *degrad);
752 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
753 ypos1 * TMath::Cos(gteta * degrad);
fe4da5cc 754 zpos = 0.;
755 atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
58005f18 756 AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90.,
757 atheta89 + 90., 0., 0.);
758 gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos,
759 idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
fe4da5cc 760
761 // --- Place an element of layer #2
762
763 biga = (yy[8] - yy[7]) / (xx[8] - xx[7]);
764 bigb = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
765 coeffa = biga * biga + 1.;
766 coeffb = biga * bigb - biga * ycc - xcc;
58005f18 767 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
768 bigb * bigb - .014285030400000001;
769 xcc1 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
770 coeffa;
fe4da5cc 771 ycc1 = biga * xcc1 + bigb;
772 biga1 = -1. / biga;
773 bigb1 = xcc1 / biga + ycc1;
774 coeffa = biga1 * biga1 + 1.;
775 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
58005f18 776 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
777 bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
778 xcc2 = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
779 coeffa;
780 ycc2 = biga1 * xcc2 + bigb1;
781 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
782 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
783 xpos = xpos1 * TMath::Cos(gteta * degrad) +
784 ypos1 * TMath::Sin(gteta *degrad);
785 ypos = -xpos1 * TMath::Sin(gteta * degrad) +
786 ypos1 * TMath::Cos(gteta * degrad);
787 zpos = 0.0;
fe4da5cc 788 ++jbox2;
58005f18 789 gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
790 idrotm[(i-1) * 13 + 1107], "ONLY");
791
fe4da5cc 792 // --- Place part # 9-10 (see sketch)
793
794 offset1 = -35.;
795 dsup[0] = .01;
58005f18 796 dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) +
797 (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
fe4da5cc 798 dsup[2] = 25.;
799 xcc = (xx[8] + xx[9]) / 20.;
800 ycc = (yy[8] + yy[9]) / 20.;
801 xccc = (xbeg[8] + xend[8]) / 20.;
802 yccc = (ybeg[8] + yend[8]) / 20.;
803 if (xx[8] == xx[9]) {
804 offset2 = 0.;
805 } else {
806 r1 = yy[9] - yy[8];
807 r2 = xx[9] - xx[8];
808 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
809 }
810 aphi = (pphi + (i-1) * 36.) * degrad;
811 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
812 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
813 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
814 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
815 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
816 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
817 zpos = 0.;
818 atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
819 AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
cfce8870 820 gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
fe4da5cc 821
822 // --- Place part # 10-11 (see sketch)
823
824 offset1 = -35.;
825 dsup[0] = .01;
826 dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
827 dsup[2] = 25.;
828 xcc = (xx[9] + xx[10]) / 20.;
829 ycc = (yy[9] + yy[10]) / 20.;
830 xccc = (xbeg[9] + xend[9]) / 20.;
831 yccc = (ybeg[9] + yend[9]) / 20.;
832 if (xx[9] == xx[10]) {
833 offset2 = 0.;
834 } else {
835 r1 = yy[10] - yy[9];
836 r2 = xx[10] - xx[9];
837 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
838 }
839 aphi = (pphi + (i-1) * 36.) * degrad;
840 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
841 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
842 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
843 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
844 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
845 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
846 zpos = 0.;
847 atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
848 AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
cfce8870 849 gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
fe4da5cc 850
851 // --- Place part # 13-14 (see sketch)
852
853 offset1 = -35.;
854 dsup[0] = .01;
855 dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
856 dsup[2] = 25.;
857 xcc = (xx[12] + xx[13]) / 20.;
858 ycc = (yy[12] + yy[13]) / 20.;
859 xccc = (xbeg[12] + xend[12]) / 20.;
860 yccc = (ybeg[12] + yend[12]) / 20.;
861 if (xx[12] == xx[13]) {
862 offset2 = 0.;
863 } else {
864 r1 = yy[12] - yy[13];
865 r2 = xx[12] - xx[13];
866 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
867 }
868 aphi = (pphi + (i-1) * 36.) * degrad;
869 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
870 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
871 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
872 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
873 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
874 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
875 zpos = 0.;
876 atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
877 AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
cfce8870 878 gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
fe4da5cc 879
880 // --- Place an element of layer #1
881
882 biga = (yy[13] - yy[12]) / (xx[13] - xx[12]);
883 bigb = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
884 coeffa = biga * biga + 1.;
885 coeffb = biga * bigb - biga * ycc - xcc;
886 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
887 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
888 ycc1 = biga * xcc1 + bigb;
889 biga1 = -1. / biga;
890 bigb1 = xcc1 / biga + ycc1;
891 coeffa = biga1 * biga1 + 1.;
892 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
893 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
894 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
895 ycc2 = biga1 * xcc2 + bigb1;
896 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
897 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
898 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
899 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
900 zpos = 0.;
901 ++jbox1;
cfce8870 902 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
fe4da5cc 903
904 // --- Place part # 12-13 (see sketch)
905
906 offset1 = -35.;
907 dsup[0] = .01;
908 dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
909 dsup[2] = 25.;
910 xcc = (xx[11] + xx[12]) / 20.;
911 ycc = (yy[11] + yy[12]) / 20.;
912 xccc = (xbeg[11] + xend[11]) / 20.;
913 yccc = (ybeg[11] + yend[11]) / 20.;
914 if (xx[11] == xx[12]) {
915 offset2 = 0.;
916 } else {
917 r1 = yy[12] - yy[11];
918 r2 = xx[12] - xx[11];
919 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
920 }
921 aphi = (pphi + (i-1) * 36.) * degrad;
922 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
923 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
924 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
925 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
926 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
927 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
928 zpos = 0.;
929 atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
930 AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
cfce8870 931 gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
fe4da5cc 932
933 // --- Place part # 11-12 (see sketch)
934
935 offset1 = -35.;
936 dsup[0] = .01;
937 dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
938 dsup[2] = 25.;
939 xcc = (xx[10] + xx[11]) / 20.;
940 ycc = (yy[10] + yy[11]) / 20.;
941 xccc = (xbeg[10] + xend[10]) / 20.;
942 yccc = (ybeg[10] + yend[10]) / 20.;
943 if (xx[10] == xx[11]) {
944 offset2 = 0.;
945 } else {
946 r1 = yy[11] - yy[10];
947 r2 = xx[11] - xx[10];
948 offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
949 }
950 aphi = (pphi + (i-1) * 36.) * degrad;
951 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
952 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
953 xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
954 ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
955 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
956 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
957 zpos = 0.;
958 atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
959 AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
cfce8870 960 gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
fe4da5cc 961
962 // --- Place an element of layer #1
963
964 biga = (yy[11] - yy[10]) / (xx[11] - xx[10]);
965 bigb = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
966 coeffa = biga * biga + 1.;
967 coeffb = biga * bigb - biga * ycc - xcc;
968 coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
969 xcc1 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
970 ycc1 = biga * xcc1 + bigb;
971 biga1 = -1. / biga;
972 bigb1 = xcc1 / biga + ycc1;
973 coeffa = biga1 * biga1 + 1.;
974 coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
975 coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox1[0]) * (dsup[0] + dbox1[0]);
976 xcc2 = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
977 ycc2 = biga1 * xcc2 + bigb1;
978 xpos1 = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
979 ypos1 = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
980 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
981 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
982 zpos = 0.;
983 ++jbox1;
cfce8870 984 gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
fe4da5cc 985
986 // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch)
987
988 darc[0] = rarc[12] / 10. - .02;
989 darc[1] = rarc[12] / 10.;
990 darc[2] = 25.;
991 darc[3] = atheta12 - (i-1) * 36.;
992 darc[4] = atheta23 - (i-1) * 36.;
993 xcc = xarc[12] / 10.;
994 ycc = yarc[12] / 10.;
995 aphi = (pphi + (i-1) * 36.) * degrad;
996 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
997 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
998 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
999 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1000 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1001 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1002 zpos = 0.;
cfce8870 1003 gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
fe4da5cc 1004
1005 // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch)
1006
1007 darc[0] = rarc[11] / 10. - .02;
1008 darc[1] = rarc[11] / 10.;
1009 darc[2] = 25.;
1010 darc[3] = atheta23 + 90. - (i-1) * 36.;
1011 darc[4] = atheta34 + 90. - (i-1) * 36.;
1012 xcc = xarc[11] / 10.;
1013 ycc = yarc[11] / 10.;
1014 aphi = (pphi + (i-1) * 36.) * degrad;
1015 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1016 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1017 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1018 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1019 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1020 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1021 zpos = 0.;
cfce8870 1022 gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
fe4da5cc 1023
1024 // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch)
1025
1026 darc[0] = rarc[10] / 10. - .02;
1027 darc[1] = rarc[10] / 10.;
1028 darc[2] = 25.;
1029 darc[3] = atheta45 + 180. - (i-1) * 36.;
1030 darc[4] = atheta34 + 180. - (i-1) * 36.;
1031 xcc = xarc[10] / 10.;
1032 ycc = yarc[10] / 10.;
1033 aphi = (pphi + (i-1) * 36.) * degrad;
1034 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1035 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1036 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1037 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1038 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1039 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1040 zpos = 0.;
cfce8870 1041 gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
fe4da5cc 1042
1043 // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch)
1044
1045 darc[0] = rarc[9] / 10. - .02;
1046 darc[1] = rarc[9] / 10.;
1047 darc[2] = 25.;
1048 darc[3] = atheta45 - 90. - (i-1) * 36.;
1049 darc[4] = atheta56 - 90. - (i-1) * 36.;
1050 xcc = xarc[9] / 10.;
1051 ycc = yarc[9] / 10.;
1052 aphi = (pphi + (i-1) * 36.) * degrad;
1053 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1054 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1055 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1056 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1057 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1058 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1059 zpos = 0.;
cfce8870 1060 gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
fe4da5cc 1061
1062 // --- Place arc # 9 (between part 5-6 and part) (see sketch)
1063
1064 darc[0] = rarc[8] / 10. - .02;
1065 darc[1] = rarc[8] / 10.;
1066 darc[2] = 25.;
1067 darc[3] = atheta67 + 45. - (i-1) * 36.;
1068 darc[4] = atheta56 + 45. - (i-1) * 36.;
1069 xcc = xarc[8] / 10.;
1070 ycc = yarc[8] / 10.;
1071 aphi = (pphi + (i-1) * 36.) * degrad;
1072 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1073 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1074 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1075 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1076 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1077 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1078 zpos = 0.;
cfce8870 1079 gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
fe4da5cc 1080
1081 // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch)
1082
1083 darc[0] = rarc[7] / 10. - .02;
1084 darc[1] = rarc[7] / 10.;
1085 darc[2] = 25.;
1086 darc[3] = atheta67 - (i-1) * 36.;
1087 darc[4] = atheta78 - (i-1) * 36.;
1088 xcc = xarc[7] / 10.;
1089 ycc = yarc[7] / 10.;
1090 aphi = (pphi + (i-1) * 36.) * degrad;
1091 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1092 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1093 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1094 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1095 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1096 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1097 zpos = 0.;
cfce8870 1098 gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
fe4da5cc 1099
1100 // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch)
1101
1102 darc[0] = rarc[6] / 10. - .02;
1103 darc[1] = rarc[6] / 10.;
1104 darc[2] = 25.;
1105 darc[3] = atheta89 + 45. - (i-1) * 36.;
1106 darc[4] = atheta78 + 45. - (i-1) * 36.;
1107 xcc = xarc[6] / 10.;
1108 ycc = yarc[6] / 10.;
1109 aphi = (pphi + (i-1) * 36.) * degrad;
1110 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1111 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1112 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1113 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1114 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1115 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1116 zpos = 0.;
cfce8870 1117 gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
fe4da5cc 1118
1119 // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch)
1120
1121 darc[0] = rarc[5] / 10. - .02;
1122 darc[1] = rarc[5] / 10.;
1123 darc[2] = 25.;
1124 darc[3] = atheta89 + 45. - (i-1) * 36.;
1125 darc[4] = atheta910 + 45. - (i-1) * 36.;
1126 xcc = xarc[5] / 10.;
1127 ycc = yarc[5] / 10.;
1128 aphi = (pphi + (i-1) * 36.) * degrad;
1129 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1130 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1131 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1132 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1133 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1134 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1135 zpos = 0.;
cfce8870 1136 gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
fe4da5cc 1137
1138 // --- Place arc # 5 (between part 9-10 and part 10-11)
1139 // (see sketch)
1140
1141 darc[0] = rarc[4] / 10. - .02;
1142 darc[1] = rarc[4] / 10.;
1143 darc[2] = 25.;
1144 darc[3] = atheta1011 + 45. - (i-1) * 36.;
1145 darc[4] = atheta910 + 45. - (i-1) * 36.;
1146 xcc = xarc[4] / 10.;
1147 ycc = yarc[4] / 10.;
1148 aphi = (pphi + (i-1) * 36.) * degrad;
1149 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1150 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1151 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1152 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1153 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1154 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1155 zpos = 0.;
cfce8870 1156 gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
fe4da5cc 1157
1158 // --- Place arc # 4 (between part 10-11 and part 11-12)
1159 // (see sketch)
1160
1161 darc[0] = rarc[3] / 10. - .02;
1162 darc[1] = rarc[3] / 10.;
1163 darc[2] = 25.;
1164 darc[3] = atheta1112 - 45. - (i-1) * 36.;
1165 darc[4] = atheta1011 - 225. - (i-1) * 36.;
1166 xcc = xarc[3] / 10.;
1167 ycc = yarc[3] / 10.;
1168 aphi = (pphi + (i-1) * 36.) * degrad;
1169 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1170 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1171 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1172 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1173 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1174 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1175 zpos = 0.;
cfce8870 1176 gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
fe4da5cc 1177
1178 // --- Place arc # 3 (between part 11-12 and part 12-13)
1179 // (see sketch)
1180
1181 darc[0] = rarc[2] / 10. - .02;
1182 darc[1] = rarc[2] / 10.;
1183 darc[2] = 25.;
1184 darc[3] = atheta1112 - 90. - (i-1) * 36.;
1185 darc[4] = atheta1213 - 90. - (i-1) * 36.;
1186 xcc = xarc[2] / 10.;
1187 ycc = yarc[2] / 10.;
1188 aphi = (pphi + (i-1) * 36.) * degrad;
1189 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1190 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1191 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1192 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1193 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1194 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1195 zpos = 0.;
cfce8870 1196 gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
fe4da5cc 1197
1198 // --- Place arc # 2 (between part 12-13 and part 13-14)
1199 // (see sketch)
1200
1201 darc[0] = rarc[1] / 10. - .02;
1202 darc[1] = rarc[1] / 10.;
1203 darc[2] = 25.;
1204 darc[3] = atheta1213 + 135. - (i-1) * 36.;
1205 darc[4] = atheta1314 + 165. - (i-1) * 36.;
1206 xcc = xarc[1] / 10.;
1207 ycc = yarc[1] / 10.;
1208 aphi = (pphi + (i-1) * 36.) * degrad;
1209 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1210 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1211 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1212 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1213 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1214 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1215 zpos = 0.;
cfce8870 1216 gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
fe4da5cc 1217
1218 // --- Place arc # 1 (between part 13-14 and part 1-2)
1219 // (see sketch)
1220
1221 darc[0] = rarc[0] / 10. - .02;
1222 darc[1] = rarc[0] / 10.;
1223 darc[2] = 25.;
1224 darc[3] = atheta12 + 45. - (i-1) * 36.;
1225 darc[4] = atheta1314 - (i-1) * 36.;
1226 xcc = xarc[0] / 10.;
1227 ycc = yarc[0] / 10.;
1228 aphi = (pphi + (i-1) * 36.) * degrad;
1229 xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
1230 yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
1231 xpos1 = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
1232 ypos1 = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
1233 xpos = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
1234 ypos = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
1235 zpos = 0.;
cfce8870 1236 gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
fe4da5cc 1237
1238 }
1239 //************************************************************************
1240 //* *
1241 //* D R I F T S *
1242 //* =========== *
1243 //* *
1244 //************************************************************************
1245
1246 // --- Define a ghost volume containing the Silicon Drift Detectors
1247 // (layer #3 and #4) and fill it with air or vacuum
1248
1249 xxm = (49.999-3.)/(70.-25.);
1250 dgh[0] = 0;
1251 dgh[1] = 360;
1252 dgh[2] = 4;
1253 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm;
1254 dgh[4] = 27.;
1255 dgh[5] = 27.;
1256 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm;
1257 dgh[7] = 9.01;
1258 dgh[8] = 27.;
1259 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm;
1260 dgh[10] = 9.01;
1261 dgh[11] = 27.;
1262 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
1263 dgh[13] = 27.;
1264 dgh[14] = 27.;
cfce8870 1265 gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
fe4da5cc 1266
1267 // --- Place the ghost volume in its mother volume (ITSV) and make it
1268 // invisible
1269
cfce8870 1270 gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
1271 gMC->Gsatt("IT34", "SEEN", 0);
fe4da5cc 1272
1273 // --- Layer #3
1274
1275 // GOTO 3456 ! skip ITS layer no. 3
1276
1277 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1278 // smaller lenght of ribs) and fill it with air or vacuum
1279
1280 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1281 dbox1[1] = 3.85;
1282 // the widest element is the sensitive element
1283 dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1284 // 7.5 cm is the lenght
cfce8870 1285 gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
fe4da5cc 1286
1287 // --- Make the ghost volume invisible
1288
cfce8870 1289 gMC->Gsatt("IDV1", "SEEN", 0);
fe4da5cc 1290
1291 // --- Define a volume containing the sensitive part of drifts
1292 // (silicon, layer #3)
1293
1294 dits[0] = .0172;
1295 // see material budget report by G. Feofilov
1296 dits[1] = 3.85;
1297 dits[2] = 4.35;
cfce8870 1298 gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
fe4da5cc 1299
1300 //--- Define the part of the (smaller) rib between two sensitive parts made of
1301 // carbon (layer #3)
1302
1303 dsup[0] = .5 - dits[0];
1304 dsup[1] = .01;
1305 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1306 // 7.5 cm is the lenght
cfce8870 1307 gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
fe4da5cc 1308
1309 //--- Define the first part of the (smaller) rib between two sensitive parts
1310 // made of aluminum (layer #3)
1311
1312 dal1[0] = .5 - dits[0];
1313 dal1[1] = 0.00096/2.;
1314 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1315 // 7.5 cm is the lenght
cfce8870 1316 gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
fe4da5cc 1317
1318 //--- Define the part of the (smaller) rib between two sensitive parts made of
1319 // kapton (layer #3)
1320
1321 dkap[0] = .5 - dits[0];
1322 dkap[1] = .01585;
1323 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1324 // 7.5 cm is the lenght
cfce8870 1325 gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
fe4da5cc 1326
1327 //--- Define the second part of the (smaller) rib between two sensitive parts
1328 // made of aluminum (layer #3)
1329
1330 dal2[0] = .5 - dits[0];
1331 dal2[1] = 0.0027/2.;
1332 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1333 // 7.5 cm is the lenght
cfce8870 1334 gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
fe4da5cc 1335
1336 // --- Define the part of the (smaller) rib between two sensitive parts
1337 // made of silicon (the electronics) (layer #3)
1338
1339 dchi[0] = .5 - dits[0];
1340 dchi[1] = 0.0071/2.;
1341 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1342 // 7.5 cm is the lenght
cfce8870 1343 gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
fe4da5cc 1344
1345 // --- Define the part of the (smaller) rib between two sensitive parts
1346 // made of water (the cooler) (layer #3)
1347
1348 dwat[0] = .5 - dits[0];
1349 dwat[1] = 0.0093/2.;
1350 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1351 // 7.5 cm is the lenght
cfce8870 1352 gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
fe4da5cc 1353
1354 //--- Define the third part of the (smaller) rib between two sensitive parts
1355 // made of aluminum (the cooling tubes) (layer #3)
1356
1357 dtub[0] = .5 - dits[0];
1358 dtub[1] = 0.00134/2.;
1359 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1360 // 7.5 cm is the lenght
cfce8870 1361 gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
fe4da5cc 1362
1363 // --- Define the part of the end-ladder stuff made of PCB (layer #3)
1364
1365 dpcb[0] = .03;
1366 // twice the foreseen thickness
1367 dpcb[1] = 3.5;
1368 dpcb[2] = 7.5;
cfce8870 1369 gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
fe4da5cc 1370
1371 // --- Define the part of the end-ladder stuff made of copper (layer #3)
1372
1373 dcop[0] = .0252;
1374 // twice the foreseen thickness
1375 dcop[1] = 3.5;
1376 dcop[2] = 7.5;
cfce8870 1377 gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
fe4da5cc 1378
1379 // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
1380
1381 dcer[0] = .04;
1382 // twice the foreseen thickness
1383 dcer[1] = 3.5;
1384 dcer[2] = 7.5;
cfce8870 1385 gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
fe4da5cc 1386
1387 // --- Define the part of the end-ladder stuff made of silicon (layer #3)
1388
1389 dsil[0] = .003;
1390 // twice the foreseen thickness
1391 dsil[1] = 3.5;
1392 dsil[2] = 7.5;
cfce8870 1393 gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
fe4da5cc 1394
1395 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1396 // (IDV1)
1397
1398 ypos = 0.;
1399 for (j = 1; j <= 5; ++j) {
1400 // odd elements are up and even elements are down
1401 if (j == 1) {
1402 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1403 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1404 } else if (j == 2) {
1405 xpos = -dbox1[0] + dits[0];
1406 zpos = 0. - dits[2] + 1. - dits[2];
1407 } else if (j == 3) {
1408 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1409 zpos = 0.;
1410 } else if (j == 4) {
1411 xpos = -dbox1[0] + dits[0];
1412 zpos = dits[2] + 0. - 1. + dits[2];
1413 } else if (j == 5) {
1414 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1415 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1416 }
cfce8870 1417 gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1418 }
1419
1420 // --- Place the smaller ribs into their mother (IDV1)
1421
1422 // --- Right ribs (just a matter of convention)
1423
1424 xpos = .5 - dbox1[0] + dits[0];
1425 zpos = 0.;
1426
1427 // --- Carbon
1428
1429 ypos = 2.81;
cfce8870 1430 gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1431
1432 // --- Aluminum #1
1433
1434 ypos = dsup[1] + 2.81 + dal1[1];
cfce8870 1435 gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1436
1437 // --- Kapton
1438
1439 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
cfce8870 1440 gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1441
1442 // --- Aluminum #2
1443
1444 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
cfce8870 1445 gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1446
1447 // --- Silicon (chip)
1448
1449 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
cfce8870 1450 gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1451
1452 // --- Water
1453
1454 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
cfce8870 1455 gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1456
1457 // --- Aluminum #3
1458
1459 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
1460 + dtub[1];
cfce8870 1461 gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1462
1463 // --- Right ribs (just a matter of convention)
1464
1465 // --- Carbon
1466
1467 ypos = -2.81;
cfce8870 1468 gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1469
1470 // --- Aluminum #1
1471
1472 ypos = -(dsup[1] + 2.81 + dal1[1]);
cfce8870 1473 gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1474
1475 // --- Kapton
1476
1477 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
cfce8870 1478 gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1479
1480 // --- Aluminum #2
1481
1482 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
cfce8870 1483 gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1484
1485 // --- Silicon (chip)
1486
1487 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
cfce8870 1488 gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1489
1490 // --- Water
1491
1492 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
cfce8870 1493 gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1494
1495 // --- Aluminum #3
1496
1497 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
1498 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
cfce8870 1499 gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1500
1501 // --- Place the end-ladder stuff into its mother (IDV1)
1502
1503
1504 // --- Negative-Z end-ladder
1505
1506 ypos = 0.;
1507 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1508
1509 // --- PCB
1510
1511 xpos = dbox1[0] - dpcb[0];
cfce8870 1512 gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1513
1514 // --- Copper
1515
1516 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
cfce8870 1517 gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1518
1519 // --- Ceramics
1520
1521 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 1522 gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1523
1524 // --- Silicon (bus)
1525
1526 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 1527 gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1528
1529 // --- Positive-Z end-ladder
1530
1531 ypos = 0.;
1532 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1533
1534 // --- PCB
1535
1536 xpos = dbox1[0] - dpcb[0];
cfce8870 1537 gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1538
1539 // --- Copper
1540
1541 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
cfce8870 1542 gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1543
1544 // --- Ceramics
1545
1546 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 1547 gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1548
1549 // --- Silicon (bus)
1550
1551 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 1552 gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1553
1554 //--- Define a ghost volume containing a single ladder of layer #3 (with the
1555 // larger lenght of ribs) and fill it with air or vacuum
1556
1557 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
1558 dbox2[1] = 3.85;
1559 // the widest element is the sensitive element
1560 dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1561 // 7.5 cm is the lenght
cfce8870 1562 gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
fe4da5cc 1563
1564 // --- Make the ghost volume invisible
1565
cfce8870 1566 gMC->Gsatt("IDV2", "SEEN", 0);
fe4da5cc 1567
1568 //--- Define the part of the (larger) rib between two sensitive parts madeof
1569 // carbon (layer #3)
1570
1571 dsup[0] = .65 - dits[0];
1572 dsup[1] = .01;
1573 dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1574 // 7.5 cm is the lenght
cfce8870 1575 gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
fe4da5cc 1576
1577 //--- Define the first part of the (larger) rib between two sensitive parts
1578 // made of aluminum (layer #3)
1579
1580 dal1[0] = .65 - dits[0];
1581 dal1[1] = 0.00096/2.;
1582 dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1583 // 7.5 cm is the lenght
cfce8870 1584 gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
fe4da5cc 1585
1586 //--- Define the part of the (larger) rib between two sensitive parts madeof
1587 // kapton (layer #3)
1588
1589 dkap[0] = .65 - dits[0];
1590 dkap[1] = 0.0317/2.;
1591 dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1592 // 7.5 cm is the lenght
cfce8870 1593 gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
fe4da5cc 1594
1595 //--- Define the second part of the (larger) rib between two sensitive parts
1596 // made of aluminum (layer #3)
1597
1598 dal2[0] = .65 - dits[0];
1599 dal2[1] = 0.0027/2.;
1600 dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1601 // 7.5 cm is the lenght
cfce8870 1602 gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
fe4da5cc 1603
1604 // --- Define the part of the (larger) rib between two sensitive parts
1605 // made of silicon (the electronics) (layer #3)
1606
1607 dchi[0] = .65 - dits[0];
1608 dchi[1] = 0.0071/2.;
1609 dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1610 // 7.5 cm is the lenght
cfce8870 1611 gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
fe4da5cc 1612
1613 // --- Define the part of the (larger) rib between two sensitive parts
1614 // made of water (the cooler) (layer #3)
1615
1616 dwat[0] = .65 - dits[0];
1617 dwat[1] = 0.0093/2.;
1618 dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1619 // 7.5 cm is the lenght
cfce8870 1620 gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
fe4da5cc 1621
1622 //--- Define the third part of the (larger) rib between two sensitive parts
1623 // made of aluminum (the cooling tubes) (layer #3)
1624
1625 dtub[0] = .65 - dits[0];
1626 dtub[1] = 0.00134/2.;
1627 dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
1628 // 7.5 cm is the lenght
cfce8870 1629 gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
fe4da5cc 1630
1631 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1632 // (IDV2)
1633
1634 ypos = 0.;
1635 for (j = 1; j <= 5; ++j) {
1636 // odd element are up and even elements are down
1637 if (j == 1) {
1638 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1639 zpos = 0. - dits[2] + 1. - dits[2] * 2. - .1 - dits[2];
1640 } else if (j == 2) {
1641 xpos = -dbox2[0] + dits[0];
1642 zpos = 0. - dits[2] + 1. - dits[2];
1643 } else if (j == 3) {
1644 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1645 zpos = 0.;
1646 } else if (j == 4) {
1647 xpos = -dbox2[0] + dits[0];
1648 zpos = dits[2] + 0. - 1. + dits[2];
1649 } else if (j == 5) {
1650 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1651 zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
1652 }
cfce8870 1653 gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1654 }
1655
1656 // --- Place the larger ribs into their mother (IDV2)
1657
1658
1659 // --- Right ribs (just a matter of convention)
1660
1661 xpos = .65 - dbox2[0] + dits[0];
1662 zpos = 0.;
1663
1664 // --- Carbon
1665
1666 ypos = 2.81;
cfce8870 1667 gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1668
1669 // --- Aluminum #1
1670
1671 ypos = dsup[1] + 2.81 + dal1[1];
cfce8870 1672 gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1673
1674 // --- Kapton
1675
1676 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
cfce8870 1677 gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1678
1679 // --- Aluminum #2
1680
1681 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
cfce8870 1682 gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1683
1684 // --- Silicon (chip)
1685
1686 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
cfce8870 1687 gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1688
1689 // --- Water
1690
1691 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
cfce8870 1692 gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1693
1694 // --- Aluminum #3
1695
1696 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
cfce8870 1697 gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1698
1699 // --- Right ribs (just a matter of convention)
1700
1701 // --- Carbon
1702
1703 ypos = -2.81;
cfce8870 1704 gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1705
1706 // --- Aluminum #1
1707
1708 ypos = -(dsup[1] + 2.81 + dal1[1]);
cfce8870 1709 gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1710
1711 // --- Kapton
1712
1713 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
cfce8870 1714 gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1715
1716 // --- Aluminum #2
1717
1718 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
cfce8870 1719 gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1720
1721 // --- Silicon (chip)
1722
1723 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
cfce8870 1724 gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1725
1726 // --- Water
1727
1728 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
cfce8870 1729 gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1730
1731 // --- Aluminum #3
1732
1733 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
cfce8870 1734 gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1735
1736 // --- Place the end-ladder stuff into its mother (IDV1)
1737
1738
1739 // --- Negative-Z end-ladder
1740
1741 ypos = 0.;
1742 zpos = -(8.7*5.-2.*1.+2.*0.1)/2.-7.5;
1743
1744 // --- PCB
1745
1746 xpos = dbox2[0] - dpcb[0];
cfce8870 1747 gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1748
1749 // --- Copper
1750
1751 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
cfce8870 1752 gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1753
1754 // --- Ceramics
1755
1756 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 1757 gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1758
1759 // --- Silicon (bus)
1760
1761 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 1762 gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1763
1764 // --- Positive-Z end-ladder
1765
1766 //yos = 0.;
1767 zpos = (8.7*5.-2.*1.+2.*0.1)/2.+7.5;
1768
1769 // --- PCB
1770
1771 xpos = dbox2[0] - dpcb[0];
cfce8870 1772 gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1773
1774 // --- Copper
1775
1776 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
cfce8870 1777 gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1778
1779 // --- Ceramics
1780
1781 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 1782 gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1783
1784 // --- Silicon (bus)
1785
1786 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 1787 gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1788
1789 //--- Place the ghost volumes containing the drift ladders of layer #3 in their
1790 // mother volume (IT34)
1791 // Odd elements have large ribs and even elements have small ribs
1792
1793 for (i = 1; i <= 12; ++i) {
1794 atheta = (i-1) * 30.;
1795 AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
1796 if (i % 2 == 0) {
1797 rzero = 14.;
1798 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1799 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1800 zpos = 0.;
cfce8870 1801 gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
fe4da5cc 1802 } else {
1803 rzero = 13.85;
1804 xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
1805 ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
1806 zpos = 0.;
cfce8870 1807 gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
fe4da5cc 1808 }
1809 }
1810
1811
1812 // --- Layer #4
1813
1814 // GOTO 4567 ! skip ITS layer no. 4
1815
1816 //--- Define a ghost volume containing a single ladder of layer #4 (with the
1817 // smaller lenght of ribs) and fill it with air or vacuum
1818
1819 dbox1[0] = 0.5+(0.0172+0.03+0.0252+0.04+0.003);
1820 dbox1[1] = 3.5;
1821 // the widest element is the end-ladder stuff
1822 dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1823 // 7.5 cm is the lenght
cfce8870 1824 gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
fe4da5cc 1825
1826 // --- Make the ghost volume invisible
1827
cfce8870 1828 gMC->Gsatt("IDV3", "SEEN", 0);
fe4da5cc 1829
1830 // --- Define a volume containing the sensitive part of drifts
1831 // (silicon, layer #4)
1832
1833 dits[0] = .0172;
1834 // see material budget report by G. Feofilov
1835 dits[1] = 3.125;
1836 dits[2] = 4.35;
cfce8870 1837 gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
fe4da5cc 1838
1839 //--- Define the part of the (smaller) rib between two sensitive parts made of
1840 // carbon (layer #4)
1841
1842 dsup[0] = .5 - dits[0];
1843 dsup[1] = .01;
1844 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1845 // 7.5 cm is the lengh
cfce8870 1846 gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
fe4da5cc 1847
1848 //--- Define the first part of the (smaller) rib between two sensitive parts
1849 // made of aluminum (layer #4)
1850
1851 dal1[0] = .5 - dits[0];
1852 dal1[1] = 0.00096/2.;
1853 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1854 // 7.5 cm is the lengh
cfce8870 1855 gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
fe4da5cc 1856
1857 //--- Define the part of the (smaller) rib between two sensitive parts made of
1858 // kapton (layer #4)
1859
1860 dkap[0] = .5 - dits[0];
1861 dkap[1] = 0.0317/2.;
1862 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1863 // 7.5 cm is the lengh
cfce8870 1864 gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
fe4da5cc 1865
1866 //--- Define the second part of the (smaller) rib between two sensitive parts
1867 // made of aluminum (layer #4)
1868
1869 dal2[0] = .5 - dits[0];
1870 dal2[1] = 0.0027/2.;
1871 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1872 // 7.5 cm is the lengh
cfce8870 1873 gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
fe4da5cc 1874
1875 // --- Define the part of the (smaller) rib between two sensitive parts
1876 // made of silicon (the electronics) (layer #4)
1877
1878 dchi[0] = .5 - dits[0];
1879 dchi[1] = 0.0071/2.;
1880 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1881 // 7.5 cm is the lengh
cfce8870 1882 gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
fe4da5cc 1883
1884 // --- Define the part of the (smaller) rib between two sensitive parts
1885 // made of water (the cooler) (layer #4)
1886
1887 dwat[0] = .5 - dits[0];
1888 dwat[1] = 0.0093/2.;
1889 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1890 // 7.5 cm is the lenght
cfce8870 1891 gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
fe4da5cc 1892
1893 //--- Define the third part of the (smaller) rib between two sensitive parts
1894 // made of aluminum (the cooling tubes) (layer #4)
1895
1896 dtub[0] = .5 - dits[0];
1897 dtub[1] = 0.00134/2.;
1898 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
1899 // 7.5 cm is the lengh
cfce8870 1900 gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
fe4da5cc 1901
1902 // --- Define the part of the end-ladder stuff made of PCB (layer #4)
1903
1904 dpcb[0] = .03;
1905 // twice the foreseen thickness
1906 dpcb[1] = 3.5;
1907 dpcb[2] = 7.5;
cfce8870 1908 gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
fe4da5cc 1909
1910 // --- Define the part of the end-ladder stuff made of copper (layer #4)
1911
1912 dcop[0] = .0252;
1913 // twice the foreseen thickness
1914 dcop[1] = 3.5;
1915 dcop[2] = 7.5;
cfce8870 1916 gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
fe4da5cc 1917
1918 // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
1919
1920 dcer[0] = .04;
1921 // twice the foreseen thickness
1922 dcer[1] = 3.5;
1923 dcer[2] = 7.5;
cfce8870 1924 gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
fe4da5cc 1925
1926 // --- Define the part of the end-ladder stuff made of silicon (layer #4)
1927
1928 dsil[0] = .003;
1929 // twice the foreseen thickness
1930 dsil[1] = 3.5;
1931 dsil[2] = 7.5;
cfce8870 1932 gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
fe4da5cc 1933
1934 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
1935 // (IDV3)
1936
1937 ypos = 0.;
1938 for (j = 1; j <= 7; ++j) {
1939 // odd elements are down and even elements are up
1940 if (j == 1) {
1941 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1942 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
1943 } else if (j == 2) {
1944 xpos = -dbox1[0] + dits[0];
1945 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
1946 } else if (j == 3) {
1947 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1948 zpos = 0. - dits[2] + .7 - dits[2];
1949 } else if (j == 4) {
1950 xpos = -dbox1[0] + dits[0];
1951 zpos = 0.;
1952 } else if (j == 5) {
1953 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1954 zpos = dits[2] + 0. - .7 + dits[2];
1955 } else if (j == 6) {
1956 xpos = -dbox1[0] + dits[0];
1957 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
1958 } else if (j == 7) {
1959 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
1960 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
1961 }
cfce8870 1962 gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1963 }
1964
1965 // --- Place the smaller ribs into their mother (IDV3)
1966
1967 // --- Right ribs (just a matter of convention)
1968
1969 xpos = .5 - dbox1[0] + dits[0];
1970 zpos = 0.;
1971
1972 // --- Carbon
1973
1974 ypos = 2.81;
cfce8870 1975 gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1976
1977 // --- Aluminum #1
1978
1979 ypos = dsup[1] + 2.81 + dal1[1];
cfce8870 1980 gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1981
1982 // --- Kapton
1983
1984 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
cfce8870 1985 gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1986
1987 // --- Aluminum #2
1988
1989 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
cfce8870 1990 gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1991
1992 // --- Silicon (chip)
1993
1994 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
cfce8870 1995 gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 1996
1997 // --- Water
1998
1999 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
cfce8870 2000 gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2001
2002 // --- Aluminum #3
2003
2004 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2005 + dtub[1];
cfce8870 2006 gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2007
2008 // --- Right ribs (just a matter of convention)
2009
2010 // --- Carbon
2011
2012 ypos = -2.81;
cfce8870 2013 gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2014
2015 // --- Aluminum #1
2016
2017 ypos = -(dsup[1] + 2.81 + dal1[1]);
cfce8870 2018 gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2019
2020 // --- Kapton
2021
2022 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
cfce8870 2023 gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2024
2025 // --- Aluminum #2
2026
2027 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2028 2. + dal2[1]);
cfce8870 2029 gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2030
2031 // --- Silicon (chip)
2032
2033 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2034 2. + dal2[1] * 2. + dchi[1]);
cfce8870 2035 gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2036
2037 // --- Water
2038
2039 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2040 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
cfce8870 2041 gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2042
2043 // --- Aluminum #3
2044
2045 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2046 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] *
2047 2. + dtub[1]);
cfce8870 2048 gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2049
2050 // --- Place the end-ladder stuff into its mother (IDV1)
2051
2052
2053 // --- Negative-Z end-ladder
2054
2055 ypos = 0.;
2056 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2057
2058 // --- PCB
2059
2060 xpos = dbox1[0] - dpcb[0];
cfce8870 2061 gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2062
2063 // --- Copper
2064
2065 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
cfce8870 2066 gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2067
2068 // --- Ceramics
2069
2070 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 2071 gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2072
2073 // --- Silicon (bus)
2074
2075 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 2076 gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2077
2078 // --- Positive-Z end-ladder
2079
2080 ypos = 0.;
2081 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2082
2083 // --- PCB
2084
2085 xpos = dbox1[0] - dpcb[0];
cfce8870 2086 gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2087
2088 // --- Copper
2089
2090 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
cfce8870 2091 gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2092
2093 // --- Ceramics
2094
2095 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 2096 gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2097
2098 // --- Silicon (bus)
2099
2100 xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 2101 gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2102
2103 //--- Define a ghost volume containing a single ladder of layer #4 (with the
2104 // larger lenght of ribs) and fill it with air or vacuum
2105
2106 dbox2[0] = 0.65+(0.0172+0.03+0.0252+0.04+0.003);
2107 dbox2[1] = 3.5;
2108 // the widest element is the end-ladder stuff
2109 dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2110 // 7.5 cm is the lenght
cfce8870 2111 gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
fe4da5cc 2112
2113 // --- Make the ghost volume invisible
2114
cfce8870 2115 gMC->Gsatt("IDV4", "SEEN", 0);
fe4da5cc 2116
2117 //--- Define the part of the (larger) rib between two sensitive parts madeof
2118 // carbon (layer #4)
2119
2120 dsup[0] = .65 - dits[0];
2121 dsup[1] = .01;
2122 dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2123 // 7.5 cm is the lengh
cfce8870 2124 gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
fe4da5cc 2125
2126 //--- Define the first part of the (larger) rib between two sensitive parts
2127 // made of aluminum (layer #4)
2128
2129 dal1[0] = .65 - dits[0];
2130 dal1[1] = 0.00096/2.;
2131 dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2132 // 7.5 cm is the lengh
cfce8870 2133 gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
fe4da5cc 2134
2135 //--- Define the part of the (larger) rib between two sensitive parts madeof
2136 // kapton (layer #4)
2137
2138 dkap[0] = .65 - dits[0];
2139 dkap[1] = 0.0317/2.;
2140 dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2141 // 7.5 cm is the lengh
cfce8870 2142 gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
fe4da5cc 2143
2144 //--- Define the second part of the (larger) rib between two sensitive parts
2145 // made of aluminum (layer #4)
2146
2147 dal2[0] = .65 - dits[0];
2148 dal2[1] = 0.0027/2.;
2149 dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2150 // 7.5 cm is the lengh
cfce8870 2151 gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
fe4da5cc 2152
2153 // --- Define the part of the (larger) rib between two sensitive parts
2154 // made of silicon (the electronics) (layer #4)
2155
2156 dchi[0] = .65 - dits[0];
2157 dchi[1] = 0.0071/2.;
2158 dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2159 // 7.5 cm is the lengh
cfce8870 2160 gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
fe4da5cc 2161
2162 // --- Define the part of the (larger) rib between two sensitive parts
2163 // made of water (the cooler) (layer #4)
2164
2165 dwat[0] = .65 - dits[0];
2166 dwat[1] = 0.0093/2.;
2167 dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2168 // 7.5 cm is the lengh
cfce8870 2169 gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
fe4da5cc 2170
2171 //--- Define the third part of the (larger) rib between two sensitive parts
2172 // made of aluminum (the cooling tubes) (layer #4)
2173
2174 dtub[0] = .65 - dits[0];
2175 dtub[1] = 0.00134/2.;
2176 dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
2177 // 7.5 cm is the lengh
cfce8870 2178 gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
fe4da5cc 2179
2180 //--- Place the sensitive part of the drifts (smaller ribs) into its mother
2181 // (IDV4)
2182
2183 ypos = 0.;
2184 for (j = 1; j <= 7; ++j) {
2185 // odd elements are down and even elements are up
2186 if (j == 1) {
2187 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2188 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2] * 2. + 1.3 - dits[2];
2189 } else if (j == 2) {
2190 xpos = -dbox2[0] + dits[0];
2191 zpos = 0. - dits[2] + .7 - dits[2] * 2. + 0. - dits[2];
2192 } else if (j == 3) {
2193 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2194 zpos = 0. - dits[2] + .7 - dits[2];
2195 } else if (j == 4) {
2196 xpos = -dbox2[0] + dits[0];
2197 zpos = 0.;
2198 } else if (j == 5) {
2199 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2200 zpos = dits[2] + 0. - .7 + dits[2];
2201 } else if (j == 6) {
2202 xpos = -dbox2[0] + dits[0];
2203 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2];
2204 } else if (j == 7) {
2205 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
2206 zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
2207 }
cfce8870 2208 gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2209 }
2210
2211 // --- Place the larger ribs into their mother (IDV4)
2212
2213
2214 // --- Right ribs (just a matter of convention)
2215
2216 xpos = .65 - dbox2[0] + dits[0];
2217 zpos = 0.;
2218
2219 // --- Carbon
2220
2221 ypos = 2.81;
cfce8870 2222 gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2223
2224 // --- Aluminum #1
2225
2226 ypos = dsup[1] + 2.81 + dal1[1];
cfce8870 2227 gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2228
2229 // --- Kapton
2230
2231 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
cfce8870 2232 gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2233
2234 // --- Aluminum #2
2235
2236 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
cfce8870 2237 gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2238
2239 // --- Silicon (chip)
2240
2241 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
cfce8870 2242 gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2243
2244 // --- Water
2245
2246 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
cfce8870 2247 gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2248
2249 // --- Aluminum #3
2250
2251 ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2.
2252 + dtub[1];
cfce8870 2253 gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2254
2255 // --- Right ribs (just a matter of convention)
2256
2257 // --- Carbon
2258
2259 ypos = -2.81;
cfce8870 2260 gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2261
2262 // --- Aluminum #1
2263
2264 ypos = -(dsup[1] + 2.81 + dal1[1]);
cfce8870 2265 gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2266
2267 // --- Kapton
2268
2269 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
cfce8870 2270 gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2271
2272 // --- Aluminum #2
2273
2274 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2275 2. + dal2[1]);
cfce8870 2276 gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2277
2278 // --- Silicon (chip)
2279
2280 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2281 2. + dal2[1] * 2. + dchi[1]);
cfce8870 2282 gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2283
2284 // --- Water
2285
2286 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2287 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
cfce8870 2288 gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2289
2290 // --- Aluminum #3
2291
2292 ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] *
2293 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
cfce8870 2294 gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2295
2296 // --- Place the end-ladder stuff into its mother (IDV1)
2297
2298
2299 // --- Negative-Z end-ladder
2300
2301 ypos = 0.;
2302 zpos = -(8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2303
2304 // --- PCB
2305
2306 xpos = dbox2[0] - dpcb[0];
cfce8870 2307 gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2308
2309 // --- Copper
2310
2311 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
cfce8870 2312 gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2313
2314 // --- Ceramics
2315
2316 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 2317 gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2318
2319 // --- Silicon (bus)
2320
2321 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 2322 gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2323
2324 // --- Positive-Z end-ladder
2325
2326 //yos = 0.;
2327 zpos = (8.7*7.-2.*0.7-2.*1.3)/2.-7.5;
2328
2329 // --- PCB
2330
2331 xpos = dbox2[0] - dpcb[0];
cfce8870 2332 gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2333
2334 // --- Copper
2335
2336 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
cfce8870 2337 gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2338
2339 // --- Ceramics
2340
2341 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
cfce8870 2342 gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2343
2344 // --- Silicon (bus)
2345
2346 xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
cfce8870 2347 gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2348
2349 //--- Place the ghost volumes containing the drift ladders of layer #4 in their
2350 // mother volume (IT34)
2351 // Odd elements have large ribs and even elements have small ribs
2352
2353 for (i = 1; i <= 24; ++i) {
2354 atheta = (i-1) * 15.;
2355 AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
2356 if (i % 2 == 0) {
2357 rzero = 23.5;
2358 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2359 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2360 zpos = 0.;
cfce8870 2361 gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
fe4da5cc 2362 } else {
2363 rzero = (24.0+22.8)/2.;
2364 xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
2365 ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
2366 zpos = 0.;
cfce8870 2367 gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
fe4da5cc 2368 }
2369 }
2370
2371 //************************************************************************
2372 //* *
2373 //* S T R I P S *
2374 //* =========== *
2375 //* *
2376 //************************************************************************
2377
2378 // --- Define SSD with the 35+39 lay-out
2379
58005f18 2380 if (fMinorVersionV3 < 3) {
fe4da5cc 2381
2382 //--- Define ghost volume containing the Strip Detectors and fill it with air
2383 // or vacuum
2384
2385 xxm = (49.999-3.)/(70.-25.);
2386 dgh[0] = 0.;
2387 dgh[1] = 360.;
2388 dgh[2] = 4.;
2389 dgh[3] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2390 (37.-27)/xxm-(49.998-37.)/xxm;
2391 dgh[4] = 49.998;
2392 dgh[5] = 49.998;
2393 dgh[6] = -25.-(9.-3.01)/xxm-(9.01-9.)/xxm-(27.-9.01)/xxm-
2394 (37.-27)/xxm;
2395 dgh[7] = 37.;
2396 dgh[8] = 49.998;
2397 dgh[9] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2398 (37.-27)/xxm;
2399 dgh[10] = 37.;
2400 dgh[11] = 49.998;
2401 dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm+
2402 (37.-27)/xxm+(49.998-37.)/xxm;
2403 dgh[13] = 49.998;
2404 dgh[14] = 49.998;
cfce8870 2405 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2406 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2407 gMC->Gsatt("IT56", "SEEN", 0);
fe4da5cc 2408
2409 // --- Layer #5
2410
2411 // GOTO 5678 ! skip ITS layer no. 5
2412
2413 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2414 // it with air or vacuum
2415
2416 dbox1[0] = (0.0600+2.*0.0150)/2.;
2417 dbox1[1] = 3.75;
2418 dbox1[2] = 90.22/2.;
cfce8870 2419 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
fe4da5cc 2420
2421 // --- Make the ghost volume invisible
2422
cfce8870 2423 gMC->Gsatt("ISV1", "SEEN", 0);
fe4da5cc 2424
2425 // --- Define a ghost volume containing the electronics and cooling of
2426 // a single ladder of layer #5 and fill it with air or vacuum
2427
2428 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2429 dsrv[1] = 3.75;
2430 dsrv[2] = 90.22/2.;
cfce8870 2431 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
fe4da5cc 2432
2433 // --- Make the ghost volume invisible
2434
cfce8870 2435 gMC->Gsatt("SSV1", "SEEN", 0);
fe4da5cc 2436
2437 // --- Define a ghost volume containing the end-ladder stuff of
2438 // a single ladder of layer #5 and fill it with air or vacuum
2439
2440 dela[0] = 2.;
2441 dela[1] = 3.5;
2442 dela[2] = 4.;
cfce8870 2443 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
fe4da5cc 2444
2445 // --- Make the ghost volume invisible
2446
cfce8870 2447 gMC->Gsatt("ELL5", "SEEN", 0);
fe4da5cc 2448
2449 // --- Define a volume containing the sensitive part of the strips
2450 // (silicon, layer #5)
2451
2452 dits[0] = .015;
2453 dits[1] = 3.75;
2454 dits[2] = 2.1;
cfce8870 2455 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
fe4da5cc 2456
2457 // --- Define a volume containing the electronics of the strips
2458 // (silicon, layer #5)
2459
2460 dchi[0] = .02;
2461 dchi[1] = 3.4;
2462 dchi[2] = .525;
cfce8870 2463 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
fe4da5cc 2464
2465 // --- Define the cooling tubes (aluminum, layer #5)
2466
2467 dtub[0] = .09;
2468 dtub[1] = dtub[0] + .01;
2469 dtub[2] = 90.22/2.;
cfce8870 2470 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
fe4da5cc 2471
2472 // --- Define the cooling fluid (water or freon, layer #5)
2473
2474 dwat[0] = 0.;
2475 dwat[1] = .09;
2476 dwat[2] = 90.22/2.;
cfce8870 2477 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
fe4da5cc 2478 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2479
2480 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
2481
2482 // water
2483 dfra[0] = 120.;
2484 dfra[1] = 360.;
2485 dfra[2] = 3.;
2486 dfra[3] = 2.;
2487 dfra[4] = -.015;
2488 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2489 dfra[6] = dfra[5] + .03;
2490 dfra[7] = .015;
2491 dfra[8] = dfra[5];
2492 dfra[9] = dfra[6];
cfce8870 2493 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
fe4da5cc 2494
2495 // --- Define the element connecting the triangles of the heat bridge
2496 // (carbon, layer #5)
2497
2498 dcei[0] = 0.;
2499 dcei[1] = .03;
2500 dcei[2] = 90.22/2.;
cfce8870 2501 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
fe4da5cc 2502
2503 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2504 // (layer #5)
2505
2506 dpla[0] = (10./(8.*7.))/2.;
2507 dpla[1] = 3.5;
2508 dpla[2] = 4.;
cfce8870 2509 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
fe4da5cc 2510
2511 // --- Define the part of the end-ladder stuff made of copper (layer #5)
2512
2513 dcop[0] = (2./(8.*7.))/2.;
2514 dcop[1] = 3.5;
2515 dcop[2] = 4.;
cfce8870 2516 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
fe4da5cc 2517
2518 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
2519
2520 depx[0] = (30./(8.*7.))/2.;
2521 depx[1] = 3.5;
2522 depx[2] = 4.;
cfce8870 2523 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
fe4da5cc 2524
2525 // --- Define the part of the end-ladder stuff made of silicon (bus)
2526 // (layer #5)
2527
2528 dsil[0] = (20./(8.*7.))/2.;
2529 dsil[1] = 3.5;
2530 dsil[2] = 4.;
cfce8870 2531 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
fe4da5cc 2532
2533 // --- Place the end-ladder stuff into its mother (ELL5)
2534
2535 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2536 ypos = 0.;
2537 zpos = 0.;
2538
2539 // --- Plastic
2540
2541 xpos = -dela[0] + dpla[0];
cfce8870 2542 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2543
2544 // --- Copper
2545
2546 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
cfce8870 2547 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2548
2549 // --- Epoxy
2550
2551 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
cfce8870 2552 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2553
2554 // --- Silicon (bus)
2555
2556 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
cfce8870 2557 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2558
2559 // --- Place the sensitive part of the strips into its mother (ISV1)
2560
2561 ypos = 0.;
2562 for (j = 1; j <= 23; ++j) {
2563 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
2564 else xpos = -dbox1[0] + dits[0];
2565 zpos = ((j - 1) - 11.) * 3.91;
cfce8870 2566 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2567 }
2568
2569 // --- Place the electronics of the strips into its mother (SSV1)
2570
2571 ypos = 0.;
2572 for (j = 1; j <= 23; ++j) {
2573 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2574 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2575 zpos = ((j - 1) - 11.) * 3.91 + .85;
cfce8870 2576 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2577 }
2578
2579 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2580
2581 xpos = -dsrv[0] + .41;
2582 zpos = 0.;
2583
2584 // --- Left tube (just a matter of convention)
2585
2586 ypos = -2.25-0.1;
cfce8870 2587 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2588 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2589
2590 // --- Right tube (just a matter of convention)
2591
2592 ypos = 2.25+0.1;
cfce8870 2593 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
2594 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2595
2596 // --- Place the heat bridge elements into their mother (SSV1)
2597
2598 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2599 ypos = 0.;
2600 for (j = 1; j <= 24; ++j) {
2601 zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
cfce8870 2602 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2603 }
2604
2605 // --- Place the elements connecting the triangles of the heat bridge
2606 // into their mother (SSV1)
2607
2608 zpos = 0.;
2609
2610 // --- Left element (just a matter of convention)
2611
2612 xpos = -dsrv[0] + .47;
2613 ypos = -(2.1+0.015);
cfce8870 2614 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2615
2616 // --- Right element
2617
2618 xpos = -dsrv[0] + .47;
2619 ypos = 2.1+0.015;
cfce8870 2620 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2621
2622 // --- Top element
2623
2624 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2625 ypos = 0.;
cfce8870 2626 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2627
2628 // --- Place the ghost volumes containing the strip ladders (ISV1),
2629 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
2630 // their mother volume (IT56)
2631
2632 offset1 = TMath::ATan2(.9, 40.);
2633 offset2 = 5.2;
2634 rzero = dbox1[0] + 40.;
2635 runo = dbox1[0] * 2. + 40. + dsrv[0];
2636 rtwo = dbox1[0] * 2. + 40. + dela[0];
2637 for (i = 1; i <= 35; ++i) {
2638 atheta = (i-1) * twopi * raddeg / 35. + offset2;
2639 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
2640
2641 // --- Strip ladders
2642
2643 xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
2644 ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
2645 zpos = 0.;
cfce8870 2646 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 2647
2648 // --- Electronics/cooling
2649
2650 xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
2651 ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
2652 zpos = 0.;
cfce8870 2653 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 2654
2655 // --- End-ladders (nagative-Z and positive-Z)
2656
2657 xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
2658 ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
2659 zpos = -(dbox1[2] + dela[2] + 6.);
cfce8870 2660 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 2661 zpos = dbox1[2] + dela[2] + 6.;
cfce8870 2662 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 2663 }
2664
2665
2666 // --- Layer #6
2667
2668 // GOTO 5778 ! skip ITS layer no. 6
2669
2670 //--- Define a ghost volume containing a single ladder of layer #6 andfill
2671 // it with air or vacuum
2672
2673 dbox2[0] = (0.0600+2.*0.0150)/2.;
2674 dbox2[1] = 3.75;
2675 dbox2[2] = 101.95/2.;
cfce8870 2676 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
fe4da5cc 2677
2678 // --- Make the ghost volume invisible
2679
cfce8870 2680 gMC->Gsatt("ISV2", "SEEN", 0);
fe4da5cc 2681
2682 // --- Define a ghost volume containing the electronics and cooling of
2683 // a single ladder of layer #6 and fill it with air or vacuum
2684
2685 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2686 dsrv[1] = 3.75;
2687 dsrv[2] = 101.95/2.;
cfce8870 2688 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
fe4da5cc 2689
2690 // --- Make the ghost volume invisible
2691
cfce8870 2692 gMC->Gsatt("SSV2", "SEEN", 0);
fe4da5cc 2693
2694 // --- Define a ghost volume containing the end-ladder stuff of
2695 // a single ladder of layer #6 and fill it with air or vacuum
2696
2697 dela[0] = 2.;
2698 dela[1] = 3.5;
2699 dela[2] = 4.;
cfce8870 2700 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
fe4da5cc 2701
2702 // --- Make the ghost volume invisible
2703
cfce8870 2704 gMC->Gsatt("ELL6", "SEEN", 0);
fe4da5cc 2705
2706 // --- Define a volume containing the sensitive part of the strips
2707 // (silicon, layer #6)
2708
2709 dits[0] = .015;
2710 dits[1] = 3.75;
2711 dits[2] = 2.1;
cfce8870 2712 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
fe4da5cc 2713
2714 // --- Define a volume containing the electronics of the strips
2715 // (silicon, layer #6)
2716
2717 dchi[0] = .02;
2718 dchi[1] = 3.4;
2719 dchi[2] = .525;
cfce8870 2720 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
fe4da5cc 2721
2722 // --- Define the cooling tubes (aluminum, layer #6)
2723
2724 dtub[0] = .09;
2725 dtub[1] = dtub[0] + .01;
2726 dtub[2] = 101.95/2.;
cfce8870 2727 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
fe4da5cc 2728
2729 // --- Define the cooling fluid (water or freon, layer #6)
2730
2731 dwat[0] = 0.;
2732 dwat[1] = .09;
2733 dwat[2] = 101.95/2.;
cfce8870 2734 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
fe4da5cc 2735 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
2736
2737 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
2738
2739 // water
2740 dfra[0] = 120.;
2741 dfra[1] = 360.;
2742 dfra[2] = 3.;
2743 dfra[3] = 2.;
2744 dfra[4] = -.015;
2745 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
2746 dfra[6] = dfra[5] + .03;
2747 dfra[7] = .015;
2748 dfra[8] = dfra[5];
2749 dfra[9] = dfra[6];
cfce8870 2750 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
fe4da5cc 2751
2752 // --- Define the element connecting the triangles of the heat bridge
2753 // (carbon, layer #6)
2754
2755 dcei[0] = 0.;
2756 dcei[1] = .03;
2757 dcei[2] = 101.95/2.;
cfce8870 2758 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
fe4da5cc 2759
2760 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
2761 // (layer #6)
2762
2763 dpla[0] = (10./(8.*7.))/2.;
2764 dpla[1] = 3.5;
2765 dpla[2] = 4.;
cfce8870 2766 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
fe4da5cc 2767
2768 // --- Define the part of the end-ladder stuff made of copper (layer #6)
2769
2770 dcop[0] = (2./(8.*7.))/2.;
2771 dcop[1] = 3.5;
2772 dcop[2] = 4.;
cfce8870 2773 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
fe4da5cc 2774
2775 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
2776
2777 depx[0] = (30./(8.*7.))/2.;
2778 depx[1] = 3.5;
2779 depx[2] = 4.;
cfce8870 2780 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
fe4da5cc 2781
2782 // --- Define the part of the end-ladder stuff made of silicon (bus)
2783 // (layer #6)
2784
2785 dsil[0] = (20./(8.*7.))/2.;
2786 dsil[1] = 3.5;
2787 dsil[2] = 4.;
cfce8870 2788 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
fe4da5cc 2789
2790 // --- Place the end-ladder stuff into its mother (ELL5)
2791
2792 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
2793 ypos = 0.;
2794 zpos = 0.;
2795
2796 // --- Plastic
2797
2798 xpos = -dela[0] + dpla[0];
cfce8870 2799 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2800
2801 // --- Copper
2802
2803 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
cfce8870 2804 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2805
2806 // --- Epoxy
2807
2808 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
cfce8870 2809 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2810
2811 // --- Silicon (bus)
2812
2813 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
cfce8870 2814 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2815
2816 // --- Place the sensitive part of the strips into its mother (ISV2)
2817
2818 ypos = 0.;
2819 for (j = 1; j <= 26; ++j) {
2820 if (j % 2 == 0) xpos = dbox2[0] - dits[0];
2821 else xpos = -dbox2[0] + dits[0];
2822 zpos = ((j - 1) - 12.) * 3.91 - 1.96;
cfce8870 2823 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2824 }
2825
2826 // --- Place the electronics of the strips into its mother (SSV2)
2827
2828 ypos = 0.;
2829 for (j = 1; j <= 26; ++j) {
2830 if (j % 2 == 0) xpos = -dsrv[0] + .28;
2831 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
2832 zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
cfce8870 2833 gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2834 }
2835
2836 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
2837
2838 xpos = -dsrv[0] + .41;
2839 zpos = 0.;
2840
2841 // --- Left tube (just a matter of convention)
2842
2843 ypos = -2.25-0.1;
cfce8870 2844 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2845 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2846
2847 // --- Right tube (just a matter of convention)
2848
2849 ypos = 2.25+0.;
cfce8870 2850 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
2851 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2852
2853 // --- Place the heat bridge elements into their mother (SSV2)
2854
2855 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
2856 ypos = 0.;
2857 for (j = 1; j <= 27; ++j) {
2858 zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
cfce8870 2859 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2860 }
2861
2862 // --- Place the elements connecting the triangles of the heat bridge
2863 // into their mother (SSV2)
2864
2865 zpos = 0.;
2866
2867 // --- Left element (just a matter of convention)
2868
2869 xpos = -dsrv[0] + .47;
2870 ypos = -(2.1+0.015);
cfce8870 2871 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2872
2873 // --- Right element
2874
2875 xpos = -dsrv[0] + .47;
2876 ypos = 2.1+0.015;
cfce8870 2877 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2878
2879 // --- Top element
2880
2881 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
2882 ypos = 0.;
cfce8870 2883 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 2884
2885 // --- Place the ghost volumes containing the strip ladders (ISV2),
2886 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
2887 // their mother volume (IT56)
2888
2889 offset1 = TMath::ATan2(1., 45.);
2890 offset2 = 5.2;
2891 rzero = dbox2[0] + 45.;
2892 runo = dbox2[0] * 2. + 45. + dsrv[0];
2893 rtwo = dbox2[0] * 2. + 45. + dela[0];
2894 for (i = 1; i <= 39; ++i) {
2895 atheta = (i-1) * twopi * raddeg / 39. + offset2;
2896 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
2897
2898 // --- Strip ladders
2899
2900 xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
2901 ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
2902 zpos = 0.;
cfce8870 2903 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 2904
2905 // --- Electronics/cooling
2906
2907 xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
2908 ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
2909 zpos = 0.;
cfce8870 2910 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 2911
2912 // --- End-ladders (nagative-Z and positive-Z)
2913
2914 xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
2915 ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
2916 zpos = -(dbox2[2] + dela[2] + 6.);
cfce8870 2917 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 2918 zpos = dbox2[2] + dela[2] + 6.;
cfce8870 2919 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 2920 }
2921 //#ifdef NEVER
2922 }
2923
2924 // --- Define SSD with the 32+36 lay-out
2925
58005f18 2926 if (fMinorVersionV3 >2 && fMinorVersionV3 < 6) {
fe4da5cc 2927
2928 //--- Define ghost volume containing the Strip Detectors and fill it with air
2929 // or vacuum
2930
2931 xxm = (49.999-3.)/(70.-25.);
2932 dgh[0] = 0.;
2933 dgh[1] = 360.;
2934 dgh[2] = 4.;
2935 dgh[3] = -25. - (9.-3.01) / xxm - (9.01-9.) / xxm -
2936 (27.-9.01) / xxm - (36.-27.) / xxm - (49.998-36.) / xxm;
2937 dgh[4] = 49.998;
2938 dgh[5] = 49.998;
2939 dgh[6] = -25. - (9.-3.01) / xxm -
2940 (9.01-9.) / xxm - (27.-9.01) / xxm - (36.-27.) / xxm;
2941 dgh[7] = 36.;
2942 dgh[8] = 49.998;
2943 dgh[9] = (9.-3.01) / xxm + 25. +
2944 (9.01-9.) / xxm + (27.-9.01) / xxm + (36.-27.) / xxm;
2945 dgh[10] = 36.;
2946 dgh[11] = 49.998;
2947 dgh[12] = (9.-3.01) / xxm + 25. + (9.01-9.) / xxm +
2948 (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
2949 dgh[13] = 49.998;
2950 dgh[14] = 49.998;
cfce8870 2951 gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
2952 gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
2953 gMC->Gsatt("IT56", "SEEN", 0);
fe4da5cc 2954
2955 // --- Layer #5
2956
2957 // GOTO 6678 ! skip ITS layer no. 5
2958
2959 //--- Define a ghost volume containing a single ladder of layer #5 andfill
2960 // it with air or vacuum
2961
2962 dbox1[0] = (0.0600+2.*0.0150)/2.;
2963 dbox1[1] = 3.75;
2964 dbox1[2] = 86.31/2.;
cfce8870 2965 gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
fe4da5cc 2966
2967 // --- Make the ghost volume invisible
2968
cfce8870 2969 gMC->Gsatt("ISV1", "SEEN", 0);
fe4da5cc 2970
2971 // --- Define a ghost volume containing the electronics and cooling of
2972 // a single ladder of layer #5 and fill it with air or vacuum
2973
2974 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
2975 dsrv[1] = 3.75;
2976 dsrv[2] = 86.31/2.;
cfce8870 2977 gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
fe4da5cc 2978
2979 // --- Make the ghost volume invisible
2980
cfce8870 2981 gMC->Gsatt("SSV1", "SEEN", 0);
fe4da5cc 2982
2983 // --- Define a ghost volume containing the end-ladder stuff of
2984 // a single ladder of layer #5 and fill it with air or vacuum
2985
2986 dela[0] = 2.;
2987 dela[1] = 3.5;
2988 dela[2] = 4.;
cfce8870 2989 gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
fe4da5cc 2990
2991 // --- Make the ghost volume invisible
2992
cfce8870 2993 gMC->Gsatt("ELL5", "SEEN", 0);
fe4da5cc 2994
2995 // --- Define a volume containing the sensitive part of the strips
2996 // (silicon, layer #5)
2997
2998 dits[0] = .015;
2999 dits[1] = 3.75;
3000 dits[2] = 2.1;
cfce8870 3001 gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
fe4da5cc 3002
3003 // --- Define a volume containing the electronics of the strips
3004 // (silicon, layer #5)
3005
3006 dchi[0] = .02;
3007 dchi[1] = 3.4;
3008 dchi[2] = .525;
cfce8870 3009 gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
fe4da5cc 3010
3011 // --- Define the cooling tubes (aluminum, layer #5)
3012
3013 dtub[0] = .09;
3014 dtub[1] = dtub[0] + .01;
3015 dtub[2] = 86.31/2.;
cfce8870 3016 gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
fe4da5cc 3017
3018 // --- Define the cooling fluid (water or freon, layer #5)
3019
3020 dwat[0] = 0.;
3021 dwat[1] = .09;
3022 dwat[2] = 86.31/2.;
cfce8870 3023 gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
fe4da5cc 3024 // CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3025
3026 //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
3027
3028 // water
3029 dfra[0] = 120.;
3030 dfra[1] = 360.;
3031 dfra[2] = 3.;
3032 dfra[3] = 2.;
3033 dfra[4] = -.015;
3034 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3035 dfra[6] = dfra[5] + .03;
3036 dfra[7] = .015;
3037 dfra[8] = dfra[5];
3038 dfra[9] = dfra[6];
cfce8870 3039 gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
fe4da5cc 3040
3041 // --- Define the element connecting the triangles of the heat bridge
3042 // (carbon, layer #5)
3043
3044 dcei[0] = 0.;
3045 dcei[1] = .03;
3046 dcei[2] = 86.31/2.;
cfce8870 3047 gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
fe4da5cc 3048
3049 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3050 // (layer #5)
3051
3052 dpla[0] = (10./(8.*7.))/2;
3053 dpla[1] = 3.5;
3054 dpla[2] = 4.;
cfce8870 3055 gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
fe4da5cc 3056
3057 // --- Define the part of the end-ladder stuff made of copper (layer #5)
3058
3059 dcop[0] = (2./(8.*7.))/2;
3060 dcop[1] = 3.5;
3061 dcop[2] = 4.;
cfce8870 3062 gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
fe4da5cc 3063
3064 // --- Define the part of the end-ladder stuff made of epoxy (layer #5)
3065
3066 depx[0] = (30./(8.*7.))/2.;
3067 depx[1] = 3.5;
3068 depx[2] = 4.;
cfce8870 3069 gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
fe4da5cc 3070
3071 // --- Define the part of the end-ladder stuff made of silicon (bus)
3072 // (layer #5)
3073
3074 dsil[0] = (20./(8.*7.))/2.;
3075 dsil[1] = 3.5;
3076 dsil[2] = 4.;
cfce8870 3077 gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
fe4da5cc 3078
3079 // --- Place the end-ladder stuff into its mother (ELL5)
3080
3081 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3082 ypos = 0.;
3083 zpos = 0.;
3084
3085 // --- Plastic
3086
3087 xpos = -dela[0] + dpla[0];
cfce8870 3088 gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3089
3090 // --- Copper
3091
3092 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
cfce8870 3093 gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3094
3095 // --- Epoxy
3096
3097 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
cfce8870 3098 gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3099
3100 // --- Silicon (bus)
3101
3102 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
cfce8870 3103 gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3104
3105 // --- Place the sensitive part of the strips into its mother (ISV1)
3106
3107 ypos = 0.;
3108 for (j = 1; j <= 22; ++j) {
3109 if (j % 2 == 0) xpos = dbox1[0] - dits[0];
3110 else xpos = -dbox1[0] + dits[0];
3111 zpos = ((j - 1) - 10.) * 3.91 - 1.96;
cfce8870 3112 gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3113 }
3114
3115 // --- Place the electronics of the strips into its mother (SSV1)
3116
3117 ypos = 0.;
3118 for (j = 1; j <= 22; ++j) {
3119 if (j % 2 == 0) xpos = -dsrv[0] + .28;
3120 else xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3121 zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
cfce8870 3122 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3123 }
3124
3125 //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
3126
3127 xpos = -dsrv[0] + .41;
3128 zpos = 0.;
3129
3130 // --- Left tube (just a matter of convention)
3131
3132 ypos = -(2.25+0.1);
cfce8870 3133 gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3134 gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3135
3136 // --- Right tube (just a matter of convention)
3137
3138 ypos = (2.25+0.1);
cfce8870 3139 gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
3140 gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3141
3142 // --- Place the heat bridge elements into their mother (SSV1)
3143
3144 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3145 ypos = 0.;
3146 for (j = 1; j <= 23; ++j) {
3147 zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
cfce8870 3148 gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3149 }
3150
3151 // --- Place the elements connecting the triangles of the heat bridge
3152 // into their mother (SSV1)
3153
3154 zpos = 0.;
3155
3156 // --- Left element (just a matter of convention)
3157
3158 xpos = -dsrv[0] + .47;
3159 ypos = -(2.1+0.015);
cfce8870 3160 gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3161
3162 // --- Right element
3163
3164 xpos = -dsrv[0] + .47;
3165 ypos = (2.1+0.015);
cfce8870 3166 gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3167
3168 // --- Top element
3169
3170 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3171 ypos = 0.;
cfce8870 3172 gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3173
3174 // --- Place the ghost volumes containing the strip ladders (ISV1),
3175 // electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
3176 // their mother volume (IT56)
3177
3178 offset1 = TMath::ATan2(.8, 36.6);
3179 offset2 = 5.2;
3180 rzero = dbox1[0] + 36.6;
3181 runo = dbox1[0] * 2. + 36.6 + dsrv[0];
3182 rtwo = dbox1[0] * 2. + 36.6 + dela[0];
3183 for (i = 1; i <= 32; ++i) {
3184 atheta = (i-1) * twopi * raddeg / 32. + offset2;
3185 AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
3186
3187 // --- Strip ladders
3188
3189 xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
3190 ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
3191 zpos = 0.;
cfce8870 3192 gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 3193
3194 // --- Electronics/cooling
3195
3196 xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
3197 ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
3198 zpos = 0.;
cfce8870 3199 gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 3200
3201 // --- End-ladders (nagative-Z and positive-Z)
3202
3203 xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
3204 ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
3205 zpos = -(dbox1[2] + dela[2] + 6.);
cfce8870 3206 gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 3207 zpos = dbox1[2] + dela[2] + 6.;
cfce8870 3208 gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
fe4da5cc 3209 }
3210
3211
3212 // --- Layer #6
3213
3214 // GOTO 6778 ! skip ITS layer no. 6
3215
3216 //--- Define a ghost volume containing a single ladder of layer #6 andfill
3217 // it with air or vacuum
3218
3219 dbox2[0] = (0.0600+2.*0.0150)/2.;
3220 dbox2[1] = 3.75;
3221 dbox2[2] = 94.13/2.;
cfce8870 3222 gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
fe4da5cc 3223
3224 // --- Make the ghost volume invisible
3225
cfce8870 3226 gMC->Gsatt("ISV2", "SEEN", 0);
fe4da5cc 3227
3228 // --- Define a ghost volume containing the electronics and cooling of
3229 // a single ladder of layer #6 and fill it with air or vacuum
3230
3231 dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
3232 dsrv[1] = 3.75;
3233 dsrv[2] = 94.13/2.;
cfce8870 3234 gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
fe4da5cc 3235
3236 // --- Make the ghost volume invisible
3237
cfce8870 3238 gMC->Gsatt("SSV2", "SEEN", 0);
fe4da5cc 3239
3240 // --- Define a ghost volume containing the end-ladder stuff of
3241 // a single ladder of layer #6 and fill it with air or vacuum
3242
3243 dela[0] = 2.;
3244 dela[1] = 3.5;
3245 dela[2] = 4.;
cfce8870 3246 gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
fe4da5cc 3247
3248 // --- Make the ghost volume invisible
3249
cfce8870 3250 gMC->Gsatt("ELL6", "SEEN", 0);
fe4da5cc 3251
3252 // --- Define a volume containing the sensitive part of the strips
3253 // (silicon, layer #6)
3254
3255 dits[0] = .015;
3256 dits[1] = 3.75;
3257 dits[2] = 2.1;
cfce8870 3258 gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
fe4da5cc 3259
3260 // --- Define a volume containing the electronics of the strips
3261 // (silicon, layer #6)
3262
3263 dchi[0] = .02;
3264 dchi[1] = 3.4;
3265 dchi[2] = .525;
cfce8870 3266 gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
fe4da5cc 3267
3268 // --- Define the cooling tubes (aluminum, layer #6)
3269
3270 dtub[0] = .09;
3271 dtub[1] = dtub[0] + .01;
3272 dtub[2] = 94.13/2.;
cfce8870 3273 gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
fe4da5cc 3274
3275 // --- Define the cooling fluid (water or freon, layer #6)
3276
3277 dwat[0] = 0.;
3278 dwat[1] = .09;
3279 dwat[2] = 94.13/2.;
cfce8870 3280 gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
fe4da5cc 3281 // CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT) ! freon
3282
3283 //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
3284
3285 // water
3286 dfra[0] = 120.;
3287 dfra[1] = 360.;
3288 dfra[2] = 3.;
3289 dfra[3] = 2.;
3290 dfra[4] = -.015;
3291 dfra[5] = TMath::Sqrt(3.) * 4.2 / 6.;
3292 dfra[6] = dfra[5] + .03;
3293 dfra[7] = .015;
3294 dfra[8] = dfra[5];
3295 dfra[9] = dfra[6];
cfce8870 3296 gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
fe4da5cc 3297
3298 // --- Define the element connecting the triangles of the heat bridge
3299 // (carbon, layer #6)
3300
3301 dcei[0] = 0.;
3302 dcei[1] = .03;
3303 dcei[2] = 94.13/2.;
cfce8870 3304 gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
fe4da5cc 3305
3306 // --- Define the part of the end-ladder stuff made of plastic (G10FR4)
3307 // (layer #6)
3308
3309 dpla[0] = (10./(8.*7.))/2;
3310 dpla[1] = 3.5;
3311 dpla[2] = 4.;
cfce8870 3312 gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
fe4da5cc 3313
3314 // --- Define the part of the end-ladder stuff made of copper (layer #6)
3315
3316 dcop[0] = (2./(8.*7.))/2;
3317 dcop[1] = 3.5;
3318 dcop[2] = 4.;
cfce8870 3319 gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
fe4da5cc 3320
3321 // --- Define the part of the end-ladder stuff made of epoxy (layer #6)
3322
3323 depx[0] = (30./(8.*7.))/2.;
3324 depx[1] = 3.5;
3325 depx[2] = 4.;
cfce8870 3326 gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
fe4da5cc 3327
3328 // --- Define the part of the end-ladder stuff made of silicon (bus)
3329 // (layer #6)
3330
3331 dsil[0] = (20./(8.*7.))/2.;
3332 dsil[1] = 3.5;
3333 dsil[2] = 4.;
cfce8870 3334 gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
fe4da5cc 3335
3336 // --- Place the end-ladder stuff into its mother (ELL5)
3337
3338 sep = (4. - (dpla[0] + dcop[0] + depx[0] + dsil[0]) * 2.) / 3.;
3339 ypos = 0.;
3340 zpos = 0.;
3341
3342 // --- Plastic
3343
3344 xpos = -dela[0] + dpla[0];
cfce8870 3345 gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3346
3347 // --- Copper
3348
3349 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
cfce8870 3350 gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3351
3352 // --- Epoxy
3353
3354 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
cfce8870 3355 gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3356
3357 // --- Silicon (bus)
3358
3359 xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
cfce8870 3360 gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3361
3362 // --- Place the sensitive part of the strips into its mother (ISV2)
3363
3364 ypos = 0.;
3365 for (j = 1; j <= 24; ++j) {
3366 if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
3367 else xpos = dbox2[0] - dits[0];
3368 zpos = ((j - 1) - 11.) * 3.91 - 1.96;
cfce8870 3369 gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3370 }
3371
3372 // --- Place the electronics of the strips into its mother (SSV2)
3373
3374 ypos = 0.;
3375 for (j = 1; j <= 24; ++j) {
3376 if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
3377 else xpos = -dsrv[0] + .28;
3378 zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
cfce8870 3379 gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3380 }
3381
3382 //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
3383
3384 xpos = -dsrv[0] + .41;
3385 zpos = 0.;
3386
3387 // --- Left tube (just a matter of convention)
3388
3389 ypos = -(2.25+0.1);
cfce8870 3390 gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3391 gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3392
3393 // --- Right tube (just a matter of convention)
3394
3395 ypos = (2.25+0.1);
cfce8870 3396 gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
3397 gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3398
3399 // --- Place the heat bridge elements into their mother (SSV2)
3400
3401 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
3402 ypos = 0.;
3403 for (j = 1; j <= 25; ++j) {
3404 zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
cfce8870 3405 gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3406 }
3407
3408 // --- Place the elements connecting the triangles of the heat bridge
3409 // into their mother (SSV2)
3410
3411 zpos = 0.;
3412
3413 // --- Left element (just a matter of convention)
3414
3415 xpos = -dsrv[0] + .47;
3416 ypos = -(2.1+0.015);
cfce8870 3417 gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3418
3419 // --- Right element
3420
3421 xpos = -dsrv[0] + .47;
3422 ypos = (2.1+0.015);
cfce8870 3423 gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3424
3425 // --- Top element
3426
3427 xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
3428 ypos = 0.;
cfce8870 3429 gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 3430
3431 // --- Place the ghost volumes containing the strip ladders (ISV2),
3432 // electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
3433 // their mother volume (IT56)
3434
3435 offset1 = TMath::ATan2(.9, 41.2);
3436 offset2 = 5.2;
3437 rzero = dbox2[0] + 41.2;
3438 runo = dbox2[0] * 2. + 41.2 + dsrv[0];
3439 rtwo = dbox2[0] * 2. + 41.2 + dela[0];
3440 for (i = 1; i <= 36; ++i) {
3441 atheta = (i-1) * twopi * raddeg / 36. + offset2;
3442 AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
3443
3444 // --- Strip ladders
3445
3446 xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
3447 ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
3448 zpos = 0.;
cfce8870 3449 gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 3450
3451 // --- Electronics/cooling
3452
3453 xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
3454 ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
3455 zpos = 0.;
cfce8870 3456 gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 3457
3458 // --- End-ladders (nagative-Z and positive-Z)
3459
3460 xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
3461 ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
3462 zpos = -(dbox2[2] + dela[2] + 6.);
cfce8870 3463 gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 3464 zpos = dbox2[2] + dela[2] + 6.;
cfce8870 3465 gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
fe4da5cc 3466 }
3467
3468
3469 }
3470
3471 //************************************************************************
3472 //* *
3473 //* E N D - C A P S A N D F R A M E S *
3474 //* ========================================= *
3475 //* *
3476 //************************************************************************
3477
3478 // --- Define a dummy cylinder for multiple scattering tests
3479
3480 // GOTO 7890 ! skip dummy cylinder for multiple scatteringtests
3481
3482 // DITS(1)=49.
3483 // DITS(2)=DITS(1)+0.1
3484 // DITS(3)=60.3
3485 // CALL GSVOLU('ITST','TUBE',IDTMED(255),DITS,3,IOUT)
3486 // CALL GSPOS('ITST',1,'ITSV',0.,0.,0.,0,'ONLY')
3487 // 7890 CONTINUE
3488
3489 // --- The 0.74% X0 outer wall (C) of the gas vessel at r=50cm ---
3490
3491 // GOTO 8901 ! skip outer wall
3492
58005f18 3493 if (fMinorVersionV3 == 0 || fMinorVersionV3 == 3) {
fe4da5cc 3494
3495 dits[0] = 49.9;
3496 dits[1] = dits[0] + .06926;
3497 dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
3498 // old value 60.3
cfce8870 3499 gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
3500 gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
fe4da5cc 3501 } else {
3502 goto L8901;
3503 }
3504 L8901:
3505 // --- The frame between the end-caps (octagonal lay-out) ---
3506
3507 // GOTO 9012 ! skip octagonal frame
3508
58005f18 3509 if (fMinorVersionV3 == 1) {
fe4da5cc 3510
3511 rzero = 34.;
3512 dtra[0] = .92;
3513 dtra[1] = 1.;
3514 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3515 dtra1[0] = .92;
3516 dtra1[1] = 1.;
3517 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3518 angle = 45.;
3519 offset = angle / 2.;
3520 for (i = 0; i < 8; ++i) {
3521 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3522 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3523 ztra[i] = 0.;
cfce8870 3524 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3525 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
fe4da5cc 3526 }
3527
3528 atheta = 22.5;
3529 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3530 aphi2 = 180. - aphi1;
3531 xpos = (xtra[0] + xtra[1]) / 2.;
3532 ypos = (ytra[0] + ytra[1]) / 2.;
3533 zpos = dtra[2] / 2.;
cfce8870 3534 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3535 r2 = atheta + 90.;
3536 r3 = atheta + 90.;
3537 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3538 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
fe4da5cc 3539 zpos = -dtra[2] / 2.;
cfce8870 3540 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3541 r2 = atheta + 90.;
3542 r3 = atheta + 90.;
3543 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3544 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
fe4da5cc 3545
3546 atheta = 67.5;
3547 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3548 aphi1 = 180. - aphi2;
3549 xpos = (xtra[1] + xtra[2]) / 2.;
3550 ypos = (ytra[1] + ytra[2]) / 2.;
3551 zpos = dtra[2] / 2.;
cfce8870 3552 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3553 r2 = atheta + 90.;
3554 r3 = atheta + 90.;
3555 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3556 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
fe4da5cc 3557 zpos = -dtra[2] / 2.;
cfce8870 3558 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3559 r2 = atheta + 90.;
3560 r3 = atheta + 90.;
3561 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3562 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
fe4da5cc 3563
3564 atheta = 112.5;
3565 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3566 aphi2 = 180. - aphi1;
3567 xpos = (xtra[2] + xtra[3]) / 2.;
3568 ypos = (ytra[2] + ytra[3]) / 2.;
3569 zpos = dtra[2] / 2.;
cfce8870 3570 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3571 r2 = atheta + 90.;
3572 r3 = atheta + 90.;
3573 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3574 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
fe4da5cc 3575 zpos = -dtra[2] / 2.;
cfce8870 3576 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3577 r2 = atheta + 90.;
3578 r3 = atheta + 90.;
3579 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3580 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
fe4da5cc 3581
3582 atheta = 157.5;
3583 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3584 aphi1 = 180. - aphi2;
3585 xpos = (xtra[3] + xtra[4]) / 2.;
3586 ypos = (ytra[3] + ytra[4]) / 2.;
3587 zpos = dtra[2] / 2.;
cfce8870 3588 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3589 r2 = atheta + 90.;
3590 r3 = atheta + 90.;
3591 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3592 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
fe4da5cc 3593 zpos = -dtra[2] / 2.;
cfce8870 3594 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3595 r2 = atheta + 90.;
3596 r3 = atheta + 90.;
3597 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3598 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
fe4da5cc 3599
3600 atheta = 22.5;
3601 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3602 aphi1 = 180. - aphi2;
3603 xpos = (xtra[4] + xtra[5]) / 2.;
3604 ypos = (ytra[4] + ytra[5]) / 2.;
3605 zpos = dtra[2] / 2.;
cfce8870 3606 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3607 r2 = atheta + 90.;
3608 r3 = atheta + 90.;
3609 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3610 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
fe4da5cc 3611 zpos = -dtra[2] / 2.;
cfce8870 3612 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3613 r2 = atheta + 90.;
3614 r3 = atheta + 90.;
3615 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3616 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
fe4da5cc 3617
3618 atheta = 67.5;
3619 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3620 aphi2 = 180. - aphi1;
3621 xpos = (xtra[5] + xtra[6]) / 2.;
3622 ypos = (ytra[5] + ytra[6]) / 2.;
3623 zpos = dtra[2] / 2.;
cfce8870 3624 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3625 r2 = atheta + 90.;
3626 r3 = atheta + 90.;
3627 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3628 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
fe4da5cc 3629 zpos = -dtra[2] / 2.;
cfce8870 3630 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3631 r2 = atheta + 90.;
3632 r3 = atheta + 90.;
3633 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3634 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
fe4da5cc 3635
3636 atheta = 112.5;
3637 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3638 aphi1 = 180. - aphi2;
3639 xpos = (xtra[6] + xtra[7]) / 2.;
3640 ypos = (ytra[6] + ytra[7]) / 2.;
3641 zpos = dtra[2] / 2.;
cfce8870 3642 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3643 r2 = atheta + 90.;
3644 r3 = atheta + 90.;
3645 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3646 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
fe4da5cc 3647 zpos = -dtra[2] / 2.;
cfce8870 3648 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3649 r2 = atheta + 90.;
3650 r3 = atheta + 90.;
3651 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3652 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
fe4da5cc 3653
3654 atheta = 157.5;
3655 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3656 aphi2 = 180. - aphi1;
3657 xpos = (xtra[7] + xtra[0]) / 2.;
3658 ypos = (ytra[7] + ytra[0]) / 2.;
3659 zpos = dtra[2] / 2.;
cfce8870 3660 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3661 r2 = atheta + 90.;
3662 r3 = atheta + 90.;
3663 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3664 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
fe4da5cc 3665 zpos = -dtra[2] / 2.;
cfce8870 3666 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3667 r2 = atheta + 90.;
3668 r3 = atheta + 90.;
3669 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3670 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
fe4da5cc 3671
3672
58005f18 3673 } else if (fMinorVersionV3 == 4) {
fe4da5cc 3674
3675
3676 rzero = 34.;
3677 dtra[0] = .92;
3678 dtra[1] = 1.;
3679 dtra[2] = dpcb[2] * 2. + 50.5 - 10.5;
3680 dtra1[0] = .92;
3681 dtra1[1] = 1.;
3682 dtra1[2] = TMath::Sqrt(dtra[2] * dtra[2] + (55.4*55.4-50.5*50.5))/2.;
3683 angle = 45.;
3684 offset = angle / 2.;
3685 for (i = 0; i < 8; ++i) {
3686 xtra[i] = rzero * TMath::Cos(i * angle * degrad);
3687 ytra[i] = rzero * TMath::Sin(i * angle * degrad);
3688 ztra[i] = 0.;
cfce8870 3689 gMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
3690 gMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
fe4da5cc 3691 }
3692
3693 atheta = 22.5;
3694 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3695 aphi2 = 180. - aphi1;
3696 xpos = (xtra[0] + xtra[1]) / 2.;
3697 ypos = (ytra[0] + ytra[1]) / 2.;
3698 zpos = dtra[2] / 2.;
cfce8870 3699 gMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3700 r2 = atheta + 90.;
3701 r3 = atheta + 90.;
3702 AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3703 gMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
fe4da5cc 3704 zpos = -dtra[2] / 2.;
cfce8870 3705 gMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3706 r2 = atheta + 90.;
3707 r3 = atheta + 90.;
3708 AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3709 gMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
fe4da5cc 3710
3711 atheta = 67.5;
3712 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3713 aphi1 = 180. - aphi2;
3714 xpos = (xtra[1] + xtra[2]) / 2.;
3715 ypos = (ytra[1] + ytra[2]) / 2.;
3716 zpos = dtra[2] / 2.;
cfce8870 3717 gMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3718 r2 = atheta + 90.;
3719 r3 = atheta + 90.;
3720 AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3721 gMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
fe4da5cc 3722 zpos = -dtra[2] / 2.;
cfce8870 3723 gMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3724 r2 = atheta + 90.;
3725 r3 = atheta + 90.;
3726 AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3727 gMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
fe4da5cc 3728
3729 atheta = 112.5;
3730 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3731 aphi2 = 180. - aphi1;
3732 xpos = (xtra[2] + xtra[3]) / 2.;
3733 ypos = (ytra[2] + ytra[3]) / 2.;
3734 zpos = dtra[2] / 2.;
cfce8870 3735 gMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3736 r2 = atheta + 90.;
3737 r3 = atheta + 90.;
3738 AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3739 gMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
fe4da5cc 3740 zpos = -dtra[2] / 2.;
cfce8870 3741 gMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3742 r2 = atheta + 90.;
3743 r3 = atheta + 90.;
3744 AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3745 gMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
fe4da5cc 3746
3747 atheta = 157.5;
3748 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3749 aphi1 = 180. - aphi2;
3750 xpos = (xtra[3] + xtra[4]) / 2.;
3751 ypos = (ytra[3] + ytra[4]) / 2.;
3752 zpos = dtra[2] / 2.;
cfce8870 3753 gMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3754 r2 = atheta + 90.;
3755 r3 = atheta + 90.;
3756 AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3757 gMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
fe4da5cc 3758 zpos = -dtra[2] / 2.;
cfce8870 3759 gMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3760 r2 = atheta + 90.;
3761 r3 = atheta + 90.;
3762 AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3763 gMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
fe4da5cc 3764
3765 atheta = 22.5;
3766 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3767 aphi1 = 180. - aphi2;
3768 xpos = (xtra[4] + xtra[5]) / 2.;
3769 ypos = (ytra[4] + ytra[5]) / 2.;
3770 zpos = dtra[2] / 2.;
cfce8870 3771 gMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3772 r2 = atheta + 90.;
3773 r3 = atheta + 90.;
3774 AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3775 gMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
fe4da5cc 3776 zpos = -dtra[2] / 2.;
cfce8870 3777 gMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3778 r2 = atheta + 90.;
3779 r3 = atheta + 90.;
3780 AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3781 gMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
fe4da5cc 3782
3783 atheta = 67.5;
3784 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3785 aphi2 = 180. - aphi1;
3786 xpos = (xtra[5] + xtra[6]) / 2.;
3787 ypos = (ytra[5] + ytra[6]) / 2.;
3788 zpos = dtra[2] / 2.;
cfce8870 3789 gMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3790 r2 = atheta + 90.;
3791 r3 = atheta + 90.;
3792 AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3793 gMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
fe4da5cc 3794 zpos = -dtra[2] / 2.;
cfce8870 3795 gMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3796 r2 = atheta + 90.;
3797 r3 = atheta + 90.;
3798 AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3799 gMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
fe4da5cc 3800
3801 atheta = 112.5;
3802 aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3803 aphi1 = 180. - aphi2;
3804 xpos = (xtra[6] + xtra[7]) / 2.;
3805 ypos = (ytra[6] + ytra[7]) / 2.;
3806 zpos = dtra[2] / 2.;
cfce8870 3807 gMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3808 r2 = atheta + 90.;
3809 r3 = atheta + 90.;
3810 AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3811 gMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
fe4da5cc 3812 zpos = -dtra[2] / 2.;
cfce8870 3813 gMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3814 r2 = atheta + 90.;
3815 r3 = atheta + 90.;
3816 AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3817 gMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
fe4da5cc 3818
3819 atheta = 157.5;
3820 aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
3821 aphi2 = 180. - aphi1;
3822 xpos = (xtra[7] + xtra[0]) / 2.;
3823 ypos = (ytra[7] + ytra[0]) / 2.;
3824 zpos = dtra[2] / 2.;
cfce8870 3825 gMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3826 r2 = atheta + 90.;
3827 r3 = atheta + 90.;
3828 AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3829 gMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
fe4da5cc 3830 zpos = -dtra[2] / 2.;
cfce8870 3831 gMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
fe4da5cc 3832 r2 = atheta + 90.;
3833 r3 = atheta + 90.;
3834 AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3835 gMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
fe4da5cc 3836 } else {
3837 goto L9012;
3838 }
3839
3840 L9012:
3841 // --- The frame between the end-caps (hexagonal lay-out) ---
3842
3843 // GOTO 9123 ! skip hexagonal frame
3844
58005f18 3845 if (fMinorVersionV3 == 2) {
fe4da5cc 3846
3847 rzero = 33.5;
3848 dtra2[0] = .92;
3849 dtra2[1] = 1.;
3850 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
3851 dtra3[0] = .92;
3852 dtra3[1] = 1.;
3853 dtra3[2] = 16.75;
3854 dtra4[0] = .92;
3855 dtra4[1] = 1.;
3856 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
3857 angle = 60.;
3858 offset = angle / 2.;
3859 for (i = 0; i < 6; ++i) {
3860 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
3861 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
3862 ztra1[i] = 0.;
cfce8870 3863 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
3864 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
fe4da5cc 3865 }
3866
3867 atheta = 60.;
3868 aphi = 90.;
3869 xpos = (xtra1[0] + xtra1[1]) / 2.;
3870 ypos = (ytra1[0] + ytra1[1]) / 2.;
3871 zpos = 0.;
cfce8870 3872 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 3873 r2 = atheta + 90.;
3874 r3 = atheta + 90.;
3875 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 3876 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
fe4da5cc 3877
3878 atheta = 120.;
3879 aphi = 90.;
3880 xpos = (xtra1[1] + xtra1[2]) / 2.;
3881 ypos = (ytra1[1] + ytra1[2]) / 2.;
3882 zpos = 0.;
cfce8870 3883 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 3884 r2 = atheta + 90.;
3885 r3 = atheta + 90.;
3886 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 3887 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
fe4da5cc 3888
3889 atheta = 180.;
3890 aphi = 90.;
3891 xpos = (xtra1[2] + xtra1[3]) / 2.;
3892 ypos = (ytra1[2] + ytra1[3]) / 2.;
3893 zpos = 0.;
cfce8870 3894 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 3895 r2 = atheta + 90.;
3896 r3 = atheta + 90.;
3897 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 3898 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
fe4da5cc 3899
3900 atheta = 60.;
3901 aphi = 90.;
3902 xpos = (xtra1[3] + xtra1[4]) / 2.;
3903 ypos = (ytra1[3] + ytra1[4]) / 2.;
3904 zpos = 0.;
cfce8870 3905 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 3906 r2 = atheta + 90.;
3907 r3 = atheta + 90.;
3908 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 3909 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
fe4da5cc 3910
3911 atheta = 120.;
3912 aphi = 90.;
3913 xpos = (xtra1[4] + xtra1[5]) / 2.;
3914 ypos = (ytra1[4] + ytra1[5]) / 2.;
3915 zpos = 0.;
cfce8870 3916 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 3917 r2 = atheta + 90.;
3918 r3 = atheta + 90.;
3919 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 3920 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
fe4da5cc 3921
3922 atheta = 180.;
3923 aphi = 90.;
3924 xpos = (xtra1[5] + xtra1[0]) / 2.;
3925 ypos = (ytra1[5] + ytra1[0]) / 2.;
3926 zpos = 0.;
cfce8870 3927 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 3928 r2 = atheta + 90.;
3929 r3 = atheta + 90.;
3930 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 3931 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
fe4da5cc 3932
3933 atheta = 60.;
3934 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3935 aphi1 = 180. - aphi2;
3936 xpos = (xtra1[0] + xtra1[1]) / 2.;
3937 ypos = (ytra1[0] + ytra1[1]) / 2.;
3938 zpos = dtra2[2] / 2.;
cfce8870 3939 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3940 r2 = atheta + 90.;
3941 r3 = atheta + 90.;
3942 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3943 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
fe4da5cc 3944 zpos = -dtra2[2] / 2.;
cfce8870 3945 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3946 r2 = atheta + 90.;
3947 r3 = atheta + 90.;
3948 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3949 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
fe4da5cc 3950
3951 atheta = 120.;
3952 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3953 aphi2 = 180. - aphi1;
3954 xpos = (xtra1[1] + xtra1[2]) / 2.;
3955 ypos = (ytra1[1] + ytra1[2]) / 2.;
3956 zpos = dtra2[2] / 2.;
cfce8870 3957 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3958 r2 = atheta + 90.;
3959 r3 = atheta + 90.;
3960 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3961 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
fe4da5cc 3962 zpos = -dtra2[2] / 2.;
cfce8870 3963 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3964 r2 = atheta + 90.;
3965 r3 = atheta + 90.;
3966 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3967 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
fe4da5cc 3968
3969 atheta = 180.;
3970 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
3971 aphi1 = 180. - aphi2;
3972 xpos = (xtra1[2] + xtra1[3]) / 2.;
3973 ypos = (ytra1[2] + ytra1[3]) / 2.;
3974 zpos = dtra2[2] / 2.;
cfce8870 3975 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3976 r2 = atheta + 90.;
3977 r3 = atheta + 90.;
3978 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3979 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
fe4da5cc 3980 zpos = -dtra2[2] / 2.;
cfce8870 3981 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3982 r2 = atheta + 90.;
3983 r3 = atheta + 90.;
3984 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 3985 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
fe4da5cc 3986 atheta = 180.;
3987 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))
3988 - 50.*50.))) * raddeg;
3989 aphi2 = 180. - aphi1;
3990 xpos = (xtra1[2] + xtra1[3]) / 2.;
3991 ypos = (ytra1[2] + ytra1[3]) / 2.;
3992 zpos = dtra2[2] / 2.;
cfce8870 3993 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 3994 r2 = atheta + 90.;
3995 r3 = atheta + 90.;
3996 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 3997 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
fe4da5cc 3998 zpos = -dtra2[2] / 2.;
cfce8870 3999 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4000 r2 = atheta + 90.;
4001 r3 = atheta + 90.;
4002 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4003 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
fe4da5cc 4004
4005 atheta = 60.;
4006 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4007 aphi1 = 180. - aphi2;
4008 xpos = (xtra1[3] + xtra1[4]) / 2.;
4009 ypos = (ytra1[3] + ytra1[4]) / 2.;
4010 zpos = dtra2[2] / 2.;
cfce8870 4011 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4012 r2 = atheta + 90.;
4013 r3 = atheta + 90.;
4014 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4015 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
fe4da5cc 4016 zpos = -dtra2[2] / 2.;
cfce8870 4017 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4018 r2 = atheta + 90.;
4019 r3 = atheta + 90.;
4020 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4021 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
fe4da5cc 4022
4023 atheta = 120.;
4024 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4025 aphi2 = 180. - aphi1;
4026 xpos = (xtra1[4] + xtra1[5]) / 2.;
4027 ypos = (ytra1[4] + ytra1[5]) / 2.;
4028 zpos = dtra2[2] / 2.;
cfce8870 4029 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4030 r2 = atheta + 90.;
4031 r3 = atheta + 90.;
4032 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4033 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
fe4da5cc 4034 zpos = -dtra2[2] / 2.;
cfce8870 4035 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4036 r2 = atheta + 90.;
4037 r3 = atheta + 90.;
4038 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4039 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
fe4da5cc 4040
4041 atheta = 180.;
4042 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4043 aphi1 = 180. - aphi2;
4044 xpos = (xtra1[5] + xtra1[0]) / 2.;
4045 ypos = (ytra1[5] + ytra1[0]) / 2.;
4046 zpos = dtra2[2] / 2.;
cfce8870 4047 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4048 r2 = atheta + 90.;
4049 r3 = atheta + 90.;
4050 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4051 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
fe4da5cc 4052 zpos = -dtra2[2] / 2.;
cfce8870 4053 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4054 r2 = atheta + 90.;
4055 r3 = atheta + 90.;
4056 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4057 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
fe4da5cc 4058 atheta = 180.;
4059 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4060 aphi2 = 180. - aphi1;
4061 xpos = (xtra1[5] + xtra1[0]) / 2.;
4062 ypos = (ytra1[5] + ytra1[0]) / 2.;
4063 zpos = dtra2[2] / 2.;
cfce8870 4064 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4065 r2 = atheta + 90.;
4066 r3 = atheta + 90.;
4067 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4068 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
fe4da5cc 4069 zpos = -dtra2[2] / 2.;
cfce8870 4070 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4071 r2 = atheta + 90.;
4072 r3 = atheta + 90.;
4073 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4074 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
fe4da5cc 4075
4076
58005f18 4077 } else if (fMinorVersionV3 == 5) {
fe4da5cc 4078
4079
4080 rzero = 33.5;
4081 dtra2[0] = .92;
4082 dtra2[1] = 1.;
4083 dtra2[2] = dpcb[2] * 2. + 50. - 10.5;
4084 dtra3[0] = .92;
4085 dtra3[1] = 1.;
4086 dtra3[2] = 16.75;
4087 dtra4[0] = .92;
4088 dtra4[1] = 1.;
4089 dtra4[2] = TMath::Sqrt(dtra2[2] * dtra2[2] + (59.9*59.9-50.*50.)) / 2.;
4090 angle = 60.;
4091 offset = angle / 2.;
4092 for (i = 0; i < 6; ++i) {
4093 xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
4094 ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
4095 ztra1[i] = 0.;
cfce8870 4096 gMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
4097 gMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
fe4da5cc 4098 }
4099
4100 atheta = 60.;
4101 aphi = 90.;
4102 xpos = (xtra1[0] + xtra1[1]) / 2.;
4103 ypos = (ytra1[0] + ytra1[1]) / 2.;
4104 zpos = 0.;
cfce8870 4105 gMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 4106 r2 = atheta + 90.;
4107 r3 = atheta + 90.;
4108 AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 4109 gMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
fe4da5cc 4110
4111 atheta = 120.;
4112 aphi = 90.;
4113 xpos = (xtra1[1] + xtra1[2]) / 2.;
4114 ypos = (ytra1[1] + ytra1[2]) / 2.;
4115 zpos = 0.;
cfce8870 4116 gMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 4117 r2 = atheta + 90.;
4118 r3 = atheta + 90.;
4119 AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 4120 gMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
fe4da5cc 4121
4122 atheta = 180.;
4123 aphi = 90.;
4124 xpos = (xtra1[2] + xtra1[3]) / 2.;
4125 ypos = (ytra1[2] + ytra1[3]) / 2.;
4126 zpos = 0.;
cfce8870 4127 gMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 4128 r2 = atheta + 90.;
4129 r3 = atheta + 90.;
4130 AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 4131 gMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
fe4da5cc 4132
4133 atheta = 60.;
4134 aphi = 90.;
4135 xpos = (xtra1[3] + xtra1[4]) / 2.;
4136 ypos = (ytra1[3] + ytra1[4]) / 2.;
4137 zpos = 0.;
cfce8870 4138 gMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 4139 r2 = atheta + 90.;
4140 r3 = atheta + 90.;
4141 AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 4142 gMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
fe4da5cc 4143
4144 atheta = 120.;
4145 aphi = 90.;
4146 xpos = (xtra1[4] + xtra1[5]) / 2.;
4147 ypos = (ytra1[4] + ytra1[5]) / 2.;
4148 zpos = 0.;
cfce8870 4149 gMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 4150 r2 = atheta + 90.;
4151 r3 = atheta + 90.;
4152 AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 4153 gMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
fe4da5cc 4154
4155 atheta = 180.;
4156 aphi = 90.;
4157 xpos = (xtra1[5] + xtra1[0]) / 2.;
4158 ypos = (ytra1[5] + ytra1[0]) / 2.;
4159 zpos = 0.;
cfce8870 4160 gMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
fe4da5cc 4161 r2 = atheta + 90.;
4162 r3 = atheta + 90.;
4163 AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
cfce8870 4164 gMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
fe4da5cc 4165
4166 atheta = 60.;
4167 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4168 aphi1 = 180. - aphi2;
4169 xpos = (xtra1[0] + xtra1[1]) / 2.;
4170 ypos = (ytra1[0] + ytra1[1]) / 2.;
4171 zpos = dtra2[2] / 2.;
cfce8870 4172 gMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4173 r2 = atheta + 90.;
4174 r3 = atheta + 90.;
4175 AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4176 gMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
fe4da5cc 4177 zpos = -dtra2[2] / 2.;
cfce8870 4178 gMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4179 r2 = atheta + 90.;
4180 r3 = atheta + 90.;
4181 AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4182 gMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
fe4da5cc 4183
4184 atheta = 120.;
4185 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4186 aphi2 = 180. - aphi1;
4187 xpos = (xtra1[1] + xtra1[2]) / 2.;
4188 ypos = (ytra1[1] + ytra1[2]) / 2.;
4189 zpos = dtra2[2] / 2.;
cfce8870 4190 gMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4191 r2 = atheta + 90.;
4192 r3 = atheta + 90.;
4193 AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4194 gMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
fe4da5cc 4195 zpos = -dtra2[2] / 2.;
cfce8870 4196 gMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4197 r2 = atheta + 90.;
4198 r3 = atheta + 90.;
4199 AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4200 gMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
fe4da5cc 4201
4202 atheta = 180.;
4203 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4204 aphi1 = 180. - aphi2;
4205 xpos = (xtra1[2] + xtra1[3]) / 2.;
4206 ypos = (ytra1[2] + ytra1[3]) / 2.;
4207 zpos = dtra2[2] / 2.;
cfce8870 4208 gMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4209 r2 = atheta + 90.;
4210 r3 = atheta + 90.;
4211 AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4212 gMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
fe4da5cc 4213 zpos = -dtra2[2] / 2.;
cfce8870 4214 gMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4215 r2 = atheta + 90.;
4216 r3 = atheta + 90.;
4217 AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4218 gMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
fe4da5cc 4219 atheta = 180.;
4220 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4221 aphi2 = 180. - aphi1;
4222 xpos = (xtra1[2] + xtra1[3]) / 2.;
4223 ypos = (ytra1[2] + ytra1[3]) / 2.;
4224 zpos = dtra2[2] / 2.;
cfce8870 4225 gMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4226 r2 = atheta + 90.;
4227 r3 = atheta + 90.;
4228 AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4229 gMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
fe4da5cc 4230 zpos = -dtra2[2] / 2.;
cfce8870 4231 gMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4232 r2 = atheta + 90.;
4233 r3 = atheta + 90.;
4234 AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4235 gMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
fe4da5cc 4236
4237 atheta = 60.;
4238 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4239 aphi1 = 180. - aphi2;
4240 xpos = (xtra1[3] + xtra1[4]) / 2.;
4241 ypos = (ytra1[3] + ytra1[4]) / 2.;
4242 zpos = dtra2[2] / 2.;
cfce8870 4243 gMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4244 r2 = atheta + 90.;
4245 r3 = atheta + 90.;
4246 AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4247 gMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
fe4da5cc 4248 zpos = -dtra2[2] / 2.;
cfce8870 4249 gMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4250 r2 = atheta + 90.;
4251 r3 = atheta + 90.;
4252 AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4253 gMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
fe4da5cc 4254
4255 atheta = 120.;
4256 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4257 aphi2 = 180. - aphi1;
4258 xpos = (xtra1[4] + xtra1[5]) / 2.;
4259 ypos = (ytra1[4] + ytra1[5]) / 2.;
4260 zpos = dtra2[2] / 2.;
cfce8870 4261 gMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4262 r2 = atheta + 90.;
4263 r3 = atheta + 90.;
4264 AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4265 gMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
fe4da5cc 4266 zpos = -dtra2[2] / 2.;
cfce8870 4267 gMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4268 r2 = atheta + 90.;
4269 r3 = atheta + 90.;
4270 AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4271 gMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
fe4da5cc 4272
4273 atheta = 180.;
4274 aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4275 aphi1 = 180. - aphi2;
4276 xpos = (xtra1[5] + xtra1[0]) / 2.;
4277 ypos = (ytra1[5] + ytra1[0]) / 2.;
4278 zpos = dtra2[2] / 2.;
cfce8870 4279 gMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4280 r2 = atheta + 90.;
4281 r3 = atheta + 90.;
4282 AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4283 gMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
fe4da5cc 4284 zpos = -dtra2[2] / 2.;
cfce8870 4285 gMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4286 r2 = atheta + 90.;
4287 r3 = atheta + 90.;
4288 AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4289 gMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
fe4da5cc 4290 atheta = 180.;
4291 aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
4292 aphi2 = 180. - aphi1;
4293 xpos = (xtra1[5] + xtra1[0]) / 2.;
4294 ypos = (ytra1[5] + ytra1[0]) / 2.;
4295 zpos = dtra2[2] / 2.;
cfce8870 4296 gMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4297 r2 = atheta + 90.;
4298 r3 = atheta + 90.;
4299 AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
cfce8870 4300 gMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
fe4da5cc 4301 zpos = -dtra2[2] / 2.;
cfce8870 4302 gMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
fe4da5cc 4303 r2 = atheta + 90.;
4304 r3 = atheta + 90.;
4305 AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
cfce8870 4306 gMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
fe4da5cc 4307 } else {
4308 goto L9123;
4309 }
4310
4311 L9123:
4312 // --- Define the end-caps
4313
4314 // GOTO 9234 ! skip both end-caps
4315
4316 // --- Define the Z>0 end-cap
4317
4318 // GOTO 9345 ! skip the Z>0 end-cap
4319
4320 dcone[0] = 16.75;
4321 dcone[1] = 12.;
4322 dcone[2] = 12.02;
4323 dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
4324 dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4325 xpos = 0.;
4326 ypos = 0.;
4327 zpos = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
4328 // end-ladder electro
cfce8870 4329 gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
4330 gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4331
4332 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4333 dtube[1] = 49.9;
4334 // In the Simonetti's drawings 52. In the TP 50.
4335 dtube[2] = .15;
4336 xpos = 0.;
4337 ypos = 0.;
4338 zpos = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
4339 // end-ladder electro
cfce8870 4340 gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
4341 gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4342
4343 dtube[0] = 10.5;
4344 dtube[1] = 12.;
4345 dtube[2] = 26.8/2./10.;
4346 xpos = 0.;
4347 ypos = 0.;
4348 zpos = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
4349 // end-ladder elect
cfce8870 4350 gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
4351 gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4352
4353 dpgon[0] = 15.;
4354 dpgon[1] = 360.;
4355 dpgon[2] = 12.;
4356 dpgon[3] = 2.;
4357 dpgon[4] = dpcb[2] * 2. + (583./2.-62.2)/10. - 10.5;
4358 // end-ladder electron
4359 dpgon[5] = 12.;
4360 dpgon[6] = 13.5;
4361 dpgon[7] = dpcb[2] * 2. + 583./2./10. - 10.5;
4362 // end-ladder electronics
4363 dpgon[8] = 12.;
4364 dpgon[9] = 13.5;
4365 xpos = 0.;
4366 ypos = 0.;
4367 zpos = 0.;
cfce8870 4368 gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
4369 gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4370
4371 dpgon[0] = 7.5;
4372 dpgon[1] = 360.;
4373 dpgon[2] = 24.;
4374 dpgon[3] = 2.;
4375 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-273.))/10. - 10.5;
4376 // end-ladder e
4377 dpgon[5] = 21.;
4378 dpgon[6] = 23.;
4379 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-273.+15.))/10. - 10.5;
4380 // end-ladde
4381 dpgon[8] = 21.;
4382 dpgon[9] = 23.;
4383 xpos = 0.;
4384 ypos = 0.;
4385 zpos = 0.;
cfce8870 4386 gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
4387 gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4388
58005f18 4389 if (fMinorVersionV3 < 3 ) {
fe4da5cc 4390 offset2 = 5.2;
4391 dpgon[0] = offset2 + 360./(2.*35.);
4392 dpgon[1] = 360.;
4393 dpgon[2] = 35.;
4394 dpgon[3] = 2.;
4395 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-106.))/10. - 10.5;
4396 // end-ladde
4397 dpgon[5] = 37.7;
4398 dpgon[6] = 40.;
4399 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-106.+15.))/10. - 10.5;
4400 // end-la
4401 dpgon[8] = 37.7;
4402 dpgon[9] = 40.;
4403 xpos = 0.;
4404 ypos = 0.;
4405 zpos = 0.;
cfce8870 4406 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4407 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4408
4409 dpgon[0] = offset2 + 360./(2.*39.);
4410 dpgon[1] = 360.;
4411 dpgon[2] = 39.;
4412 dpgon[3] = 2.;
4413 dpgon[4] = dpcb[2] * 2. + (583./2.+(338.-56.))/10. - 10.5;
4414 // end-ladder
4415 dpgon[5] = 42.7;
4416 dpgon[6] = 45.;
4417 dpgon[7] = dpcb[2] * 2. + (583./2.+(338.-56.+15.))/10. - 10.5;
4418 // end-la
4419 dpgon[8] = 42.7;
4420 dpgon[9] = 45.;
4421 xpos = 0.;
4422 ypos = 0.;
4423 zpos = 0.;
cfce8870 4424 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4425 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4426 }
58005f18 4427 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
fe4da5cc 4428 offset2 = 5.2;
4429 dpgon[0] = offset2 + 5.625;
4430 dpgon[1] = 360.;
4431 dpgon[2] = 32.;
4432 dpgon[3] = 2.;
4433 dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4434 // end-ladder electronics
4435 dpgon[5] = 34.3;
4436 dpgon[6] = 36.6;
4437 dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4438 // end-ladder electr
4439 dpgon[8] = 34.3;
4440 dpgon[9] = 36.6;
4441 xpos = 0.;
4442 ypos = 0.;
4443 zpos = 0.;
cfce8870 4444 gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
4445 gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4446
4447 dpgon[0] = offset2 + 5.;
4448 dpgon[1] = 360.;
4449 dpgon[2] = 36.;
4450 dpgon[3] = 2.;
4451 dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4452 // end-ladder electronics
4453 dpgon[5] = 38.9;
4454 dpgon[6] = 41.2;
4455 dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
4456 // end-ladder electr
4457 dpgon[8] = 38.9;
4458 dpgon[9] = 41.2;
4459 xpos = 0.;
4460 ypos = 0.;
4461 zpos = 0.;
cfce8870 4462 gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
4463 gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4464 }
4465
4466 // 9345 CONTINUE
4467
4468 // --- Define the Z<0 end-cap
4469
4470 // GOTO 9456 ! skip the Z<0 end-cap
4471
4472 dcone[0] = 16.75;
4473 dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
4474 dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4475 dcone[3] = 12.;
4476 dcone[4] = 12.02;
4477 xpos = 0.;
4478 ypos = 0.;
4479 zpos = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
4480 // end-ladder electr
cfce8870 4481 gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
fe4da5cc 4482
cfce8870 4483 gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4484
4485 dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
4486 dtube[1] = 49.9;
4487 // In the Simonetti's drawings 52. In the TP 50.
4488 dtube[2] = .15;
4489 xpos = 0.;
4490 ypos = 0.;
4491 zpos = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
4492 // end-ladder electr
cfce8870 4493 gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
fe4da5cc 4494
cfce8870 4495 gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4496
4497 dtube[0] = 10.5;
4498 dtube[1] = 12.;
4499 dtube[2] = 26.8/2./10.;
4500 xpos = 0.;
4501 ypos = 0.;
4502 zpos = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
4503 // end-ladder elec
cfce8870 4504 gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
fe4da5cc 4505 ;
cfce8870 4506 gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4507
4508 dpgon[0] = 15.;
4509 dpgon[1] = 360.;
4510 dpgon[2] = 12.;
4511 dpgon[3] = 2.;
4512 dpgon[4] = -583./2./10. - dpcb[2] * 2. + 10.5;
4513 // end-ladder electronics
4514 dpgon[5] = 12.;
4515 dpgon[6] = 13.5;
4516 dpgon[7] = -(583./2.-62.2)/10. - dpcb[2] * 2. + 10.5;
4517 // end-ladder electro
4518 dpgon[8] = 12.;
4519 dpgon[9] = 13.5;
4520 xpos = 0.;
4521 ypos = 0.;
4522 zpos = 0.;
cfce8870 4523 gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
4524 gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4525
4526 dpgon[0] = 7.5;
4527 dpgon[1] = 360.;
4528 dpgon[2] = 24.;
4529 dpgon[3] = 2.;
4530 dpgon[4] = -(583./2.+(338.-273.+15.))/10. - dpcb[2] * 2. + 10.5;
4531 // end-ladd
4532 dpgon[5] = 21.;
4533 dpgon[6] = 23.;
4534 dpgon[7] = -(583./2.+(338.-273.))/10. - dpcb[2] * 2. + 10.5;
4535 // end-ladder
4536 dpgon[8] = 21.;
4537 dpgon[9] = 23.;
4538 xpos = 0.;
4539 ypos = 0.;
4540 zpos = 0.;
cfce8870 4541 gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
4542 gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4543
58005f18 4544 if (fMinorVersionV3 < 3) {
fe4da5cc 4545 offset2 = 5.2;
4546 dpgon[0] = offset2 + 360./(2.*35.);
4547 dpgon[1] = 360.;
4548 dpgon[2] = 35.;
4549 dpgon[3] = 2.;
4550 dpgon[4] = -(583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4551 // end-ladd
4552 dpgon[5] = 37.7;
4553 dpgon[6] = 40.;
4554 dpgon[7] = -(583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4555 // end-l
4556 dpgon[8] = 37.7;
4557 dpgon[9] = 40.;
4558 xpos = 0.;
4559 ypos = 0.;
4560 zpos = 0.;
cfce8870 4561 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4562 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4563
4564 dpgon[0] = offset2 + 360./(2.*39.);
4565 dpgon[1] = 360.;
4566 dpgon[2] = 39.;
4567 dpgon[3] = 2.;
4568 dpgon[4] = -(583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4569 // end-ladde
4570 dpgon[5] = 42.7;
4571 dpgon[6] = 45.;
4572 dpgon[7] = -(583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4573 // end-l
4574 dpgon[8] = 42.7;
4575 dpgon[9] = 45.;
4576 xpos = 0.;
4577 ypos = 0.;
4578 zpos = 0.;
cfce8870 4579 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4580 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4581 }
58005f18 4582 if (fMinorVersionV3 > 2 && fMinorVersionV3 < 6) {
fe4da5cc 4583 offset2 = 5.2;
4584 dpgon[0] = offset2 + 5.625;
4585 dpgon[1] = 360.;
4586 dpgon[2] = 32.;
4587 dpgon[3] = 2.;
4588 dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
4589 // end-ladder electronics
4590 dpgon[5] = 34.3;
4591 dpgon[6] = 36.6;
4592 dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
4593 // end-ladder electr
4594 dpgon[8] = 34.3;
4595 dpgon[9] = 36.6;
4596 xpos = 0.;
4597 ypos = 0.;
4598 zpos = 0.;
cfce8870 4599 gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
4600 gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4601
4602 dpgon[0] = offset2 + 5.;
4603 dpgon[1] = 360.;
4604 dpgon[2] = 36.;
4605 dpgon[3] = 2.;
4606 dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
4607 // end-ladder electronics
4608 dpgon[5] = 38.9;
4609 dpgon[6] = 41.2;
4610 dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
4611 // end-ladder electr
4612 dpgon[8] = 38.9;
4613 dpgon[9] = 41.2;
4614 xpos = 0.;
4615 ypos = 0.;
4616 zpos = 0.;
cfce8870 4617 gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
4618 gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
fe4da5cc 4619 }
4620
4621 // 9456 CONTINUE
4622
4623
4624 // --- Outputs the geometry tree in the EUCLID/CAD format
4625
4626 if (fEuclidOut) {
cfce8870 4627 gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
fe4da5cc 4628 }
58005f18 4629 fMinorVersion = fMinorVersionV3;
fe4da5cc 4630}
4631
4632//_____________________________________________________________________________
4633void AliITSv3::CreateMaterials()
4634{
4635 //
4636 // Create Materials for ITS
4637 //
4638 AliITS::CreateMaterials();
4639}
4640
4641//_____________________________________________________________________________
593d2ea1 4642void AliITSv3::Init(){
4643 //
4644 // Initialise its after it is built
4645 //
4646 Int_t i,j,l;
4647
4648 fIdN = fId3N;;
4649 fIdName = new char*[fIdN];
4650 fIdSens = new Int_t[fIdN];
4651 for(i=0;i<fId3N;i++) {
4652 l = strlen(fId3Name[i]);
4653 fIdName[i] = new char[l+1];
4654 for(j=0;j<l;j++) fIdName[i][j] = fId3Name[i][j];
4655 fIdName[i][l] = '\0'; // Null terminate this string.
4656 } // end for i
4657 //
4658 AliITS::Init();
4659 fMajorVersion = 3;
4660 fMinorVersion = fMinorVersionV3;
fe4da5cc 4661}
4662
4663//_____________________________________________________________________________
4664void AliITSv3::StepManager()
4665{
4666 //
4667 // Called at every step in ITS
4668 //
4669 Int_t copy, id;
58005f18 4670 Float_t hits[8];
4671 Int_t vol[4];
0a6d8768 4672 TLorentzVector position, momentum;
fe4da5cc 4673 TClonesArray &lhits = *fHits;
fe4da5cc 4674 //
58005f18 4675 // Track status
4676 vol[3] = 0;
4677 if(gMC->IsTrackInside()) vol[3] += 1;
4678 if(gMC->IsTrackEntering()) vol[3] += 2;
4679 if(gMC->IsTrackExiting()) vol[3] += 4;
4680 if(gMC->IsTrackOut()) vol[3] += 8;
4681 if(gMC->IsTrackDisappeared()) vol[3] += 16;
4682 if(gMC->IsTrackStop()) vol[3] += 32;
4683 if(gMC->IsTrackAlive()) vol[3] += 64;
4684 //
4685 // Fill hit structure.
cfce8870 4686 if(gMC->TrackCharge() && gMC->Edep()) {
fe4da5cc 4687 //
4688 // Only entering charged tracks
58005f18 4689 if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {
fe4da5cc 4690 vol[0]=1;
0a6d8768 4691 id=gMC->CurrentVolOffID(1,copy);
fe4da5cc 4692 vol[1]=copy;
0a6d8768 4693 id=gMC->CurrentVolOffID(2,copy);
fe4da5cc 4694 vol[2]=copy;
58005f18 4695 } else if(id==fIdSens[1]) {
fe4da5cc 4696 vol[0]=2;
0a6d8768 4697 id=gMC->CurrentVolOffID(1,copy);
fe4da5cc 4698 vol[1]=copy;
0a6d8768 4699 id=gMC->CurrentVolOffID(2,copy);
fe4da5cc 4700 vol[2]=copy;
58005f18 4701 } else if(id==fIdSens[2]) {
fe4da5cc 4702 vol[0]=3;
4703 vol[1]=copy;
0a6d8768 4704 id=gMC->CurrentVolOffID(1,copy);
fe4da5cc 4705 vol[2]=copy;
58005f18 4706 } else if(id==fIdSens[3]) {
fe4da5cc 4707 vol[0]=4;
4708 vol[1]=copy;
0a6d8768 4709 id=gMC->CurrentVolOffID(1,copy);
fe4da5cc 4710 vol[2]=copy;
58005f18 4711 } else if(id==fIdSens[4]) {
fe4da5cc 4712 vol[0]=5;
4713 vol[1]=copy;
0a6d8768 4714 id=gMC->CurrentVolOffID(1,copy);
fe4da5cc 4715 vol[2]=copy;
58005f18 4716 } else if(id==fIdSens[5]) {
fe4da5cc 4717 vol[0]=6;
4718 vol[1]=copy;
0a6d8768 4719 id=gMC->CurrentVolOffID(1,copy);
fe4da5cc 4720 vol[2]=copy;
4721 } else return;
cfce8870 4722 gMC->TrackPosition(position);
4723 gMC->TrackMomentum(momentum);
fe4da5cc 4724 hits[0]=position[0];
4725 hits[1]=position[1];
4726 hits[2]=position[2];
0a6d8768 4727 hits[3]=momentum[0];
4728 hits[4]=momentum[1];
4729 hits[5]=momentum[2];
cfce8870 4730 hits[6]=gMC->Edep();
58005f18 4731 hits[7]=gMC->TrackTime();
fe4da5cc 4732 new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
4733 }
4734}
593d2ea1 4735
4736//____________________________________________________________________________
4737void AliITSv3::Streamer(TBuffer &R__b)
4738{
4739 // Stream an object of class AliITSv3.
4740
4741 if (R__b.IsReading()) {
4742 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
4743 AliITS::Streamer(R__b);
4744 // This information does not need to be read. It is "hard wired"
4745 // into this class via its creators.
4746 //R__b >> fId3N;
4747 //R__b.ReadArray(fId3Name);
4748 } else {
4749 R__b.WriteVersion(AliITSv3::IsA());
4750 AliITS::Streamer(R__b);
4751 // This information does not need to be saved. It is "hard wired"
4752 // into this class via its creators.
4753 //R__b << fId3N;
4754 //R__b.WriteArray(fId3Name, __COUNTER__);
4755 }
4756}