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