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