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