C++ version of spaceframe with specs according to Jan Bielski Feb. 2001
[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
16/*
17$Log$
18*/
19
20////////////////////////////////////////////////
21// space frame class /
22///////////////////////////////////////////////
23
24#include "AliFRAMEv2.h"
25#include "AliMagF.h"
26#include "AliRun.h"
27#include "AliMC.h"
28#include "TSystem.h"
29
30ClassImp(AliFRAMEv2)
31
32//_____________________________________________________________________________
33AliFRAMEv2::AliFRAMEv2()
34{
35// Constructor
36 SetHoles(0);
37}
38
39//_____________________________________________________________________________
40AliFRAMEv2::AliFRAMEv2(const char *name, const char *title)
41 : AliFRAME(name,title)
42{
43// Constructor
44 SetHoles(0);
45}
46
47
48//___________________________________________
49void AliFRAMEv2::CreateGeometry()
50{
51//Begin_Html
52/*
53<img src="picts/frame.gif">
54*/
55//End_Html
56
57
58//Begin_Html
59/*
60<img src="picts/tree_frame.gif">
61*/
62//End_Html
63
64 Int_t idrotm[2199];
65 Int_t *idtmed = fIdtmed->GetArray()-1999;
66//
67// The Space frame
68//
69//
70 Float_t pbox[3], ptrap[11], ptrd1[4], ptube[3], ppgon[10];
71
72 Float_t dx, dy, dz;
73 Int_t i, j, jmod;
74//
75// Constants
76 const Float_t kEps = 0.01;
77 const Int_t kAir = idtmed[2004];
78 const Int_t kSteel = idtmed[2064];
79
80 const Float_t krad2deg = 180./TMath::Pi();
81 const Float_t kdeg2rad = 1./krad2deg;
82
83 Float_t iFrH = 114.4;
84 Float_t ringH = 4.;
85 Float_t ringW = 10.;
86 Float_t longH = 5.39;
87 Float_t longW = 6.;
88 Float_t dwl = 3.14;
89 Float_t dwh = 0.96;
90
91 Float_t dymod[3] = {70., 224., 341.};
92//
93// Frame mother volume
94//
95 ptube[0] = 280.;
96// ptube[1] = 428.2;
97 ptube[1] = 430.;
98 ptube[2] = 376.;
99 gMC->Gsvolu("B077", "TUBE", kAir, ptube, 3);
100 gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
101//
102// The outer Frame
103//
104
105 Float_t dol = 8.75;
106 Float_t doh = 5.;
107 Float_t ds = 0.35;
108//
109// Mother volume
110//
111 ppgon[0] = 0.;
112 ppgon[1] = 360.;
113 ppgon[2] = 18.;
114
115 ppgon[3] = 2.;
116
117 ppgon[4] = -350.;
118 ppgon[5] = 399.;
119 ppgon[6] = 420.7122;
120
121 ppgon[7] = -ppgon[4];
122 ppgon[8] = ppgon[5];
123 ppgon[9] = ppgon[6];
124 gMC->Gsvolu("B076", "PGON", kAir, ppgon, 10);
125 gMC->Gspos("B076", 1, "B077", 0., 0., 0., 0, "ONLY");
126//
127// Rings
128//
129 dz = 2.*410.2*TMath::Sin(10.*kdeg2rad)-2.*dol*TMath::Cos(10.*kdeg2rad)-
130 2.*doh*TMath::Tan(10.*kdeg2rad);
131 Float_t l1 = dz/2.;
132 Float_t l2 = dz/2.+2.*doh*TMath::Tan(10.*kdeg2rad);
133
134 ptrd1[0] = l1;
135 ptrd1[1] = l2;
136
137 ptrd1[2] = dol;
138 ptrd1[3] = doh;
139 gMC->Gsvolu("B042", "TRD1", kSteel, ptrd1, 4);
140
141 ptrd1[0] = ptrd1[0]+ds*(l2-l1)/2./doh;
142 ptrd1[1] = ptrd1[1]-ds*(l2-l1)/2./doh;
143 ptrd1[2] = dol-ds;
144 ptrd1[3] = doh-ds;
145 gMC->Gsvolu("B043", "TRD1", kAir, ptrd1, 4);
146 gMC->Gspos("B043", 1, "B042", 0., 0., 0., 0, "ONLY");
147//
148// longitudinal bars
149//
150// 170x200x5
151//
152 pbox[0] = dol;
153 pbox[1] = doh;
154 pbox[2] = 350.;
155 gMC->Gsvolu("B033", "BOX", kSteel, pbox, 3);
156 pbox[0] = dol-ds;
157 pbox[1] = doh-ds;
158 gMC->Gsvolu("B034", "BOX", kAir, pbox, 3);
159 gMC->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
160
161 pbox[0] = 1.0;
162 pbox[1] = 5.0;
163 pbox[2] = 375.5;
164
165
166 gMC->Gsvolu("B080", "BOX", kSteel, pbox, 3);
167 gMC->Gspos("B080", 1, "B077", 281.01, 0., 0., 0, "ONLY");
168 gMC->Gspos("B080", 2, "B077", -281.01, 0., 0., 0, "ONLY");
169
170//
171// Diagonal bars (1)
172//
173 Float_t h, d, dq, x, theta;
174
175 h = (dymod[1]-dymod[0]-2.*dol)*.999;
176 d = 2.*dol;
177 dq = h*h+dz*dz;
178
179 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
180
181
182 theta = krad2deg * TMath::ACos(x);
183
184 ptrap[0] = dz/2.;
185 ptrap[1] = theta;
186 ptrap[2] = 0.;
187 ptrap[3] = doh;
188 ptrap[4] = dol/x;
189 ptrap[5] = ptrap[4];
190 ptrap[6] = 0;
191 ptrap[7] = ptrap[3];
192 ptrap[8] = ptrap[4];
193 ptrap[9] = ptrap[4];
194 ptrap[10] = 0;
195
196 gMC->Gsvolu("B047", "TRAP", kSteel, ptrap, 11);
197 ptrap[3] = doh-ds;
198 ptrap[4] = (dol-ds)/x;
199 ptrap[5] = ptrap[4];
200 ptrap[7] = ptrap[3];
201 ptrap[8] = ptrap[4];
202 ptrap[9] = ptrap[4];
203 gMC->Gsvolu("B048", "TRAP", kAir, ptrap, 11);
204 gMC->Gspos("B048", 1, "B047", 0.0, 0.0, 0., 0, "ONLY");
205
206/*
207 Crosses (inner most)
208 \\ //
209 \\//
210 //\\
211 // \\
212*/
213 h = (2.*dymod[0]-2.*dol)*.999;
214//
215// Mother volume
216//
217 pbox[0] = h/2;
218 pbox[1] = doh;
219 pbox[2] = dz/2.;
220 gMC->Gsvolu("BM49", "BOX ", kAir, pbox, 3);
221
222
223 dq = h*h+dz*dz;
224 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
225 theta = krad2deg * TMath::ACos(x);
226
227 ptrap[0] = dz/2.-kEps;
228 ptrap[1] = theta;
229 ptrap[2] = 0.;
230 ptrap[3] = doh-kEps;
231 ptrap[4] = dol/x;
232 ptrap[5] = ptrap[4];
233 ptrap[7] = ptrap[3];
234 ptrap[8] = ptrap[4];
235 ptrap[9] = ptrap[4];
236
237 gMC->Gsvolu("B049", "TRAP", kSteel, ptrap, 11);
238 ptrap[0] = ptrap[0]-kEps;
239 ptrap[3] = (doh-ds);
240 ptrap[4] = (dol-ds)/x;
241 ptrap[5] = ptrap[4];
242 ptrap[7] = ptrap[3];
243 ptrap[8] = ptrap[4];
244 ptrap[9] = ptrap[4];
245 gMC->Gsvolu("B050", "TRAP", kAir, ptrap, 11);
246 gMC->Gspos("B050", 1, "B049", 0.0, 0.0, 0., 0, "ONLY");
247 gMC->Gspos("B049", 1, "BM49", 0.0, 0.0, 0., 0, "ONLY");
248
249
250 Float_t dd1 = d*TMath::Tan(theta*kdeg2rad);
251 Float_t dd2 = d/TMath::Tan(2.*theta*kdeg2rad);
252 Float_t theta2 = TMath::ATan(TMath::Abs(dd2-dd1)/d/2.);
253
254
255 ptrap[0] = dol;
256 ptrap[1] = theta2*krad2deg;
257 ptrap[2] = 0.;
258 ptrap[3] = doh;
259 ptrap[4] = (dz/2./x-dd1-dd2)/2.;
260 ptrap[5] = ptrap[4];
261 ptrap[6] = 0.;
262 ptrap[7] = ptrap[3];
263 ptrap[8] = dz/4./x;
264 ptrap[9] = ptrap[8];
265
266
267 gMC->Gsvolu("B051", "TRAP", kSteel, ptrap, 11);
268 Float_t ddx0 = ptrap[8];
269
270 Float_t dd1s = dd1*(1.-2.*ds/d);
271 Float_t dd2s = dd2*(1.-2.*ds/d);
272 Float_t theta2s = TMath::ATan(TMath::Abs(dd2s-dd1s)/(d-2.*ds)/2.);
273
274
275 ptrap[0] = dol-ds;
276 ptrap[1] = theta2s*krad2deg;
277 ptrap[2] = 0.;
278 ptrap[3] = doh-ds;
279 ptrap[4] = ptrap[4]+ds/d/2.*(dd1+dd2);
280 ptrap[5] = ptrap[4];
281 ptrap[6] = 0.;
282 ptrap[7] = ptrap[3];
283 ptrap[8] = ptrap[8]-ds/2./d*(dd1+dd2);
284 ptrap[9] = ptrap[8];
285
286 gMC->Gsvolu("B052", "TRAP", kAir, ptrap, 11);
287 gMC->Gspos("B052", 1, "B051", 0.0, 0.0, 0., 0, "ONLY");
288
289 Float_t ddx, ddz, drx, drz, rtheta;
290
291 AliMatrix(idrotm[2198], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
292 rtheta = (90.-theta)*kdeg2rad;
293 ddx = -ddx0-dol*TMath::Tan(theta2);
294 ddz = -dol;
295
296 drx = TMath::Cos(rtheta) * ddx +TMath::Sin(rtheta) *ddz+pbox[0];
297 drz = -TMath::Sin(rtheta) * ddx +TMath::Cos(rtheta) *ddz-pbox[2];
298 gMC->Gspos("B051", 1, "BM49",
299 drx, 0.0, drz,
300 idrotm[2198], "ONLY");
301
302 AliMatrix(idrotm[2197], -theta, 0.0, 90.0, 90.0, 270.-theta, 0.0);
303 rtheta = (270.-theta)*kdeg2rad;
304
305 drx = TMath::Cos(rtheta) * ddx + TMath::Sin(rtheta) * ddz-pbox[0];
306 drz = -TMath::Sin(rtheta) * ddx + TMath::Cos(rtheta) * ddz+pbox[2];
307 gMC->Gspos("B051", 2, "BM49",
308 drx, 0.0, drz,
309 idrotm[2197], "ONLY");
310
311//
312// Diagonal bars (3)
313//
314 h = ((dymod[2]-dymod[1])-2.*dol)*.999;
315 dq = h*h+dz*dz;
316 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
317 theta = krad2deg * TMath::ACos(x);
318
319 ptrap[0] = dz/2.;
320 ptrap[1] = theta;
321 ptrap[3] = doh;
322 ptrap[4] = dol/x;
323 ptrap[5] = ptrap[4];
324 ptrap[7] = ptrap[3];
325 ptrap[8] = ptrap[4];
326 ptrap[9] = ptrap[4];
327
328 gMC->Gsvolu("B045", "TRAP", kSteel, ptrap, 11);
329 ptrap[3] = doh-ds;
330 ptrap[4] = (dol-ds)/x;
331 ptrap[5] = ptrap[4];
332 ptrap[7] = ptrap[3];
333 ptrap[8] = ptrap[4];
334 ptrap[9] = ptrap[4];
335 gMC->Gsvolu("B046", "TRAP", kAir, ptrap, 11);
336 gMC->Gspos("B046", 1, "B045", 0.0, 0.0, 0., 0, "ONLY");
337
338//
339// Positioning of diagonal bars
340//
341// Matrices have been imported from Euclid. Some simplification
342// seems possible
343//
344 AliMatrix(idrotm[2121], 0.0, 0.0, 90.0, 130.0, 90.0, 40.0);
345 AliMatrix(idrotm[2123], 180.0, 0.0, 90.0, 130.0, 90.0, 40.0);
346 AliMatrix(idrotm[2125], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
347 AliMatrix(idrotm[2130], 0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
348 AliMatrix(idrotm[2128], 0.0, 0.0, 90.0, 170.0, 90.0, 80.0);
349 AliMatrix(idrotm[2135], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
350 AliMatrix(idrotm[2141], 180.0, 0.0, 90.0, 170.0, 90.0, 80.0);
351 AliMatrix(idrotm[2131], 0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
352 AliMatrix(idrotm[2101], 0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
353 AliMatrix(idrotm[2106], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
354 AliMatrix(idrotm[2096], 180.0, 0.0, 90.0, 10.0, 90.0, 100.0);
355 AliMatrix(idrotm[2098], 0.0, 0.0, 90.0, 10.0, 90.0, 100.0);
356 AliMatrix(idrotm[2108], 0.0, 0.0, 90.0, 30.0, 90.0, 300.0);
357 AliMatrix(idrotm[2111], 180.0, 0.0, 90.0, 30.0, 90.0, 300.0);
358 AliMatrix(idrotm[2113], 180.0, 0.0, 90.0, 50.0, 90.0, 140.0);
359 AliMatrix(idrotm[2118], 0.0, 0.0, 90.0, 50.0, 90.0, 140.0);
360
361 AliMatrix(idrotm[2115], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
362 AliMatrix(idrotm[2112], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
363 AliMatrix(idrotm[2124], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
364 AliMatrix(idrotm[2103], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
365 AliMatrix(idrotm[2140], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
366 AliMatrix(idrotm[2133], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
367 AliMatrix(idrotm[2104], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
368 AliMatrix(idrotm[2095], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
369
370 AliMatrix(idrotm[2119], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
371 AliMatrix(idrotm[2139], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0);
372 AliMatrix(idrotm[2107], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
373 AliMatrix(idrotm[2099], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
374 AliMatrix(idrotm[2129], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
375 AliMatrix(idrotm[2144], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
376 AliMatrix(idrotm[2100], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
377
378 Float_t rd = 410.56;
379 dz = (dymod[1]+dymod[0])/2.;
380 Float_t dz2 = (dymod[1]+dymod[2])/2.;
381
382//
383// phi = 40
384//
385 Float_t phi = 40;
386 dx = rd * TMath::Sin(phi*kdeg2rad);
387 dy = rd * TMath::Cos(phi*kdeg2rad);
388
389 gMC->Gspos("B047", 1, "B076", -dx, dy, dz, idrotm[2123], "ONLY");
390 gMC->Gspos("B047", 2, "B076", -dx, dy, -dz, idrotm[2121], "ONLY");
391 gMC->Gspos("B047", 3, "B076", dx, dy, dz, idrotm[2113], "ONLY");
392 gMC->Gspos("B047", 4, "B076", dx, dy, -dz, idrotm[2118], "ONLY");
393
394 gMC->Gspos("B045", 1, "B076", -dx, dy, dz2, idrotm[2115], "ONLY");
395 gMC->Gspos("B045", 2, "B076", -dx, dy, -dz2, idrotm[2121], "ONLY"); // ?
396 gMC->Gspos("B045", 3, "B076", dx, dy, dz2, idrotm[2112], "ONLY");
397 gMC->Gspos("B045", 4, "B076", dx, dy, -dz2, idrotm[2119], "ONLY");
398
399 gMC->Gspos("BM49", 1, "B076", dx, dy, 0., idrotm[2112], "ONLY");
400 gMC->Gspos("BM49", 2, "B076", -dx, dy, 0., idrotm[2115], "ONLY");
401
402//
403// phi = 60
404//
405
406 phi = 60;
407 dx = rd * TMath::Sin(phi*kdeg2rad);
408 dy = rd * TMath::Cos(phi*kdeg2rad);
409 gMC->Gspos("B047", 5, "B076", -dx, dy, dz, idrotm[2125], "ONLY");
410 gMC->Gspos("B047", 6, "B076", -dx, dy, -dz, idrotm[2130], "ONLY");
411 gMC->Gspos("B047", 7, "B076", dx, dy, dz, idrotm[2111], "ONLY");
412 gMC->Gspos("B047", 8, "B076", dx, dy, -dz, idrotm[2108], "ONLY");
413
414 gMC->Gspos("B045", 5, "B076", -dx, dy, dz2, idrotm[2124], "ONLY");
415 gMC->Gspos("B045", 6, "B076", -dx, dy, -dz2, idrotm[2139], "ONLY");
416 gMC->Gspos("B045", 7, "B076", dx, dy, dz2, idrotm[2103], "ONLY");
417 gMC->Gspos("B045", 8, "B076", dx, dy, -dz2, idrotm[2107], "ONLY");
418
419 gMC->Gspos("BM49", 3, "B076", dx, dy, 0., idrotm[2103], "ONLY");
420 gMC->Gspos("BM49", 4, "B076", -dx, dy, 0., idrotm[2124], "ONLY");
421//
422// phi = 80
423//
424
425 phi = 80;
426 dx = rd * TMath::Sin(phi*kdeg2rad);
427 dy = rd * TMath::Cos(phi*kdeg2rad);
428 gMC->Gspos("B047", 9, "B076", -dx, dy, dz, idrotm[2141], "ONLY");
429 gMC->Gspos("B047", 10, "B076", -dx, dy, -dz, idrotm[2128], "ONLY");
430 gMC->Gspos("B047", 11, "B076", dx, dy, dz, idrotm[2096], "ONLY");
431 gMC->Gspos("B047", 12, "B076", dx, dy, -dz, idrotm[2098], "ONLY");
432
433 gMC->Gspos("B047", 13, "B076", -dx, -dy, dz, idrotm[2135], "ONLY");
434 gMC->Gspos("B047", 14, "B076", -dx, -dy, -dz, idrotm[2131], "ONLY");
435 gMC->Gspos("B047", 15, "B076", dx, -dy, dz, idrotm[2106], "ONLY");
436 gMC->Gspos("B047", 16, "B076", dx, -dy, -dz, idrotm[2101], "ONLY");
437
438 gMC->Gspos("B045", 9, "B076", -dx, dy, dz2, idrotm[2140], "ONLY");
439 gMC->Gspos("B045", 10, "B076", -dx, dy, -dz2, idrotm[2129], "ONLY");
440 gMC->Gspos("B045", 11, "B076", dx, dy, dz2, idrotm[2095], "ONLY");
441 gMC->Gspos("B045", 12, "B076", dx, dy, -dz2, idrotm[2099], "ONLY");
442
443 gMC->Gspos("B045", 13, "B076", -dx, -dy, dz2, idrotm[2133], "ONLY");
444 gMC->Gspos("B045", 14, "B076", -dx, -dy, -dz2, idrotm[2144], "ONLY");
445 gMC->Gspos("B045", 15, "B076", dx, -dy, dz2, idrotm[2104], "ONLY");
446 gMC->Gspos("B045", 16, "B076", dx, -dy, -dz2, idrotm[2100], "ONLY");
447
448 gMC->Gspos("BM49", 5, "B076", dx, dy, 0., idrotm[2095], "ONLY");
449 gMC->Gspos("BM49", 6, "B076", -dx, dy, 0., idrotm[2140], "ONLY");
450 gMC->Gspos("BM49", 7, "B076", dx, -dy, 0., idrotm[2104], "ONLY");
451 gMC->Gspos("BM49", 8, "B076", -dx, -dy, 0., idrotm[2133], "ONLY");
452
453
454// The internal frame
455//
456 char* module[3] = {"B071\0", "B074\0", "B075\0"};
457//
458//
459// Mother Volumes
460//
461 ptrd1[0] = 50.18;
462 ptrd1[1] = 70.35;
463// ptrd1[0] = 50.10;
464// ptrd1[1] = 70.20;
465
466 ptrd1[2] = 375.5;
467 ptrd1[3] = 57.2;
468 for (jmod = 0; jmod < 3; jmod++)
469 {
470 gMC->Gsvolu(module[jmod], "TRD1", kAir, ptrd1, 4);
471 }
472
473 Int_t mod[18] = {1, 1, 1, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 1, 1};
474 Int_t rot1[18] = {53, 52, 49, 69, 30, 71, 64, 83, 81, 151, 150, 145, 146, 147, 148, 149, 60, 51};
475 Int_t rot2[18] = {23, 22, 21, 24, 14, 20, 136, 137, 36, 28, 67, 25, 50, 26, 27, 29, 138, 2};
476
477
478 Float_t r = 341.8;
479 Float_t rout1 = 410.564;
480 Float_t rout2 = 415.2;
481 Int_t modcount[3] = {0, 0, 0};
482
483 for (i=0; i<18; i++) {
484 Float_t phi = i*20.;
485 Float_t phi2 = 270+phi;
486 if (phi2 >= 360.) phi2-=360.;
487
488 dx = TMath::Sin(phi*kdeg2rad)*r;
489 dy = -TMath::Cos(phi*kdeg2rad)*r;
490 modcount[mod[i]]++;
491
492 AliMatrix(idrotm[2000+rot1[i]], 90.0, phi, 0., 0., 90., phi2);
493 gMC->Gspos(module[mod[i]], modcount[mod[i]], "B077", dx, dy, 0., idrotm[2000+rot1[i]], "ONLY");
494//
495// Position elements of outer Frame
496//
497 dx = TMath::Sin(phi*kdeg2rad)*rout1;
498 dy = -TMath::Cos(phi*kdeg2rad)*rout1;
499 for (j = 0; j < 3; j++)
500 {
501 dz = dymod[j];
502 gMC->Gspos("B042", 6*i+2*j+1, "B076", dx, dy, dz, idrotm[2000+rot1[i]], "ONLY");
503 gMC->Gspos("B042", 6*i+2*j+2, "B076", dx, dy, -dz, idrotm[2000+rot1[i]], "ONLY");
504 }
505
506 phi = i*20.+10;
507 phi2 = 270+phi;
508 AliMatrix(idrotm[2000+rot2[i]], 90.0, phi, 90., phi2, 0., 0.);
509
510 dx = TMath::Sin(phi*kdeg2rad)*rout2;
511 dy = -TMath::Cos(phi*kdeg2rad)*rout2;
512 gMC->Gspos("B033", i+1, "B076", dx, dy, 0., idrotm[2000+rot2[i]], "ONLY");
513//
514 }
515// Internal Frame rings
516//
517//
518// new specs: 40x100x6 for inner rings
519// 30x135x6 for front and rear rings
520//
521// currently no distinction between front/rear and inner rings
522//
523//
524//
525 pbox[0] = 50.;
526 pbox[1] = ringW/2.;
527 pbox[2] = ringH/2.;
528
529 gMC->Gsvolu("B072", "BOX ", kSteel, pbox, 3);
530
531 pbox[1] = pbox[1] - 0.6;
532 pbox[2] = pbox[2] - 0.6;
533 gMC->Gsvolu("B073", "BOX ", kAir, pbox, 3);
534 gMC->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
535
536// Web frame 0-degree
537//
538// h x w x s = 60x40x4
539// (attention: element is are half bars, "U" shaped)
540//
541
542 pbox[0] = dwh;
543 pbox[1] = dwl;
544 pbox[2] = (iFrH-ringH-longH)/2.;
545 gMC->Gsvolu("B063", "BOX ", kSteel, pbox, 3);
546 pbox[0] = dwh-0.2;
547 pbox[1] = dwl-0.4;
548
549 gMC->Gsvolu("B064", "BOX ", kAir, pbox, 3);
550 gMC->Gspos("B064", 1, "B063", 0.2, 0., 0., 0, "ONLY");
551
552 AliMatrix(idrotm[2013], 90.0, 0.0, 90.0, 270.0, 0.0, 0.0);
553 AliMatrix(idrotm[2001], 100.0, 0.0, 90.0, 270.0, 10.0, 0.0);
554 AliMatrix(idrotm[2003], 100.0, 0.0, 90.0, 90.0, 10.0, 0.0);
555 AliMatrix(idrotm[2011], 100.0, 180.0, 90.0, 270.0, 10.0, 180.0);
556 AliMatrix(idrotm[2017], 100.0, 180.0, 90.0, 90.0, 10.0, 180.0);
557 AliMatrix(idrotm[2006], 10.0, 0.0, 80.0, 180.0, 90.0, 90.0);
558 AliMatrix(idrotm[2010], 10.0, 0.0, 80.0, 180.0, 90.0, 270.0);
559 AliMatrix(idrotm[2012], 10.0, 180.0, 80.0, 0.0, 90.0, 90.0);
560 AliMatrix(idrotm[2018], 10.0, 180.0, 80.0, 0.0, 90.0, 270.0);
561 AliMatrix(idrotm[2007], 170.0, 180.0, 80.0, 180.0, 90.0, 90.0);
562 AliMatrix(idrotm[2009], 170.0, 180.0, 80.0, 180.0, 90.0, 270.0);
563 AliMatrix(idrotm[2016], 170.0, 0.0, 80.0, 0.0, 90.0, 90.0);
564 AliMatrix(idrotm[2015], 170.0, 0.0, 80.0, 0.0, 90.0, 270.0);
565 AliMatrix(idrotm[2004], 170.0, 0.0, 90.0, 90.0, 80.0, 0.0);
566 AliMatrix(idrotm[2005], 170.0, 180.0, 90.0, 90.0, 80.0, 180.0);
567 AliMatrix(idrotm[2019], 90.0, 180.0, 90.0, 90.0, 0.0, 0.0);
568//
569// web frame diagonal (outer)
570//
571 h = 106.2;
572 d = 2.*dwl;
573 dz = dymod[2]-dymod[1]-2.*dwl;
574 dq = h*h+dz*dz;
575
576 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
577
578
579 theta = krad2deg * TMath::ACos(x);
580
581 ptrap[0] = dz/2.;
582 ptrap[1] = theta;
583 ptrap[2] = 0.;
584 ptrap[3] = dwh;
585 ptrap[4] = dwl/x;
586 ptrap[5] = ptrap[4];
587 ptrap[6] = 0;
588 ptrap[7] = ptrap[3];
589 ptrap[8] = ptrap[4];
590 ptrap[9] = ptrap[4];
591 ptrap[10] = 0;
592 gMC->Gsvolu("B065", "TRAP", kSteel, ptrap, 11);
593 ptrap[3] = dwh - 0.2;
594 ptrap[4] = (dwl-0.4)/x;
595 ptrap[5] = ptrap[4];
596 ptrap[7] = ptrap[3];
597 ptrap[8] = ptrap[4];
598 ptrap[9] = ptrap[4];
599 gMC->Gsvolu("B066", "TRAP", kAir, ptrap, 11);
600 gMC->Gspos("B066", 1, "B065", 0.0, -0.2, 0., 0, "ONLY");
601
602//
603// web frame diagonal (inner)
604//
605 dz = dymod[1]-dymod[0]-2.*dwl;
606 dq = h*h+dz*dz;
607 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
608
609
610 theta = krad2deg * TMath::ACos(x);
611
612 ptrap[0] = (dymod[1]-dymod[0]-2.*dwl)/2.;
613 ptrap[1] = theta;
614 ptrap[2] = 0.;
615 ptrap[3] = dwh;
616 ptrap[4] = dwl/x;
617 ptrap[5] = ptrap[4];
618 ptrap[6] = 0;
619 ptrap[7] = ptrap[3];
620 ptrap[8] = ptrap[4];
621 ptrap[9] = ptrap[4];
622 ptrap[10] = 0;
623 gMC->Gsvolu("B067", "TRAP", kSteel, ptrap, 11);
624 ptrap[3] = dwh-0.2;
625 ptrap[4] = (dwl-0.4)/x;
626 ptrap[5] = ptrap[4];
627 ptrap[7] = ptrap[3];
628 ptrap[8] = ptrap[4];
629 ptrap[9] = ptrap[4];
630 gMC->Gsvolu("B068", "TRAP", kAir, ptrap, 11);
631 gMC->Gspos("B068", 1, "B067", 0.0, -0.2, 0., 0, "ONLY");
632
633
634 dz = -iFrH/2.+ringH/2.+kEps;
635
636 for (i = 0; i< 3; i++)
637 {
638// ring bars
639 for (jmod = 0; jmod<3; jmod++) {
640 gMC->Gspos("B072", 6*i+jmod+1, module[jmod], 0, dymod[i], dz, 0, "ONLY");
641 gMC->Gspos("B072", 6*i+jmod+4, module[jmod], 0, -dymod[i], dz, idrotm[2013], "ONLY");
642
643// 0-deg web
644 gMC->Gspos("B063", 12*i+jmod+1, module[jmod], 60.0732, dymod[i], 4.6669, idrotm[2003], "ONLY");
645 gMC->Gspos("B063", 12*i+jmod+4, module[jmod], 60.0732, -dymod[i], 4.6669, idrotm[2001], "ONLY");
646 gMC->Gspos("B063", 12*i+jmod+7, module[jmod], -60.0732, dymod[i], 4.6669, idrotm[2017], "ONLY");
647 gMC->Gspos("B063", 12*i+jmod+10, module[jmod], -60.0732, -dymod[i], 4.6669, idrotm[2011], "ONLY");
648 }
649 }
650
651// outer diagonal web
652
653 dy = (dymod[2]+dymod[1])/2.;
654 for (jmod = 0; jmod<3; jmod++) {
655 gMC->Gspos("B065", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2010], "ONLY");
656 gMC->Gspos("B065", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2006], "ONLY");
657 gMC->Gspos("B065", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2018], "ONLY");
658 gMC->Gspos("B065", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2012], "ONLY");
659 }
660
661
662 dy = (dymod[1]+dymod[0])/2.;
663
664 for (jmod = 0; jmod<3; jmod++) {
665 gMC->Gspos("B067", 4*jmod+1, module[jmod], 60.0732, dy, 4.6669, idrotm[2009], "ONLY");
666 gMC->Gspos("B067", 4*jmod+2, module[jmod], 60.0732, -dy, 4.6669, idrotm[2007], "ONLY");
667 gMC->Gspos("B067", 4*jmod+3, module[jmod], -60.0732, dy, 4.6669, idrotm[2015], "ONLY");
668 gMC->Gspos("B067", 4*jmod+4, module[jmod], -60.0732, -dy, 4.6669, idrotm[2016], "ONLY");
669 }
670
671// longitudinal bars (TPC rails attached)
672// new specs:
673// h x w x s = 100 x 75 x 6
674// current:
675// Attention: 2 "U" shaped half rods per cell
676//
677// not yet used
678//
679 ptrap[0] = 2.50;
680 ptrap[1] = 10.00;
681 ptrap[2] = 0.00;
682 ptrap[3] = 350.00;
683 ptrap[4] = 3.75;
684 ptrap[5] = ptrap[4];
685 ptrap[6] = 0;
686 ptrap[7] = ptrap[3];
687 ptrap[8] = ptrap[4];
688 ptrap[9] = ptrap[4];
689 ptrap[10] = 0;
690 gMC->Gsvolu("B059", "TRAP", kSteel, ptrap, 11);
691 ptrap[0] = 2.2;
692 ptrap[4] = 2.15;
693 ptrap[5] = ptrap[4];
694 ptrap[7] = ptrap[3];
695 ptrap[8] = ptrap[4];
696 ptrap[9] = ptrap[4];
697 gMC->Gsvolu("B062", "TRAP", kAir, ptrap, 11);
698 gMC->Gspos("B062", 1, "B059", 0.0, -0.3, 0., 0, "ONLY");
699//
700// longitudinal bars (no TPC rails attached)
701// new specs: h x w x s = 60 x 60 x 3
702// (was: 75 x 100 x 5?)
703//
704//
705//
706 ptrap[0] = longW/4.;
707 ptrap[4] = longH/2.;
708 ptrap[5] = ptrap[4];
709 ptrap[7] = ptrap[3];
710 ptrap[8] = ptrap[4];
711 ptrap[9] = ptrap[4];
712
713 gMC->Gsvolu("BA59", "TRAP", kSteel, ptrap, 11);
714 ptrap[0] = longW/4.-0.15;
715 ptrap[4] = longH/2.-0.30;
716 ptrap[5] = ptrap[4];
717 ptrap[7] = ptrap[3];
718 ptrap[8] = ptrap[4];
719 ptrap[9] = ptrap[4];
720 gMC->Gsvolu("BA62", "TRAP", kAir, ptrap, 11);
721 gMC->Gspos("BA62", 1, "BA59", 0.0, 0.0, -0.15, 0, "ONLY");
722
723 dz = -iFrH/2.+ringH+longH/2.;
724
725 for (jmod = 0; jmod<3; jmod++) {
726 gMC->Gspos("BA59", 2*jmod+1, module[jmod], 49.6476, 0.0, dz, idrotm[2005], "ONLY");
727 gMC->Gspos("BA59", 2*jmod+2, module[jmod], -49.6476, 0.0, dz, idrotm[2004], "ONLY");
728 }
729//
730//
731// Spacer between TRD and TOF modules
732 ptrap[0] = 0.99;
733 ptrap[1] = 10.00;
734 ptrap[2] = 0.00;
735 ptrap[3] = 350.00;
736 ptrap[4] = 0.9;
737 ptrap[5] = ptrap[4];
738 ptrap[6] = 0;
739 ptrap[7] = ptrap[3];
740 ptrap[8] = ptrap[4];
741 ptrap[9] = ptrap[4];
742 ptrap[10] = 0;
743 gMC->Gsvolu("B056", "TRAP", kSteel, ptrap, 11);
744 for (jmod = 0; jmod<3; jmod++) {
745 gMC->Gspos("B056", 2*jmod+1, module[jmod], 61.9607, 0.0, 27.2, 0 , "ONLY");
746 gMC->Gspos("B056", 2*jmod+2, module[jmod], -61.9607, 0.0, 27.2, idrotm[2019], "ONLY");
747 }
748//
749// Mother volumes for TRD and TOF
750//
751 if (!fHoles) {
752
753 ptrd1[0] = 49.8065;
754 ptrd1[1] = 62.8535;
755 ptrd1[2] = 375.5;
756 ptrd1[3] = 37.;
757 gMC->Gsvolu("BTR1", "TRD1", kAir, ptrd1, 4);
758 gMC->Gsvolu("BTR2", "TRD1", kAir, ptrd1, 4);
759 gMC->Gsvolu("BTR3", "TRD1", kAir, ptrd1, 4);
760
761 ptrd1[0] = 63.2061;
762 ptrd1[1] = 68.3192;
763 ptrd1[2] = 375.5;
764 ptrd1[3] = 14.5;
765 gMC->Gsvolu("BTO1", "TRD1", kAir, ptrd1, 4);
766 gMC->Gsvolu("BTO2", "TRD1", kAir, ptrd1, 4);
767 gMC->Gsvolu("BTO3", "TRD1", kAir, ptrd1, 4);
768
769 gMC->Gspos("BTR1", 1, "B071", 0., 0., -10.8, 0, "ONLY");
770 gMC->Gspos("BTR2", 1, "B074", 0., 0., -10.8, 0, "ONLY");
771 gMC->Gspos("BTR3", 1, "B075", 0., 0., -10.8, 0, "ONLY");
772
773 gMC->Gspos("BTO1", 1, "B071", 0., 0., 42.69, 0, "ONLY");
774 gMC->Gspos("BTO2", 1, "B074", 0., 0., 42.69, 0, "ONLY");
775 gMC->Gspos("BTO3", 1, "B075", 0., 0., 42.69, 0, "ONLY");
776 } else {
777 ptrd1[0] = 49.8065;
778 ptrd1[1] = 62.8535;
779 ptrd1[2] = 375.5;
780 ptrd1[3] = 37;
781 gMC->Gsvolu("BTR1", "TRD1", kAir, ptrd1, 4);
782 ptrd1[2] = 156.75;
783 gMC->Gsvolu("BTR2", "TRD1", kAir, ptrd1, 4);
784 ptrd1[2] = 79.75;
785 gMC->Gsvolu("BTR3", "TRD1", kAir, ptrd1, 4);
786
787 ptrd1[0] = 63.2061;
788 ptrd1[1] = 68.3192;
789 ptrd1[2] = 375.5;
790 ptrd1[3] = 14.5;
791 gMC->Gsvolu("BTO1", "TRD1", kAir, ptrd1, 4);
792 ptrd1[2] = 156.75;
793 gMC->Gsvolu("BTO2", "TRD1", kAir, ptrd1, 4);
794 ptrd1[2] = 79.75;
795 gMC->Gsvolu("BTO3", "TRD1", kAir, ptrd1, 4);
796
797 gMC->Gspos("BTR1", 1, "B071", 0., 0., -10.8, 0, "ONLY");
798
799 gMC->Gspos("BTR2", 1, "B074", 0., -218.75, -10.8, idrotm[152], "ONLY");
800 gMC->Gspos("BTR2", 2, "B074", 0., 218.75, -10.8, 0, "ONLY");
801
802 gMC->Gspos("BTR3", 1, "B075", 0., -295.75, -10.8, idrotm[152], "ONLY");
803 gMC->Gspos("BTR3", 2, "B075", 0., 295.75, -10.8, 0, "ONLY");
804
805
806 gMC->Gspos("BTO1", 1, "B071", 0., 0., -42.7, 0, "ONLY");
807
808 gMC->Gspos("BTO2", 1, "B074", 0., -218.75, -42.7, idrotm[152], "ONLY");
809 gMC->Gspos("BTO2", 2, "B074", 0., 218.75, -42.7, 0, "ONLY");
810
811 gMC->Gspos("BTO3", 1, "B075", 0., -295.75, -42.7, idrotm[152], "ONLY");
812 gMC->Gspos("BTO3", 2, "B075", 0., 295.75, -42.7, 0, "ONLY");
813
814 }
815}
816
817
818//___________________________________________
819void AliFRAMEv2::CreateMaterials()
820{
821
822 Float_t epsil, stemax, tmaxfd, deemax, stmin;
823
824 epsil = 1.e-4; // Tracking precision,
825 stemax = -0.01; // Maximum displacement for multiple scat
826 tmaxfd = -20.; // Maximum angle due to field deflection
827 deemax = -.3; // Maximum fractional energy loss, DLS
828 stmin = -.8;
829 Int_t isxfld = gAlice->Field()->Integ();
830 Float_t sxmgmx = gAlice->Field()->Max();
831
832 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
833 Float_t zsteel[4] = { 26.,24.,28.,14. };
834 Float_t wsteel[4] = { .715,.18,.1,.005 };
835
836 AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
837 AliMaterial(5, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
838 AliMedium(65, "Stainless Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
839 AliMedium( 5, "Air ", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
840}
841
842//_____________________________________________________________________________
843void AliFRAMEv2::Init()
844{
845 //
846 // Initialise the module after the geometry has been defined
847 //
848
849 printf("**************************************"
850 " FRAME "
851 "**************************************\n");
852 printf("\n Version 1 of FRAME initialised, symmetric FRAME\n\n");
853 printf("**************************************"
854 " FRAME "
855 "**************************************\n");
856
857}
858
859
860
861
862
863
864
865