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