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