polish
[u/mrichter/AliRoot.git] / STRUCT / AliSHILvF.cxx
CommitLineData
5aba2f60 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*/
19
20
21#include "AliSHILvF.h"
22#include "AliRun.h"
a0cb6c86 23#include "AliMC.h"
5aba2f60 24#include "AliConst.h"
25#include "AliALIFE.h"
26
27ClassImp(AliSHILvF)
28
29//_____________________________________________________________________________
30AliSHILvF::AliSHILvF()
31{
32 //
33 // Default constructor for muon shield
34 //
35}
36
37//_____________________________________________________________________________
38AliSHILvF::AliSHILvF(const char *name, const char *title)
39 : AliSHIL(name,title)
40{
41 //
42 // Standard constructor for muon shield
43 //
44 SetMarkerColor(7);
45 SetMarkerStyle(2);
46 SetMarkerSize(0.4);
47 // Pb cone not yet compatible with muon chamber inner radii
48 // Switched off by default
49 fPbCone=kFALSE;
50}
51
52//_____________________________________________________________________________
53void AliSHILvF::CreateGeometry()
54{
55 //
56 // Build muon shield geometry
57 //
58 //
59 //Begin_Html
60 /*
61 <img src="picts/AliSHILvF.gif">
62 */
63 //End_Html
64 //Begin_Html
65 /*
66 <img src="picts/AliSHILvFTree.gif">
67 */
68 //End_Html
69
70 Float_t cpar[5], cpar0[5], tpar[3], par1[39], par2[27], par3[27],
a0cb6c86 71 par4[21], par0[45];
5aba2f60 72 Float_t dz, dZ;
73
74 Int_t *idtmed = fIdtmed->GetArray()-1699;
75
76#include "ABSOSHILConst.h"
77#include "SHILConst.h"
78
79enum {kC=1705, kAl=1708, kFe=1709, kCu=1710, kW=1711, kPb=1712,
80 kNiCuW=1720, kVacuum=1714, kAir=1714, kConcrete=1716,
81 kPolyCH2=1717, kSteel=1709, kInsulation=1713};
82//
83// Material of the rear part of the shield
84 Int_t iHeavy=kNiCuW;
85 if (fPbCone) iHeavy=kPb;
86//
87//
88// begin Fluka
89 AliALIFE* flukaGeom = new AliALIFE("beamshield.alife", "beamshield_vol.inp");
90 Int_t ifl=0;
91 Float_t posfluka[3]={0., 0., 0.};
92 Float_t zfluka[12], rfluka1[12], rfluka2[12], rfluka3[12] ;
93//
94// end Fluka
95
96
97//
98// Mother volume
99//
100 Float_t dRear1=dRear;
101
102 Float_t zstart=zRear-dRear1;
103
104 par0[0] = 0.;
105 par0[1] = 360.;
106 par0[2] = 13.;
107
108 Float_t dl=(zvac12-zstart)/2.;
109 dz=zstart+dl;
110//
111 par0[3] = -dl;
112 par0[4] = 0.;
113 par0[5] = zstart * TMath::Tan(accMin);
114
115 par0[6] = -dl+dRear1;
116 par0[7] = 0.;
117 par0[8] = zRear * TMath::Tan(accMin);
118
119 par0[9] = -dl+dRear1;
120 par0[10] = 0.;
121 par0[11] = R11;
122
123 par0[12] = -dz+zvac4;
124 par0[13] = 0.;
125 par0[14] = R11;
126
127 par0[15] = -dz+zvac4;
128 par0[16] = 0.;
129 par0[17] = R21;
130
131 par0[18] = -dz+zvac6;
132 par0[19] = 0.;
133 par0[20] = R21;
134
135 par0[21] = -dz+zvac6;
136 par0[22] = 0.;
137 par0[23] = zvac6 * TMath::Tan(accMin);
138
139 par0[24] = -dz+zConeE;
140 par0[25] = 0.;
141 par0[26] = 30.;
142
143 par0[27] = -dz+zvac10;
144 par0[28] = 0.;
145 par0[29] = 30.;
146
147 par0[30] = -dz+zvac10;
148 par0[31] = 0.;
149 par0[32] = R42;
150
151 par0[33] = -dz+zvac11;
152 par0[34] = 0.;
153 par0[35] = R42;
154
155 par0[36] = -dz+zvac11;
156 par0[37] = 0.;
157 par0[38] = R43;
158
159 par0[39] = -dz+zvac12;
160 par0[40] = 0.;
161 par0[41] = R43;
162
163 gMC->Gsvolu("YMOT", "PCON", idtmed[kVacuum], par0, 42);
164 dz=zstart+dl;
165 gMC->Gspos("YMOT", 1, "ALIC", 0., 0., dz, 0, "ONLY");
166//
167
168 dZ=-dl;
169
170//
171// First section: bellows below and behind front absorber
172//
173//
174 par1[0] = 0.;
175 par1[1] = 360.;
176 par1[2] = 12.;
177 dl=(zvac4-zstart)/2.;
178
179 par1[3] = -dl;
180 par1[4] = rAbs+(zstart-zOpen) * TMath::Tan(thetaOpen1);
181 par1[5] = zstart * TMath::Tan(accMin);
182
183 par1[6] = -dl+zvac1-zstart;
184 par1[7] = rAbs+ (zvac1-zOpen) * TMath::Tan(thetaOpen1);
185 par1[8] = zvac1 * TMath::Tan(accMin);
186
187 par1[9] = par1[6]+dr11;
188 par1[10] = par1[7]+dr11;
189 par1[11] = (zvac1+dr11) * TMath::Tan(accMin);
190
191 par1[12] = -dl+dRear1;
192 par1[13] = par1[10];
193 par1[14] = zRear * TMath::Tan(accMin);
194
195 par1[15] = -dl+dRear1;
196 par1[16] = par1[10];
197 par1[17] = R11;
198
199 par1[18] = -dl+(zvac1+dr11+dB1-zstart);
200 par1[19] = par1[16];
201 par1[20] = R11;
202
203 par1[21] = par1[18]+dr12;
204 par1[22] = par1[19]+dr12;
205 par1[23] = R11;
206
207 par1[24] = par1[21]+dF1;
208 par1[25] = par1[22];
209 par1[26] = R11;
210
211 par1[27] = par1[24]+dr12;
212 par1[28] = par1[25]-dr12;
213 par1[29] = R11;
214
215 par1[30] = par1[27]+dB1;
216 par1[31] = par1[28];
217 par1[32] = R11;
218
219 par1[33] = par1[30]+dr13;
a0cb6c86 220 par1[34] = par1[31];
5aba2f60 221 par1[35] = R11;
222
223 par1[36] = -dl+zvac4-zstart;
a0cb6c86 224 par1[37] = par1[34];
5aba2f60 225 par1[38] = R11;
226
a0cb6c86 227 Float_t r2 = par1[34];
228 Float_t rBox= par1[31]-0.1;
5aba2f60 229 Float_t rc1 = par1[7];
230
231 gMC->Gsvolu("YGO1", "PCON", idtmed[kNiCuW], par1, 39);
232
233//
234// begin Fluka
235 for (ifl=0; ifl<12; ifl++) {
236 zfluka[ifl]=par1[3+3*ifl]+dl+zRear-dRear;
237 rfluka1[ifl] = par1[4+3*ifl];
238 rfluka2[ifl] = par1[5+3*ifl];
239 if (ifl > 3) rfluka2[ifl]=rfluka2[ifl]-dRSteel1;
240 }
241
242
243 Float_t rfluka0[8]={rBox,rBox,rBox,rBox,rBox,rBox,rBox,rBox};
244
245 flukaGeom->Comment("1st part: Shield");
246// Use default for first three cones
247 flukaGeom->SetDefaultVolume("*ACR02");
248 rfluka2[0]=rfluka2[1]=rfluka2[2]=-1;
249//
250 flukaGeom->Comment("Shield");
251 flukaGeom->PolyCone(rfluka1, rfluka2, zfluka, 12, posfluka, "NIW", "MF", "$SHS");
252 flukaGeom->Comment("Vacuum");
a0cb6c86 253 flukaGeom->PolyCone(rfluka0, rfluka1+2, zfluka+2, 8, posfluka, "VACUUM", "MF", "$SHS");
5aba2f60 254//
255// end Fluka
256
257
258 { // Begin local scope for i
259 for (Int_t i=4; i<38; i+=3) par1[i] = 0;
260 } // End local scope for i
261 gMC->Gsvolu("YMO1", "PCON", idtmed[kVacuum+40], par1, 39);
262 gMC->Gspos("YGO1", 1, "YMO1", 0., 0., 0., 0, "ONLY");
263 dZ+=dl;
264 gMC->Gspos("YMO1", 1, "YMOT", 0., 0., dZ, 0, "ONLY");
265 dZ+=dl;
266
267//
268// Steel envelope
269 tpar[0]=R11-dRSteel1;
270 tpar[1]=R11;
271 tpar[2]=dl-dRear1/2;
272 gMC->Gsvolu("YSE1", "TUBE", idtmed[kNiCuW], tpar, 3);
273 dz=dl-tpar[2];
274 gMC->Gspos("YSE1", 1, "YGO1", 0., 0., dz, 0, "ONLY");
275
276// begin Fluka
277 flukaGeom->Comment("1st part: Steel Envelope");
278 flukaGeom->Cylinder(tpar[0], tpar[1], zRear, zvac4, posfluka, "NIW", "MF", "$SHS");
279//
280// end Fluka
281
282//
283// 1st section: vacuum system
284//
285//
286// Bellow 1
287//
288 tpar[0]=rB1;
289 tpar[1]=rB1+hB1;
290 tpar[2]=eB1/2.;
291 gMC->Gsvolu("YB11", "TUBE", idtmed[kSteel+40], tpar, 3);
292 Float_t dl1=tpar[2];
293
294 tpar[0]=rB1+hB1-eB1;
295 tpar[1]=rB1+hB1;
296 tpar[2]=(lB1/2.-2.*eB1)/2.;
297 gMC->Gsvolu("YB12", "TUBE", idtmed[kSteel+40], tpar, 3);
298 Float_t dl2=tpar[2];
299
300 tpar[0]=rB1-eB1;
301 tpar[1]=rB1;
302 tpar[2]=lB1/8.;
303 gMC->Gsvolu("YB13", "TUBE", idtmed[kSteel+40], tpar, 3);
304 Float_t dl3=tpar[2];
305
306
307 tpar[0]=0;
308 tpar[1]=rB1+hB1;
309 tpar[2]=lB1/2.;
310 gMC->Gsvolu("YBU1", "TUBE", idtmed[kVacuum+40], tpar, 3);
311
312 dz=-tpar[2]+dl3;
313 gMC->Gspos("YB13", 1, "YBU1", 0., 0., dz, 0, "ONLY");
314 dz+=dl3;
315 dz+=dl1;
316 gMC->Gspos("YB11", 1, "YBU1", 0., 0., dz, 0, "ONLY");
317 dz+=dl1;
318 dz+=dl2;
319 gMC->Gspos("YB12", 1, "YBU1", 0., 0., dz, 0, "ONLY");
320 dz+=dl2;
321 dz+=dl1;
322 gMC->Gspos("YB11", 2, "YBU1", 0., 0., dz, 0, "ONLY");
323 dz+=dl1;
324 dz+=dl3;
325 gMC->Gspos("YB13", 2, "YBU1", 0., 0., dz, 0, "ONLY");
326
327
328 tpar[0]=0;
329 tpar[1]=rB1+hB1;
330 tpar[2]=10.*lB1/2.;
331 gMC->Gsvolu("YBM1", "TUBE", idtmed[kVacuum+40], tpar, 3);
332 dz=-tpar[2]+lB1/2.;
333 { // Begin local scope for i
334 for (Int_t i=0; i<10; i++) {
335 gMC->Gspos("YBU1", i+1 , "YBM1", 0., 0., dz, 0, "ONLY");
336 dz+=lB1;
337 }
338 } // End local scope for i
339 dz=-dl+(zvac1-zstart)+dr11+tpar[2];
340 gMC->Gspos("YBM1", 1, "YMO1", 0., 0., dz, 0, "ONLY");
341
342 dz=dl-dr13-(zvac4-zvac3)-tpar[2];
343 gMC->Gspos("YBM1", 2, "YMO1", 0., 0., dz, 0, "ONLY");
344
345//
346// Flange
347
348 tpar[0]=0;
349 tpar[1]=rF1;
350 tpar[2]=dF1/2.;
351 gMC->Gsvolu("YFM1", "TUBE", idtmed[kVacuum+40], tpar, 3);
352
353 tpar[0]=rF1-2.;
354 tpar[1]=rF1;
355 tpar[2]=dF1/2.;
356 gMC->Gsvolu("YF11", "TUBE", idtmed[kSteel+40], tpar, 3);
357 gMC->Gspos("YF11", 1, "YFM1", 0., 0., 0., 0, "ONLY");
358
359 tpar[0]=rB1;
360 tpar[1]=rF1-2.;
361 tpar[2]=dFlange/2.;
362 gMC->Gsvolu("YF12", "TUBE", idtmed[kSteel+40], tpar, 3);
363 dz=-dF1/2.+tpar[2];
364 gMC->Gspos("YF12", 1, "YFM1", 0., 0., dz, 0, "ONLY");
365 dz= dF1/2.-tpar[2];
366 gMC->Gspos("YF12", 2, "YFM1", 0., 0., dz, 0, "ONLY");
367
368 dz=-dl+(zvac2-zstart);
369 gMC->Gspos("YFM1", 2, "YMO1", 0., 0., dz, 0, "ONLY");
370
371//
372// pipe between flange and bellows
373 tpar[0]=rB1-dTubeS;
374 tpar[1]=rB1;
375 tpar[2]=2.*(dB1+dr12-10.*lB1)/4.;
376 gMC->Gsvolu("YPF1", "TUBE", idtmed[kSteel+40], tpar, 3);
377
378 dz=-dl+(zvac2-zstart)-dF1/2.-tpar[2];
379 gMC->Gspos("YPF1", 1, "YMO1", 0., 0., dz, 0, "ONLY");
380 dz=-dl+(zvac2-zstart)+dF1/2.+tpar[2];
381 gMC->Gspos("YPF1", 2, "YMO1", 0., 0., dz, 0, "ONLY");
382
383//
384// begin Fluka
385 flukaGeom->Comment("First Bellow");
386 Float_t z1=zvac1+dr11;
387 Float_t z2;
388
389 for (Int_t i=0; i<10; i++) {
390 z2=z1+eB1;
391 flukaGeom->Cylinder(0., rB1, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
392 flukaGeom->Cylinder(rB1, rB1+hB1, z1, z2, posfluka, "STEEL", "MF", "$SHH");
393
394 z1=z2;
395 z2+=lB1/2.-eB1;
396 flukaGeom->Cylinder(0., rB1+hB1-eB1, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
397 flukaGeom->Cylinder(rB1+hB1-eB1, rB1+hB1, z1, z2, posfluka, "STEEL", "MF", "$SHH");
398 z1=z2;
399 z2=z1+eB1;
400 flukaGeom->Cylinder(0., rB1, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
401 flukaGeom->Cylinder(rB1, rB1+hB1, z1, z2, posfluka, "STEEL", "MF", "$SHH");
402 z1=z2;
403 z2+=lB1/2.-eB1;
404 flukaGeom->Cylinder(0., rB1, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
405 flukaGeom->Cylinder(rB1, rB1+eB1, z1, z2, posfluka, "STEEL", "MF", "$SHH");
406 flukaGeom->Cylinder(rB1+eB1, rB1+hB1, z1, z2, posfluka, "AIR", "MF", "$SHH");
407 z1=z2;
408 }
409 flukaGeom->Cylinder(rB1+hB1, rB1+hB1+0.5, zvac1+dr11, z1, posfluka, "AIR", "MF", "$SHH");
410 flukaGeom->Cylinder(rB1+hB1+0.5, rBox, zvac1+dr11, z1, posfluka, "AIR", "MF", "$SHH");
411 Float_t zcy1=z1;
412
413
414 flukaGeom->Comment("Second Bellow");
415 z1=zvac3-dr13;
416 for (Int_t i=0; i<10; i++) {
417 z2=z1-eB1;
418 flukaGeom->Cylinder(0., rB1, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
419 flukaGeom->Cylinder(rB1, rB1+hB1, z2, z1, posfluka, "STEEL", "MF", "$SHH");
420 z1=z2;
421 z2-=lB1/2.-eB1;
422 flukaGeom->Cylinder(0., rB1+hB1-eB1, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
423 flukaGeom->Cylinder(rB1+hB1-eB1, rB1+hB1, z2, z1, posfluka, "STEEL", "MF", "$SHH");
424 z1=z2;
425 z2=z1-eB1;
426 flukaGeom->Cylinder(0., rB1, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
427 flukaGeom->Cylinder(rB1, rB1+hB1, z2, z1, posfluka, "STEEL", "MF", "$SHH");
428 z1=z2;
429 z2-=lB1/2.-eB1;
430 flukaGeom->Cylinder(0., rB1, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
431 flukaGeom->Cylinder(rB1, rB1+eB1, z2, z1, posfluka, "STEEL", "MF", "$SHH");
432 flukaGeom->Cylinder(rB1+eB1, rB1+hB1, z2, z1, posfluka, "AIR", "MF", "$SHH");
433 z1=z2;
434 }
435 flukaGeom->Cylinder(rB1+hB1, rB1+hB1+0.5, z1, zvac3-dr13, posfluka, "AIR", "MF", "$SHH");
436 flukaGeom->Cylinder(rB1+hB1+0.5, rBox, z1, zvac3-dr13, posfluka, "AIR", "MF", "$SHH");
437
438 Float_t zcy2=z1;
439 flukaGeom->Comment("Flange");
440 Float_t zfl=(zcy1+zcy2)/2.;
441
442 z1=zfl-dF1/2.;
443 z2=zfl+dF1/2.;
444 flukaGeom->Cylinder(0.,rF1-2. , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
445 flukaGeom->Cylinder(rF1-2., rF1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
a0cb6c86 446 flukaGeom->Cylinder(rF1, rF1+0.05 , z1, z2, posfluka, "AIR", "MF", "$SHH");
447 flukaGeom->Cylinder(rF1+0.05, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
5aba2f60 448 z2=z1;
449 z1=z2-dFlange;
450 flukaGeom->Cylinder(0.,rB1 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
451 flukaGeom->Cylinder(rB1, rF1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
452 flukaGeom->Cylinder(rF1, rF1+0.5 , z1, z2, posfluka, "AIR", "MF", "$SHH");
453 flukaGeom->Cylinder(rF1+0.5, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
454 z2=z1;
455 z1=zcy1;
456 flukaGeom->Cylinder(0.,rB1 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
457 flukaGeom->Cylinder(rB1, rB1+0.1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
458 flukaGeom->Cylinder(rB1+0.1, rB1+0.6 , z1, z2, posfluka, "AIR", "MF", "$SHH");
459 flukaGeom->Cylinder(rB1+0.6, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
460
461 z1=zfl+dF1/2.;
462 z2=z1+dFlange;
463 flukaGeom->Cylinder(0.,rB1 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
464 flukaGeom->Cylinder(rB1, rF1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
465 flukaGeom->Cylinder(rF1, rF1+0.5 , z1, z2, posfluka, "AIR", "MF", "$SHH");
466 flukaGeom->Cylinder(rF1+0.5, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
467 z1=z2;
468 z2=zcy2;
469 flukaGeom->Cylinder(0.,rB1 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
470 flukaGeom->Cylinder(rB1, rB1+0.1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
471 flukaGeom->Cylinder(rB1+0.1, rB1+0.6 , z1, z2, posfluka, "AIR", "MF", "$SHH");
472 flukaGeom->Cylinder(rB1+0.6, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
473// end Fluka
474//
475
476// pipe and heating jackets outside bellows
477//
478// left side
479 cpar0[0]=(zvac1-zstart)/2;
480 cpar0[1]=rVacu+(zstart-zOpen)*TMath::Tan(thetaOpen1)-0.05;
481 cpar0[2]=rAbs +(zstart-zOpen)*TMath::Tan(thetaOpen1);
482 cpar0[3]=cpar0[1]+2.*cpar0[0]*TMath::Tan(thetaOpen1);
483 cpar0[4]=cpar0[2]+2.*cpar0[0]*TMath::Tan(thetaOpen1);
484 gMC->Gsvolu("YV11", "CONE", idtmed[kSteel+40], cpar0, 5);
485//
486// insulation
487 dTubeS=0.15;
488 cpar[0]=cpar0[0];
489 cpar[1]=cpar0[1]+0.15;
490 cpar[2]=cpar0[1]+0.65;
491 cpar[3]=cpar0[3]+0.15;
492 cpar[4]=cpar0[3]+0.65;
493 gMC->Gsvolu("YI11", "CONE", idtmed[kInsulation+40], cpar, 5);
494 gMC->Gspos("YI11", 1, "YV11", 0., 0., 0., 0, "ONLY");
495//
496// clearance
497 cpar[1]=cpar0[1]+0.75;
498 cpar[2]=cpar0[1]+1.25;
499 cpar[3]=cpar0[3]+0.75;
500 cpar[4]=cpar0[3]+1.25;
501 gMC->Gsvolu("YP11", "CONE", idtmed[kVacuum+40], cpar, 5);
502 gMC->Gspos("YP11", 1, "YV11", 0., 0., 0., 0, "ONLY");
503
504 dz=-dl+cpar0[0];
505 gMC->Gspos("YV11", 1, "YMO1", 0., 0., dz, 0, "ONLY");
506
507// begin Fluka
508//
509 Float_t rf1[10], rf2[10];
510 rf1[0]=0.; rf2[0]=0.;
511 rf1[1] = cpar0[1];
512 rf2[1] = cpar0[3];
513
514
515 rf1[2]=rf1[1]+0.15; rf1[3]=rf1[2]+0.5; rf1[4]=rf1[3]+0.1;
516 rf1[5]=rf1[4]+0.5;
517 rf2[2]=rf2[1]+0.15; rf2[3]=rf2[2]+0.5; rf2[4]=rf2[3]+0.1;
518 rf2[5]=rf2[4]+0.5;
519
520 char* materialsA[7]
521 = {"VACUUM", "STEEL", "PIPEINSU", "STEEL", "AIR", "AIR"};
522 char* fieldsA[7]
523 = {"MF", "MF", "MF", "MF", "MF", "MF"};
524 char* cutsA[7]
525 = {"$SHH","$SHH","$SHH","$SHH","$SHH","$SHH","$SHH"};
526
527 flukaGeom->Comment("1st part: Beam pipe lateral struture (left)");
528 flukaGeom->OnionCone(rf1, rf2, 6 , zstart, zvac1, posfluka, materialsA, fieldsA, cutsA);
529 for (Int_t i=0; i<7; i++) rf1[i]=rf2[i];
530 for (Int_t i=1; i<7; i++) rf2[i]=rf1[i]+dr11*TMath::Tan(thetaOpen1);
531 flukaGeom->OnionCone(rf1, rf2, 6 , zvac1, zvac1+dr11, posfluka, materialsA, fieldsA, cutsA);
532 flukaGeom->Cone(rc1, rf2[5], rc1, rc1+dr11, zvac1 , zvac1+dr11, posfluka,"AIR", "MF", "$SHH");
533//
534// end Fluka
535
536
537// right side
538 dTubeS=0.35;
539 dVacuS+=0.25;
540
541 cpar0[0]=(zvac4-zvac3)/2;
542 cpar0[1]=rB1;
543 cpar0[2]=cpar0[1]+dVacuS;
544
545 cpar0[3]=cpar0[1]+2.*cpar0[0]*TMath::Tan(thetaOpenB);
546 cpar0[4]=cpar0[2]+2.*cpar0[0]*TMath::Tan(thetaOpenB);
547 gMC->Gsvolu("YV12", "CONE", idtmed[kSteel], cpar0, 5);
548 Float_t r2V=cpar0[3];
549//
550// insulation
551 cpar[0]=cpar0[0];
552 cpar[1]=cpar0[1]+dTubeS;
553 cpar[2]=cpar0[1]+dTubeS+dInsuS;
554 cpar[3]=cpar0[3]+dTubeS;
555 cpar[4]=cpar0[3]+dTubeS+dInsuS;
556 gMC->Gsvolu("YI12", "CONE", idtmed[kInsulation], cpar, 5);
557 gMC->Gspos("YI12", 1, "YV12", 0., 0., 0., 0, "ONLY");
558
559//
560// clearance
561 cpar[1]=cpar0[1]+dTubeS+dInsuS+dEnveS;
562 cpar[2]=cpar0[1]+dTubeS+dInsuS+dEnveS+dFreeS;
563 cpar[3]=cpar0[3]+dTubeS+dInsuS+dEnveS;
564 cpar[4]=cpar0[3]+dTubeS+dInsuS+dEnveS+dFreeS;
565 gMC->Gsvolu("YP12", "CONE", idtmed[kAir], cpar, 5);
566 gMC->Gspos("YP12", 1, "YV12", 0., 0., 0., 0, "ONLY");
567
568 dz=dl-cpar0[0];
569 gMC->Gspos("YV12", 1, "YMO1", 0., 0., dz, 0, "ONLY");
570
571//
572// begin Fluka
573 char* materialsB[8]
574 = {"VACUUM", "STEEL", "PIPEINSU", "STEEL", "AIR", "STEEL", "AIR"};
575
576 char* fieldsB[8]
577 = {"MF", "MF", "MF", "MF", "MF", "MF", "MF"};
578
579 char* cutsB[8]
580 = {"$SHH","$SHH","$SHH","$SHH","$SHH","$SHH","$SHH", "$SHH"};
581
582 rf1[0]=rf2[0]=0.;
583 rf1[1]=cpar0[1];
584 rf2[1]=cpar0[3];
585
586 rf1[2]=rf1[1]+dTubeS; rf1[3]=rf1[2]+dInsuS; rf1[4]=rf1[3]+dEnveS;
587 rf1[5]=rf1[4]+dFreeS; rf1[6]=rf1[5]+dProtS; rf1[7]=r2;
588
589 rf2[2]=rf2[1]+dTubeS; rf2[3]=rf2[2]+dInsuS; rf2[4]=rf2[3]+dEnveS;
590 rf2[5]=rf2[4]+dFreeS; rf2[6]=rf2[5]+dProtS;
a0cb6c86 591 rf2[7]=r2;
5aba2f60 592 flukaGeom->Comment("1st part: Beam pipe lateral structure (right)");
593 flukaGeom->OnionCone(rf1, rf2, 8 , zvac3, zvac4, posfluka, materialsB, fieldsB, cutsB);
594 for (Int_t i=0; i<8; i++) rf2[i]=rf1[i];
a0cb6c86 595 for (Int_t i=1; i<7; i++) rf1[i]=rf2[i];
596 rf1[7]=rf2[7];
5aba2f60 597 flukaGeom->OnionCone(rf1, rf2, 8 , zvac3-dr13, zvac3, posfluka, materialsB, fieldsB, cutsB);
598//
599// end Fluka
600
601//
602// Second Section
603// Between first and second bellow section
604//
605
606 par2[0] = 0.;
607 par2[1] = 360.;
608 par2[2] = 7.;
609 dl=(zvac7-zvac4)/2.;
a0cb6c86 610// recess station 2
5aba2f60 611 par2[3] = -dl;
a0cb6c86 612 par2[4] = r2;
613 par2[5] = R21;
614
615 par2[6] = -dl+10.;
616 par2[7] = r2;
5aba2f60 617 par2[8] = R21;
618
a0cb6c86 619 par2[9] = -dl+(zvac6-zvac4);
620 par2[10] = r2+(zvac6-zvac4-10.) * TMath::Tan(thetaOpen2);
5aba2f60 621 par2[11] = R21;
622
623 par2[12] = -dl+(zvac6-zvac4);
624 par2[13] = par2[10];
625 par2[14] = zvac6*TMath::Tan(accMin);
626
627// Start of Pb section
628 par2[15] = -dl+(zPb-zvac4);
a0cb6c86 629 par2[16] = r2+(zPb-zvac4-10.) * TMath::Tan(thetaOpen2);
5aba2f60 630 par2[17] = zPb*TMath::Tan(accMin);
631
632//
633// end of cone following 2 deg line
634 par2[18] = -dl+(zConeE-zvac4);
a0cb6c86 635 par2[19] = r2+(zConeE-zvac4-10.) * TMath::Tan(thetaOpen2);
5aba2f60 636 par2[20] = 30.;
637
638 par2[21] = -dl+(zvac7-zvac4);
a0cb6c86 639 par2[22] = r2+(zvac7-zvac4-10.) * TMath::Tan(thetaOpen2);
5aba2f60 640 par2[23] = 30.;
641
642
a0cb6c86 643 gMC->Gsvolu("YGO2", "PCON", idtmed[kNiCuW+40], par2, 24);
5aba2f60 644
645//
646// begin Fluka
647 Float_t rfvacu0[8], rfvacu1[8], rfvacu2[8], rfvacu3[8], rfvacu4[8], rfvacu5[8];
648
649 for (ifl=0; ifl<7; ifl++) {
650 rfluka1[ifl] = par2[4+3*ifl];
651 rfluka2[ifl] = par2[5+3*ifl]-dRSteel2;
652 rfluka3[ifl] = par2[5+3*ifl];
653 rfvacu5[ifl] = r2V;
654 rfvacu4[ifl]=rfvacu5[0]+dTubeS;
655 rfvacu3[ifl]=rfvacu4[0]+dInsuS;
656 rfvacu2[ifl]=rfvacu3[0]+dEnveS;
657 rfvacu1[ifl]=rfvacu2[0]+dFreeS;
658 rfvacu0[ifl]=rfvacu1[0]+dProtS;
659 }
660
661 char* materials1[11]
662 = {"VACUUM", "STEEL", "PIPEINSU", "STEEL", "AIR", "STEEL", "AIR", "NIW",
663 "NIW", "STEEL"};
664 char* fields1[11]
665 = {"MF", "MF", "MF", "MF", "MF", "MF", "MF", "MF", "MF", "MF", "MF"};
666 char* cuts1[11]
667 = {"$SHH","$SHH","$SHH","$SHH","$SHH","$SHH","$SHH", "$SHH","$SHH","$SHS", "$SHS"};
668
669
670 rf1[0]=0.; rf1[1]=rfvacu5[0]; rf1[2]=rfvacu4[0]; rf1[3]=rfvacu3[0];
671 rf1[4]=rfvacu2[0]; rf1[5]=rfvacu1[0]; rf1[6]=rfvacu0[0];
672 rf1[7]=rfluka1[0]; rf1[9]=R11-dRSteel1;
673 rf1[10]=R21;
674 for (Int_t i=1; i<7; i++) rf2[i]=rf1[i]+4.*TMath::Tan(thetaOpenB);
a0cb6c86 675 rf2[7]=rf1[7];
5aba2f60 676 rf2[9]=rf1[9]; rf2[10]=rf1[10];
677 rf1[8]=13.;
678 rf2[8]=rf1[8]+4.*TMath::Tan(thetaOpenPb);
679
a0cb6c86 680 flukaGeom->Comment("2nd part: Beam pipe lateral struture (0)");
5aba2f60 681 flukaGeom->OnionCone(rf1, rf2, 11 , zvac4, zvac4+4, posfluka, materials1, fields1, cuts1);
682
683
684 for (Int_t i=0; i<11; i++) rf1[i]=rf2[i];
685 for (Int_t i=1; i<7; i++)
a0cb6c86 686 rf2[i]=rf1[i]+20.*TMath::Tan(thetaOpenB);
687 rf2[7]=rf1[7];
688 rf2[8]=rf1[8]+20.*TMath::Tan(thetaOpenPb);
689 rf1[9]=R21-dRSteel2;
690 rf1[10]=R21;
691 rf2[9]=R21-dRSteel2;
692 rf2[10]=R21;
693 flukaGeom->Comment("2nd part: Beam pipe lateral struture (1)");
694 flukaGeom->OnionCone(rf1, rf2, 11 , zvac4+4, zvac4+24, posfluka, materials1, fields1, cuts1);
695
696 for (Int_t i=0; i<11; i++) rf1[i]=rf2[i];
697 for (Int_t i=1; i<7; i++)
698 rf2[i]=rf1[i]+(zvac6-zvac4-24.)*TMath::Tan(thetaOpenB);
699 rf2[7]=rf1[7]+(zvac6-zvac4-24.)*TMath::Tan(thetaOpen2);
700 rf2[8]=rf1[8]+(zvac6-zvac4-24.)*TMath::Tan(thetaOpenPb);
5aba2f60 701 rf1[9]=R21-dRSteel2;
702 rf1[10]=R21;
703 rf2[9]=R21-dRSteel2;
704 rf2[10]=R21;
705 flukaGeom->Comment("2nd part: Beam pipe lateral struture (2)");
a0cb6c86 706 flukaGeom->OnionCone(rf1, rf2, 11 , zvac4+24, zvac6, posfluka, materials1, fields1, cuts1);
5aba2f60 707
708 for (Int_t i=0; i<11; i++) rf1[i]=rf2[i];
709 for (Int_t i=1; i<7; i++)
710 rf2[i]=rf1[i]+4.*TMath::Tan(thetaOpenB);
711 rf2[7]=rf1[7]+4.*TMath::Tan(thetaOpen2);
712
713 rf2[8]=rf1[8]+4.*TMath::Tan(thetaOpenPb);
714 rf1[9]=R21-dRSteel2;
715 rf2[9]=R21-dRSteel2;
716 rf1[10]=1;
717 rf2[10]=-1;
718 flukaGeom->Comment("2nd part: Beam pipe lateral struture (3)");
719 flukaGeom->OnionCone(rf1, rf2, 11 , zvac6, zvac6+4, posfluka, materials1, fields1, cuts1);
720
721
722 for (Int_t i=0; i<11; i++) rf1[i]=rf2[i];
723 for (Int_t i=1; i<7; i++)
724 rf2[i]=rf1[i]+(zPb-(zvac6-4.))*TMath::Tan(thetaOpenB);
725 rf2[7]=rf1[7]+(zPb-(zvac6-4.))*TMath::Tan(thetaOpen2);
726
727 rf2[8]=rf1[8]+(zPb-(zvac6-4.))*TMath::Tan(thetaOpenPb);
728 rf1[9]=(zvac6+4)*TMath::Tan(accMin)-dRSteel2;
729 rf2[9]=zPb*TMath::Tan(accMin)-dRSteel2;
730 rf1[10]=1.;
731 rf2[10]=-1.;
732 flukaGeom->Comment("2nd part: Beam pipe lateral struture (4)");
733 flukaGeom->OnionCone(rf1, rf2, 11 , zvac6+4, zPb, posfluka, materials1, fields1, cuts1);
734
735
736 for (Int_t i=0; i<11; i++) rf1[i]=rf2[i];
737 for (Int_t i=1; i<7; i++)
738 rf2[i]=rf1[i]+(zConeE-zPb)*TMath::Tan(thetaOpenB);
739 rf2[7]=rf1[7]+(zConeE-zPb)*TMath::Tan(thetaOpen2);
740 rf1[8]=rf2[8]+2.;
741 rf2[8]=rf1[8]+(zConeE-zPb)*TMath::Tan(thetaOpenPb);
742 rf1[9]=zPb*TMath::Tan(accMin)-dRSteel2;
743 rf2[9]=30.-dRSteel2;
744 rf1[10]=1.;
745 rf2[10]=-1.;
746 flukaGeom->Comment("2nd part: Beam pipe lateral struture (5)");
747 if (fPbCone) materials1[7] = "LEAD";
748 materials1[8]="LEAD";
749 flukaGeom->OnionCone(rf1, rf2, 11 , zPb, zConeE, posfluka, materials1, fields1, cuts1);
750
751 for (Int_t i=0; i<11; i++) rf1[i]=rf2[i];
752 for (Int_t i=1; i<7; i++)
753 rf2[i]=rf1[i]+(zvac7-zConeE)*TMath::Tan(thetaOpenB);
754 rf2[7]=rf1[7]+(zvac7-zConeE)*TMath::Tan(thetaOpen2);
755
756 rf1[8]=rf2[8];
757 rf2[8]=rf1[8]+(zvac7-zConeE)*TMath::Tan(thetaOpenPb);
758 rf1[9]=30.-dRSteel2;
759 rf2[9]=30.-dRSteel2;
760 rf1[10]=30.;
761 rf2[10]=30.;
762 flukaGeom->Comment("2nd part: Beam pipe lateral struture (6)");
a0cb6c86 763 flukaGeom->OnionCone(rf1, rf2, 10 , zConeE, zvac7, posfluka, materials1, fields1, cuts1);
764// Steel envelope and recesses for station 3
765 flukaGeom->Comment("Steel envelope and recesses for station 3");
766 flukaGeom->Cylinder(rf1[9],rf1[10], zConeE, zch31, posfluka, materials1[9], fields1[9], cuts1[9]);
767 flukaGeom->Cylinder(rf1[9], rf1[10]-1, zch31, zch32, posfluka, materials1[9], fields1[9], cuts1[9]);
768 flukaGeom->Cylinder(rf1[10]-1, rf1[10], zch31, zch32, posfluka, "AIR", fields1[9], cuts1[9]);
769 flukaGeom->Cylinder(rf1[9], rf1[10], zch32, zvac7, posfluka, materials1[9], fields1[9], cuts1[9]);
5aba2f60 770
771 Float_t r3V = rf2[1];
772
773// end Fluka
774
775//
776// Lead cone option replacing Tungsten
777//
778 Float_t parPb[12];
779 parPb[0] = 0.;
780 parPb[1] = 360.;
781 parPb[2] = 3.;
782 Float_t dlPb=(zvac7-zPb)/2.;
783
784 parPb[3] = -dlPb;
785 parPb[4] = 17.657;
786 parPb[5] = zPb*TMath::Tan(accMin);
787
788 parPb[6] = -dlPb+(zConeE-zPb);
789 parPb[7] = parPb[4]+(zConeE-zPb)*TMath::Tan(thetaOpenPb);
790 parPb[8] = 30.;
791
792 parPb[9] = dlPb;
793 parPb[10] = parPb[7]+(zvac7-zConeE)*TMath::Tan(thetaOpenPb);
794 parPb[11] = 30.;
a0cb6c86 795
796 Float_t rPbLast=parPb[10];
797
798
5aba2f60 799 gMC->Gsvolu("YXO2", "PCON", idtmed[kPb], parPb, 12);
800 gMC->Gspos("YXO2", 1, "YGO2", 0., 0., (zPb-zvac4)/2., 0, "ONLY");
801
a0cb6c86 802
803 parPb[4] = r2+(zPb-zvac3) * TMath::Tan(thetaOpen2);
804 parPb[5] = 17.657;
805
806 parPb[7] = r2+(zConeE-zvac3) * TMath::Tan(thetaOpen2);
807 parPb[8] = parPb[5]+(zConeE-zPb)*TMath::Tan(thetaOpenPb);
808
809 parPb[10] = r2+(zvac7-zvac3) * TMath::Tan(thetaOpen2);
810 parPb[11] = parPb[8]+(zvac7-zConeE)*TMath::Tan(thetaOpenPb);
811
812 gMC->Gsvolu("YYO2", "PCON", idtmed[iHeavy+40], parPb, 12);
813 gMC->Gspos("YYO2", 1, "YGO2", 0., 0., (zPb-zvac4)/2., 0, "ONLY");
814
5aba2f60 815 { // Begin local scope for i
816 for (Int_t i=4; i<23; i+=3) par2[i] = 0;
817 } // End local scope for i
818
819 gMC->Gsvolu("YMO2", "PCON", idtmed[kVacuum+40], par2, 24);
820 gMC->Gspos("YGO2", 1, "YMO2", 0., 0., 0., 0, "ONLY");
821 dZ+=dl;
822 gMC->Gspos("YMO2", 1, "YMOT", 0., 0., dZ, 0, "ONLY");
823 dZ+=dl;
824//
825// Steel envelope
826//
a0cb6c86 827// (1)
5aba2f60 828 tpar[0]=R11-dRSteel1;
829 tpar[1]=R21;
830 tpar[2]=2;
831 gMC->Gsvolu("YS21", "TUBE", idtmed[kSteel], tpar, 3);
832 dz=-dl+tpar[2];
833 gMC->Gspos("YS21", 1, "YGO2", 0., 0., dz, 0, "ONLY");
834 dz+=tpar[2];
a0cb6c86 835// (2)
5aba2f60 836 tpar[0]=R21-dRSteel2;
837 tpar[1]=R21;
838 tpar[2]=(zvac6-zvac5)/2.;
839 gMC->Gsvolu("YS22", "TUBE", idtmed[kSteel], tpar, 3);
840 dz+=tpar[2];
841 gMC->Gspos("YS22", 1, "YGO2", 0., 0., dz, 0, "ONLY");
842 dz+=tpar[2];
a0cb6c86 843// (3)
5aba2f60 844 cpar[0]=2.;
845 cpar[1]=R21-dRSteel2;
846 cpar[2]=zvac6 * TMath::Tan(accMin);
847 cpar[3]=cpar[1];
848 cpar[4]=cpar[2]+4.*TMath::Tan(accMin);
5aba2f60 849 gMC->Gsvolu("YS23", "CONE", idtmed[kSteel], cpar, 5);
850 dz+=cpar[0];
851 gMC->Gspos("YS23", 1, "YGO2", 0., 0., dz, 0, "ONLY");
852 dz+=cpar[0];
a0cb6c86 853// (4)
5aba2f60 854 cpar[0]=(zPb-zvac6-4.)/2;
855 cpar[2]=cpar[4];
856 cpar[4]=cpar[2]+2.*cpar[0]*TMath::Tan(accMin);
857 cpar[1]=cpar[2]-dRSteel2;
858 cpar[3]=cpar[4]-dRSteel2;
859
860 gMC->Gsvolu("YS24", "CONE", idtmed[kSteel], cpar, 5);
861 dz+=cpar[0];
862 gMC->Gspos("YS24", 1, "YGO2", 0., 0., dz, 0, "ONLY");
863 dz+=cpar[0];
864
a0cb6c86 865// (5)
5aba2f60 866 cpar[0]=(zConeE-zPb)/2;
867 cpar[2]=cpar[4];
868 cpar[4]=cpar[2]+2.*cpar[0]*TMath::Tan(accMin);
869 cpar[1]=cpar[2]-dRSteel2;
870 cpar[3]=cpar[4]-dRSteel2;
871
872 gMC->Gsvolu("YS25", "CONE", idtmed[kSteel], cpar, 5);
873 dz=-dlPb+cpar[0];
874 gMC->Gspos("YS25", 1, "YXO2", 0., 0., dz, 0, "ONLY");
875 dz+=cpar[0];
a0cb6c86 876// (6)
5aba2f60 877 tpar[0]=26.;
878 tpar[1]=30.;
879 tpar[2]=(zvac7-zConeE)/2.;
880
881 gMC->Gsvolu("YS26", "TUBE", idtmed[kSteel], tpar, 3);
882 dz+=tpar[2];
883 gMC->Gspos("YS26", 1, "YXO2", 0., 0., dz, 0, "ONLY");
a0cb6c86 884 dz = -tpar[2];
885
886// Recess in steel for station 3
887//
888 tpar[0]=29.;
889 tpar[1]=30.;
890 tpar[2]=(zch32-zch31)/2.;
891 gMC->Gsvolu("YS27", "TUBE", idtmed[kAir], tpar, 3);
892 dz+=(tpar[2]+zch31-zConeE);
5aba2f60 893
a0cb6c86 894 gMC->Gspos("YS27", 1, "YS26", 0., 0., dz, 0, "ONLY");
895
896//
5aba2f60 897//
898// 2nd section: vacuum system
899//
900 cpar0[0]=(zvac7-zvac4)/2;
901 cpar0[1]=r2V;
902 cpar0[2]=r2V+dVacuS;
903 cpar0[3]=cpar0[1]+2.*cpar0[0]*TMath::Tan(thetaOpenB);
904 cpar0[4]=cpar0[2]+2.*cpar0[0]*TMath::Tan(thetaOpenB);
905 gMC->Gsvolu("YV21", "CONE", idtmed[kSteel+40], cpar0, 5);
906//
907// insulation
908 cpar[0]=cpar0[0];
909 cpar[1]=cpar0[1]+dTubeS;
910 cpar[2]=cpar0[1]+dTubeS+dInsuS;
911 cpar[3]=cpar0[3]+dTubeS;
912 cpar[4]=cpar0[3]+dTubeS+dInsuS;
913 gMC->Gsvolu("YI21", "CONE", idtmed[kInsulation+40], cpar, 5);
914 gMC->Gspos("YI21", 1, "YV21", 0., 0., 0., 0, "ONLY");
915//
916// clearance
917 cpar[1]=cpar0[1]+dTubeS+dInsuS+dEnveS;
918 cpar[2]=cpar0[1]+dTubeS+dInsuS+dEnveS+dFreeS;
919 cpar[3]=cpar0[3]+dTubeS+dInsuS+dEnveS;
920 cpar[4]=cpar0[3]+dTubeS+dInsuS+dEnveS+dFreeS;
921 gMC->Gsvolu("YP21", "CONE", idtmed[kAir+40], cpar, 5);
922 gMC->Gspos("YP21", 1, "YV21", 0., 0., 0., 0, "ONLY");
923
924 dz=0.;
925 gMC->Gspos("YV21", 1, "YMO2", 0., 0., dz, 0, "ONLY");
926
927
928//
929// Third Section: Bellows and Flange
930//
931 par3[0] = 0.;
932 par3[1] = 360.;
933 par3[2] = 8.;
934 dl=(zvac9-zvac7)/2.;
935
936 par3[3] = -dl;
937 par3[4] = r2+(zvac7-zvac3) * TMath::Tan(thetaOpen2);
938 par3[5] = 30.;
939
940 par3[6] = -dl+dr21;
941 par3[7] = par3[4]+dr21;
942 par3[8] = 30.;
943
944 par3[9] = par3[6]+dB2;
945 par3[10] = par3[7];
946 par3[11] = 30.;
947
948 par3[12] = par3[9]+dr22;
949 par3[13] = par3[10]+dr22;
950 par3[14] = 30.;
951
952 par3[15] = par3[12]+dF2;
953 par3[16] = par3[13];
954 par3[17] = 30.;
955
956 par3[18] = par3[15]+dr22;
957 par3[19] = par3[16]-dr22;
958 par3[20] = 30.;
959
960 par3[21] = par3[18]+dB2;
961 par3[22] = par3[19];
962 par3[23] = 30.;
963
964 par3[24] = par3[21]+dr23;
a0cb6c86 965 par3[25] = par3[22];
5aba2f60 966 par3[26] = 30.;
967//
968 rBox=par3[22]-0.1;
969 Float_t r3=par3[25];
970
971 gMC->Gsvolu("YGO3", "PCON", idtmed[iHeavy+40], par3, 27);
972
5aba2f60 973// begin Fluka
974 Float_t rflukaPb[8];
975 for (ifl=0; ifl<8; ifl++) {
976 zfluka[ifl]=par3[3+3*ifl]+dl+zvac7;
977 rflukaPb[ifl]= 15.+(zfluka[ifl]-zvac4)*TMath::Tan(thetaOpenPb);
978 rfluka1[ifl] = par3[4+3*ifl];
979 rfluka2[ifl] = par3[5+3*ifl]-4.;
980 rfluka3[ifl] = par3[5+3*ifl];
981 rfvacu0[ifl] = 0.;
982 }
983 for (Int_t i=0; i<8; i++) rfluka0[i]=rBox;
984 rfluka0[0]=0.; rfluka0[7]=0.;
985
986 flukaGeom->Comment("3rd part: Shield");
987 flukaGeom->PolyCone(rflukaPb, rfluka2, zfluka, 8, posfluka, "LEAD", "MF", "$SHS");
988
989 if (fPbCone) {
990 flukaGeom->PolyCone(rfluka1, rflukaPb, zfluka, 8, posfluka, "LEAD", "MF", "$SHS");
991 } else {
992 flukaGeom->PolyCone(rfluka1, rflukaPb, zfluka, 8, posfluka, "NIW", "MF", "$SHS");
993 }
994
995 flukaGeom->Comment("3rd part: Steel envelope");
996 flukaGeom->PolyCone(rfluka2, rfluka3, zfluka, 8, posfluka, "STEEL", "MF", "$SHS");
997 flukaGeom->Comment("3rd part: Vacuum");
998 flukaGeom->PolyCone(rfluka0+1, rfluka1+1, zfluka+1, 6, posfluka, "AIR", "MF", "$SHH");
999 flukaGeom->Comment("3rd part: Beam Pipe (left)");
1000
1001 rf1[0]=0.; rf2[0]=0.;
1002 rf1[1] = r3V;
1003 rf2[1] = rf1[1]+dr21*TMath::Tan(thetaOpenB);
1004 rf1[2]=rf1[1]+dTubeS; rf1[3]=rf1[2]+dInsuS; rf1[4]=rf1[3]+dEnveS;
1005 rf1[5]=rf1[4]+dFreeS; rf1[6]= rf1[5]+dProtS; rf1[7]=par3[4];
1006 rf2[2]=rf2[1]+dTubeS; rf2[3]=rf2[2]+dInsuS; rf2[4]=rf2[3]+dEnveS;
1007 rf2[5]=rf2[4]+dFreeS; rf2[6]=rf2[5]+dProtS; rf2[7]=rf1[7]+dr21;
1008 flukaGeom->OnionCone(rf1, rf2, 8 , zvac7, zvac7+dr21, posfluka, materialsB, fieldsB, cutsB);
1009
1010
1011 flukaGeom->Comment("3rd part: Beam Pipe (right)");
1012
a0cb6c86 1013 rf1[0]=0.;
1014 rf1[1] = par3[25]-dr23;
5aba2f60 1015 rf1[2]=rf1[1]+dTubeS; rf1[3]=rf1[2]+dInsuS; rf1[4]=rf1[3]+dEnveS;
a0cb6c86 1016 rf1[5]=rf1[4]+dFreeS; rf1[6]=par3[25];
1017 flukaGeom->OnionCylinder(rf1, 7 , zvac9-dr23, zvac9, posfluka, materialsA, fieldsA, cutsA);
5aba2f60 1018
1019//
1020 flukaGeom->Comment("First Bellow");
1021 z1=zvac7+dr21;
1022
1023 for (Int_t i=0; i<7; i++) {
1024 z2=z1+eB2;
1025 flukaGeom->Cylinder(0., rB2, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1026 flukaGeom->Cylinder(rB2, rB2+hB2, z1, z2, posfluka, "STEEL", "MF", "$SHH");
1027
1028 z1=z2;
1029 z2+=lB2/2.-eB2;
1030 flukaGeom->Cylinder(0., rB2+hB2-eB2, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1031 flukaGeom->Cylinder(rB2+hB2-eB2, rB2+hB2, z1, z2, posfluka, "STEEL", "MF", "$SHH");
1032 z1=z2;
1033 z2=z1+eB2;
1034 flukaGeom->Cylinder(0., rB2, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1035 flukaGeom->Cylinder(rB2, rB2+hB2, z1, z2, posfluka, "STEEL", "MF", "$SHH");
1036 z1=z2;
1037 z2+=lB2/2.-eB2;
1038 flukaGeom->Cylinder(0., rB2, z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1039 flukaGeom->Cylinder(rB2, rB2+eB2, z1, z2, posfluka, "STEEL", "MF", "$SHH");
1040 flukaGeom->Cylinder(rB2+eB2, rB2+hB2, z1, z2, posfluka, "AIR", "MF", "$SHH");
1041 z1=z2;
1042 }
1043 flukaGeom->Cylinder(rB2+hB2, rB2+hB2+0.2, zvac7+dr21, z1, posfluka, "AIR", "MF", "$SHH");
1044 flukaGeom->Cylinder(rB2+hB2+0.2, rBox, zvac7+dr21, z1, posfluka, "AIR", "MF", "$SHH");
1045 zcy1=z1;
1046
1047
1048 flukaGeom->Comment("Second Bellow");
1049 z1=zvac9-dr23;
1050 for (Int_t i=0; i<7; i++) {
1051 z2=z1-eB2;
1052 flukaGeom->Cylinder(0., rB2, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
1053 flukaGeom->Cylinder(rB2, rB2+hB2, z2, z1, posfluka, "STEEL", "MF", "$SHH");
1054 z1=z2;
1055 z2-=lB2/2.-eB2;
1056 flukaGeom->Cylinder(0., rB2+hB2-eB2, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
1057 flukaGeom->Cylinder(rB2+hB2-eB2, rB2+hB2, z2, z1, posfluka, "STEEL", "MF", "$SHH");
1058 z1=z2;
1059 z2=z1-eB2;
1060 flukaGeom->Cylinder(0., rB2, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
1061 flukaGeom->Cylinder(rB2, rB2+hB2, z2, z1, posfluka, "STEEL", "MF", "$SHH");
1062 z1=z2;
1063 z2-=lB2/2.-eB2;
1064 flukaGeom->Cylinder(0., rB2, z2, z1, posfluka, "VACUUM", "MF", "$SHH");
1065 flukaGeom->Cylinder(rB2, rB2+eB2, z2, z1, posfluka, "STEEL", "MF", "$SHH");
1066 flukaGeom->Cylinder(rB2+eB2, rB2+hB2, z2, z1, posfluka, "AIR", "MF", "$SHH");
1067 z1=z2;
1068 }
1069 flukaGeom->Cylinder(rB2+hB2, rB2+hB2+0.2, z1, zvac9-dr23, posfluka, "AIR", "MF", "$SHH");
1070 flukaGeom->Cylinder(rB2+hB2+0.2, rBox, z1, zvac9-dr23, posfluka, "AIR", "MF", "$SHH");
1071
1072 zcy2=z1;
1073 flukaGeom->Comment("Flange");
1074 zfl=(zcy1+zcy2)/2.;
1075
1076 z1=zfl-dF2/2.;
1077 z2=zfl+dF2/2.;
a0cb6c86 1078 flukaGeom->Cylinder(0.,rF2-2., z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1079 flukaGeom->Cylinder(rF2-2., rF2, z1, z2, posfluka, "STEEL", "MF", "$SHH");
1080 flukaGeom->Cylinder(rF2, rF2+0.02 , z1, z2, posfluka, "AIR", "MF", "$SHH");
1081 flukaGeom->Cylinder(rF2+0.02, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
5aba2f60 1082 z2=z1;
1083 z1=z2-dFlange;
1084 flukaGeom->Cylinder(0.,rB2 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1085 flukaGeom->Cylinder(rB2, rF2 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
1086 flukaGeom->Cylinder(rF2, rF2+0.2 , z1, z2, posfluka, "AIR", "MF", "$SHH");
1087 flukaGeom->Cylinder(rF2+0.2, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
1088 z2=z1;
1089 z1=zcy1;
1090 flukaGeom->Cylinder(0.,rB2 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1091 flukaGeom->Cylinder(rB2, rB2+0.1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
1092 flukaGeom->Cylinder(rB2+0.1, rB2+0.2 , z1, z2, posfluka, "AIR", "MF", "$SHH");
1093 flukaGeom->Cylinder(rB2+0.2, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
1094
1095 z1=zfl+dF2/2.;
1096 z2=z1+dFlange;
1097 flukaGeom->Cylinder(0.,rB2 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1098 flukaGeom->Cylinder(rB2, rF2 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
1099 flukaGeom->Cylinder(rF2, rF2+0.2 , z1, z2, posfluka, "AIR", "MF", "$SHH");
1100 flukaGeom->Cylinder(rF2+0.2, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
1101 z1=z2;
1102 z2=zcy2;
1103 flukaGeom->Cylinder(0.,rB2 , z1, z2, posfluka, "VACUUM", "MF", "$SHH");
1104 flukaGeom->Cylinder(rB2, rB2+0.1 , z1, z2, posfluka, "STEEL", "MF", "$SHH");
1105 flukaGeom->Cylinder(rB2+0.1, rB2+0.2 , z1, z2, posfluka, "AIR", "MF", "$SHH");
1106 flukaGeom->Cylinder(rB2+0.2, rBox , z1, z2, posfluka, "AIR", "MF", "$SHH");
1107//
1108// end Fluka
1109
1110 parPb[0] = dl;
a0cb6c86 1111 parPb[1] = rPbLast;
5aba2f60 1112 parPb[2] = 30;
1113 parPb[3] = parPb[1]+2.*dl*TMath::Tan(thetaOpenPb);
1114 parPb[4] = 30;
1115 gMC->Gsvolu("YXO3", "CONE", idtmed[kPb], parPb, 5);
1116 gMC->Gspos("YXO3", 1, "YGO3", 0., 0., 0., 0, "ONLY");
1117 { // Begin local scope for i
1118 for (Int_t i=4; i<26; i+=3) par3[i] = 0;
1119 } // End local scope for i
1120 gMC->Gsvolu("YMO3", "PCON", idtmed[kVacuum+40], par3, 27);
1121 gMC->Gspos("YGO3", 1, "YMO3", 0., 0., 0., 0, "ONLY");
1122
1123//
1124// Steel envelope
1125 tpar[0]=26;
1126 tpar[1]=30;
1127 tpar[2]=dl;
1128 gMC->Gsvolu("YS31", "TUBE", idtmed[kSteel], tpar, 3);
1129 gMC->Gspos("YS31", 1, "YXO3", 0., 0., 0., 0, "ONLY");
1130 dZ+=dl;
1131 gMC->Gspos("YMO3", 1, "YMOT", 0., 0., dZ, 0, "ONLY");
1132 dZ+=dl;
1133
1134//
1135// 3rd section: vacuum system
1136//
1137//
1138// Bellow2
1139//
1140 tpar[0]=rB2;
1141 tpar[1]=rB2+hB2;
1142 tpar[2]=eB2/2.;
1143 gMC->Gsvolu("YB21", "TUBE", idtmed[kSteel+40], tpar, 3);
1144 dl1=tpar[2];
1145
1146 tpar[0]=rB2+hB2-eB2;
1147 tpar[1]=rB2+hB2;
1148 tpar[2]=(lB2/2.-2.*eB2)/2.;
1149 gMC->Gsvolu("YB22", "TUBE", idtmed[kSteel+40], tpar, 3);
1150 dl2=tpar[2];
1151
1152 tpar[0]=rB2-eB2;
1153 tpar[1]=rB2;
1154 tpar[2]=lB2/8.;
1155 gMC->Gsvolu("YB23", "TUBE", idtmed[kSteel+40], tpar, 3);
1156 dl3=tpar[2];
1157
1158
1159 tpar[0]=0;
1160 tpar[1]=rB2+hB2;
1161 tpar[2]=lB2/2.;
1162 gMC->Gsvolu("YBU2", "TUBE", idtmed[kVacuum+40], tpar, 3);
1163
1164 dz=-tpar[2]+dl3;
1165 gMC->Gspos("YB23", 1, "YBU2", 0., 0., dz, 0, "ONLY");
1166 dz+=dl3;
1167 dz+=dl1;
1168 gMC->Gspos("YB21", 1, "YBU2", 0., 0., dz, 0, "ONLY");
1169 dz+=dl1;
1170 dz+=dl2;
1171 gMC->Gspos("YB22", 1, "YBU2", 0., 0., dz, 0, "ONLY");
1172 dz+=dl2;
1173 dz+=dl1;
1174 gMC->Gspos("YB21", 2, "YBU2", 0., 0., dz, 0, "ONLY");
1175 dz+=dl1;
1176 dz+=dl3;
1177 gMC->Gspos("YB23", 2, "YBU2", 0., 0., dz, 0, "ONLY");
1178
1179
1180 tpar[0]=0;
1181 tpar[1]=rB2+hB2;
1182 tpar[2]=7.*lB2/2.;
1183 gMC->Gsvolu("YBM2", "TUBE", idtmed[kVacuum+40], tpar, 3);
1184 dz=-tpar[2]+lB2/2.;
1185 { // Begin local scope for i
1186 for (Int_t i=0; i<7; i++) {
1187 gMC->Gspos("YBU2", i+1 , "YBM2", 0., 0.,dz , 0, "ONLY");
1188 dz+=lB2;
1189 }
1190 } // End local scope for i
1191 dz=-dl+dr21+tpar[2];
1192 gMC->Gspos("YBM2", 1, "YMO3", 0., 0., dz, 0, "ONLY");
1193
1194 dz=dl-dr23-tpar[2];
1195 gMC->Gspos("YBM2", 2, "YMO3", 0., 0., dz, 0, "ONLY");
1196
1197//
1198// Flange
1199
1200 tpar[0]=0;
1201 tpar[1]=rF2;
1202 tpar[2]=dF2/2.;
1203 gMC->Gsvolu("YFM2", "TUBE", idtmed[kVacuum+40], tpar, 3);
1204
a0cb6c86 1205 tpar[0]=rF2-2.;
5aba2f60 1206 tpar[1]=rF2;
1207 tpar[2]=dF2/2.;
1208 gMC->Gsvolu("YF21", "TUBE", idtmed[kSteel+40], tpar, 3);
1209 gMC->Gspos("YF21", 1, "YFM2", 0., 0., 0., 0, "ONLY");
1210
1211 tpar[0]=rB2;
a0cb6c86 1212 tpar[1]=rF2-2.;
5aba2f60 1213 tpar[2]=dFlange/2.;
1214 gMC->Gsvolu("YF22", "TUBE", idtmed[kSteel+40], tpar, 3);
1215 dz=-dF2/2.+tpar[2];
1216 gMC->Gspos("YF22", 1, "YFM2", 0., 0., dz, 0, "ONLY");
1217 dz= dF2/2.-tpar[2];
1218 gMC->Gspos("YF22", 2, "YFM2", 0., 0., dz, 0, "ONLY");
1219
1220 dz=dr21/2.-dr23/2.;
1221 gMC->Gspos("YFM2", 2, "YMO3", 0., 0., dz, 0, "ONLY");
1222
1223
1224//
1225// pipe between flange and bellows
1226 tpar[0]=rB2-dTubeS;
1227 tpar[1]=rB2;
1228 tpar[2]=2.*(dB2+dr22-7.*lB2)/4.;
1229 gMC->Gsvolu("YPF2", "TUBE", idtmed[kSteel+40], tpar, 3);
1230 dz=dr21/2.-dr23/2.-dF2/2.-tpar[2];
1231 gMC->Gspos("YPF2", 1, "YMO3", 0., 0., dz, 0, "ONLY");
1232 dz=dr21/2.-dr23/2.+dF2/2.+tpar[2];
1233 gMC->Gspos("YPF2", 2, "YMO3", 0., 0., dz, 0, "ONLY");
1234
a0cb6c86 1235 Float_t dHorZ=55.;
1236
5aba2f60 1237//
1238// 4th section: rear shield and closing cone
1239//
1240 par4[0] = 0.;
1241 par4[1] = 360.;
a0cb6c86 1242 par4[2] = 7.;
5aba2f60 1243 dl=(zvac12-zvac9)/2.;
1244
1245 par4[3] = -dl;
1246 par4[4] = r3;
1247 par4[5] = 30.;
1248
a0cb6c86 1249 par4[6] = -dl+dHorZ;
1250 par4[7] = r3;
5aba2f60 1251 par4[8] = 30.;
1252
a0cb6c86 1253 par4[9] = -dl+(zvac10-zvac9);
1254 par4[10] = r3+(zvac10-zvac9-dHorZ) * TMath::Tan(thetaOpen3);
1255 par4[11] = 30.;
5aba2f60 1256
a0cb6c86 1257 par4[12] = par4[9];
1258 par4[13] = par4[10];
5aba2f60 1259 par4[14] = R42;
1260
a0cb6c86 1261 par4[15] = -dl+(zvac11-zvac9);
1262 par4[16] = r3+(zvac11-zvac9-dHorZ) * TMath::Tan(thetaOpen3);
1263 par4[17] = R42;
5aba2f60 1264
a0cb6c86 1265 par4[18] = par4[15];
1266 par4[19] = par4[16];
5aba2f60 1267 par4[20] = R43;
1268
a0cb6c86 1269 par4[21] = -dl+(zvac12-zvac9);
1270 par4[22] = rAbs;
1271 par4[23] = R43;
1272
1273 gMC->Gsvolu("YGO4", "PCON", idtmed[iHeavy+40], par4, 24);
5aba2f60 1274
1275 parPb[0] = (zvac10-zvac9)/2.;
1276 parPb[1] = parPb[3];
1277 parPb[2] = 30;
1278 parPb[3] = parPb[1]+2.*parPb[0]*TMath::Tan(thetaOpenPb);
1279 parPb[4] = 30;
1280 gMC->Gsvolu("YXO4", "CONE", idtmed[kPb], parPb, 5);
1281 gMC->Gspos("YXO4", 1, "YGO4", 0., 0., -dl+parPb[0], 0, "ONLY");
1282
1283 parPb[0] = (zvac12-zvac10)/2.;
1284 parPb[1] = parPb[3];
1285 parPb[2] = 31.;
1286 parPb[3] = parPb[1]+2.*parPb[0]*TMath::Tan(thetaOpenPb);
1287 parPb[4] = 31.;
1288 gMC->Gsvolu("YXO5", "CONE", idtmed[kPb], parPb, 5);
1289 gMC->Gspos("YXO5", 1, "YGO4", 0., 0., -dl+(zvac10-zvac9)+parPb[0], 0, "ONLY");
1290 { // Begin local scope for i
a0cb6c86 1291 for (Int_t i=4; i<23; i+=3) par4[i] = 0;
5aba2f60 1292 } // End local scope for i
1293
a0cb6c86 1294 gMC->Gsvolu("YMO4", "PCON", idtmed[kVacuum+40], par4, 24);
5aba2f60 1295 gMC->Gspos("YGO4", 1, "YMO4", 0., 0., 0., 0, "ONLY");
1296
1297
1298
1299 dZ+=dl;
1300 gMC->Gspos("YMO4", 1, "YMOT", 0., 0., dZ, 0, "ONLY");
1301 dZ+=dl;
1302//
1303// Closing concrete cone
1304//
1305 cpar[0]=(zvac12-zvac11)/2.;
a0cb6c86 1306 cpar[1] = r3+(zvac11-zvac9-dHorZ) * TMath::Tan(thetaOpen3);
5aba2f60 1307 cpar[2] = cpar[1]+0.001;
1308 cpar[3] = rAbs;
1309 cpar[4] = cpar[2];
1310 gMC->Gsvolu("YCC4", "CONE", idtmed[kConcrete+40], cpar, 5);
1311 dz=dl-cpar[0];
1312 gMC->Gspos("YCC4", 1, "YGO4", 0., 0., dz, 0, "ONLY");
1313
1314//
1315// begin Fluka
a0cb6c86 1316 Float_t r10=r3+(zvac10-zvac9-dHorZ) * TMath::Tan(thetaOpen3);
5aba2f60 1317 Float_t r11=cpar[1];
a0cb6c86 1318
1319 Float_t rPb0=15.+(zvac9-zvac4)* TMath::Tan(thetaOpenPb);
1320 Float_t rPb1=15.+(zvac9+dHorZ-zvac4)* TMath::Tan(thetaOpenPb);
5aba2f60 1321 Float_t rPb2=15.+(zvac10-zvac4)* TMath::Tan(thetaOpenPb);
1322 flukaGeom->Comment("4th part: Shield");
1323
a0cb6c86 1324 flukaGeom->Cone(rPb0, rPb1, 26.0, 26.0, zvac9, zvac9+dHorZ,
5aba2f60 1325 posfluka, "LEAD", "NF", "$SHH");
1326 if (fPbCone) {
a0cb6c86 1327 flukaGeom->Cone(r3, r3, rPb0, rPb1, zvac9, zvac9+dHorZ,
5aba2f60 1328 posfluka, "LEAD", "NF", "$SHS");
1329 } else {
a0cb6c86 1330 flukaGeom->Cone(r3, r3, rPb0, rPb1, zvac9, zvac9+dHorZ,
1331 posfluka, "NIW", "NF", "$SHS");
1332 }
1333
1334 flukaGeom->Cone(rPb1, rPb2, 26.0, 26.0, zvac9+dHorZ, zvac10,
1335 posfluka, "LEAD", "NF", "$SHH");
1336 if (fPbCone) {
1337 flukaGeom->Cone(r3, r10, rPb1, rPb2, zvac9+dHorZ, zvac10,
1338 posfluka, "LEAD", "NF", "$SHS");
1339 } else {
1340 flukaGeom->Cone(r3, r10, rPb1, rPb2, zvac9+dHorZ, zvac10,
5aba2f60 1341 posfluka, "NIW", "NF", "$SHS");
1342 }
1343
1344
1345 rPb1=rPb2;
1346 rPb2=15.+(zvac11-zvac4)* TMath::Tan(thetaOpenPb);
1347 flukaGeom->Cone(rPb1, rPb2, 30.0, 30.0, zvac10, zvac11,
1348 posfluka, "LEAD", "NF", "$SHH");
1349 if (fPbCone) {
1350 flukaGeom->Cone(r10, r11, rPb1, rPb2, zvac10, zvac11,
1351 posfluka, "LEAD", "NF", "$SHH");
1352 } else {
1353 flukaGeom->Cone(r10, r11, rPb1, rPb2, zvac10, zvac11,
1354 posfluka, "NIW", "NF", "$SHH");
1355 }
1356
1357 flukaGeom->Cylinder( rPb2, 30.0, zvac11, zvac12,
1358 posfluka, "LEAD", "NF", "$SHH");
1359 if (fPbCone) {
1360 flukaGeom->Cylinder( cpar[1], rPb2, zvac11, zvac12,
1361 posfluka, "LEAD", "NF", "$SHH");
1362 } else {
a0cb6c86 1363 flukaGeom->Cylinder( cpar[1], rPb2, zvac11, zvac12,
1364 posfluka, "NIW", "NF", "$SHH");
5aba2f60 1365 }
1366
1367 flukaGeom->Comment("4th part: Steel Envelope");
1368 flukaGeom->Cylinder(26.0, 30., zvac9, zvac10, posfluka, "STEEL", "NF", "$SHH");
1369 flukaGeom->Comment("4th part: Closing Cone");
1370 flukaGeom->Cone(cpar[1]-0.1, cpar[3], cpar[1], cpar[1], zvac11, zvac12,
1371 posfluka, "PORTLAND", "NF", "$SHH");
1372 flukaGeom->Comment("4th part: VACUUM");
1373 flukaGeom->Cone(0., 0., cpar[1]-0.1, cpar[3], zvac11, zvac12,
1374 posfluka, "VACUUM", "NF", "$SHH");
1375//
1376// end Fluka
1377
1378//
1379// Steel envelope
1380//
1381 dz=-dl;
1382 tpar[0]=26.;
1383 tpar[1]=30.;
1384 tpar[2]=(zvac10-zvac9)/2.;
1385 gMC->Gsvolu("YS41", "TUBE", idtmed[kSteel], tpar, 3);
1386 dz+=tpar[2];
1387 gMC->Gspos("YS41", 1, "YXO4", 0., 0., 0., 0, "ONLY");
1388 dz+=tpar[2];
1389/*
1390 tpar[0]=30.;
1391 tpar[1]=R41;
1392 tpar[2]=2.;
1393 gMC->Gsvolu("YS42", "TUBE", idtmed[kSteel], tpar, 3);
1394 dz+=tpar[2];
1395 gMC->Gspos("YS42", 1, "YGO4", 0., 0., dz, 0, "ONLY");
1396 dz+=tpar[2];
1397*/
1398 tpar[0]=R41-dRSteel2;
1399 tpar[1]=R41;
1400 tpar[2]=(zvac11-zvac10)/2.;
1401 gMC->Gsvolu("YS43", "TUBE", idtmed[kSteel], tpar, 3);
1402 dz+=tpar[2];
1403 gMC->Gspos("YS43", 1, "YGO4", 0., 0., dz, 0, "ONLY");
1404//
1405// rear lead shield
1406//
1407 tpar[0]=R41;
1408 tpar[1]=R42;
1409 tpar[2]=(zvac11-zvac10)/2.;
1410 gMC->Gsvolu("YPBI", "TUBE", idtmed[kPb+40], tpar, 3);
1411 dz-=0;
1412 gMC->Gspos("YPBI", 1, "YGO4", 0., 0., dz, 0, "ONLY");
1413
1414 tpar[0]=R42-5;
1415 tpar[1]=R42;
1416 tpar[2]=(zvac11-zvac10)/2.;
1417 gMC->Gsvolu("YPBO", "TUBE", idtmed[kPb], tpar, 3);
1418 gMC->Gspos("YPBO", 1, "YPBI", 0., 0., 0., 0, "ONLY");
1419
1420//
1421// rear Fe shield
1422//
1423
1424 tpar[0]=31.;
1425 tpar[1]=R43;
1426 tpar[2]=(zvac12-zvac11)/2.;
1427 gMC->Gsvolu("YFEI", "TUBE", idtmed[kFe+40], tpar, 3);
1428 dz=dl-tpar[2];
1429 gMC->Gspos("YFEI", 1, "YGO4", 0., 0., dz, 0, "ONLY");
1430
1431 tpar[0]=31.;
1432 tpar[1]=R43;
1433 tpar[2]=2.5;
1434 gMC->Gsvolu("YFEO", "TUBE", idtmed[kFe], tpar, 3);
1435 dz=-(zvac12-zvac11)/2.+tpar[2];
1436 gMC->Gspos("YFEO", 1, "YFEI", 0., 0., dz, 0, "ONLY");
1437//
1438// Magnet element
1439//
1440 tpar[0]=0.;
1441 tpar[1]=R43;
1442 tpar[2]=50.;
1443 gMC->Gsvolu("YAEM", "TUBE", idtmed[kAir], tpar, 3);
1444 tpar[0]=rAbs;
1445 tpar[1]=R43;
1446 tpar[2]=50.;
1447 gMC->Gsvolu("YFEM", "TUBE", idtmed[kFe], tpar, 3);
1448 gMC->Gspos("YFEM", 1, "YAEM", 0., 0., 0., 0, "ONLY");
1449
1450//
1451
1452 dz=zvac12+50.;
1453 gMC->Gspos("YAEM", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1454
1455
1456//
1457//
1458// 4th section: vacuum system
1459//
1460// up to closing cone
a0cb6c86 1461 r3V=r3-dr23+dVacuS;
1462
5aba2f60 1463 cpar0[0]=(zvac11-zvac9)/2;
a0cb6c86 1464 cpar0[1]=r3V-dVacuS;
1465 cpar0[2]=r3V;
5aba2f60 1466 cpar0[3]=cpar0[1]+2.*cpar0[0]*TMath::Tan(thetaOpen3);
1467 cpar0[4]=cpar0[2]+2.*cpar0[0]*TMath::Tan(thetaOpen3);
1468 gMC->Gsvolu("YV31", "CONE", idtmed[kSteel+40], cpar0, 5);
1469//
1470// insulation
1471 cpar[0]=cpar0[0];
1472 cpar[1]=cpar0[1]+dTubeS;
1473 cpar[2]=cpar0[1]+dTubeS+dInsuS;
1474 cpar[3]=cpar0[3]+dTubeS;
1475 cpar[4]=cpar0[3]+dTubeS+dInsuS;
1476 gMC->Gsvolu("YI31", "CONE", idtmed[kInsulation+40], cpar, 5);
1477 gMC->Gspos("YI31", 1, "YV31", 0., 0., 0., 0, "ONLY");
1478//
1479// clearance
1480 cpar[1]=cpar0[2]-dProtS-dFreeS;
1481 cpar[2]=cpar0[2]-dProtS;
1482 cpar[3]=cpar0[4]-dProtS-dFreeS;
1483 cpar[4]=cpar0[4]-dProtS;
1484 gMC->Gsvolu("YP31", "CONE", idtmed[kVacuum+40], cpar, 5);
1485 gMC->Gspos("YP31", 1, "YV31", 0., 0., 0., 0, "ONLY");
1486
1487 dz=-dl+cpar[0];
1488 gMC->Gspos("YV31", 1, "YMO4", 0., 0., dz, 0, "ONLY");
1489
1490//
1491// begin Fluka
a0cb6c86 1492 flukaGeom->Comment("4th part: Beam pipe lateral structure");
1493 for (Int_t i=0; i<7; i++) fieldsA[i] = "NF";
1494
1495 rf1[0]=0.; rf2[0]=0.;
1496
1497 rf1[1]=cpar0[1]; rf2[1]=rf1[1]+dHorZ*TMath::Tan(thetaOpen3);
1498
1499 rf1[2]=rf1[1]+dTubeS; rf1[3]=rf1[2]+dInsuS; rf1[4]=rf1[3]+dEnveS;
1500 rf1[5]=rf1[4]+dFreeS; rf1[6]=r3;
1501
1502 rf2[2]=rf2[1]+dTubeS; rf2[3]=rf2[2]+dInsuS; rf2[4]=rf2[3]+dEnveS;
1503 rf2[5]=rf2[4]+dFreeS; rf2[6]=r3;
1504
1505 flukaGeom->OnionCone(rf1, rf2, 7 , zvac9 , zvac9+dHorZ, posfluka, materialsA, fieldsA, cutsA);
1506
5aba2f60 1507 rf1[0]=0.; rf2[0]=0.;
5aba2f60 1508
a0cb6c86 1509 rf1[1]=rf2[1]; rf2[1]=rf1[1]+(zvac10-zvac9-dHorZ)*TMath::Tan(thetaOpen3);
1510
5aba2f60 1511 rf1[2]=rf1[1]+dTubeS; rf1[3]=rf1[2]+dInsuS; rf1[4]=rf1[3]+dEnveS;
1512 rf1[5]=rf1[4]+dFreeS; rf1[6]=r3;
a0cb6c86 1513
5aba2f60 1514 rf2[2]=rf2[1]+dTubeS; rf2[3]=rf2[2]+dInsuS; rf2[4]=rf2[3]+dEnveS;
1515 rf2[5]=rf2[4]+dFreeS; rf2[6]=r10;
1516
5aba2f60 1517
a0cb6c86 1518 flukaGeom->OnionCone(rf1, rf2, 7 , zvac9+dHorZ, zvac10, posfluka, materialsA, fieldsA, cutsA);
5aba2f60 1519
1520 rf1[0]=0.; rf2[0]=0.;
1521 rf1[1]=rf2[1]; rf2[1]=rf1[1]+(zvac11-zvac10)*TMath::Tan(thetaOpen3);
1522
1523 rf1[2]=rf1[1]+dTubeS; rf1[3]=rf1[2]+dInsuS; rf1[4]=rf1[3]+dEnveS;
1524 rf1[5]=rf1[4]+dFreeS; rf1[6]=r10;
1525 rf2[2]=rf2[1]+dTubeS; rf2[3]=rf2[2]+dInsuS; rf2[4]=rf2[3]+dEnveS;
1526 rf2[5]=rf2[4]+dFreeS; rf2[6]=r11;
1527
1528 flukaGeom->OnionCone(rf1, rf2, 7 , zvac10, zvac11, posfluka, materialsA, fieldsA, cutsA);
5aba2f60 1529//
1530// end Fluka
1531
1532//
1533// closing cone
1534 cpar0[0]=(zvac12-zvac11)/2;
a0cb6c86 1535 cpar0[1]=r3V-dVacuS+(zvac11-zvac9)*TMath::Tan(thetaOpen3);
1536 cpar0[2]=r3V +(zvac11-zvac9)*TMath::Tan(thetaOpen3);
5aba2f60 1537 cpar0[3]=rVacu;
1538 cpar0[4]=rAbs;
1539 gMC->Gsvolu("YV32", "CONE", idtmed[kSteel+40], cpar0, 5);
1540//
1541// insulation
1542 cpar[0]=cpar0[0];
1543 cpar[1]=cpar0[1]+dTubeS;
1544 cpar[2]=cpar0[1]+dTubeS+dInsuS;
1545 cpar[3]=cpar0[3]+dTubeS;
1546 cpar[4]=cpar0[3]+dTubeS+dInsuS;
1547 gMC->Gsvolu("YI32", "CONE", idtmed[kInsulation+40], cpar, 5);
1548 gMC->Gspos("YI32", 1, "YV32", 0., 0., 0., 0, "ONLY");
1549//
1550// clearance
1551 cpar[1]=cpar0[2]-dProtS-dFreeS;
1552 cpar[2]=cpar0[2]-dProtS;
1553 cpar[3]=cpar0[4]-dProtS-dFreeS;
1554 cpar[4]=cpar0[4]-dProtS;
1555 gMC->Gsvolu("YP32", "CONE", idtmed[kVacuum+40], cpar, 5);
1556 gMC->Gspos("YP32", 1, "YV32", 0., 0., 0., 0, "ONLY");
1557
1558 dz=dl-cpar[0];
1559 gMC->Gspos("YV32", 1, "YMO4", 0., 0., dz, 0, "ONLY");
1560//
1561//
1562// MUON trigger wall
1563//
1564 tpar[0] = 50.;
1565 tpar[1] = 310.;
1566 tpar[2] = (zFilterOut - zFilterIn) / 2.;
1567 gMC->Gsvolu("YFIM", "TUBE", idtmed[kFe+40], tpar, 3);
1568 dz = (zFilterIn + zFilterOut) / 2.;
1569 tpar[2] -= 10.;
1570 gMC->Gsvolu("YFII","TUBE", idtmed[kFe], tpar, 3);
1571 gMC->Gspos("YFII", 1, "YFIM", 0., 0., 0., 0, "ONLY");
1572 gMC->Gspos("YFIM", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1573//
1574// Shielding close to chamber
1575//
a0cb6c86 1576//
1577 cpar[0]=(zch11-zRear)/2.;
5aba2f60 1578 cpar[1]=R11;
1579 cpar[2]=zRear*TMath::Tan(accMin);
1580 cpar[3]=R11;
1581 cpar[4]=(zRear+2.*cpar[0])*TMath::Tan(accMin);
1582 gMC->Gsvolu("YCS1", "CONE", idtmed[kNiCuW], cpar, 5);
1583 dz=zRear+cpar[0];
1584 gMC->Gspos("YCS1", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1585
a0cb6c86 1586 cpar[0]=(zvac4-zch12)/2.;
5aba2f60 1587 cpar[1]=R11;
a0cb6c86 1588 cpar[2]=zch12*TMath::Tan(accMin);
5aba2f60 1589 cpar[3]=R11;
a0cb6c86 1590 cpar[4]=(zch12+2.*cpar[0])*TMath::Tan(accMin);
1591 gMC->Gsvolu("YCS3", "CONE", idtmed[kNiCuW], cpar, 5);
5aba2f60 1592 dz=zvac4-cpar[0];
a0cb6c86 1593 gMC->Gspos("YCS3", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1594
5aba2f60 1595
a0cb6c86 1596// Recess station 1
1597
1598 cpar[0]=(zch12-zch11)/2.;
5aba2f60 1599 cpar[1]=R11;
a0cb6c86 1600 cpar[2]=18.;
5aba2f60 1601 cpar[3]=R11;
a0cb6c86 1602 cpar[4]=18.0;
1603 gMC->Gsvolu("YCS2", "CONE", idtmed[kAir], cpar, 5);
1604 dz=zch11+cpar[0];
1605 gMC->Gspos("YCS2", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1606
1607 Float_t ptubs[5];
1608 ptubs[0] = R11;
1609 ptubs[1] = 18.;
1610 ptubs[2] = 0.;
1611// phi_min, phi_max
1612 ptubs[3] = 0.;
1613 ptubs[4] = 90.;
1614 gMC->Gsvolu("YCR0", "TUBS", idtmed[kNiCuW], ptubs, 0);
1615 Int_t idrotm[1799];
1616
1617 AliMatrix(idrotm[1701],90., 0., 90., 90., 0., 0.);
1618 AliMatrix(idrotm[1702],90., 90., 90., 180., 0., 0.);
1619 AliMatrix(idrotm[1703],90., 180., 90., 270., 0., 0.);
1620 AliMatrix(idrotm[1704],90., 270., 90., 0., 0., 0.);
1621 Int_t ipos;
1622
1623 dz=-cpar[0];
1624// 1.
1625 ptubs[2]=6.5/2.;
1626 dz+=ptubs[2];
1627 gMC->Gsposp("YCR0", 1, "YCS2", 0., 0., dz, idrotm[1701], "ONLY", ptubs, 5);
1628 gMC->Gsposp("YCR0", 2, "YCS2", 0., 0., dz, idrotm[1703], "ONLY", ptubs, 5);
1629 dz+=ptubs[2];
1630 dz+=1.5;
1631// 2.
1632 ptubs[2]=5.0/2.;
1633 dz+=ptubs[2];
1634 gMC->Gsposp("YCR0", 3, "YCS2", 0., 0., dz, idrotm[1702], "ONLY", ptubs, 5);
1635 gMC->Gsposp("YCR0", 4, "YCS2", 0., 0., dz, idrotm[1704], "ONLY", ptubs, 5);
1636 dz+=ptubs[2];
1637 dz+=1.5;
1638// 3.
1639 ptubs[2]=5.0/2.;
1640 dz+=ptubs[2];
1641 gMC->Gsposp("YCR0", 5, "YCS2", 0., 0., dz, idrotm[1701], "ONLY", ptubs, 5);
1642 gMC->Gsposp("YCR0", 6, "YCS2", 0., 0., dz, idrotm[1703], "ONLY", ptubs, 5);
1643 dz+=ptubs[2];
1644 dz+=1.5;
1645// 4.
1646 ptubs[2]=6.5/2.;
1647 dz+=ptubs[2];
1648 gMC->Gsposp("YCR0", 7, "YCS2", 0., 0., dz, idrotm[1702], "ONLY", ptubs, 5);
1649 gMC->Gsposp("YCR0", 8, "YCS2", 0., 0., dz, idrotm[1704], "ONLY", ptubs, 5);
1650 dz+=ptubs[2];
1651 dz+=1.5;
5aba2f60 1652
1653
a0cb6c86 1654
1655 cpar[0]=(zch21-zvac4)/2.;
5aba2f60 1656 cpar[1]=R21;
1657 cpar[2]=zvac4*TMath::Tan(accMin);
1658 cpar[3]=R21;
1659 cpar[4]=(zvac4+2.*cpar[0])*TMath::Tan(accMin);
1660 gMC->Gsvolu("YCS4", "CONE", idtmed[kNiCuW], cpar, 5);
1661 dz=zvac4+cpar[0];
1662 gMC->Gspos("YCS4", 1, "ALIC", 0., 0., dz, 0, "ONLY");
5aba2f60 1663
a0cb6c86 1664 cpar[0]=(zvac6-zch22)/2.;
5aba2f60 1665 cpar[1]=R21;
a0cb6c86 1666 cpar[2]=zch22*TMath::Tan(accMin);
5aba2f60 1667 cpar[3]=R21;
a0cb6c86 1668 cpar[4]=(zch22+2.*cpar[0])*TMath::Tan(accMin);
1669 gMC->Gsvolu("YCS6", "CONE", idtmed[kNiCuW], cpar, 5);
5aba2f60 1670 dz=zvac6-cpar[0];
a0cb6c86 1671 gMC->Gspos("YCS6", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1672
1673// Recess station 2
1674
1675 cpar[0]=(zch22-zch21)/2.;
5aba2f60 1676 cpar[1]=R21;
a0cb6c86 1677 cpar[2]=23.;
5aba2f60 1678 cpar[3]=R21;
a0cb6c86 1679 cpar[4]=23.;
1680 gMC->Gsvolu("YCS5", "CONE", idtmed[kAir], cpar, 5);
1681 dz=zch21+cpar[0];
1682 gMC->Gspos("YCS5", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1683
1684 ptubs[0] = R21;
1685 ptubs[1] = 23;
1686 ptubs[2] = 0.;
1687 ptubs[3] = 0.;
1688 ptubs[4] = 90.;
1689 gMC->Gsvolu("YCR1", "TUBS", idtmed[kNiCuW], ptubs, 0);
1690
1691 dz=-cpar[0];
1692// 1.
1693 ptubs[2]=7.5/2.;
1694 dz+=ptubs[2];
1695 gMC->Gsposp("YCR1", 1, "YCS5", 0., 0., dz, idrotm[1701], "ONLY", ptubs, 5);
1696 gMC->Gsposp("YCR1", 2, "YCS5", 0., 0., dz, idrotm[1703], "ONLY", ptubs, 5);
1697 dz+=ptubs[2];
1698 dz+=1.5;
1699// 2.
1700 ptubs[2]=6.0/2.;
1701 dz+=ptubs[2];
1702 gMC->Gsposp("YCR1", 3, "YCS5", 0., 0., dz, idrotm[1702], "ONLY", ptubs, 5);
1703 gMC->Gsposp("YCR1", 4, "YCS5", 0., 0., dz, idrotm[1704], "ONLY", ptubs, 5);
1704 dz+=ptubs[2];
1705 dz+=1.5;
1706// 3.
1707 ptubs[2]=6.0/2.;
1708 dz+=ptubs[2];
1709 gMC->Gsposp("YCR1", 5, "YCS5", 0., 0., dz, idrotm[1701], "ONLY", ptubs, 5);
1710 gMC->Gsposp("YCR1", 6, "YCS5", 0., 0., dz, idrotm[1703], "ONLY", ptubs, 5);
1711 dz+=ptubs[2];
1712 dz+=1.5;
1713// 4.
1714 ptubs[2]=7.5/2.;
1715 dz+=ptubs[2];
1716 gMC->Gsposp("YCR1", 7, "YCS5", 0., 0., dz, idrotm[1702], "ONLY", ptubs, 5);
1717 gMC->Gsposp("YCR1", 8, "YCS5", 0., 0., dz, idrotm[1704], "ONLY", ptubs, 5);
1718 dz+=ptubs[2];
1719 dz+=1.5;
1720
1721
1722//
1723// begin Fluka
1724 flukaGeom->Cone(R11, R11, -1., -1.,
1725 zRear, zch11, posfluka,"NIW", "MF", "$SHS");
1726
1727 flukaGeom->Cone(R11, R11, -1., -1.,
1728 zch11, zch12, posfluka,"AIR", "MF", "$SHS");
1729
1730 flukaGeom->Cone(R11, R11, -1., -1.,
1731 zch12, zvac4, posfluka,"NIW", "MF", "$SHS");
1732
1733 flukaGeom->Cone(R21, R21, -1., -1.,
1734 zvac4, zch21, posfluka,"NIW", "MF", "$SHS");
1735 flukaGeom->Cone(R21, R21, -1., -1.,
1736 zch21, zch22, posfluka,"AIR", "MF", "$SHS");
1737 flukaGeom->Cone(R21, R21, -1., -1.,
1738 zch22, zvac6, posfluka,"NIW", "MF", "$SHS");
1739
1740
1741 flukaGeom->Finish();
1742
1743//
1744// end Fluka
5aba2f60 1745//
1746// Outer Pb Cone
a0cb6c86 1747
5aba2f60 1748 if (fPbCone) {
a0cb6c86 1749
1750 par0[0] = 0.;
1751 par0[1] = 360.;
1752 par0[2] = 10.;
1753/*
1754// start of cone
1755 par0[3] = zConeE;
1756 par0[4] = 30.;
1757 par0[5] = 30.01;
1758// 3rd station
1759 par0[6] = zch31;
1760 par0[7] = 30.;
1761 par0[8] = 30.+(zch31-zConeE)*TMath::Tan(thetaOpenPbO);
1762
1763 par0[9] = zch31;
1764 par0[10] = 30.0;
1765 par0[11] = par0[8]-1.;
5aba2f60 1766
a0cb6c86 1767
1768 par0[12] = zch32;
1769 par0[13] = 30.0;
1770 par0[14] = par0[11];
1771*/
1772 par0[ 3] = zch32;
1773 par0[ 4] = 30.;
1774 par0[ 5] = 30.+(zch32-zConeE)*TMath::Tan(thetaOpenPbO);
1775
1776// 4th station
1777 par0[ 6] = zch41;
1778 par0[ 7] = 30.;
1779 par0[ 8] = 30.+(zch41-zConeE)*TMath::Tan(thetaOpenPbO);
1780
1781 par0[ 9] = zch41;
1782 par0[10] = 30.;
1783 par0[11] = 37.5;
1784 // recess erice2000
1785 par0[12] = zch42;
1786 par0[13] = 30.;
1787 par0[14] = par0[11];
1788
1789 par0[15] = zch42;
1790 par0[16] = 30.;
1791 par0[17] = 30.+(zch42-zConeE)*TMath::Tan(thetaOpenPbO);
1792
1793// 5th station
1794 par0[18] = zch51;
1795 par0[19] = 30.;
1796 par0[20] = 30.+(zch51-zConeE)*TMath::Tan(thetaOpenPbO);
1797
1798 par0[21] = zch51;
1799 par0[22] = 30.;
1800 par0[23] = 37.5; // recess erice2000
1801
1802 par0[24] = zch52;
1803 par0[25] = 30.;
1804 par0[26] = par0[23];
1805
1806 par0[27] = zch52;
1807 par0[28] = 30.;
1808 par0[29] = 30.+(zch52-zConeE)*TMath::Tan(thetaOpenPbO);
1809// end of cone
1810 par0[30] = zFilterIn;
1811 par0[31] = 30.;
1812 par0[32] = par0[29];
1813//
1814 gMC->Gsvolu("YOPB", "PCON", idtmed[kPb], par0, 33);
1815 dz=0.;
5aba2f60 1816 gMC->Gspos("YOPB", 1, "ALIC", 0., 0., dz, 0, "ONLY");
1817 }
1818}
1819
1820void AliSHILvF::Init()
1821{
1822 //
1823 // Initialise the muon shield after it has been built
1824 //
1825 Int_t i;
1826 //
1827 printf("\n");
1828 for(i=0;i<35;i++) printf("*");
1829 printf(" SHILvF_INIT ");
1830 for(i=0;i<35;i++) printf("*");
1831 printf("\n");
1832 //
1833 // Here the SHIL initialisation code (if any!)
1834 for(i=0;i<80;i++) printf("*");
1835 printf("\n");
1836}