1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.10 2002/10/14 14:57:39 hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
21 Revision 1.8.12.1 2002/07/24 10:08:27 alibrary
24 Revision 1.9 2002/07/23 13:08:46 morsch
25 All volume names start with "Q".
27 Revision 1.8 2000/10/02 21:28:15 fca
28 Removal of useless dependecies via forward declarations
30 Revision 1.7 2000/06/11 12:38:00 morsch
31 Coding rule violations corrected
33 Revision 1.6 1999/10/06 19:57:07 fca
34 Correct materials in pipe
36 Revision 1.5 1999/09/29 09:24:30 fca
37 Introduction of the Copyright and cvs Log
41 ///////////////////////////////////////////////////////////////////////////////
47 <img src="picts/AliPIPEClass.gif">
51 ///////////////////////////////////////////////////////////////////////////////
53 #include "AliPIPEv3.h"
59 //_____________________________________________________________________________
60 AliPIPEv3::AliPIPEv3()
63 // Default constructor for beam pipe
67 //_____________________________________________________________________________
68 AliPIPEv3::AliPIPEv3(const char *name, const char *title)
72 // Standard constructor for beam pipe
76 //_____________________________________________________________________________
77 void AliPIPEv3::CreateGeometry()
80 // Create Beam Pipe geometry
84 <img src="picts/AliPIPE.gif">
89 <img src="picts/AliPIPETree.gif">
93 Float_t tpar[3], dzmo, zpos;
94 Float_t bepar[3], alpar[3],sspar[3],flange[3],vacpar[3];
97 // const Double_t z_flange = 150;
98 //for undulated structure
99 char cn18[][5]={"CN01","CN02","CN03","CN04","CN05","CN06","CN07","CN08"};
100 char cn48[][5]={"CN21","CN22","CN23","CN24","CN25","CN26","CN27","CN28"};
101 // char undul[][5]={'BELO','UNDL'};
108 Int_t *idtmed = fIdtmed->GetArray()-1999;
109 // the mother of all beam pipes
115 gMC->Gsvolu("QQMO", "TUBE", idtmed[2015], tpar, 3);
117 // All beam pipe details as per the provisonal drawings given by Lars
118 // Leistam on 31.5.99
120 // Beryllium beam pipe, length 56.6 cm, centered at vertex
130 gMC->Gsvolu("QQBE", "TUBE", idtmed[2004], bepar, 3);
131 gMC->Gsvolu("QAC1", "TUBE", idtmed[2015], vacpar, 3);
132 gMC->Gspos("QAC1", 1, "QQBE", 0., 0., 0., 0, "ONLY");
133 gMC->Gspos("QQBE", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
135 // now beam pipes only in negative z-part for use in PMD.
137 // SS Flange 4 cm thick, 5.8 cm ID, 6.3 cm OD
141 zpos = zpos -bepar[2] - flange[2];
146 gMC->Gsvolu("QFL1", "TUBE", idtmed[2018], flange, 3);
147 gMC->Gsvolu("QAC2", "TUBE", idtmed[2015], vacpar, 3);
148 gMC->Gspos("QAC2", 1, "QFL1", 0., 0., 0., 0, "ONLY");
149 gMC->Gspos("QFL1", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
151 // Aluminium alloy beam pipe, 1mm thick, 230 cm long
155 zpos = zpos - flange[2] - alpar[2];
160 gMC->Gsvolu("QQAL", "TUBE", idtmed[2003], alpar, 3);
161 gMC->Gsvolu("QAC3", "TUBE", idtmed[2015], vacpar, 3);
162 gMC->Gspos("QAC3", 1, "QQAL", 0., 0., 0., 0, "ONLY");
163 gMC->Gspos("QQAL", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
166 // SS tube 2.0 cm long, 0.8 mm thick, 5.96 cm OD
171 zpos = zpos - alpar[2] - sspar[2];
176 gMC->Gsvolu("QSS1", "TUBE", idtmed[2018], sspar, 3);
177 gMC->Gsvolu("QAC4", "TUBE", idtmed[2015], vacpar, 3);
178 gMC->Gspos("QAC4", 1, "QSS1", 0., 0., 0., 0, "ONLY");
179 gMC->Gspos("QSS1", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
182 // SS Flange 3 cm thick 7.4 cm OD, 5.8 cm ID
187 zpos = zpos - sspar[2] - flange[2];
192 gMC->Gsvolu("QFL2", "TUBE", idtmed[2018], flange, 3);
193 gMC->Gsvolu("QAC5", "TUBE", idtmed[2015], vacpar, 3);
194 gMC->Gspos("QAC5", 1, "QFL2", 0., 0., 0., 0, "ONLY");
195 gMC->Gspos("QFL2", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
198 // SS tube 4.0 cm long, 0.8 mm thick, 5.96 cm OD
203 zpos = zpos - flange[2] - sspar[2];
208 gMC->Gsvolu("QSS2", "TUBE", idtmed[2018], sspar, 3);
209 gMC->Gsvolu("QAC6", "TUBE", idtmed[2015], vacpar, 3);
210 gMC->Gspos("QAC6", 1, "QSS2", 0., 0., 0., 0, "ONLY");
211 gMC->Gspos("QSS2", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
215 // SS Bellow 8.4 cm long, 6.5 cm ID, 7.5 cm OD
216 // 0.8 mm thick material, 0.3 cm pitch.
217 // zundul=4.2, rundul=6.5, thick=0.08
223 Undulation("BELO",pitch,thick,zundul,rundul,cn18);
226 zpos = zpos - sspar[2] - bellow[2];
227 gMC->Gspos("BELO", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
229 // SS tube 20.0 cm long, 0.8 mm thick, 5.96 cm OD
234 zpos = zpos - bellow[2] - sspar[2];
239 gMC->Gsvolu("QSS3", "TUBE", idtmed[2018], sspar, 3);
240 gMC->Gsvolu("QAC7", "TUBE", idtmed[2015], vacpar, 3);
241 gMC->Gspos("QAC7", 1, "QSS3", 0., 0., 0., 0, "ONLY");
242 gMC->Gspos("QSS3", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
245 // SS Bellow 8.4 cm long, 6.5 cm ID, 7.5 cm OD
246 // 0.8 mm thick material, 0.3 cm pitch.
249 zpos = zpos - sspar[2] - bellow[2];
250 gMC->Gspos("BELO", 2, "QQMO", 0., 0., zpos, 0, "ONLY");
252 // SS tube 4.7 cm long, 0.8 mm thick,
257 zpos = zpos - bellow[2] - sspar[2];
262 gMC->Gsvolu("QSS4", "TUBE", idtmed[2018], sspar, 3);
263 gMC->Gsvolu("QAC8", "TUBE", idtmed[2015], vacpar, 3);
264 gMC->Gspos("QAC8", 1, "QSS4", 0., 0., 0., 0, "ONLY");
265 gMC->Gspos("QSS4", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
267 // SS Flange 2.2 cm thick, ID=5.8 cm, OD=9.8 cm
272 zpos = zpos - sspar[2] - flange[2];
277 gMC->Gsvolu("QFL3", "TUBE", idtmed[2018], flange, 3);
278 gMC->Gsvolu("QAC9", "TUBE", idtmed[2015], vacpar, 3);
279 gMC->Gspos("QAC9", 1, "QFL3", 0., 0., 0., 0, "ONLY");
280 gMC->Gspos("QFL3", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
282 //Total of 3150 mm from vertex on the negative side upto this point.
284 // SS tube 20.0 cm long, 0.15 cm thick, 5.8 cm ID, to support vac. pump
289 zpos = zpos - flange[2] - sspar[2];
294 gMC->Gsvolu("QSS5", "TUBE", idtmed[2018], sspar, 3);
295 gMC->Gsvolu("QA10", "TUBE", idtmed[2015], vacpar, 3);
296 gMC->Gspos("QA10", 1, "QSS5", 0., 0., 0., 0, "ONLY");
297 gMC->Gspos("QSS5", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
300 // last item, undulated SS beam pipe, pitch=0.25, length= 342.0 cm
301 // material thickness 0.015 cm, ID=6.0 cm,
302 // zundul=171.0, thick=0.015, rundul=3.0
307 Undulation("UNDL",pitch,thick,zundul,rundul,cn48);
309 zpos = zpos - sspar[2] - zundul;
310 gMC->Gspos("UNDL", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
312 gMC->Gspos("QQMO", 1, "ALIC", 0., 0., 0.1, 0, "ONLY");
314 // total of 6770 mm length upto this point, end of undulated beam
317 // SS flange 22*2 mm thick
323 zpos = zpos - zundul - flange[2];
328 gMC->Gsvolu("QFL4", "TUBE", idtmed[2018], flange, 3);
329 gMC->Gsvolu("QC11", "TUBE", idtmed[2015], vacpar, 3);
330 gMC->Gspos("QC11", 1, "QFL4", 0., 0., 0., 0, "ONLY");
331 gMC->Gspos("QFL4", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
335 //_____________________________________________________________________________
336 void AliPIPEv3::DrawModule()
339 // Draw a shaded view of the Beam Pipe
342 // Set everything unseen
343 gMC->Gsatt("*", "seen", -1);
345 // Set ALIC mother transparent
346 gMC->Gsatt("ALIC","SEEN",0);
348 // Set the volumes visible
349 gMC->Gsatt("QQMO","seen",1);
350 gMC->Gsatt("QQBE","seen",1);
351 gMC->Gsatt("QFL1","seen",1);
352 gMC->Gsatt("QQAL","seen",1);
353 gMC->Gsatt("QSS1","seen",1);
354 gMC->Gsatt("QFL2","seen",1);
355 gMC->Gsatt("QSS2","seen",1);
356 gMC->Gsatt("QSS3","seen",1);
357 gMC->Gsatt("QSS4","seen",1);
358 gMC->Gsatt("QFL3","seen",1);
359 gMC->Gsatt("QSS5","seen",1);
360 gMC->Gsatt("BELO","seen",1);
361 gMC->Gsatt("UNDL","seen",1);
363 gMC->Gdopt("hide", "on");
364 gMC->Gdopt("shad", "on");
365 gMC->Gsatt("*", "fill", 7);
366 gMC->SetClipBox(".");
367 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
369 gMC->Gdraw("alic", 40, 30, 0, 3, 5, .04, .04);
370 gMC->Gdhead(1111, "Beam Pipe");
371 gMC->Gdman(16, 6, "MAN");
372 gMC->Gdopt("hide","off");
375 //_____________________________________________________________________________
376 void AliPIPEv3::CreateMaterials()
379 // Create materials for beam pipe
382 Int_t isxfld = gAlice->Field()->Integ();
383 Float_t sxmgmx = gAlice->Field()->Max();
385 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
386 Float_t zsteel[4] = { 26.,24.,28.,14. };
387 Float_t wsteel[4] = { .715,.18,.1,.005 };
389 Float_t epsil, stmin, tmaxfd, deemax, stemax;
394 // --- Define the various materials for GEANT ---
395 AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
396 AliMaterial(4, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 18.5);
397 AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
398 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
399 AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
402 // Defines tracking media parameters.
403 // Les valeurs sont commentees pour laisser le defaut
404 // a GEANT (version 3-21, page CONS200), f.m.
405 epsil = .001; // Tracking precision,
406 stemax = -1.; // Maximum displacement for multiple scat
407 tmaxfd = -20.; // Maximum angle due to field deflection
408 deemax = -.3; // Maximum fractional energy loss, DLS
413 AliMedium(15, "AIR_L3_US", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
417 AliMedium(5, "BE_L3_US", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
422 AliMedium(4, "AL_L3_US", 4, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
426 AliMedium(16, "VA_L3_US", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
430 AliMedium(19, "ST_L3_US", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
433 void AliPIPEv3::Undulation(char *undul, Float_t pitch, Float_t thick,
434 Float_t zundul, Float_t rundul, char (*cone)[5])
437 // RUNDUL : Internal radius of the undulated chamber
438 // THICK : material thickness
439 // PITCH : one-QUARTER wave of undulation (cm)
440 // ZUNDUL : half length (cm)
442 // The undulated structure is desgned as a superposition of eight CONES
443 // of suitable sizes, where the inner/outer radius of the cone increases,
444 // then decreases, each half of the wave is assumed to be a semicircle,
445 // which allows to calculate the thickness and the radii of the cone, by
446 // dividing the semicircle into 4 parts of equal arc length.
447 // Thus apear the constants 0.293 and 0.707.
450 const Float_t kConst1 = .293;
451 const Float_t kConst2 = .707;
455 Float_t dcone1[5], dcone2[5], dcone3[5], dcone4[5], dcone5[5],
456 dcone6[5], dcone7[5], dcone8[5];
457 Float_t xc, yc, zc, dundul[3];
458 Int_t *idtmed = fIdtmed->GetArray()-1999;
462 dcone1[0] = kConst1 * pitch / 2;
464 dcone1[2] = dcone1[1] + thick;
465 dcone1[3] = dcone1[1] + kConst2 * pitch;
466 dcone1[4] = dcone1[3] + thick;
468 dcone2[0] = kConst2 * pitch / 2;
469 dcone2[1] = dcone1[3];
470 dcone2[2] = dcone1[4];
471 dcone2[3] = dcone2[1] + kConst1 * pitch;
472 dcone2[4] = dcone2[3] + thick;
474 dcone3[0] = dcone2[0];
475 dcone3[1] = dcone2[3];
476 dcone3[2] = dcone2[4];
477 dcone3[3] = dcone2[1];
478 dcone3[4] = dcone2[2];
480 dcone4[0] = dcone1[0];
481 dcone4[1] = dcone1[3];
482 dcone4[2] = dcone1[4];
483 dcone4[3] = dcone1[1];
484 dcone4[4] = dcone1[2];
486 dcone5[0] = dcone1[0];
487 dcone5[1] = dcone1[1] - thick;
488 dcone5[2] = dcone1[1];
489 dcone5[3] = dcone5[1] - kConst2 * pitch;
490 dcone5[4] = dcone5[3] + thick;
492 dcone6[0] = dcone2[0];
493 dcone6[1] = dcone5[3];
494 dcone6[2] = dcone5[4];
495 dcone6[3] = dcone6[1] - kConst1 * pitch;
496 dcone6[4] = dcone6[3] + thick;
497 dcone7[0] = dcone6[0];
498 dcone7[1] = dcone6[3];
499 dcone7[2] = dcone6[4];
500 dcone7[3] = dcone5[3];
501 dcone7[4] = dcone5[4];
503 dcone8[0] = dcone5[0];
504 dcone8[1] = dcone7[3];
505 dcone8[2] = dcone7[4];
506 dcone8[3] = dcone5[1];
507 dcone8[4] = dcone5[2];
509 gMC->Gsvolu(cone[0], "CONE", idtmed[2018], dcone1, 5);
510 gMC->Gsvolu(cone[1], "CONE", idtmed[2018], dcone2, 5);
511 gMC->Gsvolu(cone[2], "CONE", idtmed[2018], dcone3, 5);
512 gMC->Gsvolu(cone[3], "CONE", idtmed[2018], dcone4, 5);
513 gMC->Gsvolu(cone[4], "CONE", idtmed[2018], dcone5, 5);
514 gMC->Gsvolu(cone[5], "CONE", idtmed[2018], dcone6, 5);
515 gMC->Gsvolu(cone[6], "CONE", idtmed[2018], dcone7, 5);
516 gMC->Gsvolu(cone[7], "CONE", idtmed[2018], dcone8, 5);
517 gMC->Gsatt(cone[0], "SEEN", 0);
518 gMC->Gsatt(cone[1], "SEEN", 0);
519 gMC->Gsatt(cone[2], "SEEN", 0);
520 gMC->Gsatt(cone[3], "SEEN", 0);
521 gMC->Gsatt(cone[4], "SEEN", 0);
522 gMC->Gsatt(cone[5], "SEEN", 0);
523 gMC->Gsatt(cone[6], "SEEN", 0);
524 gMC->Gsatt(cone[7], "SEEN", 0);
526 // DEFINE AN IMAGINARY TUBE VOLUME FOR UNDULATED CHAMBER, FILL WITH VACUUM
528 nwave = Int_t (zundul / (pitch * 2) + .1);
529 dundul[2] = pitch * 2 * nwave;
530 dundul[1] = rundul + pitch + thick * 2;
533 gMC->Gsvolu(undul, "TUBE", idtmed[2015], dundul, 3);
537 zc = -dundul[2] + dcone1[0];
538 for (j = 1; j <= nwave; ++j) {
539 gMC->Gspos(cone[0], j, undul, xc, yc, zc, 0, "ONLY");
540 zc = zc + dcone1[0] + dcone2[0];
541 gMC->Gspos(cone[1], j, undul, xc, yc, zc, 0, "ONLY");
542 zc = zc + dcone2[0] + dcone3[0];
543 gMC->Gspos(cone[2], j, undul, xc, yc, zc, 0, "ONLY");
544 zc = zc + dcone3[0] + dcone4[0];
545 gMC->Gspos(cone[3], j, undul, xc, yc, zc, 0, "ONLY");
546 zc = zc + dcone4[0] + dcone5[0];
547 gMC->Gspos(cone[4], j, undul, xc, yc, zc, 0, "ONLY");
548 zc = zc + dcone5[0] + dcone6[0];
549 gMC->Gspos(cone[5], j, undul, xc, yc, zc, 0, "ONLY");
550 zc = zc + dcone6[0] + dcone7[0];
551 gMC->Gspos(cone[6], j, undul, xc, yc, zc, 0, "ONLY");
552 zc = zc + dcone7[0] + dcone8[0];
553 gMC->Gspos(cone[7], j, undul, xc, yc, zc, 0, "ONLY");
554 zc = zc + dcone8[0] + dcone1[0];