]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STRUCT/AliFRAMEv2.cxx
Coding conventions
[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>
88cb7938 27
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)
36
37//_____________________________________________________________________________
38AliFRAMEv2::AliFRAMEv2()
39{
40// Constructor
41 SetHoles(0);
42}
43
44//_____________________________________________________________________________
45AliFRAMEv2::AliFRAMEv2(const char *name, const char *title)
46 : AliFRAME(name,title)
47{
48// Constructor
49 SetHoles(0);
50}
51
52
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);
122
123// gMC->Gsvolu("B077", "TUBE", kAir, ptube, 3);
7e5caa00 124 gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
125//
55bdc695 126// Reference plane for TRD
127//
128 ppgon[6] = ppgon[5] + 0.1;
129 ppgon[9] = ppgon[6];
130 gMC->Gsvolu("BREF", "PGON", kAir, ppgon, 10);
131 gMC->Gspos("BREF", 1, "B077", 0., 0., 0., 0, "ONLY");
132//
7e5caa00 133// The outer Frame
134//
135
136 Float_t dol = 8.75;
137 Float_t doh = 5.;
138 Float_t ds = 0.35;
139//
140// Mother volume
141//
142 ppgon[0] = 0.;
143 ppgon[1] = 360.;
144 ppgon[2] = 18.;
145
146 ppgon[3] = 2.;
147
148 ppgon[4] = -350.;
149 ppgon[5] = 399.;
150 ppgon[6] = 420.7122;
151
152 ppgon[7] = -ppgon[4];
153 ppgon[8] = ppgon[5];
154 ppgon[9] = ppgon[6];
155 gMC->Gsvolu("B076", "PGON", kAir, ppgon, 10);
156 gMC->Gspos("B076", 1, "B077", 0., 0., 0., 0, "ONLY");
157//
158// Rings
159//
160 dz = 2.*410.2*TMath::Sin(10.*kdeg2rad)-2.*dol*TMath::Cos(10.*kdeg2rad)-
161 2.*doh*TMath::Tan(10.*kdeg2rad);
162 Float_t l1 = dz/2.;
163 Float_t l2 = dz/2.+2.*doh*TMath::Tan(10.*kdeg2rad);
164
165 ptrd1[0] = l1;
166 ptrd1[1] = l2;
167
168 ptrd1[2] = dol;
169 ptrd1[3] = doh;
170 gMC->Gsvolu("B042", "TRD1", kSteel, ptrd1, 4);
171
172 ptrd1[0] = ptrd1[0]+ds*(l2-l1)/2./doh;
173 ptrd1[1] = ptrd1[1]-ds*(l2-l1)/2./doh;
174 ptrd1[2] = dol-ds;
175 ptrd1[3] = doh-ds;
176 gMC->Gsvolu("B043", "TRD1", kAir, ptrd1, 4);
177 gMC->Gspos("B043", 1, "B042", 0., 0., 0., 0, "ONLY");
178//
179// longitudinal bars
180//
181// 170x200x5
182//
183 pbox[0] = dol;
184 pbox[1] = doh;
185 pbox[2] = 350.;
186 gMC->Gsvolu("B033", "BOX", kSteel, pbox, 3);
187 pbox[0] = dol-ds;
188 pbox[1] = doh-ds;
189 gMC->Gsvolu("B034", "BOX", kAir, pbox, 3);
190 gMC->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
191
192 pbox[0] = 1.0;
193 pbox[1] = 5.0;
194 pbox[2] = 375.5;
195
196
197 gMC->Gsvolu("B080", "BOX", kSteel, pbox, 3);
b35d7d26 198 gMC->Gspos("B080", 1, "B077", 286.01, 0., 0., 0, "ONLY");
199 gMC->Gspos("B080", 2, "B077", -286.01, 0., 0., 0, "ONLY");
7e5caa00 200
201//
202// Diagonal bars (1)
203//
204 Float_t h, d, dq, x, theta;
205
4a8eca94 206 h = (dymodU[1]-dymodU[0]-2.*dol)*.999;
7e5caa00 207 d = 2.*dol;
208 dq = h*h+dz*dz;
209
210 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
211
212
213 theta = krad2deg * TMath::ACos(x);
214
215 ptrap[0] = dz/2.;
216 ptrap[1] = theta;
217 ptrap[2] = 0.;
218 ptrap[3] = doh;
219 ptrap[4] = dol/x;
220 ptrap[5] = ptrap[4];
221 ptrap[6] = 0;
222 ptrap[7] = ptrap[3];
223 ptrap[8] = ptrap[4];
224 ptrap[9] = ptrap[4];
225 ptrap[10] = 0;
226
227 gMC->Gsvolu("B047", "TRAP", kSteel, ptrap, 11);
228 ptrap[3] = doh-ds;
229 ptrap[4] = (dol-ds)/x;
230 ptrap[5] = ptrap[4];
231 ptrap[7] = ptrap[3];
232 ptrap[8] = ptrap[4];
233 ptrap[9] = ptrap[4];
234 gMC->Gsvolu("B048", "TRAP", kAir, ptrap, 11);
235 gMC->Gspos("B048", 1, "B047", 0.0, 0.0, 0., 0, "ONLY");
236
237/*
238 Crosses (inner most)
239 \\ //
240 \\//
241 //\\
242 // \\
243*/
4a8eca94 244 h = (2.*dymodU[0]-2.*dol)*.999;
7e5caa00 245//
246// Mother volume
247//
248 pbox[0] = h/2;
249 pbox[1] = doh;
250 pbox[2] = dz/2.;
251 gMC->Gsvolu("BM49", "BOX ", kAir, pbox, 3);
252
253
254 dq = h*h+dz*dz;
255 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
256 theta = krad2deg * TMath::ACos(x);
257
258 ptrap[0] = dz/2.-kEps;
259 ptrap[1] = theta;
260 ptrap[2] = 0.;
261 ptrap[3] = doh-kEps;
262 ptrap[4] = dol/x;
263 ptrap[5] = ptrap[4];
264 ptrap[7] = ptrap[3];
265 ptrap[8] = ptrap[4];
266 ptrap[9] = ptrap[4];
267
268 gMC->Gsvolu("B049", "TRAP", kSteel, ptrap, 11);
269 ptrap[0] = ptrap[0]-kEps;
270 ptrap[3] = (doh-ds);
271 ptrap[4] = (dol-ds)/x;
272 ptrap[5] = ptrap[4];
273 ptrap[7] = ptrap[3];
274 ptrap[8] = ptrap[4];
275 ptrap[9] = ptrap[4];
276 gMC->Gsvolu("B050", "TRAP", kAir, ptrap, 11);
277 gMC->Gspos("B050", 1, "B049", 0.0, 0.0, 0., 0, "ONLY");
278 gMC->Gspos("B049", 1, "BM49", 0.0, 0.0, 0., 0, "ONLY");
279
280
281 Float_t dd1 = d*TMath::Tan(theta*kdeg2rad);
282 Float_t dd2 = d/TMath::Tan(2.*theta*kdeg2rad);
283 Float_t theta2 = TMath::ATan(TMath::Abs(dd2-dd1)/d/2.);
284
285
286 ptrap[0] = dol;
287 ptrap[1] = theta2*krad2deg;
288 ptrap[2] = 0.;
289 ptrap[3] = doh;
290 ptrap[4] = (dz/2./x-dd1-dd2)/2.;
291 ptrap[5] = ptrap[4];
292 ptrap[6] = 0.;
293 ptrap[7] = ptrap[3];
294 ptrap[8] = dz/4./x;
295 ptrap[9] = ptrap[8];
296
297
298 gMC->Gsvolu("B051", "TRAP", kSteel, ptrap, 11);
299 Float_t ddx0 = ptrap[8];
300
301 Float_t dd1s = dd1*(1.-2.*ds/d);
302 Float_t dd2s = dd2*(1.-2.*ds/d);
303 Float_t theta2s = TMath::ATan(TMath::Abs(dd2s-dd1s)/(d-2.*ds)/2.);
304
305
306 ptrap[0] = dol-ds;
307 ptrap[1] = theta2s*krad2deg;
308 ptrap[2] = 0.;
309 ptrap[3] = doh-ds;
310 ptrap[4] = ptrap[4]+ds/d/2.*(dd1+dd2);
311 ptrap[5] = ptrap[4];
312 ptrap[6] = 0.;
313 ptrap[7] = ptrap[3];
314 ptrap[8] = ptrap[8]-ds/2./d*(dd1+dd2);
315 ptrap[9] = ptrap[8];
316
317 gMC->Gsvolu("B052", "TRAP", kAir, ptrap, 11);
318 gMC->Gspos("B052", 1, "B051", 0.0, 0.0, 0., 0, "ONLY");
319
320 Float_t ddx, ddz, drx, drz, rtheta;
321
4a8eca94 322 AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
7e5caa00 323 rtheta = (90.-theta)*kdeg2rad;
324 ddx = -ddx0-dol*TMath::Tan(theta2);
325 ddz = -dol;
326
327 drx = TMath::Cos(rtheta) * ddx +TMath::Sin(rtheta) *ddz+pbox[0];
328 drz = -TMath::Sin(rtheta) * ddx +TMath::Cos(rtheta) *ddz-pbox[2];
329 gMC->Gspos("B051", 1, "BM49",
330 drx, 0.0, drz,
4a8eca94 331 idrotm[2001], "ONLY");
7e5caa00 332
4a8eca94 333 AliMatrix(idrotm[2002], -theta, 0.0, 90.0, 90.0, 270.-theta, 0.0);
7e5caa00 334 rtheta = (270.-theta)*kdeg2rad;
335
336 drx = TMath::Cos(rtheta) * ddx + TMath::Sin(rtheta) * ddz-pbox[0];
337 drz = -TMath::Sin(rtheta) * ddx + TMath::Cos(rtheta) * ddz+pbox[2];
338 gMC->Gspos("B051", 2, "BM49",
339 drx, 0.0, drz,
4a8eca94 340 idrotm[2002], "ONLY");
7e5caa00 341
342//
343// Diagonal bars (3)
344//
4a8eca94 345 h = ((dymodU[2]-dymodU[1])-2.*dol)*.999;
7e5caa00 346 dq = h*h+dz*dz;
347 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
348 theta = krad2deg * TMath::ACos(x);
349
350 ptrap[0] = dz/2.;
351 ptrap[1] = theta;
352 ptrap[3] = doh;
353 ptrap[4] = dol/x;
354 ptrap[5] = ptrap[4];
355 ptrap[7] = ptrap[3];
356 ptrap[8] = ptrap[4];
357 ptrap[9] = ptrap[4];
358
359 gMC->Gsvolu("B045", "TRAP", kSteel, ptrap, 11);
360 ptrap[3] = doh-ds;
361 ptrap[4] = (dol-ds)/x;
362 ptrap[5] = ptrap[4];
363 ptrap[7] = ptrap[3];
364 ptrap[8] = ptrap[4];
365 ptrap[9] = ptrap[4];
366 gMC->Gsvolu("B046", "TRAP", kAir, ptrap, 11);
367 gMC->Gspos("B046", 1, "B045", 0.0, 0.0, 0., 0, "ONLY");
368
369//
370// Positioning of diagonal bars
371//
372// Matrices have been imported from Euclid. Some simplification
373// seems possible
374//
4a8eca94 375 AliMatrix(idrotm[2003], 0.0, 0.0, 90.0, 130.0, 90.0, 40.0);
376 AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0, 40.0);
377 AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
378 AliMatrix(idrotm[2006], 0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
379 AliMatrix(idrotm[2007], 0.0, 0.0, 90.0, 170.0, 90.0, 80.0);
380 AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
381 AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0, 80.0);
382 AliMatrix(idrotm[2010], 0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
383 AliMatrix(idrotm[2011], 0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
384 AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
385 AliMatrix(idrotm[2013], 180.0, 0.0, 90.0, 10.0, 90.0, 100.0);
386 AliMatrix(idrotm[2014], 0.0, 0.0, 90.0, 10.0, 90.0, 100.0);
387 AliMatrix(idrotm[2015], 0.0, 0.0, 90.0, 30.0, 90.0, 300.0);
388 AliMatrix(idrotm[2016], 180.0, 0.0, 90.0, 30.0, 90.0, 300.0);
389 AliMatrix(idrotm[2017], 180.0, 0.0, 90.0, 50.0, 90.0, 140.0);
390 AliMatrix(idrotm[2018], 0.0, 0.0, 90.0, 50.0, 90.0, 140.0);
391
392 AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
393 AliMatrix(idrotm[2020], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
394 AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
395 AliMatrix(idrotm[2022], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
396 AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
397 AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
398 AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
399 AliMatrix(idrotm[2026], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
400
401 AliMatrix(idrotm[2027], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
402 AliMatrix(idrotm[2028], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0);
403 AliMatrix(idrotm[2029], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
404 AliMatrix(idrotm[2030], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
405 AliMatrix(idrotm[2031], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
406 AliMatrix(idrotm[2032], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
407 AliMatrix(idrotm[2033], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
7e5caa00 408
409 Float_t rd = 410.56;
4a8eca94 410 dz = (dymodU[1]+dymodU[0])/2.;
411 Float_t dz2 = (dymodU[1]+dymodU[2])/2.;
7e5caa00 412
413//
414// phi = 40
415//
416 Float_t phi = 40;
417 dx = rd * TMath::Sin(phi*kdeg2rad);
418 dy = rd * TMath::Cos(phi*kdeg2rad);
419
7e5caa00 420
4a8eca94 421 gMC->Gspos("B045", 1, "B076", -dx, dy, dz2, idrotm[2019], "ONLY");
422 gMC->Gspos("B045", 2, "B076", -dx, dy, -dz2, idrotm[2003], "ONLY"); // ?
423 gMC->Gspos("B045", 3, "B076", dx, dy, dz2, idrotm[2020], "ONLY");
424 gMC->Gspos("B045", 4, "B076", dx, dy, -dz2, idrotm[2027], "ONLY");
7e5caa00 425
7e5caa00 426
427//
428// phi = 60
429//
430
431 phi = 60;
432 dx = rd * TMath::Sin(phi*kdeg2rad);
433 dy = rd * TMath::Cos(phi*kdeg2rad);
7e5caa00 434
4a8eca94 435 gMC->Gspos("B045", 5, "B076", -dx, dy, dz2, idrotm[2021], "ONLY");
436 gMC->Gspos("B045", 6, "B076", -dx, dy, -dz2, idrotm[2028], "ONLY");
437 gMC->Gspos("B045", 7, "B076", dx, dy, dz2, idrotm[2022], "ONLY");
438 gMC->Gspos("B045", 8, "B076", dx, dy, -dz2, idrotm[2029], "ONLY");
7e5caa00 439
7e5caa00 440//
441// phi = 80
442//
443
444 phi = 80;
445 dx = rd * TMath::Sin(phi*kdeg2rad);
446 dy = rd * TMath::Cos(phi*kdeg2rad);
7e5caa00 447
4a8eca94 448 gMC->Gspos("B047", 13, "B076", -dx, -dy, dz, idrotm[2008], "ONLY");
449 gMC->Gspos("B047", 14, "B076", -dx, -dy, -dz, idrotm[2010], "ONLY");
450 gMC->Gspos("B047", 15, "B076", dx, -dy, dz, idrotm[2012], "ONLY");
451 gMC->Gspos("B047", 16, "B076", dx, -dy, -dz, idrotm[2011], "ONLY");
7e5caa00 452
4a8eca94 453 gMC->Gspos("B045", 9, "B076", -dx, dy, dz2, idrotm[2023], "ONLY");
454 gMC->Gspos("B045", 10, "B076", -dx, dy, -dz2, idrotm[2031], "ONLY");
455 gMC->Gspos("B045", 11, "B076", dx, dy, dz2, idrotm[2026], "ONLY");
456 gMC->Gspos("B045", 12, "B076", dx, dy, -dz2, idrotm[2030], "ONLY");
7e5caa00 457
4a8eca94 458 gMC->Gspos("B045", 13, "B076", -dx, -dy, dz2, idrotm[2024], "ONLY");
459 gMC->Gspos("B045", 14, "B076", -dx, -dy, -dz2, idrotm[2032], "ONLY");
460 gMC->Gspos("B045", 15, "B076", dx, -dy, dz2, idrotm[2025], "ONLY");
461 gMC->Gspos("B045", 16, "B076", dx, -dy, -dz2, idrotm[2033], "ONLY");
7e5caa00 462
4a8eca94 463 gMC->Gspos("BM49", 7, "B076", dx, -dy, 0., idrotm[2025], "ONLY");
464 gMC->Gspos("BM49", 8, "B076", -dx, -dy, 0., idrotm[2024], "ONLY");
7e5caa00 465
466
467// The internal frame
468//
7e5caa00 469//
470//
471// Mother Volumes
472//
473 ptrd1[0] = 50.18;
474 ptrd1[1] = 70.35;
7e5caa00 475 ptrd1[2] = 375.5;
476 ptrd1[3] = 57.2;
7e5caa00 477
478 Float_t r = 341.8;
479 Float_t rout1 = 410.564;
480 Float_t rout2 = 415.2;
3c976b4c 481 TString module[18];
d84d0b8c 482// Position of Holes for PHOS (P) and RICH (R) starting at 6h
483// P P P - - R R R - - - - - - - - P P
484 Int_t mod[18] = {0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
7e5caa00 485
d84d0b8c 486 for (i = 0; i < 18; i++) {
487 // Create volume i
8ce41745 488 char name[16];
d84d0b8c 489 sprintf(name, "BSEGMO%d", i);
490 gMC->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
3c976b4c 491
492
d84d0b8c 493 module[i] = name;
494 // Place volume i
495 Float_t phi = i * 20.;
496 Float_t phi2 = 270 + phi;
497 if (phi2 >= 360.) phi2 -= 360.;
7e5caa00 498
499 dx = TMath::Sin(phi*kdeg2rad)*r;
500 dy = -TMath::Cos(phi*kdeg2rad)*r;
7e5caa00 501
4a8eca94 502 AliMatrix(idrotm[2034+i], 90.0, phi, 0., 0., 90., phi2);
d84d0b8c 503 gMC->Gspos(name, 1, "B077", dx, dy, 0., idrotm[2034+i], "ONLY");
7e5caa00 504//
505// Position elements of outer Frame
506//
507 dx = TMath::Sin(phi*kdeg2rad)*rout1;
508 dy = -TMath::Cos(phi*kdeg2rad)*rout1;
509 for (j = 0; j < 3; j++)
510 {
4a8eca94 511 dz = dymodU[j];
512 gMC->Gspos("B042", 6*i+2*j+1, "B076", dx, dy, dz, idrotm[2034+i], "ONLY");
513 gMC->Gspos("B042", 6*i+2*j+2, "B076", dx, dy, -dz, idrotm[2034+i], "ONLY");
7e5caa00 514 }
515
516 phi = i*20.+10;
517 phi2 = 270+phi;
4a8eca94 518 AliMatrix(idrotm[2052+i], 90.0, phi, 90., phi2, 0., 0.);
7e5caa00 519
520 dx = TMath::Sin(phi*kdeg2rad)*rout2;
521 dy = -TMath::Cos(phi*kdeg2rad)*rout2;
4a8eca94 522 gMC->Gspos("B033", i+1, "B076", dx, dy, 0., idrotm[2052+i], "ONLY");
7e5caa00 523//
524 }
525// Internal Frame rings
526//
527//
528// new specs: 40x100x6 for inner rings
529// 30x135x6 for front and rear rings
530//
531// currently no distinction between front/rear and inner rings
532//
533//
534//
535 pbox[0] = 50.;
536 pbox[1] = ringW/2.;
537 pbox[2] = ringH/2.;
538
539 gMC->Gsvolu("B072", "BOX ", kSteel, pbox, 3);
540
541 pbox[1] = pbox[1] - 0.6;
542 pbox[2] = pbox[2] - 0.6;
543 gMC->Gsvolu("B073", "BOX ", kAir, pbox, 3);
544 gMC->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
545
546// Web frame 0-degree
547//
548// h x w x s = 60x40x4
549// (attention: element is are half bars, "U" shaped)
550//
4a8eca94 551 dz = 106.2;
552 d = 2.*dwl;
553 h = dymodU[0]-dymodL[0];
554 dq = h*h+dz*dz;
555
556 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
7e5caa00 557
4a8eca94 558 theta = TMath::ACos(x);
559 Float_t thetaP = (TMath::Pi()-theta)*krad2deg;
560
561 ptrap[0] = dz/2.;
562 ptrap[1] = thetaP;
563 ptrap[2] = 0.;
564 ptrap[3] = dwh;
565 ptrap[4] = dwl/cos(theta);
566 ptrap[5] = ptrap[4];
567 ptrap[6] = 0;
568 ptrap[7] = ptrap[3];
569 ptrap[8] = ptrap[4];
570 ptrap[9] = ptrap[4];
571 ptrap[10] = 0;
572 gMC->Gsvolu("B063", "TRAP", kSteel, ptrap, 11);
573 ptrap[3] = dwh - 0.2;
574 ptrap[4] = (dwl-0.4)/cos(theta);
575 ptrap[5] = ptrap[4];
576 ptrap[7] = ptrap[3];
577 ptrap[8] = ptrap[4];
578 ptrap[9] = ptrap[4];
579 gMC->Gsvolu("B064", "TRAP", kAir, ptrap, 11);
580 gMC->Gspos("B064", 1, "B063", 0.0, -0.2, 0., 0, "ONLY");
581
582
583 h = 106.2;
584 d = 2.*dwl;
585 dz = dymodU[1]-dymodL[1];
586 dq = h*h+dz*dz;
587
588 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
589
590
591 theta = krad2deg * TMath::ACos(x);
592
593 ptrap[0] = dz/2.;
594 ptrap[1] = theta;
595 ptrap[2] = 0.;
596 ptrap[3] = dwh;
597 ptrap[4] = dwl/x;
598 ptrap[5] = ptrap[4];
599 ptrap[6] = 0;
600 ptrap[7] = ptrap[3];
601 ptrap[8] = ptrap[4];
602 ptrap[9] = ptrap[4];
603 ptrap[10] = 0;
604 gMC->Gsvolu("B163", "TRAP", kSteel, ptrap, 11);
605 ptrap[3] = dwh - 0.2;
606 ptrap[4] = (dwl-0.4)/x;
607 ptrap[5] = ptrap[4];
608 ptrap[7] = ptrap[3];
609 ptrap[8] = ptrap[4];
610 ptrap[9] = ptrap[4];
611 gMC->Gsvolu("B164", "TRAP", kAir, ptrap, 11);
612 gMC->Gspos("B164", 1, "B163", 0.0, -0.2, 0., 0, "ONLY");
613
614
7e5caa00 615 pbox[0] = dwh;
616 pbox[1] = dwl;
617 pbox[2] = (iFrH-ringH-longH)/2.;
4a8eca94 618 gMC->Gsvolu("B263", "BOX ", kSteel, pbox, 3);
7e5caa00 619 pbox[0] = dwh-0.2;
620 pbox[1] = dwl-0.4;
621
4a8eca94 622 gMC->Gsvolu("B264", "BOX ", kAir, pbox, 3);
623 gMC->Gspos("B264", 1, "B263", 0.2, 0., 0., 0, "ONLY");
624
625
626 AliMatrix(idrotm[2070], 90.0, 0.0, 90.0, 270.0, 0.0, 0.0);
627//
628 AliMatrix(idrotm[2071], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
629 AliMatrix(idrotm[2072], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
630 AliMatrix(idrotm[2073], 100.0, 180.0, 90.0, 270.0, 10.0, 180.0);
631 AliMatrix(idrotm[2074], 100.0, 180.0, 90.0, 90.0, 10.0, 180.0);
632//
633 AliMatrix(idrotm[2075], 10.0, 0.0, 80.0, 180.0, 90.0, 90.0);
634 AliMatrix(idrotm[2076], 10.0, 0.0, 80.0, 180.0, 90.0, 270.0);
635 AliMatrix(idrotm[2077], 10.0, 180.0, 80.0, 0.0, 90.0, 90.0);
636 AliMatrix(idrotm[2078], 10.0, 180.0, 80.0, 0.0, 90.0, 270.0);
637//
638 AliMatrix(idrotm[2079], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
639 AliMatrix(idrotm[2080], 170.0, 180.0, 80.0, 180.0, 90.0, 270.0);
640 AliMatrix(idrotm[2081], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
641 AliMatrix(idrotm[2082], 170.0, 0.0, 80.0, 0.0, 90.0, 270.0);
642
643//
644 AliMatrix(idrotm[2083], 170.0, 0.0, 90.0, 90.0, 80.0, 0.0);
645 AliMatrix(idrotm[2084], 170.0, 180.0, 90.0, 90.0, 80.0, 180.0);
646 AliMatrix(idrotm[2085], 90.0, 180.0, 90.0, 90.0, 0.0, 0.0);
647//
648 AliMatrix(idrotm[2086], 90.0, 90.0, 100.0, 0., 170.0, 180.0);
649 AliMatrix(idrotm[2087], 90.0, 90.0, 100.0, 0., 10.0, 0.0);
650 AliMatrix(idrotm[2088], 90.0, 90.0, 80.0, 0., 170.0, 0.0);
651 AliMatrix(idrotm[2089], 90.0, 90.0, 80.0, 0., -10.0, 0.0);
652
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
d84d0b8c 721 for (i = 0; i< 18; i++)
7e5caa00 722 {
723// ring bars
724 for (jmod = 0; jmod<3; jmod++) {
d84d0b8c 725 gMC->Gspos("B072", 6*i+jmod+1, module[jmod], 0, dymodL[mod[i]], dz, 0, "ONLY");
726 gMC->Gspos("B072", 6*i+jmod+4, module[jmod], 0, -dymodL[mod[i]], dz, idrotm[2070], "ONLY");
7e5caa00 727
728// 0-deg web
d84d0b8c 729 if (mod[i] == 2) {
730 gMC->Gspos("B263", 12*i+jmod+1, module[jmod], 60.0732, dymodU[2], 4.6669, idrotm[2072], "ONLY");
731 gMC->Gspos("B263", 12*i+jmod+4, module[jmod], 60.0732, -dymodU[2], 4.6669, idrotm[2071], "ONLY");
732 gMC->Gspos("B263", 12*i+jmod+7, module[jmod], -60.0732, dymodU[2], 4.6669, idrotm[2074], "ONLY");
733 gMC->Gspos("B263", 12*i+jmod+10, 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 }
834//
835//
836// Spacer between TRD and TOF modules
49078eb3 837/*
7e5caa00 838 ptrap[0] = 0.99;
839 ptrap[1] = 10.00;
840 ptrap[2] = 0.00;
841 ptrap[3] = 350.00;
842 ptrap[4] = 0.9;
843 ptrap[5] = ptrap[4];
844 ptrap[6] = 0;
845 ptrap[7] = ptrap[3];
846 ptrap[8] = ptrap[4];
847 ptrap[9] = ptrap[4];
848 ptrap[10] = 0;
849 gMC->Gsvolu("B056", "TRAP", kSteel, ptrap, 11);
d84d0b8c 850 for (jmod = 0; jmod < 18; jmod++) {
7e5caa00 851 gMC->Gspos("B056", 2*jmod+1, module[jmod], 61.9607, 0.0, 27.2, 0 , "ONLY");
4a8eca94 852 gMC->Gspos("B056", 2*jmod+2, module[jmod], -61.9607, 0.0, 27.2, idrotm[2085], "ONLY");
7e5caa00 853 }
49078eb3 854*/
774c288e 855 //
856 // TRD mother volumes
857 //
d84d0b8c 858
774c288e 859 ptrd1[0] = 49.8065;
d84d0b8c 860 ptrd1[1] = 63.0060;
774c288e 861 ptrd1[2] = 375.5;
d84d0b8c 862 ptrd1[3] = 37.43;
863
864// ptrd1[0] = 49.8065;
865// ptrd1[1] = 62.8535;
866// ptrd1[2] = 375.5;
867// ptrd1[3] = 37.;
868
869 for (i = 0; i < 18; i++) {
8ce41745 870 char nameCh[16];
d84d0b8c 871 sprintf(nameCh, "BTRD%d",i);
8ce41745 872 char nameMo[16];
d84d0b8c 873 sprintf(nameMo, "BSEGMO%d",i);
874 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
875 gMC->Gspos(nameCh, 1, nameMo, 0., 0., -10.37, 0, "ONLY");
876 }
4c057bc8 877
774c288e 878//
879// TOF mother volumes
880//
881 ptrd1[0] = 63.2061;
882 ptrd1[1] = 68.3192;
883 ptrd1[2] = 375.5;
884 ptrd1[3] = 14.5;
d84d0b8c 885 for (i = 0; i < 18; i++) {
8ce41745 886 char nameCh[16];
d84d0b8c 887 sprintf(nameCh, "BTOF%d",i);
8ce41745 888 char nameMo[16];
d84d0b8c 889 sprintf(nameMo, "BSEGMO%d",i);
890 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
891 gMC->Gspos(nameCh, 1, nameMo, 0., 0., 42.69, 0, "ONLY");
892 }
d3507e34 893
b35d7d26 894//
895// Geometry of Rails starts here
896//
897//
898//
899// Rails for space-frame
900//
901 Float_t rbox[3];
902
903 rbox[0] = 25.00;
904 rbox[1] = 27.50;
905 rbox[2] = 600.00;
906 gMC->Gsvolu("BRS1", "BOX", kAir, rbox, 3);
907
908 rbox[0] = 25.00;
909 rbox[1] = 3.75;
910 gMC->Gsvolu("BRS2", "BOX", kSteel, rbox, 3);
911
912 rbox[0] = 3.00;
913 rbox[1] = 20.00;
914 gMC->Gsvolu("BRS3", "BOX", kSteel, rbox, 3);
915
916 gMC->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
917 gMC->Gspos("BRS2", 2, "BRS1", 0., 27.5-3.75, 0., 0, "ONLY");
918 gMC->Gspos("BRS3", 1, "BRS1", 0., 0., 0., 0, "ONLY");
919 gMC->Gspos("BRS1", 1, "ALIC", -430.-3., -180., 0., 0, "ONLY");
920 gMC->Gspos("BRS1", 2, "ALIC", 430.+3., -180., 0., 0, "ONLY");
921
922 rbox[0] = 3.0;
e16311cb 923 rbox[1] = 145./2.;
b35d7d26 924 rbox[2] = 25.0;
925 gMC->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
926
927 gMC->Gspos("BRS4", 1, "ALIC", 430.+3., -180.+55./2.+rbox[1], 224., 0, "ONLY");
928 gMC->Gspos("BRS4", 2, "ALIC", 430.+3., -180.+55./2.+rbox[1], -224., 0, "ONLY");
929 gMC->Gspos("BRS4", 3, "ALIC", -430.-3., -180.+55./2.+rbox[1], 224., 0, "ONLY");
930 gMC->Gspos("BRS4", 4, "ALIC", -430.-3., -180.+55./2.+rbox[1], -224., 0, "ONLY");
931
f2744db7 932
933
934 //
935 // The Backframe
936 //
937 // Inner radius
938 Float_t kBFMRin = 270.0;
939 // Outer Radius
940 Float_t kBFMRou = 417.5;
941 // Width
942 Float_t kBFMdz = 118.0;
943 //
944 //
945 // Rings
946 Float_t kBFRdr = 7.5;
947 Float_t kBFRdz = 8.0;
948 //
949 //
950 // Bars and Spokes
951 //
952 Float_t kBFBd = 8.0;
953 Float_t kBFBdd = 0.6;
954
955
956 // The Mother volume
957 Float_t tpar[3];
958 tpar[0] = kBFMRin;
959 tpar[1] = kBFMRou;
960 tpar[2] = kBFMdz / 2.;
961 gMC->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);
962
963 // Rings
964 //
965 // Inner Ring
966 tpar[0] = kBFMRin;
967 tpar[1] = tpar[0] + kBFRdr;
968 tpar[2] = kBFRdz / 2.;
969
970 gMC->Gsvolu("BFIR", "TUBE", kSteel, tpar, 3);
971
972 tpar[0] = tpar[0] + kBFBdd;
973 tpar[1] = tpar[1] - kBFBdd;
974 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
975
976 gMC->Gsvolu("BFII", "TUBE", kAir, tpar, 3);
977 gMC->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");
978
f2744db7 979 //
980 // Outer RING
981 tpar[0] = kBFMRou - kBFRdr;
982 tpar[1] = kBFMRou;
983 tpar[2] = kBFRdz / 2.;
984
985 gMC->Gsvolu("BFOR", "TUBE", kSteel, tpar, 3);
986
987 tpar[0] = tpar[0] + kBFBdd;
988 tpar[1] = tpar[1] - kBFBdd;
989 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
990
991 gMC->Gsvolu("BFOO", "TUBE", kAir, tpar, 3);
992 gMC->Gspos("BFOO", 1, "BFOR", 0., 0., 0., 0, "ONLY");
993
994
995 dz = kBFMdz/2. - kBFRdz / 2.;
996 gMC->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
997 gMC->Gspos("BFIR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
998 gMC->Gspos("BFOR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
999 gMC->Gspos("BFOR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1000
1001 //
1002 // Longitudinal Bars
1003 //
1004 Float_t bpar[3];
1005
1006 bpar[0] = kBFBd/2;
1007 bpar[1] = bpar[0];
1008 bpar[2] = kBFMdz/2. - kBFBd;
1009 gMC->Gsvolu("BFLB", "BOX ", kSteel, bpar, 3);
1010
1011 bpar[0] = bpar[0] - kBFBdd;
1012 bpar[1] = bpar[1] - kBFBdd;
1013 bpar[2] = bpar[2] - kBFBdd;
1014 gMC->Gsvolu("BFLL", "BOX ", kAir, bpar, 3);
1015 gMC->Gspos("BFLL", 1, "BFLB", 0., 0., 0., 0, "ONLY");
1016
1017 for (i = 0; i < 18; i++)
1018 {
1019 Float_t ro = kBFMRou - kBFBd / 2.;
1020 Float_t ri = kBFMRin + kBFBd / 2.;
1021
1022 Float_t phi = Float_t(i) * 20.;
1023
1024 Float_t x = ri * TMath::Cos(phi * kDegrad);
1025 Float_t y = ri * TMath::Sin(phi * kDegrad);
1026 AliMatrix(idrotm[2090+i], 90.0, phi, 90.0, phi + 270., 0., 0.);
1027
1028 gMC->Gspos("BFLB", i + 1, "BFMO", x, y, 0., idrotm[2090 + i], "ONLY");
1029
1030 x = ro * TMath::Cos(phi * kDegrad);
1031 y = ro * TMath::Sin(phi * kDegrad);
1032
1033 gMC->Gspos("BFLB", i + 19, "BFMO", x, y, 0., idrotm[2090 +i], "ONLY");
1034 }
1035
1036 //
1037 // Radial Bars
1038 //
1039 bpar[0] = (kBFMRou - kBFMRin - 2. * kBFRdr) / 2.;
1040 bpar[1] = kBFBd/2;
1041 bpar[2] = bpar[1];
1042 //
1043 // Avoid overlap with circle
1044 Float_t rr = kBFMRou - kBFRdr;
1045 Float_t delta = rr - TMath::Sqrt(rr * rr - kBFBd * kBFBd / 4.) + 0.01;
1046 bpar[0] -= delta /2.;
1047
1048
1049 gMC->Gsvolu("BFRB", "BOX ", kSteel, bpar, 3);
1050
1051 bpar[0] = bpar[0] - kBFBdd;
1052 bpar[1] = bpar[1] - kBFBdd;
1053 bpar[2] = bpar[2] - kBFBdd;
1054 gMC->Gsvolu("BFRR", "BOX ", kAir, bpar, 3);
1055 gMC->Gspos("BFRR", 1, "BFRB", 0., 0., 0., 0, "ONLY");
1056
1057 Int_t iphi[10] = {0, 1, 3, 6, 8, 9, 10, 12, 15, 17};
1058
1059 for (i = 0; i < 10; i++)
1060 {
1061
1062 Float_t r = (kBFMRin + kBFMRou)/2.;
1063 Float_t phi = Float_t(iphi[i]) * 20.;
1064
1065 Float_t x = r * TMath::Cos(phi * kDegrad);
1066 Float_t y = r * TMath::Sin(phi * kDegrad);
1067
1068 gMC->Gspos("BFRB", i + 1, "BFMO", x, y, dz, idrotm[2034 + iphi[i]], "ONLY");
1069 gMC->Gspos("BFRB", i + 11, "BFMO", x, y, -dz, idrotm[2034 + iphi[i]], "ONLY");
1070
1071 }
1072
1073 gMC->Gspos("BFMO", i + 19, "ALIC", 0, 0, 376. + kBFMdz/2. + 0.5 , 0, "ONLY");
1074
1075
1076
b35d7d26 1077//
f2744db7 1078//
1079// The Baby Frame
1080//
1081//
1082 //
1083 // Inner radius
1084 Float_t kBBMRin = 278.0;
1085 // Outer Radius
1086 Float_t kBBMRou = 410.5;
1087 // Width
1088 Float_t kBBMdz = 223.0;
1089 Float_t kBBBdz = 6.0;
1090 Float_t kBBBdd = 0.6;
1091
b35d7d26 1092
f2744db7 1093 // The Mother volume
1094
1095 ppgon[0] = 0.;
1096 ppgon[1] = 360.;
1097 ppgon[2] = 18.;
b35d7d26 1098
f2744db7 1099 ppgon[3] = 2.;
1100 ppgon[4] = -kBBMdz / 2. ;
1101 ppgon[5] = kBBMRin;
1102 ppgon[6] = kBBMRou;
1103
1104 ppgon[7] = -ppgon[4];
1105 ppgon[8] = ppgon[5];
1106 ppgon[9] = ppgon[6];
1107
1108 gMC->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
1109 gMC->Gsdvn("BBCE", "BBMO", 18, 2);
1110
1111 // Longitudinal bars
1112 bpar[0] = kBBBdz/2.;
1113 bpar[1] = bpar[0];
1114 bpar[2] = kBBMdz/2. - kBBBdz;
1115 gMC->Gsvolu("BBLB", "BOX ", kSteel, bpar, 3);
1116 bpar[0] -= kBBBdd;
1117 bpar[1] -= kBBBdd;
1118 bpar[2] -= kBBBdd;
1119 gMC->Gsvolu("BBLL", "BOX ", kAir, bpar, 3);
1120 gMC->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY");
1121
65cb363f 1122 dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1123 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1124 gMC->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1125
65cb363f 1126 dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1127 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1128
1129 gMC->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1130
1131 //
1132 // Radial Bars
1133 //
1134 bpar[0] = (kBBMRou - kBBMRin) / 2. - kBBBdz;
1135 bpar[1] = kBBBdz/2;
1136 bpar[2] = bpar[1];
1137
1138 gMC->Gsvolu("BBRB", "BOX ", kSteel, bpar, 3);
1139 bpar[0] -= kBBBdd;
1140 bpar[1] -= kBBBdd;
1141 bpar[2] -= kBBBdd;
1142 gMC->Gsvolu("BBRR", "BOX ", kAir, bpar, 3);
1143 gMC->Gspos("BBRR", 1, "BBRB", 0., 0., 0., 0, "ONLY");
1144
1145
1146 dx = (kBBMRou + kBBMRin) / 2.;
1147 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1148 dz = kBBMdz/2. - kBBBdz / 2.;
1149
1150 gMC->Gspos("BBRB", 1, "BBCE", dx, dy, dz, idrotm[2052], "ONLY");
1151 gMC->Gspos("BBRB", 2, "BBCE", dx, dy, - dz, idrotm[2052], "ONLY");
1152 gMC->Gspos("BBRB", 3, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1153
1154 //
1155 // Circular bars
1156 //
1157 // Inner
1158
1159 bpar[1] = kBBMRin * TMath::Sin(10. * kDegrad);
1160 bpar[0] = kBBBdz/2;
1161 bpar[2] = bpar[0];
1162 gMC->Gsvolu("BBC1", "BOX ", kSteel, bpar, 3);
1163 bpar[0] -= kBBBdd;
1164 bpar[1] -= kBBBdd;
1165 bpar[2] -= kBBBdd;
1166 gMC->Gsvolu("BBC2", "BOX ", kAir, bpar, 3);
1167 gMC->Gspos("BBC2", 1, "BBC1", 0., 0., 0., 0, "ONLY");
1168 dx = kBBMRin + kBBBdz/2;
1169 dy = 0.;
1170 gMC->Gspos("BBC1", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1171 gMC->Gspos("BBC1", 2, "BBCE", dx, dy, -dz, 0, "ONLY");
1172 //
1173 // Outer
1174 bpar[1] = (kBBMRou - kBBBdz) * TMath::Sin(10. * kDegrad);
1175 bpar[0] = kBBBdz/2;
1176 bpar[2] = bpar[0];
1177 gMC->Gsvolu("BBC3", "BOX ", kSteel, bpar, 3);
1178 bpar[0] -= kBBBdd;
1179 bpar[1] -= kBBBdd;
1180 bpar[2] -= kBBBdd;
1181 gMC->Gsvolu("BBC4", "BOX ", kAir, bpar, 3);
1182 gMC->Gspos("BBC4", 1, "BBC3", 0., 0., 0., 0, "ONLY");
1183 dx = kBBMRou - kBBBdz/2;
1184 dy = 0.;
1185 gMC->Gspos("BBC3", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1186 gMC->Gspos("BBC3", 2, "BBCE", dx, dy, - dz, 0, "ONLY");
1187 //
1188 // Diagonal Bars
1189 //
1190 h = (kBBMRou - kBBMRin - 2. * kBBBdz);;
1191 d = kBBBdz;
1192 dz = kBBMdz/2. - 1.6 * kBBBdz;
1193 dq = h*h+dz*dz;
1194
1195 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
1196
1197
1198 theta = kRaddeg * TMath::ACos(x);
1199
1200 ptrap[0] = dz/2.;
1201 ptrap[1] = theta;
1202 ptrap[2] = 0.;
1203 ptrap[3] = d/2;
1204 ptrap[4] = d/x/2;
1205 ptrap[5] = ptrap[4];
1206 ptrap[6] = 0;
1207 ptrap[7] = ptrap[3];
1208 ptrap[8] = ptrap[4];
1209 ptrap[9] = ptrap[4];
1210 ptrap[10] = 0;
1211 gMC->Gsvolu("BBD1", "TRAP", kSteel, ptrap, 11);
1212 ptrap[3] = d/2-kBBBdd;
1213 ptrap[4] = (d/2-kBBBdd)/x;
1214 ptrap[5] = ptrap[4];
1215 ptrap[7] = ptrap[3];
1216 ptrap[8] = ptrap[4];
1217 ptrap[9] = ptrap[4];
1218 gMC->Gsvolu("BBD3", "TRAP", kAir, ptrap, 11);
1219 gMC->Gspos("BBD3", 1, "BBD1", 0.0, 0.0, 0., 0, "ONLY");
1220 dx = (kBBMRou + kBBMRin) / 2.;
1221 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1222 gMC->Gspos("BBD1", 1, "BBCE", dx, dy, dz/2. + kBBBdz/2., idrotm[2052], "ONLY");
1223
1224
1225 ptrap[0] = dz/2.;
1226 ptrap[1] = -theta;
1227 ptrap[2] = 0.;
1228 ptrap[3] = d/2;
1229 ptrap[4] = d/2/x;
1230 ptrap[5] = ptrap[4];
1231 ptrap[6] = 0;
1232 ptrap[7] = ptrap[3];
1233 ptrap[8] = ptrap[4];
1234 ptrap[9] = ptrap[4];
1235 ptrap[10] = 0;
1236 gMC->Gsvolu("BBD2", "TRAP", kSteel, ptrap, 11);
1237 ptrap[3] = d/2-kBBBdd;
1238 ptrap[4] = (d/2-kBBBdd)/x;
1239 ptrap[5] = ptrap[4];
1240 ptrap[7] = ptrap[3];
1241 ptrap[8] = ptrap[4];
1242 ptrap[9] = ptrap[4];
1243 gMC->Gsvolu("BBD4", "TRAP", kAir, ptrap, 11);
1244 gMC->Gspos("BBD4", 1, "BBD2", 0.0, 0.0, 0., 0, "ONLY");
1245 dx = (kBBMRou + kBBMRin) / 2.;
1246 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1247 gMC->Gspos("BBD2", 1, "BBCE", dx, dy, -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");
1248
1249
1250 gMC->Gspos("BBMO", 1, "ALIC", 0., 0., - 376. - kBBMdz / 2. - 0.5, 0, "ONLY");
1251
1252
7e5caa00 1253}
f2744db7 1254
7e5caa00 1255
1256
1257//___________________________________________
1258void AliFRAMEv2::CreateMaterials()
1259{
eeacf08b 1260 // Creates the materials
7e5caa00 1261 Float_t epsil, stemax, tmaxfd, deemax, stmin;
1262
1263 epsil = 1.e-4; // Tracking precision,
1264 stemax = -0.01; // Maximum displacement for multiple scat
1265 tmaxfd = -20.; // Maximum angle due to field deflection
1266 deemax = -.3; // Maximum fractional energy loss, DLS
1267 stmin = -.8;
1268 Int_t isxfld = gAlice->Field()->Integ();
1269 Float_t sxmgmx = gAlice->Field()->Max();
002b3738 1270
1271
7e5caa00 1272 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1273 Float_t zsteel[4] = { 26.,24.,28.,14. };
1274 Float_t wsteel[4] = { .715,.18,.1,.005 };
6a894888 1275
1276 //Air
1277
1278 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1279 Float_t zAir[4]={6.,7.,8.,18.};
1280 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1281 Float_t dAir = 1.20479E-3;
7e5caa00 1282
1283 AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
002b3738 1284 AliMixture(5, "AIR$ ", aAir, zAir, dAir,4, wAir);
1285
a260d998 1286 AliMedium(65, "Stainless Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1287 AliMedium( 5, "Air", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1288
7e5caa00 1289}
1290
1291//_____________________________________________________________________________
1292void AliFRAMEv2::Init()
1293{
1294 //
1295 // Initialise the module after the geometry has been defined
1296 //
4951e003 1297 if(AliLog::GetGlobalDebugLevel()>0) {
0a05c568 1298 printf("%s: **************************************"
1299 " FRAME "
1300 "**************************************\n",ClassName());
1301 printf("\n%s: Version 2 of FRAME initialised, symmetric FRAME\n\n",ClassName());
1302 printf("%s: **************************************"
1303 " FRAME "
1304 "**************************************\n",ClassName());
1305 }
55bdc695 1306//
1307// The reference volume id
1308 fRefVolumeId = gMC->VolId("BREF");
7e5caa00 1309}
1310
6304e7d2 1311Int_t AliFRAMEv2::IsVersion() const
1312{
eeacf08b 1313 // Returns the version of the FRAME (1 if no holes, 0 otherwise)
6304e7d2 1314 Int_t version = 0;
1315 if (fHoles == 0) version = 1;
1316 return version;
1317}
7e5caa00 1318
55bdc695 1319void AliFRAMEv2::StepManager()
1320{
1321//
1322// Stepmanager of AliFRAMEv2.cxx
1323// Used for recording of reference tracks entering the spaceframe mother volume
1324//
1325 Int_t copy, id;
1326
1327 //
1328 // Only charged tracks
1329 if( !(gMC->TrackCharge()) ) return;
1330 //
1331 // Only tracks entering mother volume
1332 //
1333
1334 id=gMC->CurrentVolID(copy);
1335
1336 if (id != fRefVolumeId) return;
1337 if(!gMC->IsTrackEntering()) return;
1338 //
1339 // Add the reference track
1340 //
5d12ce38 1341 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
55bdc695 1342}
7e5caa00 1343
55bdc695 1344
7e5caa00 1345
1346
1347
1348