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