xMerge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv3.cxx
CommitLineData
b9c35690 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/* $Id$ */
17
18//------------------------------------------------------------------------
19// AliFRAMEv3.cxx
20// symmetric space frame with possibility for holes
21// Author: A.Morsch
22//------------------------------------------------------------------------
23
24#include <TGeoBBox.h>
25#include <TGeoCompositeShape.h>
26#include <TGeoGlobalMagField.h>
27#include <TGeoManager.h>
28#include <TGeoMatrix.h>
29#include <TGeoPgon.h>
30#include <TString.h>
31#include <TSystem.h>
32#include <TVirtualMC.h>
33
34#include "AliFRAMEv3.h"
35#include "AliMagF.h"
36#include "AliRun.h"
37#include "AliConst.h"
38#include "AliMC.h"
39#include "AliLog.h"
40#include "AliTrackReference.h"
41
42
43#include <TGeoTrd1.h>
44
45ClassImp(AliFRAMEv3)
46
47
48//_____________________________________________________________________________
49 AliFRAMEv3::AliFRAMEv3():
50 fHoles(0)
51{
52// Constructor
53}
54
55//_____________________________________________________________________________
56AliFRAMEv3::AliFRAMEv3(const char *name, const char *title)
57 : AliFRAME(name,title),
58 fHoles(0)
59{
60// Constructor
61}
62
63//___________________________________________
64void AliFRAMEv3::CreateGeometry()
65{
66//Begin_Html
67/*
68<img src="picts/frame.gif">
69*/
70//End_Html
71
72
73//Begin_Html
74/*
75<img src="picts/tree_frame.gif">
76*/
77//End_Html
78
79 Int_t idrotm[2299];
80
81
82
83 AliMatrix(idrotm[2070], 90.0, 0.0, 90.0, 270.0, 0.0, 0.0);
84//
85 AliMatrix(idrotm[2083], 170.0, 0.0, 90.0, 90.0, 80.0, 0.0);
86 AliMatrix(idrotm[2084], 170.0, 180.0, 90.0, 90.0, 80.0, 180.0);
87 AliMatrix(idrotm[2085], 90.0, 180.0, 90.0, 90.0, 0.0, 0.0);
88//
89 AliMatrix(idrotm[2086], 80.0, 0.0, 90.0, 90., -10.0, 0.0);
90 AliMatrix(idrotm[2096], 100.0, 0.0, 90.0, 90., 10.0, 0.0);
91//
92 AliMatrix(idrotm[2087], -100.0, 0.0, 90.0, 270., -10.0, 0.0);
93 AliMatrix(idrotm[2097], -80.0, 0.0, 90.0, 270., 10.0, 0.0);
94//
95 AliMatrix(idrotm[2088], 90.0, 90.0, 90.0, 180., 0.0, 0.0);
96 AliMatrix(idrotm[2089], 90.0, 90.0, 90.0, 0., 0.0, 0.0);
97//
98 AliMatrix(idrotm[2090], 90.0, 0.0, 0.0, 0., 90.0, 90.0);
99 AliMatrix(idrotm[2091], 0.0, 0.0, 90.0, 90., 90.0, 0.0);
100//
101// Matrices have been imported from Euclid. Some simplification
102// seems possible
103//
104
105 AliMatrix(idrotm[2003], 0.0, 0.0, 90.0, 130.0, 90.0, 40.0);
106 AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0, 40.0);
107 AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
108 AliMatrix(idrotm[2006], 0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
109 AliMatrix(idrotm[2007], 0.0, 0.0, 90.0, 170.0, 90.0, 80.0);
110 AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
111 AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0, 80.0);
112 AliMatrix(idrotm[2010], 0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
113 AliMatrix(idrotm[2011], 0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
114 AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
115 AliMatrix(idrotm[2013], 180.0, 0.0, 90.0, 10.0, 90.0, 100.0);
116 AliMatrix(idrotm[2014], 0.0, 0.0, 90.0, 10.0, 90.0, 100.0);
117 AliMatrix(idrotm[2015], 0.0, 0.0, 90.0, 30.0, 90.0, 300.0);
118 AliMatrix(idrotm[2016], 180.0, 0.0, 90.0, 30.0, 90.0, 300.0);
119 AliMatrix(idrotm[2017], 180.0, 0.0, 90.0, 50.0, 90.0, 140.0);
120 AliMatrix(idrotm[2018], 0.0, 0.0, 90.0, 50.0, 90.0, 140.0);
121
122 AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
123 AliMatrix(idrotm[2020], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
124 AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
125 AliMatrix(idrotm[2022], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
126 AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
127 AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
128 AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
129 AliMatrix(idrotm[2026], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
130
131 AliMatrix(idrotm[2027], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
132 AliMatrix(idrotm[2028], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0);
133 AliMatrix(idrotm[2029], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
134 AliMatrix(idrotm[2030], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
135 AliMatrix(idrotm[2031], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
136 AliMatrix(idrotm[2032], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
137 AliMatrix(idrotm[2033], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
138
139
140 Int_t *idtmed = fIdtmed->GetArray()-1999;
141//
142// The Space frame
143//
144//
145 Float_t pbox[3], ptrap[11], ptrd1[4], ppgon[10];
146
147 Float_t dx, dy, dz;
148 Int_t i, j, jmod;
149 jmod = 0;
150//
151// Constants
152 const Float_t kEps = 0.01;
153 const Int_t kAir = idtmed[2004];
154 const Int_t kSteel = idtmed[2064];
a9bfe689 155 const Int_t kAlu = idtmed[2008];
156 const Int_t kG10 = idtmed[2021];
b9c35690 157
158 const Float_t krad2deg = 180. / TMath::Pi();
159 const Float_t kdeg2rad = 1. / krad2deg;
160 const Float_t sin10 = TMath::Sin(10. * kdeg2rad);
161 const Float_t tan10 = TMath::Tan(10. * kdeg2rad);
162 const Float_t cos10 = TMath::Cos(10. * kdeg2rad);
163
164 const Float_t hR = 286; // distance of frame wrt vertex (tangential)
165 const Float_t iFrH = 119.00; // Height of inner frame
166 const Float_t ringH = 6.00; // Height of the ring bars
167 const Float_t ringW = 10.00; // Width of the ring bars in z
168 // Positions of ring bars
169 // outer
170 const Float_t dymodU[3] = {71.5, 228.5, 339.5};
171 // inner
172 const Float_t dymodL[3] = {50.0, 175.0, 297.5};
173 // orientation of web frame elements
174 const Float_t dymodO[5] = {10., -40., 20., -27.1, 18.4};
175 // Position of web frame elements
176 Float_t dymodW[5] = {70., 73.6, 224.5, 231.4, 340.2};
177 for (Int_t ii = 0; ii < 5; ii++) {
178 dymodW[ii] = dymodW[ii]-3.*TMath::Tan(dymodO[ii]*kdeg2rad);
179 }
180 // radial length of web frame elements
181 const Float_t dHz = 114.50;
182 // inner longitudinal bars 4 x 6
183 const Float_t longH = 6.00;
184 const Float_t longW = 4.00;
185 // outer longitudianl bars 8 x 8
186 const Float_t longOD = 8.0;
187 // length of inner longitudinal bars
188 const Float_t longLI = 615.;
189//
190// Frame mother volume
191//
192 TGeoPgon* shB77A = new TGeoPgon(0., 360., 18, 2);
193 shB77A->SetName("shB77A");
194 shB77A->DefineSection( 0, -376.5, 280., 415.7);
195 shB77A->DefineSection( 1, 376.5, 280., 415.7);
196 TGeoBBox* shB77B = new TGeoBBox(3.42, 2., 375.5);
197 shB77B->SetName("shB77B");
198 TGeoTranslation* trB77A = new TGeoTranslation("trB77A", +283.32, 0., 0.);
199 TGeoTranslation* trB77B = new TGeoTranslation("trB77B", -283.32, 0., 0.);
200 trB77A->RegisterYourself();
201 trB77B->RegisterYourself();
202 TGeoCompositeShape* shB77 = new TGeoCompositeShape("shB77", "shB77A+shB77B:trB77A+shB77B:trB77B");
203 TGeoVolume* voB77 = new TGeoVolume("B077", shB77, gGeoManager->GetMedium("FRAME_Air"));
204 voB77->SetName("B077"); // just to avoid a warning
205 TVirtualMC::GetMC()->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
206//
207// Reference plane #1 for TRD
208 TGeoPgon* shBREFA = new TGeoPgon(0.0, 360., 18, 2);
209 shBREFA->DefineSection( 0, -376., 280., 280.1);
210 shBREFA->DefineSection( 1, 376., 280., 280.1);
211 shBREFA->SetName("shBREFA");
212 TGeoCompositeShape* shBREF1 = new TGeoCompositeShape("shBREF1", "shBREFA-(shB77B:trB77A+shB77B:trB77B)");
213 TGeoVolume* voBREF = new TGeoVolume("BREF1", shBREF1, gGeoManager->GetMedium("FRAME_Air"));
214 voBREF->SetVisibility(0);
215 TVirtualMC::GetMC()->Gspos("BREF1", 1, "B077", 0., 0., 0., 0, "ONLY");
216//
217// The outer Frame
218//
219
220 Float_t dol = 4.;
221 Float_t doh = 4.;
222 Float_t ds = 0.63;
223//
224// Mother volume
225//
226 ppgon[0] = 0.;
227 ppgon[1] = 360.;
228 ppgon[2] = 18.;
229
230 ppgon[3] = 2.;
231
232 ppgon[4] = -350.;
233 ppgon[5] = 401.35;
234 ppgon[6] = 415.6;
235
236 ppgon[7] = -ppgon[4];
237 ppgon[8] = ppgon[5];
238 ppgon[9] = ppgon[6];
239 TVirtualMC::GetMC()->Gsvolu("B076", "PGON", kAir, ppgon, 10);
240 TVirtualMC::GetMC()->Gspos("B076", 1, "B077", 0., 0., 0., 0, "ONLY");
241//
242// Rings
243//
244 dz = 2. * 410.2 * TMath::Sin(10.*kdeg2rad) - 2. *dol * TMath::Cos(10.*kdeg2rad)- 2. * doh * TMath::Tan(10.*kdeg2rad);
245 Float_t l1 = dz/2.;
246 Float_t l2 = dz/2.+2.*doh*TMath::Tan(10.*kdeg2rad);
247
248
249 TGeoVolumeAssembly* asBI42 = new TGeoVolumeAssembly("BI42");
250 // Horizontal
251 ptrd1[0] = l2 - 0.6 * TMath::Tan(10.*kdeg2rad);
252 ptrd1[1] = l2;
253 ptrd1[2] = 8.0 / 2.;
254 ptrd1[3] = 0.6 / 2.;
255 TVirtualMC::GetMC()->Gsvolu("BIH142", "TRD1", kSteel, ptrd1, 4);
256 ptrd1[0] = l1;
257 ptrd1[1] = l1 + 0.6 * TMath::Tan(10.*kdeg2rad);
258 ptrd1[2] = 8.0 / 2.;
259 ptrd1[3] = 0.6 / 2.;
260 TVirtualMC::GetMC()->Gsvolu("BIH242", "TRD1", kSteel, ptrd1, 4);
261
262 // Vertical
263 ptrd1[0] = l1 + 0.6 * TMath::Tan(10.*kdeg2rad);
264 ptrd1[1] = l2 - 0.6 * TMath::Tan(10.*kdeg2rad);
265 ptrd1[2] = 0.8 / 2.;
266 ptrd1[3] = 6.8 / 2.;
267 TVirtualMC::GetMC()->Gsvolu("BIV42", "TRD1", kSteel, ptrd1, 4);
268 // Place
269 asBI42->AddNode(gGeoManager->GetVolume("BIV42"), 1, new TGeoTranslation(0., 0., 0.));
270 asBI42->AddNode(gGeoManager->GetVolume("BIH142"), 1, new TGeoTranslation(0., 0., 3.7));
271 asBI42->AddNode(gGeoManager->GetVolume("BIH242"), 1, new TGeoTranslation(0., 0., -3.7));
272//
273// longitudinal bars
274//
275// 80 x 80 x 6.3
276//
277 pbox[0] = dol;
278 pbox[1] = doh;
279 pbox[2] = 345.;
280 TVirtualMC::GetMC()->Gsvolu("B033", "BOX", kSteel, pbox, 3);
281 pbox[0] = dol-ds;
282 pbox[1] = doh-ds;
283 TVirtualMC::GetMC()->Gsvolu("B034", "BOX", kAir, pbox, 3);
284 TVirtualMC::GetMC()->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
285
286
287 //
288 // TPC support
289 //
290 pbox[0] = 3.37;
291 pbox[1] = 2.0;
292 pbox[2] = 307.5;
293 TVirtualMC::GetMC()->Gsvolu("B080", "BOX", kSteel, pbox, 3);
294 pbox[0] = 2.78;
295 pbox[1] = 1.4;
296 pbox[2] = 307.5;
297 TVirtualMC::GetMC()->Gsvolu("B081", "BOX", kAir, pbox, 3);
298 TVirtualMC::GetMC()->Gspos("B081", 1, "B080", 0., 0., 0., 0, "ONLY");
299
300 // Small 2nd reference plane elemenet
301 pbox[0] = 0.05;
302 pbox[1] = 2.0;
303 pbox[2] = 307.5;
304 TVirtualMC::GetMC()->Gsvolu("BREF2", "BOX", kAir, pbox, 3);
305 TVirtualMC::GetMC()->Gspos("BREF2", 1, "B080", 3.37 - 0.05, 0., 0., 0, "ONLY");
306
307 TVirtualMC::GetMC()->Gspos("B080", 1, "B077", 283.3, 0., 0., 0, "ONLY");
a9bfe689 308 TVirtualMC::GetMC()->Gspos("B080", 2, "B077", -283.3, 0., 0., idrotm[2088], "ONLY");
b9c35690 309
310
311//
312// Diagonal bars (1)
313//
314 Float_t h, d, dq, x, theta;
315
316 h = (dymodU[1]-dymodU[0]-2.*dol)*.999;
317 d = 2.*dol;
318 dq = h*h+dz*dz;
319
320 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
321
322
323 theta = krad2deg * TMath::ACos(x);
324
325 ptrap[0] = dz/2.;
326 ptrap[1] = theta;
327 ptrap[2] = 0.;
328 ptrap[3] = doh;
329 ptrap[4] = dol/x;
330 ptrap[5] = ptrap[4];
331 ptrap[6] = 0;
332 ptrap[7] = ptrap[3];
333 ptrap[8] = ptrap[4];
334 ptrap[9] = ptrap[4];
335 ptrap[10] = 0;
336
337 TVirtualMC::GetMC()->Gsvolu("B047", "TRAP", kSteel, ptrap, 11);
338 ptrap[3] = doh-ds;
339 ptrap[4] = (dol-ds)/x;
340 ptrap[5] = ptrap[4];
341 ptrap[7] = ptrap[3];
342 ptrap[8] = ptrap[4];
343 ptrap[9] = ptrap[4];
344 TVirtualMC::GetMC()->Gsvolu("B048", "TRAP", kAir, ptrap, 11);
345 TVirtualMC::GetMC()->Gspos("B048", 1, "B047", 0.0, 0.0, 0., 0, "ONLY");
346
347/*
348 Crosses (inner most)
349 \\ //
350 \\//
351 //\\
352 // \\
353*/
354 h = (2.*dymodU[0]-2.*dol)*.999;
355//
356// Mother volume
357//
358 pbox[0] = h/2;
359 pbox[1] = doh;
360 pbox[2] = dz/2.;
361 TVirtualMC::GetMC()->Gsvolu("BM49", "BOX ", kAir, pbox, 3);
362
363
364 dq = h*h+dz*dz;
365 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
366 theta = krad2deg * TMath::ACos(x);
367
368 ptrap[0] = dz/2.-kEps;
369 ptrap[1] = theta;
370 ptrap[2] = 0.;
371 ptrap[3] = doh-kEps;
372 ptrap[4] = dol/x;
373 ptrap[5] = ptrap[4];
374 ptrap[7] = ptrap[3];
375 ptrap[8] = ptrap[4];
376 ptrap[9] = ptrap[4];
377
378 TVirtualMC::GetMC()->Gsvolu("B049", "TRAP", kSteel, ptrap, 11);
379 ptrap[0] = ptrap[0]-kEps;
380 ptrap[3] = (doh-ds);
381 ptrap[4] = (dol-ds)/x;
382 ptrap[5] = ptrap[4];
383 ptrap[7] = ptrap[3];
384 ptrap[8] = ptrap[4];
385 ptrap[9] = ptrap[4];
386 TVirtualMC::GetMC()->Gsvolu("B050", "TRAP", kAir, ptrap, 11);
387 TVirtualMC::GetMC()->Gspos("B050", 1, "B049", 0.0, 0.0, 0., 0, "ONLY");
388 TVirtualMC::GetMC()->Gspos("B049", 1, "BM49", 0.0, 0.0, 0., 0, "ONLY");
389
390
391 Float_t dd1 = d*TMath::Tan(theta*kdeg2rad);
392 Float_t dd2 = d/TMath::Tan(2.*theta*kdeg2rad);
393 Float_t theta2 = TMath::ATan(TMath::Abs(dd2-dd1)/d/2.);
394
395
396 ptrap[0] = dol;
397 ptrap[1] = theta2*krad2deg;
398 ptrap[2] = 0.;
399 ptrap[3] = doh;
400 ptrap[4] = (dz/2./x-dd1-dd2)/2.;
401 ptrap[5] = ptrap[4];
402 ptrap[6] = 0.;
403 ptrap[7] = ptrap[3];
404 ptrap[8] = dz/4./x;
405 ptrap[9] = ptrap[8];
406
407
408 TVirtualMC::GetMC()->Gsvolu("B051", "TRAP", kSteel, ptrap, 11);
409 Float_t ddx0 = ptrap[8];
410
411 Float_t dd1s = dd1*(1.-2.*ds/d);
412 Float_t dd2s = dd2*(1.-2.*ds/d);
413 Float_t theta2s = TMath::ATan(TMath::Abs(dd2s-dd1s)/(d-2.*ds)/2.);
414
415
416 ptrap[0] = dol-ds;
417 ptrap[1] = theta2s*krad2deg;
418 ptrap[2] = 0.;
419 ptrap[3] = doh-ds;
420 ptrap[4] = ptrap[4]+ds/d/2.*(dd1+dd2);
421 ptrap[5] = ptrap[4];
422 ptrap[6] = 0.;
423 ptrap[7] = ptrap[3];
424 ptrap[8] = ptrap[8]-ds/2./d*(dd1+dd2);
425 ptrap[9] = ptrap[8];
426
427 TVirtualMC::GetMC()->Gsvolu("B052", "TRAP", kAir, ptrap, 11);
428 TVirtualMC::GetMC()->Gspos("B052", 1, "B051", 0.0, 0.0, 0., 0, "ONLY");
429
430 Float_t ddx, ddz, drx, drz, rtheta;
431
432 AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
433 rtheta = (90.-theta)*kdeg2rad;
434 ddx = -ddx0-dol*TMath::Tan(theta2);
435 ddz = -dol;
436
437 drx = TMath::Cos(rtheta) * ddx +TMath::Sin(rtheta) *ddz+pbox[0];
438 drz = -TMath::Sin(rtheta) * ddx +TMath::Cos(rtheta) *ddz-pbox[2];
439 TVirtualMC::GetMC()->Gspos("B051", 1, "BM49",
440 drx, 0.0, drz,
441 idrotm[2001], "ONLY");
442
443 AliMatrix(idrotm[2002], -theta, 0.0, 90.0, 90.0, 270.-theta, 0.0);
444 rtheta = (270.-theta)*kdeg2rad;
445
446 drx = TMath::Cos(rtheta) * ddx + TMath::Sin(rtheta) * ddz-pbox[0];
447 drz = -TMath::Sin(rtheta) * ddx + TMath::Cos(rtheta) * ddz+pbox[2];
448 TVirtualMC::GetMC()->Gspos("B051", 2, "BM49",
449 drx, 0.0, drz,
450 idrotm[2002], "ONLY");
451
452//
453// Diagonal bars (3)
454//
455 h = ((dymodU[2]-dymodU[1])-2.*dol)*.999;
456 dq = h*h+dz*dz;
457 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
458 theta = krad2deg * TMath::ACos(x);
459
460 ptrap[0] = dz/2.;
461 ptrap[1] = theta;
462 ptrap[3] = doh;
463 ptrap[4] = dol/x;
464 ptrap[5] = ptrap[4];
465 ptrap[7] = ptrap[3];
466 ptrap[8] = ptrap[4];
467 ptrap[9] = ptrap[4];
468
469 TVirtualMC::GetMC()->Gsvolu("B045", "TRAP", kSteel, ptrap, 11);
470 ptrap[3] = doh-ds;
471 ptrap[4] = (dol-ds)/x;
472 ptrap[5] = ptrap[4];
473 ptrap[7] = ptrap[3];
474 ptrap[8] = ptrap[4];
475 ptrap[9] = ptrap[4];
476 TVirtualMC::GetMC()->Gsvolu("B046", "TRAP", kAir, ptrap, 11);
477 TVirtualMC::GetMC()->Gspos("B046", 1, "B045", 0.0, 0.0, 0., 0, "ONLY");
478
479//
480// Positioning of diagonal bars
481
482 Float_t rd = 405.5;
483 dz = (dymodU[1]+dymodU[0])/2.;
484 Float_t dz2 = (dymodU[1]+dymodU[2])/2.;
485
486//
487// phi = 40
488//
489 Float_t phi = 40;
490 dx = rd * TMath::Sin(phi*kdeg2rad);
491 dy = rd * TMath::Cos(phi*kdeg2rad);
492
493
494 TVirtualMC::GetMC()->Gspos("B045", 1, "B076", -dx, dy, dz2, idrotm[2019], "ONLY");
495 TVirtualMC::GetMC()->Gspos("B045", 2, "B076", -dx, dy, -dz2, idrotm[2003], "ONLY"); // ?
496 TVirtualMC::GetMC()->Gspos("B045", 3, "B076", dx, dy, dz2, idrotm[2020], "ONLY");
497 TVirtualMC::GetMC()->Gspos("B045", 4, "B076", dx, dy, -dz2, idrotm[2027], "ONLY");
498
499
500//
501// phi = 60
502//
503
504 phi = 60;
505 dx = rd * TMath::Sin(phi*kdeg2rad);
506 dy = rd * TMath::Cos(phi*kdeg2rad);
507
508 TVirtualMC::GetMC()->Gspos("B045", 5, "B076", -dx, dy, dz2, idrotm[2021], "ONLY");
509 TVirtualMC::GetMC()->Gspos("B045", 6, "B076", -dx, dy, -dz2, idrotm[2028], "ONLY");
510 TVirtualMC::GetMC()->Gspos("B045", 7, "B076", dx, dy, dz2, idrotm[2022], "ONLY");
511 TVirtualMC::GetMC()->Gspos("B045", 8, "B076", dx, dy, -dz2, idrotm[2029], "ONLY");
512
513//
514// phi = 80
515//
516
517 phi = 80;
518 dx = rd * TMath::Sin(phi*kdeg2rad);
519 dy = rd * TMath::Cos(phi*kdeg2rad);
520
521 TVirtualMC::GetMC()->Gspos("B047", 13, "B076", -dx, -dy, dz, idrotm[2008], "ONLY");
522 TVirtualMC::GetMC()->Gspos("B047", 14, "B076", -dx, -dy, -dz, idrotm[2010], "ONLY");
523 TVirtualMC::GetMC()->Gspos("B047", 15, "B076", dx, -dy, dz, idrotm[2012], "ONLY");
524 TVirtualMC::GetMC()->Gspos("B047", 16, "B076", dx, -dy, -dz, idrotm[2011], "ONLY");
525
526 TVirtualMC::GetMC()->Gspos("B045", 9, "B076", -dx, dy, dz2, idrotm[2023], "ONLY");
527 TVirtualMC::GetMC()->Gspos("B045", 10, "B076", -dx, dy, -dz2, idrotm[2031], "ONLY");
528 TVirtualMC::GetMC()->Gspos("B045", 11, "B076", dx, dy, dz2, idrotm[2026], "ONLY");
529 TVirtualMC::GetMC()->Gspos("B045", 12, "B076", dx, dy, -dz2, idrotm[2030], "ONLY");
530
531 TVirtualMC::GetMC()->Gspos("B045", 13, "B076", -dx, -dy, dz2, idrotm[2024], "ONLY");
532 TVirtualMC::GetMC()->Gspos("B045", 14, "B076", -dx, -dy, -dz2, idrotm[2032], "ONLY");
533 TVirtualMC::GetMC()->Gspos("B045", 15, "B076", dx, -dy, dz2, idrotm[2025], "ONLY");
534 TVirtualMC::GetMC()->Gspos("B045", 16, "B076", dx, -dy, -dz2, idrotm[2033], "ONLY");
535
536 TVirtualMC::GetMC()->Gspos("BM49", 7, "B076", dx, -dy, 0., idrotm[2025], "ONLY");
537 TVirtualMC::GetMC()->Gspos("BM49", 8, "B076", -dx, -dy, 0., idrotm[2024], "ONLY");
538
539//
540// The internal frame
541//
542//
543//
544// Mother Volumes
545//
546 ptrd1[0] = (hR - longH/2.) * TMath::Tan(10. * kdeg2rad);
547 ptrd1[1] = (hR - longH/2. + iFrH ) * TMath::Tan(10. * kdeg2rad);;
548 ptrd1[2] = 376.5;
549 ptrd1[3] = iFrH / 2.;
550
551 Float_t r = 342.0;
552 Float_t rout1 = 405.5;
553 Float_t rout2 = 411.55;
554 TString module[18];
555
556 for (i = 0; i < 18; i++) {
557
558 // Create volume i
559 char name[16];
560 Int_t mod = i + 13;
561 if (mod > 17) mod -= 18;
562 snprintf(name, 16, "BSEGMO%d", mod);
563 TVirtualMC::GetMC()->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
564 gGeoManager->GetVolume(name)->SetVisibility(kFALSE);
565
566 module[i] = name;
567 // Place volume i
568 Float_t phi1 = i * 20.;
569 Float_t phi2 = 270 + phi1;
570 if (phi2 >= 360.) phi2 -= 360.;
571
572 dx = TMath::Sin(phi1*kdeg2rad)*r;
573 dy = -TMath::Cos(phi1*kdeg2rad)*r;
574
575 char nameR[16];
576 snprintf(nameR, 16, "B43_Rot_%d", i);
577 TGeoRotation* rot = new TGeoRotation(nameR, 90.0, phi1, 0., 0., 90., phi2);
578 AliMatrix(idrotm[2034+i], 90.0, phi1, 0., 0., 90., phi2);
579 TGeoVolume* vol77 = gGeoManager->GetVolume("B077");
580 TGeoVolume* volS = gGeoManager->GetVolume(name);
581 vol77->AddNode(volS, 1, new TGeoCombiTrans(dx, dy, 0., rot));
582
583//
584// Position elements of outer Frame
585//
586 dx = TMath::Sin(phi1*kdeg2rad)*rout1;
587 dy = -TMath::Cos(phi1*kdeg2rad)*rout1;
588 for (j = 0; j < 3; j++)
589 {
590 dz = dymodU[j];
591 TGeoVolume* vol = gGeoManager->GetVolume("B076");
592 vol->AddNode(asBI42, 6*i+2*j+1, new TGeoCombiTrans(dx, dy, dz, rot));
593 vol->AddNode(asBI42, 6*i+2*j+2, new TGeoCombiTrans(dx, dy, -dz, rot));
594 }
595
596 phi1 = i*20.+10;
597 phi2 = 270+phi1;
598 AliMatrix(idrotm[2052+i], 90.0, phi1, 90., phi2, 0., 0.);
599
600 dx = TMath::Sin(phi1*kdeg2rad)*rout2;
601 dy = -TMath::Cos(phi1*kdeg2rad)*rout2;
602 TVirtualMC::GetMC()->Gspos("B033", i+1, "B076", dx, dy, 0., idrotm[2052+i], "ONLY");
603//
604 }
605// Internal Frame rings
606//
607//
608// 60x60x5x6 for inner rings (I-beam)
609// 100x60x5 for front and rear rings
610//
611// Front and rear
612 ptrd1[0] = (hR - longH / 2.) * tan10 - longW / 2. / cos10;
613 ptrd1[1] = (hR + longH / 2.) * tan10 - longW / 2. / cos10;
614 ptrd1[2] = ringW / 2.;
615 ptrd1[3] = ringH / 2.;
616
617 TVirtualMC::GetMC()->Gsvolu("B072", "TRD1", kSteel, ptrd1, 4);
618
619 ptrd1[0] = (hR - longH / 2. + 0.5) * tan10 - longW / 2. / cos10;
620 ptrd1[1] = (hR + longH / 2. - 0.5) * tan10 - longW / 2. / cos10;
621 ptrd1[2] = ringW / 2. - 0.5;
622 ptrd1[3] = ringH / 2. - 0.5;
623
624 TVirtualMC::GetMC()->Gsvolu("B073", "TRD1", kAir, ptrd1, 4);
625 TVirtualMC::GetMC()->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
626//
627// I-Beam
628// Mother volume
629 TGeoVolumeAssembly* asBI72 = new TGeoVolumeAssembly("BI72");
630 // Horizontal
631 ptrd1[0] = 288.5* TMath::Sin(10.* kdeg2rad) - 2.1;
632 ptrd1[1] = 289.0 * TMath::Sin(10.* kdeg2rad) - 2.1;
633 ptrd1[2] = 6./2.;
634 ptrd1[3] = 0.5/2.;
635 TVirtualMC::GetMC()->Gsvolu("BIH172", "TRD1", kSteel, ptrd1, 4);
636 ptrd1[0] = 283.0 * TMath::Sin(10.* kdeg2rad) - 2.1;
637 ptrd1[1] = 283.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
638 ptrd1[2] = 6./2.;
639 ptrd1[3] = 0.5/2.;
640 TVirtualMC::GetMC()->Gsvolu("BIH272", "TRD1", kSteel, ptrd1, 4);
641
642 // Vertical
643 ptrd1[0] = 283.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
644 ptrd1[1] = 288.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
645 ptrd1[2] = 0.6/2.;
646 ptrd1[3] = 5./2.;
647 TVirtualMC::GetMC()->Gsvolu("BIV72", "TRD1", kSteel, ptrd1, 4);
648 // Place
649 asBI72->AddNode(gGeoManager->GetVolume("BIV72"), 1, new TGeoTranslation(0., 0., 0.));
650 asBI72->AddNode(gGeoManager->GetVolume("BIH172"), 1, new TGeoTranslation(0., 0., 2.75));
651 asBI72->AddNode(gGeoManager->GetVolume("BIH272"), 1, new TGeoTranslation(0., 0., -2.75));
652
653// Web frame
654//
655// h x w x s = 60 x 40 x 5
656// (attention: elements are half bars, "U" shaped)
657//
658
659 WebFrame("B063", dHz, dymodO[0], 10.);
660 WebFrame("B163", dHz, dymodO[1], 10.);
661 WebFrame("B263", dHz, dymodO[2], 10.);
662 WebFrame("B363", dHz, dymodO[3], 10.);
663 WebFrame("B463", dHz, dymodO[4], 10.);
664
665 dz = -iFrH / 2. + ringH / 2.+ kEps;
666
667 Float_t dz0 = longH / 2.;
668 Float_t dx0 = (hR + dz0 + 113/2.) * tan10 - longW / 4. / cos10;
669 for (jmod = 0; jmod< 18; jmod++)
670 {
671// ring bars
672 for (i = 0; i < 3; i++) {
673 // if ((i == 2) || (jmod ==0) || (jmod == 8)) {
674 if (i == 2) {
675 TVirtualMC::GetMC()->Gspos("B072", 6*jmod+i+1, module[jmod], 0, dymodL[i], dz, 0, "ONLY");
676 TVirtualMC::GetMC()->Gspos("B072", 6*jmod+i+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");
677 } else {
678 TGeoVolume* vol = gGeoManager->GetVolume(module[jmod]);
679 vol->AddNode(asBI72, 6*jmod+i+1, new TGeoTranslation(0, dymodL[i], dz));
680 vol->AddNode(asBI72, 6*jmod+i+4, new TGeoTranslation(0, -dymodL[i], dz));
681 }
682 }
683 }
684
685// outer diagonal web
686
687 dy = dymodW[0] - (dHz/2.) * TMath::Tan(dymodO[0] * kdeg2rad);
688
689 for (jmod = 0; jmod < 18; jmod++) {
690 TVirtualMC::GetMC()->Gspos("B063I", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2096], "ONLY");
691 TVirtualMC::GetMC()->Gspos("B063", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2097], "ONLY");
692 TVirtualMC::GetMC()->Gspos("B063I", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
693 TVirtualMC::GetMC()->Gspos("B063", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
694 }
695
696 dy = dymodW[1] - (dHz/2.) * TMath::Tan(dymodO[1] * kdeg2rad);
697
698 for (jmod = 0; jmod < 18; jmod++) {
699 TVirtualMC::GetMC()->Gspos("B163I", 4*jmod+1, module[jmod], dx0, -dy, dz0, idrotm[2096], "ONLY");
700 TVirtualMC::GetMC()->Gspos("B163", 4*jmod+2, module[jmod], dx0, dy, dz0, idrotm[2097], "ONLY");
701 TVirtualMC::GetMC()->Gspos("B163I", 4*jmod+3, module[jmod], -dx0, dy, dz0, idrotm[2087], "ONLY");
702 TVirtualMC::GetMC()->Gspos("B163", 4*jmod+4, module[jmod], -dx0, -dy, dz0, idrotm[2086], "ONLY");
703 }
704
705 dy = dymodW[2] - (dHz/2) * TMath::Tan(dymodO[2] * kdeg2rad);
706
707 for (jmod = 0; jmod < 18; jmod++) {
708 TVirtualMC::GetMC()->Gspos("B263I", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2096], "ONLY");
709 TVirtualMC::GetMC()->Gspos("B263", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2097], "ONLY");
710 TVirtualMC::GetMC()->Gspos("B263I", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
711 TVirtualMC::GetMC()->Gspos("B263", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
712 }
713
714 dy = dymodW[3] - (dHz/2.) * TMath::Tan(dymodO[3] * kdeg2rad);
715
716 for (jmod = 0; jmod < 18; jmod++) {
717 TVirtualMC::GetMC()->Gspos("B363I", 4*jmod+1, module[jmod], dx0, -dy, dz0, idrotm[2096], "ONLY");
718 TVirtualMC::GetMC()->Gspos("B363", 4*jmod+2, module[jmod], dx0, dy, dz0, idrotm[2097], "ONLY");
719 TVirtualMC::GetMC()->Gspos("B363I", 4*jmod+3, module[jmod], -dx0, dy, dz0, idrotm[2087], "ONLY");
720 TVirtualMC::GetMC()->Gspos("B363", 4*jmod+4, module[jmod], -dx0, -dy, dz0, idrotm[2086], "ONLY");
721 }
722
723 dy = dymodW[4] - (dHz/2.) * TMath::Tan(dymodO[4] * kdeg2rad);
724
725 for (jmod = 0; jmod < 18; jmod++) {
726 TVirtualMC::GetMC()->Gspos("B463I", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2096], "ONLY");
727 TVirtualMC::GetMC()->Gspos("B463", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2097], "ONLY");
728 TVirtualMC::GetMC()->Gspos("B463I", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
729 TVirtualMC::GetMC()->Gspos("B463", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
730 }
731
732// longitudinal bars (TPC rails attached)
733// new specs:
734// h x w x s = 100 x 75 x 6
735// current:
736// ??
737// ??
738// Attention: 2 "U" shaped half rods per cell
739// longitudinal bars (no TPC rails attached)
740// new specs: h x w x s = 40 x 60 x 5
741//
742//
743//
744 Float_t lbox[3];
745 lbox[0] = longW / 4.;
746 lbox[2] = longH / 2.;
747 lbox[1] = longLI / 2.;
a9bfe689 748 TVirtualMC::GetMC()->Gsvolu("BA59", "BOX", kSteel, lbox, 3);
749 gGeoManager->GetVolume("BA59")->SetVisContainers();
b9c35690 750 lbox[0] = longW / 4. - 0.25;
751 lbox[2] = longH / 2. - 0.50;
752 TVirtualMC::GetMC()->Gsvolu("BA62", "BOX", kAir, lbox, 3);
753 TVirtualMC::GetMC()->Gspos("BA62", 1, "BA59", 0.25, 0.0, 0.0, 0, "ONLY");
754
755 dz = -iFrH / 2. + longH / 2. - 0.17;
756 dx = hR * tan10 - longW / 4. / cos(10);
757 for (jmod = 0; jmod < 18; jmod++) {
758 TVirtualMC::GetMC()->Gspos("BA59", 2*jmod+1, module[jmod], 49.31, 0.0, dz, idrotm[2096], "ONLY");
759 TVirtualMC::GetMC()->Gspos("BA59", 2*jmod+2, module[jmod], -49.31, 0.0, dz, idrotm[2087], "ONLY");
760 }
761 //
762 // Rails for TRD
763 //
764 // Pos 1
765 //
a9bfe689 766 // angular 80deg profile
b9c35690 767 lbox[2] = 4.0;
768 lbox[0] = 0.2;
769 lbox[1] = longLI / 2.;
770 TVirtualMC::GetMC()->Gsvolu("BTRDR_10", "BOX", kSteel, lbox, 3);
a9bfe689 771
b9c35690 772 ptrd1[0] = 3.;
773 ptrd1[1] = 3. + 0.4 * tan10;
774 ptrd1[2] = 307.5;
775 ptrd1[3] = 0.2;
776 TVirtualMC::GetMC()->Gsvolu("BTRDR_11", "TRD1", kSteel, ptrd1, 4);
a9bfe689 777
778 lbox[2] = 2.0;
779 lbox[0] = 0.3;
780 lbox[1] = longLI / 2.;
781 TVirtualMC::GetMC()->Gsvolu("BTRDR_12", "BOX", kAlu, lbox, 3);
782 gGeoManager->GetVolume("BTRDR_12")->SetVisContainers();
783
784 lbox[2] = 2.0;
785 lbox[0] = 0.1;
786 lbox[1] = longLI / 2.;
787 TVirtualMC::GetMC()->Gsvolu("BTRDR_13", "BOX", kG10, lbox, 3);
788 TVirtualMC::GetMC()->Gspos("BTRDR_13", 1, "BTRDR_12", -0.2, 0.0, 0.0, 0, "ONLY");
789
790 lbox[2] = 0.1;
791 lbox[0] = 2.0;
792 lbox[1] = longLI / 2.;
793 TVirtualMC::GetMC()->Gsvolu("BTRDR_14", "BOX", kG10, lbox, 3);
794
b9c35690 795 // Pos 2
796 // 40 x 10
797 lbox[2] = 2.0;
798 lbox[0] = 0.5;
799 lbox[1] = longLI / 2.;
a9bfe689 800 TVirtualMC::GetMC()->Gsvolu("BTRDR_2", "BOX", kAlu, lbox, 3);
b9c35690 801
802 // Pos 3
803 // 40 x 14
804 lbox[0] = 2.0;
805 lbox[2] = 0.7;
806 lbox[1] = 307.5;
a9bfe689 807 TVirtualMC::GetMC()->Gsvolu("BTRDR_3", "BOX", kAlu, lbox, 3);
b9c35690 808
a9bfe689 809 dz = -iFrH / 2. + longH / 2.;
810 Float_t zpos = 80.;
811 Int_t isec_1[11] = {0, 1, 2, 3, 4, 5, 13, 14, 15, 16, 17};
812 Int_t isec_2a[16] = {1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17};
813 Int_t isec_2b[6] = {6, 7, 8, 10, 11, 12};
814 Int_t isec_3[9] = {5, 6, 7, 8, 9, 10, 11, 12, 13};
815 for (Int_t index = 0; index < 11; index++) {
816 jmod = isec_1[index];
817 Float_t dz1 = dz + 3. + (zpos - 4.);
818 dx0 = (hR + dz0 + zpos - 4.) * tan10 - (longW / 2. + 0.2) / cos10;
819 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_10", 2*jmod+1, module[jmod], dx0, 0.0, dz1, idrotm[2096], "ONLY");
820 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_10", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, idrotm[2086], "ONLY");
821 dx0 -= 0.5;
822 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_12", 2*jmod+1, module[jmod], dx0, 0.0, dz1, idrotm[2096], "ONLY");
823 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_12", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, idrotm[2087], "ONLY");
824 dz1 += (4 - 0.2);
825 dx0 = (hR + dz0 + zpos - 0.2) * tan10 - (longW / 2. + 3. + 0.4) / cos10;
826 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_11", 2*jmod+1, module[jmod], dx0, 0.0, dz1, 0, "ONLY");
827 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_11", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, 0, "ONLY");
828 dz1 -= 0.3;
829 dx0 -= 0.5;
830 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_14", 2*jmod+1, module[jmod], dx0, 0.0, dz1, 0, "ONLY");
831 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_14", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, 0, "ONLY");
832 }
b9c35690 833
a9bfe689 834 for (Int_t index = 0; index < 16; index++) {
835 jmod = isec_2a[index];
b9c35690 836 dx0 = (hR + dz0 ) * tan10 + 10. * sin10 - (longW / 4. + 0.5) / cos10;
a9bfe689 837 if (jmod >8) {
838 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+1, module[jmod], dx0-1.5, 0.0, dz + 3. + 8. * cos10, idrotm[2096], "ONLY");
839 } else {
840 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+2, module[jmod], -dx0+1.5, 0.0, dz + 3. + 8. * cos10, idrotm[2086], "ONLY");
841 }
842 }
843
844 for (Int_t index = 0; index < 6; index++) {
845 jmod = isec_2b[index];
846 dx0 = (hR + dz0 + zpos) * tan10 - (longW / 4. + 0.5) / cos10;
847 if (index < 3) {
848 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+2, module[jmod], -dx0+1.5, 0.0, dz + 3. + zpos, idrotm[2086], "ONLY");
849 } else {
850 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+1, module[jmod], dx0-1.5, 0.0, dz + 3. + zpos, idrotm[2096], "ONLY");
851 }
852 }
853
854 for (Int_t index = 0; index < 9; index++) {
855 jmod = isec_3[index];
856 if (index > 1) TVirtualMC::GetMC()->Gspos("BTRDR_3", 2*jmod+1, module[jmod], 50.96-5-2., 0.0, dz+3.7, 0, "ONLY");
857 if (index < 7) TVirtualMC::GetMC()->Gspos("BTRDR_3", 2*jmod+2, module[jmod], -50.96+5+2., 0.0, dz+3.7, 0, "ONLY");
b9c35690 858 }
859//
860// Thermal shield
861//
862
863 Float_t dyM = 99.0;
864 MakeHeatScreen("M", dyM, idrotm[2090], idrotm[2091]);
865 Float_t dyAM = 119.5;
866 MakeHeatScreen("AM", dyAM, idrotm[2090], idrotm[2091]);
867 Float_t dyA = 122.5 - 5.5;
868 MakeHeatScreen("A" , dyA, idrotm[2090], idrotm[2091]);
869
870//
871//
872//
873 dz = -57.2 + 0.6;
874 for (i = 0; i < 18; i++) {
875
876 char nameMo[16];
877 snprintf(nameMo, 16, "BSEGMO%d",i);
878 // M
879 TVirtualMC::GetMC()->Gspos("BTSH_M" , i+1 , nameMo, 0., 0., dz, 0, "ONLY");
880 // AM, CM
881 dy = dymodL[0] + dyAM / 2. + 3.;
882 TVirtualMC::GetMC()->Gspos("BTSH_AM", i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
883 TVirtualMC::GetMC()->Gspos("BTSH_AM", i+19, nameMo, 0., -dy, dz, 0, "ONLY");
884 // A, C
885 dy = dymodL[1] + dyA / 2 + 0.4;
886 TVirtualMC::GetMC()->Gspos("BTSH_A" , i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
887 TVirtualMC::GetMC()->Gspos("BTSH_A" , i+19, nameMo, 0., -dy, dz, 0, "ONLY");
888}
889
890
891 //
892 // TRD mother volumes
893 //
894 // absolute position of center 290.43 + 38.95 = 329.38
895 // frame center 283.00 + 59.50 = 342.50
896 // relative position of TRD 329.38 - 342.50
897 ptrd1[0] = 47.4405; // CBL 28/6/2006
898 ptrd1[1] = 61.1765; // CBL
899 ptrd1[2] = 375.5; // CBL
900 ptrd1[3] = 38.95; // CBL
901
902 for (i = 0; i < 18; i++) {
903 char nameCh[16];
904 snprintf(nameCh, 16, "BTRD%d",i);
905 char nameMo[16];
906 snprintf(nameMo, 16, "BSEGMO%d",i);
907 TVirtualMC::GetMC()->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
908 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
909 TVirtualMC::GetMC()->Gspos(nameCh, 1, nameMo, 0., 0., -13.12, 0, "ONLY"); // CBL 28/6/2006
910 }
911
912//
913// TOF mother volumes as modified by B.Guerzoni
914// to remove overlaps/extrusions in case of aligned TOF SMs
915//
916 ptrd1[0] = 62.2500;
917 ptrd1[1] = 64.25;
918 ptrd1[2] = 372.6;
919 ptrd1[3] = 14.525/2;
920 char nameChA[16];
921 snprintf(nameChA, 16, "BTOFA");
922 TGeoTrd1 *trd1=new TGeoTrd1(nameChA,ptrd1[0],ptrd1[1],ptrd1[2],ptrd1[3]);
923 trd1->SetName("BTOFA"); // just to avoid a warning
924 char nameChB[16];
925 snprintf(nameChB, 16, "BTOFB");
926 TGeoBBox *box1 = new TGeoBBox(nameChB,64.25 ,372.6, 14.525/2);
927 box1->SetName("BTOFB"); // just to avoid a warning
928 TGeoTranslation *tr1 = new TGeoTranslation("trnsl1",0, 0, -14.525/2 );
929 tr1->RegisterYourself();
930 TGeoTranslation *tr2 = new TGeoTranslation("trnsl2",0, 0, +14.525/2 );
931 tr2->RegisterYourself();
932 TGeoCompositeShape *btofcs =new TGeoCompositeShape("Btofcs","(BTOFA:trnsl1)+(BTOFB:trnsl2)");
933
934
935 for (i = 0; i < 18; i++) {
936 char nameCh[16];
937 snprintf(nameCh, 16, "BTOF%d",i);
938 char nameMo[16];
939 snprintf(nameMo, 16, "BSEGMO%d",i);
940 TGeoVolume* btf = new TGeoVolume(nameCh, btofcs, gGeoManager->GetMedium("FRAME_Air"));
941 btf->SetName(nameCh);
942 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
943 TVirtualMC::GetMC()->Gspos(nameCh, 1, nameMo, 0., 0., 43.525, 0, "ONLY");
944 }
945//
946// Geometry of Rails starts here
947//
948//
949//
950// Rails for space-frame
951//
952 Float_t rbox[3];
953
954 rbox[0] = 25.00;
955 rbox[1] = 27.50;
956 rbox[2] = 600.00;
957 TVirtualMC::GetMC()->Gsvolu("BRS1", "BOX", kAir, rbox, 3);
958
959 rbox[0] = 25.00;
960 rbox[1] = 3.75;
961 TVirtualMC::GetMC()->Gsvolu("BRS2", "BOX", kSteel, rbox, 3);
962
963 rbox[0] = 3.00;
964 rbox[1] = 20.00;
965 TVirtualMC::GetMC()->Gsvolu("BRS3", "BOX", kSteel, rbox, 3);
966
967 TVirtualMC::GetMC()->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
968 TVirtualMC::GetMC()->Gspos("BRS2", 2, "BRS1", 0., 27.5-3.75, 0., 0, "ONLY");
969 TVirtualMC::GetMC()->Gspos("BRS3", 1, "BRS1", 0., 0., 0., 0, "ONLY");
970 TVirtualMC::GetMC()->Gspos("BRS1", 1, "ALIC", -430.-3., -190., 0., 0, "ONLY");
971 TVirtualMC::GetMC()->Gspos("BRS1", 2, "ALIC", 430.+3., -190., 0., 0, "ONLY");
972
973 rbox[0] = 3.0;
974 rbox[1] = 145./4.;
975 rbox[2] = 25.0;
976 TVirtualMC::GetMC()->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
977
978 TVirtualMC::GetMC()->Gspos("BRS4", 1, "ALIC", 430.+3., -190.+55./2.+rbox[1], 224., 0, "ONLY");
979 TVirtualMC::GetMC()->Gspos("BRS4", 2, "ALIC", 430.+3., -190.+55./2.+rbox[1], -224., 0, "ONLY");
980// TVirtualMC::GetMC()->Gspos("BRS4", 3, "ALIC", -430.+3, -180.+55./2.+rbox[1], 224., 0, "ONLY");
981// TVirtualMC::GetMC()->Gspos("BRS4", 4, "ALIC", -430.+3, -180.+55./2.+rbox[1], -224., 0, "ONLY");
982
983
984
985 //
986 // The Backframe
987 //
988 // Inner radius
989 Float_t kBFMRin = 270.0;
990 // Outer Radius
991 Float_t kBFMRou = 417.5;
992 // Width
993 Float_t kBFMdz = 118.0;
994 //
995 //
996 // Rings
997 Float_t kBFRdr = 7.5;
998 Float_t kBFRdz = 8.0;
999 //
1000 //
1001 // Bars and Spokes
1002 //
1003 Float_t kBFBd = 8.0;
1004 Float_t kBFBdd = 0.6;
1005
1006
1007 // The Mother volume
1008 Float_t tpar[3];
1009 tpar[0] = kBFMRin;
1010 tpar[1] = kBFMRou;
1011 tpar[2] = kBFMdz / 2.;
1012 TVirtualMC::GetMC()->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);
1013
1014 // CBL ////////////////////////////////////////////////////////
1015 //
1016 // TRD mother volume
1017 //
1018
1019 ptrd1[0] = 47.4405 - 0.3;
1020 ptrd1[1] = 61.1765 - 0.3;
1021 ptrd1[2] = kBFMdz / 2.;
1022 ptrd1[3] = 38.95;
1023 TVirtualMC::GetMC()->Gsvolu("BFTRD", "TRD1", kAir, ptrd1, 4);
1024 gGeoManager->GetVolume("BFTRD")->SetVisibility(kFALSE);
1025
1026 for (i = 0; i < 18; i++) {
1027
1028 Float_t phiBF = i * 20.0;
1029 dx = TMath::Sin(phiBF*kdeg2rad)*(342.0-12.62);
1030 dy = -TMath::Cos(phiBF*kdeg2rad)*(342.0-12.62);
1031 TVirtualMC::GetMC()->Gspos("BFTRD",i,"BFMO",dx,dy,0.0,idrotm[2034+i],"ONLY");
1032
1033 }
1034
1035 // CBL ////////////////////////////////////////////////////////
1036
1037 // Rings
1038 //
1039 // Inner Ring
1040 tpar[0] = kBFMRin;
1041 tpar[1] = tpar[0] + kBFRdr;
1042 tpar[2] = kBFRdz / 2.;
1043
1044 TVirtualMC::GetMC()->Gsvolu("BFIR", "TUBE", kSteel, tpar, 3);
1045
1046 tpar[0] = tpar[0] + kBFBdd;
1047 tpar[1] = tpar[1] - kBFBdd;
1048 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
1049
1050 TVirtualMC::GetMC()->Gsvolu("BFII", "TUBE", kAir, tpar, 3);
1051 TVirtualMC::GetMC()->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");
1052
1053 //
1054 // Outer RING
1055 tpar[0] = kBFMRou - kBFRdr + 0.1;
1056 tpar[1] = kBFMRou;
1057 tpar[2] = kBFRdz / 2.;
1058
1059 TVirtualMC::GetMC()->Gsvolu("BFOR", "TUBE", kSteel, tpar, 3);
1060
1061 tpar[0] = tpar[0] + kBFBdd;
1062 tpar[1] = tpar[1] - kBFBdd;
1063 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
1064
1065 TVirtualMC::GetMC()->Gsvolu("BFOO", "TUBE", kAir, tpar, 3);
1066 TVirtualMC::GetMC()->Gspos("BFOO", 1, "BFOR", 0., 0., 0., 0, "ONLY");
1067
1068
1069 dz = kBFMdz/2. - kBFRdz / 2.;
1070 TVirtualMC::GetMC()->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1071 TVirtualMC::GetMC()->Gspos("BFIR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1072 TVirtualMC::GetMC()->Gspos("BFOR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1073 TVirtualMC::GetMC()->Gspos("BFOR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1074
1075 //
1076 // Longitudinal Bars
1077 //
1078 Float_t bpar[3];
1079
1080 bpar[0] = kBFBd/2;
1081 bpar[1] = bpar[0];
1082 bpar[2] = kBFMdz/2. - kBFBd;
1083 TVirtualMC::GetMC()->Gsvolu("BFLB", "BOX ", kSteel, bpar, 3);
1084
1085 bpar[0] = bpar[0] - kBFBdd;
1086 bpar[1] = bpar[1] - kBFBdd;
1087 bpar[2] = bpar[2] - kBFBdd;
1088 TVirtualMC::GetMC()->Gsvolu("BFLL", "BOX ", kAir, bpar, 3);
1089 TVirtualMC::GetMC()->Gspos("BFLL", 1, "BFLB", 0., 0., 0., 0, "ONLY");
1090
1091 for (i = 0; i < 18; i++)
1092 {
1093 Float_t ro = kBFMRou - kBFBd / 2. - 0.02;
1094 Float_t ri = kBFMRin + kBFBd / 2.;
1095
1096 Float_t phi0 = Float_t(i) * 20.;
1097
1098 Float_t xb = ri * TMath::Cos(phi0 * kDegrad);
1099 Float_t yb = ri * TMath::Sin(phi0 * kDegrad);
1100 AliMatrix(idrotm[2090+i], 90.0, phi0, 90.0, phi0 + 270., 0., 0.);
1101
1102 TVirtualMC::GetMC()->Gspos("BFLB", i + 1, "BFMO", xb, yb, 0., idrotm[2090 + i], "ONLY");
1103
1104 xb = ro * TMath::Cos(phi0 * kDegrad);
1105 yb = ro * TMath::Sin(phi0 * kDegrad);
1106
1107 TVirtualMC::GetMC()->Gspos("BFLB", i + 19, "BFMO", xb, yb, 0., idrotm[2090 +i], "ONLY");
1108 }
1109
1110 //
1111 // Radial Bars
1112 //
1113 bpar[0] = (kBFMRou - kBFMRin - 2. * kBFRdr) / 2.;
1114 bpar[1] = kBFBd/2;
1115 bpar[2] = bpar[1];
1116 //
1117 // Avoid overlap with circle
1118 Float_t rr = kBFMRou - kBFRdr;
1119 Float_t delta = rr - TMath::Sqrt(rr * rr - kBFBd * kBFBd / 4.) + 0.01;
1120 bpar[0] -= delta /2.;
1121
1122
1123 TVirtualMC::GetMC()->Gsvolu("BFRB", "BOX ", kSteel, bpar, 3);
1124
1125 bpar[0] = bpar[0] - kBFBdd;
1126 bpar[1] = bpar[1] - kBFBdd;
1127 bpar[2] = bpar[2] - kBFBdd;
1128 TVirtualMC::GetMC()->Gsvolu("BFRR", "BOX ", kAir, bpar, 3);
1129 TVirtualMC::GetMC()->Gspos("BFRR", 1, "BFRB", 0., 0., 0., 0, "ONLY");
1130
1131 Int_t iphi[10] = {0, 1, 3, 6, 8, 9, 10, 12, 15, 17};
1132
1133 for (i = 0; i < 10; i++)
1134 {
1135
1136 Float_t rb = (kBFMRin + kBFMRou)/2.;
1137 Float_t phib = Float_t(iphi[i]) * 20.;
1138
1139 Float_t xb = rb * TMath::Cos(phib * kDegrad);
1140 Float_t yb = rb * TMath::Sin(phib * kDegrad);
1141
1142 TVirtualMC::GetMC()->Gspos("BFRB", i + 1, "BFMO", xb, yb, dz, idrotm[2034 + iphi[i]], "ONLY");
1143 TVirtualMC::GetMC()->Gspos("BFRB", i + 11, "BFMO", xb, yb, -dz, idrotm[2034 + iphi[i]], "ONLY");
1144
1145 }
1146
1147 TVirtualMC::GetMC()->Gspos("BFMO", i + 19, "ALIC", 0, 0, - 376. - kBFMdz/2. - 0.5 , 0, "ONLY");
1148
1149
1150
1151//
1152//
1153// The Baby Frame
1154//
1155//
1156 //
1157 // Inner radius
1158 Float_t kBBMRin = 278.0;
1159 // Outer Radius
1160 Float_t kBBMRou = 410.5;
1161 // Width
1162 Float_t kBBMdz = 223.0;
1163 Float_t kBBBdz = 6.0;
1164 Float_t kBBBdd = 0.6;
1165
1166
1167 // The Mother volume
1168
1169 ppgon[0] = 0.;
1170 ppgon[1] = 360.;
1171 ppgon[2] = 18.;
1172
1173 ppgon[3] = 2.;
1174 ppgon[4] = -kBBMdz / 2. ;
1175 ppgon[5] = kBBMRin;
1176 ppgon[6] = kBBMRou;
1177
1178 ppgon[7] = -ppgon[4];
1179 ppgon[8] = ppgon[5];
1180 ppgon[9] = ppgon[6];
1181
1182 TVirtualMC::GetMC()->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
1183 TVirtualMC::GetMC()->Gsdvn("BBCE", "BBMO", 18, 2);
1184
1185 // CBL ////////////////////////////////////////////////////////
1186 //
1187 // TRD mother volume
1188 //
1189
1190 AliMatrix(idrotm[2092], 90.0, 90.0, 0.0, 0.0, 90.0, 0.0);
1191
1192 ptrd1[0] = 47.4405 - 2.5;
1193 ptrd1[1] = 61.1765 - 2.5;
1194 ptrd1[2] = kBBMdz / 2.;
1195 ptrd1[3] = 38.95;
1196 TVirtualMC::GetMC()->Gsvolu("BBTRD", "TRD1", kAir, ptrd1, 4);
1197 gGeoManager->GetVolume("BBTRD")->SetVisibility(kFALSE);
1198 TVirtualMC::GetMC()->Gspos("BBTRD", 1, "BBCE", 342.0-12.62, 0.0, 0.0, idrotm[2092], "ONLY");
1199
1200 // CBL ////////////////////////////////////////////////////////
1201
1202 // Longitudinal bars
1203 bpar[0] = kBBBdz/2.;
1204 bpar[1] = bpar[0];
1205 bpar[2] = kBBMdz/2. - kBBBdz;
1206 TVirtualMC::GetMC()->Gsvolu("BBLB", "BOX ", kSteel, bpar, 3);
1207 bpar[0] -= kBBBdd;
1208 bpar[1] -= kBBBdd;
1209 bpar[2] -= kBBBdd;
1210 TVirtualMC::GetMC()->Gsvolu("BBLL", "BOX ", kAir, bpar, 3);
1211 TVirtualMC::GetMC()->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY");
1212
1213 dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
1214 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1215 TVirtualMC::GetMC()->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1216
1217 dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
1218 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1219
1220 TVirtualMC::GetMC()->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1221
1222 //
1223 // Radial Bars
1224 //
1225 bpar[0] = (kBBMRou - kBBMRin) / 2. - kBBBdz;
1226 bpar[1] = kBBBdz/2;
1227 bpar[2] = bpar[1];
1228
1229 TVirtualMC::GetMC()->Gsvolu("BBRB", "BOX ", kSteel, bpar, 3);
1230 bpar[0] -= kBBBdd;
1231 bpar[1] -= kBBBdd;
1232 bpar[2] -= kBBBdd;
1233 TVirtualMC::GetMC()->Gsvolu("BBRR", "BOX ", kAir, bpar, 3);
1234 TVirtualMC::GetMC()->Gspos("BBRR", 1, "BBRB", 0., 0., 0., 0, "ONLY");
1235
1236
1237 dx = (kBBMRou + kBBMRin) / 2.;
1238 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1239 dz = kBBMdz/2. - kBBBdz / 2.;
1240
1241 TVirtualMC::GetMC()->Gspos("BBRB", 1, "BBCE", dx, dy, dz, idrotm[2052], "ONLY");
1242 TVirtualMC::GetMC()->Gspos("BBRB", 2, "BBCE", dx, dy, - dz, idrotm[2052], "ONLY");
1243 TVirtualMC::GetMC()->Gspos("BBRB", 3, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1244
1245 //
1246 // Circular bars
1247 //
1248 // Inner
1249
1250 bpar[1] = kBBMRin * TMath::Sin(10. * kDegrad);
1251 bpar[0] = kBBBdz/2;
1252 bpar[2] = bpar[0];
1253 TVirtualMC::GetMC()->Gsvolu("BBC1", "BOX ", kSteel, bpar, 3);
1254 bpar[0] -= kBBBdd;
1255 bpar[1] -= kBBBdd;
1256 bpar[2] -= kBBBdd;
1257 TVirtualMC::GetMC()->Gsvolu("BBC2", "BOX ", kAir, bpar, 3);
1258 TVirtualMC::GetMC()->Gspos("BBC2", 1, "BBC1", 0., 0., 0., 0, "ONLY");
1259 dx = kBBMRin + kBBBdz/2;
1260 dy = 0.;
1261 TVirtualMC::GetMC()->Gspos("BBC1", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1262 TVirtualMC::GetMC()->Gspos("BBC1", 2, "BBCE", dx, dy, -dz, 0, "ONLY");
1263 //
1264 // Outer
1265 bpar[1] = (kBBMRou - kBBBdz) * TMath::Sin(10. * kDegrad);
1266 bpar[0] = kBBBdz/2;
1267 bpar[2] = bpar[0];
1268 TVirtualMC::GetMC()->Gsvolu("BBC3", "BOX ", kSteel, bpar, 3);
1269 bpar[0] -= kBBBdd;
1270 bpar[1] -= kBBBdd;
1271 bpar[2] -= kBBBdd;
1272 TVirtualMC::GetMC()->Gsvolu("BBC4", "BOX ", kAir, bpar, 3);
1273 TVirtualMC::GetMC()->Gspos("BBC4", 1, "BBC3", 0., 0., 0., 0, "ONLY");
1274 dx = kBBMRou - kBBBdz/2;
1275 dy = 0.;
1276 TVirtualMC::GetMC()->Gspos("BBC3", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1277 TVirtualMC::GetMC()->Gspos("BBC3", 2, "BBCE", dx, dy, - dz, 0, "ONLY");
1278 //
1279 // Diagonal Bars
1280 //
1281 h = (kBBMRou - kBBMRin - 2. * kBBBdz);;
1282 d = kBBBdz;
1283 dz = kBBMdz/2. - 1.6 * kBBBdz;
1284 dq = h*h+dz*dz;
1285
1286 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
1287
1288
1289 theta = kRaddeg * TMath::ACos(x);
1290
1291 ptrap[0] = dz/2.;
1292 ptrap[1] = theta;
1293 ptrap[2] = 0.;
1294 ptrap[3] = d/2;
1295 ptrap[4] = d/x/2;
1296 ptrap[5] = ptrap[4];
1297 ptrap[6] = 0;
1298 ptrap[7] = ptrap[3];
1299 ptrap[8] = ptrap[4];
1300 ptrap[9] = ptrap[4];
1301 ptrap[10] = 0;
1302 TVirtualMC::GetMC()->Gsvolu("BBD1", "TRAP", kSteel, ptrap, 11);
1303 ptrap[3] = d/2-kBBBdd;
1304 ptrap[4] = (d/2-kBBBdd)/x;
1305 ptrap[5] = ptrap[4];
1306 ptrap[7] = ptrap[3];
1307 ptrap[8] = ptrap[4];
1308 ptrap[9] = ptrap[4];
1309 TVirtualMC::GetMC()->Gsvolu("BBD3", "TRAP", kAir, ptrap, 11);
1310 TVirtualMC::GetMC()->Gspos("BBD3", 1, "BBD1", 0.0, 0.0, 0., 0, "ONLY");
1311 dx = (kBBMRou + kBBMRin) / 2.;
1312 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1313 TVirtualMC::GetMC()->Gspos("BBD1", 1, "BBCE", dx, dy, dz/2. + kBBBdz/2., idrotm[2052], "ONLY");
1314
1315
1316 ptrap[0] = dz/2.;
1317 ptrap[1] = -theta;
1318 ptrap[2] = 0.;
1319 ptrap[3] = d/2;
1320 ptrap[4] = d/2/x;
1321 ptrap[5] = ptrap[4];
1322 ptrap[6] = 0;
1323 ptrap[7] = ptrap[3];
1324 ptrap[8] = ptrap[4];
1325 ptrap[9] = ptrap[4];
1326 ptrap[10] = 0;
1327 TVirtualMC::GetMC()->Gsvolu("BBD2", "TRAP", kSteel, ptrap, 11);
1328 ptrap[3] = d/2-kBBBdd;
1329 ptrap[4] = (d/2-kBBBdd)/x;
1330 ptrap[5] = ptrap[4];
1331 ptrap[7] = ptrap[3];
1332 ptrap[8] = ptrap[4];
1333 ptrap[9] = ptrap[4];
1334 TVirtualMC::GetMC()->Gsvolu("BBD4", "TRAP", kAir, ptrap, 11);
1335 TVirtualMC::GetMC()->Gspos("BBD4", 1, "BBD2", 0.0, 0.0, 0., 0, "ONLY");
1336 dx = (kBBMRou + kBBMRin) / 2.;
1337 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1338 TVirtualMC::GetMC()->Gspos("BBD2", 1, "BBCE", dx, dy, -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");
1339
1340
1341 TVirtualMC::GetMC()->Gspos("BBMO", 1, "ALIC", 0., 0., + 376. + kBBMdz / 2. + 0.5, 0, "ONLY");
1342
1343
1344}
1345
1346//___________________________________________
1347void AliFRAMEv3::AddAlignableVolumes() const
1348{
1349 // Add the 18 spaceframe sectors as alignable volumes
1350 TString basesymname("FRAME/Sector");
1351 TString basevolpath("ALIC_1/B077_1/BSEGMO");
1352 TString symname;
1353 TString volpath;
1354
1355 for(Int_t sec=0; sec<18; sec++)
1356 {
1357 symname = basesymname;
1358 symname += sec;
1359 volpath = basevolpath;
1360 volpath += sec;
1361 volpath += "_1";
1362 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1363 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
1364 symname.Data(),volpath.Data()));
1365 }
1366}
1367
1368//___________________________________________
1369void AliFRAMEv3::CreateMaterials()
1370{
1371 // Creates the materials
1372 Float_t epsil, stemax, tmaxfd, deemax, stmin;
1373
1374 epsil = 1.e-4; // Tracking precision,
1375 stemax = -0.01; // Maximum displacement for multiple scat
1376 tmaxfd = -20.; // Maximum angle due to field deflection
1377 deemax = -.3; // Maximum fractional energy loss, DLS
1378 stmin = -.8;
1379 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
1380 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
1381
1382
1383 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1384 Float_t zsteel[4] = { 26.,24.,28.,14. };
1385 Float_t wsteel[4] = { .715,.18,.1,.005 };
1386
1387 //Air
1388
1389 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1390 Float_t zAir[4]={6.,7.,8.,18.};
1391 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1392 Float_t dAir = 1.20479E-3;
1393
a9bfe689 1394 // G10
1395 // G10 60% SiO2 40% epoxy
1396 Float_t ag10[4]= {12.01, 1., 15.994, 28.086};
1397 Float_t zg10[4] = { 6., 1., 8., 14.};
1398 Float_t wg10[4] = {0.194, 0.023, 0.443, 0.340};
1399
1400
1401 AliMixture(22, "G10", ag10, zg10, 1.7 , 4, wg10);
1402
b9c35690 1403 AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
1404 AliMixture(5, "AIR$ ", aAir, zAir, dAir,4, wAir);
1405 AliMaterial(9, "ALU ", 26.98, 13., 2.7, 8.9, 37.2);
1406
1407 AliMedium(65, "Stainless Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1408 AliMedium( 5, "Air", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1409 AliMedium( 9, "Aluminum", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
a9bfe689 1410 AliMedium(22, "G10", 22, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
b9c35690 1411
1412}
1413
1414//_____________________________________________________________________________
1415void AliFRAMEv3::Init()
1416{
1417 //
1418 // Initialise the module after the geometry has been defined
1419 //
1420 if(AliLog::GetGlobalDebugLevel()>0) {
1421 printf("%s: **************************************"
1422 " FRAME "
1423 "**************************************\n",ClassName());
1424 printf("\n%s: Version 2 of FRAME initialised, symmetric FRAME\n\n",ClassName());
1425 printf("%s: **************************************"
1426 " FRAME "
1427 "**************************************\n",ClassName());
1428 }
1429//
1430// The reference volume id
1431 fRefVolumeId1 = TVirtualMC::GetMC()->VolId("BREF1");
1432 fRefVolumeId2 = TVirtualMC::GetMC()->VolId("BREF2");
1433}
1434
1435Int_t AliFRAMEv3::IsVersion() const
1436{
1437 // Returns the version of the FRAME (1 if no holes, 0 otherwise)
1438 Int_t version = 0;
1439 if (fHoles == 0) version = 1;
1440 return version;
1441}
1442
1443void AliFRAMEv3::StepManager()
1444{
1445//
1446// Stepmanager of AliFRAMEv3.cxx
1447// Used for recording of reference tracks entering the spaceframe mother volume
1448//
1449 Int_t copy, id;
1450
1451 //
1452 // Only charged tracks
1453 if( !(TVirtualMC::GetMC()->TrackCharge()) ) return;
1454 //
1455 // Only tracks entering mother volume
1456 //
1457
1458 id=TVirtualMC::GetMC()->CurrentVolID(copy);
1459
1460 if ((id != fRefVolumeId1) && (id != fRefVolumeId2)) return;
1461 if(!TVirtualMC::GetMC()->IsTrackEntering()) return;
1462 //
1463 // Add the reference track
1464 //
1465 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kFRAME);
1466}
1467
1468
1469
1470void AliFRAMEv3::MakeHeatScreen(const char* name, Float_t dyP, Int_t rot1, Int_t rot2)
1471{
1472 // Heat screen panel
1473 //
1474 Int_t *idtmed = fIdtmed->GetArray()-1999;
1475 const Int_t kAir = idtmed[2004];
1476 const Int_t kAlu = idtmed[2008];
1477
1478 Float_t dx, dy;
1479 char mname[16];
1480 char cname [16];
1481 char t1name[16];
1482 char t2name[16];
1483 char t3name[16];
1484 char t4name[16];
1485 char t5name[16];
1486
1487 //
1488 Float_t dxP = 2. * (287. * TMath::Sin(10.* TMath::Pi()/180.) - 2.);
1489 Float_t dzP = 1.05;
1490 //
1491 // Mother volume
1492 Float_t thshM[3];
1493 thshM[0] = dxP / 2.;
1494 thshM[1] = dyP / 2.;
1495 thshM[2] = dzP / 2.;
1496 snprintf(mname, 16, "BTSH_%s", name);
1497 TVirtualMC::GetMC()->Gsvolu(mname, "BOX ", kAir, thshM, 3);
1498 //
1499 // Aluminum sheet
1500 thshM[2] = 0.025;
1501 snprintf(cname, 16, "BTSHA_%s", name);
1502 TVirtualMC::GetMC()->Gsvolu(cname, "BOX ", kAlu, thshM, 3);
1503 TVirtualMC::GetMC()->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
1504 //
1505 // Tubes
1506 Float_t thshT[3];
1507 thshT[0] = 0.4;
1508 thshT[1] = 0.5;
1509 thshT[2] = (dyP / 2. - 8.);
1510 //
1511 snprintf(t1name, 16, "BTSHT1_%s", name);
1512 TVirtualMC::GetMC()->Gsvolu(t1name, "TUBE", kAlu, thshT, 3);
1513 dx = - dxP / 2. + 8. - 0.5;
1514 TVirtualMC::GetMC()->Gspos(t1name, 1, mname, dx, 0., 0.025, rot1);
1515 //
1516 snprintf(t2name, 16, "BTSHT2_%s", name);
1517 snprintf(t3name, 16, "BTSHT3_%s", name);
1518 snprintf(t4name, 16, "BTSHT4_%s", name);
1519 snprintf(t5name, 16, "BTSHT5_%s", name);
1520 thshT[2] = (thshM[1] - 12.);
1521 TVirtualMC::GetMC()->Gsvolu(t2name, "TUBE", kAlu, thshT, 3);
1522 thshT[2] = 7.9/2.;
1523 TVirtualMC::GetMC()->Gsvolu(t3name, "TUBE", kAlu, thshT, 3);
1524 thshT[2] = 23.9/2.;
1525 TVirtualMC::GetMC()->Gsvolu(t4name, "TUBE", kAlu, thshT, 3);
1526
1527 Int_t sig = 1;
1528 Int_t ipo = 1;
1529 for (Int_t i = 0; i < 5; i++) {
1530 sig *= -1;
1531 dx += 8.00;
1532 dy = 4. * sig;
1533 Float_t dy1 = - (thshM[1] - 15.5) * sig;
1534 Float_t dy2 = - (thshM[1] - 7.5) * sig;
1535
1536 TVirtualMC::GetMC()->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
1537 dx += 6.9;
1538 TVirtualMC::GetMC()->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
1539
1540 TVirtualMC::GetMC()->Gspos(t3name, i+1, mname, dx - 3.45, dy1, 0.025, rot2);
1541 TVirtualMC::GetMC()->Gspos(t4name, i+1, mname, dx - 3.45, dy2, 0.025, rot2);
1542 }
1543 dx += 8.;
1544 TVirtualMC::GetMC()->Gspos(t1name, 2, mname, dx, 0., 0.025, rot1);
1545 TVirtualMC::GetMC()->Gspos(t3name, 6, mname, dx - 3.45, -(thshM[1] - 7.5), 0.025, rot2);
1546}
1547
1548
1549
1550void AliFRAMEv3::WebFrame(const char* name, Float_t dHz, Float_t theta0, Float_t phi0)
1551{
1552 //
1553 // Create a web frame element
1554 //
1555 phi0 = 0.;
1556 Int_t *idtmed = fIdtmed->GetArray()-1999;
1557 const Float_t krad2deg = 180. / TMath::Pi();
1558 const Float_t kdeg2rad = 1. / krad2deg;
1559 const Int_t kAir = idtmed[2004];
1560 const Int_t kSteel = idtmed[2064];
1561
1562 Float_t ptrap[11];
1563 char nameA[16];
1564 snprintf(nameA, 16, "%sA", name );
1565
1566 char nameI[16];
1567 snprintf(nameI, 16, "%sI", name );
1568
1569 theta0 *= kdeg2rad;
1570 phi0 *= kdeg2rad;
1571 // Float_t theta = TMath::ATan(TMath::Tan(theta0)/TMath::Sin(phi0));
1572 Float_t theta = TMath::Pi()/2.;
1573 Float_t phi = TMath::ACos(TMath::Cos(theta0) * TMath::Cos(phi0));
1574
1575 if (phi0 < 0) phi = -phi;
1576
1577 phi *= krad2deg;
1578 theta *= krad2deg;
1579
1580 ptrap[0] = dHz/2;
1581 ptrap[2] = theta;
1582 ptrap[1] = phi;
1583 ptrap[3] = 6./cos(theta0 * kdeg2rad)/2.;
1584 ptrap[4] = 1.;
1585 ptrap[5] = ptrap[4];
1586 ptrap[6] = 0;
1587 ptrap[7] = ptrap[3];
1588 ptrap[8] = ptrap[4];
1589 ptrap[9] = ptrap[4];
1590 ptrap[10] = 0;
1591 TVirtualMC::GetMC()->Gsvolu(name, "TRAP", kSteel, ptrap, 11);
1592 TVirtualMC::GetMC()->Gsvolu(nameI, "TRAP", kSteel, ptrap, 11);
1593 ptrap[3] = (6. - 1.)/cos(theta0 * kdeg2rad)/2.;
1594 ptrap[4] = 0.75;
1595 ptrap[5] = ptrap[4];
1596 ptrap[7] = ptrap[3];
1597 ptrap[8] = ptrap[4];
1598 ptrap[9] = ptrap[4];
1599
1600 TVirtualMC::GetMC()->Gsvolu(nameA, "TRAP", kAir, ptrap, 11);
1601 TVirtualMC::GetMC()->Gspos(nameA, 1, name, -0.25, 0.0, 0., 0, "ONLY");
1602 TVirtualMC::GetMC()->Gspos(nameA, 2, nameI, +0.25, 0.0, 0., 0, "ONLY");
a9bfe689 1603 gGeoManager->GetVolume(name)->SetVisContainers();;
1604 gGeoManager->GetVolume(nameI)->SetVisContainers();;
b9c35690 1605}
1606