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