Mixed TRU and SM phi size
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv3.cxx
CommitLineData
b9c35690 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18//------------------------------------------------------------------------
19// AliFRAMEv3.cxx
20// symmetric space frame with possibility for holes
21// Author: A.Morsch
22//------------------------------------------------------------------------
23
24#include <TGeoBBox.h>
87829bcb 25#include <TGeoXtru.h>
b9c35690 26#include <TGeoCompositeShape.h>
27#include <TGeoGlobalMagField.h>
28#include <TGeoManager.h>
29#include <TGeoMatrix.h>
30#include <TGeoPgon.h>
dd028c53 31#include <TGeoTrd1.h>
32#include <TGeoBBox.h>
33#include <TGeoMedium.h>
34#include <TGeoBoolNode.h>
35#include <TGeoCompositeShape.h>
b9c35690 36#include <TString.h>
37#include <TSystem.h>
38#include <TVirtualMC.h>
39
40#include "AliFRAMEv3.h"
41#include "AliMagF.h"
42#include "AliRun.h"
43#include "AliConst.h"
44#include "AliMC.h"
45#include "AliLog.h"
46#include "AliTrackReference.h"
47
48
dd028c53 49
b9c35690 50
51ClassImp(AliFRAMEv3)
52
53
54//_____________________________________________________________________________
55 AliFRAMEv3::AliFRAMEv3():
56 fHoles(0)
57{
58// Constructor
59}
60
61//_____________________________________________________________________________
62AliFRAMEv3::AliFRAMEv3(const char *name, const char *title)
63 : AliFRAME(name,title),
64 fHoles(0)
65{
66// Constructor
67}
68
69//___________________________________________
70void AliFRAMEv3::CreateGeometry()
71{
72//Begin_Html
73/*
74<img src="picts/frame.gif">
75*/
76//End_Html
77
78
79//Begin_Html
80/*
81<img src="picts/tree_frame.gif">
82*/
83//End_Html
84
85 Int_t idrotm[2299];
86
87
88
89 AliMatrix(idrotm[2070], 90.0, 0.0, 90.0, 270.0, 0.0, 0.0);
90//
91 AliMatrix(idrotm[2083], 170.0, 0.0, 90.0, 90.0, 80.0, 0.0);
92 AliMatrix(idrotm[2084], 170.0, 180.0, 90.0, 90.0, 80.0, 180.0);
93 AliMatrix(idrotm[2085], 90.0, 180.0, 90.0, 90.0, 0.0, 0.0);
94//
95 AliMatrix(idrotm[2086], 80.0, 0.0, 90.0, 90., -10.0, 0.0);
96 AliMatrix(idrotm[2096], 100.0, 0.0, 90.0, 90., 10.0, 0.0);
97//
98 AliMatrix(idrotm[2087], -100.0, 0.0, 90.0, 270., -10.0, 0.0);
99 AliMatrix(idrotm[2097], -80.0, 0.0, 90.0, 270., 10.0, 0.0);
87829bcb 100
b9c35690 101//
dd028c53 102 AliMatrix(idrotm[2088], 90.0, 180.0, 90.0, 270., 0.0, 0.0);
103 AliMatrix(idrotm[2089], 90.0, -90.0, 90.0, 0., 0.0, 0.0);
b9c35690 104//
105 AliMatrix(idrotm[2090], 90.0, 0.0, 0.0, 0., 90.0, 90.0);
106 AliMatrix(idrotm[2091], 0.0, 0.0, 90.0, 90., 90.0, 0.0);
107//
108// Matrices have been imported from Euclid. Some simplification
109// seems possible
110//
111
112 AliMatrix(idrotm[2003], 0.0, 0.0, 90.0, 130.0, 90.0, 40.0);
113 AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0, 40.0);
114 AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
115 AliMatrix(idrotm[2006], 0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
116 AliMatrix(idrotm[2007], 0.0, 0.0, 90.0, 170.0, 90.0, 80.0);
117 AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
118 AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0, 80.0);
119 AliMatrix(idrotm[2010], 0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
120 AliMatrix(idrotm[2011], 0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
121 AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
122 AliMatrix(idrotm[2013], 180.0, 0.0, 90.0, 10.0, 90.0, 100.0);
123 AliMatrix(idrotm[2014], 0.0, 0.0, 90.0, 10.0, 90.0, 100.0);
124 AliMatrix(idrotm[2015], 0.0, 0.0, 90.0, 30.0, 90.0, 300.0);
125 AliMatrix(idrotm[2016], 180.0, 0.0, 90.0, 30.0, 90.0, 300.0);
126 AliMatrix(idrotm[2017], 180.0, 0.0, 90.0, 50.0, 90.0, 140.0);
127 AliMatrix(idrotm[2018], 0.0, 0.0, 90.0, 50.0, 90.0, 140.0);
128
129 AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
130 AliMatrix(idrotm[2020], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
131 AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
132 AliMatrix(idrotm[2022], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
133 AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
134 AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
135 AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
136 AliMatrix(idrotm[2026], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
137
138 AliMatrix(idrotm[2027], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
139 AliMatrix(idrotm[2028], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0);
140 AliMatrix(idrotm[2029], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
141 AliMatrix(idrotm[2030], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
142 AliMatrix(idrotm[2031], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
143 AliMatrix(idrotm[2032], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
144 AliMatrix(idrotm[2033], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
145
146
147 Int_t *idtmed = fIdtmed->GetArray()-1999;
148//
dd028c53 149// The Main Space Frame
150// ALIP2A__0007
151// ALIP2A__0008
b9c35690 152//
153 Float_t pbox[3], ptrap[11], ptrd1[4], ppgon[10];
b9c35690 154 Float_t dx, dy, dz;
dd028c53 155 Int_t i, j;
156 Int_t jmod = 0;
b9c35690 157//
158// Constants
87829bcb 159//
160 // Materials
dd028c53 161 const TGeoMedium* kMedAir = gGeoManager->GetMedium("FRAME_Air");
b9c35690 162 const Int_t kAir = idtmed[2004];
163 const Int_t kSteel = idtmed[2064];
a9bfe689 164 const Int_t kAlu = idtmed[2008];
165 const Int_t kG10 = idtmed[2021];
87829bcb 166 // Angles
167 const Float_t kEps = 0.01;
b9c35690 168 const Float_t krad2deg = 180. / TMath::Pi();
169 const Float_t kdeg2rad = 1. / krad2deg;
170 const Float_t sin10 = TMath::Sin(10. * kdeg2rad);
87829bcb 171 const Float_t sin20 = TMath::Sin(20. * kdeg2rad);
b9c35690 172 const Float_t tan10 = TMath::Tan(10. * kdeg2rad);
173 const Float_t cos10 = TMath::Cos(10. * kdeg2rad);
87829bcb 174 // Dimensions
dd028c53 175 // vertical distance of frame wrt to origin (center of inner rings)
176 const Float_t hR = 286.00;
177 // Height of inner frame from lower edge to outer ring (sectors for detectors)
178 const Float_t iFrH = 119.00;
179 //
180 // radial length of web frame elements
48f13d0e 181 const Float_t dHz = 113./cos10 - 0.3; // 114.74 (114.5 on drawing)
dd028c53 182 // Positions of ring bars (ALIP2A_0008)
b9c35690 183 // outer
184 const Float_t dymodU[3] = {71.5, 228.5, 339.5};
185 // inner
186 const Float_t dymodL[3] = {50.0, 175.0, 297.5};
87829bcb 187 //
b9c35690 188 // orientation of web frame elements
189 const Float_t dymodO[5] = {10., -40., 20., -27.1, 18.4};
190 // Position of web frame elements
191 Float_t dymodW[5] = {70., 73.6, 224.5, 231.4, 340.2};
192 for (Int_t ii = 0; ii < 5; ii++) {
193 dymodW[ii] = dymodW[ii]-3.*TMath::Tan(dymodO[ii]*kdeg2rad);
194 }
dd028c53 195 // Inner ring bars (Pos 6)
196 const Float_t ringH = 6.00; // Hight
197 const Float_t ringW = 10.00; // Width of the ring bars in z
198 const Float_t ringT = 1.00; // Thickness of bars
b9c35690 199 // inner longitudinal bars 4 x 6
dd028c53 200 const Float_t longH = 6.00; // Height
201 const Float_t longW = 4.00; // Width
b9c35690 202 // outer longitudianl bars 8 x 8
203 const Float_t longOD = 8.0;
dd028c53 204 // some extra space for mother volume
205 const Float_t dext = sin10 * longW/2.+0.01;
206 // sector hight with extra space
207 const Float_t iFrH0 = iFrH + dext;
b9c35690 208 // length of inner longitudinal bars
dd028c53 209 // inner
b9c35690 210 const Float_t longLI = 615.;
87829bcb 211 const Float_t zE = 376.5;
b9c35690 212//
213// Frame mother volume
214//
215 TGeoPgon* shB77A = new TGeoPgon(0., 360., 18, 2);
216 shB77A->SetName("shB77A");
dd028c53 217 shB77A->DefineSection( 0, -zE, 280., 423.7);
218 shB77A->DefineSection( 1, zE, 280., 423.7);
b9c35690 219 TGeoBBox* shB77B = new TGeoBBox(3.42, 2., 375.5);
220 shB77B->SetName("shB77B");
221 TGeoTranslation* trB77A = new TGeoTranslation("trB77A", +283.32, 0., 0.);
222 TGeoTranslation* trB77B = new TGeoTranslation("trB77B", -283.32, 0., 0.);
223 trB77A->RegisterYourself();
224 trB77B->RegisterYourself();
225 TGeoCompositeShape* shB77 = new TGeoCompositeShape("shB77", "shB77A+shB77B:trB77A+shB77B:trB77B");
226 TGeoVolume* voB77 = new TGeoVolume("B077", shB77, gGeoManager->GetMedium("FRAME_Air"));
227 voB77->SetName("B077"); // just to avoid a warning
228 TVirtualMC::GetMC()->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
229//
230// Reference plane #1 for TRD
231 TGeoPgon* shBREFA = new TGeoPgon(0.0, 360., 18, 2);
232 shBREFA->DefineSection( 0, -376., 280., 280.1);
233 shBREFA->DefineSection( 1, 376., 280., 280.1);
234 shBREFA->SetName("shBREFA");
235 TGeoCompositeShape* shBREF1 = new TGeoCompositeShape("shBREF1", "shBREFA-(shB77B:trB77A+shB77B:trB77B)");
236 TGeoVolume* voBREF = new TGeoVolume("BREF1", shBREF1, gGeoManager->GetMedium("FRAME_Air"));
237 voBREF->SetVisibility(0);
238 TVirtualMC::GetMC()->Gspos("BREF1", 1, "B077", 0., 0., 0., 0, "ONLY");
239//
240// The outer Frame
241//
242
243 Float_t dol = 4.;
244 Float_t doh = 4.;
245 Float_t ds = 0.63;
b9c35690 246//
247// Rings
248//
87829bcb 249 dz = 2. * 410.2 * sin10 - 2. * dol * cos10 - 2. * doh * tan10;
250 Float_t l1 = dz / 2.;
251 Float_t l2 = dz / 2. + 2. * doh * tan10;
b9c35690 252
253
254 TGeoVolumeAssembly* asBI42 = new TGeoVolumeAssembly("BI42");
255 // Horizontal
87829bcb 256 ptrd1[0] = l2 - 0.6 * tan10;
b9c35690 257 ptrd1[1] = l2;
258 ptrd1[2] = 8.0 / 2.;
259 ptrd1[3] = 0.6 / 2.;
260 TVirtualMC::GetMC()->Gsvolu("BIH142", "TRD1", kSteel, ptrd1, 4);
261 ptrd1[0] = l1;
87829bcb 262 ptrd1[1] = l1 + 0.6 * tan10;
b9c35690 263 ptrd1[2] = 8.0 / 2.;
264 ptrd1[3] = 0.6 / 2.;
265 TVirtualMC::GetMC()->Gsvolu("BIH242", "TRD1", kSteel, ptrd1, 4);
266
267 // Vertical
87829bcb 268 ptrd1[0] = l1 + 0.6 * tan10;
269 ptrd1[1] = l2 - 0.6 * tan10;
b9c35690 270 ptrd1[2] = 0.8 / 2.;
271 ptrd1[3] = 6.8 / 2.;
272 TVirtualMC::GetMC()->Gsvolu("BIV42", "TRD1", kSteel, ptrd1, 4);
273 // Place
dd028c53 274 asBI42->AddNode(gGeoManager->GetVolume("BIV42"), 1, new TGeoTranslation(0., 0., 0.0));
b9c35690 275 asBI42->AddNode(gGeoManager->GetVolume("BIH142"), 1, new TGeoTranslation(0., 0., 3.7));
276 asBI42->AddNode(gGeoManager->GetVolume("BIH242"), 1, new TGeoTranslation(0., 0., -3.7));
277//
278// longitudinal bars
279//
280// 80 x 80 x 6.3
281//
282 pbox[0] = dol;
283 pbox[1] = doh;
284 pbox[2] = 345.;
285 TVirtualMC::GetMC()->Gsvolu("B033", "BOX", kSteel, pbox, 3);
286 pbox[0] = dol-ds;
287 pbox[1] = doh-ds;
288 TVirtualMC::GetMC()->Gsvolu("B034", "BOX", kAir, pbox, 3);
289 TVirtualMC::GetMC()->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
290
291
292 //
293 // TPC support
294 //
295 pbox[0] = 3.37;
296 pbox[1] = 2.0;
87829bcb 297 pbox[2] = longLI / 2.;
b9c35690 298 TVirtualMC::GetMC()->Gsvolu("B080", "BOX", kSteel, pbox, 3);
299 pbox[0] = 2.78;
87829bcb 300 pbox[1] = 1.40;
301 pbox[2] = longLI / 2.;
b9c35690 302 TVirtualMC::GetMC()->Gsvolu("B081", "BOX", kAir, pbox, 3);
303 TVirtualMC::GetMC()->Gspos("B081", 1, "B080", 0., 0., 0., 0, "ONLY");
304
305 // Small 2nd reference plane elemenet
306 pbox[0] = 0.05;
307 pbox[1] = 2.0;
87829bcb 308 pbox[2] = longLI / 2.;
b9c35690 309 TVirtualMC::GetMC()->Gsvolu("BREF2", "BOX", kAir, pbox, 3);
310 TVirtualMC::GetMC()->Gspos("BREF2", 1, "B080", 3.37 - 0.05, 0., 0., 0, "ONLY");
311
48f13d0e 312 TVirtualMC::GetMC()->Gspos("B080", 1, "B077", 283.25, 0., 0., 0, "ONLY");
313 TVirtualMC::GetMC()->Gspos("B080", 2, "B077", -283.25, 0., 0., idrotm[2088], "ONLY");
b9c35690 314
315
316//
317// Diagonal bars (1)
318//
319 Float_t h, d, dq, x, theta;
320
321 h = (dymodU[1]-dymodU[0]-2.*dol)*.999;
322 d = 2.*dol;
323 dq = h*h+dz*dz;
324
325 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
326
327
328 theta = krad2deg * TMath::ACos(x);
329
330 ptrap[0] = dz/2.;
331 ptrap[1] = theta;
332 ptrap[2] = 0.;
333 ptrap[3] = doh;
334 ptrap[4] = dol/x;
335 ptrap[5] = ptrap[4];
336 ptrap[6] = 0;
337 ptrap[7] = ptrap[3];
338 ptrap[8] = ptrap[4];
339 ptrap[9] = ptrap[4];
340 ptrap[10] = 0;
341
342 TVirtualMC::GetMC()->Gsvolu("B047", "TRAP", kSteel, ptrap, 11);
343 ptrap[3] = doh-ds;
344 ptrap[4] = (dol-ds)/x;
345 ptrap[5] = ptrap[4];
346 ptrap[7] = ptrap[3];
347 ptrap[8] = ptrap[4];
348 ptrap[9] = ptrap[4];
349 TVirtualMC::GetMC()->Gsvolu("B048", "TRAP", kAir, ptrap, 11);
350 TVirtualMC::GetMC()->Gspos("B048", 1, "B047", 0.0, 0.0, 0., 0, "ONLY");
351
352/*
353 Crosses (inner most)
354 \\ //
355 \\//
356 //\\
357 // \\
358*/
359 h = (2.*dymodU[0]-2.*dol)*.999;
360//
361// Mother volume
362//
363 pbox[0] = h/2;
364 pbox[1] = doh;
365 pbox[2] = dz/2.;
366 TVirtualMC::GetMC()->Gsvolu("BM49", "BOX ", kAir, pbox, 3);
367
368
369 dq = h*h+dz*dz;
370 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
371 theta = krad2deg * TMath::ACos(x);
372
373 ptrap[0] = dz/2.-kEps;
374 ptrap[1] = theta;
375 ptrap[2] = 0.;
376 ptrap[3] = doh-kEps;
377 ptrap[4] = dol/x;
378 ptrap[5] = ptrap[4];
379 ptrap[7] = ptrap[3];
380 ptrap[8] = ptrap[4];
381 ptrap[9] = ptrap[4];
382
383 TVirtualMC::GetMC()->Gsvolu("B049", "TRAP", kSteel, ptrap, 11);
384 ptrap[0] = ptrap[0]-kEps;
385 ptrap[3] = (doh-ds);
386 ptrap[4] = (dol-ds)/x;
387 ptrap[5] = ptrap[4];
388 ptrap[7] = ptrap[3];
389 ptrap[8] = ptrap[4];
390 ptrap[9] = ptrap[4];
391 TVirtualMC::GetMC()->Gsvolu("B050", "TRAP", kAir, ptrap, 11);
392 TVirtualMC::GetMC()->Gspos("B050", 1, "B049", 0.0, 0.0, 0., 0, "ONLY");
393 TVirtualMC::GetMC()->Gspos("B049", 1, "BM49", 0.0, 0.0, 0., 0, "ONLY");
394
395
396 Float_t dd1 = d*TMath::Tan(theta*kdeg2rad);
397 Float_t dd2 = d/TMath::Tan(2.*theta*kdeg2rad);
398 Float_t theta2 = TMath::ATan(TMath::Abs(dd2-dd1)/d/2.);
399
400
401 ptrap[0] = dol;
402 ptrap[1] = theta2*krad2deg;
403 ptrap[2] = 0.;
404 ptrap[3] = doh;
405 ptrap[4] = (dz/2./x-dd1-dd2)/2.;
406 ptrap[5] = ptrap[4];
407 ptrap[6] = 0.;
408 ptrap[7] = ptrap[3];
409 ptrap[8] = dz/4./x;
410 ptrap[9] = ptrap[8];
411
412
413 TVirtualMC::GetMC()->Gsvolu("B051", "TRAP", kSteel, ptrap, 11);
414 Float_t ddx0 = ptrap[8];
415
416 Float_t dd1s = dd1*(1.-2.*ds/d);
417 Float_t dd2s = dd2*(1.-2.*ds/d);
418 Float_t theta2s = TMath::ATan(TMath::Abs(dd2s-dd1s)/(d-2.*ds)/2.);
419
420
421 ptrap[0] = dol-ds;
422 ptrap[1] = theta2s*krad2deg;
423 ptrap[2] = 0.;
424 ptrap[3] = doh-ds;
425 ptrap[4] = ptrap[4]+ds/d/2.*(dd1+dd2);
426 ptrap[5] = ptrap[4];
427 ptrap[6] = 0.;
428 ptrap[7] = ptrap[3];
429 ptrap[8] = ptrap[8]-ds/2./d*(dd1+dd2);
430 ptrap[9] = ptrap[8];
431
432 TVirtualMC::GetMC()->Gsvolu("B052", "TRAP", kAir, ptrap, 11);
433 TVirtualMC::GetMC()->Gspos("B052", 1, "B051", 0.0, 0.0, 0., 0, "ONLY");
434
435 Float_t ddx, ddz, drx, drz, rtheta;
436
437 AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
438 rtheta = (90.-theta)*kdeg2rad;
439 ddx = -ddx0-dol*TMath::Tan(theta2);
440 ddz = -dol;
441
442 drx = TMath::Cos(rtheta) * ddx +TMath::Sin(rtheta) *ddz+pbox[0];
443 drz = -TMath::Sin(rtheta) * ddx +TMath::Cos(rtheta) *ddz-pbox[2];
444 TVirtualMC::GetMC()->Gspos("B051", 1, "BM49",
445 drx, 0.0, drz,
446 idrotm[2001], "ONLY");
447
448 AliMatrix(idrotm[2002], -theta, 0.0, 90.0, 90.0, 270.-theta, 0.0);
449 rtheta = (270.-theta)*kdeg2rad;
450
451 drx = TMath::Cos(rtheta) * ddx + TMath::Sin(rtheta) * ddz-pbox[0];
452 drz = -TMath::Sin(rtheta) * ddx + TMath::Cos(rtheta) * ddz+pbox[2];
453 TVirtualMC::GetMC()->Gspos("B051", 2, "BM49",
454 drx, 0.0, drz,
455 idrotm[2002], "ONLY");
456
457//
458// Diagonal bars (3)
459//
460 h = ((dymodU[2]-dymodU[1])-2.*dol)*.999;
461 dq = h*h+dz*dz;
462 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
463 theta = krad2deg * TMath::ACos(x);
464
465 ptrap[0] = dz/2.;
466 ptrap[1] = theta;
467 ptrap[3] = doh;
468 ptrap[4] = dol/x;
469 ptrap[5] = ptrap[4];
470 ptrap[7] = ptrap[3];
471 ptrap[8] = ptrap[4];
472 ptrap[9] = ptrap[4];
473
474 TVirtualMC::GetMC()->Gsvolu("B045", "TRAP", kSteel, ptrap, 11);
475 ptrap[3] = doh-ds;
476 ptrap[4] = (dol-ds)/x;
477 ptrap[5] = ptrap[4];
478 ptrap[7] = ptrap[3];
479 ptrap[8] = ptrap[4];
480 ptrap[9] = ptrap[4];
481 TVirtualMC::GetMC()->Gsvolu("B046", "TRAP", kAir, ptrap, 11);
482 TVirtualMC::GetMC()->Gspos("B046", 1, "B045", 0.0, 0.0, 0., 0, "ONLY");
483
484//
485// Positioning of diagonal bars
486
afaba6e2 487 Float_t rd = 405.5 + 0.51;
b9c35690 488 dz = (dymodU[1]+dymodU[0])/2.;
489 Float_t dz2 = (dymodU[1]+dymodU[2])/2.;
490
491//
492// phi = 40
493//
494 Float_t phi = 40;
495 dx = rd * TMath::Sin(phi*kdeg2rad);
496 dy = rd * TMath::Cos(phi*kdeg2rad);
497
498
dd028c53 499 TVirtualMC::GetMC()->Gspos("B045", 1, "B077", -dx, dy, dz2, idrotm[2019], "ONLY");
500 TVirtualMC::GetMC()->Gspos("B045", 2, "B077", -dx, dy, -dz2, idrotm[2003], "ONLY"); // ?
501 TVirtualMC::GetMC()->Gspos("B045", 3, "B077", dx, dy, dz2, idrotm[2020], "ONLY");
502 TVirtualMC::GetMC()->Gspos("B045", 4, "B077", dx, dy, -dz2, idrotm[2027], "ONLY");
b9c35690 503
504
505//
506// phi = 60
507//
508
509 phi = 60;
510 dx = rd * TMath::Sin(phi*kdeg2rad);
511 dy = rd * TMath::Cos(phi*kdeg2rad);
512
dd028c53 513 TVirtualMC::GetMC()->Gspos("B045", 5, "B077", -dx, dy, dz2, idrotm[2021], "ONLY");
514 TVirtualMC::GetMC()->Gspos("B045", 6, "B077", -dx, dy, -dz2, idrotm[2028], "ONLY");
515 TVirtualMC::GetMC()->Gspos("B045", 7, "B077", dx, dy, dz2, idrotm[2022], "ONLY");
516 TVirtualMC::GetMC()->Gspos("B045", 8, "B077", dx, dy, -dz2, idrotm[2029], "ONLY");
b9c35690 517
518//
519// phi = 80
520//
521
522 phi = 80;
523 dx = rd * TMath::Sin(phi*kdeg2rad);
524 dy = rd * TMath::Cos(phi*kdeg2rad);
525
dd028c53 526 TVirtualMC::GetMC()->Gspos("B047", 13, "B077", -dx, -dy, dz, idrotm[2008], "ONLY");
527 TVirtualMC::GetMC()->Gspos("B047", 14, "B077", -dx, -dy, -dz, idrotm[2010], "ONLY");
528 TVirtualMC::GetMC()->Gspos("B047", 15, "B077", dx, -dy, dz, idrotm[2012], "ONLY");
529 TVirtualMC::GetMC()->Gspos("B047", 16, "B077", dx, -dy, -dz, idrotm[2011], "ONLY");
b9c35690 530
dd028c53 531 TVirtualMC::GetMC()->Gspos("B045", 9, "B077", -dx, dy, dz2, idrotm[2023], "ONLY");
532 TVirtualMC::GetMC()->Gspos("B045", 10, "B077", -dx, dy, -dz2, idrotm[2031], "ONLY");
533 TVirtualMC::GetMC()->Gspos("B045", 11, "B077", dx, dy, dz2, idrotm[2026], "ONLY");
534 TVirtualMC::GetMC()->Gspos("B045", 12, "B077", dx, dy, -dz2, idrotm[2030], "ONLY");
b9c35690 535
dd028c53 536 TVirtualMC::GetMC()->Gspos("B045", 13, "B077", -dx, -dy, dz2, idrotm[2024], "ONLY");
537 TVirtualMC::GetMC()->Gspos("B045", 14, "B077", -dx, -dy, -dz2, idrotm[2032], "ONLY");
538 TVirtualMC::GetMC()->Gspos("B045", 15, "B077", dx, -dy, dz2, idrotm[2025], "ONLY");
539 TVirtualMC::GetMC()->Gspos("B045", 16, "B077", dx, -dy, -dz2, idrotm[2033], "ONLY");
b9c35690 540
dd028c53 541 TVirtualMC::GetMC()->Gspos("BM49", 7, "B077", dx, -dy, 0., idrotm[2025], "ONLY");
542 TVirtualMC::GetMC()->Gspos("BM49", 8, "B077", -dx, -dy, 0., idrotm[2024], "ONLY");
b9c35690 543
544//
87829bcb 545// The inner frame
b9c35690 546//
547//
548// Mother Volumes
549//
87829bcb 550 ptrd1[0] = (hR - longH/2. - dext) * tan10;
dd028c53 551 ptrd1[1] = (hR - longH/2. + iFrH0) * tan10;
87829bcb 552 ptrd1[2] = zE;
553 ptrd1[3] = iFrH0 / 2.;
48f13d0e 554 Float_t dd = longW / 2. * cos10 + 0.1;
dd028c53 555 TGeoTrd1* shTRD1 = new TGeoTrd1("shTRD1", ptrd1[0], ptrd1[1], ptrd1[2], ptrd1[3]);
556 TGeoBBox* shBox = new TGeoBBox("shBox", 50., zE+10., 1.);
557 TGeoRotation* rot1 = new TGeoRotation("urot1", 100., 0., 90., 90., 10., 0.);
558 TGeoRotation* rot2 = new TGeoRotation("urot2", 80., 0., 90., 90., -10., 0.);
48f13d0e 559 Float_t trotDz = iFrH0 / 2. + 1.;
dd028c53 560 Float_t trotDx = 402. * tan10;
561 TGeoCombiTrans* trot1 = new TGeoCombiTrans(-trotDx, 0., trotDz, rot2);
562 TGeoCombiTrans* trot2 = new TGeoCombiTrans(+trotDx, 0., trotDz, rot1);
563 TGeoUnion* uni = new TGeoUnion(shBox, shBox,trot1, trot2);
564 TGeoCompositeShape* shU = new TGeoCompositeShape("shU", uni);
565 TGeoSubtraction* sub = new TGeoSubtraction(shTRD1, shU, 0, 0);
566 TGeoCompositeShape* shCS = new TGeoCompositeShape("shCS", sub);
567 // center of segments
568 Float_t r = (hR - longH/2. + iFrH0 / 2. ) - dext;
569 // center of outer frame
570 //vertical
87829bcb 571 Float_t rout1 = 406.0;
dd028c53 572 // radial
48f13d0e 573 Float_t rout2 = 412.3 - 2. * sin10 + 0.25;
dd028c53 574 //
b9c35690 575 TString module[18];
87829bcb 576 TGeoVolume* voIF[18];
dd028c53 577
b9c35690 578 for (i = 0; i < 18; i++) {
579
580 // Create volume i
581 char name[16];
dd028c53 582 // official module numbering
b9c35690 583 Int_t mod = i + 13;
584 if (mod > 17) mod -= 18;
585 snprintf(name, 16, "BSEGMO%d", mod);
87829bcb 586 //
dd028c53 587 TGeoVolume* voTRD1 = new TGeoVolume(name, shCS, kMedAir);
b9c35690 588 module[i] = name;
589 // Place volume i
87829bcb 590 Float_t phi1 = i * 20.;
dd028c53 591 Float_t phi2 = 270. + phi1;
b9c35690 592 if (phi2 >= 360.) phi2 -= 360.;
dd028c53 593 dx = TMath::Sin(phi1 * kdeg2rad) * r;
594 dy = -TMath::Cos(phi1 * kdeg2rad) * r;
b9c35690 595
596 char nameR[16];
597 snprintf(nameR, 16, "B43_Rot_%d", i);
598 TGeoRotation* rot = new TGeoRotation(nameR, 90.0, phi1, 0., 0., 90., phi2);
599 AliMatrix(idrotm[2034+i], 90.0, phi1, 0., 0., 90., phi2);
600 TGeoVolume* vol77 = gGeoManager->GetVolume("B077");
dd028c53 601 vol77->AddNode(voTRD1, 1, new TGeoCombiTrans(dx, dy, 0., rot));
b9c35690 602
603//
604// Position elements of outer Frame
605//
606 dx = TMath::Sin(phi1*kdeg2rad)*rout1;
607 dy = -TMath::Cos(phi1*kdeg2rad)*rout1;
608 for (j = 0; j < 3; j++)
609 {
610 dz = dymodU[j];
dd028c53 611 TGeoVolume* vol = gGeoManager->GetVolume("B077");
b9c35690 612 vol->AddNode(asBI42, 6*i+2*j+1, new TGeoCombiTrans(dx, dy, dz, rot));
613 vol->AddNode(asBI42, 6*i+2*j+2, new TGeoCombiTrans(dx, dy, -dz, rot));
614 }
615
616 phi1 = i*20.+10;
617 phi2 = 270+phi1;
618 AliMatrix(idrotm[2052+i], 90.0, phi1, 90., phi2, 0., 0.);
619
620 dx = TMath::Sin(phi1*kdeg2rad)*rout2;
621 dy = -TMath::Cos(phi1*kdeg2rad)*rout2;
dd028c53 622 TVirtualMC::GetMC()->Gspos("B033", i+1, "B077", dx, dy, 0., idrotm[2052+i], "ONLY");
b9c35690 623//
624 }
625// Internal Frame rings
626//
627//
dd028c53 628// Pos 7 60x60x5x6 for inner rings (I-beam)
629// Pos 6 100x60x5 for front and rear rings
b9c35690 630//
631// Front and rear
87829bcb 632//
633
87829bcb 634 ptrd1[0] = (hR - longH / 2.) * tan10 - dd;
635 ptrd1[1] = (hR + longH / 2.) * tan10 - dd;
b9c35690 636 ptrd1[2] = ringW / 2.;
637 ptrd1[3] = ringH / 2.;
638
639 TVirtualMC::GetMC()->Gsvolu("B072", "TRD1", kSteel, ptrd1, 4);
640
87829bcb 641 ptrd1[0] = (hR - longH / 2. + 0.5) * tan10 - dd;
642 ptrd1[1] = (hR + longH / 2. - 0.5) * tan10 - dd;
b9c35690 643 ptrd1[2] = ringW / 2. - 0.5;
644 ptrd1[3] = ringH / 2. - 0.5;
645
646 TVirtualMC::GetMC()->Gsvolu("B073", "TRD1", kAir, ptrd1, 4);
647 TVirtualMC::GetMC()->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
648//
649// I-Beam
650// Mother volume
651 TGeoVolumeAssembly* asBI72 = new TGeoVolumeAssembly("BI72");
652 // Horizontal
87829bcb 653 Float_t rIB1 = hR + ringH/2.;
654 Float_t rIB2 = hR - ringH/2.;
dd028c53 655 ptrd1[0] = (rIB1 - ringT/2.) * tan10 - dd;
656 ptrd1[1] = (rIB1 ) * tan10 - dd;
87829bcb 657 ptrd1[2] = ringH / 2.;
658 ptrd1[3] = ringT / 4.;
b9c35690 659 TVirtualMC::GetMC()->Gsvolu("BIH172", "TRD1", kSteel, ptrd1, 4);
dd028c53 660 ptrd1[0] = (rIB2 ) * tan10 - dd;
661 ptrd1[1] = (rIB2 + ringT/2.) * tan10 - dd;
87829bcb 662 ptrd1[2] = ringH/2.;
663 ptrd1[3] = ringT/4.;
b9c35690 664 TVirtualMC::GetMC()->Gsvolu("BIH272", "TRD1", kSteel, ptrd1, 4);
665
666 // Vertical
dd028c53 667 ptrd1[0] = (rIB2 + ringT/2.) * tan10 - dd;
668 ptrd1[1] = (rIB1 - ringT/2.) * tan10 - dd;
87829bcb 669 ptrd1[2] = 0.6 / 2.;
670 ptrd1[3] = (ringH - ringT) / 2.;
b9c35690 671 TVirtualMC::GetMC()->Gsvolu("BIV72", "TRD1", kSteel, ptrd1, 4);
672 // Place
673 asBI72->AddNode(gGeoManager->GetVolume("BIV72"), 1, new TGeoTranslation(0., 0., 0.));
87829bcb 674 asBI72->AddNode(gGeoManager->GetVolume("BIH172"), 1, new TGeoTranslation(0., 0., (ringH/2. - ringT/4.)));
675 asBI72->AddNode(gGeoManager->GetVolume("BIH272"), 1, new TGeoTranslation(0., 0., -(ringH/2. - ringT/4.)));
b9c35690 676
677// Web frame
678//
679// h x w x s = 60 x 40 x 5
680// (attention: elements are half bars, "U" shaped)
681//
682
683 WebFrame("B063", dHz, dymodO[0], 10.);
684 WebFrame("B163", dHz, dymodO[1], 10.);
685 WebFrame("B263", dHz, dymodO[2], 10.);
686 WebFrame("B363", dHz, dymodO[3], 10.);
687 WebFrame("B463", dHz, dymodO[4], 10.);
688
dd028c53 689 dz = -iFrH0 / 2. + ringH / 2. + dext;
b9c35690 690
48f13d0e 691 Float_t dz0 = -iFrH0 / 2. + longH + 113. / 2. + dext - 0.1;
692 Float_t dx0 = (hR + iFrH/2.) * tan10 - longW / 4. * cos10 - 0.065;
87829bcb 693 for (jmod = 0; jmod < 18; jmod++)
b9c35690 694 {
87829bcb 695//
b9c35690 696// ring bars
697 for (i = 0; i < 3; i++) {
b9c35690 698 if (i == 2) {
699 TVirtualMC::GetMC()->Gspos("B072", 6*jmod+i+1, module[jmod], 0, dymodL[i], dz, 0, "ONLY");
700 TVirtualMC::GetMC()->Gspos("B072", 6*jmod+i+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");
701 } else {
702 TGeoVolume* vol = gGeoManager->GetVolume(module[jmod]);
703 vol->AddNode(asBI72, 6*jmod+i+1, new TGeoTranslation(0, dymodL[i], dz));
704 vol->AddNode(asBI72, 6*jmod+i+4, new TGeoTranslation(0, -dymodL[i], dz));
705 }
706 }
707 }
87829bcb 708//
b9c35690 709// outer diagonal web
710
711 dy = dymodW[0] - (dHz/2.) * TMath::Tan(dymodO[0] * kdeg2rad);
712
713 for (jmod = 0; jmod < 18; jmod++) {
87829bcb 714 TVirtualMC::GetMC()->Gspos("B063I", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2096], "ONLY");
715 TVirtualMC::GetMC()->Gspos("B063", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2097], "ONLY");
716 TVirtualMC::GetMC()->Gspos("B063I", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
717 TVirtualMC::GetMC()->Gspos("B063", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
b9c35690 718 }
719
720 dy = dymodW[1] - (dHz/2.) * TMath::Tan(dymodO[1] * kdeg2rad);
721
722 for (jmod = 0; jmod < 18; jmod++) {
87829bcb 723 TVirtualMC::GetMC()->Gspos("B163I", 4*jmod+1, module[jmod], dx0, -dy, dz0, idrotm[2096], "ONLY");
724 TVirtualMC::GetMC()->Gspos("B163", 4*jmod+2, module[jmod], dx0, dy, dz0, idrotm[2097], "ONLY");
725 TVirtualMC::GetMC()->Gspos("B163I", 4*jmod+3, module[jmod], -dx0, dy, dz0, idrotm[2087], "ONLY");
726 TVirtualMC::GetMC()->Gspos("B163", 4*jmod+4, module[jmod], -dx0, -dy, dz0, idrotm[2086], "ONLY");
b9c35690 727 }
728
729 dy = dymodW[2] - (dHz/2) * TMath::Tan(dymodO[2] * kdeg2rad);
87829bcb 730
731 for (jmod = 0; jmod < 18; jmod++) {
732 TVirtualMC::GetMC()->Gspos("B263I", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2096], "ONLY");
733 TVirtualMC::GetMC()->Gspos("B263", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2097], "ONLY");
734 TVirtualMC::GetMC()->Gspos("B263I", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
735 TVirtualMC::GetMC()->Gspos("B263", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
b9c35690 736 }
737
738 dy = dymodW[3] - (dHz/2.) * TMath::Tan(dymodO[3] * kdeg2rad);
739
740 for (jmod = 0; jmod < 18; jmod++) {
87829bcb 741 TVirtualMC::GetMC()->Gspos("B363I", 4*jmod+1, module[jmod], dx0, -dy, dz0, idrotm[2096], "ONLY");
742 TVirtualMC::GetMC()->Gspos("B363", 4*jmod+2, module[jmod], dx0, dy, dz0, idrotm[2097], "ONLY");
743 TVirtualMC::GetMC()->Gspos("B363I", 4*jmod+3, module[jmod], -dx0, dy, dz0, idrotm[2087], "ONLY");
744 TVirtualMC::GetMC()->Gspos("B363", 4*jmod+4, module[jmod], -dx0, -dy, dz0, idrotm[2086], "ONLY");
b9c35690 745 }
746
747 dy = dymodW[4] - (dHz/2.) * TMath::Tan(dymodO[4] * kdeg2rad);
87829bcb 748
749 for (jmod = 0; jmod < 18; jmod++) {
750 TVirtualMC::GetMC()->Gspos("B463I", 4*jmod+1, module[jmod], dx0, dy, dz0, idrotm[2096], "ONLY");
751 TVirtualMC::GetMC()->Gspos("B463", 4*jmod+2, module[jmod], dx0, -dy, dz0, idrotm[2097], "ONLY");
752 TVirtualMC::GetMC()->Gspos("B463I", 4*jmod+3, module[jmod], -dx0, -dy, dz0, idrotm[2087], "ONLY");
753 TVirtualMC::GetMC()->Gspos("B463", 4*jmod+4, module[jmod], -dx0, dy, dz0, idrotm[2086], "ONLY");
b9c35690 754 }
755
756// longitudinal bars (TPC rails attached)
757// new specs:
758// h x w x s = 100 x 75 x 6
b9c35690 759// Attention: 2 "U" shaped half rods per cell
760// longitudinal bars (no TPC rails attached)
761// new specs: h x w x s = 40 x 60 x 5
762//
763//
764//
87829bcb 765 Double_t lbox[3];
b9c35690 766 lbox[0] = longW / 4.;
767 lbox[2] = longH / 2.;
768 lbox[1] = longLI / 2.;
a9bfe689 769 TVirtualMC::GetMC()->Gsvolu("BA59", "BOX", kSteel, lbox, 3);
770 gGeoManager->GetVolume("BA59")->SetVisContainers();
b9c35690 771 lbox[0] = longW / 4. - 0.25;
772 lbox[2] = longH / 2. - 0.50;
773 TVirtualMC::GetMC()->Gsvolu("BA62", "BOX", kAir, lbox, 3);
774 TVirtualMC::GetMC()->Gspos("BA62", 1, "BA59", 0.25, 0.0, 0.0, 0, "ONLY");
775
dd028c53 776 dz = -iFrH0 / 2. + longH / 2. - 1. * sin10 + dext;
48f13d0e 777 dx = hR * tan10 - longW / 4. * cos10 - 0.065;
87829bcb 778 for (jmod = 0; jmod < 18; jmod++) {
779 TVirtualMC::GetMC()->Gspos("BA59", 2*jmod+1, module[jmod], dx, 0.0, dz, idrotm[2096], "ONLY");
780 TVirtualMC::GetMC()->Gspos("BA59", 2*jmod+2, module[jmod], -dx, 0.0, dz, idrotm[2087], "ONLY");
781 }
b9c35690 782 //
783 // Rails for TRD
784 //
785 // Pos 1
786 //
87829bcb 787 // angular 80 deg profile
b9c35690 788 lbox[2] = 4.0;
789 lbox[0] = 0.2;
790 lbox[1] = longLI / 2.;
791 TVirtualMC::GetMC()->Gsvolu("BTRDR_10", "BOX", kSteel, lbox, 3);
a9bfe689 792
b9c35690 793 ptrd1[0] = 3.;
794 ptrd1[1] = 3. + 0.4 * tan10;
87829bcb 795 ptrd1[2] = longLI / 2.;
b9c35690 796 ptrd1[3] = 0.2;
797 TVirtualMC::GetMC()->Gsvolu("BTRDR_11", "TRD1", kSteel, ptrd1, 4);
a9bfe689 798
799 lbox[2] = 2.0;
800 lbox[0] = 0.3;
801 lbox[1] = longLI / 2.;
802 TVirtualMC::GetMC()->Gsvolu("BTRDR_12", "BOX", kAlu, lbox, 3);
803 gGeoManager->GetVolume("BTRDR_12")->SetVisContainers();
804
805 lbox[2] = 2.0;
806 lbox[0] = 0.1;
807 lbox[1] = longLI / 2.;
808 TVirtualMC::GetMC()->Gsvolu("BTRDR_13", "BOX", kG10, lbox, 3);
809 TVirtualMC::GetMC()->Gspos("BTRDR_13", 1, "BTRDR_12", -0.2, 0.0, 0.0, 0, "ONLY");
810
811 lbox[2] = 0.1;
812 lbox[0] = 2.0;
813 lbox[1] = longLI / 2.;
814 TVirtualMC::GetMC()->Gsvolu("BTRDR_14", "BOX", kG10, lbox, 3);
dd028c53 815 dz = -iFrH0 / 2. + longH / 2. + dext;
a9bfe689 816 Float_t zpos = 80.;
817 Int_t isec_1[11] = {0, 1, 2, 3, 4, 5, 13, 14, 15, 16, 17};
e28d8650 818
a9bfe689 819 for (Int_t index = 0; index < 11; index++) {
820 jmod = isec_1[index];
821 Float_t dz1 = dz + 3. + (zpos - 4.);
48f13d0e 822 dx0 = (hR + dz0 + zpos - 4.) * tan10 - (longW / 2. + 0.2) / cos10 - 0.05;
a9bfe689 823 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_10", 2*jmod+1, module[jmod], dx0, 0.0, dz1, idrotm[2096], "ONLY");
824 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_10", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, idrotm[2086], "ONLY");
825 dx0 -= 0.5;
826 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_12", 2*jmod+1, module[jmod], dx0, 0.0, dz1, idrotm[2096], "ONLY");
827 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_12", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, idrotm[2087], "ONLY");
828 dz1 += (4 - 0.2);
dd028c53 829 dz1 += dext;
a9bfe689 830 dx0 = (hR + dz0 + zpos - 0.2) * tan10 - (longW / 2. + 3. + 0.4) / cos10;
831 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_11", 2*jmod+1, module[jmod], dx0, 0.0, dz1, 0, "ONLY");
832 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_11", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, 0, "ONLY");
833 dz1 -= 0.3;
834 dx0 -= 0.5;
835 if (jmod != 5) TVirtualMC::GetMC()->Gspos("BTRDR_14", 2*jmod+1, module[jmod], dx0, 0.0, dz1, 0, "ONLY");
836 if (jmod != 13) TVirtualMC::GetMC()->Gspos("BTRDR_14", 2*jmod+2, module[jmod], -dx0, 0.0, dz1, 0, "ONLY");
837 }
b9c35690 838
e28d8650 839 // Pos 2
840 // 40 x 10
841 lbox[2] = 2.0;
842 lbox[0] = 0.5;
843 lbox[1] = longLI / 2.;
844 TVirtualMC::GetMC()->Gsvolu("BTRDR_2", "BOX", kAlu, lbox, 3);
845 lbox[2] = 2.0;
846 lbox[0] = 0.1;
847 lbox[1] = longLI / 2.;
848 TVirtualMC::GetMC()->Gsvolu("BTRDR_21", "BOX", kG10, lbox, 3);
849 TVirtualMC::GetMC()->Gspos("BTRDR_21", 1, "BTRDR_2", -0.4, 0.0, 0.0, 0, "ONLY");
850
851 Int_t isec_2a[16] = {1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17};
852 for (Int_t index = 0; index < 16; index++) {
853 jmod = isec_2a[index];
854 dx0 = (hR + dz0 ) * tan10 + 10. * sin10 - (longW / 4. + 0.5) / cos10;
855 if (jmod >8) {
856 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+1, module[jmod], dx0-1.5, 0.0, dz + 3. + 8. * cos10, idrotm[2096], "ONLY");
857 } else {
858 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+2, module[jmod], -dx0+1.5, 0.0, dz + 3. + 8. * cos10, idrotm[2087], "ONLY");
859 }
860 }
861
862 Int_t isec_2b[6] = {6, 7, 8, 10, 11, 12};
863 for (Int_t index = 0; index < 6; index++) {
864 jmod = isec_2b[index];
865 dx0 = (hR + dz0 + zpos - 3.) * tan10 - (longW / 4. + 0.5) / cos10;
866 if (index < 3) {
867 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+2, module[jmod], -dx0+1.5, 0.0, dz + 3. + zpos - 3., idrotm[2087], "ONLY");
868 } else {
869 TVirtualMC::GetMC()->Gspos("BTRDR_2", 2*jmod+1, module[jmod], dx0-1.5, 0.0, dz + 3. + zpos -3. , idrotm[2096], "ONLY");
870 }
871 }
872
873
874 // Pos 3
875 // 40 x 14
876 lbox[0] = 2.0;
877 lbox[2] = 0.7;
87829bcb 878 lbox[1] = longLI / 2.;
e28d8650 879 TVirtualMC::GetMC()->Gsvolu("BTRDR_3", "BOX", kAlu, lbox, 3);
880
881 lbox[0] = 2.0;
882 lbox[2] = 0.1;
87829bcb 883 lbox[1] = longLI / 2.;
e28d8650 884 TVirtualMC::GetMC()->Gsvolu("BTRDR_31", "BOX", kG10, lbox, 3);
885 TVirtualMC::GetMC()->Gspos("BTRDR_31", 1, "BTRDR_3", 0, 0.0, 0.6, 0, "ONLY");
886
887 Int_t isec_3[9] = {5, 6, 7, 8, 9, 10, 11, 12, 13};
888
a9bfe689 889
a9bfe689 890
891 for (Int_t index = 0; index < 9; index++) {
892 jmod = isec_3[index];
893 if (index > 1) TVirtualMC::GetMC()->Gspos("BTRDR_3", 2*jmod+1, module[jmod], 50.96-5-2., 0.0, dz+3.7, 0, "ONLY");
894 if (index < 7) TVirtualMC::GetMC()->Gspos("BTRDR_3", 2*jmod+2, module[jmod], -50.96+5+2., 0.0, dz+3.7, 0, "ONLY");
b9c35690 895 }
87829bcb 896
897
898//
899// TOF Support Structures
900
901//
902// Frame extension rectangular beams
903 lbox[0] = 6;
904 lbox[1] = 3.;
905 lbox[2] = 36.0;
906 TGeoVolume* voBTOFS1 = new TGeoVolume("BTOFS1", new TGeoBBox(lbox), gGeoManager->GetMedium("FRAME_Steel"));
907 lbox[0] = 5.5;
908 lbox[1] = 2.5;
909 lbox[2] = 36.0;
910 TGeoVolume* voBTOFS11 = new TGeoVolume("BTOFS11", new TGeoBBox(lbox), gGeoManager->GetMedium("FRAME_Air"));
911 voBTOFS1->AddNode(voBTOFS11, 1, gGeoIdentity);
912
913//
914// Frame extension rectangular beams
915// upper clamps
916 TGeoXtru* shBTOFS2 = new TGeoXtru(2);
917 TGeoXtru* shBTOFS3 = new TGeoXtru(2);
afaba6e2 918 TGeoXtru* shBTOFS4 = new TGeoXtru(2);
919 TGeoXtru* shBTOFS5 = new TGeoXtru(2);
87829bcb 920
921 Double_t xxtru1[7];
922 Double_t yxtru1[7];
923 // 1
924 xxtru1[0] = 8.5;
925 yxtru1[0] = 4.5;
926 // 2
927 xxtru1[1] = -6.0;
928 yxtru1[1] = 4.5;
929 // 3
930 xxtru1[2] = -8.5;
931 yxtru1[2] = 4.5 - 2.5 * sin10;
932 // 4
933 xxtru1[3] = 8.5 - 14.5 / cos10;
934 yxtru1[3] = -6. - 14.5 * sin10;
935 // 5
936 xxtru1[4] = 8.5 - 10.5 / cos10;
937 yxtru1[4] = -6. - 10.5 * sin10;
938 // 6
939 xxtru1[5] = xxtru1[4] + 8. * sin10;
940 yxtru1[5] = yxtru1[4] - 8./cos10;
941 // 7
942 xxtru1[6] = 8.5;
943 yxtru1[6] = -6.0;
944
945 Double_t xxtru2[7];
946 for (Int_t i = 0; i < 7; i++) xxtru2[i] = -xxtru1[i];
947
afaba6e2 948 Double_t xxtru3[5];
949 Double_t yxtru3[5];
950 Double_t xxtru4[5];
951 for (Int_t i = 0; i < 4; i++) {
952 xxtru3[i] = xxtru1[i];
953 yxtru3[i] = yxtru1[i];
954 }
955 xxtru3[4] = xxtru1[6];
956 yxtru3[4] = yxtru1[6];
957 for (Int_t i = 0; i < 5; i++) xxtru4[i] = -xxtru3[i];
958
87829bcb 959 shBTOFS2->DefinePolygon(7, xxtru1, yxtru1);
960 shBTOFS2->DefineSection(0, -4.);
961 shBTOFS2->DefineSection(1, +4.);
962
963 shBTOFS3->DefinePolygon(7, xxtru2, yxtru1);
964 shBTOFS3->DefineSection(0, -4.);
965 shBTOFS3->DefineSection(1, +4.);
966 TGeoVolume* voBTOFS2 = new TGeoVolume("BTOFS2", shBTOFS2, gGeoManager->GetMedium("FRAME_Steel"));
967 TGeoVolume* voBTOFS3 = new TGeoVolume("BTOFS3", shBTOFS3, gGeoManager->GetMedium("FRAME_Steel"));
968
afaba6e2 969 // different fixation for clamps close to web frame
970 shBTOFS4->DefinePolygon(5, xxtru3, yxtru3);
971 shBTOFS4->DefineSection(0, -4.);
972 shBTOFS4->DefineSection(1, +4.);
973
974 shBTOFS5->DefinePolygon(5, xxtru4, yxtru3);
975 shBTOFS5->DefineSection(0, -4.);
976 shBTOFS5->DefineSection(1, +4.);
977 TGeoVolume* voBTOFS4 = new TGeoVolume("BTOFS4", shBTOFS4, gGeoManager->GetMedium("FRAME_Steel"));
978 TGeoVolume* voBTOFS5 = new TGeoVolume("BTOFS5", shBTOFS5, gGeoManager->GetMedium("FRAME_Steel"));
979
980
87829bcb 981 lbox[0] = 5.5;
982 lbox[1] = 2.5;
983 lbox[2] = 4.0;
984 TGeoVolume* voBTOFS21 = new TGeoVolume("BTOFS21", new TGeoBBox(lbox), gGeoManager->GetMedium("FRAME_Air"));
985 voBTOFS2->AddNode(voBTOFS21, 1, gGeoIdentity);
986 voBTOFS3->AddNode(voBTOFS21, 2, gGeoIdentity);
afaba6e2 987 voBTOFS4->AddNode(voBTOFS21, 3, gGeoIdentity);
988 voBTOFS5->AddNode(voBTOFS21, 4, gGeoIdentity);
989
87829bcb 990 TGeoVolumeAssembly* asTOFS00 = new TGeoVolumeAssembly("BTOFS00");
991 asTOFS00->AddNode(voBTOFS1, 1, gGeoIdentity);
992 asTOFS00->AddNode(voBTOFS2, 1, new TGeoTranslation(0., 0., 40.));
993 asTOFS00->AddNode(voBTOFS2, 2, new TGeoTranslation(0., 0., -40.));
994
995 TGeoVolumeAssembly* asTOFS01 = new TGeoVolumeAssembly("BTOFS01");
996 asTOFS01->AddNode(voBTOFS1, 2, gGeoIdentity);
997 asTOFS01->AddNode(voBTOFS3, 1, new TGeoTranslation(0., 0., 40.));
998 asTOFS01->AddNode(voBTOFS3, 2, new TGeoTranslation(0., 0., -40.));
999
afaba6e2 1000 TGeoVolumeAssembly* asTOFS02 = new TGeoVolumeAssembly("BTOFS02");
1001 asTOFS02->AddNode(voBTOFS1, 3, gGeoIdentity);
1002 asTOFS02->AddNode(voBTOFS2, 3, new TGeoTranslation(0., 0., -40.));
1003 asTOFS02->AddNode(voBTOFS4, 2, new TGeoTranslation(0., 0., 40.));
1004
1005 TGeoVolumeAssembly* asTOFS03 = new TGeoVolumeAssembly("BTOFS03");
1006 asTOFS03->AddNode(voBTOFS1, 4, gGeoIdentity);
1007 asTOFS03->AddNode(voBTOFS3, 3, new TGeoTranslation(0., 0., -40.));
1008 asTOFS03->AddNode(voBTOFS5, 2, new TGeoTranslation(0., 0., 40.));
1009
87829bcb 1010
1011 asTOFS00->SetVisibility(1);
1012 asTOFS01->SetVisibility(1);
1013
1014 for (i = 0; i < 18; i++) {
1015 Float_t dx, dy;
1016 Float_t phi1 = i * 20.;
1017 Float_t phi2 = 270. + phi1;
1018 TGeoRotation* rot1 = new TGeoRotation(Form("TOFS_R1_%d", i), 90.0, phi1, 90., phi2, 0., 0.);
1019 dx = TMath::Sin((phi1+8.95) * kdeg2rad) * (rout2 + 12.);
1020 dy = -TMath::Cos((phi1+8.95) * kdeg2rad) * (rout2 + 12.);
afaba6e2 1021 if ((i >3 && i < 8) || (i > 10 && i < 15)) {
dd028c53 1022 (gGeoManager->GetVolume("B077"))->AddNode(asTOFS03, i, new TGeoCombiTrans(dx, dy, 345.-53.-0.5, rot1));
afaba6e2 1023 } else {
dd028c53 1024 (gGeoManager->GetVolume("B077"))->AddNode(asTOFS01, i, new TGeoCombiTrans(dx, dy, 345.-53.-0.5, rot1));
afaba6e2 1025 }
87829bcb 1026 dx = TMath::Sin((phi1-8.95) * kdeg2rad) * (rout2 + 12.);
1027 dy = -TMath::Cos((phi1-8.95) * kdeg2rad) * (rout2 + 12.);
afaba6e2 1028 if ((i >3 && i < 8) || (i > 10 && i < 15)) {
dd028c53 1029 (gGeoManager->GetVolume("B077"))->AddNode(asTOFS02, i, new TGeoCombiTrans(dx, dy, 345.-53-0.5, rot1));
afaba6e2 1030 } else {
dd028c53 1031 (gGeoManager->GetVolume("B077"))->AddNode(asTOFS00, i, new TGeoCombiTrans(dx, dy, 345.-53-0.5, rot1));
afaba6e2 1032 }
87829bcb 1033 }
1034
b9c35690 1035//
1036// Thermal shield
1037//
1038
1039 Float_t dyM = 99.0;
1040 MakeHeatScreen("M", dyM, idrotm[2090], idrotm[2091]);
1041 Float_t dyAM = 119.5;
1042 MakeHeatScreen("AM", dyAM, idrotm[2090], idrotm[2091]);
1043 Float_t dyA = 122.5 - 5.5;
1044 MakeHeatScreen("A" , dyA, idrotm[2090], idrotm[2091]);
1045
1046//
1047//
1048//
1049 dz = -57.2 + 0.6;
1050 for (i = 0; i < 18; i++) {
1051
1052 char nameMo[16];
1053 snprintf(nameMo, 16, "BSEGMO%d",i);
1054 // M
1055 TVirtualMC::GetMC()->Gspos("BTSH_M" , i+1 , nameMo, 0., 0., dz, 0, "ONLY");
1056 // AM, CM
1057 dy = dymodL[0] + dyAM / 2. + 3.;
1058 TVirtualMC::GetMC()->Gspos("BTSH_AM", i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
1059 TVirtualMC::GetMC()->Gspos("BTSH_AM", i+19, nameMo, 0., -dy, dz, 0, "ONLY");
1060 // A, C
1061 dy = dymodL[1] + dyA / 2 + 0.4;
1062 TVirtualMC::GetMC()->Gspos("BTSH_A" , i+ 1, nameMo, 0., dy, dz, 0, "ONLY");
1063 TVirtualMC::GetMC()->Gspos("BTSH_A" , i+19, nameMo, 0., -dy, dz, 0, "ONLY");
1064}
1065
1066
1067 //
1068 // TRD mother volumes
1069 //
1070 // absolute position of center 290.43 + 38.95 = 329.38
1071 // frame center 283.00 + 59.50 = 342.50
1072 // relative position of TRD 329.38 - 342.50
5d2fd19a 1073 //
1074 // shift wrt v2
1075 //
1076 const Float_t zsh = -0.326;
1077 //
b9c35690 1078 ptrd1[0] = 47.4405; // CBL 28/6/2006
1079 ptrd1[1] = 61.1765; // CBL
1080 ptrd1[2] = 375.5; // CBL
1081 ptrd1[3] = 38.95; // CBL
1082
1083 for (i = 0; i < 18; i++) {
1084 char nameCh[16];
1085 snprintf(nameCh, 16, "BTRD%d",i);
1086 char nameMo[16];
1087 snprintf(nameMo, 16, "BSEGMO%d",i);
1088 TVirtualMC::GetMC()->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
1089 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
5d2fd19a 1090 TVirtualMC::GetMC()->Gspos(nameCh, 1, nameMo, 0., 0., -12.62 + zsh, 0, "ONLY"); // CBL 28/6/2006
b9c35690 1091 }
1092
1093//
1094// TOF mother volumes as modified by B.Guerzoni
1095// to remove overlaps/extrusions in case of aligned TOF SMs
1096//
1097 ptrd1[0] = 62.2500;
1098 ptrd1[1] = 64.25;
1099 ptrd1[2] = 372.6;
1100 ptrd1[3] = 14.525/2;
1101 char nameChA[16];
1102 snprintf(nameChA, 16, "BTOFA");
1103 TGeoTrd1 *trd1=new TGeoTrd1(nameChA,ptrd1[0],ptrd1[1],ptrd1[2],ptrd1[3]);
1104 trd1->SetName("BTOFA"); // just to avoid a warning
1105 char nameChB[16];
1106 snprintf(nameChB, 16, "BTOFB");
1107 TGeoBBox *box1 = new TGeoBBox(nameChB,64.25 ,372.6, 14.525/2);
1108 box1->SetName("BTOFB"); // just to avoid a warning
1109 TGeoTranslation *tr1 = new TGeoTranslation("trnsl1",0, 0, -14.525/2 );
1110 tr1->RegisterYourself();
1111 TGeoTranslation *tr2 = new TGeoTranslation("trnsl2",0, 0, +14.525/2 );
1112 tr2->RegisterYourself();
1113 TGeoCompositeShape *btofcs =new TGeoCompositeShape("Btofcs","(BTOFA:trnsl1)+(BTOFB:trnsl2)");
1114
1115
1116 for (i = 0; i < 18; i++) {
1117 char nameCh[16];
1118 snprintf(nameCh, 16, "BTOF%d",i);
1119 char nameMo[16];
1120 snprintf(nameMo, 16, "BSEGMO%d",i);
1121 TGeoVolume* btf = new TGeoVolume(nameCh, btofcs, gGeoManager->GetMedium("FRAME_Air"));
1122 btf->SetName(nameCh);
1123 gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
5d2fd19a 1124 TVirtualMC::GetMC()->Gspos(nameCh, 1, nameMo, 0., 0., 43.525 + zsh, 0, "ONLY");
b9c35690 1125 }
1126//
1127// Geometry of Rails starts here
1128//
1129//
1130//
1131// Rails for space-frame
1132//
1133 Float_t rbox[3];
1134
1135 rbox[0] = 25.00;
1136 rbox[1] = 27.50;
1137 rbox[2] = 600.00;
1138 TVirtualMC::GetMC()->Gsvolu("BRS1", "BOX", kAir, rbox, 3);
1139
1140 rbox[0] = 25.00;
1141 rbox[1] = 3.75;
1142 TVirtualMC::GetMC()->Gsvolu("BRS2", "BOX", kSteel, rbox, 3);
1143
1144 rbox[0] = 3.00;
1145 rbox[1] = 20.00;
1146 TVirtualMC::GetMC()->Gsvolu("BRS3", "BOX", kSteel, rbox, 3);
1147
1148 TVirtualMC::GetMC()->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
1149 TVirtualMC::GetMC()->Gspos("BRS2", 2, "BRS1", 0., 27.5-3.75, 0., 0, "ONLY");
1150 TVirtualMC::GetMC()->Gspos("BRS3", 1, "BRS1", 0., 0., 0., 0, "ONLY");
1151 TVirtualMC::GetMC()->Gspos("BRS1", 1, "ALIC", -430.-3., -190., 0., 0, "ONLY");
1152 TVirtualMC::GetMC()->Gspos("BRS1", 2, "ALIC", 430.+3., -190., 0., 0, "ONLY");
1153
1154 rbox[0] = 3.0;
1155 rbox[1] = 145./4.;
1156 rbox[2] = 25.0;
1157 TVirtualMC::GetMC()->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
1158
1159 TVirtualMC::GetMC()->Gspos("BRS4", 1, "ALIC", 430.+3., -190.+55./2.+rbox[1], 224., 0, "ONLY");
1160 TVirtualMC::GetMC()->Gspos("BRS4", 2, "ALIC", 430.+3., -190.+55./2.+rbox[1], -224., 0, "ONLY");
b9c35690 1161
1162 //
1163 // The Backframe
1164 //
1165 // Inner radius
1166 Float_t kBFMRin = 270.0;
1167 // Outer Radius
1168 Float_t kBFMRou = 417.5;
1169 // Width
1170 Float_t kBFMdz = 118.0;
1171 //
1172 //
1173 // Rings
1174 Float_t kBFRdr = 7.5;
1175 Float_t kBFRdz = 8.0;
1176 //
1177 //
1178 // Bars and Spokes
1179 //
1180 Float_t kBFBd = 8.0;
1181 Float_t kBFBdd = 0.6;
1182
1183
1184 // The Mother volume
1185 Float_t tpar[3];
1186 tpar[0] = kBFMRin;
1187 tpar[1] = kBFMRou;
1188 tpar[2] = kBFMdz / 2.;
1189 TVirtualMC::GetMC()->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);
1190
1191 // CBL ////////////////////////////////////////////////////////
1192 //
1193 // TRD mother volume
1194 //
1195
1196 ptrd1[0] = 47.4405 - 0.3;
1197 ptrd1[1] = 61.1765 - 0.3;
1198 ptrd1[2] = kBFMdz / 2.;
1199 ptrd1[3] = 38.95;
1200 TVirtualMC::GetMC()->Gsvolu("BFTRD", "TRD1", kAir, ptrd1, 4);
1201 gGeoManager->GetVolume("BFTRD")->SetVisibility(kFALSE);
1202
1203 for (i = 0; i < 18; i++) {
1204
1205 Float_t phiBF = i * 20.0;
1206 dx = TMath::Sin(phiBF*kdeg2rad)*(342.0-12.62);
1207 dy = -TMath::Cos(phiBF*kdeg2rad)*(342.0-12.62);
1208 TVirtualMC::GetMC()->Gspos("BFTRD",i,"BFMO",dx,dy,0.0,idrotm[2034+i],"ONLY");
1209
1210 }
1211
1212 // CBL ////////////////////////////////////////////////////////
1213
1214 // Rings
1215 //
1216 // Inner Ring
1217 tpar[0] = kBFMRin;
1218 tpar[1] = tpar[0] + kBFRdr;
1219 tpar[2] = kBFRdz / 2.;
1220
1221 TVirtualMC::GetMC()->Gsvolu("BFIR", "TUBE", kSteel, tpar, 3);
1222
1223 tpar[0] = tpar[0] + kBFBdd;
1224 tpar[1] = tpar[1] - kBFBdd;
1225 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
1226
1227 TVirtualMC::GetMC()->Gsvolu("BFII", "TUBE", kAir, tpar, 3);
1228 TVirtualMC::GetMC()->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");
1229
1230 //
1231 // Outer RING
1232 tpar[0] = kBFMRou - kBFRdr + 0.1;
1233 tpar[1] = kBFMRou;
1234 tpar[2] = kBFRdz / 2.;
1235
1236 TVirtualMC::GetMC()->Gsvolu("BFOR", "TUBE", kSteel, tpar, 3);
1237
1238 tpar[0] = tpar[0] + kBFBdd;
1239 tpar[1] = tpar[1] - kBFBdd;
1240 tpar[2] = (kBFRdz - 2. * kBFBdd) / 2.;
1241
1242 TVirtualMC::GetMC()->Gsvolu("BFOO", "TUBE", kAir, tpar, 3);
1243 TVirtualMC::GetMC()->Gspos("BFOO", 1, "BFOR", 0., 0., 0., 0, "ONLY");
1244
1245
1246 dz = kBFMdz/2. - kBFRdz / 2.;
1247 TVirtualMC::GetMC()->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1248 TVirtualMC::GetMC()->Gspos("BFIR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1249 TVirtualMC::GetMC()->Gspos("BFOR", 1, "BFMO", 0., 0., dz, 0, "ONLY");
1250 TVirtualMC::GetMC()->Gspos("BFOR", 2, "BFMO", 0., 0., -dz, 0, "ONLY");
1251
1252 //
1253 // Longitudinal Bars
1254 //
1255 Float_t bpar[3];
1256
1257 bpar[0] = kBFBd/2;
1258 bpar[1] = bpar[0];
1259 bpar[2] = kBFMdz/2. - kBFBd;
1260 TVirtualMC::GetMC()->Gsvolu("BFLB", "BOX ", kSteel, bpar, 3);
1261
1262 bpar[0] = bpar[0] - kBFBdd;
1263 bpar[1] = bpar[1] - kBFBdd;
1264 bpar[2] = bpar[2] - kBFBdd;
1265 TVirtualMC::GetMC()->Gsvolu("BFLL", "BOX ", kAir, bpar, 3);
1266 TVirtualMC::GetMC()->Gspos("BFLL", 1, "BFLB", 0., 0., 0., 0, "ONLY");
1267
1268 for (i = 0; i < 18; i++)
1269 {
1270 Float_t ro = kBFMRou - kBFBd / 2. - 0.02;
1271 Float_t ri = kBFMRin + kBFBd / 2.;
1272
1273 Float_t phi0 = Float_t(i) * 20.;
1274
1275 Float_t xb = ri * TMath::Cos(phi0 * kDegrad);
1276 Float_t yb = ri * TMath::Sin(phi0 * kDegrad);
1277 AliMatrix(idrotm[2090+i], 90.0, phi0, 90.0, phi0 + 270., 0., 0.);
1278
1279 TVirtualMC::GetMC()->Gspos("BFLB", i + 1, "BFMO", xb, yb, 0., idrotm[2090 + i], "ONLY");
1280
1281 xb = ro * TMath::Cos(phi0 * kDegrad);
1282 yb = ro * TMath::Sin(phi0 * kDegrad);
1283
1284 TVirtualMC::GetMC()->Gspos("BFLB", i + 19, "BFMO", xb, yb, 0., idrotm[2090 +i], "ONLY");
1285 }
1286
1287 //
1288 // Radial Bars
1289 //
1290 bpar[0] = (kBFMRou - kBFMRin - 2. * kBFRdr) / 2.;
1291 bpar[1] = kBFBd/2;
1292 bpar[2] = bpar[1];
1293 //
1294 // Avoid overlap with circle
1295 Float_t rr = kBFMRou - kBFRdr;
1296 Float_t delta = rr - TMath::Sqrt(rr * rr - kBFBd * kBFBd / 4.) + 0.01;
1297 bpar[0] -= delta /2.;
1298
1299
1300 TVirtualMC::GetMC()->Gsvolu("BFRB", "BOX ", kSteel, bpar, 3);
1301
1302 bpar[0] = bpar[0] - kBFBdd;
1303 bpar[1] = bpar[1] - kBFBdd;
1304 bpar[2] = bpar[2] - kBFBdd;
1305 TVirtualMC::GetMC()->Gsvolu("BFRR", "BOX ", kAir, bpar, 3);
1306 TVirtualMC::GetMC()->Gspos("BFRR", 1, "BFRB", 0., 0., 0., 0, "ONLY");
1307
1308 Int_t iphi[10] = {0, 1, 3, 6, 8, 9, 10, 12, 15, 17};
1309
1310 for (i = 0; i < 10; i++)
1311 {
1312
1313 Float_t rb = (kBFMRin + kBFMRou)/2.;
1314 Float_t phib = Float_t(iphi[i]) * 20.;
1315
1316 Float_t xb = rb * TMath::Cos(phib * kDegrad);
1317 Float_t yb = rb * TMath::Sin(phib * kDegrad);
1318
1319 TVirtualMC::GetMC()->Gspos("BFRB", i + 1, "BFMO", xb, yb, dz, idrotm[2034 + iphi[i]], "ONLY");
1320 TVirtualMC::GetMC()->Gspos("BFRB", i + 11, "BFMO", xb, yb, -dz, idrotm[2034 + iphi[i]], "ONLY");
1321
1322 }
1323
1324 TVirtualMC::GetMC()->Gspos("BFMO", i + 19, "ALIC", 0, 0, - 376. - kBFMdz/2. - 0.5 , 0, "ONLY");
1325
1326
1327
1328//
1329//
1330// The Baby Frame
1331//
1332//
1333 //
1334 // Inner radius
1335 Float_t kBBMRin = 278.0;
1336 // Outer Radius
1337 Float_t kBBMRou = 410.5;
1338 // Width
1339 Float_t kBBMdz = 223.0;
1340 Float_t kBBBdz = 6.0;
1341 Float_t kBBBdd = 0.6;
1342
1343
1344 // The Mother volume
1345
1346 ppgon[0] = 0.;
1347 ppgon[1] = 360.;
1348 ppgon[2] = 18.;
1349
1350 ppgon[3] = 2.;
1351 ppgon[4] = -kBBMdz / 2. ;
1352 ppgon[5] = kBBMRin;
1353 ppgon[6] = kBBMRou;
1354
1355 ppgon[7] = -ppgon[4];
1356 ppgon[8] = ppgon[5];
1357 ppgon[9] = ppgon[6];
1358
1359 TVirtualMC::GetMC()->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
1360 TVirtualMC::GetMC()->Gsdvn("BBCE", "BBMO", 18, 2);
1361
1362 // CBL ////////////////////////////////////////////////////////
1363 //
1364 // TRD mother volume
1365 //
1366
1367 AliMatrix(idrotm[2092], 90.0, 90.0, 0.0, 0.0, 90.0, 0.0);
1368
1369 ptrd1[0] = 47.4405 - 2.5;
1370 ptrd1[1] = 61.1765 - 2.5;
1371 ptrd1[2] = kBBMdz / 2.;
1372 ptrd1[3] = 38.95;
1373 TVirtualMC::GetMC()->Gsvolu("BBTRD", "TRD1", kAir, ptrd1, 4);
1374 gGeoManager->GetVolume("BBTRD")->SetVisibility(kFALSE);
1375 TVirtualMC::GetMC()->Gspos("BBTRD", 1, "BBCE", 342.0-12.62, 0.0, 0.0, idrotm[2092], "ONLY");
1376
1377 // CBL ////////////////////////////////////////////////////////
1378
1379 // Longitudinal bars
1380 bpar[0] = kBBBdz/2.;
1381 bpar[1] = bpar[0];
1382 bpar[2] = kBBMdz/2. - kBBBdz;
1383 TVirtualMC::GetMC()->Gsvolu("BBLB", "BOX ", kSteel, bpar, 3);
1384 bpar[0] -= kBBBdd;
1385 bpar[1] -= kBBBdd;
1386 bpar[2] -= kBBBdd;
1387 TVirtualMC::GetMC()->Gsvolu("BBLL", "BOX ", kAir, bpar, 3);
1388 TVirtualMC::GetMC()->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY");
1389
1390 dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
1391 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1392 TVirtualMC::GetMC()->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1393
1394 dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
1395 dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
1396
1397 TVirtualMC::GetMC()->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1398
1399 //
1400 // Radial Bars
1401 //
1402 bpar[0] = (kBBMRou - kBBMRin) / 2. - kBBBdz;
1403 bpar[1] = kBBBdz/2;
1404 bpar[2] = bpar[1];
1405
1406 TVirtualMC::GetMC()->Gsvolu("BBRB", "BOX ", kSteel, bpar, 3);
1407 bpar[0] -= kBBBdd;
1408 bpar[1] -= kBBBdd;
1409 bpar[2] -= kBBBdd;
1410 TVirtualMC::GetMC()->Gsvolu("BBRR", "BOX ", kAir, bpar, 3);
1411 TVirtualMC::GetMC()->Gspos("BBRR", 1, "BBRB", 0., 0., 0., 0, "ONLY");
1412
1413
1414 dx = (kBBMRou + kBBMRin) / 2.;
1415 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1416 dz = kBBMdz/2. - kBBBdz / 2.;
1417
1418 TVirtualMC::GetMC()->Gspos("BBRB", 1, "BBCE", dx, dy, dz, idrotm[2052], "ONLY");
1419 TVirtualMC::GetMC()->Gspos("BBRB", 2, "BBCE", dx, dy, - dz, idrotm[2052], "ONLY");
1420 TVirtualMC::GetMC()->Gspos("BBRB", 3, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");
1421
1422 //
1423 // Circular bars
1424 //
1425 // Inner
1426
1427 bpar[1] = kBBMRin * TMath::Sin(10. * kDegrad);
1428 bpar[0] = kBBBdz/2;
1429 bpar[2] = bpar[0];
1430 TVirtualMC::GetMC()->Gsvolu("BBC1", "BOX ", kSteel, bpar, 3);
1431 bpar[0] -= kBBBdd;
1432 bpar[1] -= kBBBdd;
1433 bpar[2] -= kBBBdd;
1434 TVirtualMC::GetMC()->Gsvolu("BBC2", "BOX ", kAir, bpar, 3);
1435 TVirtualMC::GetMC()->Gspos("BBC2", 1, "BBC1", 0., 0., 0., 0, "ONLY");
1436 dx = kBBMRin + kBBBdz/2;
1437 dy = 0.;
1438 TVirtualMC::GetMC()->Gspos("BBC1", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1439 TVirtualMC::GetMC()->Gspos("BBC1", 2, "BBCE", dx, dy, -dz, 0, "ONLY");
1440 //
1441 // Outer
1442 bpar[1] = (kBBMRou - kBBBdz) * TMath::Sin(10. * kDegrad);
1443 bpar[0] = kBBBdz/2;
1444 bpar[2] = bpar[0];
1445 TVirtualMC::GetMC()->Gsvolu("BBC3", "BOX ", kSteel, bpar, 3);
1446 bpar[0] -= kBBBdd;
1447 bpar[1] -= kBBBdd;
1448 bpar[2] -= kBBBdd;
1449 TVirtualMC::GetMC()->Gsvolu("BBC4", "BOX ", kAir, bpar, 3);
1450 TVirtualMC::GetMC()->Gspos("BBC4", 1, "BBC3", 0., 0., 0., 0, "ONLY");
1451 dx = kBBMRou - kBBBdz/2;
1452 dy = 0.;
1453 TVirtualMC::GetMC()->Gspos("BBC3", 1, "BBCE", dx, dy, dz, 0, "ONLY");
1454 TVirtualMC::GetMC()->Gspos("BBC3", 2, "BBCE", dx, dy, - dz, 0, "ONLY");
1455 //
1456 // Diagonal Bars
1457 //
1458 h = (kBBMRou - kBBMRin - 2. * kBBBdz);;
1459 d = kBBBdz;
1460 dz = kBBMdz/2. - 1.6 * kBBBdz;
1461 dq = h*h+dz*dz;
1462
1463 x = TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
1464
1465
1466 theta = kRaddeg * TMath::ACos(x);
1467
1468 ptrap[0] = dz/2.;
1469 ptrap[1] = theta;
1470 ptrap[2] = 0.;
1471 ptrap[3] = d/2;
1472 ptrap[4] = d/x/2;
1473 ptrap[5] = ptrap[4];
1474 ptrap[6] = 0;
1475 ptrap[7] = ptrap[3];
1476 ptrap[8] = ptrap[4];
1477 ptrap[9] = ptrap[4];
1478 ptrap[10] = 0;
1479 TVirtualMC::GetMC()->Gsvolu("BBD1", "TRAP", kSteel, ptrap, 11);
1480 ptrap[3] = d/2-kBBBdd;
1481 ptrap[4] = (d/2-kBBBdd)/x;
1482 ptrap[5] = ptrap[4];
1483 ptrap[7] = ptrap[3];
1484 ptrap[8] = ptrap[4];
1485 ptrap[9] = ptrap[4];
1486 TVirtualMC::GetMC()->Gsvolu("BBD3", "TRAP", kAir, ptrap, 11);
1487 TVirtualMC::GetMC()->Gspos("BBD3", 1, "BBD1", 0.0, 0.0, 0., 0, "ONLY");
1488 dx = (kBBMRou + kBBMRin) / 2.;
1489 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1490 TVirtualMC::GetMC()->Gspos("BBD1", 1, "BBCE", dx, dy, dz/2. + kBBBdz/2., idrotm[2052], "ONLY");
1491
1492
1493 ptrap[0] = dz/2.;
1494 ptrap[1] = -theta;
1495 ptrap[2] = 0.;
1496 ptrap[3] = d/2;
1497 ptrap[4] = d/2/x;
1498 ptrap[5] = ptrap[4];
1499 ptrap[6] = 0;
1500 ptrap[7] = ptrap[3];
1501 ptrap[8] = ptrap[4];
1502 ptrap[9] = ptrap[4];
1503 ptrap[10] = 0;
1504 TVirtualMC::GetMC()->Gsvolu("BBD2", "TRAP", kSteel, ptrap, 11);
1505 ptrap[3] = d/2-kBBBdd;
1506 ptrap[4] = (d/2-kBBBdd)/x;
1507 ptrap[5] = ptrap[4];
1508 ptrap[7] = ptrap[3];
1509 ptrap[8] = ptrap[4];
1510 ptrap[9] = ptrap[4];
1511 TVirtualMC::GetMC()->Gsvolu("BBD4", "TRAP", kAir, ptrap, 11);
1512 TVirtualMC::GetMC()->Gspos("BBD4", 1, "BBD2", 0.0, 0.0, 0., 0, "ONLY");
1513 dx = (kBBMRou + kBBMRin) / 2.;
1514 dy = ((kBBMRou + kBBMRin)/ 2) * TMath::Tan(10 * kDegrad) - kBBBdz / 2./ TMath::Cos(10 * kDegrad);
1515 TVirtualMC::GetMC()->Gspos("BBD2", 1, "BBCE", dx, dy, -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");
1516
1517
1518 TVirtualMC::GetMC()->Gspos("BBMO", 1, "ALIC", 0., 0., + 376. + kBBMdz / 2. + 0.5, 0, "ONLY");
1519
1520
1521}
1522
1523//___________________________________________
1524void AliFRAMEv3::AddAlignableVolumes() const
1525{
1526 // Add the 18 spaceframe sectors as alignable volumes
1527 TString basesymname("FRAME/Sector");
1528 TString basevolpath("ALIC_1/B077_1/BSEGMO");
1529 TString symname;
1530 TString volpath;
1531
1532 for(Int_t sec=0; sec<18; sec++)
1533 {
1534 symname = basesymname;
1535 symname += sec;
1536 volpath = basevolpath;
1537 volpath += sec;
1538 volpath += "_1";
1539 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1540 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",
1541 symname.Data(),volpath.Data()));
1542 }
1543}
1544
1545//___________________________________________
1546void AliFRAMEv3::CreateMaterials()
1547{
1548 // Creates the materials
1549 Float_t epsil, stemax, tmaxfd, deemax, stmin;
1550
1551 epsil = 1.e-4; // Tracking precision,
1552 stemax = -0.01; // Maximum displacement for multiple scat
1553 tmaxfd = -20.; // Maximum angle due to field deflection
1554 deemax = -.3; // Maximum fractional energy loss, DLS
1555 stmin = -.8;
1556 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
1557 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
1558
1559
1560 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1561 Float_t zsteel[4] = { 26.,24.,28.,14. };
1562 Float_t wsteel[4] = { .715,.18,.1,.005 };
1563
1564 //Air
1565
1566 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1567 Float_t zAir[4]={6.,7.,8.,18.};
1568 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1569 Float_t dAir = 1.20479E-3;
1570
a9bfe689 1571 // G10
1572 // G10 60% SiO2 40% epoxy
1573 Float_t ag10[4]= {12.01, 1., 15.994, 28.086};
1574 Float_t zg10[4] = { 6., 1., 8., 14.};
1575 Float_t wg10[4] = {0.194, 0.023, 0.443, 0.340};
1576
1577
1578 AliMixture(22, "G10", ag10, zg10, 1.7 , 4, wg10);
1579
87829bcb 1580 AliMixture(65, "STEEL$", asteel, zsteel, 7.88, 4, wsteel);
1581 AliMixture(5, "AIR$ ", aAir, zAir, dAir,4, wAir);
b9c35690 1582 AliMaterial(9, "ALU ", 26.98, 13., 2.7, 8.9, 37.2);
1583
87829bcb 1584 AliMedium(65, "Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
b9c35690 1585 AliMedium( 5, "Air", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
1586 AliMedium( 9, "Aluminum", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
a9bfe689 1587 AliMedium(22, "G10", 22, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
b9c35690 1588
1589}
1590
1591//_____________________________________________________________________________
1592void AliFRAMEv3::Init()
1593{
1594 //
1595 // Initialise the module after the geometry has been defined
1596 //
1597 if(AliLog::GetGlobalDebugLevel()>0) {
1598 printf("%s: **************************************"
1599 " FRAME "
1600 "**************************************\n",ClassName());
1601 printf("\n%s: Version 2 of FRAME initialised, symmetric FRAME\n\n",ClassName());
1602 printf("%s: **************************************"
1603 " FRAME "
1604 "**************************************\n",ClassName());
1605 }
1606//
1607// The reference volume id
1608 fRefVolumeId1 = TVirtualMC::GetMC()->VolId("BREF1");
1609 fRefVolumeId2 = TVirtualMC::GetMC()->VolId("BREF2");
1610}
1611
1612Int_t AliFRAMEv3::IsVersion() const
1613{
1614 // Returns the version of the FRAME (1 if no holes, 0 otherwise)
1615 Int_t version = 0;
1616 if (fHoles == 0) version = 1;
1617 return version;
1618}
1619
1620void AliFRAMEv3::StepManager()
1621{
1622//
1623// Stepmanager of AliFRAMEv3.cxx
1624// Used for recording of reference tracks entering the spaceframe mother volume
1625//
1626 Int_t copy, id;
1627
1628 //
1629 // Only charged tracks
1630 if( !(TVirtualMC::GetMC()->TrackCharge()) ) return;
1631 //
1632 // Only tracks entering mother volume
1633 //
1634
1635 id=TVirtualMC::GetMC()->CurrentVolID(copy);
1636
1637 if ((id != fRefVolumeId1) && (id != fRefVolumeId2)) return;
1638 if(!TVirtualMC::GetMC()->IsTrackEntering()) return;
1639 //
1640 // Add the reference track
1641 //
1642 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kFRAME);
1643}
1644
1645
1646
1647void AliFRAMEv3::MakeHeatScreen(const char* name, Float_t dyP, Int_t rot1, Int_t rot2)
1648{
1649 // Heat screen panel
1650 //
1651 Int_t *idtmed = fIdtmed->GetArray()-1999;
1652 const Int_t kAir = idtmed[2004];
1653 const Int_t kAlu = idtmed[2008];
1654
1655 Float_t dx, dy;
1656 char mname[16];
1657 char cname [16];
1658 char t1name[16];
1659 char t2name[16];
1660 char t3name[16];
1661 char t4name[16];
1662 char t5name[16];
1663
1664 //
1665 Float_t dxP = 2. * (287. * TMath::Sin(10.* TMath::Pi()/180.) - 2.);
1666 Float_t dzP = 1.05;
1667 //
1668 // Mother volume
1669 Float_t thshM[3];
1670 thshM[0] = dxP / 2.;
1671 thshM[1] = dyP / 2.;
1672 thshM[2] = dzP / 2.;
1673 snprintf(mname, 16, "BTSH_%s", name);
1674 TVirtualMC::GetMC()->Gsvolu(mname, "BOX ", kAir, thshM, 3);
1675 //
1676 // Aluminum sheet
1677 thshM[2] = 0.025;
1678 snprintf(cname, 16, "BTSHA_%s", name);
1679 TVirtualMC::GetMC()->Gsvolu(cname, "BOX ", kAlu, thshM, 3);
1680 TVirtualMC::GetMC()->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
1681 //
1682 // Tubes
1683 Float_t thshT[3];
1684 thshT[0] = 0.4;
1685 thshT[1] = 0.5;
1686 thshT[2] = (dyP / 2. - 8.);
1687 //
1688 snprintf(t1name, 16, "BTSHT1_%s", name);
1689 TVirtualMC::GetMC()->Gsvolu(t1name, "TUBE", kAlu, thshT, 3);
1690 dx = - dxP / 2. + 8. - 0.5;
1691 TVirtualMC::GetMC()->Gspos(t1name, 1, mname, dx, 0., 0.025, rot1);
1692 //
1693 snprintf(t2name, 16, "BTSHT2_%s", name);
1694 snprintf(t3name, 16, "BTSHT3_%s", name);
1695 snprintf(t4name, 16, "BTSHT4_%s", name);
1696 snprintf(t5name, 16, "BTSHT5_%s", name);
1697 thshT[2] = (thshM[1] - 12.);
1698 TVirtualMC::GetMC()->Gsvolu(t2name, "TUBE", kAlu, thshT, 3);
1699 thshT[2] = 7.9/2.;
1700 TVirtualMC::GetMC()->Gsvolu(t3name, "TUBE", kAlu, thshT, 3);
1701 thshT[2] = 23.9/2.;
1702 TVirtualMC::GetMC()->Gsvolu(t4name, "TUBE", kAlu, thshT, 3);
1703
1704 Int_t sig = 1;
1705 Int_t ipo = 1;
1706 for (Int_t i = 0; i < 5; i++) {
1707 sig *= -1;
1708 dx += 8.00;
1709 dy = 4. * sig;
1710 Float_t dy1 = - (thshM[1] - 15.5) * sig;
1711 Float_t dy2 = - (thshM[1] - 7.5) * sig;
1712
1713 TVirtualMC::GetMC()->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
1714 dx += 6.9;
1715 TVirtualMC::GetMC()->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
1716
1717 TVirtualMC::GetMC()->Gspos(t3name, i+1, mname, dx - 3.45, dy1, 0.025, rot2);
1718 TVirtualMC::GetMC()->Gspos(t4name, i+1, mname, dx - 3.45, dy2, 0.025, rot2);
1719 }
1720 dx += 8.;
1721 TVirtualMC::GetMC()->Gspos(t1name, 2, mname, dx, 0., 0.025, rot1);
1722 TVirtualMC::GetMC()->Gspos(t3name, 6, mname, dx - 3.45, -(thshM[1] - 7.5), 0.025, rot2);
1723}
1724
1725
1726
1727void AliFRAMEv3::WebFrame(const char* name, Float_t dHz, Float_t theta0, Float_t phi0)
1728{
1729 //
1730 // Create a web frame element
1731 //
1732 phi0 = 0.;
1733 Int_t *idtmed = fIdtmed->GetArray()-1999;
1734 const Float_t krad2deg = 180. / TMath::Pi();
1735 const Float_t kdeg2rad = 1. / krad2deg;
1736 const Int_t kAir = idtmed[2004];
1737 const Int_t kSteel = idtmed[2064];
1738
1739 Float_t ptrap[11];
1740 char nameA[16];
1741 snprintf(nameA, 16, "%sA", name );
1742
1743 char nameI[16];
1744 snprintf(nameI, 16, "%sI", name );
1745
1746 theta0 *= kdeg2rad;
1747 phi0 *= kdeg2rad;
1748 // Float_t theta = TMath::ATan(TMath::Tan(theta0)/TMath::Sin(phi0));
1749 Float_t theta = TMath::Pi()/2.;
1750 Float_t phi = TMath::ACos(TMath::Cos(theta0) * TMath::Cos(phi0));
1751
1752 if (phi0 < 0) phi = -phi;
1753
1754 phi *= krad2deg;
1755 theta *= krad2deg;
1756
1757 ptrap[0] = dHz/2;
1758 ptrap[2] = theta;
1759 ptrap[1] = phi;
1760 ptrap[3] = 6./cos(theta0 * kdeg2rad)/2.;
1761 ptrap[4] = 1.;
1762 ptrap[5] = ptrap[4];
1763 ptrap[6] = 0;
1764 ptrap[7] = ptrap[3];
1765 ptrap[8] = ptrap[4];
1766 ptrap[9] = ptrap[4];
1767 ptrap[10] = 0;
1768 TVirtualMC::GetMC()->Gsvolu(name, "TRAP", kSteel, ptrap, 11);
1769 TVirtualMC::GetMC()->Gsvolu(nameI, "TRAP", kSteel, ptrap, 11);
1770 ptrap[3] = (6. - 1.)/cos(theta0 * kdeg2rad)/2.;
1771 ptrap[4] = 0.75;
1772 ptrap[5] = ptrap[4];
1773 ptrap[7] = ptrap[3];
1774 ptrap[8] = ptrap[4];
1775 ptrap[9] = ptrap[4];
1776
1777 TVirtualMC::GetMC()->Gsvolu(nameA, "TRAP", kAir, ptrap, 11);
1778 TVirtualMC::GetMC()->Gspos(nameA, 1, name, -0.25, 0.0, 0., 0, "ONLY");
1779 TVirtualMC::GetMC()->Gspos(nameA, 2, nameI, +0.25, 0.0, 0., 0, "ONLY");
a9bfe689 1780 gGeoManager->GetVolume(name)->SetVisContainers();;
1781 gGeoManager->GetVolume(nameI)->SetVisContainers();;
b9c35690 1782}
1783