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