]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliPIPEv3.cxx
updae of the GPU framework
[u/mrichter/AliRoot.git] / STRUCT / AliPIPEv3.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
25 #include <Riostream.h>
26
27 #include <TGeoBBox.h>
28 #include <TGeoCompositeShape.h>
29 #include <TGeoCone.h>
30 #include <TGeoGlobalMagField.h>
31 #include <TGeoManager.h>
32 #include <TGeoMatrix.h>
33 #include <TGeoPcon.h>
34 #include <TGeoTorus.h>
35 #include <TGeoTube.h>
36 #include <TGeoVolume.h>
37 #include <TGeoXtru.h>
38 #include <TSystem.h>
39 #include <TVirtualMC.h>
40
41 #include "AliConst.h"
42 #include "AliMagF.h"
43 #include "AliPIPEv3.h"
44 #include "AliRun.h"
45 #include "AliLog.h"
46  
47 ClassImp(AliPIPEv3)
48  
49 //_____________________________________________________________________________
50 AliPIPEv3::AliPIPEv3()
51 {
52 // Constructor
53 }
54
55 //_____________________________________________________________________________
56 AliPIPEv3::AliPIPEv3(const char *name, const char *title)
57   : AliPIPE(name,title)
58 {
59 // Constructor
60 }
61
62  
63 //___________________________________________
64 void AliPIPEv3::CreateGeometry()
65 {
66     AliDebug(1,"Create PIPEv3 geometry");
67 //
68 //  Class describing the beam pipe geometry
69 //
70
71     Float_t dz, z, zsh, z0;
72 //
73 // Rotation Matrices
74 //
75     const Float_t  kDegRad = TMath::Pi() / 180.;
76 // Rotation by 180 deg
77     TGeoRotation* rot180        = new TGeoRotation("rot180", 90., 180.,  90.,  90., 180.,   0.);
78     TGeoRotation* rotyz         = new TGeoRotation("rotyz",  90., 180.,   0., 180.,  90.,  90.);
79     TGeoRotation* rotxz         = new TGeoRotation("rotxz",   0.,   0.,  90.,  90.,  90., 180.);
80     TGeoRotation* rot045        = new TGeoRotation("rot045", 90.,  45.,  90., 135.,   0.,   0.);
81     TGeoRotation* rot135        = new TGeoRotation("rot135", 90. ,135.,  90., 225.,   0.,   0.);
82     TGeoRotation* rot225        = new TGeoRotation("rot225", 90. ,225.,  90., 315.,   0.,   0.);
83     TGeoRotation* rot315        = new TGeoRotation("rot315", 90. ,315.,  90.,  45.,   0.,   0.);    
84 //
85 // Media
86     const TGeoMedium* kMedAir     =  gGeoManager->GetMedium("PIPE_AIR");
87     const TGeoMedium* kMedAirHigh =  gGeoManager->GetMedium("PIPE_AIR_HIGH");
88     const TGeoMedium* kMedVac     =  gGeoManager->GetMedium("PIPE_VACUUM");    
89     const TGeoMedium* kMedInsu    =  gGeoManager->GetMedium("PIPE_INS_C0");    
90     const TGeoMedium* kMedSteel   =  gGeoManager->GetMedium("PIPE_INOX");        
91     const TGeoMedium* kMedBe      =  gGeoManager->GetMedium("PIPE_BE");       
92     const TGeoMedium* kMedCu      =  gGeoManager->GetMedium("PIPE_CU");        
93     const TGeoMedium* kMedKapton  =  gGeoManager->GetMedium("PIPE_KAPTON");        
94     const TGeoMedium* kMedAco     =  gGeoManager->GetMedium("PIPE_ANTICORODAL");        
95     const TGeoMedium* kMedNEG     =  gGeoManager->GetMedium("PIPE_NEG COATING"); 
96        
97 // Top volume
98     TGeoVolume* top    = gGeoManager->GetVolume("ALIC");
99 //
100 //
101 ////////////////////////////////////////////////////////////////////////////////     
102 //                                                                            //
103 //                                  The Central Vacuum system                 // 
104 //                                                                            //
105 ////////////////////////////////////////////////////////////////////////////////
106 //
107 //
108 //  The ALICE central beam-pipe according to drawing         LHCVC2C_0001 
109 //  Drawings of sub-elements:
110 //  
111 //  Pos 7 - Minimised Flange:                                LHCVFX_P0025
112 //  Pos 6 - Standard Flange:                                 STDVFUHV0009
113 //  Pos 8 - Bellow:                                          LHCVBX__0001
114 //
115 //  Absolute z-coordinates -82.0 - 400.0 cm 
116 //  Total length:                                          482.0 cm
117 //  It consists of 3 main parts:
118 //  CP/2 The flange on the non-absorber side:               36.5 cm  
119 //  CP/1 The central Be pipe:                              405.0 cm 
120 //  CP/3 The double-bellow and flange on the absorber side: 40.5 cm 
121 //
122 //
123
124 //
125 //
126 //  Starting position in z
127     const Float_t kCPz0      = -400.0;
128 //  Length of the CP/1 section
129     const Float_t kCP1Length =  405.0;    
130 //  Length of the CP/2 section    
131     const Float_t kCP2Length =   36.5;
132 //  Length of the CP/3 section    
133     const Float_t kCP3Length =   40.5;
134 //  Position of the CP/2 section    
135 //    const Float_t kCP2pos    = kCPz0 + kCP2Length / 2.;
136 //  Position of the CP/3 section
137     const Float_t kCP3pos    = kCPz0 + kCP2Length + kCP1Length + kCP3Length/2.;
138
139
140 ///////////////////
141 //      CP/1     //
142 ///////////////////
143 //  Inner and outer radii of the Be-section [Pos 1]
144     const Float_t kCP1NegRo                      = 2.90 + 0.0002;
145     const Float_t kCP1BeRi                       = 2.90;
146     const Float_t kCP1BeRo                       = 2.98;
147     const Float_t kCP1KaRo                       = 2.99;    
148 //
149 // Be-Stainless Steel adaptor tube [Pos 2] at both ends of the Be-section. Length 5 cm
150     const Float_t kCP1BeStAdaptorLength          = 5.00;
151 //
152 // Bulge of the Be-Stainless Steel adaptor Tube [Pos 2]
153     const Float_t kCP1BeStRo                     = 3.05;
154 //
155 //  Length of bulge [Pos 2]
156     const Float_t kCP1BulgeLength                = 0.50;
157 //
158 //  Distance between bulges [Pos 2]
159     const Float_t kCP1BulgeBulgeDistance         = 1.00;
160 //
161 // Length of Be-pipe
162     const Float_t kCP1BeLength =  kCP1Length - 2. *  kCP1BeStAdaptorLength;
163
164 //    
165 // CP/1 Mother volume 
166     TGeoVolume* voCp1Mo = new TGeoVolume("CP1MO", 
167                                          new TGeoTube(0., kCP1BeStRo,  kCP1Length / 2.), 
168                                          kMedAir);
169     voCp1Mo->SetVisibility(0);
170     
171 /////////////////////////////////////////////
172 // CP/1 Be-Section                         //
173 /////////////////////////////////////////////
174     TGeoVolume* voCp1Vac = new TGeoVolume("CP1VAC", 
175                                           new TGeoTube(0., kCP1BeRi,  kCP1BeLength / 2.), 
176                                           kMedVac);
177     TGeoVolume* voCp1Be  = new TGeoVolume("CP1BE", 
178                                           new TGeoTube(0., kCP1BeRo,  kCP1BeLength / 2.), 
179                                           kMedBe);
180     // Outer Kapton foil
181     TGeoVolume* voCp1Ka  = new TGeoVolume("CP1KA", 
182                                           new TGeoTube(0., kCP1KaRo,  kCP1BeLength / 2.), 
183                                           kMedKapton);
184     // Inner NEG coating
185     TGeoVolume* voCp1NEG = new TGeoVolume("CP1NEG", 
186                                           new TGeoTube(kCP1BeRi, kCP1NegRo, kCP1BeLength / 2.), 
187                                           kMedNEG);
188
189     voCp1Ka->AddNode(voCp1Be,  1, gGeoIdentity);
190     voCp1Be->AddNode(voCp1Vac, 1, gGeoIdentity);
191     voCp1Be->AddNode(voCp1NEG, 1, gGeoIdentity);
192     voCp1Mo->AddNode(voCp1Ka,  1, gGeoIdentity);
193
194 /////////////////////////////////////////////
195 // CP/1 Be-Stainless Steel adaptor tube    //
196 /////////////////////////////////////////////
197     TGeoPcon* shCp1At = new TGeoPcon(0., 360., 8);
198 //  First Bulge 
199     z = - kCP1BeStAdaptorLength / 2.;
200     shCp1At->DefineSection(0, z, 0., kCP1BeStRo);
201     z += kCP1BulgeLength;
202     shCp1At->DefineSection(1, z, 0., kCP1BeStRo);
203     shCp1At->DefineSection(2, z, 0., kCP1BeRo);
204 //  Between the bulges
205     z += kCP1BulgeBulgeDistance;
206     shCp1At->DefineSection(3, z, 0., kCP1BeRo);
207     shCp1At->DefineSection(4, z, 0., kCP1BeStRo);
208 //  Second bulge
209     z += kCP1BulgeLength;
210     shCp1At->DefineSection(5, z, 0., kCP1BeStRo);
211     shCp1At->DefineSection(6, z, 0., kCP1BeRo);
212 //  Straight piece
213     z = kCP1BeStAdaptorLength / 2.;
214     shCp1At->DefineSection(7, z, 0., kCP1BeRo);
215 //
216     TGeoVolume* voCp1At  = new TGeoVolume("CP1AT",  shCp1At, kMedSteel);
217     TGeoVolume* voCp1AtV = new TGeoVolume("CP1ATV", new TGeoTube(0., kCP1BeRi, kCP1BeStAdaptorLength / 2.), kMedVac);
218     voCp1At->AddNode(voCp1AtV, 1, gGeoIdentity);
219     
220 //  Position adaptor tube at both ends
221     dz = kCP1Length / 2. -  kCP1BeStAdaptorLength / 2.;
222     voCp1Mo->AddNode(voCp1At,    1, new TGeoTranslation(0., 0., -dz));
223     voCp1Mo->AddNode(voCp1At,    2, new TGeoCombiTrans(0., 0.,  dz, rot180));
224     TGeoVolumeAssembly* voCp1 = new TGeoVolumeAssembly("Cp1");
225     voCp1->AddNode(voCp1Mo, 1, gGeoIdentity);
226     
227 //
228 ///////////////////
229 //      CP/2     //
230 ///////////////////
231 //
232 // Fixed Point tube [Pos 5]
233 //
234 // Inner and outer radii of the Stainless Steel pipe    
235     const Float_t kCP2StRi               =      2.90;
236     const Float_t kCP2StRo               =      2.98;
237 //  
238 // Transition to central Be-pipe (Bulge)   
239 // Length
240     const Float_t kCP2BulgeLength        =      0.80;
241 //     
242 // Bulge outer radius
243     const Float_t kCP2BulgeRo            =      3.05;
244 //
245 // Fixed Point at z = 391.7 (IP)
246 //
247 // Position of fixed point
248     const Float_t kCP2FixedPointZ        =      8.30;
249 //
250 // Outer radius of fixed point
251     const Float_t kCP2FixedPointRo       =      3.50;
252 //
253 // Length of fixed point
254     const Float_t kCP2FixedPointLength   =      0.60;
255 //
256 // Fixed Flange [Pos 6]    
257 //
258 // Fixed flange outer radius
259     const Float_t kCP2FixedFlangeRo      =      7.60;
260 //
261 // Fixed flange inner radius
262     const Float_t kCP2FixedFlangeRi      =      3.00;
263 // Fixed flange inner radius bulge
264     const Float_t kCP2FixedFlangeBulgeRi =      2.90;
265 // Fixed flange lengths of sections at inner radius
266     const Float_t kCP2FixedFlangeRecessLengths[3] ={1., 0.08, 0.9};
267 // Fixed flange length
268     const Float_t kCP2FixedFlangeLength =       1.98;
269 //
270 // Fixed flange bulge
271 // Outer radius
272      const Float_t kCP2FixedFlangeBulgeRo =     3.00;
273 //
274 // Length    
275      const Float_t kCP2FixedFlangeBulgeLength = 2.00;
276
277 //
278 // CP/2 Mother Volume
279 //
280     TGeoPcon* shCp2Mo = new TGeoPcon(0., 360., 14);
281 //  Flange
282     z = - kCP2Length / 2.;
283     shCp2Mo->DefineSection( 0, z, kCP2FixedFlangeRi, kCP2FixedFlangeRo);
284     z +=  kCP2FixedFlangeRecessLengths[0];
285     shCp2Mo->DefineSection( 1, z, kCP2FixedFlangeRi, kCP2FixedFlangeRo);
286     shCp2Mo->DefineSection( 2, z, 0.,                kCP2FixedFlangeRo);
287     z +=  (kCP2FixedFlangeRecessLengths[1] + kCP2FixedFlangeRecessLengths[2]) ;
288     shCp2Mo->DefineSection( 3, z, 0., kCP2FixedFlangeRo);
289 //  Straight section between Flange and Fixed Point
290     shCp2Mo->DefineSection( 4, z, 0., kCP2FixedFlangeBulgeRo);
291     z += kCP2FixedFlangeBulgeLength;
292     shCp2Mo->DefineSection( 5, z, 0., kCP2FixedFlangeBulgeRo);
293     shCp2Mo->DefineSection( 6, z, 0., kCP2StRo);
294     z =  - kCP2Length / 2 +  kCP2FixedPointZ - kCP2FixedPointLength / 2.;
295     shCp2Mo->DefineSection( 7, z, 0., kCP2StRo);
296 //  Fixed Point
297     shCp2Mo->DefineSection( 8, z, 0., kCP2FixedPointRo);
298     z +=  kCP2FixedPointLength;
299     shCp2Mo->DefineSection( 9, z, 0., kCP2FixedPointRo);
300 //  Straight section between Fixed Point and transition bulge
301     shCp2Mo->DefineSection(10, z, 0., kCP2StRo);
302     z  =  kCP2Length / 2. - kCP2BulgeLength;
303     shCp2Mo->DefineSection(11, z, 0., kCP2StRo);
304     shCp2Mo->DefineSection(12, z, 0., kCP2BulgeRo);
305     z = kCP2Length / 2.;
306     shCp2Mo->DefineSection(13, z, 0., kCP2BulgeRo);
307     
308     TGeoVolume* voCp2Mo = new TGeoVolume("CP2MO", shCp2Mo, kMedAir);
309     voCp2Mo->SetVisibility(0);
310 //
311 // CP/1 Vacuum
312     TGeoTube*   shCp2Va = new TGeoTube(0., kCP2StRi, (kCP2Length - kCP2FixedFlangeRecessLengths[0])/2.);
313     TGeoVolume* voCp2Va = new TGeoVolume("CP2VA", shCp2Va, kMedVac);
314     
315     voCp2Mo->AddNode(voCp2Va, 1, new TGeoTranslation(0., 0., kCP2FixedFlangeRecessLengths[0]/2.));
316     
317 /////////////////////////////////////////////
318 //  CP/2 Fixed Flange [Pos 6]              //
319 /////////////////////////////////////////////
320
321     TGeoPcon* shCp2Fl = new TGeoPcon(0., 360., 6);
322     z = - kCP2FixedFlangeLength / 2.;
323     shCp2Fl->DefineSection(0, z, kCP2FixedFlangeRi,      kCP2FixedFlangeRo);
324     z +=  kCP2FixedFlangeRecessLengths[0];
325     shCp2Fl->DefineSection(1, z, kCP2FixedFlangeRi,      kCP2FixedFlangeRo);
326     shCp2Fl->DefineSection(2, z, kCP2FixedFlangeBulgeRi, kCP2FixedFlangeRo);
327     z +=  kCP2FixedFlangeRecessLengths[1];
328     shCp2Fl->DefineSection(3, z, kCP2FixedFlangeBulgeRi, kCP2FixedFlangeRo);
329     shCp2Fl->DefineSection(4, z, kCP2FixedFlangeRi,      kCP2FixedFlangeRo);
330     z = kCP2FixedFlangeLength / 2.;
331     shCp2Fl->DefineSection(5, z, kCP2FixedFlangeRi,      kCP2FixedFlangeRo);
332     TGeoVolume* voCp2Fl = new TGeoVolume("CP2FL", shCp2Fl, kMedSteel);
333 // 
334     dz =  - kCP2Length / 2. +  kCP2FixedFlangeLength / 2.;
335     voCp2Mo->AddNode(voCp2Fl, 1, new TGeoTranslation(0., 0., dz));
336
337
338 /////////////////////////////////////////////////////////////
339 //  CP/2 Beam pipe with fixed point and transition bulges  //
340 /////////////////////////////////////////////////////////////
341     TGeoPcon* shCp2Pi = new TGeoPcon(0., 360., 10);
342 //  Bulge at transition to flange 
343     z =  - (kCP2Length -  kCP2FixedFlangeRecessLengths[0] - kCP2FixedFlangeRecessLengths[1]) / 2.;
344     z0 = z;
345     shCp2Pi->DefineSection(0, z, kCP2StRi, kCP2FixedFlangeBulgeRo);
346     z += kCP2FixedFlangeBulgeLength;
347     shCp2Pi->DefineSection(1, z, kCP2StRi, kCP2FixedFlangeBulgeRo);
348 //  Straight section between Bulge and Fixed Point
349     shCp2Pi->DefineSection(2, z, kCP2StRi, kCP2StRo);
350     z  += (kCP2FixedPointZ - kCP2FixedPointLength / 2. - kCP2FixedFlangeRecessLengths[0]
351            - kCP2FixedFlangeRecessLengths[1] - 
352         kCP2FixedFlangeBulgeLength);
353     shCp2Pi->DefineSection(3, z, kCP2StRi, kCP2StRo);
354 //  Fixed Point
355     shCp2Pi->DefineSection(4, z, kCP2StRi, kCP2FixedPointRo);
356     z +=  kCP2FixedPointLength;
357     shCp2Pi->DefineSection(5, z, kCP2StRi, kCP2FixedPointRo);
358 //  Straight section between Fixed Point and transition bulge
359     shCp2Pi->DefineSection(6, z, kCP2StRi, kCP2StRo);
360     z = - shCp2Pi->GetZ(0) - kCP2BulgeLength;
361     shCp2Pi->DefineSection(7, z, kCP2StRi, kCP2StRo);
362 //  Bulge at transition to Be pipe
363     shCp2Pi->DefineSection(8, z, kCP2StRi, kCP2BulgeRo);
364     z = - shCp2Pi->GetZ(0);
365     shCp2Pi->DefineSection(9, z, kCP2StRi, kCP2BulgeRo);
366
367     TGeoVolume* voCp2Pi = new TGeoVolume("CP2PI", shCp2Pi, kMedSteel);
368     dz = (kCP2FixedFlangeRecessLengths[0] + kCP2FixedFlangeRecessLengths[1]) / 2.;
369     voCp2Mo->AddNode(voCp2Pi, 1, new TGeoTranslation(0., 0., dz));
370
371 //
372 //  Central beam pipe support collars
373 //  LHCVC2C_0019
374 //  cp1l = 405.
375 //  Position at z = -46., 40., 150.
376     TGeoVolume* voCpSupC = new TGeoVolume("CpSupC", new TGeoTube(3.051, 4.00, 0.35), kMedAco);
377     voCp1->AddNode(voCpSupC, 1, new TGeoTranslation(0., 0.,  kCP1Length / 2. - 98.2 - 34.77 + 0.49));
378 //    voCp1->AddNode(voCpSupC, 2, new TGeoTranslation(0., 0.,  kCP1Length / 2.- 191.5));
379 //  Beam Pipe Protection Tube
380 //
381 //  ALIFWDA_0025
382 //    
383 //  Plaque de Centrage  ALIFWDA_0019
384     const Float_t kFwdaBPPTXL = 3.;
385     TGeoXtru* shFwdaBPPTX = new TGeoXtru(2);
386     Double_t xBPPTX[8] = {12.5,  7.5, -7.5, -12.5, -12.5,  -7.5,   7.5, 12.5};
387     Double_t yBPPTX[8] = { 7.0, 12.0, 12.0,  7.0, -7.0, -12.0, -12.0,  -7.0};
388     shFwdaBPPTX->DefinePolygon(8, xBPPTX, yBPPTX);
389     shFwdaBPPTX->DefineSection(0, 0.,         0., 0., 1.);
390     shFwdaBPPTX->DefineSection(1, kFwdaBPPTXL, 0., 0., 1.);
391     shFwdaBPPTX->SetName("FwdaBPPTX");
392     TGeoTube* shFwdaBPPTY = new TGeoTube(0., 8.5, 3.2);
393     shFwdaBPPTY->SetName("FwdaBPPTY");
394     TGeoCompositeShape*  shFwdaBPPTPC = new TGeoCompositeShape("shFwdaBPPTPC", "FwdaBPPTX-FwdaBPPTY");
395     TGeoVolume* voFwdaBPPTPC =  new TGeoVolume("FwdaBPPTPC", shFwdaBPPTPC, kMedAco);
396 //    
397 //  Tube  ALIFWDA_0020  
398 //    const Float_t kFwdaBPPTTL = 48.;
399     const Float_t kFwdaBPPTTL = 35.;
400     TGeoVolume* voFwdaBPPTT =  new TGeoVolume("FwdaBPPTT", new TGeoTube(8.85, 9.0, kFwdaBPPTTL/2.), kMedAco);
401     TGeoVolumeAssembly* voFwdaBPPT = new TGeoVolumeAssembly("FwdaBPPT");
402     voFwdaBPPT->AddNode(voFwdaBPPTPC, 1, gGeoIdentity);
403     voFwdaBPPT->AddNode(voFwdaBPPTT,  1, new TGeoTranslation(0., 0., kFwdaBPPTTL/2. + kFwdaBPPTXL));
404
405     
406 //  BeamPipe and T0A Support
407 //
408 //  ALIFWDA_0033
409 //    
410 //  Support  Plate ALIFWDA_0026
411     const Float_t kFwdaBPSPL = 4.0;
412     TGeoXtru* shFwdaBPSPX = new TGeoXtru(2);
413     Double_t xBPSPX[8] = {10.0,  6.0 , -6.0, -10.0, -10.0,  -6.0,   6.0, 10.0};
414     Double_t yBPSPX[8] = { 6.0, 10.0,  10.0,   6.0, - 6.0, -10.0, -10.0, -6.0};
415     shFwdaBPSPX->DefinePolygon(8, xBPSPX, yBPSPX);
416     shFwdaBPSPX->DefineSection(0, 0.,         0., 0., 1.);
417     shFwdaBPSPX->DefineSection(1, kFwdaBPSPL, 0., 0., 1.);
418     shFwdaBPSPX->SetName("FwdaBPSPX");
419     TGeoPcon* shFwdaBPSPY = new TGeoPcon(0., 360., 6);
420     shFwdaBPSPY->DefineSection(0, -1.00, 0., 5.5);
421     shFwdaBPSPY->DefineSection(1,  3.50, 0., 5.5);    
422     shFwdaBPSPY->DefineSection(2,  3.50, 0., 5.0);    
423     shFwdaBPSPY->DefineSection(3,  3.86, 0., 5.0);    
424     shFwdaBPSPY->DefineSection(4,  3.86, 0., 5.5);    
425     shFwdaBPSPY->DefineSection(5,  5.00, 0., 5.5);    
426     shFwdaBPSPY->SetName("FwdaBPSPY");
427     TGeoCompositeShape*  shFwdaBPSP = new TGeoCompositeShape("shFwdaBPSP", "FwdaBPSPX-FwdaBPSPY");
428     TGeoVolume* voFwdaBPSP =  new TGeoVolume("FwdaBPSP", shFwdaBPSP, kMedAco);
429 //    
430 //  Flasque  ALIFWDA_00027
431
432
433     const Float_t kFwdaBPSTTRi  =  7.6/2.;
434     const Float_t kFwdaBPSTTRo1 = 13.9/2.;
435     const Float_t kFwdaBPSTTRo2 =  8.2/2.;
436     const Float_t kFwdaBPSTTRo3 =  9.4/2.;
437     
438     TGeoPcon* shFwdaBPSFL = new TGeoPcon(0., 360., 8);
439     z = 0., 
440     shFwdaBPSFL->DefineSection(0, z, kFwdaBPSTTRi, kFwdaBPSTTRo1);
441     z += 0.64;
442     shFwdaBPSFL->DefineSection(1, z, kFwdaBPSTTRi, kFwdaBPSTTRo1);
443     shFwdaBPSFL->DefineSection(2, z, kFwdaBPSTTRi, kFwdaBPSTTRo2);
444     z += 2.55;
445     shFwdaBPSFL->DefineSection(3, z, kFwdaBPSTTRi, kFwdaBPSTTRo2);
446     shFwdaBPSFL->DefineSection(4, z, kFwdaBPSTTRi, kFwdaBPSTTRo3);
447     z += 0.4;
448     shFwdaBPSFL->DefineSection(5, z, kFwdaBPSTTRi, kFwdaBPSTTRo3);
449     shFwdaBPSFL->DefineSection(6, z, kFwdaBPSTTRi, kFwdaBPSTTRo2);
450     z += 1.2;
451     shFwdaBPSFL->DefineSection(7, z, kFwdaBPSTTRi, kFwdaBPSTTRo2);
452
453     TGeoVolume* voFwdaBPSFL =  new TGeoVolume("FwdaBPSFL", shFwdaBPSFL, kMedAco);
454
455     
456     //
457     // Cable support 
458     TGeoBBox* shFwdaBPSCSa = new TGeoBBox(3.0, 8.75, 0.5);
459     shFwdaBPSCSa->SetName("FwdaBPSCSa");
460     TGeoBBox* shFwdaBPSCSb = new TGeoBBox(1.25, 4.00, 1.0);
461     shFwdaBPSCSb->SetName("FwdaBPSCSb");   
462     TGeoTranslation* tFwdaBPSCSb = new TGeoTranslation(0., 5.25 - 8.75, 0.);
463     tFwdaBPSCSb->SetName("tFwdaBPSCSb");
464     tFwdaBPSCSb->RegisterYourself();
465     TGeoBBox* shFwdaBPSCSc = new TGeoBBox(3.0, 0.50, 0.70);
466     shFwdaBPSCSc->SetName("FwdaBPSCSc");
467     TGeoTranslation* tFwdaBPSCSc = new TGeoTranslation(0., 0.5 - 8.75, 1.2);
468     tFwdaBPSCSc->SetName("tFwdaBPSCSc");
469     tFwdaBPSCSc->RegisterYourself();
470     TGeoCompositeShape* shFwdaBPSCS = new TGeoCompositeShape("shFwdaBPSCS", "(FwdaBPSCSa-FwdaBPSCSb:tFwdaBPSCSb)+FwdaBPSCSc:tFwdaBPSCSc");
471     TGeoVolume* voFwdaBPSCS = new TGeoVolume("FwdaBPSCS", shFwdaBPSCS, kMedAco);
472     
473     
474     // Assembling the beam pipe support 
475     TGeoVolumeAssembly* voFwdaBPS = new TGeoVolumeAssembly("FwdaBPS");
476     voFwdaBPS->AddNode(voFwdaBPSP,   1,  new TGeoCombiTrans(0., 0., 0., rot045));
477     voFwdaBPS->AddNode(voFwdaBPSFL,  1,  new TGeoTranslation(0., 0., kFwdaBPSPL));
478     const Float_t kFwdaBPSCSdy = 18.75/TMath::Sqrt(2.);
479     
480     voFwdaBPS->AddNode(voFwdaBPSCS,  1,  new TGeoCombiTrans(- kFwdaBPSCSdy,   kFwdaBPSCSdy, 2., rot045));
481     voFwdaBPS->AddNode(voFwdaBPSCS,  2,  new TGeoCombiTrans(- kFwdaBPSCSdy, - kFwdaBPSCSdy, 2., rot135));
482     voFwdaBPS->AddNode(voFwdaBPSCS,  3,  new TGeoCombiTrans(  kFwdaBPSCSdy, - kFwdaBPSCSdy, 2., rot225));
483     voFwdaBPS->AddNode(voFwdaBPSCS,  4,  new TGeoCombiTrans(  kFwdaBPSCSdy,   kFwdaBPSCSdy, 2., rot315));
484
485     TGeoVolumeAssembly* voCp2 = new TGeoVolumeAssembly("CP2");
486     voCp2->AddNode(voCp2Mo, 1, gGeoIdentity);
487     voCp2->AddNode(voFwdaBPPT, 1, new TGeoTranslation(0., 0., -kCP2Length / 2. + 13.8));
488     voCp2->AddNode(voFwdaBPS,  1, new TGeoTranslation(0., 0., -kCP2Length / 2. +  5.1));
489
490 //
491 ///////////////////
492 //      CP/3     //
493 ///////////////////
494 //
495 // Adaptor tube [Pos 4]
496 // 
497 // Adaptor tube length 
498     const Float_t  kCP3AdaptorTubeLength            =  5.50;
499 //
500 // Inner and outer radii
501      const Float_t kCP3AdaptorTubeRi                =  2.92;
502      const Float_t kCP3AdaptorTubeRo                =  3.00;
503 //
504 // Bulge at transition point
505 // Inner and outer radii
506      const Float_t kCP3AdaptorTubeBulgeRi           =  2.90;
507      const Float_t kCP3AdaptorTubeBulgeRo           =  3.05;    
508 //
509 // Length of bulge
510     const Float_t  kCP3AdaptorTubeBulgeLength       =  0.80;
511 //
512 // Bellow [Pos 8]
513 //
514 //  Total length    
515     const Float_t kCP3BellowLength                  = 13.00;
516 //  Outer Radius
517     const Float_t kCP3BellowRo                      =  3.6;
518 //  Inner Radius 
519     const Float_t kCP3BellowRi                      =  2.8;
520 //  Number of plies
521     const Int_t   kCP3NumberOfPlies                 = 18;
522 //  Length of undulated region
523     const Float_t kCP3BellowUndulatedLength         =  8.30; 
524 //  Plie thickness
525     const Float_t kCP3PlieThickness                 =  0.02;   
526 //  Connection Plie radies (at transition been undulated region and beam pipe)
527     const Float_t kCP3ConnectionPlieR               =  0.21;
528 //  Plie radius
529 //  const Float_t kCP3PlieR = 0.118286;
530     const Float_t kCP3PlieR = 
531         (kCP3BellowUndulatedLength - 4. *  kCP3ConnectionPlieR + 2. * kCP3PlieThickness + 
532          (2. *  kCP3NumberOfPlies - 2.) * kCP3PlieThickness) / (4. * kCP3NumberOfPlies - 2.);
533 //  Length of connection pipe
534     const Float_t kCP3BellowConnectionLength        =  2.35;
535 //
536 //  Tube between bellows [Pos 3]  
537 //    
538 //  Length of tube
539     const Float_t kCP3TubeLength                    =  4.00;
540 //
541 //  Minimised fixed flange [Pos 7]
542 //  
543 //  Length of flange connection tube
544     const Float_t kCP3FlangeConnectorLength         =  5.0 - 1.4;
545 //  Length of Flange
546     const Float_t kCP3FlangeLength                  =  1.40;
547 //  Outer radius    
548     const Float_t kCP3FlangeRo                      =  4.30;
549
550 //
551 // CP/3 Mother volume
552 //
553     TGeoPcon* shCp3Mo = new TGeoPcon(0., 360., 12);
554 //  From transition to first bellow
555     z = - kCP3Length / 2.;
556     shCp3Mo->DefineSection( 0, z, 0., kCP3AdaptorTubeBulgeRo);
557     z += kCP3BellowConnectionLength + kCP3AdaptorTubeLength;
558     shCp3Mo->DefineSection( 1, z, 0., kCP3AdaptorTubeBulgeRo);
559 //  First Bellow
560     shCp3Mo->DefineSection( 2, z, 0., kCP3BellowRo);
561     z +=  kCP3BellowUndulatedLength;
562     shCp3Mo->DefineSection( 3, z, 0., kCP3BellowRo);
563 //  Connection between the two bellows
564     shCp3Mo->DefineSection( 4, z, 0., kCP3AdaptorTubeBulgeRo);
565     z +=  2. * kCP3BellowConnectionLength + kCP3TubeLength;
566     shCp3Mo->DefineSection( 5, z, 0., kCP3AdaptorTubeBulgeRo);
567 //  Second bellow
568     shCp3Mo->DefineSection( 6, z, 0., kCP3BellowRo);
569     z += kCP3BellowUndulatedLength;
570     shCp3Mo->DefineSection( 7, z, 0., kCP3BellowRo);
571 //  Pipe between second Bellow and Flange
572     shCp3Mo->DefineSection( 8, z, 0., kCP3AdaptorTubeBulgeRo);
573     z +=  kCP3BellowConnectionLength +  kCP3FlangeConnectorLength;
574     shCp3Mo->DefineSection( 9, z, 0., kCP3AdaptorTubeBulgeRo);
575 //  Flange 
576     shCp3Mo->DefineSection(10, z, 0., kCP3FlangeRo);
577     z = -shCp3Mo->GetZ(0);
578     shCp3Mo->DefineSection(11, z, 0., kCP3FlangeRo);
579 //
580     TGeoVolume* voCp3Mo = new TGeoVolume("CP3MO", shCp3Mo, kMedAir);
581     voCp3Mo->SetVisibility(0);
582     TGeoVolumeAssembly* voCp3 = new TGeoVolumeAssembly("Cp3");
583     voCp3->AddNode(voCp3Mo,  1, gGeoIdentity);
584     voCp3->AddNode(voCpSupC, 3, new TGeoTranslation(0., 0., - kCP3Length / 2. + 4.6 - 0.49));
585     dz = kCP3pos;
586
587 //////////////////////////////////////////////
588 // CP/3 Adaptor tube                        // 
589 //////////////////////////////////////////////
590     TGeoPcon* shCp3AtV = new TGeoPcon(0., 360., 4);
591 //  Bulge at transition
592     z =  - kCP3AdaptorTubeLength / 2.;
593     shCp3AtV->DefineSection(0, z, 0., kCP3AdaptorTubeBulgeRo);
594     z += kCP3AdaptorTubeBulgeLength;
595     shCp3AtV->DefineSection(1, z, 0., kCP3AdaptorTubeBulgeRo);
596 //  Tube
597     shCp3AtV->DefineSection(2, z, 0., kCP3AdaptorTubeRo);
598     z =  + kCP3AdaptorTubeLength / 2.;
599     shCp3AtV->DefineSection(3, z, 0., kCP3AdaptorTubeRo);
600
601     TGeoVolume* voCp3AtV = new TGeoVolume("CP3ATV", shCp3AtV, kMedVac);
602
603     TGeoPcon* shCp3AtS = new TGeoPcon(0., 360., 4);
604 //  Bulge at transition
605     shCp3AtS->DefineSection(0, shCp3AtV->GetZ(0), kCP3AdaptorTubeBulgeRi, kCP3AdaptorTubeBulgeRo);
606     shCp3AtS->DefineSection(1, shCp3AtV->GetZ(1), kCP3AdaptorTubeBulgeRi, kCP3AdaptorTubeBulgeRo);
607 //  Tube
608     shCp3AtS->DefineSection(2, shCp3AtV->GetZ(2), kCP3AdaptorTubeRi,      kCP3AdaptorTubeRo);
609     shCp3AtS->DefineSection(3, shCp3AtV->GetZ(3), kCP3AdaptorTubeRi ,     kCP3AdaptorTubeRo);
610     TGeoVolume* voCp3AtS = new TGeoVolume("CP3ATS", shCp3AtS, kMedSteel);
611
612     voCp3AtV->AddNode(voCp3AtS, 1, gGeoIdentity);
613     dz = - kCP3Length / 2. +  kCP3AdaptorTubeLength / 2.;
614     voCp3Mo->AddNode(voCp3AtV, 1, new TGeoTranslation(0., 0., dz));
615
616 /////////////////////////////////
617 // CP/3 Bellow section         //
618 /////////////////////////////////
619
620 //
621 //  Upper part of the undulation
622     TGeoTorus* plieTorusUO =  new TGeoTorus(kCP3BellowRo - kCP3PlieR, 0. , kCP3PlieR);
623     plieTorusUO->SetName("TorusUO");
624     TGeoTorus* plieTorusUI =  new TGeoTorus(kCP3BellowRo - kCP3PlieR, kCP3PlieR - kCP3PlieThickness, kCP3PlieR);
625     plieTorusUI->SetName("TorusUI");
626     TGeoTube*  plieTubeU   =  new TGeoTube (kCP3BellowRo - kCP3PlieR, kCP3BellowRo, kCP3PlieR);
627     plieTubeU->SetName("TubeU");
628     
629     TGeoCompositeShape*  shUpperPlieO = new TGeoCompositeShape("upperPlieO", "TorusUO*TubeU");
630     TGeoCompositeShape*  shUpperPlieI = new TGeoCompositeShape("upperPlieI", "TorusUI*TubeU");
631  
632     TGeoVolume* voWiggleUO = new TGeoVolume("CP3WUO", shUpperPlieO, kMedVac);
633     TGeoVolume* voWiggleUI = new TGeoVolume("CP3WUI", shUpperPlieI, kMedSteel);
634     voWiggleUO->AddNode(voWiggleUI, 1,  gGeoIdentity);    
635 //
636 // Lower part of the undulation
637     TGeoTorus* plieTorusLO =  new TGeoTorus(kCP3BellowRi + kCP3PlieR, 0. , kCP3PlieR);
638     plieTorusLO->SetName("TorusLO");
639     TGeoTorus* plieTorusLI =  new TGeoTorus(kCP3BellowRi + kCP3PlieR, kCP3PlieR - kCP3PlieThickness, kCP3PlieR);
640     plieTorusLI->SetName("TorusLI");
641     TGeoTube*  plieTubeL   =  new TGeoTube (kCP3BellowRi, kCP3BellowRi + kCP3PlieR, kCP3PlieR);
642     plieTubeL->SetName("TubeL");
643
644     TGeoCompositeShape*  shLowerPlieO = new TGeoCompositeShape("lowerPlieO", "TorusLO*TubeL");
645     TGeoCompositeShape*  shLowerPlieI = new TGeoCompositeShape("lowerPlieI", "TorusLI*TubeL");
646
647     TGeoVolume* voWiggleLO = new TGeoVolume("CP3WLO", shLowerPlieO, kMedVac);
648     TGeoVolume* voWiggleLI = new TGeoVolume("CP3WLI", shLowerPlieI, kMedSteel);
649     voWiggleLO->AddNode(voWiggleLI, 1,  gGeoIdentity);    
650
651 //
652 // Connection between upper and lower part of undulation
653     TGeoVolume* voWiggleC1 = new TGeoVolume("Q3WCO1",  
654                                           new TGeoTube(kCP3BellowRi + kCP3PlieR, kCP3BellowRo - kCP3PlieR, kCP3PlieThickness / 2.),
655                                           kMedSteel);
656     TGeoVolume* voWiggleC2 = new TGeoVolume("Q3WCO2",  
657                                           new TGeoTube(kCP3BellowRi + kCP3ConnectionPlieR, kCP3BellowRo - kCP3PlieR, kCP3PlieThickness / 2.),
658                                           kMedSteel);
659 //
660 // Conncetion between undulated section and beam pipe
661     TGeoTorus* plieTorusCO =  new TGeoTorus(kCP3BellowRi + kCP3ConnectionPlieR, 0. , kCP3ConnectionPlieR);
662     plieTorusCO->SetName("TorusCO");
663     TGeoTorus* plieTorusCI =  new TGeoTorus(kCP3BellowRi + kCP3ConnectionPlieR, kCP3ConnectionPlieR - kCP3PlieThickness, kCP3ConnectionPlieR);
664     plieTorusCI->SetName("TorusCI");
665     TGeoTube*  plieTubeC   =  new TGeoTube (kCP3BellowRi, kCP3BellowRi + kCP3ConnectionPlieR, kCP3ConnectionPlieR);
666     plieTubeC->SetName("TubeC");
667
668     TGeoCompositeShape*  shConnectionPlieO = new TGeoCompositeShape("connectionPlieO", "TorusCO*TubeC");
669     TGeoCompositeShape*  shConnectionPlieI = new TGeoCompositeShape("connectionPlieI", "TorusCI*TubeC");
670
671     TGeoVolume* voConnectionPO = new TGeoVolume("CP3CPO", shConnectionPlieO, kMedVac);
672     TGeoVolume* voConnectionPI = new TGeoVolume("CP3CPI", shConnectionPlieI, kMedSteel);
673     voConnectionPO->AddNode(voConnectionPI, 1,  gGeoIdentity);    
674 //
675 // Connecting pipes
676     TGeoVolume* voConnectionPipeO = new TGeoVolume("CP3BECO",  
677                                                    new TGeoTube(0., kCP3AdaptorTubeRo, kCP3BellowConnectionLength / 2.),
678                                                    kMedVac);
679     TGeoVolume* voConnectionPipeI = new TGeoVolume("CP3BECI",  
680                                                    new TGeoTube(kCP3AdaptorTubeRi, kCP3AdaptorTubeRo, kCP3BellowConnectionLength / 2.),
681                                                    kMedSteel);
682     
683     voConnectionPipeO->AddNode(voConnectionPipeI, 1,  gGeoIdentity);
684     
685 //
686 // Bellow mother
687     TGeoPcon* shBellowMotherPC = new TGeoPcon(0., 360., 6);
688     dz =  - kCP3BellowLength / 2;
689     shBellowMotherPC->DefineSection(0, dz, 0.,  kCP3AdaptorTubeRo);
690     dz +=  kCP3BellowConnectionLength;
691     shBellowMotherPC->DefineSection(1, dz, 0.,  kCP3AdaptorTubeRo);
692     shBellowMotherPC->DefineSection(2, dz, 0.,  kCP3BellowRo);
693     dz =  kCP3BellowLength /2. -  kCP3BellowConnectionLength;;
694     shBellowMotherPC->DefineSection(3, dz, 0.,  kCP3BellowRo);
695     shBellowMotherPC->DefineSection(4, dz, 0.,  kCP3AdaptorTubeRo);
696     dz +=  kCP3BellowConnectionLength;
697     shBellowMotherPC->DefineSection(5, dz, 0.,  kCP3AdaptorTubeRo);
698
699     TGeoVolume* voBellowMother = new TGeoVolume("CP3BeMO", shBellowMotherPC, kMedVac);
700     voBellowMother->SetVisibility(0);
701     
702 //
703 // Add undulations
704     z0   =  - kCP3BellowLength / 2. +  kCP3BellowConnectionLength + 2. * kCP3ConnectionPlieR - kCP3PlieThickness;
705     zsh  = 4. *  kCP3PlieR -  2. * kCP3PlieThickness;
706     for (Int_t iw = 0; iw < 18; iw++) {
707         Float_t zpos =  z0 + iw * zsh;  
708         if (iw > 0) 
709             voBellowMother->AddNode(voWiggleC1,  iw + 1 , new TGeoTranslation(0., 0., zpos + kCP3PlieThickness / 2.));  
710         else
711             voBellowMother->AddNode(voWiggleC2,  iw + 1 , new TGeoTranslation(0., 0., zpos + kCP3PlieThickness / 2.));  
712
713         zpos += kCP3PlieR;
714         voBellowMother->AddNode(voWiggleUO, iw + 1,  new TGeoTranslation(0., 0., zpos));        
715
716         zpos += kCP3PlieR;
717         if (iw < 17) 
718             voBellowMother->AddNode(voWiggleC1,  iw + 19, new TGeoTranslation(0., 0., zpos - kCP3PlieThickness / 2.));
719         else
720             voBellowMother->AddNode(voWiggleC2,  iw + 19, new TGeoTranslation(0., 0., zpos - kCP3PlieThickness / 2.));
721
722         if (iw < 17) {
723             zpos += kCP3PlieR;
724             voBellowMother->AddNode(voWiggleLO, iw + 1, new TGeoTranslation(0., 0., zpos -  kCP3PlieThickness));
725         }
726     }
727 //
728 // Add connecting undulation between bellow and connecting pipe
729     dz = - kCP3BellowUndulatedLength / 2. + kCP3ConnectionPlieR;
730     voBellowMother->AddNode(voConnectionPO, 1,  new TGeoTranslation(0., 0.,  dz));
731     voBellowMother->AddNode(voConnectionPO, 2,  new TGeoTranslation(0., 0., -dz));
732 //
733 // Add connecting pipe
734     dz =  - kCP3BellowLength / 2. +  kCP3BellowConnectionLength / 2.;
735     voBellowMother->AddNode(voConnectionPipeO, 1,  new TGeoTranslation(0., 0.,   dz));
736     voBellowMother->AddNode(voConnectionPipeO, 2,  new TGeoTranslation(0., 0.,  -dz));
737 //
738 // Add bellow to CP/3 mother    
739     dz = - kCP3Length / 2. +  kCP3AdaptorTubeLength +  kCP3BellowLength / 2.;
740     voCp3Mo->AddNode(voBellowMother, 1,  new TGeoTranslation(0., 0., dz));
741     dz += (kCP3BellowLength +  kCP3TubeLength);
742     voCp3Mo->AddNode(voBellowMother, 2,  new TGeoTranslation(0., 0., dz));
743
744
745 ///////////////////////////////////////////
746 // Beam pipe section between bellows     //
747 ///////////////////////////////////////////
748
749     TGeoVolume* voCp3Bco = new TGeoVolume("CP3BCO",
750                                           new TGeoTube(0.,  kCP3AdaptorTubeRo,  kCP3TubeLength / 2.),
751                                           kMedVac);
752    
753     TGeoVolume* voCp3Bci = new TGeoVolume("CP3BCI",
754                                           new TGeoTube(kCP3AdaptorTubeRi, kCP3AdaptorTubeRo, kCP3TubeLength / 2.), 
755                                           kMedSteel);
756     
757     voCp3Bco->AddNode(voCp3Bci, 1, gGeoIdentity);
758     dz = - kCP3Length / 2. +   kCP3AdaptorTubeLength +  kCP3BellowLength +  kCP3TubeLength / 2.;
759     voCp3Mo->AddNode(voCp3Bco, 1, new TGeoTranslation(0., 0., dz));
760
761
762 ///////////////////////////////////////////               
763 // CP3 Minimised Flange                  //
764 ///////////////////////////////////////////
765
766     TGeoPcon* shCp3mfo = new TGeoPcon(0., 360., 4);
767     z = - (kCP3FlangeConnectorLength + kCP3FlangeLength) / 2.;
768 //  Connection Tube
769     shCp3mfo->DefineSection(0, z, 0., kCP3AdaptorTubeRo);
770     z +=  kCP3FlangeConnectorLength;
771     shCp3mfo->DefineSection(1, z, 0., kCP3AdaptorTubeRo);
772 //  Flange
773     shCp3mfo->DefineSection(2, z, 0., kCP3FlangeRo);
774     z = - shCp3mfo->GetZ(0);
775     shCp3mfo->DefineSection(3, z, 0., kCP3FlangeRo);
776
777     TGeoVolume* voCp3mfo = new TGeoVolume("CP3MFO", shCp3mfo, kMedVac);
778
779
780     TGeoPcon* shCp3mfi = new TGeoPcon(0., 360., 4);
781 //  Connection Tube
782     shCp3mfi->DefineSection(0, shCp3mfo->GetZ(0), kCP3AdaptorTubeRi, kCP3AdaptorTubeRo);
783     shCp3mfi->DefineSection(1, shCp3mfo->GetZ(1), kCP3AdaptorTubeRi, kCP3AdaptorTubeRo);
784 //  Flange
785     shCp3mfi->DefineSection(2, shCp3mfo->GetZ(2), kCP3AdaptorTubeRi, kCP3FlangeRo);
786     shCp3mfi->DefineSection(3, shCp3mfo->GetZ(3), kCP3AdaptorTubeRi, kCP3FlangeRo);
787
788     TGeoVolume* voCp3mfi = new TGeoVolume("CP3MFI", shCp3mfi, kMedSteel);
789
790     voCp3mfo->AddNode(voCp3mfi, 1, gGeoIdentity);
791     dz =  kCP3Length / 2. - (kCP3FlangeConnectorLength + kCP3FlangeLength) / 2.;
792     voCp3Mo->AddNode(voCp3mfo, 1, new TGeoTranslation(0., 0., dz));
793
794
795 //
796 //  Assemble the central beam pipe
797 //
798     TGeoVolumeAssembly* asCP = new TGeoVolumeAssembly("CP");
799     z = 0.;
800     asCP->AddNode(voCp2,   1, gGeoIdentity);
801     z +=  kCP2Length / 2. + kCP1Length / 2.;
802     asCP->AddNode(voCp1, 1, new TGeoTranslation(0., 0., z));
803     z +=  kCP1Length / 2.  + kCP3Length / 2.;
804     asCP->AddNode(voCp3, 1, new TGeoTranslation(0., 0., z));
805     top->AddNode(asCP, 1,  new TGeoCombiTrans(0., 0., 400. -  kCP2Length / 2, rot180));
806
807
808
809
810 ////////////////////////////////////////////////////////////////////////////////     
811 //                                                                            //
812 //                                  RB24/1                                    // 
813 //                                                                            //
814 ////////////////////////////////////////////////////////////////////////////////
815 //
816 //
817 // Drawing LHCVC2U_0001
818 // Copper Tube RB24/1      393.5 cm 
819 // Warm module VMACA        18.0 cm
820 // Annular Ion Pump         35.0 cm
821 // Valve                     7.5 cm
822 // Warm module VMABC        28.0 cm
823 // ================================
824 //                         462.0 cm
825 //
826
827     
828 // Copper Tube RB24/1
829     const Float_t  kRB24CuTubeL   = 393.5;
830     const Float_t  kRB24CuTubeRi  = 8.0/2.;
831     const Float_t  kRB24CuTubeRo  = 8.4/2.;
832     const Float_t  kRB24CuTubeFRo = 7.6;
833     const Float_t  kRB24CuTubeFL  = 1.86;
834
835     TGeoVolume* voRB24CuTubeM = new TGeoVolume("voRB24CuTubeM", 
836                                                new TGeoTube(0., kRB24CuTubeRo, kRB24CuTubeL/2.), kMedVac);
837     voRB24CuTubeM->SetVisibility(0);
838     TGeoVolume* voRB24CuTube  = new TGeoVolume("voRB24CuTube", 
839                                                new TGeoTube(kRB24CuTubeRi, kRB24CuTubeRo, kRB24CuTubeL/2.), kMedCu);
840     voRB24CuTubeM->AddNode(voRB24CuTube, 1, gGeoIdentity);
841     // Air outside tube with higher transport cuts
842     TGeoVolume* voRB24CuTubeA  = new TGeoVolume("voRB24CuTubeA", 
843                                                 new TGeoTube(25., 100., kRB24CuTubeL/2.), kMedAirHigh);
844     voRB24CuTubeA->SetVisibility(0);
845     // Simplified DN 100 Flange
846      TGeoVolume* voRB24CuTubeF = new TGeoVolume("voRB24CuTubeF", 
847                                                new TGeoTube(kRB24CuTubeRo, kRB24CuTubeFRo, kRB24CuTubeFL/2.), kMedSteel);
848
849 // Warm Module Type VMACA
850 // LHCVMACA_0002
851 // 
852 // Pos 1 Warm Bellows DN100       LHCVBU__0012
853 // Pos 2 RF Contact   D80         LHCVSR__0005
854 // Pos 3 Trans. Tube Flange       LHCVSR__0065
855 // [Pos 4 Hex. Countersunk Screw   Bossard BN4719]
856 // [Pos 5 Tension spring           LHCVSR__0011]
857 //
858 //
859 //
860 // Pos1    Warm Bellows DN100
861 // Pos1.1  Bellows                  LHCVBU__0006
862 //
863 //
864 // Connection Tubes    
865 // Connection tube inner r
866     const Float_t kRB24B1ConTubeRin        = 10.0/2.;
867 // Connection tube outer r
868     const Float_t kRB24B1ConTubeRou        = 10.3/2.;
869 // Connection tube length
870     const Float_t kRB24B1ConTubeL          =  2.5;
871 // 
872     const Float_t kRB24B1CompL             = 16.00;    // Length of the compensator
873     const Float_t kRB24B1BellowRi          = 10.25/2.; // Bellow inner radius        
874     const Float_t kRB24B1BellowRo          = 11.40/2.; // Bellow outer radius        
875     const Int_t   kRB24B1NumberOfPlies     = 27;       // Number of plies            
876     const Float_t kRB24B1BellowUndL        = 11.00;    // Length of undulated region 
877     const Float_t kRB24B1PlieThickness     =  0.015;   // Plie thickness             
878
879     const Float_t kRB24B1PlieRadius = 
880         (kRB24B1BellowUndL + (2. *  kRB24B1NumberOfPlies - 2.) * kRB24B1PlieThickness) / (4. * kRB24B1NumberOfPlies);
881     
882     const Float_t kRB24B1ProtTubeThickness = 0.02;     // Thickness of the protection tube
883     const Float_t kRB24B1ProtTubeLength    = 4.2;      // Length of the protection tube
884
885     const Float_t kRB24B1RFlangeL          = 1.86;     // Length of the flanges
886     const Float_t kRB24B1RFlangeLO         = 0.26;     // Flange overlap
887     const Float_t kRB24B1RFlangeRO         = 11.18/2;  // Inner radius at Flange overlap    
888     const Float_t kRB24B1RFlangeRou        = 15.20/2.; // Outer radius of flange
889     const Float_t kRB24B1RFlangeRecess     = 0.98;     // Flange recess
890     const Float_t kRB24B1L                 = kRB24B1CompL +  2. * (kRB24B1RFlangeL - kRB24B1RFlangeRecess);
891     
892 ///      
893 //
894 // Bellow mother volume
895     TGeoPcon* shRB24B1BellowM = new TGeoPcon(0., 360., 14);
896     // Connection Tube and Flange
897     z = 0.;
898     shRB24B1BellowM->DefineSection( 0, z, 0.,               kRB24B1RFlangeRou);
899     z += kRB24B1RFlangeLO;
900     shRB24B1BellowM->DefineSection( 1, z, 0.,               kRB24B1RFlangeRou);
901     shRB24B1BellowM->DefineSection( 2, z, 0.,               kRB24B1RFlangeRou);    
902     z = kRB24B1RFlangeL;
903     shRB24B1BellowM->DefineSection( 3, z, 0.,               kRB24B1RFlangeRou);    
904     shRB24B1BellowM->DefineSection( 4, z, 0.,               kRB24B1ConTubeRou);
905     z = kRB24B1ConTubeL +  kRB24B1RFlangeL - kRB24B1RFlangeRecess;
906     shRB24B1BellowM->DefineSection( 5, z, 0.,               kRB24B1ConTubeRou);
907     // Plie
908     shRB24B1BellowM->DefineSection( 6, z, 0.,               kRB24B1BellowRo + kRB24B1ProtTubeThickness);
909     z += kRB24B1BellowUndL;
910     shRB24B1BellowM->DefineSection( 7, z, 0.,               kRB24B1BellowRo + kRB24B1ProtTubeThickness);
911     shRB24B1BellowM->DefineSection( 8, z, 0.,               kRB24B1ConTubeRou);
912     // Connection Tube and Flange
913     z = kRB24B1L - shRB24B1BellowM->GetZ(3);
914     shRB24B1BellowM->DefineSection( 9, z, 0.,               kRB24B1ConTubeRou);
915     shRB24B1BellowM->DefineSection(10, z, 0.,               kRB24B1RFlangeRou);
916     z = kRB24B1L - shRB24B1BellowM->GetZ(1);
917     shRB24B1BellowM->DefineSection(11, z, 0.,               kRB24B1RFlangeRou);
918     shRB24B1BellowM->DefineSection(12, z, 0.,               kRB24B1RFlangeRou);
919     z = kRB24B1L - shRB24B1BellowM->GetZ(0);
920     shRB24B1BellowM->DefineSection(13, z, 0.,               kRB24B1RFlangeRou);
921
922     TGeoVolume* voRB24B1BellowM = new TGeoVolume("RB24B1BellowM", shRB24B1BellowM, kMedVac);
923     voRB24B1BellowM->SetVisibility(0);
924 //
925 // Bellow Section    
926     TGeoVolume* voRB24B1Bellow 
927         = MakeBellow("RB24B1", kRB24B1NumberOfPlies, kRB24B1BellowRi, kRB24B1BellowRo, 
928                      kRB24B1BellowUndL, kRB24B1PlieRadius ,kRB24B1PlieThickness);
929     voRB24B1Bellow->SetVisibility(0);
930     
931 //
932 // End Parts (connection tube)
933     TGeoVolume* voRB24B1CT = new TGeoVolume("RB24B1CT", new TGeoTube(kRB24B1ConTubeRin, kRB24B1ConTubeRou,  kRB24B1ConTubeL/2.), kMedSteel); 
934 //
935 // Protection Tube      
936     TGeoVolume* voRB24B1PT = new TGeoVolume("RB24B1PT", new TGeoTube(kRB24B1BellowRo, kRB24B1BellowRo + kRB24B1ProtTubeThickness,  
937                                                                      kRB24B1ProtTubeLength / 2.), kMedSteel);
938     
939     z = kRB24B1ConTubeL/2. +  (kRB24B1RFlangeL - kRB24B1RFlangeRecess);
940     
941     voRB24B1BellowM->AddNode(voRB24B1CT, 1, new TGeoTranslation(0., 0., z));
942     z += (kRB24B1ConTubeL/2.+ kRB24B1BellowUndL/2.);
943     voRB24B1BellowM->AddNode(voRB24B1Bellow, 1, new TGeoTranslation(0., 0., z));
944     z += (kRB24B1BellowUndL/2. + kRB24B1ConTubeL/2);
945     voRB24B1BellowM->AddNode(voRB24B1CT, 2, new TGeoTranslation(0., 0., z));
946     z =  kRB24B1ConTubeL +  kRB24B1ProtTubeLength / 2. + 1. + kRB24B1RFlangeLO;
947     voRB24B1BellowM->AddNode(voRB24B1PT, 1, new TGeoTranslation(0., 0., z));
948     z +=  kRB24B1ProtTubeLength + 0.6;
949     voRB24B1BellowM->AddNode(voRB24B1PT, 2, new TGeoTranslation(0., 0., z));
950
951                  
952
953 // Pos 1/2 Rotatable Flange         LHCVBU__0013
954 // Pos 1/3 Flange DN100/103         LHCVBU__0018
955 // The two flanges can be represented by the same volume
956     // Outer Radius (including the outer movable ring).
957     // The inner ring has a diameter of 12.04 cm
958
959   
960     TGeoPcon* shRB24B1RFlange = new TGeoPcon(0., 360., 10);
961     z = 0.;
962     shRB24B1RFlange->DefineSection(0, z, 10.30/2., kRB24B1RFlangeRou);
963     z += 0.55;  // 5.5 mm added for outer ring
964     z += 0.43;
965     shRB24B1RFlange->DefineSection(1, z, 10.30/2., kRB24B1RFlangeRou);
966     shRB24B1RFlange->DefineSection(2, z, 10.06/2., kRB24B1RFlangeRou);    
967     z += 0.15;
968     shRB24B1RFlange->DefineSection(3, z, 10.06/2., kRB24B1RFlangeRou);    
969     // In reality this part is rounded
970     shRB24B1RFlange->DefineSection(4, z, 10.91/2., kRB24B1RFlangeRou);    
971     z += 0.15;
972     shRB24B1RFlange->DefineSection(5, z, 10.91/2., kRB24B1RFlangeRou);    
973     shRB24B1RFlange->DefineSection(6, z, 10.06/2., kRB24B1RFlangeRou);    
974     z += 0.32;
975     shRB24B1RFlange->DefineSection(7, z, 10.06/2., kRB24B1RFlangeRou);    
976     shRB24B1RFlange->DefineSection(8, z, kRB24B1RFlangeRO, kRB24B1RFlangeRou);    
977     z += kRB24B1RFlangeLO;
978     shRB24B1RFlange->DefineSection(9, z, kRB24B1RFlangeRO, kRB24B1RFlangeRou);    
979     
980     TGeoVolume* voRB24B1RFlange = new TGeoVolume("RB24B1RFlange", shRB24B1RFlange, kMedSteel);
981
982     
983     z = kRB24B1L - kRB24B1RFlangeL;
984     voRB24B1BellowM->AddNode(voRB24B1RFlange, 1, new TGeoTranslation(0., 0., z));
985     z = kRB24B1RFlangeL;
986     voRB24B1BellowM->AddNode(voRB24B1RFlange, 2, new TGeoCombiTrans(0., 0., z, rot180));
987 //
988 // Pos 2 RF Contact   D80         LHCVSR__0005
989 //
990 // Pos 2.1 RF Contact Flange      LHCVSR__0003
991 //
992     TGeoPcon* shRB24B1RCTFlange = new TGeoPcon(0., 360., 6);
993     const Float_t kRB24B1RCTFlangeRin  = 8.06/2. + 0.05;  // Inner radius
994     const Float_t kRB24B1RCTFlangeL    = 1.45;            // Length
995     
996     z = 0.;
997     shRB24B1RCTFlange->DefineSection(0, z, kRB24B1RCTFlangeRin,  8.20/2.);
998     z += 0.15;
999     shRB24B1RCTFlange->DefineSection(1, z, kRB24B1RCTFlangeRin,  8.20/2.);
1000     shRB24B1RCTFlange->DefineSection(2, z, kRB24B1RCTFlangeRin,  8.60/2.);
1001     z += 1.05;
1002     shRB24B1RCTFlange->DefineSection(3, z, kRB24B1RCTFlangeRin,  8.60/2.);
1003     shRB24B1RCTFlange->DefineSection(4, z, kRB24B1RCTFlangeRin, 11.16/2.);
1004     z += 0.25;
1005     shRB24B1RCTFlange->DefineSection(5, z, kRB24B1RCTFlangeRin, 11.16/2.);
1006     TGeoVolume* voRB24B1RCTFlange = new TGeoVolume("RB24B1RCTFlange", shRB24B1RCTFlange, kMedCu);
1007     z = kRB24B1L - kRB24B1RCTFlangeL;
1008     
1009     voRB24B1BellowM->AddNode(voRB24B1RCTFlange, 1, new TGeoTranslation(0., 0., z));
1010 //
1011 // Pos 2.2 RF-Contact        LHCVSR__0004
1012 //
1013     TGeoPcon* shRB24B1RCT = new TGeoPcon(0., 360., 3);
1014     const Float_t kRB24B1RCTRin  = 8.00/2.;        // Inner radius
1015     const Float_t kRB24B1RCTCRin = 8.99/2.;        // Max. inner radius conical section
1016     const Float_t kRB24B1RCTL    = 11.78;          // Length
1017     const Float_t kRB24B1RCTSL   = 10.48;          // Length of straight section
1018     const Float_t kRB24B1RCTd    =  0.03;          // Thickness
1019     
1020     z = 0;
1021     shRB24B1RCT->DefineSection(0, z,  kRB24B1RCTCRin,  kRB24B1RCTCRin + kRB24B1RCTd);
1022     z =  kRB24B1RCTL -  kRB24B1RCTSL;
1023     // In the (VSR0004) this section is straight in (LHCVC2U_0001) it is conical ????
1024     shRB24B1RCT->DefineSection(1, z,  kRB24B1RCTRin + 0.35,  kRB24B1RCTRin + 0.35 + kRB24B1RCTd);
1025     z = kRB24B1RCTL - 0.03;
1026     shRB24B1RCT->DefineSection(2, z,  kRB24B1RCTRin,  kRB24B1RCTRin + kRB24B1RCTd);
1027
1028     TGeoVolume* voRB24B1RCT = new TGeoVolume("RB24B1RCT", shRB24B1RCT, kMedCu);
1029     z = kRB24B1L - kRB24B1RCTL - 0.45;
1030     voRB24B1BellowM->AddNode(voRB24B1RCT, 1, new TGeoTranslation(0., 0., z));    
1031
1032 //
1033 // Pos 3 Trans. Tube Flange       LHCVSR__0065
1034 //
1035 // Pos 3.1 Transition Tube D53    LHCVSR__0064
1036 // Pos 3.2 Transition Flange      LHCVSR__0060
1037 // Pos 3.3 Transition Tube        LHCVSR__0058
1038     TGeoPcon* shRB24B1TTF = new TGeoPcon(0., 360., 7);
1039     // Flange
1040     z = 0.;
1041     shRB24B1TTF->DefineSection(0, z,  6.30/2., 11.16/2.);
1042     z += 0.25;
1043     shRB24B1TTF->DefineSection(1, z,  6.30/2., 11.16/2.);
1044     shRB24B1TTF->DefineSection(2, z,  6.30/2.,  9.3/2.);
1045     z += 0.55;
1046     shRB24B1TTF->DefineSection(3, z,  6.30/2.,  9.3/2.);
1047     // Tube
1048     shRB24B1TTF->DefineSection(4, z,  6.30/2.,  6.7/2.);
1049     z += 5.80;
1050     shRB24B1TTF->DefineSection(5, z,  6.30/2.,  6.7/2.);
1051     // Transition Tube
1052     z += 3.75;
1053     shRB24B1TTF->DefineSection(6, z,  8.05/2.,  8.45/2.);
1054     TGeoVolume* voRB24B1TTF = new TGeoVolume("RB24B1TTF", shRB24B1TTF, kMedSteel);
1055     z =  0.;
1056     voRB24B1BellowM->AddNode(voRB24B1TTF, 1, new TGeoTranslation(0., 0., z));    
1057
1058 // Annular Ion Pump        
1059 // LHCVC2U_0003
1060 //
1061 // Pos  1 Rotable Flange         LHCVFX__0031
1062 // Pos  2 RF Screen Tube         LHCVC2U_0005
1063 // Pos  3 Shell                  LHCVC2U_0007
1064 // Pos  4 Extruded Shell         LHCVC2U_0006
1065 // Pos  5 Feedthrough Tube       LHCVC2U_0004
1066 // Pos  6 Tubulated Flange       STDVFUHV0021
1067 // Pos  7 Fixed Flange           LHCVFX__0032
1068 // Pos  8 Pumping Elements
1069
1070 //
1071 // Pos 1 Rotable Flange          LHCVFX__0031
1072 // pos 7 Fixed Flange            LHCVFX__0032
1073 //
1074 //  Mother volume
1075     const Float_t kRB24AIpML = 35.;
1076     
1077     TGeoVolume* voRB24AIpM = new TGeoVolume("voRB24AIpM", new TGeoTube(0., 10., kRB24AIpML/2.), kMedAir);
1078     voRB24AIpM->SetVisibility(0);
1079     
1080     //
1081     // Length 35 cm
1082     // Flange 2 x 1.98 =   3.96
1083     // Tube            =  32.84
1084     //==========================
1085     //                    36.80
1086     // Overlap 2 * 0.90 =  1.80
1087                         
1088     const Float_t kRB24IpRFD1     =  0.68;    // Length of section 1
1089     const Float_t kRB24IpRFD2     =  0.30;    // Length of section 2                                                 
1090     const Float_t kRB24IpRFD3     =  0.10;    // Length of section 3                                                       
1091     const Float_t kRB24IpRFD4     =  0.35;    // Length of section 4                                                       
1092     const Float_t kRB24IpRFD5     =  0.55;    // Length of section 5                                                       
1093     
1094     const Float_t kRB24IpRFRo     = 15.20/2.; // Flange outer radius 
1095     const Float_t kRB24IpRFRi1    =  6.30/2.; // Flange inner radius section 1
1096     const Float_t kRB24IpRFRi2    =  6.00/2.; // Flange inner radius section 2
1097     const Float_t kRB24IpRFRi3    =  5.84/2.; // Flange inner radius section 3    
1098     const Float_t kRB24IpRFRi4    =  6.00/2.; // Flange inner radius section 1
1099     const Float_t kRB24IpRFRi5    = 10.50/2.; // Flange inner radius section 2
1100
1101     TGeoPcon* shRB24IpRF = new TGeoPcon(0., 360., 9);
1102     z0 = 0.;
1103     shRB24IpRF->DefineSection(0, z0, kRB24IpRFRi1, kRB24IpRFRo);
1104     z0 += kRB24IpRFD1;
1105     shRB24IpRF->DefineSection(1, z0, kRB24IpRFRi2, kRB24IpRFRo);
1106     z0 += kRB24IpRFD2;
1107     shRB24IpRF->DefineSection(2, z0, kRB24IpRFRi2, kRB24IpRFRo);
1108     shRB24IpRF->DefineSection(3, z0, kRB24IpRFRi3, kRB24IpRFRo);
1109     z0 += kRB24IpRFD3;
1110     shRB24IpRF->DefineSection(4, z0, kRB24IpRFRi3, kRB24IpRFRo);
1111     shRB24IpRF->DefineSection(5, z0, kRB24IpRFRi4, kRB24IpRFRo);
1112     z0 += kRB24IpRFD4;
1113     shRB24IpRF->DefineSection(6, z0, kRB24IpRFRi4, kRB24IpRFRo);
1114     shRB24IpRF->DefineSection(7, z0, kRB24IpRFRi5, kRB24IpRFRo);
1115     z0 += kRB24IpRFD5;
1116     shRB24IpRF->DefineSection(8, z0, kRB24IpRFRi5, kRB24IpRFRo);
1117
1118     TGeoVolume* voRB24IpRF = new TGeoVolume("RB24IpRF", shRB24IpRF, kMedSteel);
1119     
1120 //
1121 // Pos  2 RF Screen Tube         LHCVC2U_0005
1122 //
1123
1124 //
1125 // Tube
1126     Float_t kRB24IpSTTL  = 32.84;            // Total length of the tube
1127     Float_t kRB24IpSTTRi =  5.80/2.;         // Inner Radius
1128     Float_t kRB24IpSTTRo =  6.00/2.;         // Outer Radius
1129     TGeoVolume* voRB24IpSTT = new TGeoVolume("RB24IpSTT", new TGeoTube(kRB24IpSTTRi, kRB24IpSTTRo, kRB24IpSTTL/2.), kMedSteel);
1130 // Screen
1131     Float_t kRB24IpSTCL  =  0.4;             // Lenth of the crochet detail
1132     // Length of the screen 
1133     Float_t kRB24IpSTSL  =  9.00 - 2. * kRB24IpSTCL; 
1134     // Rel. position of the screen 
1135     Float_t kRB24IpSTSZ  =  7.00 + kRB24IpSTCL; 
1136     TGeoVolume* voRB24IpSTS = new TGeoVolume("RB24IpSTS", new TGeoTube(kRB24IpSTTRi, kRB24IpSTTRo, kRB24IpSTSL/2.), kMedSteel);
1137     // Vacuum
1138     TGeoVolume* voRB24IpSTV = new TGeoVolume("RB24IpSTV", new TGeoTube(0., kRB24IpSTTRi, kRB24AIpML/2.), kMedVac);
1139     //
1140     voRB24IpSTT->AddNode(voRB24IpSTS, 1, new TGeoTranslation(0., 0., kRB24IpSTSZ -  kRB24IpSTTL/2. +  kRB24IpSTSL/2.));
1141     
1142 // Crochets
1143     // Inner radius
1144     Float_t kRB24IpSTCRi  = kRB24IpSTTRo + 0.25;
1145     // Outer radius
1146     Float_t kRB24IpSTCRo  = kRB24IpSTTRo + 0.35;
1147     // Length of 1stsection
1148     Float_t kRB24IpSTCL1  = 0.15;
1149     // Length of 2nd section
1150     Float_t kRB24IpSTCL2  = 0.15;
1151     // Length of 3rd section
1152     Float_t kRB24IpSTCL3  = 0.10;
1153     // Rel. position of 1st Crochet
1154
1155
1156     TGeoPcon* shRB24IpSTC = new TGeoPcon(0., 360., 5);
1157     z0 = 0;
1158     shRB24IpSTC->DefineSection(0, z0, kRB24IpSTCRi, kRB24IpSTCRo);
1159     z0 += kRB24IpSTCL1;
1160     shRB24IpSTC->DefineSection(1, z0, kRB24IpSTCRi, kRB24IpSTCRo);
1161     shRB24IpSTC->DefineSection(2, z0, kRB24IpSTTRo, kRB24IpSTCRo);
1162     z0 += kRB24IpSTCL2;
1163     shRB24IpSTC->DefineSection(3, z0, kRB24IpSTTRo, kRB24IpSTCRo);
1164     z0 += kRB24IpSTCL3;
1165     shRB24IpSTC->DefineSection(4, z0, kRB24IpSTTRo, kRB24IpSTTRo + 0.001);
1166     TGeoVolume* voRB24IpSTC = new TGeoVolume("RB24IpSTC", shRB24IpSTC, kMedSteel);
1167
1168 // Pos  3 Shell                  LHCVC2U_0007
1169 // Pos  4 Extruded Shell         LHCVC2U_0006
1170     Float_t kRB24IpShellL     =  4.45;    // Length of the Shell
1171     Float_t kRB24IpShellD     =  0.10;    // Wall thickness of the shell
1172     Float_t kRB24IpShellCTRi  =  6.70/2.; // Inner radius of the connection tube
1173     Float_t kRB24IpShellCTL   =  1.56;    // Length of the connection tube
1174     Float_t kRB24IpShellCARi  = 17.80/2.; // Inner radius of the cavity
1175     Float_t kRB24IpShellCCRo  = 18.20/2.; // Inner radius at the centre
1176
1177     TGeoPcon* shRB24IpShell = new TGeoPcon(0., 360., 7);
1178     z0 = 0;
1179     shRB24IpShell->DefineSection(0, z0, kRB24IpShellCTRi, kRB24IpShellCTRi + kRB24IpShellD);
1180     z0 +=  kRB24IpShellCTL;
1181     shRB24IpShell->DefineSection(1, z0, kRB24IpShellCTRi, kRB24IpShellCTRi + kRB24IpShellD);
1182     shRB24IpShell->DefineSection(2, z0, kRB24IpShellCTRi, kRB24IpShellCARi + kRB24IpShellD);
1183     z0 += kRB24IpShellD;
1184     shRB24IpShell->DefineSection(3, z0, kRB24IpShellCARi, kRB24IpShellCARi + kRB24IpShellD);
1185     z0 = kRB24IpShellL - kRB24IpShellD;
1186     shRB24IpShell->DefineSection(4, z0, kRB24IpShellCARi, kRB24IpShellCARi + kRB24IpShellD);
1187     shRB24IpShell->DefineSection(5, z0, kRB24IpShellCARi, kRB24IpShellCCRo);
1188     z0 = kRB24IpShellL;
1189     shRB24IpShell->DefineSection(6, z0, kRB24IpShellCARi, kRB24IpShellCCRo);
1190     TGeoVolume* voRB24IpShell = new TGeoVolume("RB24IpShell", shRB24IpShell, kMedSteel);
1191     
1192     TGeoPcon* shRB24IpShellM   = MakeMotherFromTemplate(shRB24IpShell, 0, 6, kRB24IpShellCTRi , 13);
1193     
1194     
1195     for (Int_t i = 0; i < 6; i++) {
1196         z = 2. * kRB24IpShellL  - shRB24IpShellM->GetZ(5-i);
1197         Float_t rmin = shRB24IpShellM->GetRmin(5-i);
1198         Float_t rmax = shRB24IpShellM->GetRmax(5-i);
1199         shRB24IpShellM->DefineSection(7+i, z, rmin, rmax);
1200     }
1201     
1202     TGeoVolume* voRB24IpShellM = new TGeoVolume("RB24IpShellM", shRB24IpShellM, kMedVac);
1203     voRB24IpShellM->SetVisibility(0);
1204     voRB24IpShellM->AddNode(voRB24IpShell, 1, gGeoIdentity);
1205     voRB24IpShellM->AddNode(voRB24IpShell, 2, new TGeoCombiTrans(0., 0., 2. * kRB24IpShellL, rot180));
1206 //
1207 // Pos  8 Pumping Elements
1208 //
1209 //  Anode array
1210     TGeoVolume* voRB24IpPE = new TGeoVolume("voRB24IpPE", new TGeoTube(0.9, 1., 2.54/2.), kMedSteel);
1211     Float_t kRB24IpPEAR = 5.5;
1212     
1213     for (Int_t i = 0; i < 15; i++) {
1214         Float_t phi = Float_t(i) * 24.;
1215         Float_t x   =  kRB24IpPEAR * TMath::Cos(kDegRad * phi);
1216         Float_t y   =  kRB24IpPEAR * TMath::Sin(kDegRad * phi);
1217         voRB24IpShellM->AddNode(voRB24IpPE, i+1, new TGeoTranslation(x, y, kRB24IpShellL));
1218     }
1219     
1220     
1221 //
1222 //  Cathodes
1223 //
1224 // Here we could add some Ti strips
1225
1226 // Postioning of elements
1227     voRB24AIpM->AddNode(voRB24IpRF,     1, new TGeoTranslation(0., 0., -kRB24AIpML/2.));
1228     voRB24AIpM->AddNode(voRB24IpRF,     2, new TGeoCombiTrans (0., 0., +kRB24AIpML/2., rot180));
1229     voRB24AIpM->AddNode(voRB24IpSTT,    1, new TGeoTranslation(0., 0., 0.));
1230     voRB24AIpM->AddNode(voRB24IpSTV,    1, new TGeoTranslation(0., 0., 0.));
1231     voRB24AIpM->AddNode(voRB24IpShellM, 1, new TGeoTranslation(0., 0., -kRB24AIpML/2. +  8.13));
1232     voRB24AIpM->AddNode(voRB24IpSTC,    1, new TGeoTranslation(0., 0., 8.13 - kRB24AIpML/2.));
1233     voRB24AIpM->AddNode(voRB24IpSTC,    2, new TGeoCombiTrans (0., 0., 8.14 + 8.9 - kRB24AIpML/2., rot180));
1234     
1235 //
1236 // Valve
1237 // VAC Series 47 DN 63 with manual actuator
1238 //
1239     const Float_t kRB24ValveWz = 7.5;
1240     const Float_t kRB24ValveDN = 10.0/2.;
1241 //
1242 //  Body containing the valve plate
1243 //
1244     const Float_t kRB24ValveBoWx =  15.6;
1245     const Float_t kRB24ValveBoWy = (21.5 + 23.1 - 5.);
1246     const Float_t kRB24ValveBoWz =  4.6;
1247     const Float_t kRB24ValveBoD  =  0.5;
1248
1249     TGeoVolume* voRB24ValveBoM =
1250         new TGeoVolume("RB24ValveBoM", 
1251                        new TGeoBBox( kRB24ValveBoWx/2.,  kRB24ValveBoWy/2., kRB24ValveBoWz/2.), kMedAir);
1252     voRB24ValveBoM->SetVisibility(0);
1253     TGeoVolume* voRB24ValveBo =
1254         new TGeoVolume("RB24ValveBo", 
1255                        new TGeoBBox( kRB24ValveBoWx/2.,  kRB24ValveBoWy/2., kRB24ValveBoWz/2.), kMedSteel);
1256     voRB24ValveBoM->AddNode(voRB24ValveBo, 1, gGeoIdentity);
1257     //
1258     // Inner volume
1259     //
1260     TGeoVolume* voRB24ValveBoI = new TGeoVolume("RB24ValveBoI", 
1261                                                 new TGeoBBox( kRB24ValveBoWx/2. -  kRB24ValveBoD,  
1262                                                               kRB24ValveBoWy/2. -  kRB24ValveBoD/2., 
1263                                                               kRB24ValveBoWz/2. -  kRB24ValveBoD), 
1264                                                 kMedVac);
1265     voRB24ValveBo->AddNode(voRB24ValveBoI, 1, new TGeoTranslation(0., kRB24ValveBoD/2., 0.));
1266     //
1267     // Opening and Flanges
1268     const Float_t  kRB24ValveFlRo = 18./2.;
1269     const Float_t  kRB24ValveFlD  = 1.45;    
1270     TGeoVolume* voRB24ValveBoA = new TGeoVolume("RB24ValveBoA", 
1271                                                 new TGeoTube(0., kRB24ValveDN/2., kRB24ValveBoD/2.), kMedVac);
1272     voRB24ValveBo->AddNode(voRB24ValveBoA, 1, new TGeoTranslation(0., - kRB24ValveBoWy/2. + 21.5, -kRB24ValveBoWz/2. +  kRB24ValveBoD/2.));
1273     voRB24ValveBo->AddNode(voRB24ValveBoA, 2, new TGeoTranslation(0., - kRB24ValveBoWy/2. + 21.5, +kRB24ValveBoWz/2. -  kRB24ValveBoD/2.));
1274  
1275     TGeoVolume* voRB24ValveFl  = new TGeoVolume("RB24ValveFl",  new TGeoTube(kRB24ValveDN/2.,  kRB24ValveFlRo, kRB24ValveFlD/2.), kMedSteel);
1276     TGeoVolume* voRB24ValveFlI = new TGeoVolume("RB24ValveFlI", new TGeoTube(0.,               kRB24ValveFlRo, kRB24ValveFlD/2.), kMedVac);
1277     voRB24ValveFlI->AddNode(voRB24ValveFl, 1, gGeoIdentity);
1278     
1279     //
1280     // Actuator Flange
1281     const Float_t kRB24ValveAFlWx =  18.9;
1282     const Float_t kRB24ValveAFlWy =   5.0;
1283     const Float_t kRB24ValveAFlWz =   7.7;
1284     TGeoVolume* voRB24ValveAFl = new TGeoVolume("RB24ValveAFl", new TGeoBBox(kRB24ValveAFlWx/2., kRB24ValveAFlWy/2., kRB24ValveAFlWz/2.), kMedSteel);
1285     //
1286     // Actuator Tube
1287     const Float_t kRB24ValveATRo = 9.7/2.;
1288     const Float_t kRB24ValveATH  = 16.6;
1289     TGeoVolume* voRB24ValveAT = new TGeoVolume("RB24ValveAT", new TGeoTube(kRB24ValveATRo -  2. * kRB24ValveBoD,kRB24ValveATRo,  kRB24ValveATH/2.), 
1290                                                kMedSteel);
1291     //
1292     // Manual Actuator (my best guess)
1293     TGeoVolume* voRB24ValveMA1 = new TGeoVolume("RB24ValveMA1", new TGeoCone(2.5/2., 0., 0.5, 4.5, 5.), kMedSteel);
1294     TGeoVolume* voRB24ValveMA2 = new TGeoVolume("RB24ValveMA2", new TGeoTorus(5., 0., 1.25), kMedSteel);
1295     TGeoVolume* voRB24ValveMA3 = new TGeoVolume("RB24ValveMA3", new TGeoTube (0., 1.25, 2.5), kMedSteel);
1296     
1297
1298     //
1299     // Position all volumes
1300     Float_t y0;
1301     TGeoVolumeAssembly*  voRB24ValveMo = new TGeoVolumeAssembly("RB24ValveMo");
1302     voRB24ValveMo->AddNode(voRB24ValveFl,  1, new TGeoTranslation(0., 0., - 7.5/2. + kRB24ValveFlD/2.));
1303     voRB24ValveMo->AddNode(voRB24ValveFl,  2, new TGeoTranslation(0., 0., + 7.5/2. - kRB24ValveFlD/2.));
1304     y0 = -21.5;
1305     voRB24ValveMo->AddNode(voRB24ValveBoM, 1, new TGeoTranslation(0., y0 + kRB24ValveBoWy/2.,   0.));
1306     y0 +=  kRB24ValveBoWy;
1307     voRB24ValveMo->AddNode(voRB24ValveAFl, 1, new TGeoTranslation(0., y0 +  kRB24ValveAFlWy/2., 0.));
1308     y0 +=  kRB24ValveAFlWy;
1309     voRB24ValveMo->AddNode(voRB24ValveAT,  1, new TGeoCombiTrans(0.,  y0 + kRB24ValveATH/2.,    0., rotyz));
1310     y0 += kRB24ValveATH;
1311     voRB24ValveMo->AddNode(voRB24ValveMA1, 1, new TGeoCombiTrans(0.,  y0 + 2.5/2.,    0., rotyz));
1312     y0 += 2.5;
1313     voRB24ValveMo->AddNode(voRB24ValveMA2, 1, new TGeoCombiTrans(0.,  y0 + 2.5/2.,    0., rotyz));
1314     y0 += 2.5;
1315     voRB24ValveMo->AddNode(voRB24ValveMA3, 1, new TGeoCombiTrans(5./TMath::Sqrt(2.),  y0 + 5.0/2., 5./TMath::Sqrt(2.), rotyz));
1316 //
1317 // Warm Module Type VMABC
1318 // LHCVMABC_0002
1319 // 
1320 //
1321 //
1322 // Flange                  1.00
1323 // Central Piece          11.50
1324 // Bellow                 14.50
1325 // End Flange              1.00
1326 //===================================
1327 // Total                  28.00 
1328 //                        
1329 // Pos 1 Warm Bellows DN100       LHCVBU__0016
1330 // Pos 2 Trans. Tube Flange       LHCVSR__0062
1331 // Pos 3 RF Contact   D63         LHCVSR__0057
1332 // [Pos 4 Hex. Countersunk Screw   Bossard BN4719]
1333 // [Pos 5 Tension spring           LHCVSR__00239]
1334 //
1335
1336 // Pos 1 Warm Bellows DN100                   LHCVBU__0016
1337 // Pos 1.1 Right Body 2 Ports with Support    LHCVBU__0014
1338     //
1339     // Tube 1
1340     const Float_t kRB24VMABCRBT1Ri = 10.0/2.;
1341     const Float_t kRB24VMABCRBT1Ro = 10.3/2.;
1342     const Float_t kRB24VMABCRBT1L  = 11.5;   
1343     const Float_t kRB24VMABCRBT1L2 = 8.;
1344     const Float_t kRB24VMABCL      = 28.;
1345     
1346     TGeoTube* shRB24VMABCRBT1 = new TGeoTube(kRB24VMABCRBT1Ri, kRB24VMABCRBT1Ro, kRB24VMABCRBT1L/2.);
1347     shRB24VMABCRBT1->SetName("RB24VMABCRBT1");
1348     TGeoTube* shRB24VMABCRBT1o = new TGeoTube(0., kRB24VMABCRBT1Ro,  kRB24VMABCRBT1L/2.);
1349     shRB24VMABCRBT1o->SetName("RB24VMABCRBT1o");
1350     TGeoTube* shRB24VMABCRBT1o2 = new TGeoTube(0., kRB24VMABCRBT1Ro + 0.3, kRB24VMABCRBT1L/2.);
1351     shRB24VMABCRBT1o2->SetName("RB24VMABCRBT1o2");
1352     // Lower inforcement 
1353     TGeoVolume*  voRB24VMABCRBT12  = new TGeoVolume("RB24VMABCRBT12", 
1354                                                     new TGeoTubeSeg(kRB24VMABCRBT1Ro, kRB24VMABCRBT1Ro + 0.3, kRB24VMABCRBT1L2/2., 220., 320.)
1355                                                     , kMedSteel);
1356     //
1357     // Tube 2
1358     const Float_t kRB24VMABCRBT2Ri =   6.0/2.;
1359     const Float_t kRB24VMABCRBT2Ro =   6.3/2.;
1360     const Float_t kRB24VMABCRBF2Ro =  11.4/2.;
1361     const Float_t kRB24VMABCRBT2L  =   5.95 + 2.; // 2. cm added for welding    
1362     const Float_t kRB24VMABCRBF2L  =   1.75;
1363     TGeoTube* shRB24VMABCRBT2 = new TGeoTube(kRB24VMABCRBT2Ri, kRB24VMABCRBT2Ro,  kRB24VMABCRBT2L/2.);
1364     shRB24VMABCRBT2->SetName("RB24VMABCRBT2");
1365     TGeoTube* shRB24VMABCRBT2i = new TGeoTube(0., kRB24VMABCRBT2Ri, kRB24VMABCRBT2L/2. + 2.);
1366     shRB24VMABCRBT2i->SetName("RB24VMABCRBT2i");
1367     TGeoCombiTrans* tRBT2 = new TGeoCombiTrans(-11.5 + kRB24VMABCRBT2L/2., 0., 7.2 - kRB24VMABCRBT1L/2.  , rotxz);
1368     tRBT2->SetName("tRBT2");
1369     tRBT2->RegisterYourself();
1370     TGeoCompositeShape* shRB24VMABCRBT2c =  new TGeoCompositeShape("shRB24VMABCRBT2c","RB24VMABCRBT2:tRBT2-RB24VMABCRBT1o");
1371     TGeoVolume* voRB24VMABCRBT2 = new TGeoVolume("shRB24VMABCRBT2", shRB24VMABCRBT2c, kMedSteel);
1372     // Flange
1373     // Pos 1.4 Flange DN63                        LHCVBU__0008
1374     TGeoVolume* voRB24VMABCRBF2 = new TGeoVolume("RB24VMABCRBF2", 
1375                                                  new TGeoTube(kRB24VMABCRBT2Ro, kRB24VMABCRBF2Ro, kRB24VMABCRBF2L/2.), kMedSteel);
1376     // DN63 Blank Flange (my best guess)
1377     TGeoVolume* voRB24VMABCRBF2B = new TGeoVolume("RB24VMABCRBF2B", 
1378                                                   new TGeoTube(0., kRB24VMABCRBF2Ro, kRB24VMABCRBF2L/2.), kMedSteel);
1379     //
1380     // Tube 3
1381     const Float_t kRB24VMABCRBT3Ri =  3.5/2.;
1382     const Float_t kRB24VMABCRBT3Ro =  3.8/2.;
1383     const Float_t kRB24VMABCRBF3Ro =  7.0/2.;
1384     const Float_t kRB24VMABCRBT3L  =  4.95 + 2.; // 2. cm added for welding    
1385     const Float_t kRB24VMABCRBF3L  =  1.27;
1386     TGeoTube* shRB24VMABCRBT3 = new TGeoTube(kRB24VMABCRBT3Ri, kRB24VMABCRBT3Ro,  kRB24VMABCRBT3L/2);
1387     shRB24VMABCRBT3->SetName("RB24VMABCRBT3");
1388     TGeoTube* shRB24VMABCRBT3i = new TGeoTube(0., kRB24VMABCRBT3Ri, kRB24VMABCRBT3L/2. + 2.);
1389     shRB24VMABCRBT3i->SetName("RB24VMABCRBT3i");
1390     TGeoCombiTrans* tRBT3 = new TGeoCombiTrans(0., 10.5 - kRB24VMABCRBT3L/2., 7.2 - kRB24VMABCRBT1L/2.  , rotyz);
1391     tRBT3->SetName("tRBT3");
1392     tRBT3->RegisterYourself();
1393     TGeoCompositeShape* shRB24VMABCRBT3c =  new TGeoCompositeShape("shRB24VMABCRBT3c","RB24VMABCRBT3:tRBT3-RB24VMABCRBT1o");
1394     TGeoVolume* voRB24VMABCRBT3 = new TGeoVolume("shRB24VMABCRBT3", shRB24VMABCRBT3c, kMedSteel);
1395     // Flange
1396     // Pos 1.4 Flange DN35                        LHCVBU__0007
1397     TGeoVolume* voRB24VMABCRBF3 = new TGeoVolume("RB24VMABCRBF3", 
1398                                                  new TGeoTube(kRB24VMABCRBT3Ro, kRB24VMABCRBF3Ro, kRB24VMABCRBF3L/2.), kMedSteel);
1399     //
1400     // Tube 4
1401     const Float_t kRB24VMABCRBT4Ri =  6.0/2.;
1402     const Float_t kRB24VMABCRBT4Ro =  6.4/2.;
1403     const Float_t kRB24VMABCRBT4L  =  6.6;    
1404     TGeoTube* shRB24VMABCRBT4 = new TGeoTube(kRB24VMABCRBT4Ri, kRB24VMABCRBT4Ro,  kRB24VMABCRBT4L/2.);
1405     shRB24VMABCRBT4->SetName("RB24VMABCRBT4");
1406     TGeoCombiTrans* tRBT4 = new TGeoCombiTrans(0.,-11.+kRB24VMABCRBT4L/2., 7.2 - kRB24VMABCRBT1L/2.  , rotyz);
1407     tRBT4->SetName("tRBT4");
1408     tRBT4->RegisterYourself();
1409     TGeoCompositeShape* shRB24VMABCRBT4c =  new TGeoCompositeShape("shRB24VMABCRBT4c","RB24VMABCRBT4:tRBT4-RB24VMABCRBT1o2");
1410     TGeoVolume* voRB24VMABCRBT4 = new TGeoVolume("shRB24VMABCRBT4", shRB24VMABCRBT4c, kMedSteel);
1411     TGeoCompositeShape* shRB24VMABCRB = new TGeoCompositeShape("shRB24VMABCRB", "RB24VMABCRBT1-(RB24VMABCRBT2i:tRBT2+RB24VMABCRBT3i:tRBT3)");
1412     TGeoVolume* voRB24VMABCRBI = new TGeoVolume("RB24VMABCRBI", shRB24VMABCRB, kMedSteel);
1413     //
1414     // Plate
1415     const Float_t kRB24VMABCRBBx = 16.0;
1416     const Float_t kRB24VMABCRBBy =  1.5;
1417     const Float_t kRB24VMABCRBBz = 15.0;
1418     
1419     // Relative position of tubes
1420     const Float_t  kRB24VMABCTz =   7.2;
1421     // Relative position of plate
1422     const Float_t  kRB24VMABCPz =   3.6;
1423     const Float_t  kRB24VMABCPy = -12.5;
1424     
1425     TGeoVolume* voRB24VMABCRBP = new TGeoVolume("RB24VMABCRBP", new TGeoBBox(kRB24VMABCRBBx/2., kRB24VMABCRBBy/2., kRB24VMABCRBBz/2.), kMedSteel);
1426     //
1427     // Pirani Gauge (my best guess)
1428     //
1429     TGeoPcon* shRB24VMABCPirani = new TGeoPcon(0., 360., 15);
1430     // DN35/16 Coupling
1431     z = 0;
1432     shRB24VMABCPirani->DefineSection( 0, z,  0.8 , kRB24VMABCRBF3Ro);
1433     z += kRB24VMABCRBF3L; // 1.3
1434     shRB24VMABCPirani->DefineSection( 1, z,  0.8 , kRB24VMABCRBF3Ro);
1435     shRB24VMABCPirani->DefineSection( 2, z,  0.8 , 1.0);
1436     // Pipe
1437     z += 2.8;
1438     shRB24VMABCPirani->DefineSection( 3, z,  0.8 , 1.0);
1439     // Flange
1440     shRB24VMABCPirani->DefineSection( 4, z,  0.8 , 1.75);
1441     z += 1.6;
1442     shRB24VMABCPirani->DefineSection( 5, z,  0.8 , 1.75);
1443     shRB24VMABCPirani->DefineSection( 6, z,  0.8 , 1.0);
1444     z += 5.2;
1445     shRB24VMABCPirani->DefineSection( 7, z,  0.8 , 1.0);
1446     shRB24VMABCPirani->DefineSection( 8, z,  0.8 , 2.5);    
1447     z += 2.0;
1448     shRB24VMABCPirani->DefineSection( 9, z,  0.80, 2.50);    
1449     shRB24VMABCPirani->DefineSection(10, z,  1.55, 1.75);    
1450     z += 5.7;
1451     shRB24VMABCPirani->DefineSection(11, z,  1.55, 1.75);    
1452     shRB24VMABCPirani->DefineSection(11, z,  0.00, 1.75);    
1453     z += 0.2;
1454     shRB24VMABCPirani->DefineSection(12, z,  0.00, 1.75);    
1455     shRB24VMABCPirani->DefineSection(13, z,  0.00, 0.75);    
1456     z += 0.5;
1457     shRB24VMABCPirani->DefineSection(14, z,  0.00, 0.75);  
1458     TGeoVolume* voRB24VMABCPirani = new TGeoVolume("RB24VMABCPirani", shRB24VMABCPirani, kMedSteel);
1459     //
1460     //
1461     // 
1462     
1463     
1464     //
1465     // Positioning of elements
1466     TGeoVolumeAssembly* voRB24VMABCRB = new TGeoVolumeAssembly("RB24VMABCRB");
1467     //
1468     voRB24VMABCRB->AddNode(voRB24VMABCRBI,   1, gGeoIdentity);
1469     // Plate
1470     voRB24VMABCRB->AddNode(voRB24VMABCRBP,   1, new TGeoTranslation(0., kRB24VMABCPy +  kRB24VMABCRBBy /2., 
1471                                                                     kRB24VMABCRBBz/2. - kRB24VMABCRBT1L/2. +  kRB24VMABCPz));
1472     // Tube 2
1473     voRB24VMABCRB->AddNode(voRB24VMABCRBT2,  1, gGeoIdentity);
1474     // Flange Tube 2
1475     voRB24VMABCRB->AddNode(voRB24VMABCRBF2,  1, new TGeoCombiTrans(kRB24VMABCPy + kRB24VMABCRBF2L/2., 0.,  kRB24VMABCTz - kRB24VMABCRBT1L/2., rotxz));
1476     // Blank Flange Tube 2
1477     voRB24VMABCRB->AddNode(voRB24VMABCRBF2B, 1, new TGeoCombiTrans(kRB24VMABCPy- kRB24VMABCRBF2L/2., 0.,  kRB24VMABCTz - kRB24VMABCRBT1L/2., rotxz));    
1478     // Tube 3
1479     voRB24VMABCRB->AddNode(voRB24VMABCRBT3,  1, gGeoIdentity);
1480     // Flange Tube 3
1481     voRB24VMABCRB->AddNode(voRB24VMABCRBF3,  1, new TGeoCombiTrans(0.,   11.2 - kRB24VMABCRBF3L/2.,  kRB24VMABCTz - kRB24VMABCRBT1L/2., rotyz));
1482     // Pirani Gauge
1483     voRB24VMABCRB->AddNode(voRB24VMABCPirani, 1, new  TGeoCombiTrans(0., 11.2,  kRB24VMABCTz - kRB24VMABCRBT1L/2., rotyz));
1484     // Tube 4
1485     voRB24VMABCRB->AddNode(voRB24VMABCRBT4,  1, gGeoIdentity);
1486     // Inforcement 
1487     voRB24VMABCRB->AddNode(voRB24VMABCRBT12, 1, new TGeoTranslation(0., 0., kRB24VMABCRBT1L2/2. - kRB24VMABCRBT1L/2. + 2.8));
1488     
1489
1490 // Pos 1.3 Bellows with end part              LHCVBU__0002
1491 //
1492 // Connection Tube    
1493 // Connection tube inner r
1494     const Float_t kRB24VMABBEConTubeRin        = 10.0/2.;
1495 // Connection tube outer r
1496     const Float_t kRB24VMABBEConTubeRou        = 10.3/2.;
1497 // Connection tube length
1498     const Float_t kRB24VMABBEConTubeL1         =  0.9;
1499     const Float_t kRB24VMABBEConTubeL2         =  2.6;
1500 //  const Float_t RB24VMABBEBellowL            =  kRB24VMABBEConTubeL1 + kRB24VMABBEConTubeL2 + kRB24B1BellowUndL;
1501     
1502 // Mother volume
1503     TGeoPcon* shRB24VMABBEBellowM = new TGeoPcon(0., 360., 6);
1504     // Connection Tube and Flange
1505     z = 0.;
1506     shRB24VMABBEBellowM->DefineSection( 0, z, kRB24VMABBEConTubeRin,  kRB24VMABBEConTubeRou);
1507     z += kRB24VMABBEConTubeL1;
1508     shRB24VMABBEBellowM->DefineSection( 1, z, kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou);
1509     shRB24VMABBEBellowM->DefineSection( 2, z, kRB24B1BellowRi,       kRB24B1BellowRo + kRB24B1ProtTubeThickness);
1510     z += kRB24B1BellowUndL;
1511     shRB24VMABBEBellowM->DefineSection( 3, z, kRB24B1BellowRi,       kRB24B1BellowRo + kRB24B1ProtTubeThickness);
1512     shRB24VMABBEBellowM->DefineSection( 4, z, kRB24VMABBEConTubeRin,  kRB24VMABBEConTubeRou);
1513     z += kRB24VMABBEConTubeL2;
1514     shRB24VMABBEBellowM->DefineSection( 5, z, kRB24VMABBEConTubeRin,  kRB24VMABBEConTubeRou);
1515     TGeoVolume* voRB24VMABBEBellowM = new TGeoVolume("RB24VMABBEBellowM", shRB24VMABBEBellowM, kMedVac);
1516     voRB24VMABBEBellowM->SetVisibility(0);
1517     
1518 //  Connection tube left
1519     TGeoVolume* voRB24VMABBECT1 = new TGeoVolume("RB24VMABBECT1", 
1520                                               new TGeoTube(kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou,kRB24VMABBEConTubeL1/2.),
1521                                               kMedSteel);
1522 //  Connection tube right
1523     TGeoVolume* voRB24VMABBECT2 = new TGeoVolume("RB24VMABBECT2", 
1524                                               new TGeoTube(kRB24VMABBEConTubeRin, kRB24VMABBEConTubeRou,kRB24VMABBEConTubeL2/2.),
1525                                               kMedSteel);
1526     z = kRB24VMABBEConTubeL1/2.;
1527     voRB24VMABBEBellowM->AddNode(voRB24VMABBECT1, 1, new TGeoTranslation(0., 0., z));
1528     z += kRB24VMABBEConTubeL1/2.;
1529     z += kRB24B1BellowUndL/2.;
1530     voRB24VMABBEBellowM->AddNode(voRB24B1Bellow, 2, new TGeoTranslation(0., 0., z));
1531     z += kRB24B1BellowUndL/2.;
1532     z += kRB24VMABBEConTubeL2/2.;
1533     voRB24VMABBEBellowM->AddNode(voRB24VMABBECT2, 1, new TGeoTranslation(0., 0., z));
1534     z += kRB24VMABBEConTubeL2/2.;
1535
1536     voRB24VMABCRB->AddNode(voRB24VMABBEBellowM, 1, new TGeoTranslation(0., 0., kRB24VMABCRBT1L/2.));
1537
1538 // Pos 1.2 Rotable flange                     LHCVBU__0013[*]
1539 // Front
1540     voRB24VMABCRB->AddNode(voRB24B1RFlange,  3, new TGeoCombiTrans(0., 0., - kRB24VMABCRBT1L/2. + 0.86, rot180));
1541 // End
1542     z =  kRB24VMABCRBT1L/2. + kRB24B1BellowUndL +kRB24VMABBEConTubeL1 +  kRB24VMABBEConTubeL2;
1543     voRB24VMABCRB->AddNode(voRB24B1RFlange,  4, new TGeoTranslation(0., 0., z - 0.86));
1544
1545
1546 // Pos 2    Trans. Tube Flange       LHCVSR__0062
1547 // Pos 2.1  Transition Tube          LHCVSR__0063
1548 // Pos 2.2  Transition Flange        LHCVSR__0060
1549 //
1550 // Transition Tube with Flange
1551     TGeoPcon* shRB24VMABCTT = new TGeoPcon(0., 360., 7);
1552     z = 0.;
1553     shRB24VMABCTT->DefineSection(0, z, 6.3/2., 11.16/2.);
1554     z += 0.25;
1555     shRB24VMABCTT->DefineSection(1, z, 6.3/2., 11.16/2.);
1556     shRB24VMABCTT->DefineSection(2, z, 6.3/2.,  9.30/2.);
1557     z += 0.25;
1558     shRB24VMABCTT->DefineSection(3, z, 6.3/2.,  9.30/2.);
1559     shRB24VMABCTT->DefineSection(4, z, 6.3/2.,  6.70/2.);
1560     z += (20.35 - 0.63);
1561     shRB24VMABCTT->DefineSection(5, z, 6.3/2.,  6.7/2.);
1562     z += 0.63;
1563     shRB24VMABCTT->DefineSection(6, z, 6.3/2.,  6.7/2.);
1564     TGeoVolume* voRB24VMABCTT = new TGeoVolume("RB24VMABCTT", shRB24VMABCTT, kMedSteel);
1565     voRB24VMABCRB->AddNode(voRB24VMABCTT, 1, new TGeoTranslation(0., 0., - kRB24VMABCRBT1L/2.-1.));
1566
1567 // Pos 3   RF Contact   D63         LHCVSR__0057
1568 // Pos 3.1 RF Contact Flange        LHCVSR__0017
1569 //
1570     TGeoPcon* shRB24VMABCCTFlange = new TGeoPcon(0., 360., 6);
1571     const Float_t kRB24VMABCCTFlangeRin  = 6.36/2.;  // Inner radius
1572     const Float_t kRB24VMABCCTFlangeL    = 1.30;     // Length
1573     
1574     z = 0.;
1575     shRB24VMABCCTFlange->DefineSection(0, z, kRB24VMABCCTFlangeRin,  6.5/2.);
1576     z += 0.15;
1577     shRB24VMABCCTFlange->DefineSection(1, z, kRB24VMABCCTFlangeRin,  6.5/2.);
1578     shRB24VMABCCTFlange->DefineSection(2, z, kRB24VMABCCTFlangeRin,  6.9/2.);
1579     z += 0.9;
1580     shRB24VMABCCTFlange->DefineSection(3, z, kRB24VMABCCTFlangeRin,  6.9/2.);
1581     shRB24VMABCCTFlange->DefineSection(4, z, kRB24VMABCCTFlangeRin, 11.16/2.);
1582     z += 0.25;
1583     shRB24VMABCCTFlange->DefineSection(5, z, kRB24VMABCCTFlangeRin, 11.16/2.);
1584     TGeoVolume* voRB24VMABCCTFlange = new TGeoVolume("RB24VMABCCTFlange", shRB24VMABCCTFlange, kMedCu);
1585 //
1586 // Pos 3.2 RF-Contact        LHCVSR__0056
1587 //
1588     TGeoPcon* shRB24VMABCCT = new TGeoPcon(0., 360., 4);
1589     const Float_t kRB24VMABCCTRin  = 6.30/2.;        // Inner radius
1590     const Float_t kRB24VMABCCTCRin = 7.29/2.;        // Max. inner radius conical section
1591     const Float_t kRB24VMABCCTL    = 11.88;          // Length
1592     const Float_t kRB24VMABCCTSL   = 10.48;          // Length of straight section
1593     const Float_t kRB24VMABCCTd    =  0.03;          // Thickness
1594     z = 0;
1595     shRB24VMABCCT->DefineSection(0, z,  kRB24VMABCCTCRin,  kRB24VMABCCTCRin + kRB24VMABCCTd);
1596     z =  kRB24VMABCCTL -  kRB24VMABCCTSL;
1597     shRB24VMABCCT->DefineSection(1, z,  kRB24VMABCCTRin + 0.35,  kRB24VMABCCTRin + 0.35 + kRB24VMABCCTd);
1598     z = kRB24VMABCCTL  -  kRB24VMABCCTFlangeL;
1599     shRB24VMABCCT->DefineSection(2, z,  kRB24VMABCCTRin,  kRB24VMABCCTRin + kRB24VMABCCTd);
1600     z = kRB24VMABCCTL;
1601     shRB24VMABCCT->DefineSection(3, z,  kRB24VMABCCTRin,  kRB24VMABCCTRin + kRB24VMABCCTd);
1602
1603     TGeoVolume* voRB24VMABCCT = new TGeoVolume("RB24VMABCCT", shRB24VMABCCT, kMedCu);
1604     
1605     TGeoVolumeAssembly* voRB24VMABRFCT = new TGeoVolumeAssembly("RB24VMABRFCT");
1606     voRB24VMABRFCT->AddNode(voRB24VMABCCT,        1, gGeoIdentity);
1607     voRB24VMABRFCT->AddNode( voRB24VMABCCTFlange, 1, new TGeoTranslation(0., 0.,  kRB24VMABCCTL - kRB24VMABCCTFlangeL));
1608
1609     z =  kRB24VMABCRBT1L/2. + kRB24B1BellowUndL + kRB24VMABBEConTubeL1 +  kRB24VMABBEConTubeL2 - kRB24VMABCCTL + 1.;    
1610     voRB24VMABCRB->AddNode(voRB24VMABRFCT, 1, new TGeoTranslation(0., 0., z));
1611
1612
1613 //
1614 // Assembling RB24/1
1615 //    
1616     TGeoVolumeAssembly* voRB24 = new TGeoVolumeAssembly("RB24");
1617     // Cu Tube with two simplified flanges
1618     voRB24->AddNode(voRB24CuTubeM, 1, gGeoIdentity);
1619     voRB24->AddNode(voRB24CuTubeA, 1, gGeoIdentity);
1620     z = - kRB24CuTubeL/2 + kRB24CuTubeFL/2.;
1621     voRB24->AddNode(voRB24CuTubeF, 1, new TGeoTranslation(0., 0., z));
1622     z = + kRB24CuTubeL/2 - kRB24CuTubeFL/2.;
1623     voRB24->AddNode(voRB24CuTubeF, 2, new TGeoTranslation(0., 0., z));
1624     // VMABC close to compensator magnet
1625     z = - kRB24CuTubeL/2. -  (kRB24VMABCL - kRB24VMABCRBT1L/2) + 1.;
1626     
1627     voRB24->AddNode(voRB24VMABCRB, 2, new TGeoTranslation(0., 0., z));
1628     // Bellow
1629     z =  kRB24CuTubeL/2;
1630     voRB24->AddNode(voRB24B1BellowM, 1, new TGeoTranslation(0., 0., z));
1631     z +=  (kRB24B1L +  kRB24AIpML/2.);
1632     // Annular ion pump
1633     voRB24->AddNode(voRB24AIpM, 1, new TGeoTranslation(0., 0., z));
1634     z +=  (kRB24AIpML/2. +  kRB24ValveWz/2.);
1635     // Valve
1636     voRB24->AddNode(voRB24ValveMo, 1, new TGeoTranslation(0., 0., z));
1637     z += (kRB24ValveWz/2.+ kRB24VMABCRBT1L/2. + 1.);
1638     // VMABC close to forward detectors
1639     voRB24->AddNode(voRB24VMABCRB, 3, new TGeoTranslation(0., 0., z));
1640 //
1641 //   RB24/2
1642 //     
1643 // Copper Tube RB24/2
1644     const Float_t  kRB242CuTubeL  = 330.0;
1645     
1646     TGeoVolume* voRB242CuTubeM = new TGeoVolume("voRB242CuTubeM", 
1647                                                 new TGeoTube(0., kRB24CuTubeRo, kRB242CuTubeL/2.), kMedVac);
1648     voRB24CuTubeM->SetVisibility(0);
1649     TGeoVolume* voRB242CuTube = new TGeoVolume("voRB242CuTube", 
1650                                                new TGeoTube(kRB24CuTubeRi, kRB24CuTubeRo, kRB242CuTubeL/2.), kMedCu);
1651     voRB242CuTubeM->AddNode(voRB242CuTube, 1, gGeoIdentity);
1652     
1653
1654     TGeoVolumeAssembly* voRB242 = new TGeoVolumeAssembly("RB242");
1655     voRB242->AddNode(voRB242CuTube, 1, gGeoIdentity);
1656     z = - kRB242CuTubeL/2 + kRB24CuTubeFL/2.;
1657     voRB242->AddNode(voRB24CuTubeF, 3, new TGeoTranslation(0., 0., z));
1658     z = + kRB242CuTubeL/2 - kRB24CuTubeFL/2.;
1659     voRB242->AddNode(voRB24CuTubeF, 4, new TGeoTranslation(0., 0., z));
1660     z = - kRB24CuTubeL/2 - kRB24VMABCL - kRB242CuTubeL/2.;
1661     voRB24->AddNode(voRB242, 1, new TGeoTranslation(0., 0., z));
1662 //
1663 //   RB24/3
1664 //     
1665 // Copper Tube RB24/3
1666     const Float_t  kRB243CuTubeL  = 303.35;
1667     
1668     TGeoVolume* voRB243CuTubeM = new TGeoVolume("voRB243CuTubeM", 
1669                                                 new TGeoTube(0., kRB24CuTubeRo, kRB243CuTubeL/2.), kMedVac);
1670     voRB24CuTubeM->SetVisibility(0);
1671     TGeoVolume* voRB243CuTube = new TGeoVolume("voRB243CuTube", 
1672                                                new TGeoTube(kRB24CuTubeRi, kRB24CuTubeRo, kRB243CuTubeL/2.), kMedCu);
1673     voRB243CuTubeM->AddNode(voRB243CuTube, 1, gGeoIdentity);
1674     
1675
1676     TGeoVolumeAssembly* voRB243  = new TGeoVolumeAssembly("RB243");
1677     TGeoVolumeAssembly* voRB243A = new TGeoVolumeAssembly("RB243A");
1678     
1679     voRB243A->AddNode(voRB243CuTube, 1, gGeoIdentity);
1680     z = - kRB243CuTubeL/2 + kRB24CuTubeFL/2.;
1681     voRB243A->AddNode(voRB24CuTubeF, 5, new TGeoTranslation(0., 0., z));
1682     z = + kRB243CuTubeL/2 - kRB24CuTubeFL/2.;
1683     voRB243A->AddNode(voRB24CuTubeF,    6, new TGeoTranslation(0., 0., z));
1684     z = + kRB243CuTubeL/2;
1685     voRB243A->AddNode(voRB24B1BellowM,  2, new TGeoTranslation(0., 0., z));    
1686
1687     z = - kRB243CuTubeL/2.  - kRB24B1L;
1688     voRB243->AddNode(voRB243A, 1, new TGeoTranslation(0., 0., z));    
1689     z = - (1.5 * kRB243CuTubeL + 2. * kRB24B1L);
1690     voRB243->AddNode(voRB243A, 2, new TGeoTranslation(0., 0., z));    
1691
1692     z = - 2. * (kRB243CuTubeL + kRB24B1L) - (kRB24VMABCL - kRB24VMABCRBT1L/2) + 1.;
1693     voRB243->AddNode(voRB24VMABCRB, 3, new TGeoTranslation(0., 0., z));    
1694     
1695     z = - kRB24CuTubeL/2 - kRB24VMABCL - kRB242CuTubeL;
1696     voRB24->AddNode(voRB243, 1, new TGeoTranslation(0., 0., z));
1697
1698
1699 //
1700 //
1701     top->AddNode(voRB24, 1, new TGeoCombiTrans(0., 0., kRB24CuTubeL/2 + 88.5 + 400., rot180));
1702
1703
1704 // 
1705 ////////////////////////////////////////////////////////////////////////////////     
1706 //                                                                            //
1707 //                                  The Absorber Vacuum system                // 
1708 //                                                                            //
1709 ////////////////////////////////////////////////////////////////////////////////
1710 //
1711 //    Rotable Flange starts at:            82.00 cm from IP      
1712 //    Length of rotable flange section:    10.68 cm             
1713 //    Weld                                  0.08 cm                  
1714 //    Length of straight section          207.21 cm
1715 //    =======================================================================
1716 //                                        299.97 cm  [0.03 cm missing ?]
1717 //    Length of opening cone              252.09 cm
1718 //    Weld                                  0.15 cm                
1719 //    Length of compensator                30.54 cm
1720 //    Weld                                  0.15 cm                
1721 //    Length of fixed flange  2.13 - 0.97   1.16 cm
1722 //    ======================================================================= 
1723 //                                        584.06 cm [584.80 installed] [0.74 cm missing]
1724 //    RB26/3
1725 //    Length of split flange  2.13 - 1.2    0.93 cm
1726 //    Weld                                  0.15 cm                
1727 //    Length of fixed point section        16.07 cm               
1728 //    Weld                                  0.15 cm                
1729 //    Length of opening cone              629.20 cm
1730 //    Weld                                  0.30 cm                
1731 //    Kength of the compensator            41.70 cm
1732 //    Weld                                  0.30 cm                
1733 //    Length of fixed flange  2.99 - 1.72   1.27 cm
1734 // =================================================
1735 //    Length of RB26/3                    690.07 cm [689.20 installed] [0.87 cm too much] 
1736 //
1737 //    RB26/4-5
1738 //    Length of split flange  2.13 - 1.2    0.93 cm
1739 //    Weld                                  0.15 cm                
1740 //    Length of fixed point section        16.07 cm               
1741 //    Weld                                  0.15 cm                
1742 //    Length of opening cone              629.20 cm
1743 //    Weld                                  0.30 cm                
1744 //    Length of closing cone
1745 //    Weld
1746 //    Lenth of straight section 
1747 //    Kength of the compensator            41.70 cm
1748 //    Weld                                  0.30 cm                
1749 //    Length of fixed flange  2.99 - 1.72   1.27 cm
1750 // =================================================
1751 //    Length of RB26/3                    690.07 cm [689.20 installed] [0.87 cm too much] 
1752       
1753 ///////////////////////////////////////////
1754 //                                       //
1755 //    RB26/1-2                           //  
1756 //    Drawing LHCV2a_0050 [as installed] //
1757 //    Drawing LHCV2a_0008                //
1758 //    Drawing LHCV2a_0001                //
1759 ///////////////////////////////////////////
1760 //    Pos1 Vacuum Tubes   LHCVC2A__0010
1761 //    Pos2 Compensator    LHCVC2A__0064
1762 //    Pos3 Rotable Flange LHCVFX___0016
1763 //    Pos4 Fixed Flange   LHCVFX___0006
1764 //    Pos5 Bellow Tooling LHCVFX___0003
1765 //
1766 //             
1767 //
1768 ///////////////////////////////////
1769 //    RB26/1-2 Vacuum Tubes      //
1770 //    Drawing  LHCVC2a_0010      //
1771 ///////////////////////////////////
1772       const Float_t kRB26s12TubeL = 459.45; // 0.15 cm added for welding       
1773       //
1774       // Add 1 cm on outer diameter for insulation
1775       //
1776       TGeoPcon* shRB26s12Tube = new TGeoPcon(0., 360., 5);
1777       // Section 1: straight section
1778       shRB26s12Tube->DefineSection(0,   0.00,         5.84/2.,  6.00/2.);
1779       shRB26s12Tube->DefineSection(1, 207.21,         5.84/2.,  6.00/2.);      
1780       // Section 2: 0.72 deg opening cone
1781       shRB26s12Tube->DefineSection(2, 207.21,         5.84/2.,  6.14/2.);      
1782       shRB26s12Tube->DefineSection(3, 452.30,        12.00/2., 12.30/2.);      
1783       shRB26s12Tube->DefineSection(4, kRB26s12TubeL, 12.00/2., 12.30/2.); 
1784       TGeoVolume* voRB26s12Tube  = new TGeoVolume("RB26s12Tube", shRB26s12Tube, kMedSteel);
1785       // Add the insulation layer    
1786       TGeoVolume* voRB26s12TubeIns = new TGeoVolume("RB26s12TubeIns", MakeInsulationFromTemplate(shRB26s12Tube), kMedInsu); 
1787       voRB26s12Tube->AddNode(voRB26s12TubeIns, 1, gGeoIdentity);
1788
1789  
1790       TGeoVolume* voRB26s12TubeM  = new TGeoVolume("RB26s12TubeM", MakeMotherFromTemplate(shRB26s12Tube), kMedVac);
1791       voRB26s12TubeM->AddNode(voRB26s12Tube, 1, gGeoIdentity);
1792       
1793
1794       
1795 ///////////////////////////////////
1796 //    RB26/2   Axial Compensator //
1797 //    Drawing  LHCVC2a_0064      //
1798 ///////////////////////////////////
1799       const Float_t kRB26s2CompL             = 30.65;    // Length of the compensator
1800       const Float_t kRB26s2BellowRo          = 14.38/2.; // Bellow outer radius        [Pos 1]
1801       const Float_t kRB26s2BellowRi          = 12.12/2.; // Bellow inner radius        [Pos 1] 
1802       const Int_t   kRB26s2NumberOfPlies     = 14;       // Number of plies            [Pos 1] 
1803       const Float_t kRB26s2BellowUndL        = 10.00;    // Length of undulated region [Pos 1]  [+10 mm installed including pretension ?] 
1804       const Float_t kRB26s2PlieThickness     =  0.025;   // Plie thickness             [Pos 1]
1805       const Float_t kRB26s2ConnectionPlieR   =  0.21;    // Connection plie radius     [Pos 1] 
1806 //  Plie radius
1807       const Float_t kRB26s2PlieR = 
1808         (kRB26s2BellowUndL - 4. *  kRB26s2ConnectionPlieR + 2. * kRB26s2PlieThickness + 
1809          (2. *  kRB26s2NumberOfPlies - 2.) * kRB26s2PlieThickness) / (4. * kRB26s2NumberOfPlies - 2.);
1810       const Float_t kRB26s2CompTubeInnerR    = 12.00/2.;  // Connection tubes inner radius     [Pos 2 + 3]
1811       const Float_t kRB26s2CompTubeOuterR    = 12.30/2.;  // Connection tubes outer radius     [Pos 2 + 3]
1812       const Float_t kRB26s2WeldingTubeLeftL  =  9.00/2.;  // Left connection tube half length  [Pos 2]
1813       const Float_t kRB26s2WeldingTubeRightL = 11.65/2.;  // Right connection tube half length [Pos 3]  [+ 0.15 cm for welding]
1814       const Float_t kRB26s2RingOuterR        = 18.10/2.;  // Ring inner radius                 [Pos 4]
1815       const Float_t kRB26s2RingL             =  0.40/2.;  // Ring half length                  [Pos 4]
1816       const Float_t kRB26s2RingZ             =  6.50   ;  // Ring z-position                   [Pos 4]
1817       const Float_t kRB26s2ProtOuterR        = 18.20/2.;  // Protection tube outer radius      [Pos 5]
1818       const Float_t kRB26s2ProtL             = 15.00/2.;  // Protection tube half length       [Pos 5]
1819       const Float_t kRB26s2ProtZ             =  6.70   ;  // Protection tube z-position        [Pos 5]
1820    
1821       
1822 // Mother volume
1823 //
1824       TGeoPcon* shRB26s2Compensator  = new TGeoPcon(0., 360., 6);
1825       shRB26s2Compensator->DefineSection( 0,   0.0, 0., kRB26s2CompTubeOuterR);
1826       shRB26s2Compensator->DefineSection( 1,   kRB26s2RingZ, 0., kRB26s2CompTubeOuterR);      
1827       shRB26s2Compensator->DefineSection( 2,   kRB26s2RingZ, 0., kRB26s2ProtOuterR);      
1828       shRB26s2Compensator->DefineSection( 3,   kRB26s2ProtZ + 2. * kRB26s2ProtL, 0., kRB26s2ProtOuterR);            
1829       shRB26s2Compensator->DefineSection( 4,   kRB26s2ProtZ + 2. * kRB26s2ProtL, 0., kRB26s2CompTubeOuterR);
1830       shRB26s2Compensator->DefineSection( 5,   kRB26s2CompL                    , 0., kRB26s2CompTubeOuterR);            
1831       TGeoVolume* voRB26s2Compensator  = new TGeoVolume("RB26s2Compensator", shRB26s2Compensator, kMedVac);
1832             
1833 //
1834 // [Pos 1] Bellow
1835 //      
1836 //
1837       TGeoVolume* voRB26s2Bellow = new TGeoVolume("RB26s2Bellow", new TGeoTube(kRB26s2BellowRi, kRB26s2BellowRo, kRB26s2BellowUndL/2.), kMedVac);
1838 //      
1839 //  Upper part of the undulation
1840 //
1841       TGeoTorus* shRB26s2PlieTorusU  =  new TGeoTorus(kRB26s2BellowRo - kRB26s2PlieR, kRB26s2PlieR - kRB26s2PlieThickness, kRB26s2PlieR);
1842       shRB26s2PlieTorusU->SetName("RB26s2TorusU");
1843       TGeoTube*  shRB26s2PlieTubeU   =  new TGeoTube (kRB26s2BellowRo - kRB26s2PlieR, kRB26s2BellowRo, kRB26s2PlieR);
1844       shRB26s2PlieTubeU->SetName("RB26s2TubeU");
1845       TGeoCompositeShape*  shRB26s2UpperPlie = new TGeoCompositeShape("RB26s2UpperPlie", "RB26s2TorusU*RB26s2TubeU");
1846  
1847       TGeoVolume* voRB26s2WiggleU = new TGeoVolume("RB26s2UpperPlie", shRB26s2UpperPlie, kMedSteel);
1848 //
1849 // Lower part of the undulation
1850       TGeoTorus* shRB26s2PlieTorusL =  new TGeoTorus(kRB26s2BellowRi + kRB26s2PlieR, kRB26s2PlieR - kRB26s2PlieThickness, kRB26s2PlieR);
1851       shRB26s2PlieTorusL->SetName("RB26s2TorusL");
1852       TGeoTube*  shRB26s2PlieTubeL   =  new TGeoTube (kRB26s2BellowRi, kRB26s2BellowRi + kRB26s2PlieR, kRB26s2PlieR);
1853       shRB26s2PlieTubeL->SetName("RB26s2TubeL");
1854       TGeoCompositeShape*  shRB26s2LowerPlie = new TGeoCompositeShape("RB26s2LowerPlie", "RB26s2TorusL*RB26s2TubeL");
1855       
1856       TGeoVolume* voRB26s2WiggleL = new TGeoVolume("RB26s2LowerPlie", shRB26s2LowerPlie, kMedSteel); 
1857
1858 //
1859 // Connection between upper and lower part of undulation
1860       TGeoVolume* voRB26s2WiggleC1 = new TGeoVolume("RB26s2PlieConn1",  
1861                                                     new TGeoTube(kRB26s2BellowRi + kRB26s2PlieR, 
1862                                                                  kRB26s2BellowRo - kRB26s2PlieR, kRB26s2PlieThickness / 2.), kMedSteel);
1863 //
1864 // One wiggle
1865       TGeoVolumeAssembly* voRB26s2Wiggle = new TGeoVolumeAssembly("RB26s2Wiggle");
1866       z0 =  -  kRB26s2PlieThickness / 2.;
1867       voRB26s2Wiggle->AddNode(voRB26s2WiggleC1,  1 , new TGeoTranslation(0., 0., z0));
1868       z0 += kRB26s2PlieR -  kRB26s2PlieThickness / 2.;
1869       voRB26s2Wiggle->AddNode(voRB26s2WiggleU,   1 , new TGeoTranslation(0., 0., z0));
1870       z0 += kRB26s2PlieR -  kRB26s2PlieThickness / 2.;
1871       voRB26s2Wiggle->AddNode(voRB26s2WiggleC1,  2 , new TGeoTranslation(0., 0., z0));
1872       z0 += kRB26s2PlieR -  kRB26s2PlieThickness;
1873       voRB26s2Wiggle->AddNode(voRB26s2WiggleL ,  1 , new TGeoTranslation(0., 0., z0));
1874 // Positioning of the volumes
1875       z0   = - kRB26s2BellowUndL/2.+ kRB26s2ConnectionPlieR;
1876       voRB26s2Bellow->AddNode(voRB26s2WiggleL, 1, new TGeoTranslation(0., 0., z0));
1877       z0  +=  kRB26s2ConnectionPlieR;
1878       zsh  = 4. *  kRB26s2PlieR -  2. * kRB26s2PlieThickness;
1879       for (Int_t iw = 0; iw < kRB26s2NumberOfPlies; iw++) {
1880           Float_t zpos =  z0 + iw * zsh;        
1881           voRB26s2Bellow->AddNode(voRB26s2Wiggle,  iw + 1, new TGeoTranslation(0., 0., zpos -  kRB26s2PlieThickness));  
1882       }
1883
1884       voRB26s2Compensator->AddNode(voRB26s2Bellow, 1,  new TGeoTranslation(0., 0., 2. * kRB26s2WeldingTubeLeftL + kRB26s2BellowUndL/2.));
1885       
1886 //
1887 // [Pos 2] Left Welding Tube
1888 //      
1889       TGeoTube* shRB26s2CompLeftTube = new TGeoTube(kRB26s2CompTubeInnerR, kRB26s2CompTubeOuterR, kRB26s2WeldingTubeLeftL);
1890       TGeoVolume* voRB26s2CompLeftTube = new TGeoVolume("RB26s2CompLeftTube", shRB26s2CompLeftTube, kMedSteel);
1891       voRB26s2Compensator->AddNode(voRB26s2CompLeftTube, 1,  new TGeoTranslation(0., 0., kRB26s2WeldingTubeLeftL));
1892 //
1893 // [Pos 3] Right Welding Tube
1894 //      
1895       TGeoTube* shRB26s2CompRightTube = new TGeoTube(kRB26s2CompTubeInnerR, kRB26s2CompTubeOuterR, kRB26s2WeldingTubeRightL);
1896       TGeoVolume* voRB26s2CompRightTube = new TGeoVolume("RB26s2CompRightTube", shRB26s2CompRightTube, kMedSteel);
1897       voRB26s2Compensator->AddNode(voRB26s2CompRightTube,  1, new TGeoTranslation(0., 0.,  kRB26s2CompL - kRB26s2WeldingTubeRightL));
1898 //
1899 // [Pos 4] Ring
1900 //      
1901       TGeoTube* shRB26s2CompRing = new TGeoTube(kRB26s2CompTubeOuterR, kRB26s2RingOuterR, kRB26s2RingL);
1902       TGeoVolume* voRB26s2CompRing = new TGeoVolume("RB26s2CompRing", shRB26s2CompRing, kMedSteel);
1903       voRB26s2Compensator->AddNode(voRB26s2CompRing,  1, new TGeoTranslation(0., 0., kRB26s2RingZ + kRB26s2RingL));
1904
1905 //
1906 // [Pos 5] Outer Protecting Tube
1907 //      
1908       TGeoTube* shRB26s2CompProtTube = new TGeoTube(kRB26s2RingOuterR, kRB26s2ProtOuterR, kRB26s2ProtL);
1909       TGeoVolume* voRB26s2CompProtTube = new TGeoVolume("RB26s2CompProtTube", shRB26s2CompProtTube, kMedSteel);
1910       voRB26s2Compensator->AddNode(voRB26s2CompProtTube, 1,  new TGeoTranslation(0., 0., kRB26s2ProtZ + kRB26s2ProtL));
1911       
1912 ///////////////////////////////////
1913 //    Rotable Flange             //
1914 //    Drawing  LHCVFX_0016       //
1915 /////////////////////////////////// 
1916       const Float_t kRB26s1RFlangeTubeRi    = 5.84/2. ;  // Tube inner radius
1917       const Float_t kRB26s1RFlangeTubeRo    = 6.00/2. ;  // Tube outer radius
1918
1919 // Pos 1 Clamp Ring          LHCVFX__0015
1920       const Float_t kRB26s1RFlangeCrL       = 1.40     ; // Lenth of the clamp ring
1921       const Float_t kRB26s1RFlangeCrRi1     = 6.72/2.  ; // Ring inner radius section 1
1922       const Float_t kRB26s1RFlangeCrRi2     = 6.06/2.  ; // Ring inner radius section 2
1923       const Float_t kRB26s1RFlangeCrRo      = 8.60/2.  ; // Ring outer radius 
1924       const Float_t kRB26s1RFlangeCrD       = 0.800    ; // Width section 1
1925       
1926       TGeoPcon* shRB26s1RFlangeCr = new TGeoPcon(0., 360., 4);
1927       z0 = 0.;
1928       shRB26s1RFlangeCr->DefineSection(0, z0, kRB26s1RFlangeCrRi1, kRB26s1RFlangeCrRo);
1929       z0 += kRB26s1RFlangeCrD;
1930       shRB26s1RFlangeCr->DefineSection(1, z0, kRB26s1RFlangeCrRi1, kRB26s1RFlangeCrRo);
1931       shRB26s1RFlangeCr->DefineSection(2, z0, kRB26s1RFlangeCrRi2, kRB26s1RFlangeCrRo);      
1932       z0 = kRB26s1RFlangeCrL;
1933       shRB26s1RFlangeCr->DefineSection(3, z0, kRB26s1RFlangeCrRi2, kRB26s1RFlangeCrRo);
1934       TGeoVolume* voRB26s1RFlangeCr =  
1935           new TGeoVolume("RB26s1RFlangeCr", shRB26s1RFlangeCr, kMedSteel);
1936
1937 // Pos 2 Insert              LHCVFX__0015
1938       const Float_t kRB26s1RFlangeIsL       = 4.88     ; // Lenth of the insert
1939       const Float_t kRB26s1RFlangeIsR       = 6.70/2.  ; // Ring radius
1940       const Float_t kRB26s1RFlangeIsD       = 0.80     ; // Ring Width
1941
1942       TGeoPcon* shRB26s1RFlangeIs = new TGeoPcon(0., 360., 4);
1943       z0 = 0.;
1944       shRB26s1RFlangeIs->DefineSection(0, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeIsR);
1945       z0 += kRB26s1RFlangeIsD;
1946       shRB26s1RFlangeIs->DefineSection(1, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeIsR);
1947       shRB26s1RFlangeIs->DefineSection(2, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeTubeRo);      
1948       z0 = kRB26s1RFlangeIsL;
1949       shRB26s1RFlangeIs->DefineSection(3, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeTubeRo);
1950       TGeoVolume* voRB26s1RFlangeIs =  
1951           new TGeoVolume("RB26s1RFlangeIs", shRB26s1RFlangeIs, kMedSteel);
1952 // 4.88 + 3.7 = 8.58 (8.7 to avoid overlap)
1953 // Pos 3 Fixed Point Section LHCVC2A_0021
1954       const Float_t kRB26s1RFlangeFpL       = 5.88     ; // Length of the fixed point section (0.08 cm added for welding)
1955       const Float_t kRB26s1RFlangeFpZ       = 3.82     ; // Position of the ring
1956       const Float_t kRB26s1RFlangeFpD       = 0.59     ; // Width of the ring
1957       const Float_t kRB26s1RFlangeFpR       = 7.00/2.  ; // Radius of the ring
1958       
1959       TGeoPcon* shRB26s1RFlangeFp = new TGeoPcon(0., 360., 6);
1960       z0 = 0.;
1961       shRB26s1RFlangeFp->DefineSection(0, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeTubeRo);
1962       z0 += kRB26s1RFlangeFpZ;
1963       shRB26s1RFlangeFp->DefineSection(1, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeTubeRo);      
1964       shRB26s1RFlangeFp->DefineSection(2, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeFpR);           
1965       z0 += kRB26s1RFlangeFpD;
1966       shRB26s1RFlangeFp->DefineSection(3, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeFpR);           
1967       shRB26s1RFlangeFp->DefineSection(4, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeTubeRo);
1968       z0 = kRB26s1RFlangeFpL;
1969       shRB26s1RFlangeFp->DefineSection(5, z0, kRB26s1RFlangeTubeRi, kRB26s1RFlangeTubeRo);
1970       TGeoVolume* voRB26s1RFlangeFp = new TGeoVolume("RB26s1RFlangeFp", shRB26s1RFlangeFp, kMedSteel);
1971              
1972 // Put everything in a mother volume
1973       TGeoPcon* shRB26s1RFlange = new TGeoPcon(0., 360., 8);
1974       z0 =  0.;
1975       shRB26s1RFlange->DefineSection(0, z0, 0., kRB26s1RFlangeCrRo);
1976       z0 += kRB26s1RFlangeCrL;
1977       shRB26s1RFlange->DefineSection(1, z0, 0., kRB26s1RFlangeCrRo);
1978       shRB26s1RFlange->DefineSection(2, z0, 0., kRB26s1RFlangeTubeRo);
1979       z0 = kRB26s1RFlangeIsL + kRB26s1RFlangeFpZ;
1980       shRB26s1RFlange->DefineSection(3, z0, 0., kRB26s1RFlangeTubeRo);      
1981       shRB26s1RFlange->DefineSection(4, z0, 0., kRB26s1RFlangeFpR);
1982       z0 += kRB26s1RFlangeFpD;
1983       shRB26s1RFlange->DefineSection(5, z0, 0., kRB26s1RFlangeFpR);               
1984       shRB26s1RFlange->DefineSection(6, z0, 0., kRB26s1RFlangeTubeRo);
1985       z0 = kRB26s1RFlangeIsL + kRB26s1RFlangeFpL;
1986       shRB26s1RFlange->DefineSection(7, z0, 0., kRB26s1RFlangeTubeRo);
1987       TGeoVolume* voRB26s1RFlange = new TGeoVolume("RB26s1RFlange", shRB26s1RFlange, kMedVac);
1988
1989       voRB26s1RFlange->AddNode(voRB26s1RFlangeIs, 1, gGeoIdentity);
1990       voRB26s1RFlange->AddNode(voRB26s1RFlangeCr, 1, gGeoIdentity);
1991       voRB26s1RFlange->AddNode(voRB26s1RFlangeFp, 1, new TGeoTranslation(0., 0., kRB26s1RFlangeIsL));
1992       
1993 ///////////////////////////////////
1994 //    Fixed Flange               //
1995 //    Drawing  LHCVFX_0006       //
1996 /////////////////////////////////// 
1997       const Float_t kRB26s2FFlangeL      =  2.13;    // Length of the flange
1998       const Float_t kRB26s2FFlangeD1     =  0.97;    // Length of section 1
1999       const Float_t kRB26s2FFlangeD2     =  0.29;    // Length of section 2                                                  
2000       const Float_t kRB26s2FFlangeD3     =  0.87;    // Length of section 3                                                        
2001       const Float_t kRB26s2FFlangeRo     = 17.15/2.; // Flange outer radius 
2002       const Float_t kRB26s2FFlangeRi1    = 12.30/2.; // Flange inner radius section 1
2003       const Float_t kRB26s2FFlangeRi2    = 12.00/2.; // Flange inner radius section 2
2004       const Float_t kRB26s2FFlangeRi3    = 12.30/2.; // Flange inner radius section 3
2005       z0 = 0;
2006       TGeoPcon* shRB26s2FFlange = new TGeoPcon(0., 360., 6);
2007       z0 = 0.;
2008       shRB26s2FFlange->DefineSection(0, z0, kRB26s2FFlangeRi1, kRB26s2FFlangeRo);
2009       z0 += kRB26s2FFlangeD1;
2010       shRB26s2FFlange->DefineSection(1, z0, kRB26s2FFlangeRi1, kRB26s2FFlangeRo);
2011       shRB26s2FFlange->DefineSection(2, z0, kRB26s2FFlangeRi2, kRB26s2FFlangeRo);
2012       z0 += kRB26s2FFlangeD2;
2013       shRB26s2FFlange->DefineSection(3, z0, kRB26s2FFlangeRi2, kRB26s2FFlangeRo);
2014       shRB26s2FFlange->DefineSection(4, z0, kRB26s2FFlangeRi3, kRB26s2FFlangeRo);
2015       z0 += kRB26s2FFlangeD3;
2016       shRB26s2FFlange->DefineSection(5, z0, kRB26s2FFlangeRi3, kRB26s2FFlangeRo);
2017       TGeoVolume* voRB26s2FFlange = new TGeoVolume("RB26s2FFlange", shRB26s2FFlange, kMedSteel);
2018
2019       TGeoVolume* voRB26s2FFlangeM = new TGeoVolume("RB26s2FFlangeM", MakeMotherFromTemplate(shRB26s2FFlange, 2, 5), kMedVac);
2020       voRB26s2FFlangeM->AddNode(voRB26s2FFlange, 1, gGeoIdentity);
2021       
2022       
2023
2024 ////////////////////////////////////////
2025 //                                    //
2026 //    RB26/3                          //  
2027 //    Drawing LHCV2a_0048             //
2028 //    Drawing LHCV2a_0002             //
2029 ////////////////////////////////////////    
2030 //
2031 //    Pos 1 Vacuum Tubes      LHCVC2A__0003
2032 //    Pos 2 Fixed Point       LHCVFX___0005
2033 //    Pos 3 Split Flange      LHCVFX___0007
2034 //    Pos 4 Fixed Flange      LHCVFX___0004
2035 //    Pos 5 Axial Compensator LHCVC2A__0065
2036 //
2037 //
2038 //
2039 //
2040 ///////////////////////////////////
2041 //    Vacuum Tube                //
2042 //    Drawing  LHCVC2A_0003      //
2043 /////////////////////////////////// 
2044       const Float_t kRB26s3TubeL  = 629.35 + 0.3; // 0.3 cm added for welding
2045       const Float_t kRB26s3TubeR1 =  12./2.;
2046       const Float_t kRB26s3TubeR2 =  kRB26s3TubeR1 + 215.8 * TMath::Tan(0.829 / 180. * TMath::Pi());
2047       
2048       
2049       TGeoPcon* shRB26s3Tube = new TGeoPcon(0., 360., 7);
2050       // Section 1: straight section
2051       shRB26s3Tube->DefineSection(0,   0.00, kRB26s3TubeR1, kRB26s3TubeR1 + 0.15);
2052       shRB26s3Tube->DefineSection(1,   2.00, kRB26s3TubeR1, kRB26s3TubeR1 + 0.15);      
2053       // Section 2: 0.829 deg opening cone
2054       shRB26s3Tube->DefineSection(2,   2.00, kRB26s3TubeR1, kRB26s3TubeR1 + 0.20);
2055       
2056       shRB26s3Tube->DefineSection(3, 217.80, kRB26s3TubeR2, kRB26s3TubeR2 + 0.20);
2057       shRB26s3Tube->DefineSection(4, 217.80, kRB26s3TubeR2, kRB26s3TubeR2 + 0.30);      
2058
2059       shRB26s3Tube->DefineSection(5, 622.20,       30.00/2., 30.60/2.);      
2060       shRB26s3Tube->DefineSection(6, kRB26s3TubeL, 30.00/2., 30.60/2.); 
2061
2062       TGeoVolume* voRB26s3Tube = new TGeoVolume("RB26s3Tube", shRB26s3Tube, kMedSteel);
2063 //    Add the insulation layer
2064       TGeoVolume* voRB26s3TubeIns = new TGeoVolume("RB26s3TubeIns", MakeInsulationFromTemplate(shRB26s3Tube), kMedInsu); 
2065       voRB26s3Tube->AddNode(voRB26s3TubeIns, 1, gGeoIdentity);
2066
2067       TGeoVolume* voRB26s3TubeM  = new TGeoVolume("RB26s3TubeM", MakeMotherFromTemplate(shRB26s3Tube), kMedVac);
2068       voRB26s3TubeM->AddNode(voRB26s3Tube, 1, gGeoIdentity);
2069
2070       
2071
2072 ///////////////////////////////////
2073 //    Fixed Point                //
2074 //    Drawing  LHCVFX_0005       //
2075 /////////////////////////////////// 
2076       const Float_t kRB26s3FixedPointL       = 16.37     ; // Length of the fixed point section (0.3 cm added for welding)
2077       const Float_t kRB26s3FixedPointZ       =  9.72     ; // Position of the ring (0.15 cm added for welding)
2078       const Float_t kRB26s3FixedPointD       =  0.595    ; // Width of the ring
2079       const Float_t kRB26s3FixedPointR       = 13.30/2.  ; // Radius of the ring
2080       const Float_t kRB26s3FixedPointRi      = 12.00/2.  ; // Inner radius of the tube
2081       const Float_t kRB26s3FixedPointRo1     = 12.30/2.  ; // Outer radius of the tube (in)
2082       const Float_t kRB26s3FixedPointRo2     = 12.40/2.  ; // Outer radius of the tube (out)
2083       const Float_t kRB26s3FixedPointDs      =  1.5      ; // Width of straight section behind ring
2084       const Float_t kRB26s3FixedPointDc      =  3.15     ; // Width of conical  section behind ring (0.15 cm added for welding)      
2085       
2086       TGeoPcon* shRB26s3FixedPoint = new TGeoPcon(0., 360., 8);
2087       z0 = 0.;
2088       shRB26s3FixedPoint->DefineSection(0, z0, kRB26s3FixedPointRi, kRB26s3FixedPointRo1);
2089       z0 += kRB26s3FixedPointZ;
2090       shRB26s3FixedPoint->DefineSection(1, z0, kRB26s3FixedPointRi, kRB26s3FixedPointRo1);      
2091       shRB26s3FixedPoint->DefineSection(2, z0, kRB26s3FixedPointRi, kRB26s3FixedPointR);          
2092       z0 += kRB26s3FixedPointD;
2093       shRB26s3FixedPoint->DefineSection(3, z0, kRB26s3FixedPointRi, kRB26s3FixedPointR);          
2094       shRB26s3FixedPoint->DefineSection(4, z0, kRB26s3FixedPointRi, kRB26s3FixedPointRo1);
2095       z0 += kRB26s3FixedPointDs;
2096       shRB26s3FixedPoint->DefineSection(5, z0, kRB26s3FixedPointRi, kRB26s3FixedPointRo1);
2097       z0 += kRB26s3FixedPointDc;
2098       shRB26s3FixedPoint->DefineSection(6, z0, kRB26s3FixedPointRi, kRB26s3FixedPointRo2);
2099       z0 = kRB26s3FixedPointL;
2100       shRB26s3FixedPoint->DefineSection(7, z0, kRB26s3FixedPointRi, kRB26s3FixedPointRo2);
2101       TGeoVolume* voRB26s3FixedPoint = new TGeoVolume("RB26s3FixedPoint", shRB26s3FixedPoint, kMedSteel);
2102
2103       TGeoVolume* voRB26s3FixedPointM = new TGeoVolume("RB26s3FixedPointM", MakeMotherFromTemplate(shRB26s3FixedPoint), kMedVac);
2104       voRB26s3FixedPointM->AddNode(voRB26s3FixedPoint, 1, gGeoIdentity);
2105       
2106 ///////////////////////////////////
2107 //    Split Flange               //
2108 //    Drawing  LHCVFX_0005       //
2109 /////////////////////////////////// 
2110       const Float_t kRB26s3SFlangeL      =  2.13;        // Length of the flange
2111       const Float_t kRB26s3SFlangeD1     =  0.57;        // Length of section 1
2112       const Float_t kRB26s3SFlangeD2     =  0.36;        // Length of section 2                                              
2113       const Float_t kRB26s3SFlangeD3     =  0.50 + 0.70; // Length of section 3                                                    
2114       const Float_t kRB26s3SFlangeRo     = 17.15/2.;     // Flange outer radius 
2115       const Float_t kRB26s3SFlangeRi1    = 12.30/2.;     // Flange inner radius section 1
2116       const Float_t kRB26s3SFlangeRi2    = 12.00/2.;     // Flange inner radius section 2
2117       const Float_t kRB26s3SFlangeRi3    = 12.30/2.;     // Flange inner radius section 3
2118       z0 = 0;
2119       TGeoPcon* shRB26s3SFlange = new TGeoPcon(0., 360., 6);
2120       z0 = 0.;
2121       shRB26s3SFlange->DefineSection(0, z0, kRB26s3SFlangeRi1, kRB26s3SFlangeRo);
2122       z0 += kRB26s3SFlangeD1;
2123       shRB26s3SFlange->DefineSection(1, z0, kRB26s3SFlangeRi1, kRB26s3SFlangeRo);
2124       shRB26s3SFlange->DefineSection(2, z0, kRB26s3SFlangeRi2, kRB26s3SFlangeRo);
2125       z0 += kRB26s3SFlangeD2;
2126       shRB26s3SFlange->DefineSection(3, z0, kRB26s3SFlangeRi2, kRB26s3SFlangeRo);
2127       shRB26s3SFlange->DefineSection(4, z0, kRB26s3SFlangeRi3, kRB26s3SFlangeRo);
2128       z0 += kRB26s3SFlangeD3;
2129       shRB26s3SFlange->DefineSection(5, z0, kRB26s3SFlangeRi3, kRB26s3SFlangeRo);
2130       TGeoVolume* voRB26s3SFlange = new TGeoVolume("RB26s3SFlange", shRB26s3SFlange, kMedSteel);
2131
2132       TGeoVolume* voRB26s3SFlangeM = new TGeoVolume("RB26s3SFlangeM", MakeMotherFromTemplate(shRB26s3SFlange, 0, 3), kMedVac);
2133       voRB26s3SFlangeM->AddNode(voRB26s3SFlange, 1, gGeoIdentity);
2134         
2135 ///////////////////////////////////
2136 //    RB26/3   Fixed Flange      //
2137 //    Drawing  LHCVFX___0004     //
2138 /////////////////////////////////// 
2139       const Float_t kRB26s3FFlangeL      =  2.99;    // Length of the flange
2140       const Float_t kRB26s3FFlangeD1     =  1.72;    // Length of section 1
2141       const Float_t kRB26s3FFlangeD2     =  0.30;    // Length of section 2                                                  
2142       const Float_t kRB26s3FFlangeD3     =  0.97;    // Length of section 3                                                        
2143       const Float_t kRB26s3FFlangeRo     = 36.20/2.; // Flange outer radius 
2144       const Float_t kRB26s3FFlangeRi1    = 30.60/2.; // Flange inner radius section 1
2145       const Float_t kRB26s3FFlangeRi2    = 30.00/2.; // Flange inner radius section 2
2146       const Float_t kRB26s3FFlangeRi3    = 30.60/2.; // Flange inner radius section 3
2147       z0 = 0;
2148       TGeoPcon* shRB26s3FFlange = new TGeoPcon(0., 360., 6);
2149       z0 = 0.;
2150       shRB26s3FFlange->DefineSection(0, z0, kRB26s3FFlangeRi1, kRB26s3FFlangeRo);
2151       z0 += kRB26s3FFlangeD1;
2152       shRB26s3FFlange->DefineSection(1, z0, kRB26s3FFlangeRi1, kRB26s3FFlangeRo);
2153       shRB26s3FFlange->DefineSection(2, z0, kRB26s3FFlangeRi2, kRB26s3FFlangeRo);
2154       z0 += kRB26s3FFlangeD2;
2155       shRB26s3FFlange->DefineSection(3, z0, kRB26s3FFlangeRi2, kRB26s3FFlangeRo);
2156       shRB26s3FFlange->DefineSection(4, z0, kRB26s3FFlangeRi3, kRB26s3FFlangeRo);
2157       z0 += kRB26s3FFlangeD3;
2158       shRB26s3FFlange->DefineSection(5, z0, kRB26s3FFlangeRi3, kRB26s3FFlangeRo);
2159       TGeoVolume* voRB26s3FFlange = new TGeoVolume("RB26s3FFlange", shRB26s3FFlange, kMedSteel);
2160       
2161       TGeoVolume* voRB26s3FFlangeM = new TGeoVolume("RB26s3FFlangeM", MakeMotherFromTemplate(shRB26s3FFlange, 2, 5), kMedVac);
2162       voRB26s3FFlangeM->AddNode(voRB26s3FFlange, 1, gGeoIdentity);
2163             
2164
2165
2166 ///////////////////////////////////
2167 //    RB26/3   Axial Compensator //
2168 //    Drawing  LHCVC2a_0065      //
2169 /////////////////////////////////// 
2170       const Float_t kRB26s3CompL              = 42.0;     // Length of the compensator (0.3 cm added for welding)
2171       const Float_t kRB26s3BellowRo           = 34.00/2.; // Bellow outer radius        [Pos 1]
2172       const Float_t kRB26s3BellowRi           = 30.10/2.; // Bellow inner radius        [Pos 1] 
2173       const Int_t   kRB26s3NumberOfPlies      = 13;       // Number of plies            [Pos 1] 
2174       const Float_t kRB26s3BellowUndL         = 17.70;    // Length of undulated region [Pos 1] 
2175       const Float_t kRB26s3PlieThickness      =  0.06;    // Plie thickness             [Pos 1]
2176       const Float_t kRB26s3ConnectionPlieR    =  0.21;    // Connection plie radius     [Pos 1] 
2177 //  Plie radius
2178       const Float_t kRB26s3PlieR = 
2179         (kRB26s3BellowUndL - 4. *  kRB26s3ConnectionPlieR + 2. * kRB26s3PlieThickness + 
2180          (2. *  kRB26s3NumberOfPlies - 2.) * kRB26s3PlieThickness) / (4. * kRB26s3NumberOfPlies - 2.);
2181
2182       //
2183       // The welding tubes have 3 sections with different radii and 2 transition regions.
2184       // Section 1: connection to the outside
2185       // Section 2: commection to the bellow
2186       // Section 3: between 1 and 2
2187       const Float_t kRB26s3CompTubeInnerR1    = 30.0/2.;  // Outer Connection tubes inner radius     [Pos 4 + 3]
2188       const Float_t kRB26s3CompTubeOuterR1    = 30.6/2.;  // Outer Connection tubes outer radius     [Pos 4 + 3]
2189       const Float_t kRB26s3CompTubeInnerR2    = 29.4/2.;  // Connection tubes inner radius           [Pos 4 + 3]
2190       const Float_t kRB26s3CompTubeOuterR2    = 30.0/2.;  // Connection tubes outer radius           [Pos 4 + 3]
2191       const Float_t kRB26s3CompTubeInnerR3    = 30.6/2.;  // Connection tubes inner radius at bellow [Pos 4 + 3]
2192       const Float_t kRB26s3CompTubeOuterR3    = 32.2/2.;  // Connection tubes outer radius at bellow [Pos 4 + 3]
2193  
2194       const Float_t kRB26s3WeldingTubeLeftL1  =  2.0;     // Left connection tube length             [Pos 4]
2195       const Float_t kRB26s3WeldingTubeLeftL2  =  3.4;     // Left connection tube length             [Pos 4]
2196       const Float_t kRB26s3WeldingTubeLeftL   =  7.0;     // Left connection tube total length       [Pos 4]
2197       const Float_t kRB26s3WeldingTubeRightL1 =  2.3;     // Right connection tube length            [Pos 3] (0.3 cm added for welding)
2198       const Float_t kRB26s3WeldingTubeRightL2 = 13.4;     // Right connection tube length            [Pos 3]
2199
2200       const Float_t kRB26s3WeldingTubeT1      =  0.6;     // Length of first r-transition            [Pos 4 + 3]
2201       const Float_t kRB26s3WeldingTubeT2      =  1.0;     // Length of 2nd   r-transition            [Pos 4 + 3]       
2202
2203       
2204       
2205       const Float_t kRB26s3RingOuterR         = 36.1/2.;  // Ring inner radius                       [Pos 4]
2206       const Float_t kRB26s3RingL              =  0.8/2.;  // Ring half length                        [Pos 4]
2207       const Float_t kRB26s3RingZ              =  3.7   ;  // Ring z-position                         [Pos 4]
2208       const Float_t kRB26s3ProtOuterR         = 36.2/2.;  // Protection tube outer radius            [Pos 2]
2209       const Float_t kRB26s3ProtL              = 27.0/2.;  // Protection tube half length             [Pos 2]
2210       const Float_t kRB26s3ProtZ              =  4.0   ;  // Protection tube z-position              [Pos 2]
2211    
2212       
2213 // Mother volume
2214 //
2215       TGeoPcon* shRB26s3Compensator  = new TGeoPcon(0., 360., 6);
2216       shRB26s3Compensator->DefineSection( 0,   0.0, 0., kRB26s3CompTubeOuterR1);
2217       shRB26s3Compensator->DefineSection( 1,   kRB26s3RingZ, 0., kRB26s3CompTubeOuterR1);      
2218       shRB26s3Compensator->DefineSection( 2,   kRB26s3RingZ, 0., kRB26s3ProtOuterR);      
2219       shRB26s3Compensator->DefineSection( 3,   kRB26s3ProtZ + 2. * kRB26s3ProtL, 0., kRB26s3ProtOuterR);            
2220       shRB26s3Compensator->DefineSection( 4,   kRB26s3ProtZ + 2. * kRB26s3ProtL, 0., kRB26s3CompTubeOuterR1);
2221       shRB26s3Compensator->DefineSection( 5,   kRB26s3CompL                    , 0., kRB26s3CompTubeOuterR1);            
2222       TGeoVolume* voRB26s3Compensator  =  
2223           new TGeoVolume("RB26s3Compensator", shRB26s3Compensator, kMedVac);
2224             
2225 //
2226 // [Pos 1] Bellow
2227 //      
2228 //
2229       TGeoVolume* voRB26s3Bellow = new TGeoVolume("RB26s3Bellow", 
2230                                                   new TGeoTube(kRB26s3BellowRi, kRB26s3BellowRo, kRB26s3BellowUndL/2.), kMedVac);
2231 //      
2232 //  Upper part of the undulation
2233 //
2234       TGeoTorus* shRB26s3PlieTorusU  =  new TGeoTorus(kRB26s3BellowRo - kRB26s3PlieR, kRB26s3PlieR - kRB26s3PlieThickness, kRB26s3PlieR);
2235       shRB26s3PlieTorusU->SetName("RB26s3TorusU");
2236       TGeoTube*  shRB26s3PlieTubeU   =  new TGeoTube (kRB26s3BellowRo - kRB26s3PlieR, kRB26s3BellowRo, kRB26s3PlieR);
2237       shRB26s3PlieTubeU->SetName("RB26s3TubeU");
2238       TGeoCompositeShape*  shRB26s3UpperPlie = new TGeoCompositeShape("RB26s3UpperPlie", "RB26s3TorusU*RB26s3TubeU");
2239  
2240       TGeoVolume* voRB26s3WiggleU = new TGeoVolume("RB26s3UpperPlie", shRB26s3UpperPlie, kMedSteel);
2241 //
2242 // Lower part of the undulation
2243       TGeoTorus* shRB26s3PlieTorusL =  new TGeoTorus(kRB26s3BellowRi + kRB26s3PlieR, kRB26s3PlieR - kRB26s3PlieThickness, kRB26s3PlieR);
2244       shRB26s3PlieTorusL->SetName("RB26s3TorusL");
2245       TGeoTube*  shRB26s3PlieTubeL   =  new TGeoTube (kRB26s3BellowRi, kRB26s3BellowRi + kRB26s3PlieR, kRB26s3PlieR);
2246       shRB26s3PlieTubeL->SetName("RB26s3TubeL");
2247       TGeoCompositeShape*  shRB26s3LowerPlie = new TGeoCompositeShape("RB26s3LowerPlie", "RB26s3TorusL*RB26s3TubeL");
2248       
2249       TGeoVolume* voRB26s3WiggleL = new TGeoVolume("RB26s3LowerPlie", shRB26s3LowerPlie, kMedSteel); 
2250
2251 //
2252 // Connection between upper and lower part of undulation
2253       TGeoVolume* voRB26s3WiggleC1 = new TGeoVolume("RB26s3PlieConn1",  
2254                                                     new TGeoTube(kRB26s3BellowRi + kRB26s3PlieR, 
2255                                                                  kRB26s3BellowRo - kRB26s3PlieR, kRB26s3PlieThickness / 2.), kMedSteel);
2256 //
2257 // One wiggle
2258       TGeoVolumeAssembly* voRB26s3Wiggle = new TGeoVolumeAssembly("RB26s3Wiggle");
2259       z0 =  -  kRB26s3PlieThickness / 2.;
2260       voRB26s3Wiggle->AddNode(voRB26s3WiggleC1,  1 , new TGeoTranslation(0., 0., z0));
2261       z0 += kRB26s3PlieR -  kRB26s3PlieThickness / 2.;
2262       voRB26s3Wiggle->AddNode(voRB26s3WiggleU,   1 , new TGeoTranslation(0., 0., z0));
2263       z0 += kRB26s3PlieR -  kRB26s3PlieThickness / 2.;
2264       voRB26s3Wiggle->AddNode(voRB26s3WiggleC1,  2 , new TGeoTranslation(0., 0., z0));
2265       z0 += kRB26s3PlieR -  kRB26s3PlieThickness;
2266       voRB26s3Wiggle->AddNode(voRB26s3WiggleL,  1 , new TGeoTranslation(0., 0., z0));
2267 // Positioning of the volumes
2268       z0   = - kRB26s3BellowUndL/2.+ kRB26s3ConnectionPlieR;
2269       voRB26s3Bellow->AddNode(voRB26s3WiggleL, 1, new TGeoTranslation(0., 0., z0));
2270       z0  +=  kRB26s3ConnectionPlieR;
2271       zsh  = 4. *  kRB26s3PlieR -  2. * kRB26s3PlieThickness;
2272       for (Int_t iw = 0; iw < kRB26s3NumberOfPlies; iw++) {
2273           Float_t zpos =  z0 + iw * zsh;        
2274           voRB26s3Bellow->AddNode(voRB26s3Wiggle,  iw + 1, new TGeoTranslation(0., 0., zpos -  kRB26s3PlieThickness));  
2275       }
2276
2277       voRB26s3Compensator->AddNode(voRB26s3Bellow, 1,  new TGeoTranslation(0., 0., kRB26s3WeldingTubeLeftL + kRB26s3BellowUndL/2.));
2278
2279
2280 //
2281 // [Pos 2] Outer Protecting Tube
2282 //      
2283       TGeoTube* shRB26s3CompProtTube = new TGeoTube(kRB26s3RingOuterR, kRB26s3ProtOuterR, kRB26s3ProtL);
2284       TGeoVolume* voRB26s3CompProtTube =  
2285           new TGeoVolume("RB26s3CompProtTube", shRB26s3CompProtTube, kMedSteel);
2286       voRB26s3Compensator->AddNode(voRB26s3CompProtTube, 1,  new TGeoTranslation(0., 0., kRB26s3ProtZ + kRB26s3ProtL));
2287       
2288
2289 //
2290 // [Pos 3] Right Welding Tube
2291 //      
2292       TGeoPcon* shRB26s3CompRightTube = new TGeoPcon(0., 360., 5);
2293       z0 = 0.;
2294       shRB26s3CompRightTube->DefineSection(0, z0,  kRB26s3CompTubeInnerR3, kRB26s3CompTubeOuterR3);
2295       z0 += kRB26s3WeldingTubeT2;
2296       shRB26s3CompRightTube->DefineSection(1, z0,  kRB26s3CompTubeInnerR2, kRB26s3CompTubeOuterR2);
2297       z0 += kRB26s3WeldingTubeRightL2;
2298       shRB26s3CompRightTube->DefineSection(2, z0,  kRB26s3CompTubeInnerR2, kRB26s3CompTubeOuterR2);
2299       z0 += kRB26s3WeldingTubeT1;
2300       shRB26s3CompRightTube->DefineSection(3, z0,  kRB26s3CompTubeInnerR1, kRB26s3CompTubeOuterR1);
2301       z0 += kRB26s3WeldingTubeRightL1;
2302       shRB26s3CompRightTube->DefineSection(4, z0,  kRB26s3CompTubeInnerR1, kRB26s3CompTubeOuterR1);
2303       
2304       TGeoVolume* voRB26s3CompRightTube =  
2305           new TGeoVolume("RB26s3CompRightTube", shRB26s3CompRightTube, kMedSteel);
2306       voRB26s3Compensator->AddNode(voRB26s3CompRightTube,  1, new TGeoTranslation(0., 0.,  kRB26s3CompL - z0));
2307
2308 //
2309 // [Pos 4] Left Welding Tube
2310 //      
2311       TGeoPcon* shRB26s3CompLeftTube = new TGeoPcon(0., 360., 5);
2312       z0 = 0.;
2313       shRB26s3CompLeftTube->DefineSection(0, z0,  kRB26s3CompTubeInnerR1, kRB26s3CompTubeOuterR1);
2314       z0 += kRB26s3WeldingTubeLeftL1;
2315       shRB26s3CompLeftTube->DefineSection(1, z0,  kRB26s3CompTubeInnerR1, kRB26s3CompTubeOuterR1);
2316       z0 += kRB26s3WeldingTubeT1;
2317       shRB26s3CompLeftTube->DefineSection(2, z0,  kRB26s3CompTubeInnerR2, kRB26s3CompTubeOuterR2);
2318       z0 += kRB26s3WeldingTubeLeftL2;
2319       shRB26s3CompLeftTube->DefineSection(3, z0,  kRB26s3CompTubeInnerR2, kRB26s3CompTubeOuterR2);
2320       z0 += kRB26s3WeldingTubeT2;
2321       shRB26s3CompLeftTube->DefineSection(4, z0,  kRB26s3CompTubeInnerR3, kRB26s3CompTubeOuterR3);
2322
2323       TGeoVolume* voRB26s3CompLeftTube =  
2324           new TGeoVolume("RB26s3CompLeftTube", shRB26s3CompLeftTube, kMedSteel);
2325       voRB26s3Compensator->AddNode(voRB26s3CompLeftTube, 1,  gGeoIdentity);
2326 //
2327 // [Pos 5] Ring
2328 //      
2329       TGeoTube* shRB26s3CompRing = new TGeoTube(kRB26s3CompTubeOuterR2, kRB26s3RingOuterR, kRB26s3RingL);
2330       TGeoVolume* voRB26s3CompRing =  
2331           new TGeoVolume("RB26s3CompRing", shRB26s3CompRing, kMedSteel);
2332       voRB26s3Compensator->AddNode(voRB26s3CompRing,  1, new TGeoTranslation(0., 0., kRB26s3RingZ + kRB26s3RingL));
2333
2334
2335
2336 ///////////////////////////////////////////
2337 //                                       //
2338 //    RB26/4-5                           //  
2339 //    Drawing LHCV2a_0012 [as installed] //
2340 ////////////////////////////////////////////
2341 //    Pos1 Vacuum Tubes        LHCVC2A__0014
2342 //    Pos2 Compensator         LHCVC2A__0066
2343 //    Pos3 Fixed Point Section LHCVC2A__0016
2344 //    Pos4 Split Flange        LHCVFX___0005
2345 //    Pos5 RotableFlange       LHCVFX___0009
2346 ////////////////////////////////////////////
2347
2348 ///////////////////////////////////
2349 //    RB26/4-5 Vacuum Tubes      //
2350 //    Drawing  LHCVC2a_0014      //
2351 /////////////////////////////////// 
2352       const Float_t kRB26s45TubeL = 593.12 + 0.3; // 0.3 cm added for welding
2353       
2354       TGeoPcon* shRB26s45Tube = new TGeoPcon(0., 360., 11);
2355       // Section 1: straight section
2356       shRB26s45Tube->DefineSection( 0,   0.00, 30.00/2., 30.60/2.);
2357       shRB26s45Tube->DefineSection( 1,   1.20, 30.00/2., 30.60/2.);
2358       shRB26s45Tube->DefineSection( 2,   1.20, 30.00/2., 30.80/2.);
2359       shRB26s45Tube->DefineSection( 3,  25.10, 30.00/2., 30.80/2.);      
2360       // Section 2: 0.932 deg opening cone
2361       shRB26s45Tube->DefineSection( 4, 486.10, 45.00/2., 45.80/2.);      
2362       // Section 3: straight section 4 mm 
2363       shRB26s45Tube->DefineSection( 5, 512.10, 45.00/2., 45.80/2.);
2364       // Section 4: straight section 3 mm
2365       shRB26s45Tube->DefineSection( 6, 512.10, 45.00/2., 45.60/2.);
2366       shRB26s45Tube->DefineSection( 7, 527.70, 45.00/2., 45.60/2.);
2367       // Section 4: closing cone 
2368       shRB26s45Tube->DefineSection( 8, 591.30, 10.00/2., 10.60/2.);      
2369       shRB26s45Tube->DefineSection( 9, 591.89, 10.00/2., 10.30/2.);      
2370
2371       shRB26s45Tube->DefineSection(10, kRB26s45TubeL, 10.00/2., 10.30/2.);      
2372       TGeoVolume* voRB26s45Tube  =  
2373           new TGeoVolume("RB26s45Tube", shRB26s45Tube, kMedSteel);
2374
2375       TGeoVolume* voRB26s45TubeM  = new TGeoVolume("RB26s45TubeM", MakeMotherFromTemplate(shRB26s45Tube), kMedVac);
2376       voRB26s45TubeM->AddNode(voRB26s45Tube, 1, gGeoIdentity);
2377             
2378       
2379
2380 ///////////////////////////////////
2381 //    RB26/5   Axial Compensator //
2382 //    Drawing  LHCVC2a_0066      //
2383 /////////////////////////////////// 
2384       const Float_t kRB26s5CompL             = 27.60;    // Length of the compensator (0.30 cm added for welding)
2385       const Float_t kRB26s5BellowRo          = 12.48/2.; // Bellow outer radius        [Pos 1]
2386       const Float_t kRB26s5BellowRi          = 10.32/2.; // Bellow inner radius        [Pos 1] 
2387       const Int_t   kRB26s5NumberOfPlies     = 15;       // Number of plies            [Pos 1] 
2388       const Float_t kRB26s5BellowUndL        = 10.50;    // Length of undulated region [Pos 1] 
2389       const Float_t kRB26s5PlieThickness     =  0.025;   // Plie thickness             [Pos 1]
2390       const Float_t kRB26s5ConnectionPlieR   =  0.21;    // Connection plie radius     [Pos 1] 
2391       const Float_t kRB26s5ConnectionR       = 11.2/2.;  // Bellow connection radius   [Pos 1] 
2392 //  Plie radius
2393       const Float_t kRB26s5PlieR = 
2394         (kRB26s5BellowUndL - 4. *  kRB26s5ConnectionPlieR + 2. * kRB26s5PlieThickness + 
2395          (2. *  kRB26s5NumberOfPlies - 2.) * kRB26s5PlieThickness) / (4. * kRB26s5NumberOfPlies - 2.);
2396       const Float_t kRB26s5CompTubeInnerR    = 10.00/2.;  // Connection tubes inner radius     [Pos 2 + 3]
2397       const Float_t kRB26s5CompTubeOuterR    = 10.30/2.;  // Connection tubes outer radius     [Pos 2 + 3]
2398       const Float_t kRB26s5WeldingTubeLeftL  =  3.70/2.;  // Left connection tube half length  [Pos 2]
2399       const Float_t kRB26s5WeldingTubeRightL = 13.40/2.;  // Right connection tube half length [Pos 3]   (0.3 cm added for welding)
2400       const Float_t kRB26s5RingInnerR        = 11.2/2.;   // Ring inner radius                 [Pos 4]
2401       const Float_t kRB26s5RingOuterR        = 16.0/2.;   // Ring inner radius                 [Pos 4]
2402       const Float_t kRB26s5RingL             =  0.4/2.;   // Ring half length                  [Pos 4]
2403       const Float_t kRB26s5RingZ             = 14.97;     // Ring z-position                   [Pos 4]
2404       const Float_t kRB26s5ProtOuterR        = 16.2/2.;   // Protection tube outer radius      [Pos 5]
2405       const Float_t kRB26s5ProtL             = 13.0/2.;   // Protection tube half length       [Pos 5]
2406       const Float_t kRB26s5ProtZ             =  2.17;     // Protection tube z-position        [Pos 5]
2407       const Float_t kRB26s5DetailZR          = 11.3/2.;   // Detail Z max radius
2408       
2409       
2410 // Mother volume
2411 //
2412       TGeoPcon* shRB26s5Compensator  = new TGeoPcon(0., 360., 8);
2413       shRB26s5Compensator->DefineSection( 0,   0.0,                                                  0., kRB26s5CompTubeOuterR);
2414       shRB26s5Compensator->DefineSection( 1,   kRB26s5ProtZ,                                         0., kRB26s5CompTubeOuterR);      
2415       shRB26s5Compensator->DefineSection( 2,   kRB26s5ProtZ,                                         0., kRB26s5ProtOuterR);
2416       shRB26s5Compensator->DefineSection( 3,   kRB26s5ProtZ + 2. * kRB26s5ProtL + 2. * kRB26s5RingL, 0., kRB26s5ProtOuterR);      
2417       shRB26s5Compensator->DefineSection( 4,   kRB26s5ProtZ + 2. * kRB26s5ProtL + 2. * kRB26s5RingL, 0., kRB26s5DetailZR);
2418       shRB26s5Compensator->DefineSection( 5,   kRB26s5CompL - 8.,                                    0., kRB26s5DetailZR);
2419       shRB26s5Compensator->DefineSection( 6,   kRB26s5CompL - 8.,                                    0., kRB26s5CompTubeOuterR);            
2420       shRB26s5Compensator->DefineSection( 7,   kRB26s5CompL,                                         0., kRB26s5CompTubeOuterR);            
2421       TGeoVolume* voRB26s5Compensator  = new TGeoVolume("RB26s5Compensator", shRB26s5Compensator, kMedVac);
2422             
2423 //
2424 // [Pos 1] Bellow
2425 //      
2426 //
2427       TGeoVolume* voRB26s5Bellow = new TGeoVolume("RB26s5Bellow", 
2428                                                   new TGeoTube(kRB26s5BellowRi, kRB26s5BellowRo, kRB26s5BellowUndL/2.), kMedVac);
2429 //      
2430 //  Upper part of the undulation
2431 //
2432       TGeoTorus* shRB26s5PlieTorusU  =  new TGeoTorus(kRB26s5BellowRo - kRB26s5PlieR, kRB26s5PlieR - kRB26s5PlieThickness, kRB26s5PlieR);
2433       shRB26s5PlieTorusU->SetName("RB26s5TorusU");
2434       TGeoTube*  shRB26s5PlieTubeU   =  new TGeoTube (kRB26s5BellowRo - kRB26s5PlieR, kRB26s5BellowRo, kRB26s5PlieR);
2435       shRB26s5PlieTubeU->SetName("RB26s5TubeU");
2436       TGeoCompositeShape*  shRB26s5UpperPlie = new TGeoCompositeShape("RB26s5UpperPlie", "RB26s5TorusU*RB26s5TubeU");
2437  
2438       TGeoVolume* voRB26s5WiggleU = new TGeoVolume("RB26s5UpperPlie", shRB26s5UpperPlie, kMedSteel);
2439 //
2440 // Lower part of the undulation
2441       TGeoTorus* shRB26s5PlieTorusL =  new TGeoTorus(kRB26s5BellowRi + kRB26s5PlieR, kRB26s5PlieR - kRB26s5PlieThickness, kRB26s5PlieR);
2442       shRB26s5PlieTorusL->SetName("RB26s5TorusL");
2443       TGeoTube*  shRB26s5PlieTubeL   =  new TGeoTube (kRB26s5BellowRi, kRB26s5BellowRi + kRB26s5PlieR, kRB26s5PlieR);
2444       shRB26s5PlieTubeL->SetName("RB26s5TubeL");
2445       TGeoCompositeShape*  shRB26s5LowerPlie = new TGeoCompositeShape("RB26s5LowerPlie", "RB26s5TorusL*RB26s5TubeL");
2446       
2447       TGeoVolume* voRB26s5WiggleL = new TGeoVolume("RB26s5LowerPlie", shRB26s5LowerPlie, kMedSteel); 
2448
2449 //
2450 // Connection between upper and lower part of undulation
2451       TGeoVolume* voRB26s5WiggleC1 = new TGeoVolume("RB26s5PlieConn1",  
2452                                                     new TGeoTube(kRB26s5BellowRi + kRB26s5PlieR, 
2453                                                                  kRB26s5BellowRo - kRB26s5PlieR, kRB26s5PlieThickness / 2.), kMedSteel);
2454 //
2455 // One wiggle
2456       TGeoVolumeAssembly* voRB26s5Wiggle = new TGeoVolumeAssembly("RB26s5Wiggle");
2457       z0 =  -  kRB26s5PlieThickness / 2.;
2458       voRB26s5Wiggle->AddNode(voRB26s5WiggleC1,  1 , new TGeoTranslation(0., 0., z0));
2459       z0 += kRB26s5PlieR -  kRB26s5PlieThickness / 2.;
2460       voRB26s5Wiggle->AddNode(voRB26s5WiggleU,   1 , new TGeoTranslation(0., 0., z0));
2461       z0 += kRB26s5PlieR -  kRB26s5PlieThickness / 2.;
2462       voRB26s5Wiggle->AddNode(voRB26s5WiggleC1,  2 , new TGeoTranslation(0., 0., z0));
2463       z0 += kRB26s5PlieR -  kRB26s5PlieThickness;
2464       voRB26s5Wiggle->AddNode(voRB26s5WiggleL ,  1 , new TGeoTranslation(0., 0., z0));
2465 // Positioning of the volumes
2466       z0   = - kRB26s5BellowUndL/2.+ kRB26s5ConnectionPlieR;
2467       voRB26s5Bellow->AddNode(voRB26s5WiggleL, 1, new TGeoTranslation(0., 0., z0));
2468       z0  +=  kRB26s5ConnectionPlieR;
2469       zsh  = 4. *  kRB26s5PlieR -  2. * kRB26s5PlieThickness;
2470       for (Int_t iw = 0; iw < kRB26s5NumberOfPlies; iw++) {
2471           Float_t zpos =  z0 + iw * zsh;        
2472           voRB26s5Bellow->AddNode(voRB26s5Wiggle,  iw + 1, new TGeoTranslation(0., 0., zpos -  kRB26s5PlieThickness));  
2473       }
2474
2475       voRB26s5Compensator->AddNode(voRB26s5Bellow, 1,  new TGeoTranslation(0., 0., 2. * kRB26s5WeldingTubeLeftL + kRB26s5BellowUndL/2.));
2476       
2477 //
2478 // [Pos 2] Left Welding Tube
2479 //      
2480       TGeoPcon* shRB26s5CompLeftTube = new TGeoPcon(0., 360., 3);
2481       z0 = 0;
2482       shRB26s5CompLeftTube->DefineSection(0, z0, kRB26s5CompTubeInnerR, kRB26s5CompTubeOuterR);
2483       z0 += 2 * kRB26s5WeldingTubeLeftL - ( kRB26s5ConnectionR - kRB26s5CompTubeOuterR);
2484       shRB26s5CompLeftTube->DefineSection(1, z0, kRB26s5CompTubeInnerR, kRB26s5CompTubeOuterR);
2485       z0 += ( kRB26s5ConnectionR - kRB26s5CompTubeOuterR);
2486       shRB26s5CompLeftTube->DefineSection(2, z0, kRB26s5ConnectionR - 0.15, kRB26s5ConnectionR);
2487       TGeoVolume* voRB26s5CompLeftTube = new TGeoVolume("RB26s5CompLeftTube", shRB26s5CompLeftTube, kMedSteel);
2488       voRB26s5Compensator->AddNode(voRB26s5CompLeftTube, 1,  gGeoIdentity);
2489 //
2490 // [Pos 3] Right Welding Tube
2491 //      
2492       TGeoPcon* shRB26s5CompRightTube = new TGeoPcon(0., 360., 11);
2493       // Detail Z
2494       shRB26s5CompRightTube->DefineSection( 0, 0.  , kRB26s5CompTubeInnerR + 0.22, 11.2/2.);
2495       shRB26s5CompRightTube->DefineSection( 1, 0.05, kRB26s5CompTubeInnerR + 0.18, 11.2/2.);
2496       shRB26s5CompRightTube->DefineSection( 2, 0.22, kRB26s5CompTubeInnerR       , 11.2/2. - 0.22);
2497       shRB26s5CompRightTube->DefineSection( 3, 0.44, kRB26s5CompTubeInnerR       , 11.2/2.);
2498       shRB26s5CompRightTube->DefineSection( 4, 1.70, kRB26s5CompTubeInnerR       , 11.2/2.);
2499       shRB26s5CompRightTube->DefineSection( 5, 2.10, kRB26s5CompTubeInnerR       , kRB26s5CompTubeOuterR);
2500       shRB26s5CompRightTube->DefineSection( 6, 2.80, kRB26s5CompTubeInnerR       , kRB26s5CompTubeOuterR);
2501       shRB26s5CompRightTube->DefineSection( 7, 2.80, kRB26s5CompTubeInnerR       , 11.3/2.);
2502       shRB26s5CompRightTube->DefineSection( 8, 3.40, kRB26s5CompTubeInnerR       , 11.3/2.);
2503       // Normal pipe
2504       shRB26s5CompRightTube->DefineSection( 9, 3.50, kRB26s5CompTubeInnerR       , kRB26s5CompTubeOuterR);
2505       shRB26s5CompRightTube->DefineSection(10, 2. * kRB26s5WeldingTubeRightL, kRB26s5CompTubeInnerR, kRB26s5CompTubeOuterR);
2506       
2507       TGeoVolume* voRB26s5CompRightTube =  
2508           new TGeoVolume("RB26s5CompRightTube", shRB26s5CompRightTube, kMedSteel);
2509       voRB26s5Compensator->AddNode(voRB26s5CompRightTube,  1, 
2510                                    new TGeoTranslation(0., 0.,  kRB26s5CompL - 2. * kRB26s5WeldingTubeRightL));
2511 //
2512 // [Pos 4] Ring
2513 //      
2514       TGeoTube* shRB26s5CompRing = new TGeoTube(kRB26s5RingInnerR, kRB26s5RingOuterR, kRB26s5RingL);
2515       TGeoVolume* voRB26s5CompRing =  
2516           new TGeoVolume("RB26s5CompRing", shRB26s5CompRing, kMedSteel);
2517       voRB26s5Compensator->AddNode(voRB26s5CompRing,  1, new TGeoTranslation(0., 0., kRB26s5RingZ + kRB26s5RingL));
2518
2519 //
2520 // [Pos 5] Outer Protecting Tube
2521 //      
2522       TGeoTube* shRB26s5CompProtTube = new TGeoTube(kRB26s5RingOuterR, kRB26s5ProtOuterR, kRB26s5ProtL);
2523       TGeoVolume* voRB26s5CompProtTube =  
2524           new TGeoVolume("RB26s5CompProtTube", shRB26s5CompProtTube, kMedSteel);
2525       voRB26s5Compensator->AddNode(voRB26s5CompProtTube, 1,  new TGeoTranslation(0., 0., kRB26s5ProtZ + kRB26s5ProtL));
2526
2527 ///////////////////////////////////////
2528 //    RB26/4   Fixed Point Section   //
2529 //    Drawing  LHCVC2a_0016          //
2530 /////////////////////////////////////// 
2531       const Float_t kRB26s4TubeRi            =  30.30/2. ; // Tube inner radius  (0.3 cm added for welding)
2532       const Float_t kRB26s4TubeRo            =  30.60/2. ; // Tube outer radius      
2533       const Float_t kRB26s4FixedPointL       =  12.63    ; // Length of the fixed point section
2534       const Float_t kRB26s4FixedPointZ       =  10.53    ; // Position of the ring (0.15 added for welding)
2535       const Float_t kRB26s4FixedPointD       =   0.595   ; // Width of the ring
2536       const Float_t kRB26s4FixedPointR       =  31.60/2. ; // Radius of the ring
2537       
2538       TGeoPcon* shRB26s4FixedPoint = new TGeoPcon(0., 360., 6);
2539       z0 = 0.;
2540       shRB26s4FixedPoint->DefineSection(0, z0, kRB26s4TubeRi, kRB26s4TubeRo);
2541       z0 += kRB26s4FixedPointZ;
2542       shRB26s4FixedPoint->DefineSection(1, z0, kRB26s4TubeRi, kRB26s4TubeRo);      
2543       shRB26s4FixedPoint->DefineSection(2, z0, kRB26s4TubeRi, kRB26s4FixedPointR);                
2544       z0 += kRB26s4FixedPointD;
2545       shRB26s4FixedPoint->DefineSection(3, z0, kRB26s4TubeRi, kRB26s4FixedPointR);                
2546       shRB26s4FixedPoint->DefineSection(4, z0, kRB26s4TubeRi, kRB26s4TubeRo);
2547       z0 = kRB26s4FixedPointL;
2548       shRB26s4FixedPoint->DefineSection(5, z0, kRB26s4TubeRi, kRB26s4TubeRo);
2549       TGeoVolume* voRB26s4FixedPoint = new TGeoVolume("RB26s4FixedPoint", shRB26s4FixedPoint, kMedSteel);
2550       
2551       TGeoVolume* voRB26s4FixedPointM = new TGeoVolume("RB26s4FixedPointM", MakeMotherFromTemplate(shRB26s4FixedPoint), kMedVac);
2552       voRB26s4FixedPointM->AddNode(voRB26s4FixedPoint, 1, gGeoIdentity);
2553             
2554
2555 ///////////////////////////////////////
2556 //    RB26/4   Split Flange          //
2557 //    Drawing  LHCVFX__0005          //
2558 /////////////////////////////////////// 
2559       const Float_t kRB26s4SFlangeL      =  2.99;        // Length of the flange
2560       const Float_t kRB26s4SFlangeD1     =  0.85;        // Length of section 1
2561       const Float_t kRB26s4SFlangeD2     =  0.36;        // Length of section 2                                              
2562       const Float_t kRB26s4SFlangeD3     =  0.73 + 1.05; // Length of section 3                                                    
2563       const Float_t kRB26s4SFlangeRo     = 36.20/2.;     // Flange outer radius 
2564       const Float_t kRB26s4SFlangeRi1    = 30.60/2.;     // Flange inner radius section 1
2565       const Float_t kRB26s4SFlangeRi2    = 30.00/2.;     // Flange inner radius section 2
2566       const Float_t kRB26s4SFlangeRi3    = 30.60/2.;     // Flange inner radius section 3
2567       z0 = 0;
2568       TGeoPcon* shRB26s4SFlange = new TGeoPcon(0., 360., 6);
2569       z0 = 0.;
2570       shRB26s4SFlange->DefineSection(0, z0, kRB26s4SFlangeRi1, kRB26s4SFlangeRo);
2571       z0 += kRB26s4SFlangeD1;
2572       shRB26s4SFlange->DefineSection(1, z0, kRB26s4SFlangeRi1, kRB26s4SFlangeRo);
2573       shRB26s4SFlange->DefineSection(2, z0, kRB26s4SFlangeRi2, kRB26s4SFlangeRo);
2574       z0 += kRB26s4SFlangeD2;
2575       shRB26s4SFlange->DefineSection(3, z0, kRB26s4SFlangeRi2, kRB26s4SFlangeRo);
2576       shRB26s4SFlange->DefineSection(4, z0, kRB26s4SFlangeRi3, kRB26s4SFlangeRo);
2577       z0 += kRB26s4SFlangeD3;
2578       shRB26s4SFlange->DefineSection(5, z0, kRB26s4SFlangeRi3, kRB26s4SFlangeRo);
2579       TGeoVolume* voRB26s4SFlange = new TGeoVolume("RB26s4SFlange", shRB26s4SFlange, kMedSteel);
2580
2581       TGeoVolume* voRB26s4SFlangeM = new TGeoVolume("RB26s4SFlangeM", MakeMotherFromTemplate(shRB26s4SFlange, 0, 3), kMedVac);
2582       voRB26s4SFlangeM->AddNode(voRB26s4SFlange, 1, gGeoIdentity);
2583       
2584 ///////////////////////////////////////
2585 //    RB26/5   Rotable Flange        //
2586 //    Drawing  LHCVFX__0009          //
2587 /////////////////////////////////////// 
2588       const Float_t kRB26s5RFlangeL      =  1.86;    // Length of the flange
2589       const Float_t kRB26s5RFlangeD1     =  0.61;    // Length of section 1
2590       const Float_t kRB26s5RFlangeD2     =  0.15;    // Length of section 2                                                  
2591       const Float_t kRB26s5RFlangeD3     =  0.60;    // Length of section 3                                                        
2592       const Float_t kRB26s5RFlangeD4     =  0.50;    // Length of section 4                                                        
2593       const Float_t kRB26s5RFlangeRo     = 15.20/2.; // Flange outer radius 
2594       const Float_t kRB26s5RFlangeRi1    = 10.30/2.; // Flange inner radius section 1
2595       const Float_t kRB26s5RFlangeRi2    = 10.00/2.; // Flange inner radius section 2
2596       const Float_t kRB26s5RFlangeRi3    = 10.30/2.; // Flange inner radius section 3
2597       const Float_t kRB26s5RFlangeRi4    = 10.50/2.; // Flange inner radius section 4
2598
2599       z0 = 0;
2600       TGeoPcon* shRB26s5RFlange = new TGeoPcon(0., 360., 8);
2601       z0 = 0.;
2602       shRB26s5RFlange->DefineSection(0, z0, kRB26s5RFlangeRi4, kRB26s5RFlangeRo);
2603       z0 += kRB26s5RFlangeD4;
2604       shRB26s5RFlange->DefineSection(1, z0, kRB26s5RFlangeRi4, kRB26s5RFlangeRo);
2605       shRB26s5RFlange->DefineSection(2, z0, kRB26s5RFlangeRi3, kRB26s5RFlangeRo);
2606       z0 += kRB26s5RFlangeD3;
2607       shRB26s5RFlange->DefineSection(3, z0, kRB26s5RFlangeRi3, kRB26s5RFlangeRo);
2608       shRB26s5RFlange->DefineSection(4, z0, kRB26s5RFlangeRi2, kRB26s5RFlangeRo);
2609       z0 += kRB26s5RFlangeD2;
2610       shRB26s5RFlange->DefineSection(5, z0, kRB26s5RFlangeRi2, kRB26s5RFlangeRo);
2611       shRB26s5RFlange->DefineSection(6, z0, kRB26s5RFlangeRi1, kRB26s5RFlangeRo);
2612       z0 += kRB26s5RFlangeD1;
2613       shRB26s5RFlange->DefineSection(7, z0, kRB26s5RFlangeRi1, kRB26s5RFlangeRo);
2614       TGeoVolume* voRB26s5RFlange = new TGeoVolume("RB26s5RFlange", shRB26s5RFlange, kMedSteel);
2615
2616       TGeoVolume* voRB26s5RFlangeM = new TGeoVolume("RB26s5RFlangeM", MakeMotherFromTemplate(shRB26s5RFlange, 4, 7), kMedVac);
2617       voRB26s5RFlangeM->AddNode(voRB26s5RFlange, 1, gGeoIdentity);
2618
2619 //      
2620 // Assemble RB26/1-2
2621 //
2622       TGeoVolumeAssembly* asRB26s12 = new TGeoVolumeAssembly("RB26s12"); 
2623       z0 = 0.;
2624       asRB26s12->AddNode(voRB26s1RFlange,       1, gGeoIdentity);
2625       z0 += kRB26s1RFlangeIsL + kRB26s1RFlangeFpL;
2626       asRB26s12->AddNode(voRB26s12TubeM,         1, new TGeoTranslation(0., 0., z0));
2627       z0 += kRB26s12TubeL;
2628       asRB26s12->AddNode(voRB26s2Compensator,   1, new TGeoTranslation(0., 0., z0));
2629       z0 += kRB26s2CompL;
2630       z0 -= kRB26s2FFlangeD1;
2631       asRB26s12->AddNode(voRB26s2FFlangeM,       1, new TGeoTranslation(0., 0., z0));
2632       z0 += kRB26s2FFlangeL;
2633       const Float_t kRB26s12L = z0;
2634
2635 //
2636 // Assemble RB26/3
2637 //
2638       TGeoVolumeAssembly* asRB26s3 = new TGeoVolumeAssembly("RB26s3"); 
2639       z0 = 0.;
2640       asRB26s3->AddNode(voRB26s3SFlangeM,      1, gGeoIdentity);
2641       z0 +=  kRB26s3SFlangeL;
2642       z0 -=  kRB26s3SFlangeD3;
2643       asRB26s3->AddNode(voRB26s3FixedPointM,   1, new TGeoTranslation(0., 0., z0));
2644       z0 += kRB26s3FixedPointL;
2645       asRB26s3->AddNode(voRB26s3TubeM,         1, new TGeoTranslation(0., 0., z0));
2646       z0 += kRB26s3TubeL;
2647       asRB26s3->AddNode(voRB26s3Compensator,   1, new TGeoTranslation(0., 0., z0));
2648       z0 += kRB26s3CompL;
2649       z0 -= kRB26s3FFlangeD1;
2650       asRB26s3->AddNode(voRB26s3FFlangeM,      1, new TGeoTranslation(0., 0., z0));
2651       z0 += kRB26s3FFlangeL;
2652       const Float_t kRB26s3L = z0;
2653       
2654
2655 //
2656 // Assemble RB26/4-5
2657 //
2658       TGeoVolumeAssembly* asRB26s45 = new TGeoVolumeAssembly("RB26s45"); 
2659       z0 = 0.;
2660       asRB26s45->AddNode(voRB26s4SFlangeM,       1, gGeoIdentity);
2661       z0 +=  kRB26s4SFlangeL;
2662       z0 -=  kRB26s4SFlangeD3;
2663       asRB26s45->AddNode(voRB26s4FixedPointM,    1, new TGeoTranslation(0., 0., z0));
2664       z0 += kRB26s4FixedPointL;
2665       asRB26s45->AddNode(voRB26s45TubeM,         1, new TGeoTranslation(0., 0., z0));
2666       z0 += kRB26s45TubeL;
2667       asRB26s45->AddNode(voRB26s5Compensator,    1, new TGeoTranslation(0., 0., z0));
2668       z0 += kRB26s5CompL;
2669       z0 -= kRB26s5RFlangeD3;
2670       z0 -= kRB26s5RFlangeD4;
2671       asRB26s45->AddNode(voRB26s5RFlangeM,       1, new TGeoTranslation(0., 0., z0));
2672       z0 += kRB26s5RFlangeL;
2673       const Float_t kRB26s45L = z0;
2674       
2675 //
2676 // Assemble RB26
2677 //
2678       TGeoVolumeAssembly* asRB26Pipe = new TGeoVolumeAssembly("RB26Pipe"); 
2679       z0 = 0.;
2680       asRB26Pipe->AddNode(asRB26s12,       1, new TGeoTranslation(0., 0., z0));
2681       z0 +=  kRB26s12L;
2682       asRB26Pipe->AddNode(asRB26s3,        1, new TGeoTranslation(0., 0., z0));
2683       z0 +=  kRB26s3L;
2684       asRB26Pipe->AddNode(asRB26s45,       1, new TGeoTranslation(0., 0., z0));
2685       z0 +=  kRB26s45L;
2686       top->AddNode(asRB26Pipe, 1, new TGeoCombiTrans(0., 0., -82., rot180));
2687 }
2688
2689
2690
2691 //___________________________________________
2692 void AliPIPEv3::CreateMaterials()
2693 {
2694   //
2695   // Define materials for beam pipe
2696   //
2697
2698   AliDebugClass(1,"Create PIPEv3 materials");
2699   Int_t   isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
2700   Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
2701   // Steel (Inox)  
2702   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
2703   Float_t zsteel[4] = { 26.,24.,28.,14. };
2704   Float_t wsteel[4] = { .715,.18,.1,.005 };
2705   // AlBe - alloy 
2706   Float_t aAlBe[2] = { 26.98, 9.01};
2707   Float_t zAlBe[2] = { 13.00, 4.00};
2708   Float_t wAlBe[2] = { 0.4, 0.6};
2709   //
2710   // Polyamid
2711   Float_t aPA[4] = {16., 14., 12.,  1.};
2712   Float_t zPA[4] = { 8.,  7.,  6.,  1.};
2713   Float_t wPA[4] = { 1.,  1.,  6., 11.};
2714   //
2715   // Air 
2716   //
2717   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
2718   Float_t zAir[4]={6.,7.,8.,18.};
2719   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
2720   Float_t dAir = 1.20479E-3;
2721   Float_t dAir1 = 1.20479E-11;
2722   //
2723   // Insulation powder
2724   //                    Si         O       Ti     Al
2725   Float_t ains[4] ={28.0855, 15.9994, 47.867,  26.982};
2726   Float_t zins[4] ={14.,      8.    , 22.   ,  13.   };
2727   Float_t wins[4] ={ 0.3019,  0.4887,  0.1914,  0.018};
2728   //
2729   //
2730   // Anticorodal
2731   //
2732   // Al Si7 Mg 0.6
2733   //
2734   Float_t aaco[3] ={26.982, 28.0855, 24.035};
2735   Float_t zaco[3] ={13.,    14.    , 12.   };
2736   Float_t waco[3] ={ 0.924,  0.07,  0.006};
2737   // Kapton
2738   //
2739   Float_t aKapton[4]={1.00794,12.0107, 14.010,15.9994};
2740   Float_t zKapton[4]={1.,6.,7.,8.};
2741   Float_t wKapton[4]={0.026362,0.69113,0.07327,0.209235};
2742   Float_t dKapton = 1.42;
2743   // NEG coating
2744   //                  Ti     V      Zr
2745   Float_t aNEG[4] = {47.87, 50.94, 91.24};
2746   Float_t zNEG[4] = {22.00, 23.00, 40.00};
2747   Float_t wNEG[4] = {1./3., 1./3., 1./3.};  
2748   Float_t dNEG = 5.6; // ?
2749
2750   //
2751   //
2752   //     Berillium 
2753   AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
2754   //
2755   //     Carbon 
2756   AliMaterial(6,  "CARBON$   ", 12.01, 6., 2.265, 18.8, 49.9);
2757   //
2758   //     Aluminum 
2759   AliMaterial(9,  "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
2760   //
2761   //     Copper 
2762   AliMaterial(10, "COPPER", 63.55, 29, 8.96, 1.43, 85.6/8.96);
2763   //
2764   //     Air 
2765   AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
2766   AliMixture(35, "AIR_HIGH$ ", aAir, zAir, dAir, 4, wAir);
2767   //
2768   //     Vacuum 
2769   AliMixture(16, "VACUUM$ ", aAir, zAir, dAir1, 4, wAir);
2770   //
2771   //     stainless Steel 
2772   AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
2773   //
2774   //     reduced density steel to approximate pump getter material
2775   AliMixture(20, "GETTER$", asteel, zsteel, 1.00, 4, wsteel);
2776   //     Al-Be alloy
2777   //     
2778   AliMixture(21, "AlBe$", aAlBe, zAlBe, 2.07, 2, wAlBe);
2779   //     Polyamid
2780   //   
2781   AliMixture(22, "PA$", aPA, zPA, 1.14, -4, wPA);
2782   //
2783   //     Kapton
2784   AliMixture(23, "KAPTON", aKapton, zKapton, dKapton, 4, wKapton);
2785   // Anticorodal 
2786   AliMixture(24, "ANTICORODAL", aaco, zaco, 2.66, 3, waco);
2787   
2788   //
2789   //     Insulation powder 
2790    AliMixture(14, "INSULATION0$", ains, zins, 0.41, 4, wins);
2791    AliMixture(34, "INSULATION1$", ains, zins, 0.41, 4, wins);
2792    AliMixture(54, "INSULATION2$", ains, zins, 0.41, 4, wins);
2793
2794    //    NEG
2795    AliMixture(25, "NEG COATING", aNEG, zNEG, dNEG, -3, wNEG);
2796    
2797    
2798    // **************** 
2799    //     Defines tracking media parameters. 
2800    //
2801   Float_t epsil  = .001;    // Tracking precision, 
2802   Float_t stemax = -0.01;   // Maximum displacement for multiple scat 
2803   Float_t tmaxfd = -20.;    // Maximum angle due to field deflection 
2804   Float_t deemax = -.3;     // Maximum fractional energy loss, DLS 
2805   Float_t stmin  = -.8;
2806   // *************** 
2807   //
2808   //    Beryllium 
2809   
2810   AliMedium(5, "BE",       5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2811
2812   //    Carbon 
2813   AliMedium(6, "C",        6, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2814   //
2815   //    Aluminum 
2816   AliMedium(9, "ALU",      9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2817   //    Copper 
2818   AliMedium(10, "CU",      10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2819   //
2820   //    Air 
2821   AliMedium(15, "AIR",     15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2822   AliMedium(35, "AIR_HIGH",35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2823   //
2824   //    Vacuum 
2825   AliMedium(16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2826   //
2827   //    Steel 
2828   AliMedium(19, "INOX",   19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2829   //
2830   //    Getter 
2831   AliMedium(20, "GETTER", 20, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2832   //
2833   //   AlBe - Aloy 
2834   AliMedium(21, "AlBe"  , 21, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2835   //
2836   //   Polyamid
2837   AliMedium(22, "PA"  ,   22, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2838   //   Antocorodal
2839   AliMedium(24, "ANTICORODAL",   24, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2840   //    Insulation Powder 
2841   AliMedium(14, "INS_C0          ", 14, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2842   AliMedium(34, "INS_C1          ", 34, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2843   AliMedium(54, "INS_C2          ", 54, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2844   //
2845   //   KAPTON
2846   AliMedium(23, "KAPTON", 23, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2847
2848   //
2849   //   NEG
2850   AliMedium(25, "NEG COATING", 25, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
2851 }
2852
2853
2854 TGeoPcon* AliPIPEv3::MakeMotherFromTemplate(TGeoPcon* shape, Int_t imin, Int_t imax, Float_t r0, Int_t nz)
2855 {
2856 //
2857 //  Create a mother shape from a template setting some min radii to 0
2858 //
2859     Int_t nz0 = shape->GetNz();
2860     // if nz > -1 the number of planes is given by nz
2861     if (nz != -1) nz0 = nz;
2862     TGeoPcon* mother = new TGeoPcon(0., 360., nz0);
2863
2864     if (imin == -1 || imax == -1) {
2865         imin = 0;
2866         imax = shape->GetNz();
2867     } else if (imax >= nz0) {
2868         imax = nz0 - 1;
2869         printf("Warning: imax reset to nz-1 %5d %5d %5d %5d\n", imin, imax, nz, nz0);
2870     }
2871     
2872
2873     
2874     for (Int_t i = 0;  i < shape->GetNz(); i++) {
2875         Double_t rmin = shape->GetRmin(i);
2876         if ((i >= imin) && (i <= imax) ) rmin = r0;
2877         Double_t rmax = shape->GetRmax(i);
2878         Double_t    z = shape->GetZ(i);
2879         mother->DefineSection(i, z, rmin, rmax);
2880     }
2881     return mother;
2882     
2883 }
2884
2885 TGeoPcon* AliPIPEv3::MakeInsulationFromTemplate(TGeoPcon* shape)
2886 {
2887 //
2888 //  Create an beam pipe insulation layer shape from a template
2889 //
2890     Int_t nz = shape->GetNz();
2891     TGeoPcon* insu = new TGeoPcon(0., 360., nz);
2892     
2893     for (Int_t i = 0;  i < nz; i++) {
2894         Double_t    z = shape->GetZ(i);
2895         Double_t rmin = shape->GetRmin(i);
2896         Double_t rmax = shape->GetRmax(i);
2897         rmax += 0.5;
2898         shape->DefineSection(i, z, rmin, rmax); 
2899         rmin  = rmax - 0.5;
2900         insu->DefineSection(i, z, rmin, rmax);  
2901     }
2902     return insu;
2903     
2904 }
2905
2906
2907 TGeoVolume* AliPIPEv3::MakeBellow(const char* ext, Int_t nc, Float_t rMin, Float_t rMax, Float_t dU, Float_t rPlie, Float_t dPlie)
2908 {
2909     // nc     Number of convolution
2910     // rMin   Inner radius of the bellow
2911     // rMax   Outer radius of the bellow
2912     // dU     Undulation length
2913     // rPlie  Plie radius
2914     // dPlie  Plie thickness
2915     const TGeoMedium* kMedVac    =  gGeoManager->GetMedium("PIPE_VACUUM");    
2916     const TGeoMedium* kMedSteel  =  gGeoManager->GetMedium("PIPE_INOX");   
2917
2918     char name[64], nameA[64], nameB[64], bools[64];
2919     sprintf(name, "%sBellowUS", ext);
2920     TGeoVolume* voBellow = new TGeoVolume(name, new TGeoTube(rMin, rMax, dU/2.), kMedVac);
2921 //      
2922 //  Upper part of the undulation
2923 //
2924     TGeoTorus* shPlieTorusU  =  new TGeoTorus(rMax - rPlie, rPlie - dPlie, rPlie);
2925     sprintf(nameA, "%sTorusU", ext);
2926     shPlieTorusU->SetName(nameA);
2927     TGeoTube*  shPlieTubeU   =  new TGeoTube (rMax - rPlie, rMax, rPlie);
2928     sprintf(nameB, "%sTubeU", ext);
2929     shPlieTubeU->SetName(nameB);
2930     sprintf(name, "%sUpperPlie", ext);
2931     sprintf(bools, "%s*%s", nameA, nameB);
2932     TGeoCompositeShape*  shUpperPlie = new TGeoCompositeShape(name, bools);
2933     
2934     TGeoVolume* voWiggleU = new TGeoVolume(name, shUpperPlie, kMedSteel);
2935 //
2936 // Lower part of the undulation
2937     TGeoTorus* shPlieTorusL =  new TGeoTorus(rMin + rPlie, rPlie - dPlie, rPlie);
2938     sprintf(nameA, "%sTorusL", ext);
2939     shPlieTorusL->SetName(nameA);
2940     TGeoTube*  shPlieTubeL  =  new TGeoTube (rMin, rMin + rPlie, rPlie);
2941     sprintf(nameB, "%sTubeL", ext);
2942     shPlieTubeL->SetName(nameB);
2943     sprintf(name, "%sLowerPlie", ext);
2944     sprintf(bools, "%s*%s", nameA, nameB);
2945     TGeoCompositeShape*  shLowerPlie = new TGeoCompositeShape(name, bools);
2946     
2947     TGeoVolume* voWiggleL = new TGeoVolume(name, shLowerPlie, kMedSteel); 
2948     
2949 //
2950 // Connection between upper and lower part of undulation
2951     sprintf(name, "%sPlieConn1", ext);
2952     TGeoVolume* voWiggleC1 = new TGeoVolume(name, new TGeoTube(rMin + rPlie, rMax - rPlie, dPlie/2.), kMedSteel);
2953 //
2954 // One wiggle
2955     Float_t dz = rPlie -  dPlie / 2.;
2956     Float_t z0 = -  dPlie / 2.;
2957     sprintf(name, "%sWiggle", ext);
2958     TGeoVolumeAssembly* asWiggle = new TGeoVolumeAssembly(name);
2959     asWiggle->AddNode(voWiggleC1,  1 , new TGeoTranslation(0., 0., z0));
2960     z0 += dz;
2961     asWiggle->AddNode(voWiggleU,   1 , new TGeoTranslation(0., 0., z0));
2962     z0 += dz;
2963     asWiggle->AddNode(voWiggleC1,  2 , new TGeoTranslation(0., 0., z0));
2964     z0 += dz;
2965     asWiggle->AddNode(voWiggleL ,  1 , new TGeoTranslation(0., 0., z0));
2966 // Positioning of the volumes
2967     z0   = - dU / 2.+ rPlie;
2968     voBellow->AddNode(voWiggleL, 2, new TGeoTranslation(0., 0., z0));
2969     z0  +=  rPlie;
2970     Float_t zsh  = 4. *  rPlie -  2. * dPlie;
2971     for (Int_t iw = 0; iw < nc; iw++) {
2972         Float_t zpos =  z0 + iw * zsh;  
2973         voBellow->AddNode(asWiggle,  iw + 1, new TGeoTranslation(0., 0., zpos - dPlie));        
2974     }
2975     return voBellow;
2976 }
2977
2978
2979
2980