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