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