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