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