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