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