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