Removing AliITSgeom dependencies from the old ITS clusterer V2 and the corresponding...
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv2.cxx
CommitLineData
7e5caa00 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
eeacf08b 16/* $Id$ */
6304e7d2 17
eeacf08b 18//------------------------------------------------------------------------
19// AliFRAMEv2.cxx
20// symmetric space frame with possibility for holes
21// Author: A.Morsch
22//------------------------------------------------------------------------
7e5caa00 23
88cb7938 24#include <TSystem.h>
5d12ce38 25#include <TVirtualMC.h>
3c976b4c 26#include <TString.h>
bb92d81d 27#include <TGeoManager.h>
7e5caa00 28#include "AliFRAMEv2.h"
29#include "AliMagF.h"
30#include "AliRun.h"
f2744db7 31#include "AliConst.h"
5d12ce38 32#include "AliMC.h"
4951e003 33#include "AliLog.h"
7e5caa00 34
35ClassImp(AliFRAMEv2)
6772b8d8 36
7e5caa00 37
38//_____________________________________________________________________________
6772b8d8 39AliFRAMEv2::AliFRAMEv2():
40 fHoles(0)
7e5caa00 41{
42// Constructor
7e5caa00 43}
44
45//_____________________________________________________________________________
46AliFRAMEv2::AliFRAMEv2(const char *name, const char *title)
6772b8d8 47 : AliFRAME(name,title),
48 fHoles(0)
7e5caa00 49{
50// Constructor
7e5caa00 51}
52
7e5caa00 53//___________________________________________
54void AliFRAMEv2::CreateGeometry()
55{
56//Begin_Html
57/*
58<img src="picts/frame.gif">
59*/
60//End_Html
61
62
63//Begin_Html
64/*
65<img src="picts/tree_frame.gif">
66*/
67//End_Html
68
4a8eca94 69 Int_t idrotm[2299];
7e5caa00 70 Int_t *idtmed = fIdtmed->GetArray()-1999;
71//
72// The Space frame
73//
74//
e16311cb 75 Float_t pbox[3], ptrap[11], ptrd1[4], ppgon[10];
7e5caa00 76
77 Float_t dx, dy, dz;
78 Int_t i, j, jmod;
d84d0b8c 79 jmod = 0;
7e5caa00 80//
81// Constants
82 const Float_t kEps = 0.01;
83 const Int_t kAir = idtmed[2004];
84 const Int_t kSteel = idtmed[2064];
85
86 const Float_t krad2deg = 180./TMath::Pi();
87 const Float_t kdeg2rad = 1./krad2deg;
88
4c057bc8 89 Float_t iFrH = 114.40;
90 Float_t ringH = 4.00;
91 Float_t ringW = 10.00;
92 Float_t longH = 5.39;
93 Float_t longW = 6.00;
94 Float_t dwl = 3.14;
95 Float_t dwh = 0.96;
7e5caa00 96
02e42643 97//
4a8eca94 98 Float_t dymodU[3] = {70.0, 224.0, 341.};
02e42643 99// new ?
4a8eca94 100 Float_t dymodL[3] = {54.0, 178.5, 341.};
af3fbbe1 101
7e5caa00 102//
103// Frame mother volume
104//
b35d7d26 105// ptube[0] = 280.;
106// ptube[1] = 430.;
107// ptube[2] = 376.;
108 ppgon[0] = 0.;
109 ppgon[1] = 360.;
110 ppgon[2] = 18.;
111
112 ppgon[3] = 2.;
b35d7d26 113 ppgon[4] = -376.;
114 ppgon[5] = 280.;
115 ppgon[6] = 421.;
116
117 ppgon[7] = -ppgon[4];
118 ppgon[8] = ppgon[5];
119 ppgon[9] = ppgon[6];
120
121 gMC->Gsvolu("B077", "PGON", kAir, ppgon, 10);
7e5caa00 122 gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
123//
55bdc695 124// Reference plane for TRD
125//
126 ppgon[6] = ppgon[5] + 0.1;
127 ppgon[9] = ppgon[6];
128 gMC->Gsvolu("BREF", "PGON", kAir, ppgon, 10);
129 gMC->Gspos("BREF", 1, "B077", 0., 0., 0., 0, "ONLY");
bb92d81d 130 gGeoManager->GetVolume("BREF")->SetVisibility(kFALSE);
55bdc695 131//
7e5caa00 132// The outer Frame
133//
134
135 Float_t dol = 8.75;
136 Float_t doh = 5.;
137 Float_t ds = 0.35;
138//
139// Mother volume
140//
141 ppgon[0] = 0.;
142 ppgon[1] = 360.;
143 ppgon[2] = 18.;
144
145 ppgon[3] = 2.;
146
147 ppgon[4] = -350.;
148 ppgon[5] = 399.;
149 ppgon[6] = 420.7122;
150
151 ppgon[7] = -ppgon[4];
152 ppgon[8] = ppgon[5];
153 ppgon[9] = ppgon[6];
154 gMC->Gsvolu("B076", "PGON", kAir, ppgon, 10);
155 gMC->Gspos("B076", 1, "B077", 0., 0., 0., 0, "ONLY");
156//
157// Rings
158//
159 dz = 2.*410.2*TMath::Sin(10.*kdeg2rad)-2.*dol*TMath::Cos(10.*kdeg2rad)-
160 2.*doh*TMath::Tan(10.*kdeg2rad);
161 Float_t l1 = dz/2.;
162 Float_t l2 = dz/2.+2.*doh*TMath::Tan(10.*kdeg2rad);
163
164 ptrd1[0] = l1;
165 ptrd1[1] = l2;
166
167 ptrd1[2] = dol;
168 ptrd1[3] = doh;
169 gMC->Gsvolu("B042", "TRD1", kSteel, ptrd1, 4);
170
171 ptrd1[0] = ptrd1[0]+ds*(l2-l1)/2./doh;
172 ptrd1[1] = ptrd1[1]-ds*(l2-l1)/2./doh;
173 ptrd1[2] = dol-ds;
174 ptrd1[3] = doh-ds;
175 gMC->Gsvolu("B043", "TRD1", kAir, ptrd1, 4);
176 gMC->Gspos("B043", 1, "B042", 0., 0., 0., 0, "ONLY");
177//
178// longitudinal bars
179//
180// 170x200x5
181//
182 pbox[0] = dol;
183 pbox[1] = doh;
184 pbox[2] = 350.;
185 gMC->Gsvolu("B033", "BOX", kSteel, pbox, 3);
186 pbox[0] = dol-ds;
187 pbox[1] = doh-ds;
188 gMC->Gsvolu("B034", "BOX", kAir, pbox, 3);
189 gMC->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
190
191 pbox[0] = 1.0;
192 pbox[1] = 5.0;
193 pbox[2] = 375.5;
194
195
196 gMC->Gsvolu("B080", "BOX", kSteel, pbox, 3);
b35d7d26 197 gMC->Gspos("B080", 1, "B077", 286.01, 0., 0., 0, "ONLY");
198 gMC->Gspos("B080", 2, "B077", -286.01, 0., 0., 0, "ONLY");
7e5caa00 199
200//
201// Diagonal bars (1)
202//
203 Float_t h, d, dq, x, theta;
204
4a8eca94 205 h = (dymodU[1]-dymodU[0]-2.*dol)*.999;
7e5caa00 206 d = 2.*dol;
207 dq = h*h+dz*dz;
208
209 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
210
211
212 theta = krad2deg * TMath::ACos(x);
213
214 ptrap[0] = dz/2.;
215 ptrap[1] = theta;
216 ptrap[2] = 0.;
217 ptrap[3] = doh;
218 ptrap[4] = dol/x;
219 ptrap[5] = ptrap[4];
220 ptrap[6] = 0;
221 ptrap[7] = ptrap[3];
222 ptrap[8] = ptrap[4];
223 ptrap[9] = ptrap[4];
224 ptrap[10] = 0;
225
226 gMC->Gsvolu("B047", "TRAP", kSteel, ptrap, 11);
227 ptrap[3] = doh-ds;
228 ptrap[4] = (dol-ds)/x;
229 ptrap[5] = ptrap[4];
230 ptrap[7] = ptrap[3];
231 ptrap[8] = ptrap[4];
232 ptrap[9] = ptrap[4];
233 gMC->Gsvolu("B048", "TRAP", kAir, ptrap, 11);
234 gMC->Gspos("B048", 1, "B047", 0.0, 0.0, 0., 0, "ONLY");
235
236/*
237 Crosses (inner most)
238 \\ //
239 \\//
240 //\\
241 // \\
242*/
4a8eca94 243 h = (2.*dymodU[0]-2.*dol)*.999;
7e5caa00 244//
245// Mother volume
246//
247 pbox[0] = h/2;
248 pbox[1] = doh;
249 pbox[2] = dz/2.;
250 gMC->Gsvolu("BM49", "BOX ", kAir, pbox, 3);
251
252
253 dq = h*h+dz*dz;
254 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
255 theta = krad2deg * TMath::ACos(x);
256
257 ptrap[0] = dz/2.-kEps;
258 ptrap[1] = theta;
259 ptrap[2] = 0.;
260 ptrap[3] = doh-kEps;
261 ptrap[4] = dol/x;
262 ptrap[5] = ptrap[4];
263 ptrap[7] = ptrap[3];
264 ptrap[8] = ptrap[4];
265 ptrap[9] = ptrap[4];
266
267 gMC->Gsvolu("B049", "TRAP", kSteel, ptrap, 11);
268 ptrap[0] = ptrap[0]-kEps;
269 ptrap[3] = (doh-ds);
270 ptrap[4] = (dol-ds)/x;
271 ptrap[5] = ptrap[4];
272 ptrap[7] = ptrap[3];
273 ptrap[8] = ptrap[4];
274 ptrap[9] = ptrap[4];
275 gMC->Gsvolu("B050", "TRAP", kAir, ptrap, 11);
276 gMC->Gspos("B050", 1, "B049", 0.0, 0.0, 0., 0, "ONLY");
277 gMC->Gspos("B049", 1, "BM49", 0.0, 0.0, 0., 0, "ONLY");
278
279
280 Float_t dd1 = d*TMath::Tan(theta*kdeg2rad);
281 Float_t dd2 = d/TMath::Tan(2.*theta*kdeg2rad);
282 Float_t theta2 = TMath::ATan(TMath::Abs(dd2-dd1)/d/2.);
283
284
285 ptrap[0] = dol;
286 ptrap[1] = theta2*krad2deg;
287 ptrap[2] = 0.;
288 ptrap[3] = doh;
289 ptrap[4] = (dz/2./x-dd1-dd2)/2.;
290 ptrap[5] = ptrap[4];
291 ptrap[6] = 0.;
292 ptrap[7] = ptrap[3];
293 ptrap[8] = dz/4./x;
294 ptrap[9] = ptrap[8];
295
296
297 gMC->Gsvolu("B051", "TRAP", kSteel, ptrap, 11);
298 Float_t ddx0 = ptrap[8];
299
300 Float_t dd1s = dd1*(1.-2.*ds/d);
301 Float_t dd2s = dd2*(1.-2.*ds/d);
302 Float_t theta2s = TMath::ATan(TMath::Abs(dd2s-dd1s)/(d-2.*ds)/2.);
303
304
305 ptrap[0] = dol-ds;
306 ptrap[1] = theta2s*krad2deg;
307 ptrap[2] = 0.;
308 ptrap[3] = doh-ds;
309 ptrap[4] = ptrap[4]+ds/d/2.*(dd1+dd2);
310 ptrap[5] = ptrap[4];
311 ptrap[6] = 0.;
312 ptrap[7] = ptrap[3];
313 ptrap[8] = ptrap[8]-ds/2./d*(dd1+dd2);
314 ptrap[9] = ptrap[8];
315
316 gMC->Gsvolu("B052", "TRAP", kAir, ptrap, 11);
317 gMC->Gspos("B052", 1, "B051", 0.0, 0.0, 0., 0, "ONLY");
318
319 Float_t ddx, ddz, drx, drz, rtheta;
320
4a8eca94 321 AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
7e5caa00 322 rtheta = (90.-theta)*kdeg2rad;
323 ddx = -ddx0-dol*TMath::Tan(theta2);
324 ddz = -dol;
325
326 drx = TMath::Cos(rtheta) * ddx +TMath::Sin(rtheta) *ddz+pbox[0];
327 drz = -TMath::Sin(rtheta) * ddx +TMath::Cos(rtheta) *ddz-pbox[2];
328 gMC->Gspos("B051", 1, "BM49",
329 drx, 0.0, drz,
4a8eca94 330 idrotm[2001], "ONLY");
7e5caa00 331
4a8eca94 332 AliMatrix(idrotm[2002], -theta, 0.0, 90.0, 90.0, 270.-theta, 0.0);
7e5caa00 333 rtheta = (270.-theta)*kdeg2rad;
334
335 drx = TMath::Cos(rtheta) * ddx + TMath::Sin(rtheta) * ddz-pbox[0];
336 drz = -TMath::Sin(rtheta) * ddx + TMath::Cos(rtheta) * ddz+pbox[2];
337 gMC->Gspos("B051", 2, "BM49",
338 drx, 0.0, drz,
4a8eca94 339 idrotm[2002], "ONLY");
7e5caa00 340
341//
342// Diagonal bars (3)
343//
4a8eca94 344 h = ((dymodU[2]-dymodU[1])-2.*dol)*.999;
7e5caa00 345 dq = h*h+dz*dz;
346 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
347 theta = krad2deg * TMath::ACos(x);
348
349 ptrap[0] = dz/2.;
350 ptrap[1] = theta;
351 ptrap[3] = doh;
352 ptrap[4] = dol/x;
353 ptrap[5] = ptrap[4];
354 ptrap[7] = ptrap[3];
355 ptrap[8] = ptrap[4];
356 ptrap[9] = ptrap[4];
357
358 gMC->Gsvolu("B045", "TRAP", kSteel, ptrap, 11);
359 ptrap[3] = doh-ds;
360 ptrap[4] = (dol-ds)/x;
361 ptrap[5] = ptrap[4];
362 ptrap[7] = ptrap[3];
363 ptrap[8] = ptrap[4];
364 ptrap[9] = ptrap[4];
365 gMC->Gsvolu("B046", "TRAP", kAir, ptrap, 11);
366 gMC->Gspos("B046", 1, "B045", 0.0, 0.0, 0., 0, "ONLY");
367
368//
369// Positioning of diagonal bars
370//
371// Matrices have been imported from Euclid. Some simplification
372// seems possible
373//
4a8eca94 374 AliMatrix(idrotm[2003], 0.0, 0.0, 90.0, 130.0, 90.0, 40.0);
375 AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0, 40.0);
376 AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
377 AliMatrix(idrotm[2006], 0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
378 AliMatrix(idrotm[2007], 0.0, 0.0, 90.0, 170.0, 90.0, 80.0);
379 AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
380 AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0, 80.0);
381 AliMatrix(idrotm[2010], 0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
382 AliMatrix(idrotm[2011], 0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
383 AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
384 AliMatrix(idrotm[2013], 180.0, 0.0, 90.0, 10.0, 90.0, 100.0);
385 AliMatrix(idrotm[2014], 0.0, 0.0, 90.0, 10.0, 90.0, 100.0);
386 AliMatrix(idrotm[2015], 0.0, 0.0, 90.0, 30.0, 90.0, 300.0);
387 AliMatrix(idrotm[2016], 180.0, 0.0, 90.0, 30.0, 90.0, 300.0);
388 AliMatrix(idrotm[2017], 180.0, 0.0, 90.0, 50.0, 90.0, 140.0);
389 AliMatrix(idrotm[2018], 0.0, 0.0, 90.0, 50.0, 90.0, 140.0);
390
391 AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
25918453 392 AliMatrix(idrotm[2020], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
393 AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
394 AliMatrix(idrotm[2022], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
4a8eca94 395 AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
396 AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
25918453 397 AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
398 AliMatrix(idrotm[2026], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
4a8eca94 399
25918453 400 AliMatrix(idrotm[2027], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
401 AliMatrix(idrotm[2028], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0);
402 AliMatrix(idrotm[2029], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
403 AliMatrix(idrotm[2030], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
404 AliMatrix(idrotm[2031], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
405 AliMatrix(idrotm[2032], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
406 AliMatrix(idrotm[2033], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
7e5caa00 407
408 Float_t rd = 410.56;
4a8eca94 409 dz = (dymodU[1]+dymodU[0])/2.;
410 Float_t dz2 = (dymodU[1]+dymodU[2])/2.;
7e5caa00 411
412//
413// phi = 40
414//
415 Float_t phi = 40;
416 dx = rd * TMath::Sin(phi*kdeg2rad);
417 dy = rd * TMath::Cos(phi*kdeg2rad);
418
7e5caa00 419
4a8eca94 420 gMC->Gspos("B045", 1, "B076", -dx, dy, dz2, idrotm[2019], "ONLY");
421 gMC->Gspos("B045", 2, "B076", -dx, dy, -dz2, idrotm[2003], "ONLY"); // ?
422 gMC->Gspos("B045", 3, "B076", dx, dy, dz2, idrotm[2020], "ONLY");
423 gMC->Gspos("B045", 4, "B076", dx, dy, -dz2, idrotm[2027], "ONLY");
7e5caa00 424
7e5caa00 425
426//
427// phi = 60
428//
429
430 phi = 60;
431 dx = rd * TMath::Sin(phi*kdeg2rad);
432 dy = rd * TMath::Cos(phi*kdeg2rad);
7e5caa00 433
4a8eca94 434 gMC->Gspos("B045", 5, "B076", -dx, dy, dz2, idrotm[2021], "ONLY");
435 gMC->Gspos("B045", 6, "B076", -dx, dy, -dz2, idrotm[2028], "ONLY");
436 gMC->Gspos("B045", 7, "B076", dx, dy, dz2, idrotm[2022], "ONLY");
437 gMC->Gspos("B045", 8, "B076", dx, dy, -dz2, idrotm[2029], "ONLY");
7e5caa00 438
7e5caa00 439//
440// phi = 80
441//
442
443 phi = 80;
444 dx = rd * TMath::Sin(phi*kdeg2rad);
445 dy = rd * TMath::Cos(phi*kdeg2rad);
7e5caa00 446
4a8eca94 447 gMC->Gspos("B047", 13, "B076", -dx, -dy, dz, idrotm[2008], "ONLY");
448 gMC->Gspos("B047", 14, "B076", -dx, -dy, -dz, idrotm[2010], "ONLY");
449 gMC->Gspos("B047", 15, "B076", dx, -dy, dz, idrotm[2012], "ONLY");
450 gMC->Gspos("B047", 16, "B076", dx, -dy, -dz, idrotm[2011], "ONLY");
7e5caa00 451
4a8eca94 452 gMC->Gspos("B045", 9, "B076", -dx, dy, dz2, idrotm[2023], "ONLY");
453 gMC->Gspos("B045", 10, "B076", -dx, dy, -dz2, idrotm[2031], "ONLY");
454 gMC->Gspos("B045", 11, "B076", dx, dy, dz2, idrotm[2026], "ONLY");
455 gMC->Gspos("B045", 12, "B076", dx, dy, -dz2, idrotm[2030], "ONLY");
7e5caa00 456
4a8eca94 457 gMC->Gspos("B045", 13, "B076", -dx, -dy, dz2, idrotm[2024], "ONLY");
458 gMC->Gspos("B045", 14, "B076", -dx, -dy, -dz2, idrotm[2032], "ONLY");
459 gMC->Gspos("B045", 15, "B076", dx, -dy, dz2, idrotm[2025], "ONLY");
460 gMC->Gspos("B045", 16, "B076", dx, -dy, -dz2, idrotm[2033], "ONLY");
7e5caa00 461
4a8eca94 462 gMC->Gspos("BM49", 7, "B076", dx, -dy, 0., idrotm[2025], "ONLY");
463 gMC->Gspos("BM49", 8, "B076", -dx, -dy, 0., idrotm[2024], "ONLY");
7e5caa00 464
465
466// The internal frame
467//
7e5caa00 468//
469//
470// Mother Volumes
471//
472 ptrd1[0] = 50.18;
473 ptrd1[1] = 70.35;
7e5caa00 474 ptrd1[2] = 375.5;
475 ptrd1[3] = 57.2;
7e5caa00 476
477 Float_t r = 341.8;
478 Float_t rout1 = 410.564;
479 Float_t rout2 = 415.2;
3c976b4c 480 TString module[18];
7e5caa00 481
d84d0b8c 482 for (i = 0; i < 18; i++) {
483 // Create volume i
8ce41745 484 char name[16];
9398db43 485 Int_t mod = i + 13;
486 if (mod > 17) mod -= 18;
487 sprintf(name, "BSEGMO%d", mod);
d84d0b8c 488 gMC->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
bb92d81d 489 gGeoManager->GetVolume(name)->SetVisibility(kFALSE);
3c976b4c 490
d84d0b8c 491 module[i] = name;
492 // Place volume i
493 Float_t phi = i * 20.;
494 Float_t phi2 = 270 + phi;
495 if (phi2 >= 360.) phi2 -= 360.;
7e5caa00 496
497 dx = TMath::Sin(phi*kdeg2rad)*r;
498 dy = -TMath::Cos(phi*kdeg2rad)*r;
7e5caa00 499
4a8eca94 500 AliMatrix(idrotm[2034+i], 90.0, phi, 0., 0., 90., phi2);
bb92d81d 501 gMC->Gspos(name, 1, "B077", dx, dy, 0., idrotm[2034+i], "ONLY");
7e5caa00 502//
503// Position elements of outer Frame
504//
505 dx = TMath::Sin(phi*kdeg2rad)*rout1;
506 dy = -TMath::Cos(phi*kdeg2rad)*rout1;
507 for (j = 0; j < 3; j++)
508 {
4a8eca94 509 dz = dymodU[j];
510 gMC->Gspos("B042", 6*i+2*j+1, "B076", dx, dy, dz, idrotm[2034+i], "ONLY");
511 gMC->Gspos("B042", 6*i+2*j+2, "B076", dx, dy, -dz, idrotm[2034+i], "ONLY");
7e5caa00 512 }
513
514 phi = i*20.+10;
515 phi2 = 270+phi;
4a8eca94 516 AliMatrix(idrotm[2052+i], 90.0, phi, 90., phi2, 0., 0.);
7e5caa00 517
518 dx = TMath::Sin(phi*kdeg2rad)*rout2;
519 dy = -TMath::Cos(phi*kdeg2rad)*rout2;
4a8eca94 520 gMC->Gspos("B033", i+1, "B076", dx, dy, 0., idrotm[2052+i], "ONLY");
7e5caa00 521//
522 }
523// Internal Frame rings
524//
525//
526// new specs: 40x100x6 for inner rings
527// 30x135x6 for front and rear rings
528//
529// currently no distinction between front/rear and inner rings
530//
531//
532//
533 pbox[0] = 50.;
534 pbox[1] = ringW/2.;
535 pbox[2] = ringH/2.;
536
537 gMC->Gsvolu("B072", "BOX ", kSteel, pbox, 3);
538
539 pbox[1] = pbox[1] - 0.6;
540 pbox[2] = pbox[2] - 0.6;
541 gMC->Gsvolu("B073", "BOX ", kAir, pbox, 3);
542 gMC->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
543
544// Web frame 0-degree
545//
546// h x w x s = 60x40x4
547// (attention: element is are half bars, "U" shaped)
548//
4a8eca94 549 dz = 106.2;
550 d = 2.*dwl;
551 h = dymodU[0]-dymodL[0];
552 dq = h*h+dz*dz;
553
554 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
7e5caa00 555
4a8eca94 556 theta = TMath::ACos(x);
557 Float_t thetaP = (TMath::Pi()-theta)*krad2deg;
558
559 ptrap[0] = dz/2.;
560 ptrap[1] = thetaP;
561 ptrap[2] = 0.;
562 ptrap[3] = dwh;
563 ptrap[4] = dwl/cos(theta);
564 ptrap[5] = ptrap[4];
565 ptrap[6] = 0;
566 ptrap[7] = ptrap[3];
567 ptrap[8] = ptrap[4];
568 ptrap[9] = ptrap[4];
569 ptrap[10] = 0;
570 gMC->Gsvolu("B063", "TRAP", kSteel, ptrap, 11);
571 ptrap[3] = dwh - 0.2;
572 ptrap[4] = (dwl-0.4)/cos(theta);
573 ptrap[5] = ptrap[4];
574 ptrap[7] = ptrap[3];
575 ptrap[8] = ptrap[4];
576 ptrap[9] = ptrap[4];
577 gMC->Gsvolu("B064", "TRAP", kAir, ptrap, 11);
578 gMC->Gspos("B064", 1, "B063", 0.0, -0.2, 0., 0, "ONLY");
579
580
581 h = 106.2;
582 d = 2.*dwl;
583 dz = dymodU[1]-dymodL[1];
584 dq = h*h+dz*dz;
585
586 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
587
588
589 theta = krad2deg * TMath::ACos(x);
590
591 ptrap[0] = dz/2.;
592 ptrap[1] = theta;
593 ptrap[2] = 0.;
594 ptrap[3] = dwh;
595 ptrap[4] = dwl/x;
596 ptrap[5] = ptrap[4];
597 ptrap[6] = 0;
598 ptrap[7] = ptrap[3];
599 ptrap[8] = ptrap[4];
600 ptrap[9] = ptrap[4];
601 ptrap[10] = 0;
602 gMC->Gsvolu("B163", "TRAP", kSteel, ptrap, 11);
603 ptrap[3] = dwh - 0.2;
604 ptrap[4] = (dwl-0.4)/x;
605 ptrap[5] = ptrap[4];
606 ptrap[7] = ptrap[3];
607 ptrap[8] = ptrap[4];
608 ptrap[9] = ptrap[4];
609 gMC->Gsvolu("B164", "TRAP", kAir, ptrap, 11);
610 gMC->Gspos("B164", 1, "B163", 0.0, -0.2, 0., 0, "ONLY");
611
612
7e5caa00 613 pbox[0] = dwh;
614 pbox[1] = dwl;
615 pbox[2] = (iFrH-ringH-longH)/2.;
4a8eca94 616 gMC->Gsvolu("B263", "BOX ", kSteel, pbox, 3);
7e5caa00 617 pbox[0] = dwh-0.2;
618 pbox[1] = dwl-0.4;
619
4a8eca94 620 gMC->Gsvolu("B264", "BOX ", kAir, pbox, 3);
621 gMC->Gspos("B264", 1, "B263", 0.2, 0., 0., 0, "ONLY");
622
623
624 AliMatrix(idrotm[2070], 90.0, 0.0, 90.0, 270.0, 0.0, 0.0);
625//
626 AliMatrix(idrotm[2071], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
627 AliMatrix(idrotm[2072], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
628 AliMatrix(idrotm[2073], 100.0, 180.0, 90.0, 270.0, 10.0, 180.0);
25918453 629 AliMatrix(idrotm[2074], 100.0, 180.0, 90.0, 90.0, 10.0, 180.0);
4a8eca94 630//
631 AliMatrix(idrotm[2075], 10.0, 0.0, 80.0, 180.0, 90.0, 90.0);
632 AliMatrix(idrotm[2076], 10.0, 0.0, 80.0, 180.0, 90.0, 270.0);
633 AliMatrix(idrotm[2077], 10.0, 180.0, 80.0, 0.0, 90.0, 90.0);
634 AliMatrix(idrotm[2078], 10.0, 180.0, 80.0, 0.0, 90.0, 270.0);
635//
636 AliMatrix(idrotm[2079], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
637 AliMatrix(idrotm[2080], 170.0, 180.0, 80.0, 180.0, 90.0, 270.0);
638 AliMatrix(idrotm[2081], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
639 AliMatrix(idrotm[2082], 170.0, 0.0, 80.0, 0.0, 90.0, 270.0);
640
641//
642 AliMatrix(idrotm[2083], 170.0, 0.0, 90.0, 90.0, 80.0, 0.0);
643 AliMatrix(idrotm[2084], 170.0, 180.0, 90.0, 90.0, 80.0, 180.0);
644 AliMatrix(idrotm[2085], 90.0, 180.0, 90.0, 90.0, 0.0, 0.0);
645//
25918453 646 AliMatrix(idrotm[2086], 90.0, 90.0, 100.0, 0., 170.0, 180.0);
647 AliMatrix(idrotm[2087], 90.0, 90.0, 100.0, 0., 10.0, 0.0);
648 AliMatrix(idrotm[2088], 90.0, 90.0, 80.0, 0., 170.0, 0.0);
649 AliMatrix(idrotm[2089], 90.0, 90.0, 80.0, 0., -10.0, 0.0);
650//
651 AliMatrix(idrotm[2090], 90.0, 0.0, 0.0, 0., 90.0, 90.0);
652 AliMatrix(idrotm[2091], 0.0, 0.0, 90.0, 90., 90.0, 0.0);
7e5caa00 653//
654// web frame diagonal (outer)
655//
656 h = 106.2;
657 d = 2.*dwl;
4a8eca94 658 dz = dymodL[2]-dymodU[1]-dwl;
7e5caa00 659 dq = h*h+dz*dz;
660
661 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
662
663
664 theta = krad2deg * TMath::ACos(x);
665
666 ptrap[0] = dz/2.;
667 ptrap[1] = theta;
668 ptrap[2] = 0.;
669 ptrap[3] = dwh;
670 ptrap[4] = dwl/x;
671 ptrap[5] = ptrap[4];
672 ptrap[6] = 0;
673 ptrap[7] = ptrap[3];
674 ptrap[8] = ptrap[4];
675 ptrap[9] = ptrap[4];
676 ptrap[10] = 0;
677 gMC->Gsvolu("B065", "TRAP", kSteel, ptrap, 11);
678 ptrap[3] = dwh - 0.2;
679 ptrap[4] = (dwl-0.4)/x;
680 ptrap[5] = ptrap[4];
681 ptrap[7] = ptrap[3];
682 ptrap[8] = ptrap[4];
683 ptrap[9] = ptrap[4];
684 gMC->Gsvolu("B066", "TRAP", kAir, ptrap, 11);
685 gMC->Gspos("B066", 1, "B065", 0.0, -0.2, 0., 0, "ONLY");
686
687//
688// web frame diagonal (inner)
689//
4a8eca94 690 dz = dymodL[1]-dymodU[0];
7e5caa00 691 dq = h*h+dz*dz;
4a8eca94 692 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
7e5caa00 693
694
695 theta = krad2deg * TMath::ACos(x);
696
4a8eca94 697 ptrap[0] = (dymodL[1]-dymodU[0])/2.;
7e5caa00 698 ptrap[1] = theta;
699 ptrap[2] = 0.;
700 ptrap[3] = dwh;
701 ptrap[4] = dwl/x;
702 ptrap[5] = ptrap[4];
703 ptrap[6] = 0;
704 ptrap[7] = ptrap[3];
705 ptrap[8] = ptrap[4];
706 ptrap[9] = ptrap[4];
707 ptrap[10] = 0;
708 gMC->Gsvolu("B067", "TRAP", kSteel, ptrap, 11);
709 ptrap[3] = dwh-0.2;
710 ptrap[4] = (dwl-0.4)/x;
711 ptrap[5] = ptrap[4];
712 ptrap[7] = ptrap[3];
713 ptrap[8] = ptrap[4];
714 ptrap[9] = ptrap[4];
715 gMC->Gsvolu("B068", "TRAP", kAir, ptrap, 11);
716 gMC->Gspos("B068", 1, "B067", 0.0, -0.2, 0., 0, "ONLY");
717
718
719 dz = -iFrH/2.+ringH/2.+kEps;
720
bb92d81d 721 for (jmod = 0; jmod< 18; jmod++)
7e5caa00 722 {
723// ring bars
bb92d81d 724 for (i = 0; i < 3; i++) {
725 gMC->Gspos("B072", 6*jmod+i+1, module[jmod], 0, dymodL[i], dz, 0, "ONLY");
726 gMC->Gspos("B072", 6*jmod+i+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");
7e5caa00 727
728// 0-deg web
bb92d81d 729 if (i == 2) {
730 gMC->Gspos("B263", 4*jmod+1, module[jmod], 60.0732, dymodU[2], 4.6669, idrotm[2072], "ONLY");
731 gMC->Gspos("B263", 4*jmod+2, module[jmod], 60.0732, -dymodU[2], 4.6669, idrotm[2071], "ONLY");
732 gMC->Gspos("B263", 4*jmod+3, module[jmod], -60.0732, dymodU[2], 4.6669, idrotm[2074], "ONLY");
733 gMC->Gspos("B263", 4*jmod+4, module[jmod], -60.0732, -dymodU[2], 4.6669, idrotm[2073], "ONLY");
4a8eca94 734 }
7e5caa00 735 }
736 }
737
738// outer diagonal web
739
4a8eca94 740 dy = (dymodU[0]+dymodL[0])/2.;
d84d0b8c 741 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 742 gMC->Gspos("B063", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2086], "ONLY");
743 gMC->Gspos("B063", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2087], "ONLY");
744 gMC->Gspos("B063", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2088], "ONLY");
745 gMC->Gspos("B063", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2089], "ONLY");
746 }
747
748 dy = (dymodU[1]+dymodL[1])/2.;
d84d0b8c 749 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 750 gMC->Gspos("B163", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2080], "ONLY");
751 gMC->Gspos("B163", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2079], "ONLY");
752 gMC->Gspos("B163", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2082], "ONLY");
753 gMC->Gspos("B163", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2081], "ONLY");
754 }
755
756
757 dy = (dymodL[2]+dymodU[1])/2.-dwl/2.;
d84d0b8c 758 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 759 gMC->Gspos("B065", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2076], "ONLY");
760 gMC->Gspos("B065", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2075], "ONLY");
761 gMC->Gspos("B065", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2078], "ONLY");
762 gMC->Gspos("B065", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2077], "ONLY");
7e5caa00 763 }
764
765
4a8eca94 766 dy = (dymodL[1]+dymodU[0])/2.;
7e5caa00 767
d84d0b8c 768 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 769 gMC->Gspos("B067", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2076], "ONLY");
770 gMC->Gspos("B067", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2075], "ONLY");
771 gMC->Gspos("B067", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2078], "ONLY");
772 gMC->Gspos("B067", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2077], "ONLY");
7e5caa00 773 }
774
775// longitudinal bars (TPC rails attached)
776// new specs:
777// h x w x s = 100 x 75 x 6
778// current:
779// Attention: 2 "U" shaped half rods per cell
780//
781// not yet used
782//
783 ptrap[0] = 2.50;
784 ptrap[1] = 10.00;
785 ptrap[2] = 0.00;
786 ptrap[3] = 350.00;
787 ptrap[4] = 3.75;
788 ptrap[5] = ptrap[4];
789 ptrap[6] = 0;
790 ptrap[7] = ptrap[3];
791 ptrap[8] = ptrap[4];
792 ptrap[9] = ptrap[4];
793 ptrap[10] = 0;
f935f49e 794// gMC->Gsvolu("B059", "TRAP", kSteel, ptrap, 11);
7e5caa00 795 ptrap[0] = 2.2;
796 ptrap[4] = 2.15;
797 ptrap[5] = ptrap[4];
798 ptrap[7] = ptrap[3];
799 ptrap[8] = ptrap[4];
800 ptrap[9] = ptrap[4];
f935f49e 801 //gMC->Gsvolu("B062", "TRAP", kAir, ptrap, 11);
802 //gMC->Gspos("B062", 1, "B059", 0.0, 0., 0., 0, "ONLY");
803
7e5caa00 804//
805// longitudinal bars (no TPC rails attached)
806// new specs: h x w x s = 60 x 60 x 3
807// (was: 75 x 100 x 5?)
808//
809//
810//
811 ptrap[0] = longW/4.;
812 ptrap[4] = longH/2.;
813 ptrap[5] = ptrap[4];
814 ptrap[7] = ptrap[3];
815 ptrap[8] = ptrap[4];
816 ptrap[9] = ptrap[4];
817
818 gMC->Gsvolu("BA59", "TRAP", kSteel, ptrap, 11);
819 ptrap[0] = longW/4.-0.15;
820 ptrap[4] = longH/2.-0.30;
821 ptrap[5] = ptrap[4];
822 ptrap[7] = ptrap[3];
823 ptrap[8] = ptrap[4];
824 ptrap[9] = ptrap[4];
825 gMC->Gsvolu("BA62", "TRAP", kAir, ptrap, 11);
826 gMC->Gspos("BA62", 1, "BA59", 0.0, 0.0, -0.15, 0, "ONLY");
827
828 dz = -iFrH/2.+ringH+longH/2.;
829
d84d0b8c 830 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 831 gMC->Gspos("BA59", 2*jmod+1, module[jmod], 49.6476, 0.0, dz, idrotm[2084], "ONLY");
832 gMC->Gspos("BA59", 2*jmod+2, module[jmod], -49.6476, 0.0, dz, idrotm[2083], "ONLY");
7e5caa00 833 }
25918453 834
835
7e5caa00 836//
25918453 837// Thermal shield
7e5caa00 838//
23cb15ef 839 Float_t dyM = 99.0 - 4.;
25918453 840 MakeHeatScreen("M", dyM, idrotm[2090], idrotm[2091]);
23cb15ef 841 Float_t dyAM = 119.5 - 4.;
25918453 842 MakeHeatScreen("AM", dyAM, idrotm[2090], idrotm[2091]);
23cb15ef 843 Float_t dyA = 128.0 - 4.;
25918453 844 MakeHeatScreen("A" , dyA, idrotm[2090], idrotm[2091]);
845//
846//
847//
23cb15ef 848 dz = -57.2 + 0.6;
25918453 849 for (i = 0; i < 18; i++) {
850
851 char nameMo[16];
852 sprintf(nameMo, "BSEGMO%d",i);
853 // M
854 gMC->Gspos("BTSH_M" , i+1 , nameMo, 0., 0., dz, 0, "ONLY");
855 // AM, CM
23cb15ef 856 dy = dymodL[0] + dyAM / 2. + 4.5;
25918453 857 gMC->Gspos("BTSH_AM", i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
858 gMC->Gspos("BTSH_AM", i+19, nameMo, 0., -dy, dz, 0, "ONLY");
859 // A, C
23cb15ef 860 dy = dymodL[1] + dyA / 2. + 6.0;
25918453 861 gMC->Gspos("BTSH_A" , i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
862 gMC->Gspos("BTSH_A" , i+19, nameMo, 0., -dy, dz, 0, "ONLY");
863}
864
865
774c288e 866 //
867 // TRD mother volumes
868 //
d84d0b8c 869
a621ccf6 870 ptrd1[0] = 47.4405; // CBL 28/6/2006
871 ptrd1[1] = 61.1765; // CBL
872 ptrd1[2] = 375.5; // CBL
873 ptrd1[3] = 38.95; // CBL
874
875
d84d0b8c 876
877 for (i = 0; i < 18; i++) {
8ce41745 878 char nameCh[16];
d84d0b8c 879 sprintf(nameCh, "BTRD%d",i);
8ce41745 880 char nameMo[16];
d84d0b8c 881 sprintf(nameMo, "BSEGMO%d",i);
882 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
bb92d81d 883 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
a621ccf6 884 gMC->Gspos(nameCh, 1, nameMo, 0., 0., -11.75, 0, "ONLY"); // CBL 28/6/2006
d84d0b8c 885 }
4c057bc8 886
774c288e 887//
888// TOF mother volumes
889//
890 ptrd1[0] = 63.2061;
891 ptrd1[1] = 68.3192;
892 ptrd1[2] = 375.5;
893 ptrd1[3] = 14.5;
d84d0b8c 894 for (i = 0; i < 18; i++) {
8ce41745 895 char nameCh[16];
d84d0b8c 896 sprintf(nameCh, "BTOF%d",i);
8ce41745 897 char nameMo[16];
d84d0b8c 898 sprintf(nameMo, "BSEGMO%d",i);
899 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
bb92d81d 900 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
d84d0b8c 901 gMC->Gspos(nameCh, 1, nameMo, 0., 0., 42.69, 0, "ONLY");
902 }
d3507e34 903
b35d7d26 904//
905// Geometry of Rails starts here
906//
907//
908//
909// Rails for space-frame
910//
911 Float_t rbox[3];
912
913 rbox[0] = 25.00;
914 rbox[1] = 27.50;
915 rbox[2] = 600.00;
916 gMC->Gsvolu("BRS1", "BOX", kAir, rbox, 3);
917
918 rbox[0] = 25.00;
919 rbox[1] = 3.75;
920 gMC->Gsvolu("BRS2", "BOX", kSteel, rbox, 3);
921
922 rbox[0] = 3.00;
923 rbox[1] = 20.00;
924 gMC->Gsvolu("BRS3", "BOX", kSteel, rbox, 3);
925
926 gMC->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
927 gMC->Gspos("BRS2", 2, "BRS1", 0., 27.5-3.75, 0., 0, "ONLY");
928 gMC->Gspos("BRS3", 1, "BRS1", 0., 0., 0., 0, "ONLY");
85227d20 929 gMC->Gspos("BRS1", 1, "ALIC", -430.-3., -190., 0., 0, "ONLY");
930 gMC->Gspos("BRS1", 2, "ALIC", 430.+3., -190., 0., 0, "ONLY");
b35d7d26 931
932 rbox[0] = 3.0;
85227d20 933 rbox[1] = 145./4.;
b35d7d26 934 rbox[2] = 25.0;
935 gMC->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
936
85227d20 937 gMC->Gspos("BRS4", 1, "ALIC", 430.+3., -190.+55./2.+rbox[1], 224., 0, "ONLY");
938 gMC->Gspos("BRS4", 2, "ALIC", 430.+3., -190.+55./2.+rbox[1], -224., 0, "ONLY");
939// gMC->Gspos("BRS4", 3, "ALIC", -430.+3, -180.+55./2.+rbox[1], 224., 0, "ONLY");
940// gMC->Gspos("BRS4", 4, "ALIC", -430.+3, -180.+55./2.+rbox[1], -224., 0, "ONLY");
b35d7d26 941
f2744db7 942
943
944 //
945 // The Backframe
946 //
947 // Inner radius
948 Float_t kBFMRin = 270.0;
949 // Outer Radius
950 Float_t kBFMRou = 417.5;
951 // Width
952 Float_t kBFMdz = 118.0;
953 //
954 //
955 // Rings
956 Float_t kBFRdr = 7.5;
957 Float_t kBFRdz = 8.0;
958 //
959 //
960 // Bars and Spokes
961 //
962 Float_t kBFBd = 8.0;
963 Float_t kBFBdd = 0.6;
964
965
966 // The Mother volume
967 Float_t tpar[3];
968 tpar[0] = kBFMRin;
969 tpar[1] = kBFMRou;
970 tpar[2] = kBFMdz / 2.;
971 gMC->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);
972
973 // Rings
974 //
975 // Inner Ring
976 tpar[0] = kBFMRin;
977 tpar[1] = tpar[0] + kBFRdr;
978 tpar[2] = kBFRdz / 2.;
979
980 gMC->Gsvolu("BFIR", "TUBE", kSteel, tpar, 3);
981
982 tpar[0] = tpar[0] + kBFBdd;
983 tpar[1] = tpar[1] - kBFBdd;
984 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
985
986 gMC->Gsvolu("BFII", "TUBE", kAir, tpar, 3);
987 gMC->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");
988
f2744db7 989 //
990 // Outer RING
991 tpar[0] = kBFMRou - kBFRdr;
992 tpar[1] = kBFMRou;
993 tpar[2] = kBFRdz / 2.;
994
995 gMC->Gsvolu("BFOR", "TUBE", kSteel, tpar, 3);
996
997 tpar[0] = tpar[0] + kBFBdd;
998 tpar[1] = tpar[1] - kBFBdd;
999 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
1000
1001 gMC->Gsvolu("BFOO", "TUBE", kAir, tpar, 3);
1002 gMC->Gspos("BFOO", 1, "BFOR", 0., 0., 0., 0, "ONLY");
1003
1004
1005 dz = kBFMdz/2. - kBFRdz / 2.;
1006 gMC->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1007 gMC->Gspos("BFIR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1008 gMC->Gspos("BFOR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1009 gMC->Gspos("BFOR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1010
1011 //
1012 // Longitudinal Bars
1013 //
1014 Float_t bpar[3];
1015
1016 bpar[0] = kBFBd/2;
1017 bpar[1] = bpar[0];
1018 bpar[2] = kBFMdz/2. - kBFBd;
1019 gMC->Gsvolu("BFLB", "BOX ", kSteel, bpar, 3);
1020
1021 bpar[0] = bpar[0] - kBFBdd;
1022 bpar[1] = bpar[1] - kBFBdd;
1023 bpar[2] = bpar[2] - kBFBdd;
1024 gMC->Gsvolu("BFLL", "BOX ", kAir, bpar, 3);
1025 gMC->Gspos("BFLL", 1, "BFLB", 0., 0., 0., 0, "ONLY");
1026
1027 for (i = 0; i < 18; i++)
1028 {
1029 Float_t ro = kBFMRou - kBFBd / 2.;
1030 Float_t ri = kBFMRin + kBFBd / 2.;
1031
1032 Float_t phi = Float_t(i) * 20.;
1033
1034 Float_t x = ri * TMath::Cos(phi * kDegrad);
1035 Float_t y = ri * TMath::Sin(phi * kDegrad);
1036 AliMatrix(idrotm[2090+i], 90.0, phi, 90.0, phi + 270., 0., 0.);
1037
1038 gMC->Gspos("BFLB", i + 1, "BFMO", x, y, 0., idrotm[2090 + i], "ONLY");
1039
1040 x = ro * TMath::Cos(phi * kDegrad);
1041 y = ro * TMath::Sin(phi * kDegrad);
1042
1043 gMC->Gspos("BFLB", i + 19, "BFMO", x, y, 0., idrotm[2090 +i], "ONLY");
1044 }
1045
1046 //
1047 // Radial Bars
1048 //
1049 bpar[0] = (kBFMRou - kBFMRin - 2. * kBFRdr) / 2.;
1050 bpar[1] = kBFBd/2;
1051 bpar[2] = bpar[1];
1052 //
1053 // Avoid overlap with circle
1054 Float_t rr = kBFMRou - kBFRdr;
1055 Float_t delta = rr - TMath::Sqrt(rr * rr - kBFBd * kBFBd / 4.) + 0.01;
1056 bpar[0] -= delta /2.;
1057
1058
1059 gMC->Gsvolu("BFRB", "BOX ", kSteel, bpar, 3);
1060
1061 bpar[0] = bpar[0] - kBFBdd;
1062 bpar[1] = bpar[1] - kBFBdd;
1063 bpar[2] = bpar[2] - kBFBdd;
1064 gMC->Gsvolu("BFRR", "BOX ", kAir, bpar, 3);
1065 gMC->Gspos("BFRR", 1, "BFRB", 0., 0., 0., 0, "ONLY");
1066
1067 Int_t iphi[10] = {0, 1, 3, 6, 8, 9, 10, 12, 15, 17};
1068
1069 for (i = 0; i < 10; i++)
1070 {
1071
1072 Float_t r = (kBFMRin + kBFMRou)/2.;
1073 Float_t phi = Float_t(iphi[i]) * 20.;
1074
1075 Float_t x = r * TMath::Cos(phi * kDegrad);
1076 Float_t y = r * TMath::Sin(phi * kDegrad);
1077
1078 gMC->Gspos("BFRB", i + 1, "BFMO", x, y, dz, idrotm[2034 + iphi[i]], "ONLY");
1079 gMC->Gspos("BFRB", i + 11, "BFMO", x, y, -dz, idrotm[2034 + iphi[i]], "ONLY");
1080
1081 }
1082
9cde95f3 1083 gMC->Gspos("BFMO", i + 19, "ALIC", 0, 0, - 376. - kBFMdz/2. - 0.5 , 0, "ONLY");
f2744db7 1084
1085
1086
b35d7d26 1087//
f2744db7 1088//
1089// The Baby Frame
1090//
1091//
1092 //
1093 // Inner radius
1094 Float_t kBBMRin = 278.0;
1095 // Outer Radius
1096 Float_t kBBMRou = 410.5;
1097 // Width
1098 Float_t kBBMdz = 223.0;
1099 Float_t kBBBdz = 6.0;
1100 Float_t kBBBdd = 0.6;
1101
b35d7d26 1102
f2744db7 1103 // The Mother volume
1104
1105 ppgon[0] = 0.;
1106 ppgon[1] = 360.;
1107 ppgon[2] = 18.;
b35d7d26 1108
f2744db7 1109 ppgon[3] = 2.;
1110 ppgon[4] = -kBBMdz / 2. ;
1111 ppgon[5] = kBBMRin;
1112 ppgon[6] = kBBMRou;
1113
1114 ppgon[7] = -ppgon[4];
1115 ppgon[8] = ppgon[5];
1116 ppgon[9] = ppgon[6];
1117
1118 gMC->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
1119 gMC->Gsdvn("BBCE", "BBMO", 18, 2);
1120
1121 // Longitudinal bars
1122 bpar[0] = kBBBdz/2.;
1123 bpar[1] = bpar[0];
1124 bpar[2] = kBBMdz/2. - kBBBdz;
1125 gMC->Gsvolu("BBLB", "BOX ", kSteel, bpar, 3);
1126 bpar[0] -= kBBBdd;
1127 bpar[1] -= kBBBdd;
1128 bpar[2] -= kBBBdd;
1129 gMC->Gsvolu("BBLL", "BOX ", kAir, bpar, 3);
1130 gMC->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY");
1131
65cb363f 1132 dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1133 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1134 gMC->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1135
65cb363f 1136 dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1137 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1138
1139 gMC->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1140
1141 //
1142 // Radial Bars
1143 //
1144 bpar[0] = (kBBMRou - kBBMRin) / 2. - kBBBdz;
1145 bpar[1] = kBBBdz/2;
1146 bpar[2] = bpar[1];
1147
1148 gMC->Gsvolu("BBRB", "BOX ", kSteel, bpar, 3);
1149 bpar[0] -= kBBBdd;
1150 bpar[1] -= kBBBdd;
1151 bpar[2] -= kBBBdd;
1152 gMC->Gsvolu("BBRR", "BOX ", kAir, bpar, 3);
1153 gMC->Gspos("BBRR", 1, "BBRB", 0., 0., 0., 0, "ONLY");
1154
1155
1156 dx = (kBBMRou + kBBMRin) / 2.;
1157 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1158 dz = kBBMdz/2. - kBBBdz / 2.;
1159
1160 gMC->Gspos("BBRB", 1, "BBCE", dx, dy, dz, idrotm[2052], "ONLY");
1161 gMC->Gspos("BBRB", 2, "BBCE", dx, dy, - dz, idrotm[2052], "ONLY");
1162 gMC->Gspos("BBRB", 3, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1163
1164 //
1165 // Circular bars
1166 //
1167 // Inner
1168
1169 bpar[1] = kBBMRin * TMath::Sin(10. * kDegrad);
1170 bpar[0] = kBBBdz/2;
1171 bpar[2] = bpar[0];
1172 gMC->Gsvolu("BBC1", "BOX ", kSteel, bpar, 3);
1173 bpar[0] -= kBBBdd;
1174 bpar[1] -= kBBBdd;
1175 bpar[2] -= kBBBdd;
1176 gMC->Gsvolu("BBC2", "BOX ", kAir, bpar, 3);
1177 gMC->Gspos("BBC2", 1, "BBC1", 0., 0., 0., 0, "ONLY");
1178 dx = kBBMRin + kBBBdz/2;
1179 dy = 0.;
1180 gMC->Gspos("BBC1", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1181 gMC->Gspos("BBC1", 2, "BBCE", dx, dy, -dz, 0, "ONLY");
1182 //
1183 // Outer
1184 bpar[1] = (kBBMRou - kBBBdz) * TMath::Sin(10. * kDegrad);
1185 bpar[0] = kBBBdz/2;
1186 bpar[2] = bpar[0];
1187 gMC->Gsvolu("BBC3", "BOX ", kSteel, bpar, 3);
1188 bpar[0] -= kBBBdd;
1189 bpar[1] -= kBBBdd;
1190 bpar[2] -= kBBBdd;
1191 gMC->Gsvolu("BBC4", "BOX ", kAir, bpar, 3);
1192 gMC->Gspos("BBC4", 1, "BBC3", 0., 0., 0., 0, "ONLY");
1193 dx = kBBMRou - kBBBdz/2;
1194 dy = 0.;
1195 gMC->Gspos("BBC3", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1196 gMC->Gspos("BBC3", 2, "BBCE", dx, dy, - dz, 0, "ONLY");
1197 //
1198 // Diagonal Bars
1199 //
1200 h = (kBBMRou - kBBMRin - 2. * kBBBdz);;
1201 d = kBBBdz;
1202 dz = kBBMdz/2. - 1.6 * kBBBdz;
1203 dq = h*h+dz*dz;
1204
1205 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
1206
1207
1208 theta = kRaddeg * TMath::ACos(x);
1209
1210 ptrap[0] = dz/2.;
1211 ptrap[1] = theta;
1212 ptrap[2] = 0.;
1213 ptrap[3] = d/2;
1214 ptrap[4] = d/x/2;
1215 ptrap[5] = ptrap[4];
1216 ptrap[6] = 0;
1217 ptrap[7] = ptrap[3];
1218 ptrap[8] = ptrap[4];
1219 ptrap[9] = ptrap[4];
1220 ptrap[10] = 0;
1221 gMC->Gsvolu("BBD1", "TRAP", kSteel, ptrap, 11);
1222 ptrap[3] = d/2-kBBBdd;
1223 ptrap[4] = (d/2-kBBBdd)/x;
1224 ptrap[5] = ptrap[4];
1225 ptrap[7] = ptrap[3];
1226 ptrap[8] = ptrap[4];
1227 ptrap[9] = ptrap[4];
1228 gMC->Gsvolu("BBD3", "TRAP", kAir, ptrap, 11);
1229 gMC->Gspos("BBD3", 1, "BBD1", 0.0, 0.0, 0., 0, "ONLY");
1230 dx = (kBBMRou + kBBMRin) / 2.;
1231 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1232 gMC->Gspos("BBD1", 1, "BBCE", dx, dy, dz/2. + kBBBdz/2., idrotm[2052], "ONLY");
1233
1234
1235 ptrap[0] = dz/2.;
1236 ptrap[1] = -theta;
1237 ptrap[2] = 0.;
1238 ptrap[3] = d/2;
1239 ptrap[4] = d/2/x;
1240 ptrap[5] = ptrap[4];
1241 ptrap[6] = 0;
1242 ptrap[7] = ptrap[3];
1243 ptrap[8] = ptrap[4];
1244 ptrap[9] = ptrap[4];
1245 ptrap[10] = 0;
1246 gMC->Gsvolu("BBD2", "TRAP", kSteel, ptrap, 11);
1247 ptrap[3] = d/2-kBBBdd;
1248 ptrap[4] = (d/2-kBBBdd)/x;
1249 ptrap[5] = ptrap[4];
1250 ptrap[7] = ptrap[3];
1251 ptrap[8] = ptrap[4];
1252 ptrap[9] = ptrap[4];
1253 gMC->Gsvolu("BBD4", "TRAP", kAir, ptrap, 11);
1254 gMC->Gspos("BBD4", 1, "BBD2", 0.0, 0.0, 0., 0, "ONLY");
1255 dx = (kBBMRou + kBBMRin) / 2.;
1256 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1257 gMC->Gspos("BBD2", 1, "BBCE", dx, dy, -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");
1258
1259
9cde95f3 1260 gMC->Gspos("BBMO", 1, "ALIC", 0., 0., + 376. + kBBMdz / 2. + 0.5, 0, "ONLY");
f2744db7 1261
1262
7e5caa00 1263}
f2744db7 1264
7e5caa00 1265
1266
1267//___________________________________________
1268void AliFRAMEv2::CreateMaterials()
1269{
eeacf08b 1270 // Creates the materials
7e5caa00 1271 Float_t epsil, stemax, tmaxfd, deemax, stmin;
1272
1273 epsil = 1.e-4; // Tracking precision,
25918453 1274 stemax = -0.01; // Maximum displacement for multiple scat
1275 tmaxfd = -20.; // Maximum angle due to field deflection
1276 deemax = -.3; // Maximum fractional energy loss, DLS
7e5caa00 1277 stmin = -.8;
1278 Int_t isxfld = gAlice->Field()->Integ();
1279 Float_t sxmgmx = gAlice->Field()->Max();
002b3738 1280
1281
7e5caa00 1282 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1283 Float_t zsteel[4] = { 26.,24.,28.,14. };
1284 Float_t wsteel[4] = { .715,.18,.1,.005 };
6a894888 1285
1286 //Air
1287
1288 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1289 Float_t zAir[4]={6.,7.,8.,18.};
1290 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1291 Float_t dAir = 1.20479E-3;
7e5caa00 1292
1293 AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
002b3738 1294 AliMixture(5, "AIR$ ", aAir, zAir, dAir,4, wAir);
25918453 1295 AliMaterial(9, "ALU ", 26.98, 13., 2.7, 8.9, 37.2);
002b3738 1296
a260d998 1297 AliMedium(65, "Stainless Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1298 AliMedium( 5, "Air", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
25918453 1299 AliMedium( 9, "Aluminum", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
a260d998 1300
7e5caa00 1301}
1302
1303//_____________________________________________________________________________
1304void AliFRAMEv2::Init()
1305{
1306 //
1307 // Initialise the module after the geometry has been defined
1308 //
4951e003 1309 if(AliLog::GetGlobalDebugLevel()>0) {
0a05c568 1310 printf("%s: **************************************"
1311 " FRAME "
1312 "**************************************\n",ClassName());
1313 printf("\n%s: Version 2 of FRAME initialised, symmetric FRAME\n\n",ClassName());
1314 printf("%s: **************************************"
1315 " FRAME "
1316 "**************************************\n",ClassName());
1317 }
55bdc695 1318//
1319// The reference volume id
1320 fRefVolumeId = gMC->VolId("BREF");
7e5caa00 1321}
1322
6304e7d2 1323Int_t AliFRAMEv2::IsVersion() const
1324{
eeacf08b 1325 // Returns the version of the FRAME (1 if no holes, 0 otherwise)
6304e7d2 1326 Int_t version = 0;
1327 if (fHoles == 0) version = 1;
1328 return version;
1329}
7e5caa00 1330
55bdc695 1331void AliFRAMEv2::StepManager()
1332{
1333//
1334// Stepmanager of AliFRAMEv2.cxx
1335// Used for recording of reference tracks entering the spaceframe mother volume
1336//
1337 Int_t copy, id;
1338
1339 //
1340 // Only charged tracks
1341 if( !(gMC->TrackCharge()) ) return;
1342 //
1343 // Only tracks entering mother volume
1344 //
1345
1346 id=gMC->CurrentVolID(copy);
1347
1348 if (id != fRefVolumeId) return;
1349 if(!gMC->IsTrackEntering()) return;
1350 //
1351 // Add the reference track
1352 //
5d12ce38 1353 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
55bdc695 1354}
7e5caa00 1355
55bdc695 1356
7e5caa00 1357
25918453 1358void AliFRAMEv2::MakeHeatScreen(char* name, Float_t dyP, Int_t rot1, Int_t rot2)
1359{
1360 // Heat screen panel
1361 //
1362 Int_t *idtmed = fIdtmed->GetArray()-1999;
1363 const Int_t kAir = idtmed[2004];
1364 const Int_t kAlu = idtmed[2008];
1365
1366 Float_t dx, dy;
1367 char mname [128];
1368 char cname [128];
1369 char t1name[128];
1370 char t2name[128];
1371 char t3name[128];
1372 char t4name[128];
1373 char t5name[128];
1374
1375 //
23cb15ef 1376 Float_t dxP = 98.5;
1377 Float_t dzP = 1.05;
25918453 1378 //
1379 // Mother volume
1380 Float_t thshM[3];
1381 thshM[0] = dxP / 2.;
1382 thshM[1] = dyP / 2.;
1383 thshM[2] = dzP / 2.;
1384 sprintf(mname, "BTSH_%s", name);
1385 gMC->Gsvolu(mname, "BOX ", kAir, thshM, 3);
1386 //
1387 // Aluminum sheet
23cb15ef 1388 thshM[2] = 0.025;
25918453 1389 sprintf(cname, "BTSHA_%s", name);
1390 gMC->Gsvolu(cname, "BOX ", kAlu, thshM, 3);
23cb15ef 1391 gMC->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
25918453 1392 //
1393 // Tubes
1394 Float_t thshT[3];
1395 thshT[0] = 0.4;
1396 thshT[1] = 0.5;
23cb15ef 1397 thshT[2] = (dyP / 2. - 6.);
25918453 1398 //
1399 sprintf(t1name, "BTSHT1_%s", name);
1400 gMC->Gsvolu(t1name, "TUBE", kAlu, thshT, 3);
1401 dx = - dxP / 2. + 8.;
23cb15ef 1402 gMC->Gspos(t1name, 1, mname, dx, 0., 0.05, rot1);
1403 gMC->Gspos(t1name, 2, mname, -dx, 0., 0.05, rot1);
25918453 1404 //
1405 sprintf(t2name, "BTSHT2_%s", name);
1406 sprintf(t3name, "BTSHT3_%s", name);
1407 sprintf(t4name, "BTSHT4_%s", name);
1408 sprintf(t5name, "BTSHT5_%s", name);
1409 thshT[2] = (thshM[1] - 12.);
1410 gMC->Gsvolu(t2name, "TUBE", kAlu, thshT, 3);
1411 thshT[2] = 7.9/2.;
1412 gMC->Gsvolu(t3name, "TUBE", kAlu, thshT, 3);
1413 thshT[2] = 23.9/2.;
1414 gMC->Gsvolu(t4name, "TUBE", kAlu, thshT, 3);
1415 thshT[2] = 9.0/2.;
1416 gMC->Gsvolu(t5name, "TUBE", kAlu, thshT, 3);
23cb15ef 1417 gMC->Gspos(t5name, 0, mname, -dx - 4., - (dyP / 2. - 5.5), 0.05, rot2);
25918453 1418
1419 Int_t sig = 1;
1420 Int_t ipo = 1;
1421 for (Int_t i = 0; i < 5; i++) {
1422 sig *= -1;
1423 dx += 8.00;
1424 dy = 4. * sig;
1425 Float_t dy1 = - (thshM[1] - 15.5) * sig;
1426 Float_t dy2 = - (thshM[1] - 7.5) * sig;
1427
23cb15ef 1428 gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.05, rot1);
25918453 1429 dx += 6.9;
23cb15ef 1430 gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.05, rot1);
25918453 1431
23cb15ef 1432 gMC->Gspos(t3name, i+1, mname, dx - 3.45, dy1, 0.05, rot2);
1433 gMC->Gspos(t4name, i+1, mname, dx - 3.45, dy2, 0.05, rot2);
25918453 1434 }
1435}
7e5caa00 1436
1437
1438