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