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