Fix Coverity leaks
[u/mrichter/AliRoot.git] / STRUCT / AliABSOvF.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
eeacf08b 16/* $Id$ */
5aba2f60 17
18// //
19// //
20///////////////////////////////////////////////////////////////////////////////
21
22#include "AliABSOvF.h"
23#include "AliRun.h"
24#include "AliConst.h"
25#include "AliALIFE.h"
26
27ClassImp(AliABSOvF)
28
29//_____________________________________________________________________________
30AliABSOvF::AliABSOvF()
31{
32 //
33 // Default constructor
34 //
35}
36
37//_____________________________________________________________________________
38AliABSOvF::AliABSOvF(const char *name, const char *title)
39 : AliABSO(name,title)
40{
41 //
42 // Standard constructor
43 //
44 SetMarkerColor(7);
45 SetMarkerStyle(2);
46 SetMarkerSize(0.4);
47}
48
49//_____________________________________________________________________________
50void AliABSOvF::CreateGeometry()
51{
52// Create the absorber geometry
53// The inner part of the absorber (shield) is written also in ALIFE format
54//
55 enum {kC=1605, kAl=1608, kFe=1609, kCu=1610, kW=1611, kPb=1612,
56 kNiCuW=1620, kVacuum=1615, kAir=1614, kConcrete=1616,
57 kPolyCH2=1617, kSteel=1609, kInsulation=1613, kPolyCc=1619};
58
59 Int_t *idtmed = fIdtmed->GetArray()-1599;
60
61 Float_t par[24], cpar[5], cpar0[5], pcpar[12], tpar[3], tpar0[3];
62 Float_t dz;
63
64 AliALIFE* flukaGeom = new AliALIFE("frontshield.alife", "abso_vol.inp");
65
66#include "ABSOSHILConst.h"
67#include "ABSOConst.h"
fb25e598 68 Float_t dzFe = 11.;
69//
70// 3 < theta < 9
71 fNLayers[0] = 11;
72 fMLayers[0][ 0] = kAir; fZLayers[0][ 0] = zAbsStart;
73 fMLayers[0][ 1] = kC; fZLayers[0][ 1] = zAbsCc;
74 fMLayers[0][ 2] = kConcrete; fZLayers[0][ 2] = zRear-dRear-dzFe;
75 fMLayers[0][ 3] = kFe; fZLayers[0][ 3] = zRear-dRear;
76 fMLayers[0][ 4] = kPb; fZLayers[0][ 4] = fZLayers[0][3] + 5.;
77 fMLayers[0][ 5] = kPolyCH2; fZLayers[0][ 5] = fZLayers[0][4] + 5.;
78 fMLayers[0][ 6] = kPb; fZLayers[0][ 6] = fZLayers[0][5] + 5.;
79 fMLayers[0][ 7] = kPolyCH2; fZLayers[0][ 7] = fZLayers[0][6] + 5.;
80 fMLayers[0][ 8] = kPb; fZLayers[0][ 8] = fZLayers[0][7] + 5.;
81 fMLayers[0][ 9] = kPolyCH2; fZLayers[0][ 9] = fZLayers[0][8] + 5.;
82 fMLayers[0][10] = kPb; fZLayers[0][10] = zRear;
83// 2 < theta < 3
84 fNLayers[1] = 5;
85 fMLayers[1][0] = fMLayers[0][0]; fZLayers[1][0] = fZLayers[0][0];
86 fMLayers[1][1] = fMLayers[0][1]; fZLayers[1][1] = fZLayers[0][1];
87 fMLayers[1][2] = fMLayers[0][2]; fZLayers[1][2] = fZLayers[0][2];
88 fMLayers[1][3] = fMLayers[0][3]; fZLayers[1][3] = fZLayers[0][3];
89 fMLayers[1][4] = kNiCuW; fZLayers[1][4] = zRear;
90//
5aba2f60 91 Float_t dTube=0.1; // tube thickness
92 Float_t dInsu=0.5; // insulation thickness
93 Float_t dEnve=0.1; // protective envelope thickness
94 Float_t dFree=0.5; // clearance thickness
95
96
97// Mother volume and outer shielding: Pb
98 par[0] = 0.;
99 par[1] = 360.;
100 par[2] = 7.;
101
102 par[3] = -(zRear-zAbsStart)/2.;
103 par[4] = rAbs;
104 par[5] = zAbsStart * TMath::Tan(theta1);
105
106 par[6] = par[3]+(zNose-zAbsStart);
107 par[7] = rAbs;
108 par[8] = zNose * TMath::Tan(theta1);
109
110 par[9] = par[3]+(zConeTPC-zAbsStart);
111 par[10] = rAbs;
112 par[11] = par[8] + (par[9] - par[6]) * TMath::Tan(theta2);
113
114 par[12] = par[3]+(zOpen-zAbsStart);
115 par[13] = rAbs;
116 par[14] = par[11] + (par[12] - par[9]) * TMath::Tan(accMax);
117
118 par[15] = par[3]+(zRear-dRear-zAbsStart);
119 par[16] = rAbs + (par[15] - par[12]) * TMath::Tan(thetaOpen1) ;
120 par[17] = par[14] + (par[15] - par[12]) * TMath::Tan(accMax);
121
122 par[18] = par[3]+(zRear-dRear-zAbsStart);
123 par[19] = (zRear-dRear) * TMath::Tan(accMin);
124 par[20] = par[14] + (par[18] - par[12]) * TMath::Tan(accMax);
125
126 par[21] = -par[3];
127 par[22] = zRear* TMath::Tan(accMin);
128 par[23] = par[20] + (par[21] - par[18]) * TMath::Tan(accMax);
129 gMC->Gsvolu("ABSS", "PCON", idtmed[kPb], par, 24);
130 { // Begin local scope for i
131 for (Int_t i=4; i<18; i+=3) par[i] = 0;
132 } // End local scope for i
133 gMC->Gsvolu("ABSM", "PCON", idtmed[kVacuum+40], par, 24);
134 gMC->Gspos("ABSS", 1, "ABSM", 0., 0., 0., 0, "ONLY");
135
136//
137// Steel envelope
138//
139 par[4] = par[5] -dSteel;
140 par[7] = par[8] -dSteel;
141 par[10]= par[11]-dSteel;
142 par[13]= par[14]-dSteel;
143 par[16]= par[17]-dSteel;
144 par[19]= par[20]-dSteel;
145 par[22]= par[23]-dSteel;
146 gMC->Gsvolu("ABST", "PCON", idtmed[kSteel], par, 24);
147 gMC->Gspos("ABST", 1, "ABSS", 0., 0., 0., 0, "ONLY");
148//
149// Polyethylene shield
150//
151 cpar[0] = (zRear - zConeTPC) / 2.;
152 cpar[1] = zConeTPC * TMath::Tan(accMax);
153 cpar[2] = cpar[1] + dPoly;
154 cpar[3] = zRear * TMath::Tan(accMax);
155 cpar[4] = cpar[3] + dPoly;
156 gMC->Gsvolu("APOL", "CONE", idtmed[kPolyCH2+40], cpar, 5);
157 dz = (zRear-zAbsStart)/2.-cpar[0];
158 gMC->Gspos("APOL", 1, "ABSS", 0., 0., dz, 0, "ONLY");
159
160//
161// Tungsten nose to protect TPC
162//
163 cpar[0] = (zNose - zAbsStart) / 2.;
164 cpar[1] = zAbsStart * TMath::Tan(accMax);
165 cpar[2] = zAbsStart * TMath::Tan(theta1)-dSteel;
166 cpar[3] = zNose * TMath::Tan(accMax);
167 cpar[4] = zNose * TMath::Tan(theta1)-dSteel;
168 gMC->Gsvolu("ANOS", "CONE", idtmed[kW], cpar, 5);
169//
170 dz = -(zRear-zAbsStart)/2.+cpar[0];
171 gMC->Gspos("ANOS", 1, "ABSS", 0., 0., dz, 0, "ONLY");
172//
173// Tungsten inner shield
174//
175 Float_t zW=zTwoDeg+.1;
176 Float_t dZ = zW+(zRear-dRear-zW)/2.;
177 //
178 pcpar[0] = 0.;
179 pcpar[1] = 360.;
180 pcpar[2] = 3.;
181 pcpar[3] = zW-dZ;
182 pcpar[4] = rAbs;
183 pcpar[5] = zW * TMath::Tan(accMin);
184 pcpar[6] = zOpen-dZ;
185 pcpar[7] = rAbs;
186 pcpar[8] = zOpen * TMath::Tan(accMin);
187 pcpar[9] = zRear-dRear-dZ;
188 pcpar[10] = rAbs+(zRear-dRear-zOpen) * TMath::Tan(thetaOpen1);
189 pcpar[11] = (zRear-dRear) * TMath::Tan(accMin);
190
191 gMC->Gsvolu("AWIN", "PCON", idtmed[kNiCuW+40], pcpar, 12);
192 //
193 dz=(zW+zRear-dRear)/2-(zAbsStart+zRear)/2.;
194 gMC->Gspos("AWIN", 1, "ABSS", 0., 0., dz, 0, "ONLY");
195
196 // Inner tracking region
197 //
198 // mother volume: Pb
199 //
200 pcpar[0] = 0.;
201 pcpar[1] = 360.;
202 pcpar[2] = 3.;
203 pcpar[3] = -(zRear-zAbsStart)/2.;
204 pcpar[4] = rAbs;
205 pcpar[5] = zAbsStart * TMath::Tan(accMax);
206 pcpar[6] = pcpar[3]+(zTwoDeg-zAbsStart);
207 pcpar[7] = rAbs;
208 pcpar[8] = zTwoDeg * TMath::Tan(accMax);
209 pcpar[9] = -pcpar[3];
210 pcpar[10] = zRear * TMath::Tan(accMin);
211 pcpar[11] = zRear * TMath::Tan(accMax);
fb25e598 212 gMC->Gsvolu("AITR", "PCON", idtmed[fMLayers[0][4]], pcpar, 12);
5aba2f60 213 //
214 // special Pb medium for last 5 cm of Pb
215 Float_t zr=zRear-2.-0.001;
216 cpar[0] = 1.0;
217 cpar[1] = zr * TMath::Tan(thetaR);
218 cpar[2] = zr * TMath::Tan(accMax);
219 cpar[3] = cpar[1] + TMath::Tan(thetaR) * 2;
220 cpar[4] = cpar[2] + TMath::Tan(accMax) * 2;
fb25e598 221 gMC->Gsvolu("ARPB", "CONE", idtmed[fMLayers[0][4]], cpar, 5);
5aba2f60 222 dz=(zRear-zAbsStart)/2.-cpar[0]-0.001;
223 gMC->Gspos("ARPB", 1, "AITR", 0., 0., dz, 0, "ONLY");
224 //
225 // concrete cone: concrete
226 //
227 pcpar[9] = pcpar[3]+(zRear-dRear-zAbsStart);
228 pcpar[10] = (zRear-dRear) * TMath::Tan(accMin);
229 pcpar[11] = (zRear-dRear) * TMath::Tan(accMax);
fb25e598 230 gMC->Gsvolu("ACON", "PCON", idtmed[fMLayers[0][2]+40], pcpar, 12);
5aba2f60 231 gMC->Gspos("ACON", 1, "AITR", 0., 0., 0., 0, "ONLY");
fb25e598 232//
233// Fe Cone
234//
235 zr = zRear-dRear-dzFe-1.;
236 cpar[0] = dzFe/2.;
237 cpar[1] = zr * TMath::Tan(accMin);
238 cpar[2] = zr * TMath::Tan(accMax);
239 cpar[3] = cpar[1] + TMath::Tan(thetaR) * dzFe;
240 cpar[4] = cpar[2] + TMath::Tan(accMax) * dzFe;
241 gMC->Gsvolu("ACFE", "CONE",idtmed[fMLayers[0][3]], cpar, 5);
242
243 dz = (zRear-zAbsStart)/2.-dRear-dzFe/2.-1.;
244
245 gMC->Gspos("ACFE", 1, "ACON", 0., 0., dz, 0, "ONLY");
246
247
5aba2f60 248 //
249 // carbon cone: carbon
250 //
251 pcpar[9] = pcpar[3]+(zAbsCc-zAbsStart);
252 pcpar[10] = zAbsCc * TMath::Tan(accMin);
253 pcpar[11] = zAbsCc * TMath::Tan(accMax);
fb25e598 254 gMC->Gsvolu("ACAR", "PCON", idtmed[fMLayers[0][1]+40], pcpar, 12);
5aba2f60 255 gMC->Gspos("ACAR", 1, "ACON", 0., 0., 0., 0, "ONLY");
256 //
257 // carbon cone outer region
258 //
259 cpar[0] = 10.;
260 cpar[1] = rAbs;
261 cpar[2] = zAbsStart* TMath::Tan(accMax);
262 cpar[3] = rAbs;
263 cpar[4] = cpar[2]+2. * cpar[0] * TMath::Tan(accMax);
264
fb25e598 265 gMC->Gsvolu("ACAO", "CONE", idtmed[fMLayers[0][1]], cpar, 5);
5aba2f60 266 dz=-(zRear-zAbsStart)/2.+cpar[0];
267 gMC->Gspos("ACAO", 1, "ACAR", 0., 0., dz, 0, "ONLY");
268 //
269 // inner W shield
270 Float_t epsi=0.;
271 Float_t repsi=1.;
272
273 zr=zRear-(dRear-epsi);
274 cpar[0] = (dRear-epsi)/2.;
275 cpar[1] = zr * TMath::Tan(accMin);
276 cpar[2] = zr * TMath::Tan(thetaR*repsi);
277 cpar[3] = cpar[1] + TMath::Tan(accMin) * (dRear-epsi);
278 cpar[4] = cpar[2] + TMath::Tan(thetaR*repsi) * (dRear-epsi);
fb25e598 279 gMC->Gsvolu("ARW0", "CONE", idtmed[fMLayers[1][4]+40], cpar, 5);
5aba2f60 280 dz=(zRear-zAbsStart)/2.-cpar[0];
281 gMC->Gspos("ARW0", 1, "AITR", 0., 0., dz, 0, "ONLY");
282 //
283 // special W medium for last 5 cm of W
284 zr=zRear-5;
285 cpar[0] = 2.5;
286 cpar[1] = zr * TMath::Tan(accMin);
287 cpar[2] = zr * TMath::Tan(thetaR*repsi);
288 cpar[3] = cpar[1] + TMath::Tan(accMin) * 5.;
289 cpar[4] = cpar[2] + TMath::Tan(thetaR*repsi) * 5.;
fb25e598 290 gMC->Gsvolu("ARW1", "CONE", idtmed[fMLayers[1][4]+20], cpar, 5);
5aba2f60 291 dz=(dRear-epsi)/2.-cpar[0];
292 gMC->Gspos("ARW1", 1, "ARW0", 0., 0., dz, 0, "ONLY");
293 //
294 // PolyEthylene Layers
295 Float_t drMin=TMath::Tan(thetaR) * 5;
296 Float_t drMax=TMath::Tan(accMax) * 5;
fb25e598 297 gMC->Gsvolu("ARPE", "CONE", idtmed[fMLayers[0][5]], cpar, 0);
5aba2f60 298 cpar[0]=2.5;
299 { // Begin local scope for i
300 for (Int_t i=0; i<3; i++) {
301 zr=zRear-dRear+5+i*10.;
302 cpar[1] = zr * TMath::Tan(thetaR);
303 cpar[2] = zr * TMath::Tan(accMax);
304 cpar[3] = cpar[1] + drMin;
305 cpar[4] = cpar[2] + drMax;
306 dz=(zRear-zAbsStart)/2.-cpar[0]-5.-(2-i)*10;
307 gMC->Gsposp("ARPE", i+1, "AITR", 0., 0., dz, 0, "ONLY",cpar,5);
308 }
309 } // End local scope for i
310 gMC->Gspos("AITR", 1, "ABSS", 0., 0., 0., 0, "ONLY");
311 dz = (zRear-zAbsStart)/2.+zAbsStart;
312 gMC->Gspos("ABSM", 1, "ALIC", 0., 0., dz, 0, "ONLY");
313//
314//
315// vacuum system
316//
317// pipe and heating jackets
318//
319//
320// cylindrical piece
321 tpar0[2]=(zOpen-zAbsStart)/2;
322 tpar0[0]=rVacu;
323 tpar0[1]=rAbs;
324 gMC->Gsvolu("AV11", "TUBE", idtmed[kSteel+40], tpar0, 3);
325//
326// insulation
327
328 tpar[2]=tpar0[2];
329 tpar[0]=rVacu+dTube;
330 tpar[1]=tpar[0]+dInsu;
331 gMC->Gsvolu("AI11", "TUBE", idtmed[kInsulation+40], tpar, 3);
332 gMC->Gspos("AI11", 1, "AV11", 0., 0., 0., 0, "ONLY");
333//
334// clearance
335 tpar[0]=tpar[1]+dEnve;
336 tpar[1]=tpar[0]+dFree;
337 gMC->Gsvolu("AP11", "TUBE", idtmed[kAir+40], tpar, 3);
338 gMC->Gspos("AP11", 1, "AV11", 0., 0., 0., 0, "ONLY");
339//
340 dz=-(zRear-zAbsStart)/2.+tpar0[2];
341 gMC->Gspos("AV11", 1, "ABSM", 0., 0., dz, 0, "ONLY");
342
343//
344// begin Fluka
345// Float_t zTwoDeg1=zTwoDeg-0.9/TMath::Tan(accMin);
346 Float_t pos[3]={0.,0.,0.};
347 Float_t r[8];
348 r[0]=0.;
349 r[1]=rVacu;
350 r[2]=r[1]+0.1;
351 r[3]=r[2]+0.5;
352 r[4]=r[3]+0.1;
353 r[5]=r[4]+0.5;
354
355 char* materialsA[7]
356 = {"VACUUM", "STEEL", "PIPEINSU", "STEEL", "AIR", "AIR"};
357 char* fieldsA[7]
358 = {"MF", "MF", "MF", "MF", "MF", "MF"};
359 char* cutsA[7]
360 = {"$SHH", "$SHH", "$SHH", "$SHH", "$SHH", "$SHH"};
361 char* materialsB[7]
362 = {"VACUUM", "STEEL", "PIPEINSU", "STEEL", "AIR", "CARBON"};
363 char* fieldsB[7]
364 = {"MF", "MF", "MF", "MF", "MF", "MF"};
365 char* cutsB[7]
366 = {"$SHH", "$SHH", "$SHH", "$SHH", "$SHH", "$SHS"};
367
368 flukaGeom->Comment("Front Absorber Cylyndrical Section");
369 flukaGeom->SetDefaultVolume("*ACR02","*ACR02" );
370 flukaGeom->OnionCylinder(r, 6 , zAbsStart, zOpen, pos, materialsB, fieldsB, cutsB);
371 flukaGeom->Cone(rAbs, rAbs, -rAbs, -rAbs, zTwoDeg, zOpen, pos,
0cc503f6 372 "NIW", "MF", "$SHH");
5aba2f60 373//
374// end Fluka
375
376//
377// conical piece
378
379 cpar0[0]=(zRear-dRear-zOpen)/2;
380 cpar0[1]=rVacu-0.05;
381 cpar0[2]=rAbs;
382 Float_t dR=2.*cpar0[0]*TMath::Tan(thetaOpen1);
383 cpar0[3]=cpar0[1]+dR;
384 cpar0[4]=cpar0[2]+dR;
385 gMC->Gsvolu("AV21", "CONE", idtmed[kSteel+40], cpar0, 5);
386 dTube+=0.05;
387
388//
389// insulation
390 cpar[0]=cpar0[0];
391 cpar[1]=cpar0[1]+dTube;
392 cpar[2]=cpar0[1]+dTube+dInsu;
393 cpar[3]=cpar0[3]+dTube;
394 cpar[4]=cpar0[3]+dTube+dInsu;
395 gMC->Gsvolu("AI21", "CONE", idtmed[kInsulation+40], cpar, 5);
396 gMC->Gspos("AI21", 1, "AV21", 0., 0., 0., 0, "ONLY");
397//
398// clearance
399 cpar[1]=cpar0[1]+dTube+dInsu+dEnve;
400 cpar[2]=rAbs;
401 cpar[3]=cpar0[1]+dTube+dInsu+dEnve+dR;
402 cpar[4]=rAbs+dR;
403
404 gMC->Gsvolu("AP21", "CONE", idtmed[kAir+40], cpar, 5);
405 gMC->Gspos("AP21", 1, "AV21", 0., 0., 0., 0, "ONLY");
406
407 dz=(zRear-zAbsStart)/2.-cpar0[0]-dRear;
408 gMC->Gspos("AV21", 1, "ABSM", 0., 0., dz, 0, "ONLY");
409//
410// begin Fluka
411//
412 Float_t r1[7], r2[7];
413 r1[0]=0.;
414 r2[0]=0.;
415 r1[1]=rVacu-0.05;
416 r2[1]=cpar0[3];
417
418 r1[2]=r1[1]+0.15;
419 r1[3]=r1[2]+0.5;
420 r1[4]=r1[3]+0.1;
421 r1[5]=r1[4]+0.5;
422 r1[6]=cpar0[2];
423
424 r2[2]=r2[1]+0.15;
425 r2[3]=r2[2]+0.5;
426 r2[4]=r2[3]+0.1;
427 r2[5]=r2[4]+0.5;
428 r2[6]=cpar0[4];
429
430 flukaGeom->Comment("Front Absorber Conical Section");
431 flukaGeom->OnionCone(r1, r2, 7 , zOpen, zRear-dRear, pos, materialsA, fieldsA, cutsA);
432 flukaGeom->Cone(r1[6], r2[6], -1., -1.,
0cc503f6 433 zOpen, zRear-dRear, pos, "NIW", "MF", "$SHH");
5aba2f60 434
435 flukaGeom->Finish();
436 delete flukaGeom;
437
438//
439// end Fluka
440}
441
442//_____________________________________________________________________________
443
444void AliABSOvF::Init()
445{
446 //
447 // Initialisation of the muon absorber after it has been built
448 Int_t i;
449 //
450 printf("\n");
451 for(i=0;i<35;i++) printf("*");
452 printf(" ABSOvF_INIT ");
453 for(i=0;i<35;i++) printf("*");
454 printf("\n");
455 //
456 for(i=0;i<80;i++) printf("*");
457 printf("\n");
458}
459
460
461
462
463
464
465
466
467
468