New line fitter class from Annalisa. Code in development.
[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"
e6add757 34#include "AliTrackReference.h"
7e5caa00 35
36ClassImp(AliFRAMEv2)
6772b8d8 37
7e5caa00 38
39//_____________________________________________________________________________
6772b8d8 40AliFRAMEv2::AliFRAMEv2():
41 fHoles(0)
7e5caa00 42{
43// Constructor
7e5caa00 44}
45
46//_____________________________________________________________________________
47AliFRAMEv2::AliFRAMEv2(const char *name, const char *title)
6772b8d8 48 : AliFRAME(name,title),
49 fHoles(0)
7e5caa00 50{
51// Constructor
7e5caa00 52}
53
7e5caa00 54//___________________________________________
55void AliFRAMEv2::CreateGeometry()
56{
57//Begin_Html
58/*
59<img src="picts/frame.gif">
60*/
61//End_Html
62
63
64//Begin_Html
65/*
66<img src="picts/tree_frame.gif">
67*/
68//End_Html
69
4a8eca94 70 Int_t idrotm[2299];
7e5caa00 71 Int_t *idtmed = fIdtmed->GetArray()-1999;
72//
73// The Space frame
74//
75//
e16311cb 76 Float_t pbox[3], ptrap[11], ptrd1[4], ppgon[10];
7e5caa00 77
78 Float_t dx, dy, dz;
79 Int_t i, j, jmod;
d84d0b8c 80 jmod = 0;
7e5caa00 81//
82// Constants
83 const Float_t kEps = 0.01;
84 const Int_t kAir = idtmed[2004];
85 const Int_t kSteel = idtmed[2064];
86
87 const Float_t krad2deg = 180./TMath::Pi();
88 const Float_t kdeg2rad = 1./krad2deg;
89
4c057bc8 90 Float_t iFrH = 114.40;
6904b1c6 91 Float_t ringH = 6.00;
4c057bc8 92 Float_t ringW = 10.00;
6904b1c6 93 Float_t longH = 6.00;
94 Float_t longW = 4.00;
4c057bc8 95 Float_t dwl = 3.14;
96 Float_t dwh = 0.96;
7e5caa00 97
02e42643 98//
4a8eca94 99 Float_t dymodU[3] = {70.0, 224.0, 341.};
02e42643 100// new ?
4a8eca94 101 Float_t dymodL[3] = {54.0, 178.5, 341.};
af3fbbe1 102
7e5caa00 103//
104// Frame mother volume
105//
b35d7d26 106// ptube[0] = 280.;
107// ptube[1] = 430.;
108// ptube[2] = 376.;
109 ppgon[0] = 0.;
110 ppgon[1] = 360.;
111 ppgon[2] = 18.;
112
113 ppgon[3] = 2.;
b35d7d26 114 ppgon[4] = -376.;
115 ppgon[5] = 280.;
6904b1c6 116 ppgon[6] = 415.7;
b35d7d26 117
118 ppgon[7] = -ppgon[4];
119 ppgon[8] = ppgon[5];
120 ppgon[9] = ppgon[6];
121
122 gMC->Gsvolu("B077", "PGON", kAir, ppgon, 10);
7e5caa00 123 gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
124//
55bdc695 125// Reference plane for TRD
126//
127 ppgon[6] = ppgon[5] + 0.1;
128 ppgon[9] = ppgon[6];
129 gMC->Gsvolu("BREF", "PGON", kAir, ppgon, 10);
130 gMC->Gspos("BREF", 1, "B077", 0., 0., 0., 0, "ONLY");
bb92d81d 131 gGeoManager->GetVolume("BREF")->SetVisibility(kFALSE);
55bdc695 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.;
6904b1c6 150// ppgon[6] = 420.7122;
151 ppgon[6] = 415.6;
152
7e5caa00 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);
25918453 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);
4a8eca94 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);
25918453 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);
4a8eca94 401
25918453 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;
e2dab6e6 477 ptrd1[3] = 57.7;
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];
7e5caa00 483
d84d0b8c 484 for (i = 0; i < 18; i++) {
485 // Create volume i
8ce41745 486 char name[16];
9398db43 487 Int_t mod = i + 13;
488 if (mod > 17) mod -= 18;
489 sprintf(name, "BSEGMO%d", mod);
d84d0b8c 490 gMC->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
bb92d81d 491 gGeoManager->GetVolume(name)->SetVisibility(kFALSE);
3c976b4c 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);
bb92d81d 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
6904b1c6 541 pbox[1] = pbox[1] - 0.5;
542 pbox[2] = pbox[2] - 0.5;
7e5caa00 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);
25918453 631 AliMatrix(idrotm[2074], 100.0, 180.0, 90.0, 90.0, 10.0, 180.0);
4a8eca94 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//
25918453 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//
653 AliMatrix(idrotm[2090], 90.0, 0.0, 0.0, 0., 90.0, 90.0);
654 AliMatrix(idrotm[2091], 0.0, 0.0, 90.0, 90., 90.0, 0.0);
7e5caa00 655//
656// web frame diagonal (outer)
657//
658 h = 106.2;
659 d = 2.*dwl;
4a8eca94 660 dz = dymodL[2]-dymodU[1]-dwl;
7e5caa00 661 dq = h*h+dz*dz;
662
663 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
664
665
666 theta = krad2deg * TMath::ACos(x);
667
668 ptrap[0] = dz/2.;
669 ptrap[1] = theta;
670 ptrap[2] = 0.;
671 ptrap[3] = dwh;
672 ptrap[4] = dwl/x;
673 ptrap[5] = ptrap[4];
674 ptrap[6] = 0;
675 ptrap[7] = ptrap[3];
676 ptrap[8] = ptrap[4];
677 ptrap[9] = ptrap[4];
678 ptrap[10] = 0;
679 gMC->Gsvolu("B065", "TRAP", kSteel, ptrap, 11);
680 ptrap[3] = dwh - 0.2;
681 ptrap[4] = (dwl-0.4)/x;
682 ptrap[5] = ptrap[4];
683 ptrap[7] = ptrap[3];
684 ptrap[8] = ptrap[4];
685 ptrap[9] = ptrap[4];
686 gMC->Gsvolu("B066", "TRAP", kAir, ptrap, 11);
687 gMC->Gspos("B066", 1, "B065", 0.0, -0.2, 0., 0, "ONLY");
688
689//
690// web frame diagonal (inner)
691//
4a8eca94 692 dz = dymodL[1]-dymodU[0];
7e5caa00 693 dq = h*h+dz*dz;
4a8eca94 694 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
7e5caa00 695
696
697 theta = krad2deg * TMath::ACos(x);
698
4a8eca94 699 ptrap[0] = (dymodL[1]-dymodU[0])/2.;
7e5caa00 700 ptrap[1] = theta;
701 ptrap[2] = 0.;
702 ptrap[3] = dwh;
703 ptrap[4] = dwl/x;
704 ptrap[5] = ptrap[4];
705 ptrap[6] = 0;
706 ptrap[7] = ptrap[3];
707 ptrap[8] = ptrap[4];
708 ptrap[9] = ptrap[4];
709 ptrap[10] = 0;
710 gMC->Gsvolu("B067", "TRAP", kSteel, ptrap, 11);
711 ptrap[3] = dwh-0.2;
712 ptrap[4] = (dwl-0.4)/x;
713 ptrap[5] = ptrap[4];
714 ptrap[7] = ptrap[3];
715 ptrap[8] = ptrap[4];
716 ptrap[9] = ptrap[4];
717 gMC->Gsvolu("B068", "TRAP", kAir, ptrap, 11);
718 gMC->Gspos("B068", 1, "B067", 0.0, -0.2, 0., 0, "ONLY");
719
720
721 dz = -iFrH/2.+ringH/2.+kEps;
722
bb92d81d 723 for (jmod = 0; jmod< 18; jmod++)
7e5caa00 724 {
725// ring bars
bb92d81d 726 for (i = 0; i < 3; i++) {
727 gMC->Gspos("B072", 6*jmod+i+1, module[jmod], 0, dymodL[i], dz, 0, "ONLY");
728 gMC->Gspos("B072", 6*jmod+i+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");
7e5caa00 729
730// 0-deg web
bb92d81d 731 if (i == 2) {
732 gMC->Gspos("B263", 4*jmod+1, module[jmod], 60.0732, dymodU[2], 4.6669, idrotm[2072], "ONLY");
733 gMC->Gspos("B263", 4*jmod+2, module[jmod], 60.0732, -dymodU[2], 4.6669, idrotm[2071], "ONLY");
734 gMC->Gspos("B263", 4*jmod+3, module[jmod], -60.0732, dymodU[2], 4.6669, idrotm[2074], "ONLY");
735 gMC->Gspos("B263", 4*jmod+4, module[jmod], -60.0732, -dymodU[2], 4.6669, idrotm[2073], "ONLY");
4a8eca94 736 }
7e5caa00 737 }
738 }
739
740// outer diagonal web
741
4a8eca94 742 dy = (dymodU[0]+dymodL[0])/2.;
d84d0b8c 743 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 744 gMC->Gspos("B063", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2086], "ONLY");
745 gMC->Gspos("B063", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2087], "ONLY");
746 gMC->Gspos("B063", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2088], "ONLY");
747 gMC->Gspos("B063", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2089], "ONLY");
748 }
749
750 dy = (dymodU[1]+dymodL[1])/2.;
d84d0b8c 751 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 752 gMC->Gspos("B163", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2080], "ONLY");
753 gMC->Gspos("B163", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2079], "ONLY");
754 gMC->Gspos("B163", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2082], "ONLY");
755 gMC->Gspos("B163", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2081], "ONLY");
756 }
757
758
759 dy = (dymodL[2]+dymodU[1])/2.-dwl/2.;
d84d0b8c 760 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 761 gMC->Gspos("B065", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2076], "ONLY");
762 gMC->Gspos("B065", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2075], "ONLY");
763 gMC->Gspos("B065", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2078], "ONLY");
764 gMC->Gspos("B065", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2077], "ONLY");
7e5caa00 765 }
766
767
4a8eca94 768 dy = (dymodL[1]+dymodU[0])/2.;
7e5caa00 769
d84d0b8c 770 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 771 gMC->Gspos("B067", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2076], "ONLY");
772 gMC->Gspos("B067", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2075], "ONLY");
773 gMC->Gspos("B067", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2078], "ONLY");
774 gMC->Gspos("B067", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2077], "ONLY");
7e5caa00 775 }
776
777// longitudinal bars (TPC rails attached)
778// new specs:
779// h x w x s = 100 x 75 x 6
780// current:
781// Attention: 2 "U" shaped half rods per cell
782//
783// not yet used
784//
785 ptrap[0] = 2.50;
786 ptrap[1] = 10.00;
787 ptrap[2] = 0.00;
788 ptrap[3] = 350.00;
789 ptrap[4] = 3.75;
790 ptrap[5] = ptrap[4];
791 ptrap[6] = 0;
792 ptrap[7] = ptrap[3];
793 ptrap[8] = ptrap[4];
794 ptrap[9] = ptrap[4];
795 ptrap[10] = 0;
f935f49e 796// gMC->Gsvolu("B059", "TRAP", kSteel, ptrap, 11);
7e5caa00 797 ptrap[0] = 2.2;
798 ptrap[4] = 2.15;
799 ptrap[5] = ptrap[4];
800 ptrap[7] = ptrap[3];
801 ptrap[8] = ptrap[4];
802 ptrap[9] = ptrap[4];
f935f49e 803 //gMC->Gsvolu("B062", "TRAP", kAir, ptrap, 11);
804 //gMC->Gspos("B062", 1, "B059", 0.0, 0., 0., 0, "ONLY");
805
7e5caa00 806//
807// longitudinal bars (no TPC rails attached)
808// new specs: h x w x s = 60 x 60 x 3
809// (was: 75 x 100 x 5?)
810//
811//
812//
813 ptrap[0] = longW/4.;
814 ptrap[4] = longH/2.;
815 ptrap[5] = ptrap[4];
816 ptrap[7] = ptrap[3];
817 ptrap[8] = ptrap[4];
818 ptrap[9] = ptrap[4];
819
820 gMC->Gsvolu("BA59", "TRAP", kSteel, ptrap, 11);
821 ptrap[0] = longW/4.-0.15;
822 ptrap[4] = longH/2.-0.30;
823 ptrap[5] = ptrap[4];
824 ptrap[7] = ptrap[3];
825 ptrap[8] = ptrap[4];
826 ptrap[9] = ptrap[4];
827 gMC->Gsvolu("BA62", "TRAP", kAir, ptrap, 11);
828 gMC->Gspos("BA62", 1, "BA59", 0.0, 0.0, -0.15, 0, "ONLY");
829
830 dz = -iFrH/2.+ringH+longH/2.;
831
d84d0b8c 832 for (jmod = 0; jmod < 18; jmod++) {
4a8eca94 833 gMC->Gspos("BA59", 2*jmod+1, module[jmod], 49.6476, 0.0, dz, idrotm[2084], "ONLY");
834 gMC->Gspos("BA59", 2*jmod+2, module[jmod], -49.6476, 0.0, dz, idrotm[2083], "ONLY");
7e5caa00 835 }
25918453 836
837
7e5caa00 838//
25918453 839// Thermal shield
7e5caa00 840//
e6add757 841
23cb15ef 842 Float_t dyM = 99.0 - 4.;
25918453 843 MakeHeatScreen("M", dyM, idrotm[2090], idrotm[2091]);
6904b1c6 844 Float_t dyAM = 119.5 - 5.;
25918453 845 MakeHeatScreen("AM", dyAM, idrotm[2090], idrotm[2091]);
23cb15ef 846 Float_t dyA = 128.0 - 4.;
25918453 847 MakeHeatScreen("A" , dyA, idrotm[2090], idrotm[2091]);
e6add757 848
25918453 849//
850//
851//
23cb15ef 852 dz = -57.2 + 0.6;
25918453 853 for (i = 0; i < 18; i++) {
854
855 char nameMo[16];
856 sprintf(nameMo, "BSEGMO%d",i);
857 // M
858 gMC->Gspos("BTSH_M" , i+1 , nameMo, 0., 0., dz, 0, "ONLY");
859 // AM, CM
23cb15ef 860 dy = dymodL[0] + dyAM / 2. + 4.5;
25918453 861 gMC->Gspos("BTSH_AM", i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
862 gMC->Gspos("BTSH_AM", i+19, nameMo, 0., -dy, dz, 0, "ONLY");
863 // A, C
23cb15ef 864 dy = dymodL[1] + dyA / 2. + 6.0;
25918453 865 gMC->Gspos("BTSH_A" , i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
866 gMC->Gspos("BTSH_A" , i+19, nameMo, 0., -dy, dz, 0, "ONLY");
867}
868
e6add757 869
774c288e 870 //
871 // TRD mother volumes
872 //
d84d0b8c 873
a621ccf6 874 ptrd1[0] = 47.4405; // CBL 28/6/2006
875 ptrd1[1] = 61.1765; // CBL
876 ptrd1[2] = 375.5; // CBL
877 ptrd1[3] = 38.95; // CBL
878
879
d84d0b8c 880
881 for (i = 0; i < 18; i++) {
8ce41745 882 char nameCh[16];
d84d0b8c 883 sprintf(nameCh, "BTRD%d",i);
8ce41745 884 char nameMo[16];
d84d0b8c 885 sprintf(nameMo, "BSEGMO%d",i);
886 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
bb92d81d 887 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
a621ccf6 888 gMC->Gspos(nameCh, 1, nameMo, 0., 0., -11.75, 0, "ONLY"); // CBL 28/6/2006
d84d0b8c 889 }
4c057bc8 890
774c288e 891//
892// TOF mother volumes
893//
e2dab6e6 894 ptrd1[0] = 62.2500;
895 ptrd1[1] = 67.3631;
896 ptrd1[2] = 373.6;
774c288e 897 ptrd1[3] = 14.5;
d84d0b8c 898 for (i = 0; i < 18; i++) {
8ce41745 899 char nameCh[16];
d84d0b8c 900 sprintf(nameCh, "BTOF%d",i);
8ce41745 901 char nameMo[16];
d84d0b8c 902 sprintf(nameMo, "BSEGMO%d",i);
903 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
bb92d81d 904 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
d84d0b8c 905 gMC->Gspos(nameCh, 1, nameMo, 0., 0., 42.69, 0, "ONLY");
906 }
d3507e34 907
b35d7d26 908//
909// Geometry of Rails starts here
910//
911//
912//
913// Rails for space-frame
914//
915 Float_t rbox[3];
916
917 rbox[0] = 25.00;
918 rbox[1] = 27.50;
919 rbox[2] = 600.00;
920 gMC->Gsvolu("BRS1", "BOX", kAir, rbox, 3);
921
922 rbox[0] = 25.00;
923 rbox[1] = 3.75;
924 gMC->Gsvolu("BRS2", "BOX", kSteel, rbox, 3);
925
926 rbox[0] = 3.00;
927 rbox[1] = 20.00;
928 gMC->Gsvolu("BRS3", "BOX", kSteel, rbox, 3);
929
930 gMC->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
931 gMC->Gspos("BRS2", 2, "BRS1", 0., 27.5-3.75, 0., 0, "ONLY");
932 gMC->Gspos("BRS3", 1, "BRS1", 0., 0., 0., 0, "ONLY");
85227d20 933 gMC->Gspos("BRS1", 1, "ALIC", -430.-3., -190., 0., 0, "ONLY");
934 gMC->Gspos("BRS1", 2, "ALIC", 430.+3., -190., 0., 0, "ONLY");
b35d7d26 935
936 rbox[0] = 3.0;
85227d20 937 rbox[1] = 145./4.;
b35d7d26 938 rbox[2] = 25.0;
939 gMC->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
940
85227d20 941 gMC->Gspos("BRS4", 1, "ALIC", 430.+3., -190.+55./2.+rbox[1], 224., 0, "ONLY");
942 gMC->Gspos("BRS4", 2, "ALIC", 430.+3., -190.+55./2.+rbox[1], -224., 0, "ONLY");
943// gMC->Gspos("BRS4", 3, "ALIC", -430.+3, -180.+55./2.+rbox[1], 224., 0, "ONLY");
944// gMC->Gspos("BRS4", 4, "ALIC", -430.+3, -180.+55./2.+rbox[1], -224., 0, "ONLY");
b35d7d26 945
f2744db7 946
947
948 //
949 // The Backframe
950 //
951 // Inner radius
952 Float_t kBFMRin = 270.0;
953 // Outer Radius
954 Float_t kBFMRou = 417.5;
955 // Width
956 Float_t kBFMdz = 118.0;
957 //
958 //
959 // Rings
960 Float_t kBFRdr = 7.5;
961 Float_t kBFRdz = 8.0;
962 //
963 //
964 // Bars and Spokes
965 //
966 Float_t kBFBd = 8.0;
967 Float_t kBFBdd = 0.6;
968
969
970 // The Mother volume
971 Float_t tpar[3];
972 tpar[0] = kBFMRin;
973 tpar[1] = kBFMRou;
974 tpar[2] = kBFMdz / 2.;
975 gMC->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);
976
977 // Rings
978 //
979 // Inner Ring
980 tpar[0] = kBFMRin;
981 tpar[1] = tpar[0] + kBFRdr;
982 tpar[2] = kBFRdz / 2.;
983
984 gMC->Gsvolu("BFIR", "TUBE", kSteel, tpar, 3);
985
986 tpar[0] = tpar[0] + kBFBdd;
987 tpar[1] = tpar[1] - kBFBdd;
988 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
989
990 gMC->Gsvolu("BFII", "TUBE", kAir, tpar, 3);
991 gMC->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");
992
f2744db7 993 //
994 // Outer RING
995 tpar[0] = kBFMRou - kBFRdr;
996 tpar[1] = kBFMRou;
997 tpar[2] = kBFRdz / 2.;
998
999 gMC->Gsvolu("BFOR", "TUBE", kSteel, tpar, 3);
1000
1001 tpar[0] = tpar[0] + kBFBdd;
1002 tpar[1] = tpar[1] - kBFBdd;
1003 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
1004
1005 gMC->Gsvolu("BFOO", "TUBE", kAir, tpar, 3);
1006 gMC->Gspos("BFOO", 1, "BFOR", 0., 0., 0., 0, "ONLY");
1007
1008
1009 dz = kBFMdz/2. - kBFRdz / 2.;
1010 gMC->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1011 gMC->Gspos("BFIR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1012 gMC->Gspos("BFOR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1013 gMC->Gspos("BFOR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1014
1015 //
1016 // Longitudinal Bars
1017 //
1018 Float_t bpar[3];
1019
1020 bpar[0] = kBFBd/2;
1021 bpar[1] = bpar[0];
1022 bpar[2] = kBFMdz/2. - kBFBd;
1023 gMC->Gsvolu("BFLB", "BOX ", kSteel, bpar, 3);
1024
1025 bpar[0] = bpar[0] - kBFBdd;
1026 bpar[1] = bpar[1] - kBFBdd;
1027 bpar[2] = bpar[2] - kBFBdd;
1028 gMC->Gsvolu("BFLL", "BOX ", kAir, bpar, 3);
1029 gMC->Gspos("BFLL", 1, "BFLB", 0., 0., 0., 0, "ONLY");
1030
1031 for (i = 0; i < 18; i++)
1032 {
1033 Float_t ro = kBFMRou - kBFBd / 2.;
1034 Float_t ri = kBFMRin + kBFBd / 2.;
1035
1036 Float_t phi = Float_t(i) * 20.;
1037
1038 Float_t x = ri * TMath::Cos(phi * kDegrad);
1039 Float_t y = ri * TMath::Sin(phi * kDegrad);
1040 AliMatrix(idrotm[2090+i], 90.0, phi, 90.0, phi + 270., 0., 0.);
1041
1042 gMC->Gspos("BFLB", i + 1, "BFMO", x, y, 0., idrotm[2090 + i], "ONLY");
1043
1044 x = ro * TMath::Cos(phi * kDegrad);
1045 y = ro * TMath::Sin(phi * kDegrad);
1046
1047 gMC->Gspos("BFLB", i + 19, "BFMO", x, y, 0., idrotm[2090 +i], "ONLY");
1048 }
1049
1050 //
1051 // Radial Bars
1052 //
1053 bpar[0] = (kBFMRou - kBFMRin - 2. * kBFRdr) / 2.;
1054 bpar[1] = kBFBd/2;
1055 bpar[2] = bpar[1];
1056 //
1057 // Avoid overlap with circle
1058 Float_t rr = kBFMRou - kBFRdr;
1059 Float_t delta = rr - TMath::Sqrt(rr * rr - kBFBd * kBFBd / 4.) + 0.01;
1060 bpar[0] -= delta /2.;
1061
1062
1063 gMC->Gsvolu("BFRB", "BOX ", kSteel, bpar, 3);
1064
1065 bpar[0] = bpar[0] - kBFBdd;
1066 bpar[1] = bpar[1] - kBFBdd;
1067 bpar[2] = bpar[2] - kBFBdd;
1068 gMC->Gsvolu("BFRR", "BOX ", kAir, bpar, 3);
1069 gMC->Gspos("BFRR", 1, "BFRB", 0., 0., 0., 0, "ONLY");
1070
1071 Int_t iphi[10] = {0, 1, 3, 6, 8, 9, 10, 12, 15, 17};
1072
1073 for (i = 0; i < 10; i++)
1074 {
1075
1076 Float_t r = (kBFMRin + kBFMRou)/2.;
1077 Float_t phi = Float_t(iphi[i]) * 20.;
1078
1079 Float_t x = r * TMath::Cos(phi * kDegrad);
1080 Float_t y = r * TMath::Sin(phi * kDegrad);
1081
1082 gMC->Gspos("BFRB", i + 1, "BFMO", x, y, dz, idrotm[2034 + iphi[i]], "ONLY");
1083 gMC->Gspos("BFRB", i + 11, "BFMO", x, y, -dz, idrotm[2034 + iphi[i]], "ONLY");
1084
1085 }
1086
9cde95f3 1087 gMC->Gspos("BFMO", i + 19, "ALIC", 0, 0, - 376. - kBFMdz/2. - 0.5 , 0, "ONLY");
f2744db7 1088
1089
1090
b35d7d26 1091//
f2744db7 1092//
1093// The Baby Frame
1094//
1095//
1096 //
1097 // Inner radius
1098 Float_t kBBMRin = 278.0;
1099 // Outer Radius
1100 Float_t kBBMRou = 410.5;
1101 // Width
1102 Float_t kBBMdz = 223.0;
1103 Float_t kBBBdz = 6.0;
1104 Float_t kBBBdd = 0.6;
1105
b35d7d26 1106
f2744db7 1107 // The Mother volume
1108
1109 ppgon[0] = 0.;
1110 ppgon[1] = 360.;
1111 ppgon[2] = 18.;
b35d7d26 1112
f2744db7 1113 ppgon[3] = 2.;
1114 ppgon[4] = -kBBMdz / 2. ;
1115 ppgon[5] = kBBMRin;
1116 ppgon[6] = kBBMRou;
1117
1118 ppgon[7] = -ppgon[4];
1119 ppgon[8] = ppgon[5];
1120 ppgon[9] = ppgon[6];
1121
1122 gMC->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
1123 gMC->Gsdvn("BBCE", "BBMO", 18, 2);
1124
1125 // Longitudinal bars
1126 bpar[0] = kBBBdz/2.;
1127 bpar[1] = bpar[0];
1128 bpar[2] = kBBMdz/2. - kBBBdz;
1129 gMC->Gsvolu("BBLB", "BOX ", kSteel, bpar, 3);
1130 bpar[0] -= kBBBdd;
1131 bpar[1] -= kBBBdd;
1132 bpar[2] -= kBBBdd;
1133 gMC->Gsvolu("BBLL", "BOX ", kAir, bpar, 3);
1134 gMC->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY");
1135
65cb363f 1136 dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1137 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1138 gMC->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1139
65cb363f 1140 dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1141 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1142
1143 gMC->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1144
1145 //
1146 // Radial Bars
1147 //
1148 bpar[0] = (kBBMRou - kBBMRin) / 2. - kBBBdz;
1149 bpar[1] = kBBBdz/2;
1150 bpar[2] = bpar[1];
1151
1152 gMC->Gsvolu("BBRB", "BOX ", kSteel, bpar, 3);
1153 bpar[0] -= kBBBdd;
1154 bpar[1] -= kBBBdd;
1155 bpar[2] -= kBBBdd;
1156 gMC->Gsvolu("BBRR", "BOX ", kAir, bpar, 3);
1157 gMC->Gspos("BBRR", 1, "BBRB", 0., 0., 0., 0, "ONLY");
1158
1159
1160 dx = (kBBMRou + kBBMRin) / 2.;
1161 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1162 dz = kBBMdz/2. - kBBBdz / 2.;
1163
1164 gMC->Gspos("BBRB", 1, "BBCE", dx, dy, dz, idrotm[2052], "ONLY");
1165 gMC->Gspos("BBRB", 2, "BBCE", dx, dy, - dz, idrotm[2052], "ONLY");
1166 gMC->Gspos("BBRB", 3, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1167
1168 //
1169 // Circular bars
1170 //
1171 // Inner
1172
1173 bpar[1] = kBBMRin * TMath::Sin(10. * kDegrad);
1174 bpar[0] = kBBBdz/2;
1175 bpar[2] = bpar[0];
1176 gMC->Gsvolu("BBC1", "BOX ", kSteel, bpar, 3);
1177 bpar[0] -= kBBBdd;
1178 bpar[1] -= kBBBdd;
1179 bpar[2] -= kBBBdd;
1180 gMC->Gsvolu("BBC2", "BOX ", kAir, bpar, 3);
1181 gMC->Gspos("BBC2", 1, "BBC1", 0., 0., 0., 0, "ONLY");
1182 dx = kBBMRin + kBBBdz/2;
1183 dy = 0.;
1184 gMC->Gspos("BBC1", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1185 gMC->Gspos("BBC1", 2, "BBCE", dx, dy, -dz, 0, "ONLY");
1186 //
1187 // Outer
1188 bpar[1] = (kBBMRou - kBBBdz) * TMath::Sin(10. * kDegrad);
1189 bpar[0] = kBBBdz/2;
1190 bpar[2] = bpar[0];
1191 gMC->Gsvolu("BBC3", "BOX ", kSteel, bpar, 3);
1192 bpar[0] -= kBBBdd;
1193 bpar[1] -= kBBBdd;
1194 bpar[2] -= kBBBdd;
1195 gMC->Gsvolu("BBC4", "BOX ", kAir, bpar, 3);
1196 gMC->Gspos("BBC4", 1, "BBC3", 0., 0., 0., 0, "ONLY");
1197 dx = kBBMRou - kBBBdz/2;
1198 dy = 0.;
1199 gMC->Gspos("BBC3", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1200 gMC->Gspos("BBC3", 2, "BBCE", dx, dy, - dz, 0, "ONLY");
1201 //
1202 // Diagonal Bars
1203 //
1204 h = (kBBMRou - kBBMRin - 2. * kBBBdz);;
1205 d = kBBBdz;
1206 dz = kBBMdz/2. - 1.6 * kBBBdz;
1207 dq = h*h+dz*dz;
1208
1209 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
1210
1211
1212 theta = kRaddeg * TMath::ACos(x);
1213
1214 ptrap[0] = dz/2.;
1215 ptrap[1] = theta;
1216 ptrap[2] = 0.;
1217 ptrap[3] = d/2;
1218 ptrap[4] = d/x/2;
1219 ptrap[5] = ptrap[4];
1220 ptrap[6] = 0;
1221 ptrap[7] = ptrap[3];
1222 ptrap[8] = ptrap[4];
1223 ptrap[9] = ptrap[4];
1224 ptrap[10] = 0;
1225 gMC->Gsvolu("BBD1", "TRAP", kSteel, ptrap, 11);
1226 ptrap[3] = d/2-kBBBdd;
1227 ptrap[4] = (d/2-kBBBdd)/x;
1228 ptrap[5] = ptrap[4];
1229 ptrap[7] = ptrap[3];
1230 ptrap[8] = ptrap[4];
1231 ptrap[9] = ptrap[4];
1232 gMC->Gsvolu("BBD3", "TRAP", kAir, ptrap, 11);
1233 gMC->Gspos("BBD3", 1, "BBD1", 0.0, 0.0, 0., 0, "ONLY");
1234 dx = (kBBMRou + kBBMRin) / 2.;
1235 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1236 gMC->Gspos("BBD1", 1, "BBCE", dx, dy, dz/2. + kBBBdz/2., idrotm[2052], "ONLY");
1237
1238
1239 ptrap[0] = dz/2.;
1240 ptrap[1] = -theta;
1241 ptrap[2] = 0.;
1242 ptrap[3] = d/2;
1243 ptrap[4] = d/2/x;
1244 ptrap[5] = ptrap[4];
1245 ptrap[6] = 0;
1246 ptrap[7] = ptrap[3];
1247 ptrap[8] = ptrap[4];
1248 ptrap[9] = ptrap[4];
1249 ptrap[10] = 0;
1250 gMC->Gsvolu("BBD2", "TRAP", kSteel, ptrap, 11);
1251 ptrap[3] = d/2-kBBBdd;
1252 ptrap[4] = (d/2-kBBBdd)/x;
1253 ptrap[5] = ptrap[4];
1254 ptrap[7] = ptrap[3];
1255 ptrap[8] = ptrap[4];
1256 ptrap[9] = ptrap[4];
1257 gMC->Gsvolu("BBD4", "TRAP", kAir, ptrap, 11);
1258 gMC->Gspos("BBD4", 1, "BBD2", 0.0, 0.0, 0., 0, "ONLY");
1259 dx = (kBBMRou + kBBMRin) / 2.;
1260 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1261 gMC->Gspos("BBD2", 1, "BBCE", dx, dy, -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");
1262
1263
9cde95f3 1264 gMC->Gspos("BBMO", 1, "ALIC", 0., 0., + 376. + kBBMdz / 2. + 0.5, 0, "ONLY");
f2744db7 1265
1266
7e5caa00 1267}
f2744db7 1268
7e5caa00 1269
1270
1271//___________________________________________
1272void AliFRAMEv2::CreateMaterials()
1273{
eeacf08b 1274 // Creates the materials
7e5caa00 1275 Float_t epsil, stemax, tmaxfd, deemax, stmin;
1276
1277 epsil = 1.e-4; // Tracking precision,
25918453 1278 stemax = -0.01; // Maximum displacement for multiple scat
1279 tmaxfd = -20.; // Maximum angle due to field deflection
1280 deemax = -.3; // Maximum fractional energy loss, DLS
7e5caa00 1281 stmin = -.8;
1282 Int_t isxfld = gAlice->Field()->Integ();
1283 Float_t sxmgmx = gAlice->Field()->Max();
002b3738 1284
1285
7e5caa00 1286 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1287 Float_t zsteel[4] = { 26.,24.,28.,14. };
1288 Float_t wsteel[4] = { .715,.18,.1,.005 };
6a894888 1289
1290 //Air
1291
1292 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1293 Float_t zAir[4]={6.,7.,8.,18.};
1294 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1295 Float_t dAir = 1.20479E-3;
7e5caa00 1296
1297 AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
002b3738 1298 AliMixture(5, "AIR$ ", aAir, zAir, dAir,4, wAir);
25918453 1299 AliMaterial(9, "ALU ", 26.98, 13., 2.7, 8.9, 37.2);
002b3738 1300
a260d998 1301 AliMedium(65, "Stainless Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1302 AliMedium( 5, "Air", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
25918453 1303 AliMedium( 9, "Aluminum", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
a260d998 1304
7e5caa00 1305}
1306
1307//_____________________________________________________________________________
1308void AliFRAMEv2::Init()
1309{
1310 //
1311 // Initialise the module after the geometry has been defined
1312 //
4951e003 1313 if(AliLog::GetGlobalDebugLevel()>0) {
0a05c568 1314 printf("%s: **************************************"
1315 " FRAME "
1316 "**************************************\n",ClassName());
1317 printf("\n%s: Version 2 of FRAME initialised, symmetric FRAME\n\n",ClassName());
1318 printf("%s: **************************************"
1319 " FRAME "
1320 "**************************************\n",ClassName());
1321 }
55bdc695 1322//
1323// The reference volume id
1324 fRefVolumeId = gMC->VolId("BREF");
7e5caa00 1325}
1326
6304e7d2 1327Int_t AliFRAMEv2::IsVersion() const
1328{
eeacf08b 1329 // Returns the version of the FRAME (1 if no holes, 0 otherwise)
6304e7d2 1330 Int_t version = 0;
1331 if (fHoles == 0) version = 1;
1332 return version;
1333}
7e5caa00 1334
55bdc695 1335void AliFRAMEv2::StepManager()
1336{
1337//
1338// Stepmanager of AliFRAMEv2.cxx
1339// Used for recording of reference tracks entering the spaceframe mother volume
1340//
1341 Int_t copy, id;
1342
1343 //
1344 // Only charged tracks
1345 if( !(gMC->TrackCharge()) ) return;
1346 //
1347 // Only tracks entering mother volume
1348 //
1349
1350 id=gMC->CurrentVolID(copy);
1351
1352 if (id != fRefVolumeId) return;
1353 if(!gMC->IsTrackEntering()) return;
1354 //
1355 // Add the reference track
1356 //
e6add757 1357 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kFRAME);
55bdc695 1358}
7e5caa00 1359
55bdc695 1360
7e5caa00 1361
25918453 1362void AliFRAMEv2::MakeHeatScreen(char* name, Float_t dyP, Int_t rot1, Int_t rot2)
1363{
1364 // Heat screen panel
1365 //
1366 Int_t *idtmed = fIdtmed->GetArray()-1999;
1367 const Int_t kAir = idtmed[2004];
1368 const Int_t kAlu = idtmed[2008];
1369
1370 Float_t dx, dy;
1371 char mname [128];
1372 char cname [128];
1373 char t1name[128];
1374 char t2name[128];
1375 char t3name[128];
1376 char t4name[128];
1377 char t5name[128];
1378
1379 //
23cb15ef 1380 Float_t dxP = 98.5;
1381 Float_t dzP = 1.05;
25918453 1382 //
1383 // Mother volume
1384 Float_t thshM[3];
1385 thshM[0] = dxP / 2.;
1386 thshM[1] = dyP / 2.;
1387 thshM[2] = dzP / 2.;
1388 sprintf(mname, "BTSH_%s", name);
1389 gMC->Gsvolu(mname, "BOX ", kAir, thshM, 3);
1390 //
1391 // Aluminum sheet
23cb15ef 1392 thshM[2] = 0.025;
25918453 1393 sprintf(cname, "BTSHA_%s", name);
1394 gMC->Gsvolu(cname, "BOX ", kAlu, thshM, 3);
23cb15ef 1395 gMC->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
25918453 1396 //
1397 // Tubes
1398 Float_t thshT[3];
1399 thshT[0] = 0.4;
1400 thshT[1] = 0.5;
23cb15ef 1401 thshT[2] = (dyP / 2. - 6.);
25918453 1402 //
1403 sprintf(t1name, "BTSHT1_%s", name);
1404 gMC->Gsvolu(t1name, "TUBE", kAlu, thshT, 3);
1405 dx = - dxP / 2. + 8.;
23cb15ef 1406 gMC->Gspos(t1name, 1, mname, dx, 0., 0.05, rot1);
1407 gMC->Gspos(t1name, 2, mname, -dx, 0., 0.05, rot1);
25918453 1408 //
1409 sprintf(t2name, "BTSHT2_%s", name);
1410 sprintf(t3name, "BTSHT3_%s", name);
1411 sprintf(t4name, "BTSHT4_%s", name);
1412 sprintf(t5name, "BTSHT5_%s", name);
1413 thshT[2] = (thshM[1] - 12.);
1414 gMC->Gsvolu(t2name, "TUBE", kAlu, thshT, 3);
1415 thshT[2] = 7.9/2.;
1416 gMC->Gsvolu(t3name, "TUBE", kAlu, thshT, 3);
1417 thshT[2] = 23.9/2.;
1418 gMC->Gsvolu(t4name, "TUBE", kAlu, thshT, 3);
1419 thshT[2] = 9.0/2.;
1420 gMC->Gsvolu(t5name, "TUBE", kAlu, thshT, 3);
23cb15ef 1421 gMC->Gspos(t5name, 0, mname, -dx - 4., - (dyP / 2. - 5.5), 0.05, rot2);
25918453 1422
1423 Int_t sig = 1;
1424 Int_t ipo = 1;
1425 for (Int_t i = 0; i < 5; i++) {
1426 sig *= -1;
1427 dx += 8.00;
1428 dy = 4. * sig;
1429 Float_t dy1 = - (thshM[1] - 15.5) * sig;
1430 Float_t dy2 = - (thshM[1] - 7.5) * sig;
1431
23cb15ef 1432 gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.05, rot1);
25918453 1433 dx += 6.9;
23cb15ef 1434 gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.05, rot1);
25918453 1435
23cb15ef 1436 gMC->Gspos(t3name, i+1, mname, dx - 3.45, dy1, 0.05, rot2);
1437 gMC->Gspos(t4name, i+1, mname, dx - 3.45, dy2, 0.05, rot2);
25918453 1438 }
1439}
7e5caa00 1440
1441
1442