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