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