]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliPIPEv0.cxx
Put air in connecting tubes and flanges of vacuum pump.
[u/mrichter/AliRoot.git] / STRUCT / AliPIPEv0.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 /*
17 $Log$
18 Revision 1.13  2001/01/20 16:35:27  morsch
19 Increase mother volume for bellows.
20
21 Revision 1.12  2000/12/21 16:41:06  morsch
22 Coding convention clean-up (RS3)
23
24 Revision 1.11  2000/11/28 16:06:57  morsch
25 Undulated beam-pipe replaced by Al-Be (40,60) pipe 1.5 mm thick.
26
27 Revision 1.10  2000/11/24 13:00:37  morsch
28 - Geometry and materials imported from euclid output
29 - include comments
30 - better struturing of volume tree
31 - improved version of flange close to front absorber
32 - more realistic pump materials
33 - undulated beam pipe imported from v3.
34
35 Revision 1.9  2000/10/02 21:28:15  fca
36 Removal of useless dependecies via forward declarations
37
38 Revision 1.8  2000/06/11 12:37:01  morsch
39 Coding rule violations corrected
40
41 Revision 1.7  2000/02/23 16:25:24  fca
42 AliVMC and AliGeant3 classes introduced
43 ReadEuclid moved from AliRun to AliModule
44
45 Revision 1.6  1999/09/29 09:24:30  fca
46 Introduction of the Copyright and cvs Log
47
48 */
49
50 ////////////////////////////////////////////////
51 //  Beam pipe class                            /
52 ////////////////////////////////////////////////
53
54 #include "AliPIPEv0.h"
55 #include "AliRun.h"
56 #include "AliConst.h"
57 #include "AliMagF.h"
58 #include "AliMC.h"
59 #include "TSystem.h"
60  
61 ClassImp(AliPIPEv0)
62  
63 //_____________________________________________________________________________
64 AliPIPEv0::AliPIPEv0()
65 {
66 // Constructor
67 }
68
69 //_____________________________________________________________________________
70 AliPIPEv0::AliPIPEv0(const char *name, const char *title)
71   : AliPIPE(name,title)
72 {
73 // Constructor
74 }
75
76  
77 //___________________________________________
78 void AliPIPEv0::CreateGeometry()
79 {
80 //Begin_Html
81 /*
82 <img src="picts/pipe.gif">
83 */
84 //End_Html
85
86
87 //Begin_Html
88 /*
89 <img src="picts/tree_pipe.gif">
90 */
91 //End_Html
92
93     printf("Create PIPEv0 geometry \n");
94   
95
96     Int_t *idtmed = fIdtmed->GetArray();
97     Float_t ppcon[36], ptube[3], pbox[3];
98     Int_t i=0;
99     
100     enum {kC=6, kAlu=9, kInox=19, kGetter=20, kBe=5, kVac=16, kAir=15, kAlBe=21};
101     
102     Int_t   idrotm[2099];  
103     AliMatrix(idrotm[2001],90.,240.,  0.,  0., 90.,150.);
104     AliMatrix(idrotm[2002],90.,  0.,  0.,  0., 90.,270.);
105     AliMatrix(idrotm[2003],90.,120.,  0.,  0., 90., 30.);
106     AliMatrix(idrotm[2004],90.,315., 90., 45.,  0.,  0.);
107     AliMatrix(idrotm[2005],90.,270., 90.,  0.,  0.,  0.);
108     AliMatrix(idrotm[2006],90.,225., 90.,315.,  0.,  0.);
109     AliMatrix(idrotm[2007],90.,180., 90.,270.,  0.,  0.);
110     AliMatrix(idrotm[2008],90.,135., 90.,225.,  0.,  0.);
111     AliMatrix(idrotm[2009],90., 90., 90.,180.,  0.,  0.);
112     AliMatrix(idrotm[2010],90., 45., 90.,135.,  0.,  0.);
113     idrotm[2011] = 0;
114     AliMatrix(idrotm[2012],90.,180., 90., 90.,180.,  0.);
115     AliMatrix(idrotm[2013],90.,  0., 90., 90.,180.,  0.);
116
117
118     
119 //
120 // The peam pipe up to the Front Absorber
121 //
122 // Mother Volume QBPM
123     ppcon[0]  =    0;
124     ppcon[1]  =  360;
125     ppcon[2]  =   11;
126 //  1: 
127     ppcon[3]  = - 90;
128     ppcon[4]  =    0;
129     ppcon[5]  =    5.8;
130 //  2
131     ppcon[6]  = - 81.0;
132     ppcon[7]  =    0.;
133     ppcon[8]  =    5.8;
134 //  3
135     ppcon[9]  = - 81.;
136     ppcon[10]  =    0.;
137     ppcon[11] =    4.22;
138 //  4
139     ppcon[12] = - 28.00;
140     ppcon[13] =    0;
141     ppcon[14] =    4.22;
142 //  5
143     ppcon[15] = - 28.00;
144     ppcon[16] =    0;
145     ppcon[17] =    3.2;
146 //  6
147     ppcon[18] =    0;
148     ppcon[19] =    0;
149     ppcon[20] =    3.2;
150 //  7
151     ppcon[21] =   28.00;
152     ppcon[22] =    0;
153     ppcon[23] =    3.2;
154 //  8
155     ppcon[24] =   28.00;
156     ppcon[25] =    0;
157     ppcon[26] =    4.22;
158 //  9
159     ppcon[27] =  250;
160     ppcon[28] =    0;
161     ppcon[29] =   4.22;
162 // 10
163     ppcon[30] =  250;
164     ppcon[31] =    0;
165     ppcon[32] =    5;
166 // 11
167     ppcon[33] =  800;
168     ppcon[34] =    0;
169     ppcon[35] =    5;
170     
171     gMC->Gsvolu("QBPM", "PCON", idtmed[kAir], ppcon, 36);
172
173 //
174 // The Vacuum 
175     ptube[0] =   0.0;
176     ptube[1] =   2.9;
177     ptube[2] = 445.0;
178     
179     gMC->Gsvolu("QBVA","TUBE", idtmed[kVac], ptube, 3);
180     gMC->Gspos("QBVA", 1, "QBPM", 0., 0., 355., 0, "ONLY");
181 //
182 // Be Pipe in central Alice
183     ptube[0] =  2.90;
184     ptube[1] =  3.00;
185     ptube[2] = 28.25;
186     
187     gMC->Gsvolu("QBBE","TUBE", idtmed[kBe], ptube, 3);
188     gMC->Gspos("QBBE", 1, "QBPM", 0., 0., 0., 0, "ONLY");
189     
190 //
191 // Metal-Metal Transitions
192 //
193 //  Be-Inox
194 //  Mother Volume
195     ptube[0] = 2.900;
196     ptube[1] = 4.200;
197     ptube[2] = 2.750;
198     gMC->Gsvolu("QBT1","TUBE", idtmed[kAir], ptube, 3);
199     gMC->Gspos("QBT1", 1, "QBPM", 0., 0.,  28.25+ptube[2], 0, "ONLY");
200
201     ptube[0] = 2.900;
202     ptube[1] = 3.150;
203     ptube[2] = 0.375;
204     //
205     //  Be-part
206     gMC->Gsvolu("QB01","TUBE", idtmed[kInox], ptube, 3);
207
208     ptube[1] = 3.000;
209     gMC->Gsvolu("QBA1","TUBE", idtmed[kBe], ptube, 3);
210
211     gMC->Gspos("QBA1", 1, "QB01", 0., 0., 0, 0, "ONLY");
212     gMC->Gspos("QB01", 1, "QBT1", 0., 0.,-2.75+ptube[2], 0, "ONLY");
213
214     //  Inox-part
215     //
216     ptube[0] = 2.900;
217     ptube[1] = 3.150;
218     ptube[2] = 2.375;
219
220     gMC->Gsvolu("QB03","TUBE", idtmed[kInox], ptube, 3);
221     gMC->Gspos("QB03", 1, "QBT1", 0., 0.,-2.+ptube[2], 0, "ONLY");
222     
223     
224     ptube[0] = 3.15;
225     ptube[1] = 3.50;
226     ptube[2] = 0.10;
227
228     gMC->Gsvolu("QB05","TUBE", idtmed[kInox], ptube, 3);
229     gMC->Gspos("QB05", 1, "QBT1", 0., 0., 2.55+ptube[2], 0, "ONLY");
230     
231     
232     // Fixations
233     ptube[0] = 0.0;
234     ptube[1] = 0.1;
235     ptube[2] = 0.5;
236     
237     gMC->Gsvolu("QB08","TUBE", idtmed[kInox], ptube, 3);
238     gMC->Gspos("QB08", 1 ,"QBT1",  0.000,  3.650, -1.25, idrotm[2002], "ONLY");
239     gMC->Gspos("QB08", 2 ,"QBT1",  3.161, -1.825, -1.25, idrotm[2001], "ONLY");
240     gMC->Gspos("QB08", 3 ,"QBT1", -3.161, -1.825, -1.25, idrotm[2003], "ONLY");
241     
242     // Carbon ring
243     ptube[0] = 3.15;
244     ptube[1] = 4.10;
245     ptube[2] = 0.55;
246     
247     gMC->Gsvolu("QB07","TUBE", idtmed[kC], ptube, 3);
248
249     ptube[0] = 3.15;
250     ptube[1] = 3.50;
251     ptube[2] = 0.10;
252     gMC->Gsvolu("QBA7","TUBE", idtmed[kInox], ptube, 3);
253     gMC->Gspos("QBA7", 1, "QB07", 0.0, 0.0, 0.55-0.2, 0, "ONLY");
254     gMC->Gspos("QB07", 1, "QBT1", 0.0, 0.0, 2., 0, "ONLY");
255
256 //
257 //  Be-Alu
258 //  Mother Volume
259     ptube[0] = 2.900;
260     ptube[1] = 4.200;
261     ptube[2] = 2.750;
262     gMC->Gsvolu("QBT2","TUBE", idtmed[kAir], ptube, 3);
263     gMC->Gspos("QBT2", 1, "QBPM", 0., 0., -28.25-ptube[2], idrotm[2012], "ONLY");    
264
265     ptube[0] = 2.900;
266     ptube[1] = 3.150;
267     ptube[2] = 0.375;
268     //
269     //  Be-part
270     gMC->Gsvolu("QB02","TUBE", idtmed[kAlu], ptube, 3);
271
272     ptube[1] = 3.000;
273     gMC->Gsvolu("QBA2","TUBE", idtmed[kBe], ptube, 3);
274
275     gMC->Gspos("QBA2", 1, "QB01", 0., 0., 0, 0, "ONLY");
276     gMC->Gspos("QB02", 1, "QBT2", 0., 0.,-2.75+ptube[2], 0, "ONLY");
277
278     // Alu part    
279     ptube[0] = 2.900;
280     ptube[1] = 3.150;
281     ptube[2] = 2.375;
282
283     gMC->Gsvolu("QB04","TUBE", idtmed[kAlu], ptube, 3);
284     gMC->Gspos("QB04", 1, "QBT2", 0., 0.,-2.+ptube[2], 0, "ONLY");
285     
286     
287     ptube[0] = 3.15;
288     ptube[1] = 3.50;
289     ptube[2] = 0.10;
290
291     gMC->Gsvolu("QB06","TUBE", idtmed[kAlu], ptube, 3);
292     gMC->Gspos("QB06", 1, "QBT2", 0., 0., 2.55+ptube[2], 0, "ONLY");
293     
294     
295     // Fixation
296     ptube[0] = 0.0;
297     ptube[1] = 0.1;
298     ptube[2] = 0.5;
299     
300     gMC->Gsvolu("QBA8","TUBE", idtmed[kInox], ptube, 3);
301     gMC->Gspos("QBA8", 1 ,"QBT2",  0.000,  3.650, -1.25, idrotm[2002], "ONLY");
302     gMC->Gspos("QBA8", 2 ,"QBT2",  3.161, -1.825, -1.25, idrotm[2001], "ONLY");
303     gMC->Gspos("QBA8", 3 ,"QBT2", -3.161, -1.825, -1.25, idrotm[2003], "ONLY");
304     
305     // Carbon ring
306     ptube[0] = 3.15;
307     ptube[1] = 4.10;
308     ptube[2] = 0.55;
309     
310     gMC->Gsvolu("QB77","TUBE", idtmed[kC], ptube, 3);
311
312     ptube[0] = 3.15;
313     ptube[1] = 3.50;
314     ptube[2] = 0.10;
315     gMC->Gsvolu("QBB7","TUBE", idtmed[kInox], ptube, 3);
316     gMC->Gspos("QBB7", 1, "QB77", 0.0, 0.0, 0.55-0.2, 0, "ONLY");
317     gMC->Gspos("QB77", 1, "QBT2", 0.0, 0.0, 2., 0, "ONLY");
318
319
320
321 //
322 // 1st section Alu non-absorber side
323     ptube[0] = 2.9;
324     ptube[1] = 3.0;
325     ptube[2] = 85.175;
326     
327     gMC->Gsvolu("QB10","TUBE", idtmed[kAlu], ptube, 3);
328     gMC->Gspos("QB10", 1, "QBPM", 0.0, 0.0, 118.925, 0, "ONLY");
329 //
330 // Support rollers: non absorber side
331 //
332 //  Mother volume
333     ptube[0] = 3.2;
334     ptube[1] = 4.8;
335     ptube[2] = 3.0;
336     gMC->Gsvolu("QBRM","TUBE", idtmed[kAir], ptube, 3);
337     gMC->Gspos("QBRM", 1, "QBPM", 0., 0., 654.8, 0, "ONLY");
338     gMC->Gspos("QBRM", 2, "QBPM", 0., 0., 254.8, 0, "ONLY");
339
340     ptube[0] = 0.0;
341     ptube[1] = 0.7;
342     ptube[2] = 3.0;
343     
344     gMC->Gsvolu("QB30","TUBE", idtmed[kInox], ptube, 3);
345     
346     for (i=0; i<8; i++) {
347         Float_t phi = 45.+i*45.*kDegrad;
348         Float_t xpos = 4.*TMath::Sin(phi);
349         Float_t ypos = 4.*TMath::Cos(phi);
350         gMC->Gspos("QB30", i+1, "QBRM", xpos, ypos, 0, idrotm[2004+i], "ONLY");
351     }
352
353 //
354 // Flanges: non absorber side
355     ptube[0] = 3.0;
356     ptube[1] = 4.9;
357     ptube[2] = 2.2;
358     
359     gMC->Gsvolu("QB29","TUBE", idtmed[kInox], ptube, 3);
360     gMC->Gspos("QB29", 2, "QBPM", 0.0, 0.0, 654.8, 0, "ONLY");
361     gMC->Gspos("QB29", 1, "QBPM", 0.0, 0.0, 254.8, 0, "ONLY");
362 //
363 // Inox beam pipe: non absorber side
364
365     ptube[0] =   2.90;
366     ptube[1] =   2.98;
367 //    ptube[2] = 275.05;  // without undulated beampipe
368     ptube[2] = 42.55;    
369
370     gMC->Gsvolu("QB28","TUBE", idtmed[kInox], ptube, 3);
371 //    gMC->Gspos("QB28", 1, "QBPM", 0.0, 0.0, 524.95, 0, "ONLY");  // without undulated beam pipe
372     gMC->Gspos("QB28", 1, "QBPM", 0.0, 0.0, 249.9+ptube[2], 0, "ONLY");
373
374 //
375 //  Undulated beam pipe
376 // 
377 /*
378     Float_t pitch=0.25;
379     Float_t thick=0.015;
380     Float_t zundul=171;
381     Float_t rundul=3.0;
382     char cn48[][5]={"QN21","QN22","QN23","QN24","QN25","QN26","QN27","QN28"};
383
384     Undulation("QUND",pitch,thick,zundul,rundul,cn48);
385     gMC->Gspos("QUND", 1, "QBPM", 0., 0., 335.+zundul, 0, "ONLY");
386 */
387
388 //  Al-Be (40-60 wgt%, rho=2.7 g/cm**3) beam pipe
389 //
390     ptube[0] =   2.90;
391     ptube[1] =   3.05;
392     ptube[2] =  171.0;    
393
394     gMC->Gsvolu("QBAB","TUBE", idtmed[kAlBe], ptube, 3);
395     gMC->Gspos("QBAB", 1, "QBPM", 0.0, 0.0, 335.+ptube[2], 0, "ONLY");
396
397     
398 //
399 //  missing pieces of inox pipe 
400 //
401     ptube[0] =   2.90;
402     ptube[1] =   2.98;
403     ptube[2] =  61.55;    
404
405     gMC->Gsvolu("QB48","TUBE", idtmed[kInox], ptube, 3);
406     gMC->Gspos("QB48", 1, "QBPM", 0.0, 0.0, 800.-ptube[2], 0, "ONLY");
407
408     ptube[0] = 2.90;
409     ptube[1] = 2.98;
410     ptube[2] = 1.0;
411     
412     gMC->Gsvolu("QB27","TUBE", idtmed[kInox], ptube, 3);
413     gMC->Gspos("QB27", 1, "QBPM", 0.0, 0.0, 208.1, 0, "ONLY");
414 //
415     ptube[0] = 2.90;
416     ptube[1] = 3.15;
417     ptube[2] = 1.5;
418     
419     gMC->Gsvolu("QB26","TUBE", idtmed[kInox], ptube, 3);
420     gMC->Gspos("QB26", 1, "QBPM", 0.0, 0.0, 205.6, 0, "ONLY");
421
422 // 
423     ptube[0] = 3.0;
424     ptube[1] = 3.15;
425     ptube[2] = 2.75;
426     
427     gMC->Gsvolu("QB25","TUBE", idtmed[kAlu], ptube, 3);
428     gMC->Gspos("QB25", 1, "QBPM", 0.0, 0.0, 201.35, 0, "ONLY");
429
430 //
431 // Bellows
432 //
433 // Mother Volume
434     ptube[0] =  2.90;
435     ptube[1] =  3.75;
436     ptube[2] = 20.40;
437     gMC->Gsvolu("QBE0","TUBE", idtmed[kAir], ptube, 3);
438     gMC->Gspos("QBE0", 2 ,"QBPM", 0.0, 0.0, 229.5, 0, "ONLY");
439     gMC->Gspos("QBE0", 1 ,"QBPM", 0.0, 0.0, -61.3, 0, "ONLY");
440
441     ptube[2] = 5.70;
442
443     gMC->Gsvolu("QBEM","TUBE", idtmed[kAir], ptube, 3);
444     gMC->Gspos("QBEM", 2 ,"QBE0", 0.0, 0.0,-14.7, 0 , "ONLY");
445     gMC->Gspos("QBEM", 1 ,"QBE0", 0.0, 0.0, 14.7,idrotm[2012], "ONLY");
446     
447     ptube[0] = 2.90;
448     ptube[1] = 3.25;
449     ptube[2] = 3.70;
450     
451     gMC->Gsvolu("QB19","TUBE", idtmed[kVac], ptube, 3);
452     gMC->Gspos("QB19", 1 ,"QBEM", 0.0, 0.0, 0.5, 0 , "ONLY");
453     
454     ptube[0] = 3.25;
455     ptube[1] = 3.74;
456     ptube[2] = 0.095;
457     
458     gMC->Gsvolu("QB18","TUBE", idtmed[kVac], ptube, 3);
459     for (i=0; i<15; i++) {
460         gMC->Gspos("QB18", i+1, "QBEM", 0.0, 0.0, 3.3-i*0.4, 0, "ONLY");
461     }
462     
463     ptube[0] = 2.90;
464     ptube[1] = 3.00;
465     ptube[2] = 1.20;
466     
467     gMC->Gsvolu("QB21","TUBE", idtmed[kVac], ptube, 3);
468     gMC->Gspos("QB21", 1 ,"QBEM", 0.0, 0.0, -4.5, 0 , "ONLY");
469     
470     ptube[0] = 3.250;
471     ptube[1] = 3.750;
472     ptube[2] = 0.005;
473     
474     gMC->Gsvolu("QB15","TUBE", idtmed[kInox], ptube, 3);
475     for (i=0; i<30; i++) {
476         gMC->Gspos("QB15", i+1, "QBEM", 0.0, 0.0, 3.4-i*0.2, 0, "ONLY");
477     }
478     
479     ptube[0] = 3.740;
480     ptube[1] = 3.750;
481     ptube[2] = 0.095;
482     
483     gMC->Gsvolu("QB16","TUBE", idtmed[kInox], ptube, 3);
484     for (i=0; i<15; i++) {
485         gMC->Gspos("QB16", i+1, "QBEM", 0.0, 0.0, 3.3-i*0.4, 0, "ONLY");
486     }
487     
488     ptube[0] = 3.250;
489     ptube[1] = 3.260;
490     ptube[2] = 0.095;
491     
492     gMC->Gsvolu("QB17","TUBE", idtmed[kInox], ptube, 3);
493     for (i=0; i<14; i++) {
494         gMC->Gspos("QB17", i+1, "QBEM", 0.0, 0.0, 3.1-i*0.4, 0, "ONLY");
495     }
496     
497     ptube[0] = 3.250;
498     ptube[1] = 3.260;
499     ptube[2] = 0.3975;
500
501     gMC->Gsvolu("QB14","TUBE", idtmed[kInox], ptube, 3);
502     gMC->Gspos("QB14", 2 ,"QBEM", 0.0, 0.0, -2.8025, 0 , "ONLY");
503     gMC->Gspos("QB14", 1 ,"QBEM", 0.0, 0.0,  3.8025, 0 , "ONLY");
504     
505     ptube[0] = 2.900;
506     ptube[1] = 3.260;
507     ptube[2] = 0.050;
508     
509     gMC->Gsvolu("QB13","TUBE", idtmed[kInox], ptube, 3);
510     gMC->Gspos("QB13", 2 ,"QBEM", 0.0, 0.0, -3.25, 0 , "ONLY");
511     gMC->Gspos("QB13", 1 ,"QBEM", 0.0, 0.0,  4.25, 0 , "ONLY");
512     
513     ptube[0] = 2.900;
514     ptube[1] = 3.000;
515     ptube[2] = 0.700;
516     
517     gMC->Gsvolu("QB12","TUBE", idtmed[kInox], ptube, 3);
518     gMC->Gspos("QB12", 1 ,"QBEM", 0.0, 0.0, 5.0, 0, "ONLY");
519
520
521 //
522 //  pipe between Bellows
523     ptube[0] = 2.9;
524     ptube[1] = 3.0;
525     ptube[2] = 9.0;
526     gMC->Gsvolu("QB23","TUBE", idtmed[kInox], ptube, 3);
527     gMC->Gspos("QB23", 1 ,"QBE0", 0.0, 0.0, 0.0, 0, "ONLY");
528     
529 //
530 // End Bellow
531  
532 // Absorber side   
533 //
534 // beam pipe between metal-metal transition and bellows
535     ptube[0] = 2.9;
536     ptube[1] = 3.0;
537     ptube[2] = 3.575;
538     
539     gMC->Gsvolu("QB24","TUBE", idtmed[kInox], ptube, 3);
540     gMC->Gspos("QB24", 1 ,"QBPM", 0.0, 0.0, -37.325, 0, "ONLY");
541 //
542 // beam pipe between flange and bellows    
543     ptube[0] = 2.90;
544     ptube[1] = 3.00;
545     ptube[2] = 0.45;
546
547     gMC->Gsvolu("QB22","TUBE", idtmed[kInox], ptube, 3);
548     gMC->Gspos("QB22", 1 ,"QBPM", 0.0, 0.0, -82.15, 0, "ONLY");
549
550 // 
551 // Flange
552 // 
553 //  Mother Volume
554     ptube[0] = 2.900;
555     ptube[1] = 4.300;
556     ptube[2] = 1.400;
557     
558     gMC->Gsvolu("QFA0","TUBE", idtmed[kAlu], ptube, 3);
559     gMC->Gspos("QFA0", 1 ,"QBPM", 0.0, 0.0, -84.0, 0, "ONLY");
560 //
561 //  inner Inox piece
562     ptube[0] = 2.900;
563     ptube[1] = 3.500;
564     ptube[2] = 0.450;
565     gMC->Gsvolu("QFA1","TUBE", idtmed[kInox], ptube, 3);
566     gMC->Gspos("QFA1", 1 ,"QFA0", 0.0, 0.0, 0.225, 0, "ONLY");
567 //
568 //  8 x M5 Inox
569     ptube[0] = 0.000;
570     ptube[1] = 0.250;
571     ptube[2] = 1.400;
572     gMC->Gsvolu("QFA2","TUBE", idtmed[kInox], ptube, 3);
573     for (i=0; i<8; i++) {
574         Float_t phi = i*45.*kDegrad;
575         Float_t xpos = 3.9*TMath::Sin(phi);
576         Float_t ypos = 3.9*TMath::Cos(phi);
577         gMC->Gspos("QFA2", i+1, "QFA0", xpos, ypos, 0., 0, "ONLY");
578     }
579
580
581     ptube[0] = 2.900;
582     ptube[1] = 3.000;
583     ptube[2] = 2.300;
584     
585     gMC->Gsvolu("QB32","TUBE", idtmed[kInox], ptube, 3);
586     gMC->Gspos("QB32", 1 ,"QBPM", 0.0, 0.0, -90.+2.3, 0, "ONLY");
587
588 //
589 // The Ion Pump
590 // --- Place the PIPE ghost volume (QBPM) in its mother volume (ALIC)
591 //    and make it invisible
592 // 
593
594   
595     gMC->Gspos("QBPM",1,"ALIC",0,0,0,idrotm[2013], "ONLY");
596
597 //
598 // Ion Pump
599 // 
600     ptube[0] =  5.;
601     ptube[1] = 55.;
602     ptube[2] = 20.;
603     gMC->Gsvolu("QIPM","TUBE", idtmed[kAir], ptube, 3);
604     //
605     // Getters ->
606     pbox[0] =  6.50;
607     pbox[1] =  6.75;
608     pbox[2] = 15.60;
609     gMC->Gsvolu("QI32","BOX", idtmed[kInox], pbox, 3);
610     
611     pbox[0] =  5.90;
612     pbox[1] =  6.15;
613     pbox[2] = 15.00;
614     gMC->Gsvolu("QI42","BOX", idtmed[kGetter], pbox, 3);
615     gMC->Gspos("QI42", 1, "QI32", 0.0, 0.0, 0.0, 0, "ONLY");
616 // <-
617
618     ptube[0] =  0.0;
619     ptube[1] = 19.0;
620     ptube[2] =  2.5;
621     gMC->Gsvolu("QI33","TUBE", idtmed[kInox], ptube, 3);
622
623
624     ptube[0] =  0.0;
625     ptube[1] = 15.0;
626     ptube[2] =  2.5;
627     gMC->Gsvolu("QI43","TUBE", idtmed[kAir], ptube, 3);
628     gMC->Gspos("QI43", 1, "QI33", 0.0, 0.0, 0.0, 0, "ONLY");
629 // 
630 // Connecting tube ->
631     ptube[0] =  0.0;
632     ptube[1] =  5.4;
633     ptube[2] = 13.7;
634     gMC->Gsvolu("QI34","TUBE", idtmed[kInox], ptube, 3);
635     
636     ptube[0] =  0.0;
637     ptube[1] =  4.8;
638     ptube[2] = 13.7;
639     gMC->Gsvolu("QI44","TUBE", idtmed[kAir], ptube, 3);
640     gMC->Gspos("QI44", 1, "QI34", 0.0, 0.0, 0.0, 0, "ONLY");
641 // <-
642
643   //
644   // Flange ->
645     ptube[0] =  0.00;
646     ptube[1] =  7.30;
647     ptube[2] =  2.15;
648     gMC->Gsvolu("QI35","TUBE", idtmed[kInox], ptube, 3);
649     
650     ptube[0] =  0.00;
651     ptube[1] =  4.80;
652     ptube[2] =  2.15;
653     gMC->Gsvolu("QI45","TUBE", idtmed[kAir], ptube, 3);
654     gMC->Gspos("QI45", 1, "QI35", 0.0, 0.0, 0.0, 0, "ONLY");
655 // <-
656
657     gMC->Gspos("QI32", 1, "QIPM", 0.0, -44.25, 0.0, 0, "ONLY");
658     gMC->Gspos("QI33", 1, "QIPM", 0.0, -35.00, 0.0,idrotm[2002], "ONLY");
659     gMC->Gspos("QI34", 1, "QIPM", 0.0, -18.80, 0.0,idrotm[2002], "ONLY");
660     gMC->Gspos("QI35", 1, "QIPM", 0.0, -24.35, 0.0,idrotm[2002], "ONLY");
661 //
662 //    PLACE ION PUMP (QIPM) AT Z=-385.
663 //
664     gMC->Gspos("QIPM",1,"ALIC",0,0,-385,idrotm[2013], "ONLY");
665     
666
667     gMC->Gsatt("QIPM", "SEEN", 0);
668     gMC->Gsatt("QBPM", "SEEN", 0);
669     gMC->Gsatt("QBEM", "SEEN", 0);
670 }
671
672  
673 //___________________________________________
674 void AliPIPEv0::DrawModule()
675 {
676 // Set drawing options
677     ;
678 }
679
680 //___________________________________________
681 void AliPIPEv0::CreateMaterials()
682 {
683   //
684   // Define materials for beam pipe
685   //
686
687   printf("Create PIPEv0 materials \n");
688   Int_t   isxfld = gAlice->Field()->Integ();
689   Float_t sxmgmx = gAlice->Field()->Max();
690   // Steel (Inox)  
691   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
692   Float_t zsteel[4] = { 26.,24.,28.,14. };
693   Float_t wsteel[4] = { .715,.18,.1,.005 };
694   // AlBe - alloy 
695   Float_t aAlBe[2] = { 26.98, 9.01};
696   Float_t zAlBe[2] = { 13.00, 4.00};
697   Float_t wAlBe[2] = { 0.4, 0.6};
698
699   //
700   //     Berillium 
701   AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
702   //
703   //     Carbon 
704   AliMaterial(6,  "CARBON$   ", 12.01, 6., 2.265, 18.8, 49.9);
705   //
706   //     Aluminum 
707   AliMaterial(9,  "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
708   //
709   //     Air 
710   AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500.);
711   //
712   //     Vacuum 
713   AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
714   //
715   //     stainless Steel 
716   AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
717   //
718   //     reduced density steel to approximate pump getter material
719   AliMixture(20, "GETTER$", asteel, zsteel, 1.00, 4, wsteel);
720   //     Al-Be alloy
721   //     
722   AliMixture(21, "AlBe$", aAlBe, zAlBe, 2.07, 2, wAlBe);
723   //
724   // **************** 
725   //     Defines tracking media parameters. 
726   //
727   Float_t epsil  = .001;    // Tracking precision, 
728   Float_t stemax = -0.01;   // Maximum displacement for multiple scat 
729   Float_t tmaxfd = -20.;    // Maximum angle due to field deflection 
730   Float_t deemax = -.3;     // Maximum fractional energy loss, DLS 
731   Float_t stmin  = -.8;
732   // *************** 
733   //
734   //    Beryllium 
735   
736   AliMedium(5, "BE",       5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
737
738   //    Carbon 
739   AliMedium(6, "C",        6, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
740   //
741   //    Aluminum 
742   AliMedium(9, "ALU",      9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
743   //
744   //    Air 
745   AliMedium(15, "AIR",    15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
746   //
747   //    Vacuum 
748   AliMedium(16, "VACUUM", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
749   //
750   //    Steel 
751   AliMedium(19, "INOX",   19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
752   //
753   //    Getter 
754   AliMedium(20, "GETTER", 20, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
755   //
756   //   AlBe - Aloy 
757   AliMedium(21, "AlBe"  , 21, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
758
759 }
760
761
762 void AliPIPEv0::Undulation(char *undul, Float_t pitch, Float_t thick,
763                         Float_t zundul, Float_t rundul, char (*cone)[5])
764 {
765   //
766   // RUNDUL   : Internal radius of the undulated chamber
767   // THICK    : material thickness
768   // PITCH    : one-QUARTER wave of undulation (cm)
769   // ZUNDUL   : half length (cm)
770   //
771   // The undulated structure is desgned as a superposition of eight CONES
772   // of suitable sizes, where the inner/outer radius of the cone increases,
773   // then decreases, each half of the wave is assumed to be a semicircle,
774   // which allows to calculate the thickness and the radii of the cone, by
775   // dividing the semicircle into 4 parts of equal arc length.
776   // Thus apear the constants 0.293 and 0.707.
777   //
778
779   const Float_t kConst1 = .293;
780   const Float_t kConst2 = .707;
781
782   // Local variables
783   Int_t j, nwave;
784   Float_t dcone1[5], dcone2[5], dcone3[5], dcone4[5], dcone5[5],
785     dcone6[5], dcone7[5], dcone8[5];
786   Float_t xc, yc, zc, dundul[3];
787   Int_t *idtmed = fIdtmed->GetArray()-1999;
788
789   // Function Body
790
791   dcone1[0] = kConst1 * pitch / 2;
792   dcone1[1] = rundul;
793   dcone1[2] = dcone1[1] + thick;
794   dcone1[3] = dcone1[1] + kConst2 * pitch;
795   dcone1[4] = dcone1[3] + thick;
796
797   dcone2[0] = kConst2 * pitch / 2;
798   dcone2[1] = dcone1[3];
799   dcone2[2] = dcone1[4];
800   dcone2[3] = dcone2[1] + kConst1 * pitch;
801   dcone2[4] = dcone2[3] + thick;
802
803   dcone3[0] = dcone2[0];
804   dcone3[1] = dcone2[3];
805   dcone3[2] = dcone2[4];
806   dcone3[3] = dcone2[1];
807   dcone3[4] = dcone2[2];
808
809   dcone4[0] = dcone1[0];
810   dcone4[1] = dcone1[3];
811   dcone4[2] = dcone1[4];
812   dcone4[3] = dcone1[1];
813   dcone4[4] = dcone1[2];
814
815   dcone5[0] = dcone1[0];
816   dcone5[1] = dcone1[1] - thick;
817   dcone5[2] = dcone1[1];
818   dcone5[3] = dcone5[1] - kConst2 * pitch;
819   dcone5[4] = dcone5[3] + thick;
820
821   dcone6[0] = dcone2[0];
822   dcone6[1] = dcone5[3];
823   dcone6[2] = dcone5[4];
824   dcone6[3] = dcone6[1] - kConst1 * pitch;
825   dcone6[4] = dcone6[3] + thick;
826   dcone7[0] = dcone6[0];
827   dcone7[1] = dcone6[3];
828   dcone7[2] = dcone6[4];
829   dcone7[3] = dcone5[3];
830   dcone7[4] = dcone5[4];
831
832   dcone8[0] = dcone5[0];
833   dcone8[1] = dcone7[3];
834   dcone8[2] = dcone7[4];
835   dcone8[3] = dcone5[1];
836   dcone8[4] = dcone5[2];
837
838   gMC->Gsvolu(cone[0], "CONE", idtmed[2018], dcone1, 5);
839   gMC->Gsvolu(cone[1], "CONE", idtmed[2018], dcone2, 5);
840   gMC->Gsvolu(cone[2], "CONE", idtmed[2018], dcone3, 5);
841   gMC->Gsvolu(cone[3], "CONE", idtmed[2018], dcone4, 5);
842   gMC->Gsvolu(cone[4], "CONE", idtmed[2018], dcone5, 5);
843   gMC->Gsvolu(cone[5], "CONE", idtmed[2018], dcone6, 5);
844   gMC->Gsvolu(cone[6], "CONE", idtmed[2018], dcone7, 5);
845   gMC->Gsvolu(cone[7], "CONE", idtmed[2018], dcone8, 5);
846   gMC->Gsatt(cone[0], "SEEN", 0);
847   gMC->Gsatt(cone[1], "SEEN", 0);
848   gMC->Gsatt(cone[2], "SEEN", 0);
849   gMC->Gsatt(cone[3], "SEEN", 0);
850   gMC->Gsatt(cone[4], "SEEN", 0);
851   gMC->Gsatt(cone[5], "SEEN", 0);
852   gMC->Gsatt(cone[6], "SEEN", 0);
853   gMC->Gsatt(cone[7], "SEEN", 0);
854
855   // DEFINE AN IMAGINARY TUBE VOLUME FOR UNDULATED CHAMBER, FILL WITH VACUUM
856
857   nwave = Int_t (zundul / (pitch * 2) + .1);
858   dundul[2] = pitch * 2 * nwave;
859   dundul[1] = rundul + pitch + thick * 2;
860   //
861   dundul[0] = 2.9;
862   gMC->Gsvolu(undul, "TUBE", idtmed[2015], dundul, 3);
863
864   xc = 0;
865   yc = 0;
866   zc = -dundul[2] + dcone1[0];
867   for (j = 1; j <= nwave; ++j) {
868     gMC->Gspos(cone[0], j, undul, xc, yc, zc, 0, "ONLY");
869     zc = zc + dcone1[0] + dcone2[0];
870     gMC->Gspos(cone[1], j, undul, xc, yc, zc, 0, "ONLY");
871     zc = zc + dcone2[0] + dcone3[0];
872     gMC->Gspos(cone[2], j, undul, xc, yc, zc, 0, "ONLY");
873     zc = zc + dcone3[0] + dcone4[0];
874     gMC->Gspos(cone[3], j, undul, xc, yc, zc, 0, "ONLY");
875     zc = zc + dcone4[0] + dcone5[0];
876     gMC->Gspos(cone[4], j, undul, xc, yc, zc, 0, "ONLY");
877     zc = zc + dcone5[0] + dcone6[0];
878     gMC->Gspos(cone[5], j, undul, xc, yc, zc, 0, "ONLY");
879     zc = zc + dcone6[0] + dcone7[0];
880     gMC->Gspos(cone[6], j, undul, xc, yc, zc, 0, "ONLY");
881     zc = zc + dcone7[0] + dcone8[0];
882     gMC->Gspos(cone[7], j, undul, xc, yc, zc, 0, "ONLY");
883     zc = zc + dcone8[0] + dcone1[0];
884   }
885 }
886
887
888
889
890
891
892
893
894
895
896