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