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