]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliPIPEvGEO.cxx
Mods for MacOSX 10.4
[u/mrichter/AliRoot.git] / STRUCT / AliPIPEvGEO.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 //  Beam pipe class
20 //  This version uses TGeo
21 //  Author: A.Morsch
22 //-------------------------------------------------------------------------
23
24 #include <Riostream.h>
25
26 #include <TSystem.h>
27 #include <TVirtualMC.h>
28 #include <TGeoManager.h>
29 #include <TGeoVolume.h>
30 #include <TGeoTorus.h>
31 #include <TGeoTube.h>
32 #include <TGeoPcon.h>
33 #include <TGeoCompositeShape.h>
34
35 #include "AliConst.h"
36 #include "AliMagF.h"
37 #include "AliPIPEvGEO.h"
38 #include "AliRun.h"
39  
40 ClassImp(AliPIPEvGEO)
41  
42 //_____________________________________________________________________________
43 AliPIPEvGEO::AliPIPEvGEO()
44 {
45 // Constructor
46 }
47
48 //_____________________________________________________________________________
49 AliPIPEvGEO::AliPIPEvGEO(const char *name, const char *title)
50   : AliPIPE(name,title)
51 {
52 // Constructor
53 }
54
55  
56 //___________________________________________
57 void AliPIPEvGEO::CreateGeometry()
58 {
59 //Begin_Html
60 /*
61 <img src="picts/pipe.gif">
62 */
63 //End_Html
64
65
66 //Begin_Html
67 /*
68 <img src="picts/tree_pipe.gif">
69 */
70 //End_Html
71 //
72 //
73 //  The ALICE central beam-pipe according to drawing         LHCVC2C_0001 
74 //  Drawings of sub-elements:
75 //  
76 //  Pos 7 - Minimised Flange:                                LHCVFX_P0025
77 //  Pos 6 - Standard Flange:                                 STDVFUHV0009
78 //  Pos 8 - Bellow:                                          LHCVBX__0001
79 //
80 //  Absolute z-coordinates -82.0 - 400.0 cm 
81 //  Total length:                                          482.0 cm
82 //  It consists of 3 main parts:
83 //  CP/1 The central Be pipe:                              405.0 cm 
84 //  CP/2 The flange on the non-absorber side:               36.5 cm  
85 //  CP/3 The double-bellow and flange on the absorber side: 40.5 cm 
86 //
87 //
88     if(fDebug) printf("%s: Create PIPEv0 geometry \n",ClassName());
89     Int_t *idtmed = fIdtmed->GetArray();
90     Float_t dz;
91     Float_t cpcon[39];
92     Float_t cpTube[3];
93     Int_t   idrotm[2099];  
94 //
95 // Rotation Matrices
96 //
97 // Rotation by 180 deg
98     AliMatrix(idrotm[2012],90.,180., 90., 90.,180.,  0.);
99
100 //
101     const Float_t kCPz0      = -400.0;
102     const Float_t kCP1Length =  405.0;    
103     const Float_t kCP2Length =   36.6;
104     const Float_t kCP3Length =   40.5;
105     
106     const Float_t kCP2pos    = kCPz0 + kCP2Length / 2.;
107     const Float_t kCP1pos    = kCPz0 + kCP2Length + kCP1Length / 2.;
108     const Float_t kCP3pos    = kCPz0 + kCP2Length + kCP1Length + kCP3Length/2.;
109 ///////////////////
110 //      CP/1     //
111 ///////////////////
112 //  Inner and outer radii of the Be-section [Pos 1]
113     const Float_t kCP1BeRi = 2.90;
114     const Float_t kCP1BeRo = 2.98;
115 //
116 // Be-Stainless Steel adaptor tube [Pos 2] at both ends of the Be-section. Length 5 cm
117     const Float_t kCP1BeStAdaptorLength = 5.00;
118 //
119 // Bulge of the Be-Stainless Steel adaptor Tube [Pos 2]
120     const Float_t kCP1BeStRo = 3.05;
121 //
122 //  Length of bulge [Pos 2]
123     const Float_t kCP1BulgeLength = 0.50;
124 //
125 //  Distance between bulges [Pos 2]
126     const Float_t kCP1BulgeBulgeDistance = 1.00;
127 //
128 // Length of Be-pipe
129     const Float_t kCP1BeLength =  kCP1Length - 2. *  kCP1BeStAdaptorLength;
130 //
131 // CP/1 Mother volume 
132     cpTube[0] = 0.;
133     cpTube[1] = kCP1BeStRo;
134     cpTube[2] = kCP1Length / 2.;
135     gMC->Gsvolu("Q1MO","TUBE", idtmed[kAir], cpTube, 3);    
136     gMC->Gspos("Q1MO", 1, "ALIC", 0., 0., kCP1pos, 0, "ONLY");
137
138 //
139 // CP/1 Be-Section
140 //    
141     cpTube[0] = 0.;
142     cpTube[1] = kCP1BeRo;
143     cpTube[2] = kCP1BeLength / 2.;
144     gMC->Gsvolu("Q1BE","TUBE", idtmed[kBe], cpTube, 3);    
145     cpTube[0] = 0.;
146     cpTube[1] = kCP1BeRi;
147     gMC->Gsvolu("Q1BV","TUBE", idtmed[kVac], cpTube, 3);    
148     gMC->Gspos("Q1BV", 1, "Q1BE", 0., 0., 0., 0, "ONLY");
149     gMC->Gspos("Q1BE", 1, "Q1MO", 0., 0., 0., 0, "ONLY");
150 //
151 //   CP/1 Be-Stainless Steel adaptor tube
152 //
153     cpcon[0 ]  =   0;
154     cpcon[1 ]  = 360;
155     cpcon[2 ]  =  8;
156 //  1 First Bulge 
157     cpcon[3 ]  = - kCP1BeStAdaptorLength / 2.;
158     cpcon[4 ]  = 0.;
159     cpcon[5 ]  = kCP1BeStRo;
160 //  2
161     cpcon[6 ]  = cpcon[3] + kCP1BulgeLength;
162     cpcon[7 ]  = 0.;
163     cpcon[8 ]  = kCP1BeStRo;
164 //  3 
165     cpcon[9 ]  = cpcon[6];
166     cpcon[10]  = 0.;
167     cpcon[11]  = kCP1BeRo;
168 //  4 Between the bulges
169     cpcon[12]  = cpcon[9] + kCP1BulgeBulgeDistance;
170     cpcon[13]  = 0.;
171     cpcon[14]  = kCP1BeRo;
172 //  5 
173     cpcon[15]  = cpcon[12];
174     cpcon[16]  = 0.;
175     cpcon[17]  = kCP1BeStRo;
176 //  6 Second bulge 
177     cpcon[18]  = cpcon[15] + kCP1BulgeLength;
178     cpcon[19]  = 0.;
179     cpcon[20]  = kCP1BeStRo;
180 //  7 
181     cpcon[21]  = cpcon[18] + kCP1BulgeLength;
182     cpcon[22]  = 0.;
183     cpcon[23]  = kCP1BeRo;
184 // 8 Straight piece
185     cpcon[24]  = kCP1BeStAdaptorLength / 2.;
186     cpcon[25]  = 0.;
187     cpcon[26]  = kCP1BeRo;
188 //
189     gMC->Gsvolu("Q1AT","PCON", idtmed[kInox], cpcon, 27);    
190 // 
191 //  Vacuum
192     cpTube[0] =  0.;
193     cpTube[1] = kCP1BeRi;
194     cpTube[2] = -1.;
195     gMC->Gsvolu("Q1AV","TUBE", idtmed[kVac], cpTube, 3);
196     gMC->Gspos("Q1AV", 1, "Q1AT", 0., 0., 0., 0, "ONLY");
197 //  Position adaptor tube at both ends
198     dz = kCP1Length / 2. -  kCP1BeStAdaptorLength / 2.;
199     gMC->Gspos("Q1AT", 1, "Q1MO", 0., 0.,  -dz, 0,            "ONLY");
200     gMC->Gspos("Q1AT", 2, "Q1MO", 0., 0.,   dz, idrotm[2012], "ONLY");
201 //
202 ///////////////////
203 //      CP/2     //
204 ///////////////////
205 //
206 // Fixed Point tube [Pos 5]
207 //
208 // Inner and outer radii of the Stainless Steel pipe    
209     const Float_t kCP2StRi = 2.90;
210     const Float_t kCP2StRo = 2.98;
211 //  
212 // Transition to central Be-pipe (Bulge)   
213 // Length
214     const Float_t kCP2BulgeLength = 0.80;
215 //     
216 // Bulge outer radius
217     const Float_t kCP2BulgeRo = 3.05;
218 //
219 // Fixed Point at z = 391.7 (IP)
220 //
221 // Position of fixed point
222     const Float_t kCP2FixedPointZ = 8.30;
223 //
224 // Outer radius of fixed point
225     const Float_t kCP2FixedPointRo = 3.50;
226 //
227 // Length of fixed point
228     const Float_t kCP2FixedPointLength = 0.60;
229 //
230 // Fixed Flange [Pos 6]    
231 //
232 // Fixed flange outer radius
233     const Float_t kCP2FixedFlangeRo = 7.60;
234 //
235 // Fixed flange inner radius
236     const Float_t kCP2FixedFlangeRi = 3.00;
237 // Fixed flange inner radius bulge
238     const Float_t kCP2FixedFlangeBulgeRi = 2.90;
239 // Fixed flange lengths of sections at inner radius
240     const Float_t  kCP2FixedFlangeRecessLengths[3] ={1., 0.08, 0.9};
241 // Fixed flange length
242     const Float_t kCP2FixedFlangeLength = 1.98;
243 //
244 // Fixed flange bulge
245 // Outer radius
246      const Float_t kCP2FixedFlangeBulgeRo = 3.00;
247 //
248 // Length    
249      const Float_t kCP2FixedFlangeBulgeLength = 2.00;
250 //
251 // CP/2 Mother Volume
252 //
253     cpcon[0 ]  =   0;
254     cpcon[1 ]  = 360;
255     cpcon[2 ]  =  8;
256 //  1 Flange 
257     cpcon[3 ]  = - kCP2Length / 2.;
258     cpcon[4 ]  = 0.;
259     cpcon[5 ]  = kCP2FixedFlangeRo;
260 //  2
261     cpcon[6 ]  = cpcon[3] + kCP2FixedFlangeLength;
262     cpcon[7 ]  = 0.;
263     cpcon[8 ]  = kCP2FixedFlangeRo;
264 //  3 Straight section between Flange and Fixed Point
265     cpcon[9 ]  = cpcon[6];
266     cpcon[10]  = 0.;
267     cpcon[11]  = kCP2FixedFlangeBulgeRo;
268 //  4 
269     cpcon[12]  = cpcon[3] + kCP2FixedPointZ - kCP2FixedPointLength / 2.;
270     cpcon[13]  = 0.;
271     cpcon[14]  = kCP2FixedFlangeBulgeRo;
272 //  5 Fixed Point
273     cpcon[15]  = cpcon[12];
274     cpcon[16]  = 0.;
275     cpcon[17]  = kCP2FixedPointRo;
276 //  6 
277     cpcon[18]  = cpcon[15] + kCP2FixedPointLength;
278     cpcon[19]  = 0.;
279     cpcon[20]  = kCP2FixedPointRo;
280 //  7 Straight section between Fixed Point and transition bulge
281     cpcon[21]  = cpcon[18];
282     cpcon[22]  = 0.;
283     cpcon[23]  = kCP2BulgeRo;
284 //  8
285     cpcon[24]  = kCP2Length / 2.;
286     cpcon[25]  = 0.;
287     cpcon[26]  = kCP2BulgeRo;
288     gMC->Gsvolu("Q2MO","PCON", idtmed[kAir], cpcon, 27);
289     dz =  kCP2pos;
290     gMC->Gspos("Q2MO", 1, "ALIC", 0., 0., dz, 0, "ONLY");
291 //
292 //  CP/2 Fixed Flange [Pos 6] 
293 //
294     cpcon[0 ]  =   0;
295     cpcon[1 ]  = 360;
296     cpcon[2 ]  =   4;
297 //  1 
298     cpcon[3 ]  = - kCP2FixedFlangeLength / 2.;
299     cpcon[4 ]  = 0.;
300     cpcon[5 ]  = kCP2FixedFlangeRo;
301 //  2 
302     cpcon[6 ]  = cpcon[3] + kCP2FixedFlangeRecessLengths[0] + kCP2FixedFlangeRecessLengths[1];
303     cpcon[7 ]  = 0.;
304     cpcon[8 ]  = kCP2FixedFlangeRo;
305 //  3 
306     cpcon[9 ]  = cpcon[6];
307     cpcon[10]  = kCP2FixedFlangeRi;
308     cpcon[11]  = kCP2FixedFlangeRo;
309 //  4 
310     cpcon[12]  = - cpcon[3];
311     cpcon[13]  = kCP2FixedFlangeRi;
312     cpcon[14]  = kCP2FixedFlangeRo;
313     gMC->Gsvolu("Q2FL","PCON", idtmed[kInox], cpcon, 15);    
314 //
315 //  Vacuum to be placed into Fixed Flange
316     cpcon[0 ]  =   0;
317     cpcon[1 ]  = 360;
318     cpcon[2 ]  =   4;
319 //  1 
320     cpcon[3 ]  = - (kCP2FixedFlangeRecessLengths[0] + kCP2FixedFlangeRecessLengths[1]) / 2.;
321     cpcon[4 ]  = 0.;
322     cpcon[5 ]  = kCP2FixedFlangeRi;
323 //  2 
324     cpcon[6 ]  = cpcon[3] + kCP2FixedFlangeRecessLengths[0];
325     cpcon[7 ]  = 0.;
326     cpcon[8 ]  = kCP2FixedFlangeRi; 
327 //  3 Bulge
328     cpcon[9 ]  = cpcon[6];
329     cpcon[10]  = 0.;
330     cpcon[11]  = kCP2FixedFlangeBulgeRi;
331 //  4 
332     cpcon[12]  = -cpcon[3];
333     cpcon[13]  = 0.;
334     cpcon[14]  = kCP2FixedFlangeBulgeRi;
335     gMC->Gsvolu("Q2V1","PCON", idtmed[kVac], cpcon, 15);   
336     dz =  - kCP2FixedFlangeLength / 2. - cpcon[3];
337     gMC->Gspos("Q2V1", 1, "Q2FL", 0., 0., dz, 0, "ONLY");
338 // 
339     dz =  - kCP2Length / 2. +  kCP2FixedFlangeLength / 2.;
340     gMC->Gspos("Q2FL", 1, "Q2MO", 0., 0., dz, 0, "ONLY");
341 //
342 //  CP/2 Beam pipe with fixed point and transition bulges
343 //    
344     cpcon[0 ]  =   0;
345     cpcon[1 ]  = 360;
346     cpcon[2 ]  =  10;
347 //  1 Bulge at transition to flange 
348     cpcon[3 ]  = - (kCP2Length -  kCP2FixedFlangeRecessLengths[0] - kCP2FixedFlangeRecessLengths[1]) / 2.;
349     cpcon[4 ]  = 0.;
350     cpcon[5 ]  = kCP2FixedFlangeBulgeRo;
351 //  2
352     cpcon[6 ]  = cpcon[3] +  kCP2FixedFlangeBulgeLength;
353     cpcon[7 ]  = 0.;
354     cpcon[8 ]  = kCP2FixedFlangeBulgeRo;
355 //  3 Straight section between Bulge and Fixed Point
356     cpcon[9 ]  = cpcon[6];
357     cpcon[10]  = 0.;
358     cpcon[11]  = kCP2StRo;
359 //  4 
360     cpcon[12]  = cpcon[3] + (kCP2FixedPointZ - kCP2FixedFlangeRecessLengths[0] - kCP2FixedFlangeRecessLengths[1])  - kCP2FixedPointLength / 2.;
361     cpcon[13]  = 0.;
362     cpcon[14]  = kCP2StRo;
363 //  5 Fixed Point
364     cpcon[15]  = cpcon[12];
365     cpcon[16]  = 0.;
366     cpcon[17]  = kCP2FixedPointRo;
367 //  6 
368     cpcon[18]  = cpcon[15] + kCP2FixedPointLength;
369     cpcon[19]  = 0.;
370     cpcon[20]  = kCP2FixedPointRo;
371 //  7 Straight section between Fixed Point and transition bulge
372     cpcon[21]  = cpcon[18];
373     cpcon[22]  = 0.;
374     cpcon[23]  = kCP2StRo;
375 //  8
376     cpcon[24]  = - cpcon[3] - kCP2BulgeLength;
377     cpcon[25]  = 0.;
378     cpcon[26]  = kCP2StRo;
379 // 9 Bulge at transition to Be pipe
380     cpcon[27]  = cpcon[24];
381     cpcon[28]  = 0.;
382     cpcon[29]  = kCP2BulgeRo;
383 // 10 
384     cpcon[30]  = - cpcon[3];
385     cpcon[31]  = 0.;
386     cpcon[32]  = kCP2BulgeRo;
387     gMC->Gsvolu("Q2PI","PCON", idtmed[kInox], cpcon, 33);    
388 //
389 //  Vacuum to be place into CP/2 beam pipe
390     cpTube[0] = 0.;
391     cpTube[1] = kCP2StRi;
392     cpTube[2] = -1.;
393     gMC->Gsvolu("Q2V2","TUBE", idtmed[kVac], cpTube, 3);   
394
395     gMC->Gspos("Q2V2", 1, "Q2PI", 0., 0., 0., 0, "ONLY");    
396     dz = (kCP2FixedFlangeRecessLengths[0] + kCP2FixedFlangeRecessLengths[1]) / 2.;
397     gMC->Gspos("Q2PI", 1, "Q2MO", 0., 0., dz, 0, "ONLY");    
398 //
399 ///////////////////
400 //      CP/3     //
401 ///////////////////
402 //
403 // Adaptor tube [Pos 4]
404 // 
405 // Adaptor tube length 
406     const Float_t  kCP3AdaptorTubeLength = 5.50;
407 //
408 // Inner and outer radii
409      const Float_t kCP3AdaptorTubeRi = 2.92;
410      const Float_t kCP3AdaptorTubeRo = 3.00;
411 //
412 // Bulge at transition point
413 // Inner and outer radii
414      const Float_t kCP3AdaptorTubeBulgeRi = 2.90;
415      const Float_t kCP3AdaptorTubeBulgeRo = 3.05;    
416 //
417 // Length of bulge
418     const Float_t  kCP3AdaptorTubeBulgeLength = 0.80;
419 //
420 // Bellow [Pos 8]
421 //
422 //  Total length    
423     const Float_t kCP3BellowLength = 13.00;
424 //  Outer Radius
425     const Float_t kCP3BellowRo = 3.6;
426 //  Inner Radius 
427     const Float_t kCP3BellowRi = 2.8;
428 //  Number of plies
429     const Int_t   kCP3NumberOfPlies = 18;
430 //  Length of undulated region
431     const Float_t kCP3BellowUndulatedLength  = 8.30; 
432 //  Plie thickness
433     const Float_t kCP3PlieThickness = 0.02;   
434 //  Connection Plie radies (at transition been undulated region and beam pipe)
435     const Float_t kCP3ConnectionPlieR = 0.21;
436 //  Plie radius
437 //  const Float_t kCP3PlieR = 0.118286;
438     const Float_t kCP3PlieR = 
439         (kCP3BellowUndulatedLength - 4. *  kCP3ConnectionPlieR + 2. * kCP3PlieThickness + (2. *  kCP3NumberOfPlies - 2.) * kCP3PlieThickness) 
440         / (4. * kCP3NumberOfPlies - 2.);
441 //  Length of connection pipe
442     const Float_t kCP3BellowConnectionLength = 2.35;
443 //
444 //  Tube between bellows [Pos 3]  
445 //    
446 //  Length of tube
447     const Float_t kCP3TubeLength = 4.00;
448 //
449 //  Minimised fixed flange [Pos 7]
450 //  
451 //  Length of flange connection tube
452     const Float_t kCP3FlangeConnectorLength = 5.0 - 1.4;
453 //  Length of Flange
454     const Float_t kCP3FlangeLength = 1.40;
455 //  Outer radius    
456     const Float_t kCP3FlangeRo     = 4.30;
457
458 //
459 // CP/3 Mother volume
460 //
461     cpcon[0 ]  =   0;
462     cpcon[1 ]  = 360;
463     cpcon[2 ]  =  12;
464 //  1 From transition to first bellow
465     cpcon[3 ]  = - kCP3Length / 2.;
466     cpcon[4 ]  = 0.;
467     cpcon[5 ]  = kCP3AdaptorTubeBulgeRo;
468 //  2
469     cpcon[6 ]  = cpcon[3] + kCP3BellowConnectionLength + kCP3AdaptorTubeLength;
470     cpcon[7 ]  = 0.;
471     cpcon[8 ]  = kCP3AdaptorTubeBulgeRo;
472 //  3 First Bellow
473     cpcon[9 ]  = cpcon[6];
474     cpcon[10]  = 0.;
475     cpcon[11]  = kCP3BellowRo;
476 //  4 
477     cpcon[12]  = cpcon[9] +  kCP3BellowUndulatedLength;
478     cpcon[13]  = 0.;
479     cpcon[14]  = kCP3BellowRo;
480 //  5 Connection between the two bellows
481     cpcon[15]  = cpcon[12];
482     cpcon[16]  = 0.;
483     cpcon[17]  = kCP3AdaptorTubeBulgeRo;
484 //  6 
485     cpcon[18]  = cpcon[15] + 2. * kCP3BellowConnectionLength + kCP3TubeLength;
486     cpcon[19]  = 0.;
487     cpcon[20]  = kCP3AdaptorTubeBulgeRo;
488 //  7 Second bellow
489     cpcon[21]  = cpcon[18];
490     cpcon[22]  = 0.;
491     cpcon[23]  = kCP3BellowRo;
492 //  8
493     cpcon[24]  = cpcon[21] + kCP3BellowUndulatedLength;
494     cpcon[25]  = 0.;
495     cpcon[26]  = kCP3BellowRo;
496 //  9 Pipe between second Bellow and Flange 
497     cpcon[27]  = cpcon[24];
498     cpcon[28]  = 0.;
499     cpcon[29]  = kCP3AdaptorTubeBulgeRo;
500 //  10 
501     cpcon[30]  = cpcon[27] + kCP3BellowConnectionLength +  kCP3FlangeConnectorLength;
502     cpcon[31]  = 0.;
503     cpcon[32]  = kCP3AdaptorTubeBulgeRo;
504 //  11 Flange 
505     cpcon[33]  = cpcon[30];
506     cpcon[34]  = 0.;
507     cpcon[35]  = kCP3FlangeRo;
508 //  12 
509     cpcon[36]  = - cpcon[3];
510     cpcon[37]  = 0.;
511     cpcon[38]  = kCP3FlangeRo;
512 //
513     gMC->Gsvolu("Q3MO","PCON", idtmed[kAir], cpcon, 39);
514     dz = kCP3pos;
515     gMC->Gspos("Q3MO", 1, "ALIC", 0., 0., dz, 0, "ONLY");
516 //
517 // CP/3 Adaptor tube
518 //
519     cpcon[0 ]  =   0;
520     cpcon[1 ]  = 360;
521     cpcon[2 ]  =  4;
522 //  1 Bulge at transition
523     cpcon[3 ]  = - kCP3AdaptorTubeLength / 2.;
524     cpcon[4 ]  = 0.;
525     cpcon[5 ]  = kCP3AdaptorTubeBulgeRo;
526 //  2
527     cpcon[6 ]  = cpcon[3] + kCP3AdaptorTubeBulgeLength;
528     cpcon[7 ]  = 0.;
529     cpcon[8 ]  = kCP3AdaptorTubeBulgeRo;
530 //  3 Tube
531     cpcon[9 ]  = cpcon[6];
532     cpcon[10]  = 0.;
533     cpcon[11]  = kCP3AdaptorTubeRo;
534 //  4 
535     cpcon[12]  = - cpcon[3];
536     cpcon[13]  = 0.;
537     cpcon[14]  = kCP3AdaptorTubeRo;
538     gMC->Gsvolu("Q3ATO","PCON", idtmed[kVac], cpcon, 15);
539
540 //  1 Bulge at transition
541     cpcon[4 ]  = kCP3AdaptorTubeBulgeRi;
542 //  2
543     cpcon[7 ]  = kCP3AdaptorTubeBulgeRi;;
544 //  3 Tube
545     cpcon[10]  = kCP3AdaptorTubeRi;
546 //  4 
547     cpcon[13]  = kCP3AdaptorTubeRi;
548
549     gMC->Gsvolu("Q3ATI","PCON", idtmed[kInox], cpcon, 15);
550     gMC->Gspos("Q3ATI", 1, "Q3ATO", 0., 0., 0., 0, "ONLY");
551     dz = - kCP3Length / 2. +  kCP3AdaptorTubeLength / 2.;
552     gMC->Gspos("Q3ATO", 1, "Q3MO", 0., 0., dz, 0, "ONLY");
553 //
554 // CP/3 Bellow section
555 //
556 //    TGeoMedium* mAir    =  gGeoManager->GetMedium("AIR");
557     TGeoMedium* mVacuum =  gGeoManager->GetMedium("VACUUM");    
558     TGeoMedium* mSteel  =  gGeoManager->GetMedium("INOX");        
559 //
560 //  Upper part of the undulation
561     TGeoTorus* plieTorusUO =  new TGeoTorus(kCP3BellowRo - kCP3PlieR, 0. , kCP3PlieR);
562     plieTorusUO->SetName("TorusUO");
563     TGeoTorus* plieTorusUI =  new TGeoTorus(kCP3BellowRo - kCP3PlieR, kCP3PlieR - kCP3PlieThickness, kCP3PlieR);
564     plieTorusUI->SetName("TorusUI");
565     TGeoTube*  plieTubeU   =  new TGeoTube (kCP3BellowRo - kCP3PlieR, kCP3BellowRo, kCP3PlieR / 2.);
566     plieTubeU->SetName("TubeU");
567     
568     TGeoCompositeShape*  upperPlieO = new TGeoCompositeShape("upperPlieO", "TorusUO*TubeU");
569     TGeoCompositeShape*  upperPlieI = new TGeoCompositeShape("upperPlieI", "TorusUI*TubeU");
570  
571     TGeoVolume* wiggleUO = new TGeoVolume("Q3WUO", upperPlieO, mVacuum);
572     TGeoVolume* wiggleUI = new TGeoVolume("Q3WUI", upperPlieI, mSteel);
573     wiggleUO->AddNode(wiggleUI, 1,  new TGeoTranslation(0., 0., 0.));    
574 //
575 // Lower part of the undulation
576     TGeoTorus* plieTorusLO =  new TGeoTorus(kCP3BellowRi + kCP3PlieR, 0. , kCP3PlieR);
577     plieTorusLO->SetName("TorusLO");
578     TGeoTorus* plieTorusLI =  new TGeoTorus(kCP3BellowRi + kCP3PlieR, kCP3PlieR - kCP3PlieThickness, kCP3PlieR);
579     plieTorusLI->SetName("TorusLI");
580     TGeoTube*  plieTubeL   =  new TGeoTube (kCP3BellowRi, kCP3BellowRi + kCP3PlieR, kCP3PlieR);
581     plieTubeL->SetName("TubeL");
582
583     TGeoCompositeShape*  lowerPlieO = new TGeoCompositeShape("lowerPlieO", "TorusLO*TubeL");
584     TGeoCompositeShape*  lowerPlieI = new TGeoCompositeShape("lowerPlieI", "TorusLI*TubeL");
585
586     TGeoVolume* wiggleLO = new TGeoVolume("Q3WLO", lowerPlieO, mVacuum);
587     TGeoVolume* wiggleLI = new TGeoVolume("Q3WLI", lowerPlieI, mSteel);
588     wiggleLO->AddNode(wiggleLI, 1,  new TGeoTranslation(0., 0., 0.));    
589
590 //
591 // Connection between upper and lower part of undulation
592     TGeoVolume* wiggleC1 = new TGeoVolume("Q3WCO1",  
593                                           new TGeoTube(kCP3BellowRi + kCP3PlieR, kCP3BellowRo - kCP3PlieR, kCP3PlieThickness / 2.),
594                                           mSteel);
595     TGeoVolume* wiggleC2 = new TGeoVolume("Q3WCO2",  
596                                           new TGeoTube(kCP3BellowRi + kCP3ConnectionPlieR, kCP3BellowRo - kCP3PlieR, kCP3PlieThickness / 2.),
597                                           mSteel);
598 //
599 // Conncetion between undulated section and beam pipe
600     TGeoTorus* plieTorusCO =  new TGeoTorus(kCP3BellowRi + kCP3ConnectionPlieR, 0. , kCP3ConnectionPlieR);
601     plieTorusCO->SetName("TorusCO");
602     TGeoTorus* plieTorusCI =  new TGeoTorus(kCP3BellowRi + kCP3ConnectionPlieR, kCP3ConnectionPlieR - kCP3PlieThickness, kCP3ConnectionPlieR);
603     plieTorusCI->SetName("TorusCI");
604     TGeoTube*  plieTubeC   =  new TGeoTube (kCP3BellowRi, kCP3BellowRi + kCP3ConnectionPlieR, kCP3ConnectionPlieR);
605     plieTubeC->SetName("TubeC");
606
607     TGeoCompositeShape*  connectionPlieO = new TGeoCompositeShape("connectionPlieO", "TorusCO*TubeC");
608     TGeoCompositeShape*  connectionPlieI = new TGeoCompositeShape("connectionPlieI", "TorusCI*TubeC");
609
610     TGeoVolume* connectionPO = new TGeoVolume("Q3CPO", connectionPlieO, mVacuum);
611     TGeoVolume* connectionPI = new TGeoVolume("Q3CPI", connectionPlieI, mSteel);
612     connectionPO->AddNode(connectionPI, 1,  new TGeoTranslation(0., 0., 0.));    
613 //
614 // Connecting pipes
615     TGeoVolume* connectionPipeO = new TGeoVolume("Q3BECO",  
616                                                  new TGeoTube(0., kCP3AdaptorTubeRo, kCP3BellowConnectionLength / 2.),
617                                                  mVacuum);
618     TGeoVolume* connectionPipeI = new TGeoVolume("Q3BECI",  
619                                                  new TGeoTube(kCP3AdaptorTubeRi, kCP3AdaptorTubeRo, kCP3BellowConnectionLength / 2.),
620                                                  mSteel);
621   
622     connectionPipeO->AddNode(connectionPipeI, 1,  new TGeoTranslation(0., 0., 0.));
623     
624 //
625 // Bellow mother
626     TGeoPcon* bellowMotherPC = new TGeoPcon(0., 360., 6);
627     dz =  - kCP3BellowLength / 2;
628     bellowMotherPC->DefineSection(0, dz, 0.,  kCP3AdaptorTubeRo);
629     dz +=  kCP3BellowConnectionLength;
630     bellowMotherPC->DefineSection(1, dz, 0.,  kCP3AdaptorTubeRo);
631     bellowMotherPC->DefineSection(2, dz, 0.,  kCP3BellowRo);
632     dz =  kCP3BellowLength /2. -  kCP3BellowConnectionLength;;
633     bellowMotherPC->DefineSection(3, dz, 0.,  kCP3BellowRo);
634     bellowMotherPC->DefineSection(4, dz, 0.,  kCP3AdaptorTubeRo);
635     dz +=  kCP3BellowConnectionLength;
636     bellowMotherPC->DefineSection(5, dz, 0.,  kCP3AdaptorTubeRo);
637
638     TGeoVolume* bellowMother = new TGeoVolume("Q3BeMO", bellowMotherPC, mVacuum);
639 //
640 // Add undulations
641     Float_t z0 =  - kCP3BellowLength / 2. +  kCP3BellowConnectionLength + 2. * kCP3ConnectionPlieR - kCP3PlieThickness;
642     Float_t zsh  = 4. *  kCP3PlieR -  2. * kCP3PlieThickness;
643     for (Int_t iw = 0; iw < 18; iw++) {
644         Float_t zpos =  z0 + iw * zsh;  
645         if (iw > 0) 
646             bellowMother->AddNode(wiggleC1,  iw + 1 , new TGeoTranslation(0., 0., zpos + kCP3PlieThickness / 2.));      
647         else
648             bellowMother->AddNode(wiggleC2,  iw + 1 , new TGeoTranslation(0., 0., zpos + kCP3PlieThickness / 2.));      
649
650         zpos += kCP3PlieR;
651         bellowMother->AddNode(wiggleUO, iw + 1,  new TGeoTranslation(0., 0., zpos));    
652
653         zpos += kCP3PlieR;
654         if (iw < 17) 
655             bellowMother->AddNode(wiggleC1,  iw + 19, new TGeoTranslation(0., 0., zpos - kCP3PlieThickness / 2.));
656         else
657             bellowMother->AddNode(wiggleC2,  iw + 19, new TGeoTranslation(0., 0., zpos - kCP3PlieThickness / 2.));
658
659         if (iw < 17) {
660             zpos += kCP3PlieR;
661             bellowMother->AddNode(wiggleLO, iw + 1, new TGeoTranslation(0., 0., zpos -  kCP3PlieThickness));
662         }
663     }
664 //
665 // Add connecting undulation between bellow and connecting pipe
666     dz = - kCP3BellowUndulatedLength / 2. + kCP3ConnectionPlieR;
667     bellowMother->AddNode(connectionPO, 1,  new TGeoTranslation(0., 0.,  dz));
668     bellowMother->AddNode(connectionPO, 2,  new TGeoTranslation(0., 0., -dz));
669 //
670 // Add connecting pipe
671     dz =  - kCP3BellowLength / 2. +  kCP3BellowConnectionLength / 2.;
672     bellowMother->AddNode(connectionPipeO, 1,  new TGeoTranslation(0., 0.,   dz));
673     bellowMother->AddNode(connectionPipeO, 2,  new TGeoTranslation(0., 0.,  -dz));
674 //
675 // Add bellow to CP/3 mother    
676     TGeoVolume* mother = gGeoManager->GetVolume("Q3MO");
677     dz = - kCP3Length / 2. +  kCP3AdaptorTubeLength +  kCP3BellowLength / 2.;
678     mother->AddNode(bellowMother, 1,  new TGeoTranslation(0., 0., dz));
679     dz += (kCP3BellowLength +  kCP3TubeLength);
680     mother->AddNode(bellowMother, 2,  new TGeoTranslation(0., 0., dz));
681 //
682 // Beam pipe section between bellows
683 //
684     cpTube[0] = 0.;
685     cpTube[1] = kCP3AdaptorTubeRo;
686     cpTube[2] = kCP3TubeLength / 2.;
687     gMC->Gsvolu("Q3BCO","TUBE", idtmed[kVac], cpTube, 3);
688
689     cpTube[0] = kCP3AdaptorTubeRi;
690     cpTube[1] = kCP3AdaptorTubeRo;
691     cpTube[2] = kCP3TubeLength / 2.;
692     gMC->Gsvolu("Q3BCI","TUBE", idtmed[kInox], cpTube, 3);
693   
694     gMC->Gspos("Q3BCI", 1, "Q3BCO", 0., 0., 0., 0, "ONLY");
695     dz = - kCP3Length / 2. +   kCP3AdaptorTubeLength +  kCP3BellowLength +  kCP3TubeLength / 2.;
696     gMC->Gspos("Q3BCO", 1, "Q3MO", 0., 0., dz, 0, "ONLY");
697     
698
699 // CP3 Minimised Flange
700 //
701     cpcon[0 ]  =   0;
702     cpcon[1 ]  = 360;
703     cpcon[2 ]  =  4;
704 //  1 Connection Tube
705     cpcon[3 ]  = - (kCP3FlangeConnectorLength + kCP3FlangeLength) / 2.;
706     cpcon[4 ]  = 0.;
707     cpcon[5 ]  = kCP3AdaptorTubeRo;
708 //  2
709     cpcon[6 ]  = cpcon[3] + kCP3FlangeConnectorLength;
710     cpcon[7 ]  = 0.;
711     cpcon[8 ]  = kCP3AdaptorTubeRo;
712 //  3 Flange
713     cpcon[9 ]  = cpcon[6];
714     cpcon[10]  = 0.;
715     cpcon[11]  = kCP3FlangeRo;
716 //  4 
717     cpcon[12]  = - cpcon[3];
718     cpcon[13]  = 0.;
719     cpcon[14]  = kCP3FlangeRo;
720     gMC->Gsvolu("Q3MFO","PCON", idtmed[kVac], cpcon, 15);
721
722     cpcon[4 ]  = cpcon[7 ] = cpcon [10] = cpcon[13] = kCP3AdaptorTubeRi;
723     gMC->Gsvolu("Q3MFI","PCON", idtmed[kInox], cpcon, 15);
724
725     gMC->Gspos("Q3MFI", 1, "Q3MFO", 0., 0., 0., 0, "ONLY");
726     dz =  kCP3Length / 2. - (kCP3FlangeConnectorLength + kCP3FlangeLength) / 2.;
727     gMC->Gspos("Q3MFO", 1, "Q3MO", 0., 0., dz, 0, "ONLY");
728 }
729
730
731
732 //___________________________________________
733 void AliPIPEvGEO::CreateMaterials()
734 {
735   //
736   // Define materials for beam pipe
737   //
738
739   if(fDebug) printf("%s: Create PIPEvGEO materials \n",ClassName());
740   Int_t   isxfld = gAlice->Field()->Integ();
741   Float_t sxmgmx = gAlice->Field()->Max();
742   // Steel (Inox)  
743   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
744   Float_t zsteel[4] = { 26.,24.,28.,14. };
745   Float_t wsteel[4] = { .715,.18,.1,.005 };
746   // AlBe - alloy 
747   Float_t aAlBe[2] = { 26.98, 9.01};
748   Float_t zAlBe[2] = { 13.00, 4.00};
749   Float_t wAlBe[2] = { 0.4, 0.6};
750   //
751   // Polyamid
752   Float_t aPA[4] = {16., 14., 12.,  1.};
753   Float_t zPA[4] = { 8.,  7.,  6.,  1.};
754   Float_t wPA[4] = { 1.,  1.,  6., 11.};
755   //
756   // Air 
757   //
758   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
759   Float_t zAir[4]={6.,7.,8.,18.};
760   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
761   Float_t dAir = 1.20479E-3;
762   Float_t dAir1 = 1.20479E-10;
763
764   //
765   //     Berillium 
766   AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
767   //
768   //     Carbon 
769   AliMaterial(6,  "CARBON$   ", 12.01, 6., 2.265, 18.8, 49.9);
770   //
771   //     Aluminum 
772   AliMaterial(9,  "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
773   //
774   //     Air 
775   AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
776   //
777   //     Vacuum 
778   AliMixture(16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
779   //
780   //     stainless Steel 
781   AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
782   //
783   //     reduced density steel to approximate pump getter material
784   AliMixture(20, "GETTER$", asteel, zsteel, 1.00, 4, wsteel);
785   //     Al-Be alloy
786   //     
787   AliMixture(21, "AlBe$", aAlBe, zAlBe, 2.07, 2, wAlBe);
788   //     Polyamid
789   //   
790   AliMixture(22, "PA$", aPA, zPA, 1.14, -4, wPA);
791   //
792
793   // **************** 
794   //     Defines tracking media parameters. 
795   //
796   Float_t epsil  = .001;    // Tracking precision, 
797   Float_t stemax = -0.01;   // Maximum displacement for multiple scat 
798   Float_t tmaxfd = -20.;    // Maximum angle due to field deflection 
799   Float_t deemax = -.3;     // Maximum fractional energy loss, DLS 
800   Float_t stmin  = -.8;
801   // *************** 
802   //
803   //    Beryllium 
804   
805   AliMedium(5, "BE",       5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
806
807   //    Carbon 
808   AliMedium(6, "C",        6, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
809   //
810   //    Aluminum 
811   AliMedium(9, "ALU",      9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
812   //
813   //    Air 
814   AliMedium(15, "AIR",    15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
815   //
816   //    Vacuum 
817   AliMedium(16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
818   //
819   //    Steel 
820   AliMedium(19, "INOX",   19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
821   //
822   //    Getter 
823   AliMedium(20, "GETTER", 20, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
824   //
825   //   AlBe - Aloy 
826   AliMedium(21, "AlBe"  , 21, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
827   //
828   //   Polyamid
829   AliMedium(22, "PA"  ,   22, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
830
831 }
832
833
834
835
836
837
838
839
840
841