Moved old AliMagFCheb to AliMagF, small fixes/optimizations in field classes
[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>
83af9b47 28#include <TGeoBBox.h>
29#include <TGeoMatrix.h>
30#include <TGeoPgon.h>
31#include <TGeoCompositeShape.h>
7e5caa00 32#include "AliFRAMEv2.h"
33#include "AliMagF.h"
34#include "AliRun.h"
f2744db7 35#include "AliConst.h"
5d12ce38 36#include "AliMC.h"
4951e003 37#include "AliLog.h"
e6add757 38#include "AliTrackReference.h"
7e5caa00 39
40ClassImp(AliFRAMEv2)
6772b8d8 41
7e5caa00 42
43//_____________________________________________________________________________
6772b8d8 44AliFRAMEv2::AliFRAMEv2():
45 fHoles(0)
7e5caa00 46{
47// Constructor
7e5caa00 48}
49
50//_____________________________________________________________________________
51AliFRAMEv2::AliFRAMEv2(const char *name, const char *title)
6772b8d8 52 : AliFRAME(name,title),
53 fHoles(0)
7e5caa00 54{
55// Constructor
7e5caa00 56}
57
7e5caa00 58//___________________________________________
59void AliFRAMEv2::CreateGeometry()
60{
61//Begin_Html
62/*
63<img src="picts/frame.gif">
64*/
65//End_Html
66
67
68//Begin_Html
69/*
70<img src="picts/tree_frame.gif">
71*/
72//End_Html
73
4a8eca94 74 Int_t idrotm[2299];
83af9b47 75
76
77
78 AliMatrix(idrotm[2070], 90.0, 0.0, 90.0, 270.0, 0.0, 0.0);
79//
80 AliMatrix(idrotm[2083], 170.0, 0.0, 90.0, 90.0, 80.0, 0.0);
81 AliMatrix(idrotm[2084], 170.0, 180.0, 90.0, 90.0, 80.0, 180.0);
82 AliMatrix(idrotm[2085], 90.0, 180.0, 90.0, 90.0, 0.0, 0.0);
83//
84 AliMatrix(idrotm[2086], 90.0, 0.0, 90.0, 90., 0.0, 0.0);
85 AliMatrix(idrotm[2087], 90.0, 180.0, 90.0, 270., 0.0, 0.0);
86 AliMatrix(idrotm[2088], 90.0, 90.0, 90.0, 180., 0.0, 0.0);
87 AliMatrix(idrotm[2089], 90.0, 90.0, 90.0, 0., 0.0, 0.0);
88//
89 AliMatrix(idrotm[2090], 90.0, 0.0, 0.0, 0., 90.0, 90.0);
90 AliMatrix(idrotm[2091], 0.0, 0.0, 90.0, 90., 90.0, 0.0);
91//
92// Matrices have been imported from Euclid. Some simplification
93// seems possible
94//
95
96 AliMatrix(idrotm[2003], 0.0, 0.0, 90.0, 130.0, 90.0, 40.0);
97 AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0, 40.0);
98 AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
99 AliMatrix(idrotm[2006], 0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
100 AliMatrix(idrotm[2007], 0.0, 0.0, 90.0, 170.0, 90.0, 80.0);
101 AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
102 AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0, 80.0);
103 AliMatrix(idrotm[2010], 0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
104 AliMatrix(idrotm[2011], 0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
105 AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
106 AliMatrix(idrotm[2013], 180.0, 0.0, 90.0, 10.0, 90.0, 100.0);
107 AliMatrix(idrotm[2014], 0.0, 0.0, 90.0, 10.0, 90.0, 100.0);
108 AliMatrix(idrotm[2015], 0.0, 0.0, 90.0, 30.0, 90.0, 300.0);
109 AliMatrix(idrotm[2016], 180.0, 0.0, 90.0, 30.0, 90.0, 300.0);
110 AliMatrix(idrotm[2017], 180.0, 0.0, 90.0, 50.0, 90.0, 140.0);
111 AliMatrix(idrotm[2018], 0.0, 0.0, 90.0, 50.0, 90.0, 140.0);
112
113 AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
114 AliMatrix(idrotm[2020], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
115 AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
116 AliMatrix(idrotm[2022], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
117 AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
118 AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
119 AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
120 AliMatrix(idrotm[2026], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
121
122 AliMatrix(idrotm[2027], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
123 AliMatrix(idrotm[2028], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0);
124 AliMatrix(idrotm[2029], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
125 AliMatrix(idrotm[2030], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
126 AliMatrix(idrotm[2031], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
127 AliMatrix(idrotm[2032], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
128 AliMatrix(idrotm[2033], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
129
130
7e5caa00 131 Int_t *idtmed = fIdtmed->GetArray()-1999;
132//
133// The Space frame
134//
135//
e16311cb 136 Float_t pbox[3], ptrap[11], ptrd1[4], ppgon[10];
7e5caa00 137
138 Float_t dx, dy, dz;
139 Int_t i, j, jmod;
d84d0b8c 140 jmod = 0;
7e5caa00 141//
142// Constants
143 const Float_t kEps = 0.01;
c2beaf42 144 const Int_t kAir = idtmed[2004];
145 const Int_t kSteel = idtmed[2064];
7e5caa00 146
c2beaf42 147 const Float_t krad2deg = 180. / TMath::Pi();
148 const Float_t kdeg2rad = 1. / krad2deg;
7e5caa00 149
c2beaf42 150 Float_t iFrH = 118.66; // Height of inner frame
151 Float_t ringH = 6.00; // Height of the ring bars
83af9b47 152 Float_t ringW = 10.00; // Width of the ring bars in z
6904b1c6 153 Float_t longH = 6.00;
154 Float_t longW = 4.00;
02e42643 155//
83af9b47 156 Float_t dymodU[3] = {70.0, 224.0, 340.2};
157 Float_t dymodL[3] = {50.0, 175.0, 297.5};
158 //
159
7e5caa00 160//
161// Frame mother volume
162//
83af9b47 163 TGeoPgon* shB77A = new TGeoPgon(0., 360., 18, 2);
164 shB77A->SetName("shB77A");
165 shB77A->DefineSection( 0, -376., 280., 415.7);
166 shB77A->DefineSection( 1, 376., 280., 415.7);
167 TGeoBBox* shB77B = new TGeoBBox(3.42, 2., 375.5);
168 shB77B->SetName("shB77B");
1cae56d7 169 TGeoTranslation* trB77A = new TGeoTranslation("trB77A", +283.32, 0., 0.);
170 TGeoTranslation* trB77B = new TGeoTranslation("trB77B", -283.32, 0., 0.);
83af9b47 171 trB77A->RegisterYourself();
172 trB77B->RegisterYourself();
173 TGeoCompositeShape* shB77 = new TGeoCompositeShape("shB77", "shB77A+shB77B:trB77A+shB77B:trB77B");
174 TGeoVolume* voB77 = new TGeoVolume("B077", shB77, gGeoManager->GetMedium("FRAME_Air"));
4523beaf 175 voB77->SetName("B077"); // just to avoid a warning
7e5caa00 176 gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
177//
83af9b47 178// Reference plane #1 for TRD
179 TGeoPgon* shBREFA = new TGeoPgon(0.0, 360., 18, 2);
180 shBREFA->DefineSection( 0, -376., 280., 280.1);
181 shBREFA->DefineSection( 1, 376., 280., 280.1);
182 shBREFA->SetName("shBREFA");
183 TGeoCompositeShape* shBREF1 = new TGeoCompositeShape("shBREF1", "shBREFA-(shB77B:trB77A+shB77B:trB77B)");
184 TGeoVolume* voBREF = new TGeoVolume("BREF1", shBREF1, gGeoManager->GetMedium("FRAME_Air"));
46fd9a2e 185 voBREF->SetVisibility(0);
83af9b47 186 gMC->Gspos("BREF1", 1, "B077", 0., 0., 0., 0, "ONLY");
55bdc695 187//
7e5caa00 188// The outer Frame
189//
190
c2beaf42 191 Float_t dol = 4.;
192 Float_t doh = 4.;
193 Float_t ds = 0.63;
7e5caa00 194//
195// Mother volume
196//
197 ppgon[0] = 0.;
198 ppgon[1] = 360.;
199 ppgon[2] = 18.;
200
201 ppgon[3] = 2.;
202
203 ppgon[4] = -350.;
7d03cffa 204 ppgon[5] = 401.35;
6904b1c6 205 ppgon[6] = 415.6;
206
7e5caa00 207 ppgon[7] = -ppgon[4];
208 ppgon[8] = ppgon[5];
209 ppgon[9] = ppgon[6];
210 gMC->Gsvolu("B076", "PGON", kAir, ppgon, 10);
211 gMC->Gspos("B076", 1, "B077", 0., 0., 0., 0, "ONLY");
212//
213// Rings
214//
83af9b47 215 dz = 2. * 410.2 * TMath::Sin(10.*kdeg2rad) - 2. *dol * TMath::Cos(10.*kdeg2rad)- 2. * doh * TMath::Tan(10.*kdeg2rad);
7e5caa00 216 Float_t l1 = dz/2.;
217 Float_t l2 = dz/2.+2.*doh*TMath::Tan(10.*kdeg2rad);
218
7e5caa00 219
83af9b47 220 TGeoVolumeAssembly* asBI42 = new TGeoVolumeAssembly("BI42");
221 // Horizontal
222 ptrd1[0] = l2 - 0.6 * TMath::Tan(10.*kdeg2rad);
223 ptrd1[1] = l2;
224 ptrd1[2] = 8.0 / 2.;
225 ptrd1[3] = 0.6 / 2.;
226 gMC->Gsvolu("BIH142", "TRD1", kSteel, ptrd1, 4);
227 ptrd1[0] = l1;
228 ptrd1[1] = l1 + 0.6 * TMath::Tan(10.*kdeg2rad);
229 ptrd1[2] = 8.0 / 2.;
230 ptrd1[3] = 0.6 / 2.;
231 gMC->Gsvolu("BIH242", "TRD1", kSteel, ptrd1, 4);
232
233 // Vertical
234 ptrd1[0] = l1 + 0.6 * TMath::Tan(10.*kdeg2rad);
235 ptrd1[1] = l2 - 0.6 * TMath::Tan(10.*kdeg2rad);
236 ptrd1[2] = 0.8 / 2.;
237 ptrd1[3] = 6.8 / 2.;
238 gMC->Gsvolu("BIV42", "TRD1", kSteel, ptrd1, 4);
239 // Place
240 asBI42->AddNode(gGeoManager->GetVolume("BIV42"), 1, new TGeoTranslation(0., 0., 0.));
241 asBI42->AddNode(gGeoManager->GetVolume("BIH142"), 1, new TGeoTranslation(0., 0., 3.7));
242 asBI42->AddNode(gGeoManager->GetVolume("BIH242"), 1, new TGeoTranslation(0., 0., -3.7));
7e5caa00 243//
244// longitudinal bars
245//
c2beaf42 246// 80 x 80 x 6.3
7e5caa00 247//
248 pbox[0] = dol;
249 pbox[1] = doh;
83af9b47 250 pbox[2] = 345.;
7e5caa00 251 gMC->Gsvolu("B033", "BOX", kSteel, pbox, 3);
252 pbox[0] = dol-ds;
253 pbox[1] = doh-ds;
254 gMC->Gsvolu("B034", "BOX", kAir, pbox, 3);
255 gMC->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
256
7e5caa00 257
83af9b47 258 //
259 // TPC support
260 //
49a2852a 261 pbox[0] = 3.37;
83af9b47 262 pbox[1] = 2.0;
263 pbox[2] = 375.5;
7e5caa00 264 gMC->Gsvolu("B080", "BOX", kSteel, pbox, 3);
83af9b47 265 pbox[0] = 2.78;
266 pbox[1] = 1.4;
267 pbox[2] = 375.5;
268 gMC->Gsvolu("B081", "BOX", kAir, pbox, 3);
269 gMC->Gspos("B081", 1, "B080", 0., 0., 0., 0, "ONLY");
270
271 // Small 2nd reference plane elemenet
272 pbox[0] = 0.05;
273 pbox[1] = 2.0;
274 pbox[2] = 375.5;
275 gMC->Gsvolu("BREF2", "BOX", kAir, pbox, 3);
b98a8a5f 276 gMC->Gspos("BREF2", 1, "B080", 3.37 - 0.05, 0., 0., 0, "ONLY");
83af9b47 277
1cae56d7 278 gMC->Gspos("B080", 1, "B077", 283.3, 0., 0., 0, "ONLY");
279 gMC->Gspos("B080", 2, "B077", -283.3, 0., 0., idrotm[2087], "ONLY");
7e5caa00 280
83af9b47 281
7e5caa00 282//
283// Diagonal bars (1)
284//
285 Float_t h, d, dq, x, theta;
286
4a8eca94 287 h = (dymodU[1]-dymodU[0]-2.*dol)*.999;
7e5caa00 288 d = 2.*dol;
289 dq = h*h+dz*dz;
290
291 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
292
293
294 theta = krad2deg * TMath::ACos(x);
295
296 ptrap[0] = dz/2.;
297 ptrap[1] = theta;
298 ptrap[2] = 0.;
299 ptrap[3] = doh;
300 ptrap[4] = dol/x;
301 ptrap[5] = ptrap[4];
302 ptrap[6] = 0;
303 ptrap[7] = ptrap[3];
304 ptrap[8] = ptrap[4];
305 ptrap[9] = ptrap[4];
306 ptrap[10] = 0;
307
308 gMC->Gsvolu("B047", "TRAP", kSteel, ptrap, 11);
309 ptrap[3] = doh-ds;
310 ptrap[4] = (dol-ds)/x;
311 ptrap[5] = ptrap[4];
312 ptrap[7] = ptrap[3];
313 ptrap[8] = ptrap[4];
314 ptrap[9] = ptrap[4];
315 gMC->Gsvolu("B048", "TRAP", kAir, ptrap, 11);
316 gMC->Gspos("B048", 1, "B047", 0.0, 0.0, 0., 0, "ONLY");
317
318/*
319 Crosses (inner most)
320 \\ //
321 \\//
322 //\\
323 // \\
324*/
4a8eca94 325 h = (2.*dymodU[0]-2.*dol)*.999;
7e5caa00 326//
327// Mother volume
328//
329 pbox[0] = h/2;
330 pbox[1] = doh;
331 pbox[2] = dz/2.;
332 gMC->Gsvolu("BM49", "BOX ", kAir, pbox, 3);
333
334
335 dq = h*h+dz*dz;
336 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
337 theta = krad2deg * TMath::ACos(x);
338
339 ptrap[0] = dz/2.-kEps;
340 ptrap[1] = theta;
341 ptrap[2] = 0.;
342 ptrap[3] = doh-kEps;
343 ptrap[4] = dol/x;
344 ptrap[5] = ptrap[4];
345 ptrap[7] = ptrap[3];
346 ptrap[8] = ptrap[4];
347 ptrap[9] = ptrap[4];
348
349 gMC->Gsvolu("B049", "TRAP", kSteel, ptrap, 11);
350 ptrap[0] = ptrap[0]-kEps;
351 ptrap[3] = (doh-ds);
352 ptrap[4] = (dol-ds)/x;
353 ptrap[5] = ptrap[4];
354 ptrap[7] = ptrap[3];
355 ptrap[8] = ptrap[4];
356 ptrap[9] = ptrap[4];
357 gMC->Gsvolu("B050", "TRAP", kAir, ptrap, 11);
358 gMC->Gspos("B050", 1, "B049", 0.0, 0.0, 0., 0, "ONLY");
359 gMC->Gspos("B049", 1, "BM49", 0.0, 0.0, 0., 0, "ONLY");
360
361
362 Float_t dd1 = d*TMath::Tan(theta*kdeg2rad);
363 Float_t dd2 = d/TMath::Tan(2.*theta*kdeg2rad);
364 Float_t theta2 = TMath::ATan(TMath::Abs(dd2-dd1)/d/2.);
365
366
367 ptrap[0] = dol;
368 ptrap[1] = theta2*krad2deg;
369 ptrap[2] = 0.;
370 ptrap[3] = doh;
371 ptrap[4] = (dz/2./x-dd1-dd2)/2.;
372 ptrap[5] = ptrap[4];
373 ptrap[6] = 0.;
374 ptrap[7] = ptrap[3];
375 ptrap[8] = dz/4./x;
376 ptrap[9] = ptrap[8];
377
378
379 gMC->Gsvolu("B051", "TRAP", kSteel, ptrap, 11);
380 Float_t ddx0 = ptrap[8];
381
382 Float_t dd1s = dd1*(1.-2.*ds/d);
383 Float_t dd2s = dd2*(1.-2.*ds/d);
384 Float_t theta2s = TMath::ATan(TMath::Abs(dd2s-dd1s)/(d-2.*ds)/2.);
385
386
387 ptrap[0] = dol-ds;
388 ptrap[1] = theta2s*krad2deg;
389 ptrap[2] = 0.;
390 ptrap[3] = doh-ds;
391 ptrap[4] = ptrap[4]+ds/d/2.*(dd1+dd2);
392 ptrap[5] = ptrap[4];
393 ptrap[6] = 0.;
394 ptrap[7] = ptrap[3];
395 ptrap[8] = ptrap[8]-ds/2./d*(dd1+dd2);
396 ptrap[9] = ptrap[8];
397
398 gMC->Gsvolu("B052", "TRAP", kAir, ptrap, 11);
399 gMC->Gspos("B052", 1, "B051", 0.0, 0.0, 0., 0, "ONLY");
400
401 Float_t ddx, ddz, drx, drz, rtheta;
402
83af9b47 403 AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
7e5caa00 404 rtheta = (90.-theta)*kdeg2rad;
405 ddx = -ddx0-dol*TMath::Tan(theta2);
406 ddz = -dol;
407
408 drx = TMath::Cos(rtheta) * ddx +TMath::Sin(rtheta) *ddz+pbox[0];
409 drz = -TMath::Sin(rtheta) * ddx +TMath::Cos(rtheta) *ddz-pbox[2];
410 gMC->Gspos("B051", 1, "BM49",
411 drx, 0.0, drz,
4a8eca94 412 idrotm[2001], "ONLY");
7e5caa00 413
4a8eca94 414 AliMatrix(idrotm[2002], -theta, 0.0, 90.0, 90.0, 270.-theta, 0.0);
7e5caa00 415 rtheta = (270.-theta)*kdeg2rad;
416
417 drx = TMath::Cos(rtheta) * ddx + TMath::Sin(rtheta) * ddz-pbox[0];
418 drz = -TMath::Sin(rtheta) * ddx + TMath::Cos(rtheta) * ddz+pbox[2];
419 gMC->Gspos("B051", 2, "BM49",
420 drx, 0.0, drz,
4a8eca94 421 idrotm[2002], "ONLY");
7e5caa00 422
423//
424// Diagonal bars (3)
425//
4a8eca94 426 h = ((dymodU[2]-dymodU[1])-2.*dol)*.999;
7e5caa00 427 dq = h*h+dz*dz;
428 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
429 theta = krad2deg * TMath::ACos(x);
430
431 ptrap[0] = dz/2.;
432 ptrap[1] = theta;
433 ptrap[3] = doh;
434 ptrap[4] = dol/x;
435 ptrap[5] = ptrap[4];
436 ptrap[7] = ptrap[3];
437 ptrap[8] = ptrap[4];
438 ptrap[9] = ptrap[4];
439
440 gMC->Gsvolu("B045", "TRAP", kSteel, ptrap, 11);
441 ptrap[3] = doh-ds;
442 ptrap[4] = (dol-ds)/x;
443 ptrap[5] = ptrap[4];
444 ptrap[7] = ptrap[3];
445 ptrap[8] = ptrap[4];
446 ptrap[9] = ptrap[4];
447 gMC->Gsvolu("B046", "TRAP", kAir, ptrap, 11);
448 gMC->Gspos("B046", 1, "B045", 0.0, 0.0, 0., 0, "ONLY");
449
450//
451// Positioning of diagonal bars
7e5caa00 452
7d03cffa 453 Float_t rd = 405.5;
4a8eca94 454 dz = (dymodU[1]+dymodU[0])/2.;
455 Float_t dz2 = (dymodU[1]+dymodU[2])/2.;
7e5caa00 456
457//
458// phi = 40
459//
460 Float_t phi = 40;
461 dx = rd * TMath::Sin(phi*kdeg2rad);
462 dy = rd * TMath::Cos(phi*kdeg2rad);
463
7e5caa00 464
4a8eca94 465 gMC->Gspos("B045", 1, "B076", -dx, dy, dz2, idrotm[2019], "ONLY");
466 gMC->Gspos("B045", 2, "B076", -dx, dy, -dz2, idrotm[2003], "ONLY"); // ?
467 gMC->Gspos("B045", 3, "B076", dx, dy, dz2, idrotm[2020], "ONLY");
468 gMC->Gspos("B045", 4, "B076", dx, dy, -dz2, idrotm[2027], "ONLY");
7e5caa00 469
7e5caa00 470
471//
472// phi = 60
473//
474
475 phi = 60;
476 dx = rd * TMath::Sin(phi*kdeg2rad);
477 dy = rd * TMath::Cos(phi*kdeg2rad);
7e5caa00 478
4a8eca94 479 gMC->Gspos("B045", 5, "B076", -dx, dy, dz2, idrotm[2021], "ONLY");
480 gMC->Gspos("B045", 6, "B076", -dx, dy, -dz2, idrotm[2028], "ONLY");
481 gMC->Gspos("B045", 7, "B076", dx, dy, dz2, idrotm[2022], "ONLY");
482 gMC->Gspos("B045", 8, "B076", dx, dy, -dz2, idrotm[2029], "ONLY");
7e5caa00 483
7e5caa00 484//
485// phi = 80
486//
487
488 phi = 80;
489 dx = rd * TMath::Sin(phi*kdeg2rad);
490 dy = rd * TMath::Cos(phi*kdeg2rad);
7e5caa00 491
4a8eca94 492 gMC->Gspos("B047", 13, "B076", -dx, -dy, dz, idrotm[2008], "ONLY");
493 gMC->Gspos("B047", 14, "B076", -dx, -dy, -dz, idrotm[2010], "ONLY");
494 gMC->Gspos("B047", 15, "B076", dx, -dy, dz, idrotm[2012], "ONLY");
495 gMC->Gspos("B047", 16, "B076", dx, -dy, -dz, idrotm[2011], "ONLY");
7e5caa00 496
4a8eca94 497 gMC->Gspos("B045", 9, "B076", -dx, dy, dz2, idrotm[2023], "ONLY");
498 gMC->Gspos("B045", 10, "B076", -dx, dy, -dz2, idrotm[2031], "ONLY");
499 gMC->Gspos("B045", 11, "B076", dx, dy, dz2, idrotm[2026], "ONLY");
500 gMC->Gspos("B045", 12, "B076", dx, dy, -dz2, idrotm[2030], "ONLY");
7e5caa00 501
4a8eca94 502 gMC->Gspos("B045", 13, "B076", -dx, -dy, dz2, idrotm[2024], "ONLY");
503 gMC->Gspos("B045", 14, "B076", -dx, -dy, -dz2, idrotm[2032], "ONLY");
504 gMC->Gspos("B045", 15, "B076", dx, -dy, dz2, idrotm[2025], "ONLY");
505 gMC->Gspos("B045", 16, "B076", dx, -dy, -dz2, idrotm[2033], "ONLY");
7e5caa00 506
4a8eca94 507 gMC->Gspos("BM49", 7, "B076", dx, -dy, 0., idrotm[2025], "ONLY");
508 gMC->Gspos("BM49", 8, "B076", -dx, -dy, 0., idrotm[2024], "ONLY");
7e5caa00 509
7eb5db32 510//
7e5caa00 511// The internal frame
512//
7e5caa00 513//
514//
515// Mother Volumes
516//
7eb5db32 517
c2beaf42 518 ptrd1[0] = 49.8;
519 ptrd1[1] = 70.7;
83af9b47 520 ptrd1[2] = 376.0;
c2beaf42 521 ptrd1[3] = iFrH / 2.;
7e5caa00 522
c2beaf42 523 Float_t r = 342.0;
7d03cffa 524 Float_t rout1 = 405.5;
b98a8a5f 525 Float_t rout2 = 411.55;
3c976b4c 526 TString module[18];
7e5caa00 527
d84d0b8c 528 for (i = 0; i < 18; i++) {
7eb5db32 529
d84d0b8c 530 // Create volume i
8ce41745 531 char name[16];
9398db43 532 Int_t mod = i + 13;
533 if (mod > 17) mod -= 18;
534 sprintf(name, "BSEGMO%d", mod);
d84d0b8c 535 gMC->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
bb92d81d 536 gGeoManager->GetVolume(name)->SetVisibility(kFALSE);
3c976b4c 537
d84d0b8c 538 module[i] = name;
539 // Place volume i
3b7df2c4 540 Float_t phi1 = i * 20.;
541 Float_t phi2 = 270 + phi1;
d84d0b8c 542 if (phi2 >= 360.) phi2 -= 360.;
7e5caa00 543
3b7df2c4 544 dx = TMath::Sin(phi1*kdeg2rad)*r;
545 dy = -TMath::Cos(phi1*kdeg2rad)*r;
7e5caa00 546
83af9b47 547 char nameR[64];
548 sprintf(nameR, "B43_Rot_%d", i);
549 TGeoRotation* rot = new TGeoRotation(nameR, 90.0, phi1, 0., 0., 90., phi2);
3b7df2c4 550 AliMatrix(idrotm[2034+i], 90.0, phi1, 0., 0., 90., phi2);
83af9b47 551 TGeoVolume* vol77 = gGeoManager->GetVolume("B077");
552 TGeoVolume* volS = gGeoManager->GetVolume(name);
553 vol77->AddNode(volS, 1, new TGeoCombiTrans(dx, dy, 0., rot));
7eb5db32 554
7e5caa00 555//
556// Position elements of outer Frame
557//
3b7df2c4 558 dx = TMath::Sin(phi1*kdeg2rad)*rout1;
559 dy = -TMath::Cos(phi1*kdeg2rad)*rout1;
7e5caa00 560 for (j = 0; j < 3; j++)
561 {
4a8eca94 562 dz = dymodU[j];
83af9b47 563 TGeoVolume* vol = gGeoManager->GetVolume("B076");
564 vol->AddNode(asBI42, 6*i+2*j+1, new TGeoCombiTrans(dx, dy, dz, rot));
565 vol->AddNode(asBI42, 6*i+2*j+2, new TGeoCombiTrans(dx, dy, -dz, rot));
7e5caa00 566 }
567
3b7df2c4 568 phi1 = i*20.+10;
569 phi2 = 270+phi1;
570 AliMatrix(idrotm[2052+i], 90.0, phi1, 90., phi2, 0., 0.);
7e5caa00 571
3b7df2c4 572 dx = TMath::Sin(phi1*kdeg2rad)*rout2;
573 dy = -TMath::Cos(phi1*kdeg2rad)*rout2;
4a8eca94 574 gMC->Gspos("B033", i+1, "B076", dx, dy, 0., idrotm[2052+i], "ONLY");
7e5caa00 575//
576 }
577// Internal Frame rings
578//
579//
83af9b47 580// 60x60x5x6 for inner rings (I-beam)
581// 100x60x5 for front and rear rings
7e5caa00 582//
83af9b47 583// Front and rear
282734ac 584 ptrd1[0] = 287. * TMath::Sin(10.* kdeg2rad) - 2.1;
585 ptrd1[1] = 293. * TMath::Sin(10.* kdeg2rad) - 2.1;
c2beaf42 586 ptrd1[2] = ringW/2.;
587 ptrd1[3] = ringH/2.;
7e5caa00 588
c2beaf42 589 gMC->Gsvolu("B072", "TRD1", kSteel, ptrd1, 4);
7e5caa00 590
282734ac 591 ptrd1[0] = 287.5 * TMath::Sin(10. * kdeg2rad) - 2.1;
592 ptrd1[1] = 292.5 * TMath::Sin(10. * kdeg2rad) - 2.1;
c2beaf42 593 ptrd1[2] = ringW / 2. - 0.5;
594 ptrd1[3] = ringH / 2. - 0.5;
595
596 gMC->Gsvolu("B073", "TRD1", kAir, ptrd1, 4);
7e5caa00 597 gMC->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
83af9b47 598//
599// I-Beam
600// Mother volume
601 TGeoVolumeAssembly* asBI72 = new TGeoVolumeAssembly("BI72");
602 // Horizontal
603 ptrd1[0] = 292.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
604 ptrd1[1] = 293.0 * TMath::Sin(10.* kdeg2rad) - 2.1;
605 ptrd1[2] = 6./2.;
606 ptrd1[3] = 0.5/2.;
607 gMC->Gsvolu("BIH172", "TRD1", kSteel, ptrd1, 4);
608 ptrd1[0] = 287.0 * TMath::Sin(10.* kdeg2rad) - 2.1;
609 ptrd1[1] = 287.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
610 ptrd1[2] = 6./2.;
611 ptrd1[3] = 0.5/2.;
612 gMC->Gsvolu("BIH272", "TRD1", kSteel, ptrd1, 4);
613
614 // Vertical
615 ptrd1[0] = 287.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
616 ptrd1[1] = 292.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
617 ptrd1[2] = 0.6/2.;
618 ptrd1[3] = 5./2.;
619 gMC->Gsvolu("BIV72", "TRD1", kSteel, ptrd1, 4);
620 // Place
621 asBI72->AddNode(gGeoManager->GetVolume("BIV72"), 1, new TGeoTranslation(0., 0., 0.));
622 asBI72->AddNode(gGeoManager->GetVolume("BIH172"), 1, new TGeoTranslation(0., 0., 2.75));
623 asBI72->AddNode(gGeoManager->GetVolume("BIH272"), 1, new TGeoTranslation(0., 0., -2.75));
7e5caa00 624
625// Web frame 0-degree
626//
83af9b47 627// h x w x s = 60x40x5
7e5caa00 628// (attention: element is are half bars, "U" shaped)
629//
83af9b47 630 Float_t dHz = 112.66;
4a8eca94 631
83af9b47 632 WebFrame("B063", dHz, 10.0, 10.);
633 WebFrame("B063I", dHz, 10.0, -10.);
4a8eca94 634
83af9b47 635 WebFrame("B163", dHz, -40.0, 10.);
636 WebFrame("B163I", dHz, -40.0, -10.);
4a8eca94 637
83af9b47 638 WebFrame("B263", dHz, 20.0, 10.);
639 WebFrame("B263I", dHz, 20.0, -10.);
4a8eca94 640
83af9b47 641 WebFrame("B363", dHz, -27.1, 10.);
642 WebFrame("B363I", dHz, -27.1, -10.);
4a8eca94 643
83af9b47 644 WebFrame("B463", dHz, 18.4, 10.);
645 WebFrame("B463I", dHz, 18.4, -10.);
7e5caa00 646
647
648 dz = -iFrH/2.+ringH/2.+kEps;
83af9b47 649 Float_t dz0 = 3.;
650 Float_t dx0 = 49.8 + dHz/2. * TMath::Tan(10. * kdeg2rad) + 0.035;
7e5caa00 651
bb92d81d 652 for (jmod = 0; jmod< 18; jmod++)
7e5caa00 653 {
654// ring bars
bb92d81d 655 for (i = 0; i < 3; i++) {
83af9b47 656 // if ((i == 2) || (jmod ==0) || (jmod == 8)) {
657 if (i == 2) {
bb92d81d 658 gMC->Gspos("B072", 6*jmod+i+1, module[jmod], 0, dymodL[i], dz, 0, "ONLY");
659 gMC->Gspos("B072", 6*jmod+i+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");
83af9b47 660 } else {
661 TGeoVolume* vol = gGeoManager->GetVolume(module[jmod]);
662 vol->AddNode(asBI72, 6*jmod+i+1, new TGeoTranslation(0, dymodL[i], dz));
663 vol->AddNode(asBI72, 6*jmod+i+4, new TGeoTranslation(0, -dymodL[i], dz));
664 }
7e5caa00 665 }
666 }
667
668// outer diagonal web
669
83af9b47 670 dy = dymodL[0] + (dHz/2. - 4.) * TMath::Tan(10. * kdeg2rad);
c2beaf42 671
d84d0b8c 672 for (jmod = 0; jmod < 18; jmod++) {
83af9b47 673 gMC->Gspos("B063", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2086], "ONLY");
674 gMC->Gspos("B063I", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2087], "ONLY");
675 gMC->Gspos("B063", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
676 gMC->Gspos("B063I", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
4a8eca94 677 }
678
83af9b47 679 dy = 73.6 + (dHz/2. + 4.) * TMath::Tan(40. * kdeg2rad);
680
d84d0b8c 681 for (jmod = 0; jmod < 18; jmod++) {
83af9b47 682 gMC->Gspos("B163", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2086], "ONLY");
683 gMC->Gspos("B163I", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2087], "ONLY");
684 gMC->Gspos("B163", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
685 gMC->Gspos("B163I", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
4a8eca94 686 }
687
83af9b47 688 dy = 224.5 - (dHz/2 + 4.) * TMath::Tan(20. * kdeg2rad);
4a8eca94 689
83af9b47 690 for (jmod = 0; jmod < 18; jmod++) {
691 gMC->Gspos("B263", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2086], "ONLY");
692 gMC->Gspos("B263I", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2087], "ONLY");
693 gMC->Gspos("B263", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
694 gMC->Gspos("B263I", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
7e5caa00 695 }
7e5caa00 696
83af9b47 697 dy = 231.4 + (dHz/2.+ 4.) * TMath::Tan(27.1 * kdeg2rad);
7e5caa00 698
83af9b47 699 for (jmod = 0; jmod < 18; jmod++) {
700 gMC->Gspos("B363", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2086], "ONLY");
701 gMC->Gspos("B363I", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2087], "ONLY");
702 gMC->Gspos("B363", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
703 gMC->Gspos("B363I", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
704 }
705
706 dy = 340.2 - (dHz/2.+ 4.) * TMath::Tan(18.4 * kdeg2rad);
707
708 for (jmod = 0; jmod < 18; jmod++) {
709 gMC->Gspos("B463", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2086], "ONLY");
710 gMC->Gspos("B463I", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2087], "ONLY");
711 gMC->Gspos("B463", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
712 gMC->Gspos("B463I", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
7e5caa00 713 }
714
715// longitudinal bars (TPC rails attached)
716// new specs:
717// h x w x s = 100 x 75 x 6
718// current:
719// Attention: 2 "U" shaped half rods per cell
720//
721// not yet used
722//
723 ptrap[0] = 2.50;
724 ptrap[1] = 10.00;
725 ptrap[2] = 0.00;
726 ptrap[3] = 350.00;
727 ptrap[4] = 3.75;
728 ptrap[5] = ptrap[4];
729 ptrap[6] = 0;
730 ptrap[7] = ptrap[3];
731 ptrap[8] = ptrap[4];
732 ptrap[9] = ptrap[4];
733 ptrap[10] = 0;
f935f49e 734// gMC->Gsvolu("B059", "TRAP", kSteel, ptrap, 11);
7e5caa00 735 ptrap[0] = 2.2;
736 ptrap[4] = 2.15;
737 ptrap[5] = ptrap[4];
738 ptrap[7] = ptrap[3];
739 ptrap[8] = ptrap[4];
740 ptrap[9] = ptrap[4];
f935f49e 741 //gMC->Gsvolu("B062", "TRAP", kAir, ptrap, 11);
742 //gMC->Gspos("B062", 1, "B059", 0.0, 0., 0., 0, "ONLY");
743
7e5caa00 744//
745// longitudinal bars (no TPC rails attached)
83af9b47 746// new specs: h x w x s = 40 x 60 x 5
7e5caa00 747//
748//
749//
750 ptrap[0] = longW/4.;
751 ptrap[4] = longH/2.;
752 ptrap[5] = ptrap[4];
753 ptrap[7] = ptrap[3];
754 ptrap[8] = ptrap[4];
755 ptrap[9] = ptrap[4];
756
757 gMC->Gsvolu("BA59", "TRAP", kSteel, ptrap, 11);
83af9b47 758 ptrap[0] = longW/4.-0.25;
759 ptrap[4] = longH/2.-0.50;
7e5caa00 760 ptrap[5] = ptrap[4];
761 ptrap[7] = ptrap[3];
762 ptrap[8] = ptrap[4];
763 ptrap[9] = ptrap[4];
764 gMC->Gsvolu("BA62", "TRAP", kAir, ptrap, 11);
765 gMC->Gspos("BA62", 1, "BA59", 0.0, 0.0, -0.15, 0, "ONLY");
766
c2beaf42 767 dz = -iFrH/2. + longH/2.;
7e5caa00 768
d84d0b8c 769 for (jmod = 0; jmod < 18; jmod++) {
c2beaf42 770 gMC->Gspos("BA59", 2*jmod+1, module[jmod], 49.31, 0.0, dz, idrotm[2084], "ONLY");
771 gMC->Gspos("BA59", 2*jmod+2, module[jmod], -49.31, 0.0, dz, idrotm[2083], "ONLY");
7e5caa00 772 }
25918453 773
774
7e5caa00 775//
25918453 776// Thermal shield
7e5caa00 777//
e6add757 778
83af9b47 779 Float_t dyM = 99.0;
25918453 780 MakeHeatScreen("M", dyM, idrotm[2090], idrotm[2091]);
83af9b47 781 Float_t dyAM = 119.5;
25918453 782 MakeHeatScreen("AM", dyAM, idrotm[2090], idrotm[2091]);
83af9b47 783 Float_t dyA = 122.5 - 5.5;
25918453 784 MakeHeatScreen("A" , dyA, idrotm[2090], idrotm[2091]);
e6add757 785
25918453 786//
787//
788//
23cb15ef 789 dz = -57.2 + 0.6;
25918453 790 for (i = 0; i < 18; i++) {
791
792 char nameMo[16];
793 sprintf(nameMo, "BSEGMO%d",i);
794 // M
795 gMC->Gspos("BTSH_M" , i+1 , nameMo, 0., 0., dz, 0, "ONLY");
796 // AM, CM
83af9b47 797 dy = dymodL[0] + dyAM / 2. + 3.;
25918453 798 gMC->Gspos("BTSH_AM", i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
799 gMC->Gspos("BTSH_AM", i+19, nameMo, 0., -dy, dz, 0, "ONLY");
800 // A, C
83af9b47 801 dy = dymodL[1] + dyA / 2 + 0.4;
25918453 802 gMC->Gspos("BTSH_A" , i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
803 gMC->Gspos("BTSH_A" , i+19, nameMo, 0., -dy, dz, 0, "ONLY");
804}
805
e6add757 806
774c288e 807 //
808 // TRD mother volumes
809 //
d84d0b8c 810
a621ccf6 811 ptrd1[0] = 47.4405; // CBL 28/6/2006
812 ptrd1[1] = 61.1765; // CBL
813 ptrd1[2] = 375.5; // CBL
814 ptrd1[3] = 38.95; // CBL
815
d84d0b8c 816 for (i = 0; i < 18; i++) {
8ce41745 817 char nameCh[16];
d84d0b8c 818 sprintf(nameCh, "BTRD%d",i);
8ce41745 819 char nameMo[16];
d84d0b8c 820 sprintf(nameMo, "BSEGMO%d",i);
821 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
bb92d81d 822 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
c2beaf42 823 gMC->Gspos(nameCh, 1, nameMo, 0., 0., -12.62, 0, "ONLY"); // CBL 28/6/2006
d84d0b8c 824 }
4c057bc8 825
774c288e 826//
827// TOF mother volumes
828//
e2dab6e6 829 ptrd1[0] = 62.2500;
830 ptrd1[1] = 67.3631;
831 ptrd1[2] = 373.6;
a009d497 832 ptrd1[3] = 14.525; //AdC
d84d0b8c 833 for (i = 0; i < 18; i++) {
8ce41745 834 char nameCh[16];
d84d0b8c 835 sprintf(nameCh, "BTOF%d",i);
8ce41745 836 char nameMo[16];
d84d0b8c 837 sprintf(nameMo, "BSEGMO%d",i);
838 gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
bb92d81d 839 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
a009d497 840 gMC->Gspos(nameCh, 1, nameMo, 0., 0., 43.525, 0, "ONLY"); //AdC
d84d0b8c 841 }
d3507e34 842
b35d7d26 843//
844// Geometry of Rails starts here
845//
846//
847//
848// Rails for space-frame
849//
850 Float_t rbox[3];
851
852 rbox[0] = 25.00;
853 rbox[1] = 27.50;
854 rbox[2] = 600.00;
855 gMC->Gsvolu("BRS1", "BOX", kAir, rbox, 3);
856
857 rbox[0] = 25.00;
858 rbox[1] = 3.75;
859 gMC->Gsvolu("BRS2", "BOX", kSteel, rbox, 3);
860
861 rbox[0] = 3.00;
862 rbox[1] = 20.00;
863 gMC->Gsvolu("BRS3", "BOX", kSteel, rbox, 3);
864
865 gMC->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
866 gMC->Gspos("BRS2", 2, "BRS1", 0., 27.5-3.75, 0., 0, "ONLY");
867 gMC->Gspos("BRS3", 1, "BRS1", 0., 0., 0., 0, "ONLY");
85227d20 868 gMC->Gspos("BRS1", 1, "ALIC", -430.-3., -190., 0., 0, "ONLY");
869 gMC->Gspos("BRS1", 2, "ALIC", 430.+3., -190., 0., 0, "ONLY");
b35d7d26 870
871 rbox[0] = 3.0;
85227d20 872 rbox[1] = 145./4.;
b35d7d26 873 rbox[2] = 25.0;
874 gMC->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
875
85227d20 876 gMC->Gspos("BRS4", 1, "ALIC", 430.+3., -190.+55./2.+rbox[1], 224., 0, "ONLY");
877 gMC->Gspos("BRS4", 2, "ALIC", 430.+3., -190.+55./2.+rbox[1], -224., 0, "ONLY");
878// gMC->Gspos("BRS4", 3, "ALIC", -430.+3, -180.+55./2.+rbox[1], 224., 0, "ONLY");
879// gMC->Gspos("BRS4", 4, "ALIC", -430.+3, -180.+55./2.+rbox[1], -224., 0, "ONLY");
b35d7d26 880
f2744db7 881
882
883 //
884 // The Backframe
885 //
886 // Inner radius
887 Float_t kBFMRin = 270.0;
888 // Outer Radius
889 Float_t kBFMRou = 417.5;
890 // Width
891 Float_t kBFMdz = 118.0;
892 //
893 //
894 // Rings
895 Float_t kBFRdr = 7.5;
896 Float_t kBFRdz = 8.0;
897 //
898 //
899 // Bars and Spokes
900 //
901 Float_t kBFBd = 8.0;
902 Float_t kBFBdd = 0.6;
903
904
905 // The Mother volume
906 Float_t tpar[3];
907 tpar[0] = kBFMRin;
908 tpar[1] = kBFMRou;
909 tpar[2] = kBFMdz / 2.;
910 gMC->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);
7eb5db32 911
912 // CBL ////////////////////////////////////////////////////////
913 //
914 // TRD mother volume
915 //
916
282734ac 917 ptrd1[0] = 47.4405 - 0.3;
918 ptrd1[1] = 61.1765 - 0.3;
7eb5db32 919 ptrd1[2] = kBFMdz / 2.;
920 ptrd1[3] = 38.95;
921 gMC->Gsvolu("BFTRD", "TRD1", kAir, ptrd1, 4);
922 gGeoManager->GetVolume("BFTRD")->SetVisibility(kFALSE);
923
8465fe4c 924 for (i = 0; i < 18; i++) {
7eb5db32 925
926 Float_t phiBF = i * 20.0;
927 dx = TMath::Sin(phiBF*kdeg2rad)*(342.0-12.62);
928 dy = -TMath::Cos(phiBF*kdeg2rad)*(342.0-12.62);
929 gMC->Gspos("BFTRD",i,"BFMO",dx,dy,0.0,idrotm[2034+i],"ONLY");
930
931 }
932
933 // CBL ////////////////////////////////////////////////////////
f2744db7 934
935 // Rings
936 //
937 // Inner Ring
938 tpar[0] = kBFMRin;
939 tpar[1] = tpar[0] + kBFRdr;
940 tpar[2] = kBFRdz / 2.;
941
942 gMC->Gsvolu("BFIR", "TUBE", kSteel, tpar, 3);
943
944 tpar[0] = tpar[0] + kBFBdd;
945 tpar[1] = tpar[1] - kBFBdd;
946 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
947
948 gMC->Gsvolu("BFII", "TUBE", kAir, tpar, 3);
949 gMC->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");
950
f2744db7 951 //
952 // Outer RING
1cae56d7 953 tpar[0] = kBFMRou - kBFRdr + 0.1;
f2744db7 954 tpar[1] = kBFMRou;
955 tpar[2] = kBFRdz / 2.;
956
957 gMC->Gsvolu("BFOR", "TUBE", kSteel, tpar, 3);
958
959 tpar[0] = tpar[0] + kBFBdd;
960 tpar[1] = tpar[1] - kBFBdd;
961 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
962
963 gMC->Gsvolu("BFOO", "TUBE", kAir, tpar, 3);
964 gMC->Gspos("BFOO", 1, "BFOR", 0., 0., 0., 0, "ONLY");
965
966
967 dz = kBFMdz/2. - kBFRdz / 2.;
968 gMC->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
969 gMC->Gspos("BFIR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
970 gMC->Gspos("BFOR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
971 gMC->Gspos("BFOR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
972
973 //
974 // Longitudinal Bars
975 //
976 Float_t bpar[3];
977
978 bpar[0] = kBFBd/2;
979 bpar[1] = bpar[0];
980 bpar[2] = kBFMdz/2. - kBFBd;
981 gMC->Gsvolu("BFLB", "BOX ", kSteel, bpar, 3);
982
983 bpar[0] = bpar[0] - kBFBdd;
984 bpar[1] = bpar[1] - kBFBdd;
985 bpar[2] = bpar[2] - kBFBdd;
986 gMC->Gsvolu("BFLL", "BOX ", kAir, bpar, 3);
987 gMC->Gspos("BFLL", 1, "BFLB", 0., 0., 0., 0, "ONLY");
988
989 for (i = 0; i < 18; i++)
990 {
7fc57eb6 991 Float_t ro = kBFMRou - kBFBd / 2. - 0.02;
f2744db7 992 Float_t ri = kBFMRin + kBFBd / 2.;
993
3b7df2c4 994 Float_t phi0 = Float_t(i) * 20.;
f2744db7 995
3b7df2c4 996 Float_t xb = ri * TMath::Cos(phi0 * kDegrad);
997 Float_t yb = ri * TMath::Sin(phi0 * kDegrad);
998 AliMatrix(idrotm[2090+i], 90.0, phi0, 90.0, phi0 + 270., 0., 0.);
f2744db7 999
3b7df2c4 1000 gMC->Gspos("BFLB", i + 1, "BFMO", xb, yb, 0., idrotm[2090 + i], "ONLY");
f2744db7 1001
3b7df2c4 1002 xb = ro * TMath::Cos(phi0 * kDegrad);
1003 yb = ro * TMath::Sin(phi0 * kDegrad);
f2744db7 1004
3b7df2c4 1005 gMC->Gspos("BFLB", i + 19, "BFMO", xb, yb, 0., idrotm[2090 +i], "ONLY");
f2744db7 1006 }
1007
1008 //
1009 // Radial Bars
1010 //
1011 bpar[0] = (kBFMRou - kBFMRin - 2. * kBFRdr) / 2.;
1012 bpar[1] = kBFBd/2;
1013 bpar[2] = bpar[1];
1014 //
1015 // Avoid overlap with circle
1016 Float_t rr = kBFMRou - kBFRdr;
1017 Float_t delta = rr - TMath::Sqrt(rr * rr - kBFBd * kBFBd / 4.) + 0.01;
1018 bpar[0] -= delta /2.;
1019
1020
1021 gMC->Gsvolu("BFRB", "BOX ", kSteel, bpar, 3);
1022
1023 bpar[0] = bpar[0] - kBFBdd;
1024 bpar[1] = bpar[1] - kBFBdd;
1025 bpar[2] = bpar[2] - kBFBdd;
1026 gMC->Gsvolu("BFRR", "BOX ", kAir, bpar, 3);
1027 gMC->Gspos("BFRR", 1, "BFRB", 0., 0., 0., 0, "ONLY");
1028
1029 Int_t iphi[10] = {0, 1, 3, 6, 8, 9, 10, 12, 15, 17};
1030
1031 for (i = 0; i < 10; i++)
1032 {
1033
3b7df2c4 1034 Float_t rb = (kBFMRin + kBFMRou)/2.;
e99f0660 1035 Float_t phib = Float_t(iphi[i]) * 20.;
f2744db7 1036
e99f0660 1037 Float_t xb = rb * TMath::Cos(phib * kDegrad);
1038 Float_t yb = rb * TMath::Sin(phib * kDegrad);
f2744db7 1039
3b7df2c4 1040 gMC->Gspos("BFRB", i + 1, "BFMO", xb, yb, dz, idrotm[2034 + iphi[i]], "ONLY");
1041 gMC->Gspos("BFRB", i + 11, "BFMO", xb, yb, -dz, idrotm[2034 + iphi[i]], "ONLY");
f2744db7 1042
1043 }
1044
9cde95f3 1045 gMC->Gspos("BFMO", i + 19, "ALIC", 0, 0, - 376. - kBFMdz/2. - 0.5 , 0, "ONLY");
f2744db7 1046
1047
1048
b35d7d26 1049//
f2744db7 1050//
1051// The Baby Frame
1052//
1053//
1054 //
1055 // Inner radius
1056 Float_t kBBMRin = 278.0;
1057 // Outer Radius
1058 Float_t kBBMRou = 410.5;
1059 // Width
1060 Float_t kBBMdz = 223.0;
1061 Float_t kBBBdz = 6.0;
1062 Float_t kBBBdd = 0.6;
1063
b35d7d26 1064
f2744db7 1065 // The Mother volume
1066
1067 ppgon[0] = 0.;
1068 ppgon[1] = 360.;
1069 ppgon[2] = 18.;
b35d7d26 1070
f2744db7 1071 ppgon[3] = 2.;
1072 ppgon[4] = -kBBMdz / 2. ;
1073 ppgon[5] = kBBMRin;
1074 ppgon[6] = kBBMRou;
1075
1076 ppgon[7] = -ppgon[4];
1077 ppgon[8] = ppgon[5];
1078 ppgon[9] = ppgon[6];
1079
1080 gMC->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
1081 gMC->Gsdvn("BBCE", "BBMO", 18, 2);
1082
7eb5db32 1083 // CBL ////////////////////////////////////////////////////////
1084 //
1085 // TRD mother volume
1086 //
1087
1088 AliMatrix(idrotm[2092], 90.0, 90.0, 0.0, 0.0, 90.0, 0.0);
1089
1090 ptrd1[0] = 47.4405 - 2.5;
1091 ptrd1[1] = 61.1765 - 2.5;
1092 ptrd1[2] = kBBMdz / 2.;
1093 ptrd1[3] = 38.95;
1094 gMC->Gsvolu("BBTRD", "TRD1", kAir, ptrd1, 4);
1095 gGeoManager->GetVolume("BBTRD")->SetVisibility(kFALSE);
1096 gMC->Gspos("BBTRD", 1, "BBCE", 342.0-12.62, 0.0, 0.0, idrotm[2092], "ONLY");
1097
1098 // CBL ////////////////////////////////////////////////////////
1099
f2744db7 1100 // Longitudinal bars
1101 bpar[0] = kBBBdz/2.;
1102 bpar[1] = bpar[0];
1103 bpar[2] = kBBMdz/2. - kBBBdz;
1104 gMC->Gsvolu("BBLB", "BOX ", kSteel, bpar, 3);
1105 bpar[0] -= kBBBdd;
1106 bpar[1] -= kBBBdd;
1107 bpar[2] -= kBBBdd;
1108 gMC->Gsvolu("BBLL", "BOX ", kAir, bpar, 3);
1109 gMC->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY");
1110
65cb363f 1111 dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1112 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1113 gMC->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1114
65cb363f 1115 dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
f2744db7 1116 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1117
1118 gMC->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1119
1120 //
1121 // Radial Bars
1122 //
1123 bpar[0] = (kBBMRou - kBBMRin) / 2. - kBBBdz;
1124 bpar[1] = kBBBdz/2;
1125 bpar[2] = bpar[1];
1126
1127 gMC->Gsvolu("BBRB", "BOX ", kSteel, bpar, 3);
1128 bpar[0] -= kBBBdd;
1129 bpar[1] -= kBBBdd;
1130 bpar[2] -= kBBBdd;
1131 gMC->Gsvolu("BBRR", "BOX ", kAir, bpar, 3);
1132 gMC->Gspos("BBRR", 1, "BBRB", 0., 0., 0., 0, "ONLY");
1133
1134
1135 dx = (kBBMRou + kBBMRin) / 2.;
1136 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1137 dz = kBBMdz/2. - kBBBdz / 2.;
1138
1139 gMC->Gspos("BBRB", 1, "BBCE", dx, dy, dz, idrotm[2052], "ONLY");
1140 gMC->Gspos("BBRB", 2, "BBCE", dx, dy, - dz, idrotm[2052], "ONLY");
1141 gMC->Gspos("BBRB", 3, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1142
1143 //
1144 // Circular bars
1145 //
1146 // Inner
1147
1148 bpar[1] = kBBMRin * TMath::Sin(10. * kDegrad);
1149 bpar[0] = kBBBdz/2;
1150 bpar[2] = bpar[0];
1151 gMC->Gsvolu("BBC1", "BOX ", kSteel, bpar, 3);
1152 bpar[0] -= kBBBdd;
1153 bpar[1] -= kBBBdd;
1154 bpar[2] -= kBBBdd;
1155 gMC->Gsvolu("BBC2", "BOX ", kAir, bpar, 3);
1156 gMC->Gspos("BBC2", 1, "BBC1", 0., 0., 0., 0, "ONLY");
1157 dx = kBBMRin + kBBBdz/2;
1158 dy = 0.;
1159 gMC->Gspos("BBC1", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1160 gMC->Gspos("BBC1", 2, "BBCE", dx, dy, -dz, 0, "ONLY");
1161 //
1162 // Outer
1163 bpar[1] = (kBBMRou - kBBBdz) * TMath::Sin(10. * kDegrad);
1164 bpar[0] = kBBBdz/2;
1165 bpar[2] = bpar[0];
1166 gMC->Gsvolu("BBC3", "BOX ", kSteel, bpar, 3);
1167 bpar[0] -= kBBBdd;
1168 bpar[1] -= kBBBdd;
1169 bpar[2] -= kBBBdd;
1170 gMC->Gsvolu("BBC4", "BOX ", kAir, bpar, 3);
1171 gMC->Gspos("BBC4", 1, "BBC3", 0., 0., 0., 0, "ONLY");
1172 dx = kBBMRou - kBBBdz/2;
1173 dy = 0.;
1174 gMC->Gspos("BBC3", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1175 gMC->Gspos("BBC3", 2, "BBCE", dx, dy, - dz, 0, "ONLY");
1176 //
1177 // Diagonal Bars
1178 //
1179 h = (kBBMRou - kBBMRin - 2. * kBBBdz);;
1180 d = kBBBdz;
1181 dz = kBBMdz/2. - 1.6 * kBBBdz;
1182 dq = h*h+dz*dz;
1183
1184 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
1185
1186
1187 theta = kRaddeg * TMath::ACos(x);
1188
1189 ptrap[0] = dz/2.;
1190 ptrap[1] = theta;
1191 ptrap[2] = 0.;
1192 ptrap[3] = d/2;
1193 ptrap[4] = d/x/2;
1194 ptrap[5] = ptrap[4];
1195 ptrap[6] = 0;
1196 ptrap[7] = ptrap[3];
1197 ptrap[8] = ptrap[4];
1198 ptrap[9] = ptrap[4];
1199 ptrap[10] = 0;
1200 gMC->Gsvolu("BBD1", "TRAP", kSteel, ptrap, 11);
1201 ptrap[3] = d/2-kBBBdd;
1202 ptrap[4] = (d/2-kBBBdd)/x;
1203 ptrap[5] = ptrap[4];
1204 ptrap[7] = ptrap[3];
1205 ptrap[8] = ptrap[4];
1206 ptrap[9] = ptrap[4];
1207 gMC->Gsvolu("BBD3", "TRAP", kAir, ptrap, 11);
1208 gMC->Gspos("BBD3", 1, "BBD1", 0.0, 0.0, 0., 0, "ONLY");
1209 dx = (kBBMRou + kBBMRin) / 2.;
1210 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1211 gMC->Gspos("BBD1", 1, "BBCE", dx, dy, dz/2. + kBBBdz/2., idrotm[2052], "ONLY");
1212
1213
1214 ptrap[0] = dz/2.;
1215 ptrap[1] = -theta;
1216 ptrap[2] = 0.;
1217 ptrap[3] = d/2;
1218 ptrap[4] = d/2/x;
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("BBD2", "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("BBD4", "TRAP", kAir, ptrap, 11);
1233 gMC->Gspos("BBD4", 1, "BBD2", 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("BBD2", 1, "BBCE", dx, dy, -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");
1237
1238
9cde95f3 1239 gMC->Gspos("BBMO", 1, "ALIC", 0., 0., + 376. + kBBMdz / 2. + 0.5, 0, "ONLY");
f2744db7 1240
1241
7e5caa00 1242}
f2744db7 1243
2245ab3a 1244//___________________________________________
1245void AliFRAMEv2::AddAlignableVolumes() const
1246{
1247 // Add the 18 spaceframe sectors as alignable volumes
1248 TString basesymname("FRAME/Sector");
1249 TString basevolpath("ALIC_1/B077_1/BSEGMO");
1250 TString symname;
1251 TString volpath;
1252
1253 for(Int_t sec=0; sec<18; sec++)
1254 {
1255 symname = basesymname;
1256 symname += sec;
1257 volpath = basevolpath;
1258 volpath += sec;
1259 volpath += "_1";
1260 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1261 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
1262 symname.Data(),volpath.Data()));
1263 }
1264}
7e5caa00 1265
1266//___________________________________________
1267void AliFRAMEv2::CreateMaterials()
1268{
eeacf08b 1269 // Creates the materials
7e5caa00 1270 Float_t epsil, stemax, tmaxfd, deemax, stmin;
1271
1272 epsil = 1.e-4; // Tracking precision,
25918453 1273 stemax = -0.01; // Maximum displacement for multiple scat
1274 tmaxfd = -20.; // Maximum angle due to field deflection
1275 deemax = -.3; // Maximum fractional energy loss, DLS
7e5caa00 1276 stmin = -.8;
1277 Int_t isxfld = gAlice->Field()->Integ();
1278 Float_t sxmgmx = gAlice->Field()->Max();
002b3738 1279
1280
7e5caa00 1281 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1282 Float_t zsteel[4] = { 26.,24.,28.,14. };
1283 Float_t wsteel[4] = { .715,.18,.1,.005 };
6a894888 1284
1285 //Air
1286
1287 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1288 Float_t zAir[4]={6.,7.,8.,18.};
1289 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1290 Float_t dAir = 1.20479E-3;
7e5caa00 1291
1292 AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
002b3738 1293 AliMixture(5, "AIR$ ", aAir, zAir, dAir,4, wAir);
25918453 1294 AliMaterial(9, "ALU ", 26.98, 13., 2.7, 8.9, 37.2);
002b3738 1295
a260d998 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);
25918453 1298 AliMedium( 9, "Aluminum", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
a260d998 1299
7e5caa00 1300}
1301
1302//_____________________________________________________________________________
1303void AliFRAMEv2::Init()
1304{
1305 //
1306 // Initialise the module after the geometry has been defined
1307 //
4951e003 1308 if(AliLog::GetGlobalDebugLevel()>0) {
0a05c568 1309 printf("%s: **************************************"
1310 " FRAME "
1311 "**************************************\n",ClassName());
1312 printf("\n%s: Version 2 of FRAME initialised, symmetric FRAME\n\n",ClassName());
1313 printf("%s: **************************************"
1314 " FRAME "
1315 "**************************************\n",ClassName());
1316 }
55bdc695 1317//
1318// The reference volume id
83af9b47 1319 fRefVolumeId1 = gMC->VolId("BREF1");
1320 fRefVolumeId2 = gMC->VolId("BREF2");
7e5caa00 1321}
1322
6304e7d2 1323Int_t AliFRAMEv2::IsVersion() const
1324{
eeacf08b 1325 // Returns the version of the FRAME (1 if no holes, 0 otherwise)
6304e7d2 1326 Int_t version = 0;
1327 if (fHoles == 0) version = 1;
1328 return version;
1329}
7e5caa00 1330
55bdc695 1331void AliFRAMEv2::StepManager()
1332{
1333//
1334// Stepmanager of AliFRAMEv2.cxx
1335// Used for recording of reference tracks entering the spaceframe mother volume
1336//
1337 Int_t copy, id;
1338
1339 //
1340 // Only charged tracks
1341 if( !(gMC->TrackCharge()) ) return;
1342 //
1343 // Only tracks entering mother volume
1344 //
1345
1346 id=gMC->CurrentVolID(copy);
1347
83af9b47 1348 if ((id != fRefVolumeId1) && (id != fRefVolumeId2)) return;
55bdc695 1349 if(!gMC->IsTrackEntering()) return;
1350 //
1351 // Add the reference track
1352 //
e6add757 1353 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kFRAME);
55bdc695 1354}
7e5caa00 1355
55bdc695 1356
7e5caa00 1357
a6e0ebfe 1358void AliFRAMEv2::MakeHeatScreen(const char* name, Float_t dyP, Int_t rot1, Int_t rot2)
25918453 1359{
1360 // Heat screen panel
1361 //
1362 Int_t *idtmed = fIdtmed->GetArray()-1999;
1363 const Int_t kAir = idtmed[2004];
1364 const Int_t kAlu = idtmed[2008];
1365
1366 Float_t dx, dy;
1367 char mname [128];
1368 char cname [128];
1369 char t1name[128];
1370 char t2name[128];
1371 char t3name[128];
1372 char t4name[128];
1373 char t5name[128];
1374
1375 //
c2beaf42 1376 Float_t dxP = 2. * (287. * TMath::Sin(10.* TMath::Pi()/180.) - 2.);
23cb15ef 1377 Float_t dzP = 1.05;
25918453 1378 //
1379 // Mother volume
1380 Float_t thshM[3];
1381 thshM[0] = dxP / 2.;
1382 thshM[1] = dyP / 2.;
1383 thshM[2] = dzP / 2.;
1384 sprintf(mname, "BTSH_%s", name);
1385 gMC->Gsvolu(mname, "BOX ", kAir, thshM, 3);
1386 //
1387 // Aluminum sheet
23cb15ef 1388 thshM[2] = 0.025;
25918453 1389 sprintf(cname, "BTSHA_%s", name);
1390 gMC->Gsvolu(cname, "BOX ", kAlu, thshM, 3);
23cb15ef 1391 gMC->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
25918453 1392 //
1393 // Tubes
1394 Float_t thshT[3];
1395 thshT[0] = 0.4;
1396 thshT[1] = 0.5;
c2beaf42 1397 thshT[2] = (dyP / 2. - 8.);
25918453 1398 //
1399 sprintf(t1name, "BTSHT1_%s", name);
1400 gMC->Gsvolu(t1name, "TUBE", kAlu, thshT, 3);
c2beaf42 1401 dx = - dxP / 2. + 8. - 0.5;
7fc57eb6 1402 gMC->Gspos(t1name, 1, mname, dx, 0., 0.025, rot1);
25918453 1403 //
1404 sprintf(t2name, "BTSHT2_%s", name);
1405 sprintf(t3name, "BTSHT3_%s", name);
1406 sprintf(t4name, "BTSHT4_%s", name);
1407 sprintf(t5name, "BTSHT5_%s", name);
1408 thshT[2] = (thshM[1] - 12.);
1409 gMC->Gsvolu(t2name, "TUBE", kAlu, thshT, 3);
1410 thshT[2] = 7.9/2.;
1411 gMC->Gsvolu(t3name, "TUBE", kAlu, thshT, 3);
1412 thshT[2] = 23.9/2.;
1413 gMC->Gsvolu(t4name, "TUBE", kAlu, thshT, 3);
25918453 1414
1415 Int_t sig = 1;
1416 Int_t ipo = 1;
1417 for (Int_t i = 0; i < 5; i++) {
1418 sig *= -1;
1419 dx += 8.00;
1420 dy = 4. * sig;
1421 Float_t dy1 = - (thshM[1] - 15.5) * sig;
1422 Float_t dy2 = - (thshM[1] - 7.5) * sig;
1423
7fc57eb6 1424 gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
25918453 1425 dx += 6.9;
7fc57eb6 1426 gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
25918453 1427
7fc57eb6 1428 gMC->Gspos(t3name, i+1, mname, dx - 3.45, dy1, 0.025, rot2);
1429 gMC->Gspos(t4name, i+1, mname, dx - 3.45, dy2, 0.025, rot2);
25918453 1430 }
c2beaf42 1431 dx += 8.;
7fc57eb6 1432 gMC->Gspos(t1name, 2, mname, dx, 0., 0.025, rot1);
1433 gMC->Gspos(t3name, 6, mname, dx - 3.45, -(thshM[1] - 7.5), 0.025, rot2);
25918453 1434}
7e5caa00 1435
1436
1437
a6e0ebfe 1438void AliFRAMEv2::WebFrame(const char* name, Float_t dHz, Float_t theta0, Float_t phi0)
83af9b47 1439{
1440 //
1441 // Create a web frame element
1442 //
1443 Int_t *idtmed = fIdtmed->GetArray()-1999;
1444 const Float_t krad2deg = 180. / TMath::Pi();
1445 const Float_t kdeg2rad = 1. / krad2deg;
1446 const Int_t kAir = idtmed[2004];
1447 const Int_t kSteel = idtmed[2064];
1448
1449 Float_t ptrap[11];
1450 char nameA[64];
1451 sprintf(nameA, "%sA", name );
1452 theta0 *= kdeg2rad;
1453 phi0 *= kdeg2rad;
1454 Float_t theta = TMath::ATan(TMath::Tan(theta0)/TMath::Sin(phi0));
1455 Float_t phi = TMath::ACos(TMath::Cos(theta0) * TMath::Cos(phi0));
1456 if (phi0 < 0) phi = -phi;
1457
1458 phi *= krad2deg;
1459 theta *= krad2deg;
1460
1461 ptrap[0] = dHz/2;
1462 ptrap[2] = theta;
1463 ptrap[1] = phi;
1464 ptrap[3] = 6./cos(theta0 * kdeg2rad)/2.;
1465 ptrap[4] = 1.;
1466 ptrap[5] = ptrap[4];
1467 ptrap[6] = 0;
1468 ptrap[7] = ptrap[3];
1469 ptrap[8] = ptrap[4];
1470 ptrap[9] = ptrap[4];
1471 ptrap[10] = 0;
1472 gMC->Gsvolu(name, "TRAP", kSteel, ptrap, 11);
1473 ptrap[3] = (6. - 1.)/cos(theta0 * kdeg2rad)/2.;
1474 ptrap[4] = 0.75;
1475 ptrap[5] = ptrap[4];
1476 ptrap[7] = ptrap[3];
1477 ptrap[8] = ptrap[4];
1478 ptrap[9] = ptrap[4];
1479
1480 gMC->Gsvolu(nameA, "TRAP", kAir, ptrap, 11);
1481 gMC->Gspos(nameA, 1, name, 0.0, -0.25, 0., 0, "ONLY");
1482 gGeoManager->GetVolume(name)->SetVisibility(1);
1483}
1484