]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliABSOv3.cxx
190d2cc14684400b85c72a2a3abb9dc90cefb4f1
[u/mrichter/AliRoot.git] / STRUCT / AliABSOv3.cxx
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 // The Front Absorber FA
20 // As built
21 // Author: A.Morsch
22 // andreas.morsch@cern.ch
23 //-------------------------------------------------------------------------
24
25 #include <TVirtualMC.h>
26 #include <TArrayI.h>
27 #include <TGeoVolume.h>
28 #include <TGeoTube.h>
29 #include <TGeoManager.h>
30 #include <TGeoMatrix.h>
31 #include <TGeoCompositeShape.h>
32 #include <TGeoBBox.h>
33 #include <TGeoPgon.h>
34 #include <TGeoTorus.h>
35 #include <TGeoCone.h>
36 #include <TGeoArb8.h>
37
38 #include "AliABSOv3.h"
39 #include "AliConst.h"
40 #include "AliLog.h"
41
42 ClassImp(AliABSOv3)
43  
44 //_____________________________________________________________________________
45 AliABSOv3::AliABSOv3()
46 {
47   //
48   // Default constructor for muon shield
49   //
50 }
51  
52 //_____________________________________________________________________________
53 AliABSOv3::AliABSOv3(const char *name, const char *title)
54   : AliABSO(name,title)
55 {
56   // Standard constructor for muon shield
57   //
58 }
59  
60 //_____________________________________________________________________________
61 void AliABSOv3::CreateGeometry()
62 {
63   // 
64   // Build muon shield geometry
65   //
66   //
67
68     Float_t z, z0, dz;
69 //
70 // The top volume
71 //
72     TGeoVolume* top = gGeoManager->GetVolume("ALIC");
73     
74 //
75 // Translation
76 //
77     TGeoTranslation* vec0 = new TGeoTranslation(0., 0., 0.);
78 //
79 // Media
80 //
81     TGeoMedium* kMedNiW     = gGeoManager->GetMedium("ABSO_Ni/W0");
82     TGeoMedium* kMedNiWsh   = gGeoManager->GetMedium("ABSO_Ni/W3");
83 //
84     TGeoMedium* kMedSteel   = gGeoManager->GetMedium("ABSO_ST_C0");
85     TGeoMedium* kMedSteelSh = gGeoManager->GetMedium("ABSO_ST_C3");
86 //
87     TGeoMedium* kMedAir     = gGeoManager->GetMedium("ABSO_AIR_C0");
88 //
89     TGeoMedium* kMedPb      = gGeoManager->GetMedium("ABSO_PB_C0");
90     TGeoMedium* kMedPbSh    = gGeoManager->GetMedium("ABSO_PB_C2");
91 //
92     TGeoMedium* kMedConcSh  = gGeoManager->GetMedium("ABSO_CC_C2");
93 //
94     TGeoMedium* kMedCH2Sh   = gGeoManager->GetMedium("ABSO_CH2_C2");    
95 //
96     TGeoMedium* kMedC       = gGeoManager->GetMedium("ABSO_C_C0");    
97     TGeoMedium* kMedCsh     = gGeoManager->GetMedium("ABSO_C_C2");    
98 //
99     TGeoMedium* kMedAlu     = gGeoManager->GetMedium("ABSO_ALU_C0");    
100 //
101     TGeoMedium* kMedMg      = gGeoManager->GetMedium("ABSO_MG_C0");    
102 //
103     const Float_t kDegRad = TMath::Pi() / 180.;
104     
105 //
106     TGeoRotation* rotxz  = new TGeoRotation("rotxz",   90.,   0., 90.,  90., 180., 0.);
107 ///////////////////////////////////
108 //                               //
109 //        Front Absorber         //
110 //        Drawing ALIP2A__0106   //
111 //                               //
112 //                               //
113 ///////////////////////////////////
114 // 
115 // Pos  1 Steel Envelope
116 // Pos  2 End Plate
117 // Pos  3 Flange (wrong arrow in the drawing)
118 // Pos  4 W Plate A
119 // Pos  5 W Plate B
120 // Pos  6 Tungsten Tube Part 1
121 // Pos  7 Tungsten Tube Part 2
122 // Pos  8 Tungsten Tube Part 3
123 // Pos  9 Tungsten Tube Part 4
124 // Pos 10 Tungsten Tail
125 // Pos 11 Graphite Cone
126 // Pos 12 Pb       Cone
127 // Pos 13 Concrete Cone
128 // Pos 14 Polyethylene Parts
129 // Pos 15 Steel Plate 25 cm
130 // Pos 16 Steel Plate 31 cm
131 // Pos 17 Magnesium Ring
132 // Pos 18 Composite Ring
133 //
134 //
135 // Mimimum angle of the tracking region
136       const Float_t angle02 = TMath::Tan( 2.   * kDegRad);   
137 // Maximum angle of the tracking region
138       const Float_t angle10 = TMath::Tan(10.   * kDegRad);
139 // Opening angle of W rear plug
140       const Float_t angle03 = TMath::Tan( 3.   * kDegRad);
141 //   
142       const Float_t angle05 = TMath::Tan( 5.   * kDegRad);
143 // Opening angle of the FA snout
144       const Float_t angle24 = TMath::Tan(24.   * kDegRad);
145 // Opneing angle of the inner cone
146       const Float_t angle71 = TMath::Tan(0.697 * kDegRad);
147 // Starting position in z      
148       const Float_t zFa           =   90.0;
149
150 // Pos 1
151 ///////////////////////////////////
152 //    FA Steel Envelope          //
153 //    Drawing ALIP2A__0036       //
154 ///////////////////////////////////
155       // Thickness of the envelope
156       Float_t dSteelEnvelope      =    1.5;
157       // Front cover
158       //
159       // Length
160       Float_t dzSteelEnvelopeFC   =    4.00;
161       // Inner Radius
162       Float_t rInSteelEnvelopeFC1 =  35.90/2.;
163       Float_t rInSteelEnvelopeFC2 = rInSteelEnvelopeFC1 + dzSteelEnvelopeFC * angle10;
164       // Outer Radius
165       Float_t rOuSteelEnvelopeFC1 =  88.97/2.;
166       Float_t rOuSteelEnvelopeFC2 = rOuSteelEnvelopeFC1 + dzSteelEnvelopeFC * angle05;
167       //
168       // 5 deg cone
169       Float_t dzSteelEnvelopeC5   = 168.9;
170       Float_t rInSteelEnvelopeC5  = rOuSteelEnvelopeFC2 - dSteelEnvelope/TMath::Cos(5 * kDegRad);
171       Float_t rOuSteelEnvelopeC5  = rOuSteelEnvelopeFC2;
172       // 10 deg cone
173       Float_t dzSteelEnvelopeC10   = 227.1 - 4.;
174       Float_t rInSteelEnvelopeC10  = 116.22/2.;
175       Float_t rOuSteelEnvelopeC10  = rInSteelEnvelopeC10 + dSteelEnvelope/TMath::Cos(10 * kDegRad);
176       // Rear ring
177       Float_t dzSteelEnvelopeR     =   4.;
178       Float_t rInSteelEnvelopeR2   = 196.3/2.;
179       Float_t rOuSteelEnvelopeR2   = 212.0/2.;
180       Float_t rInSteelEnvelopeR1   = rInSteelEnvelopeR2 - dzSteelEnvelopeR * angle10;
181       Float_t rOuSteelEnvelopeR1   = rInSteelEnvelopeR1 + dSteelEnvelope/TMath::Cos(10 * kDegRad);
182       // Front insert 
183       Float_t dzSteelEnvelopeFI    =  1.;
184       Float_t rInSteelEnvelopeFI   = 42.0/2.;
185       Float_t rOuSteelEnvelopeFI   = 85.0/2.;      
186       
187       TGeoPcon* shFaSteelEnvelopeC = new TGeoPcon(0., 360., 7);
188       z = 0.;
189       // Front cover 
190       shFaSteelEnvelopeC->DefineSection( 0, z, rInSteelEnvelopeFC1, rOuSteelEnvelopeFC1);
191       z += dzSteelEnvelopeFC;
192       shFaSteelEnvelopeC->DefineSection( 1, z, rInSteelEnvelopeFC2, rOuSteelEnvelopeFC2); 
193       // 5 deg cone
194       shFaSteelEnvelopeC->DefineSection( 2, z, rInSteelEnvelopeC5, rOuSteelEnvelopeC5);
195       z += dzSteelEnvelopeC5;
196       shFaSteelEnvelopeC->DefineSection( 3, z, rInSteelEnvelopeC10, rOuSteelEnvelopeC10);
197       // 10 deg cone
198       z += dzSteelEnvelopeC10;
199       shFaSteelEnvelopeC->DefineSection( 4, z, rInSteelEnvelopeR1, rOuSteelEnvelopeR1);
200       // Rear Ring
201       shFaSteelEnvelopeC->DefineSection( 5, z, rInSteelEnvelopeR1, rOuSteelEnvelopeR2);
202       z += dzSteelEnvelopeR;
203       shFaSteelEnvelopeC->DefineSection( 6, z, rInSteelEnvelopeR2, rOuSteelEnvelopeR2);
204       
205       // Insert 
206       shFaSteelEnvelopeC->SetName("steelEnvC");
207       TGeoTube* shFaSteelEnvelopeT = new TGeoTube(rInSteelEnvelopeFI, rOuSteelEnvelopeFI, dzSteelEnvelopeFI);
208       shFaSteelEnvelopeT->SetName("steelEnvT");
209       TGeoCompositeShape*  shFaSteelEnvelope = new TGeoCompositeShape("shFaSteelEnvelope", "steelEnvC-steelEnvT");
210
211       TGeoVolume* voFaSteelEnvelope = new TGeoVolume("AFaSteelEnvelope", shFaSteelEnvelope, kMedSteel);
212  
213 // Pos 2
214 ///////////////////////////////////
215 //    FA End Plate               //
216 //    Drawing ALIP2A__0037       //
217 ///////////////////////////////////
218 //
219 //
220 //    
221 //    Outer dimensions dx, dy, dz
222       Float_t dxEndPlate   = 220.0;
223       Float_t dyEndPlate   = 220.0;      
224       Float_t dzEndPlate   =   6.0;      
225 //    Inner radius
226       Float_t rInEndPlate  =  52.5/2.;
227 //    Insert 
228       Float_t rInEndPlateI = 175.3/2.;
229       Float_t rOuEndPlateI = 212.2/2.;
230       Float_t dzEndPlateI  =   2.0;
231       
232       
233       TGeoBBox* endPlate1 = new TGeoBBox(dxEndPlate/2., dyEndPlate/2., dzEndPlate/2.);
234       endPlate1->SetName("endPlate1");
235
236       TGeoTube* endPlate2 = new TGeoTube(0., rInEndPlate , (dzEndPlate + 0.1) / 2.) ;
237       endPlate2->SetName("endPlate2");
238       TGeoTube* endPlate3 = new TGeoTube(rInEndPlateI, rOuEndPlateI, (dzEndPlateI + 0.1)/2.);
239       endPlate3->SetName("endPlate3");
240
241       TGeoTranslation* tPlate = new TGeoTranslation("tPlate", 0., 0., -dzEndPlateI - 0.05);
242       tPlate->RegisterYourself();
243
244       TGeoCompositeShape*  shFaEndPlate = new TGeoCompositeShape("shFaEndPlate", "endPlate1-(endPlate2+endPlate3:tPlate)");
245       TGeoVolume* voFaEndPlate = new TGeoVolume("AFaEndPlate", shFaEndPlate, kMedSteel);
246
247 // Pos 3
248 ///////////////////////////////////
249 //    FA Flange                  //
250 //    Drawing ALIP2A__0038       //
251 ///////////////////////////////////
252       // Width of the Flange
253       Float_t dzFaFlange   =  2.;
254       // Outer radius
255       Float_t rOuFaFlange  = 41.0/2.;
256       // 1st section
257       Float_t dzFaFlange1  =  0.8;
258       Float_t rInFaFlange1 = 33.4/2.;
259       // 2nd section
260       Float_t dzFaFlange2  =  1.2;
261       Float_t rInFaFlange2 = 36.4/2.;
262
263       TGeoPcon* shFaFlange = new TGeoPcon(0., 360., 4);
264       z = 0;
265       shFaFlange->DefineSection(0, z, rInFaFlange1, rOuFaFlange);
266       z += dzFaFlange1;
267       shFaFlange->DefineSection(1, z, rInFaFlange1, rOuFaFlange);
268       shFaFlange->DefineSection(2, z, rInFaFlange2, rOuFaFlange);
269       z += dzFaFlange2;
270       shFaFlange->DefineSection(3, z, rInFaFlange2, rOuFaFlange);
271
272       TGeoVolume* voFaFlange = new TGeoVolume("AFaFlange", shFaFlange, kMedSteel);
273
274 // Pos 4+5
275 ///////////////////////////////////
276 //    FA W Plate A+B             //
277 //    Drawing ALIP2A__0043       //
278 ///////////////////////////////////
279       // Front Flange
280       Float_t dzFaWPlateF   =  2.00;
281       Float_t rInFaQPlateF  = 20.50;
282       Float_t rOuFaQPlateF  = 40.05;
283       // 1st Central Part 24 deg
284       Float_t dzFaWPlateC1  =  7.95;
285       Float_t rInFaQPlateC1 = 16.35;
286       Float_t rOuFaQPlateC1 =  rOuFaQPlateF + dzFaWPlateF * angle24;
287       // 2nd Central Part 5 deg
288       Float_t dzFaWPlateC2  =  1.05;
289       Float_t rInFaQPlateC2 =  rInFaQPlateC1 + dzFaWPlateC1  * angle10;
290       Float_t rOuFaQPlateC2 =  rOuFaQPlateC1 + dzFaWPlateC1  * angle24;
291       Float_t rInFaQPlateC3 =  17.94;
292       Float_t rOuFaQPlateC3 =  44.49;
293       // Rear Flange
294       Float_t dzFaWPlateR   =  1.00;
295       Float_t rInFaQPlateR  = 21.00;
296       Float_t rOuFaQPlateR  = 42.55;
297       // Lenth of Plate - Rear Flange
298       Float_t dzFaWPlate    = dzFaWPlateF + dzFaWPlateC1 + dzFaWPlateC2;
299       
300       TGeoPcon* shFaWPlateA = new TGeoPcon(0., 360., 7);
301       z = 0.;
302       // Front Flange
303       shFaWPlateA->DefineSection(0, z, rInFaQPlateF, rOuFaQPlateF);
304       z += dzFaWPlateF;
305       shFaWPlateA->DefineSection(1, z, rInFaQPlateF, rOuFaQPlateC1);
306       // 24 deg cone
307       shFaWPlateA->DefineSection(2, z, rInFaQPlateC1, rOuFaQPlateC1);
308       z += dzFaWPlateC1;
309       shFaWPlateA->DefineSection(3, z, rInFaQPlateC2, rOuFaQPlateC2);
310       // 5 deg cone
311       z += dzFaWPlateC2;
312       shFaWPlateA->DefineSection(4, z, rInFaQPlateC3, rOuFaQPlateC3);
313       // Rear Flange
314       shFaWPlateA->DefineSection(5, z, rInFaQPlateR, rOuFaQPlateR);
315       z += dzFaWPlateR;
316       shFaWPlateA->DefineSection(6, z, rInFaQPlateR, rOuFaQPlateR);
317
318       TGeoVolume* voFaWPlateA = new TGeoVolume("AFaWPlateA", shFaWPlateA, kMedNiW);
319       // Inner region with higher transport cuts
320       TGeoPcon* shFaWPlateAI = new TGeoPcon(0., 360., 5);
321       z = 3.;
322       shFaWPlateAI->DefineSection(0, z, rInFaQPlateF + z * angle10, rOuFaQPlateC1 + (z - dzFaWPlateF) * angle24);
323       for (Int_t i = 1; i < 5; i++) {
324           Float_t rmin = shFaWPlateA->GetRmin(i+2);
325           Float_t rmax = shFaWPlateA->GetRmax(i+2) - 3.;        
326           Float_t z    = shFaWPlateA->GetZ(i+2);
327           shFaWPlateAI->DefineSection(i, z, rmin, rmax);
328       }
329       TGeoVolume* voFaWPlateAI = new TGeoVolume("AFaWPlateAI", shFaWPlateAI, kMedNiWsh);
330       voFaWPlateA->AddNode(voFaWPlateAI, 1, vec0);
331       
332 //
333 // Inner Tungsten Shield
334 // Part 1  99.8 cm
335 // Part 2 143.5 cm
336 // Part 3  25.0 cm
337 // Part 4  31.0 cm
338 // ====================
339 //        299.3 cm - 0.6 overlap between Part 1 and Part 2
340 //        298.7 cm
341 // Starting position 499.0 - 298.7 = 200.3
342 // Within C cone:    200.3 -  92.0 = 108.3 = end of straight section of the Graphite Cone
343 //
344       
345 // Pos 6
346 ///////////////////////////////////
347 //    FA Tungsten Tube Part 1    //
348 //    Drawing ALIP2A__0045       //
349 ///////////////////////////////////
350       //
351       // Inner radius
352       Float_t rInFaWTube1C1 =  9.1/2.;
353       // Central part
354       Float_t dzFaWTube1C   = 98.8;
355       Float_t rOuFaWTube1C1 = 13.8/2.;
356       Float_t rOuFaWTube1C2 = 20.7/2.;
357       // Rear Flange 
358       Float_t dzFaWTube1R   =  1.0;
359       Float_t rOuFaWTube1R  = 15.0/2.;
360       // Total length 
361       Float_t dzFaWTube1    = dzFaWTube1C + dzFaWTube1R;
362       
363       TGeoPcon* shFaWTube1 = new TGeoPcon(0., 360., 4);
364       z = 0.;
365       // Central Part
366       shFaWTube1->DefineSection(0, z, rInFaWTube1C1, rOuFaWTube1C1);
367       z += dzFaWTube1C;
368       shFaWTube1->DefineSection(1, z, rInFaWTube1C1, rOuFaWTube1C2);
369       // Rear Flange
370       shFaWTube1->DefineSection(2, z, rInFaWTube1C1, rOuFaWTube1R);
371       z += dzFaWTube1R;
372       shFaWTube1->DefineSection(3, z, rInFaWTube1C1, rOuFaWTube1R);
373       
374       TGeoVolume* voFaWTube1 = new TGeoVolume("AFaWTube1", shFaWTube1, kMedNiWsh);
375       
376 // Pos 7
377 ///////////////////////////////////
378 //    FA Tungsten Tube Part 2    //
379 //    Drawing ALIP2A__0046       //
380 ///////////////////////////////////
381       //
382
383       // Central part
384       Float_t dzFaWTube2C   = 142.9;
385       Float_t rInFaWTube2C1 =   9.10/2.;
386       Float_t rInFaWTube2C2 =  12.58/2.;
387       Float_t rOuFaWTube2C1 =  20.70/2.;
388       Float_t rOuFaWTube2C2 =  30.72/2.;
389       // Front Flange 
390       Float_t dzFaWTube2F   =  0.6;
391       Float_t rInFaWTube2F  = 15.4/2.;
392       // Total length 
393       Float_t dzFaWTube2    = dzFaWTube2C + dzFaWTube2F;
394
395       TGeoPcon* shFaWTube2 = new TGeoPcon(0., 360., 4);
396       z = 0.;
397       // Front Flange
398       shFaWTube2->DefineSection(0, z, rInFaWTube2F, rOuFaWTube2C1);
399       z += dzFaWTube2F;
400       shFaWTube2->DefineSection(1, z, rInFaWTube2F, rOuFaWTube2C1);
401       // Central part
402       shFaWTube2->DefineSection(2, z, rInFaWTube2C1, rOuFaWTube2C1);
403       z += dzFaWTube2C;
404       shFaWTube2->DefineSection(3, z, rInFaWTube2C2, rOuFaWTube2C2);
405
406       TGeoVolume* voFaWTube2 = new TGeoVolume("AFaWTube2", shFaWTube2, kMedNiWsh);
407
408 // Pos 8
409 ///////////////////////////////////
410 //    FA Tungsten Tube Part 3    //
411 //    Drawing ALIP2A__0047       //
412 ///////////////////////////////////
413       Float_t dzFaWTube3    =  25.0;
414       Float_t rInFaWTube3C1 =  12.59/2.;
415       Float_t rInFaWTube3C2 =  13.23/2.;
416       Float_t rOuFaWTube3C1 =  30.60/2.;
417       Float_t rOuFaWTube3C2 =  32.35/2.;
418       TGeoVolume* voFaWTube3 = new TGeoVolume("AFaWTube3", 
419                                               new TGeoCone(dzFaWTube3/2., rInFaWTube3C1, rOuFaWTube3C1, rInFaWTube3C2, rOuFaWTube3C2), 
420                                               kMedNiWsh);
421
422 // Pos 9
423 ///////////////////////////////////
424 //    FA Tungsten Tube Part 4    //
425 //    Drawing ALIP2A__0048       //
426 ///////////////////////////////////
427       Float_t dzFaWTube4    =  31.0;
428       Float_t rInFaWTube4C1 =  13.23/2.;
429       Float_t rInFaWTube4C2 =  13.98/2.;
430       Float_t rOuFaWTube4C1 =  48.80/2.;
431       Float_t rOuFaWTube4C2 =  52.05/2.;
432       TGeoVolume* voFaWTube4 = new TGeoVolume("AFaWTube4", 
433                                               new TGeoCone(dzFaWTube4/2., rInFaWTube4C1, rOuFaWTube4C1, rInFaWTube4C2, rOuFaWTube4C2), 
434                                               kMedNiWsh);
435
436 // Pos 10
437 //
438 // This section has been moved to AliSHILv3
439       
440 //
441 // Pos 11
442 ///////////////////////////////////
443 //    FA Graphite Cone           //
444 //    Drawing ALIP2_0002         //
445 ///////////////////////////////////
446 //
447       // Total length 
448       Float_t dzFaGraphiteCone   = 225.0;
449       // Straight section = start of the 2deg inner cone
450       Float_t dzFaGraphiteConeS  =  108.3;
451       // Inner radius at the front
452       Float_t rInFaGraphiteCone1 =   4.5;
453       // Outer radius at the front
454       Float_t rOuFaGraphiteCone1 =  (zFa + dzFaFlange) * angle10; 
455       // Inner radius at start of inner opening cone
456       Float_t rInFaGraphiteCone2 =   7.0;
457       // Outer radius at start of inner opening cone
458       Float_t rOuFaGraphiteCone2 =  (zFa + dzFaFlange + dzFaGraphiteConeS) * angle10; 
459       // Inner radius the rear 
460       Float_t rInFaGraphiteCone3 =  11.0;
461       // Ouer radius at the rear
462       Float_t rOuFaGraphiteCone3 =  (zFa + dzFaFlange + dzFaGraphiteCone) * angle10; 
463
464       TGeoPcon* shFaGraphiteCone = new TGeoPcon(0., 360., 4);
465       
466       z = 0;
467       // Straight section
468       shFaGraphiteCone->DefineSection(0, z, rInFaGraphiteCone1, rOuFaGraphiteCone1);
469       z += dzFaGraphiteConeS;
470       shFaGraphiteCone->DefineSection(1, z, rInFaGraphiteCone1, rOuFaGraphiteCone2);
471       // 2 deg opening cone
472       shFaGraphiteCone->DefineSection(2, z, rInFaGraphiteCone2, rOuFaGraphiteCone2);
473       z = dzFaGraphiteCone;
474       shFaGraphiteCone->DefineSection(3, z, rInFaGraphiteCone3, rOuFaGraphiteCone3);
475
476       TGeoVolume* voFaGraphiteCone = new TGeoVolume("AFaGraphiteCone", shFaGraphiteCone, kMedCsh);
477       //
478       // Outer region with lower transport cuts
479       dz = 50.;
480       TGeoCone* shFaGraphiteConeO = new TGeoCone(dz/2.,
481                                                  rInFaGraphiteCone1, rOuFaGraphiteCone1, 
482                                                  rInFaGraphiteCone1, rOuFaGraphiteCone1 + dz * angle10);
483       
484       TGeoVolume* voFaGraphiteConeO = new TGeoVolume("AFaGraphiteConeO", shFaGraphiteConeO, kMedC);
485       voFaGraphiteCone->AddNode(voFaGraphiteConeO, 1, new TGeoTranslation(0., 0., dz/2.));
486
487 // Pos 12
488 ///////////////////////////////////
489 //    FA Lead Cone               //
490 //    Drawing ALIP2A__0077       //
491 ///////////////////////////////////
492       // 5 deg cone
493       Float_t dzFaPbCone5   = 168.9;
494       Float_t rInFaPbCone5  =  37.35/2.;
495       Float_t rOuFaPbCone5  =  85.66/2.;      
496       // 10 deg cone
497       Float_t dzFaPbCone10  =  25.9;
498       Float_t rInFaPbCone10 =  rInFaPbCone5 + dzFaPbCone5 * angle10;
499       Float_t rOuFaPbCone10 =  115.2/2.;
500       // end
501       Float_t rInFaPbConeE  =  106.05/2.;
502       Float_t rOuFaPbConeE  =  124.35/2.;
503       // Total length
504       Float_t dzFaPbCone    =  dzFaPbCone5 + dzFaPbCone10;
505
506       TGeoPcon* shFaPbCone = new TGeoPcon(0., 360., 3);
507       z = 0.;
508       // 5 deg cone
509       shFaPbCone->DefineSection(0, z, rInFaPbCone5,  rOuFaPbCone5);
510       z += dzFaPbCone5;
511       // 10 deg cone
512       shFaPbCone->DefineSection(1, z, rInFaPbCone10, rOuFaPbCone10);
513       z += dzFaPbCone10;
514       shFaPbCone->DefineSection(2, z, rInFaPbConeE,  rOuFaPbConeE);
515
516       TGeoVolume* voFaPbCone = new TGeoVolume("AFaPbCone", shFaPbCone, kMedPb);
517       //
518       // Inner region with higher transport cuts
519       TGeoPcon*   shFaPbConeI = MakeShapeFromTemplate(shFaPbCone, 0., -3.);
520       TGeoVolume* voFaPbConeI  = new TGeoVolume("AFaPbConeI", shFaPbConeI, kMedPbSh);
521       voFaPbCone->AddNode(voFaPbConeI, 1, vec0);
522       
523       
524 // Pos 13
525 ///////////////////////////////////
526 //    FA Concrete Cone           //
527 //    Drawing ALIP2A__00xx       //
528 ///////////////////////////////////
529       Float_t dzFaConcreteCone    = 126.;
530       Float_t rOuFaConcreteCone1  = rOuFaGraphiteCone3;
531       Float_t rInFaConcreteCone1  =  11.;
532       Float_t rOuFaConcreteCone2  = rOuFaConcreteCone1 + dzFaConcreteCone * angle10;
533       Float_t rInFaConcreteCone2  = rInFaConcreteCone1 + dzFaConcreteCone * angle02;
534       
535       TGeoVolume* voFaConcreteCone = new TGeoVolume("AFaConcreteCone", 
536                                                     new TGeoCone(dzFaConcreteCone/2., 
537                                                                  rInFaConcreteCone1, rOuFaConcreteCone1, 
538                                                                  rInFaConcreteCone2, rOuFaConcreteCone2), 
539                                                     kMedConcSh);  
540
541 // Pos 14
542 ///////////////////////////////////
543 //    FA Polyethylene Parts      //
544 //    Drawing ALIP2A__0034       //
545 ///////////////////////////////////
546       Float_t dzFaCH2Cone    = 201.;
547       Float_t rInFaCH2Cone1  = 106.0/2.;
548       Float_t rInFaCH2Cone2  = 176.9/2.;      
549       Float_t dFaCH2Cone     = 7.5 / TMath::Cos(10. * kDegRad);
550       
551       TGeoVolume* voFaCH2Cone = new TGeoVolume("AFaCH2Cone", 
552                                                new TGeoCone(dzFaCH2Cone/2., 
553                                                             rInFaCH2Cone1, rInFaCH2Cone1 + dFaCH2Cone,      
554                                                             rInFaCH2Cone2, rInFaCH2Cone2 + dFaCH2Cone),             
555                                                kMedCH2Sh);
556       
557       
558 // Pos 15
559 ///////////////////////////////////
560 //    FA Steel Plate 250 mm      //
561 //    Drawing ALIP2A__00xx       //
562 ///////////////////////////////////     
563       Float_t dzFaSteelCone25   = 25.;
564       Float_t rInFaSteelCone25A = rInFaConcreteCone2;
565       Float_t rOuFaSteelCone25A = rOuFaConcreteCone2;      
566       Float_t rInFaSteelCone25B = rInFaSteelCone25A + dzFaSteelCone25 * angle02;
567       Float_t rOuFaSteelCone25B = rOuFaSteelCone25A + dzFaSteelCone25 * angle10;
568       
569       TGeoVolume* voFaSteelCone25 = new TGeoVolume("AFaSteelCone25", 
570                                                    new TGeoCone(dzFaSteelCone25/2., 
571                                                                 rInFaSteelCone25A, rOuFaSteelCone25A,       
572                                                                 rInFaSteelCone25B, rOuFaSteelCone25B),
573                                                    kMedSteelSh);
574
575 // Pos 16
576 ///////////////////////////////////
577 //    FA Steel Plate 310 mm      //
578 //    Drawing ALIP2A__00xx       //
579 ///////////////////////////////////  
580       Float_t dzFaSteelCone31   = 31.;
581       Float_t rInFaSteelCone31A = rOuFaWTube4C1;;
582       Float_t rOuFaSteelCone31A = rOuFaSteelCone25B;      
583       Float_t rInFaSteelCone31B = rOuFaWTube4C2;
584       Float_t rOuFaSteelCone31B = rOuFaSteelCone31A + dzFaSteelCone31 * angle10;
585       
586       TGeoVolume* voFaSteelCone31 = new TGeoVolume("AFaSteelCone31", 
587                                                    new TGeoCone(dzFaSteelCone31/2., 
588                                                                 rInFaSteelCone31A, rOuFaSteelCone31A,       
589                                                                 rInFaSteelCone31B, rOuFaSteelCone31B),
590                                                    kMedSteelSh);
591       // Outer Rregion with higher transport cuts
592       dz = 5.;
593       TGeoVolume* voFaSteelCone31I = new TGeoVolume("AFaSteelCone31I", 
594                                                     new TGeoCone(dz/2., 
595                                                                  rInFaSteelCone31B - dz * angle03, 
596                                                                  rOuFaSteelCone31B - dz * angle10, 
597                                                                  rInFaSteelCone31B, rOuFaSteelCone31B),
598                                                     kMedSteel);
599       
600       voFaSteelCone31->AddNode(voFaSteelCone31I, 1,  new TGeoTranslation(0., 0., dzFaSteelCone31/2. - dz/2.));
601       
602
603 ///////////////////////////////////
604 //    FA Composite Ring          //
605 //    Drawing ALIP2A__0126       //
606 ///////////////////////////////////  
607       // 1st section
608       Float_t dzFaCompRing1  =  0.8;
609       Float_t rInFaCompRing1 = 11.0/2.;
610       Float_t rOuFaCompRing1 = 32.4/2.;
611       // 2nd section
612       Float_t dzFaCompRing2  =  1.2;
613       Float_t rInFaCompRing2 = 14.0/2.;
614       Float_t rOuFaCompRing2 = 34.3/2.;
615
616       TGeoPcon* shFaCompRing = new TGeoPcon(0., 360., 4);
617       z = 0.;
618       // 1st section
619       shFaCompRing->DefineSection(0, z, rInFaCompRing1, rOuFaCompRing1);
620       z +=  dzFaCompRing1;
621       shFaCompRing->DefineSection(1, z, rInFaCompRing1, rOuFaCompRing1);
622       // 2nd section
623       shFaCompRing->DefineSection(2, z, rInFaCompRing2, rOuFaCompRing2);;
624       z +=  dzFaCompRing2;
625       shFaCompRing->DefineSection(3, z, rInFaCompRing2, rOuFaCompRing2);
626
627       TGeoVolume* voFaCompRing = new TGeoVolume("AFaCompRing", shFaCompRing, kMedC);
628
629 ///////////////////////////////////
630 //    FA Magnesium Ring          //
631 //    Drawing ALIP2A__0127       //
632 ///////////////////////////////////  
633       //
634       // The inner radii
635       // section 1+3
636       Float_t dzFaMgRingO   = 0.7;
637       Float_t rInFaMgRingO  = 3.0;
638       // section 2
639       Float_t dzFaMgRingI   = 0.6;
640       Float_t rInFaMgRingI  = 3.5;
641
642       TGeoPcon* shFaMgRing = new TGeoPcon(0., 360., 8);
643       // 1st section 
644       z = 0.;
645       shFaMgRing->DefineSection(0, z,  rInFaMgRingO, rInFaCompRing1);
646       z += dzFaMgRingO;
647       shFaMgRing->DefineSection(1, z,  rInFaMgRingO, rInFaCompRing1);
648       // 2nd section
649       shFaMgRing->DefineSection(2, z,  rInFaMgRingI, rInFaCompRing1);
650       z +=  dzFaMgRingI/2.;
651       shFaMgRing->DefineSection(3, z,  rInFaMgRingI, rInFaCompRing1);
652       // 3rd section
653       shFaMgRing->DefineSection(4, z,  rInFaMgRingI, rInFaCompRing2);
654       z +=  dzFaMgRingI/2.;
655       shFaMgRing->DefineSection(5, z,  rInFaMgRingI, rInFaCompRing2);
656       // 4th section
657       shFaMgRing->DefineSection(6, z,  rInFaMgRingO, rInFaCompRing2);
658       z += dzFaMgRingO;
659       shFaMgRing->DefineSection(7, z,  rInFaMgRingO, rInFaCompRing2);
660       TGeoVolume* voFaMgRing = new TGeoVolume("AFaMgRing", shFaMgRing, kMedMg);
661
662
663 //
664 //    Absorber mother volume
665 //
666 //
667 // Length of the absorber without endplate
668       Float_t dzFa = dzFaFlange + dzFaGraphiteCone + dzFaConcreteCone + dzFaSteelCone25 + dzFaSteelCone31;
669       TGeoPcon* shFaM = new TGeoPcon(0., 360., 16);
670       // Front -> Flange (Mg Ring details)
671       z = 0.;
672       shFaM->DefineSection( 0, z, rInFaMgRingO,       rOuFaQPlateF);
673       z +=  dzFaMgRingO;
674       dz =  dzFaMgRingO;
675       shFaM->DefineSection( 1, z, rInFaMgRingO,       rOuFaQPlateF +  dz * angle24);
676       shFaM->DefineSection( 2, z, rInFaMgRingI,       rOuFaQPlateF +  dz * angle24);
677       z  += dzFaMgRingI;
678       dz += dzFaMgRingI;
679       shFaM->DefineSection( 3, z, rInFaMgRingI,       rOuFaQPlateF +  dz * angle24);
680       shFaM->DefineSection( 4, z, rInFaMgRingO,       rOuFaQPlateF +  dz * angle24);
681       z +=  dzFaMgRingO;
682       dz += dzFaMgRingO;
683       shFaM->DefineSection( 5, z, rInFaMgRingO,       rOuFaQPlateF +  dz * angle24);
684       shFaM->DefineSection( 6, z, rInFaGraphiteCone1, rOuFaQPlateF +  dz * angle24);
685       // Flange -> W-Plate B
686       z += dzFaWPlateC1;
687       shFaM->DefineSection( 7, z, rInFaGraphiteCone1, rOuFaQPlateC2);
688       z += dzFaWPlateC2;
689       Float_t zFaSteelEnvelope = z;
690       shFaM->DefineSection( 8, z, rInFaGraphiteCone1, rOuFaQPlateC3);
691       // 5 deg cone -> 10 deg cone
692       z  = zFaSteelEnvelope + dzSteelEnvelopeFC  + dzSteelEnvelopeC5;
693       shFaM->DefineSection( 9, z, rInFaGraphiteCone1, rOuSteelEnvelopeC10);
694       // 10 deg cone  up to end of straight section
695       z0 = z;
696       z  = dzFaFlange + dzFaGraphiteConeS + dzFaWTube1C;
697       dz = z - z0;
698       shFaM->DefineSection(10, z, rInFaGraphiteCone1, rOuSteelEnvelopeC10 + dz * angle10);
699       // 0.7 deg inner opening cone up to outer rear ring
700       z0 = z;
701       z = dzFa - dzSteelEnvelopeR/2.;
702       dz = (z - z0);
703       shFaM->DefineSection(11, z,  rInFaGraphiteCone1 +dz * angle71, rOuSteelEnvelopeR1);
704       shFaM->DefineSection(12, z,  rInFaGraphiteCone1 +dz * angle71, rOuSteelEnvelopeR2);
705       z += dzSteelEnvelopeR/2.;
706       shFaM->DefineSection(13, z,  rInFaWTube4C2,                    rOuSteelEnvelopeR2);
707       // Recess for end plate
708       dz = dzSteelEnvelopeR/2;
709       shFaM->DefineSection(14, z,  rInFaCH2Cone2 - dz * angle10,     rOuSteelEnvelopeR2);
710       z += dzSteelEnvelopeR/2.;
711       shFaM->DefineSection(15, z,  rInFaCH2Cone2,                    rOuSteelEnvelopeR2);
712
713       TGeoVolume* voFaM = new TGeoVolume("AFaM", shFaM, kMedAir);
714
715
716 //
717 //    Assemble volumes inside acceptance
718       TGeoPcon* shFaAccM = new TGeoPcon(0., 360., 7);
719       for (Int_t i = 0; i < 4; i++) {
720           Float_t z     = shFaGraphiteCone->GetZ(i);
721           Float_t rmin  = shFaGraphiteCone->GetRmin(i);
722           Float_t rmax  = shFaGraphiteCone->GetRmax(i);
723           shFaAccM->DefineSection(i, z, rmin, rmax);
724       }
725       z  = dzFaGraphiteCone + dzFaConcreteCone + dzFaSteelCone25;
726       z0 = z + zFa + dzFaFlange;
727       shFaAccM->DefineSection(4, z, rOuFaWTube3C2, z0 * angle10);
728       shFaAccM->DefineSection(5, z, rOuFaWTube4C1, z0 * angle10);
729       z  += dzFaSteelCone31;
730       z0 += dzFaSteelCone31;
731       shFaAccM->DefineSection(6, z, rOuFaWTube4C2,  z0 * angle10);
732       TGeoVolume* voFaAccM = new TGeoVolume("AFaAcc", shFaAccM, kMedAir);
733       
734       z = 0;
735       voFaAccM->AddNode(voFaGraphiteCone, 1, vec0);
736       z += dzFaGraphiteCone;
737       voFaAccM->AddNode(voFaConcreteCone, 1, new TGeoTranslation(0., 0., z + dzFaConcreteCone / 2.));
738       z += dzFaConcreteCone;
739       voFaAccM->AddNode(voFaSteelCone25,  1, new TGeoTranslation(0., 0., z + dzFaSteelCone25 / 2. + 0.001));
740       z += dzFaSteelCone25;
741       voFaAccM->AddNode(voFaSteelCone31,  1, new TGeoTranslation(0., 0., z + dzFaSteelCone31 / 2. + 0.001));
742
743 //
744 // Inner shield
745       TGeoVolumeAssembly* voFaInnerShield = new TGeoVolumeAssembly("AFaInnerShield");
746       voFaInnerShield->AddNode(voFaWTube1, 1, vec0);
747       z = dzFaWTube1 - 0.6;
748       voFaInnerShield->AddNode(voFaWTube2, 1, new TGeoTranslation(0., 0., z) );
749       z += dzFaWTube2;
750       voFaInnerShield->AddNode(voFaWTube3, 1, new TGeoTranslation(0., 0., z + dzFaWTube3 / 2.) );
751       z += dzFaWTube3;
752       voFaInnerShield->AddNode(voFaWTube4, 1, new TGeoTranslation(0., 0., z + dzFaWTube4 / 2.) );
753       z = dzFaGraphiteConeS + dzFaFlange;
754       voFaM->AddNode(voFaInnerShield, 1, new TGeoTranslation(0., 0., z));
755
756
757 //
758 //    Adding volumes to mother volume
759 //
760       z = 0.;
761       voFaM->AddNode(voFaWPlateA,       1, vec0);
762       z += dzFaWPlate;
763       voFaM->AddNode(voFaSteelEnvelope, 1, new TGeoTranslation(0., 0., z));
764       z += dzSteelEnvelopeFC;
765       voFaM->AddNode(voFaPbCone,        1, new TGeoTranslation(0., 0., z));
766       z += (dzFaPbCone + dzFaCH2Cone / 2.);
767       voFaM->AddNode(voFaCH2Cone,       1, new TGeoTranslation(0., 0., z));
768       voFaM->AddNode(voFaFlange,   1, vec0);
769       voFaM->AddNode(voFaMgRing,   1, vec0);
770       voFaM->AddNode(voFaCompRing, 1, vec0);
771       voFaM->AddNode(voFaAccM, 1, new TGeoTranslation(0., 0., dzFaFlange));
772
773 ////////////////////////////////////////////////////
774 //                                                // 
775 //    Front Absorber Support Structure FASS       // 
776 //                                                //
777 //    Drawing ALIP2A__0035                        //
778 //    Drawing ALIP2A__0089                        //
779 //    Drawing ALIP2A__0090                        //
780 //    Drawing ALIP2A__0109                        //
781 ////////////////////////////////////////////////////
782       TGeoVolumeAssembly* voFass = new TGeoVolumeAssembly("AFass");
783       const Float_t kFassUBFlangeH = 380.;
784       const Float_t kFassUBFlangeW =  77.;
785
786       const Float_t kFassUMFlangeH = 380.;
787       const Float_t kFassUMFlangeB = 246.;
788       const Float_t kFassUMFlangeT =  10.;
789       const Float_t kFassUMFalpha  = - TMath::ATan((kFassUMFlangeB-kFassUMFlangeT)/ kFassUMFlangeH / 2.) / kDegRad;      
790 // Upper back   flange
791 // B1
792 // 380 x 77
793       TGeoVolume* voFassUBFlange = new TGeoVolume("AFassUBFlange", new TGeoBBox(kFassUBFlangeW/2., 
794                                                                                kFassUBFlangeH/2., 3./2.), kMedSteel);
795       voFass->AddNode(voFassUBFlange, 1, new TGeoTranslation(+1.5 + kFassUBFlangeW/2., 
796                                                              180. + kFassUBFlangeH/2.,
797                                                              kFassUMFlangeB - 1.5));
798       voFass->AddNode(voFassUBFlange, 2, new TGeoTranslation(-1.5 - kFassUBFlangeW/2., 
799                                                              180. + kFassUBFlangeH/2.,
800                                                              kFassUMFlangeB - 1.5));
801
802       
803 // Lower back   flange
804 // Upper median flange
805 //    Drawing ALIP2A__0090                        //
806 //    Drawing ALIP2A__0089                        //
807 //    A2
808
809       TGeoVolume* voFassUMFlange = new TGeoVolume("AFassUMFlange", 
810                                                   new TGeoTrap(kFassUMFlangeH/2., kFassUMFalpha,  
811                                                                0., 1.5, 
812                                                                kFassUMFlangeB/2., kFassUMFlangeB/2.,
813                                                                0., 1.5, 
814                                                                kFassUMFlangeT/2., kFassUMFlangeT/2.,
815                                                                0.), kMedSteel);
816       
817       TGeoRotation* rotFass1 = new TGeoRotation("rotFass1", 180., 0., 90., 0., 90., 90.);
818       voFass->AddNode(voFassUMFlange,1 , 
819                       new TGeoCombiTrans(0., 180. + kFassUMFlangeH/2., -(kFassUMFlangeB+kFassUMFlangeT)/4. + kFassUMFlangeB, 
820                                          rotFass1));
821       
822
823 // Lower median flange
824 //    Drawing ALIP2A__0090                        //
825 //    Drawing ALIP2A__0089                        //
826 //    A1
827       const Float_t kFassLMFlangeH = 242.;
828       const Float_t kFassLMFlangeB = 246.;
829       const Float_t kFassLMFlangeT =  43.;
830       const Float_t kFassLMFalpha  = - TMath::ATan((kFassLMFlangeB-kFassLMFlangeT)/ kFassLMFlangeH / 2.) / kDegRad;
831       TGeoVolume* voFassLMFlange = new TGeoVolume("AFassLMFlange", 
832                                                   new TGeoTrap(kFassLMFlangeH/2., kFassLMFalpha,  
833                                                                0., 1.5, 
834                                                                kFassLMFlangeB/2., kFassLMFlangeB/2.,
835                                                                0., 1.5, 
836                                                                kFassLMFlangeT/2., kFassLMFlangeT/2.,
837                                                                0.), kMedSteel);
838       TGeoRotation* rotFass2 = new TGeoRotation("rotFass2", 180., 0., 90., 0., 90., 270.);
839       voFass->AddNode(voFassLMFlange, 1, 
840                       new TGeoCombiTrans(0., -180. - kFassLMFlangeH/2., -(kFassLMFlangeB+kFassLMFlangeT)/4. + kFassLMFlangeB, 
841                                         rotFass2));
842
843 // Stiffeners
844 // Support Plate
845 //
846 // Central cone
847       TGeoPgon* shFassCone = new TGeoPgon(22.5, 360., 8, 4);
848       shFassCone->DefineSection(0,   0.,   0., 180.);
849       shFassCone->DefineSection(1,   3.,   0., 180.);
850       shFassCone->DefineSection(2,   3., 177., 180.);
851       shFassCone->DefineSection(3, 246., 177., 180.);
852       shFassCone->SetName("FassCone");
853
854       TGeoBBox* shFassWindow = new TGeoBBox( 190., 53., 28.);
855       shFassWindow->SetName("FassWindow");
856       TGeoTranslation* tFassWindow = new TGeoTranslation("tFassWindow", 0., 0., 78.);
857       tFassWindow->RegisterYourself();
858
859       TGeoTube* shFassApperture = new TGeoTube(0., 104., 3.);
860       shFassApperture->SetName("FassApperture");
861       
862       TGeoCompositeShape* shFassCentral = 
863           new TGeoCompositeShape("shFassCentral", "FassCone-(FassWindow:tFassWindow+FassApperture)");
864       
865       TGeoVolume* voFassCentral = new TGeoVolume("AFassCentral", shFassCentral, kMedSteel);
866       voFass->AddNode(voFassCentral, 1, vec0);
867       
868 //
869 // Aluminum ring
870 //
871       TGeoVolume* voFassAlRing = new TGeoVolume("AFassAlRing", new TGeoTube(104., 180., 10.), kMedAlu);
872       
873       
874 //
875 // Assemble the FA
876 //
877 // Inside muon spectrometer acceptance
878 //
879 //    Composite  2 cm
880 //    Graphite 225 cm
881 //    Concrete 126 cm
882 //    Steel     56 cm
883 // ===================
884 //             409 cm
885 // should be   409 cm
886
887
888       
889             
890 //
891 // Absorber and Support
892       TGeoVolumeAssembly* voFA = new TGeoVolumeAssembly("AFA");
893       voFA->AddNode(voFaM,        1, vec0);
894       voFA->AddNode(voFaEndPlate, 1, new TGeoTranslation(0., 0., dzFa + dzEndPlate/2.));
895       voFA->AddNode(voFass, 1, new TGeoTranslation(0., 0., 388.45));
896       voFA->AddNode(voFassAlRing, 1, new TGeoTranslation(0., 0., 382. - 0.55));
897       top->AddNode(voFA, 1, new TGeoCombiTrans(0., 0., -90., rotxz));
898 }
899
900
901 TGeoPcon* AliABSOv3::MakeShapeFromTemplate(TGeoPcon* pcon, Float_t drMin, Float_t drMax)
902 {
903     // 
904     // Returns new shape based on a template changing
905     // the inner radii by drMin and the outer radii by drMax.
906     //
907     Int_t nz = pcon->GetNz();
908     TGeoPcon* cpcon = new TGeoPcon(0., 360., nz);
909     for (Int_t i = 0; i < nz; i++) 
910         cpcon->DefineSection(i, pcon->GetZ(i), pcon->GetRmin(i) + drMin, pcon->GetRmax(i) + drMax);
911     return cpcon;
912 }