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