]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliPIPEv1.cxx
Corrections to obey the coding conventions
[u/mrichter/AliRoot.git] / STRUCT / AliPIPEv1.cxx
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 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Beam pipe class. Test version                                            //
21 //                                                                           //
22 //Begin_Html
23 /*
24 <img src="picts/AliPIPEClass.gif">
25 */
26 //End_Html
27 //                                                                           //
28 ///////////////////////////////////////////////////////////////////////////////
29
30 #include "AliPIPEv1.h"
31 #include "AliRun.h"
32 #include "AliMagF.h"
33  
34 ClassImp(AliPIPEv1)
35  
36 //_____________________________________________________________________________
37 AliPIPEv1::AliPIPEv1()
38 {
39   //
40   // Default constructor for beam pipe
41   //
42 }
43  
44 //_____________________________________________________________________________
45 AliPIPEv1::AliPIPEv1(const char *name, const char *title)
46        : AliPIPE(name,title)
47 {
48   //
49   // Standard constructor for beam pipe
50   //
51 }
52  
53 //_____________________________________________________________________________
54 void AliPIPEv1::CreateGeometry()
55 {
56   //
57   // Create Beam Pipe geometry
58   //
59   //Begin_Html
60   /*
61     <img src="picts/AliPIPE.gif">
62   */
63   //End_Html
64   //Begin_Html
65   /*
66     <img src="picts/AliPIPETree.gif">
67   */
68   //End_Html
69
70   Float_t tpar[3], dzmo, zpos, absorberDistance, absorberEnd;
71   Float_t r2, dr;
72
73   const Double_t kZFlange = 150;
74   
75   Int_t *idtmed = fIdtmed->GetArray()-1999;
76   
77   
78   absorberDistance   = 90.;  // DEFINES DRIFT LENGTH 
79   //z_nose  = 102.;
80   //z_cone  = 285.;
81   //theta1  = 24.;  // 1. angle defining the front absorber 
82   //theta2  = 5.;   // 2. angle defining the front absorbe 
83   //acc_max = 9.;   // ANGLE POLAIRE MAXIMUM 
84   //acc_min = 2.;   // ANGLE POLAIRE MINIMUM DE DETECTION 
85   absorberEnd   = 503.;
86   //d_steel = 1.;   // THICKNESS OF STEEL SUPPORT 
87   //d_poly  = 7.5;
88   //d_pb    = 2.5;
89   //abs_cc  = 315.; // DEFINES LENGTH OF CARBON 
90   //abs_c   = 358.;
91   //abs_s   = 150.; // DEFINES W-SHIELD LENGTH 
92   //abs_n   = 80.;  // START OF NOSE 
93   //r_abs   = 4.;
94   //r_pb    = .1;
95   //epsilon = .01;
96   //theta_r = 3.;
97   //d_rear  = 35.;
98   //theta_open = .75;
99   
100   //z_l3      = 700.;
101   //zmag_in   = 725.;
102   //zmag_out  = 1225.;
103   //zfil_in   = 1471.;
104   //zfil_out  = 1591.;
105   //zcon_in   = 1900.;
106   //zcon_out  = 2e3;
107   //zcone_e   = 859.0875;
108   //spec_l    = 1800.;
109   //zplug_in  = 1780.;
110   //zplug_out = 1900.;
111   
112   //     Chamber position 
113   //      CZ1=515.5 
114   //cz1 = 511.;
115   //cz2 = 686.;
116   //cz3 = 971.;
117   //cz4 = 1245.;
118   //cz5 = 1445.;
119   //cz6 = 1610.;
120   //cz7 = 1710.;
121   
122   
123   //     the mother of all beam pipes 
124   
125   tpar[0] = 0.;
126   tpar[1] = 3.;
127   tpar[2] = (absorberDistance + 700.) / 2.;
128   dzmo = tpar[2] - absorberDistance;
129   gMC->Gsvolu("QQMO", "TUBE", idtmed[2015], tpar, 3);
130   gMC->Gspos("QQMO", 1, "ALIC", 0., 0., -dzmo, 0, "ONLY");
131   
132   //       BEAM PIPE IN DRIFT SPACE 
133   
134   //     -30-kZFlange 
135   tpar[0] = 0.;
136   tpar[1] = 3.;
137   tpar[2] = 30;
138   gMC->Gsvolu("QDT1", "TUBE", idtmed[2015], tpar, 3);
139   
140   tpar[0] = 2.9;
141   gMC->Gsvolu("QTB1", "TUBE", idtmed[2004], tpar, 3);
142   gMC->Gspos("QTB1", 1, "QDT1", 0., 0., 0., 0, "ONLY");
143   gMC->Gspos("QDT1", 1, "QQMO", 0., 0., dzmo, 0, "ONLY");
144   
145   
146   //     30-90 
147   tpar[0] = 0.;
148   tpar[1] = 3.;
149   tpar[2] = 30.;
150   gMC->Gsvolu("QDT2", "TUBE", idtmed[2015], tpar, 3);
151   
152   tpar[0] = 2.9;
153   gMC->Gsvolu("QTB2", "TUBE", idtmed[2004], tpar, 3);
154   gMC->Gspos("QTB2", 1, "QDT2", 0., 0., 0.,   0, "ONLY");
155   gMC->Gspos("QDT2", 1, "QQMO", 0., 0., dzmo, 0, "ONLY");
156   
157   //       beam pipe outside absorber on the left side 
158   
159   
160   
161   //     -30 - kZFlange 
162   tpar[0] = 0.;
163   tpar[1] = 3.;
164   tpar[2] = (kZFlange - 30)/2;
165   gMC->Gsvolu("QDT5", "TUBE", idtmed[2015], tpar, 3);
166   
167   tpar[0] = 2.9;
168   zpos    = -30. - tpar[2] + dzmo;
169   gMC->Gsvolu("QTB5", "TUBE", idtmed[2004], tpar, 3);
170   gMC->Gspos("QTB5", 1, "QDT5", 0., 0., 0.,   0, "ONLY");
171   gMC->Gspos("QDT5", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
172   
173   //     STRAIGHT STEEL PIECE 
174   
175   zpos    = -kZFlange;
176   r2      = 2.9;
177   dr      = .015;
178   tpar[0] = 0.;
179   tpar[1] = r2 + dr;
180   tpar[2] = (zpos + 700.) / 2.;
181   gMC->Gsvolu("QDT7", "TUBE", idtmed[2015], tpar, 3);
182   tpar[0] = r2;
183   gMC->Gsvolu("QTB7", "TUBE", idtmed[2018], tpar, 3);
184   gMC->Gspos("QTB7", 1, "QDT7", 0., 0., 0.,   0, "ONLY");
185   zpos = zpos - tpar[2] + dzmo;
186   gMC->Gspos("QDT7", 1, "QQMO", 0., 0., zpos, 0, "ONLY");
187   
188   //     flange dn 63 
189   
190   tpar[0] = 3.;
191   tpar[1] = 5.7;
192   tpar[2] = 2.;
193   gMC->Gsvolu("QN63", "TUBE", idtmed[2018], tpar, 3);
194   zpos = tpar[2] - kZFlange;
195   gMC->Gspos("QN63", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
196   
197   
198   //     Replace Absorber or Shield by Beam-Pipe 
199   //     in case they are not selected 
200   
201   if (gAlice->GetModule("ABSO") == 0) {
202     
203     gMC->Gspos("QN63", 2, "ALIC", 0., 0., kZFlange, 0, "ONLY");
204     r2      = 2.9;
205     dr      = .1;
206     tpar[0] = 0.;
207     tpar[1] = r2 + dr;
208     tpar[2] = (kZFlange - absorberDistance) / 2.;
209     gMC->Gsvolu("QDT8", "TUBE", idtmed[2015], tpar, 3);
210     tpar[0] = r2;
211     gMC->Gsvolu("QTB8", "TUBE", idtmed[2004], tpar, 3);
212     gMC->Gspos("QTB8", 1, "QDT8", 0., 0., 0., 0, "ONLY");
213     zpos    = absorberDistance + tpar[2];
214     gMC->Gspos("QDT8", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
215     dr      = .015;
216     tpar[0] = 0.;
217     tpar[1] = r2 + dr;
218     tpar[2] = (absorberEnd - kZFlange) / 2.;
219     gMC->Gsvolu("QDTS", "TUBE", idtmed[2015], tpar, 3);
220     tpar[0] = r2;
221     gMC->Gsvolu("QTBS", "TUBE", idtmed[2018], tpar, 3);
222     gMC->Gspos("QTBS", 1, "QDTS", 0., 0., 0., 0, "ONLY");
223     zpos = tpar[2] + kZFlange;
224     gMC->Gspos("QDTS", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
225   }
226   if (gAlice->GetModule("SHIL") == 0) {
227     r2      = 2.9;
228     dr      = .015;
229     tpar[0] = 0.;
230     tpar[1] = r2 + dr;
231     tpar[2] = (700. - absorberEnd) / 2.;
232     gMC->Gsvolu("QDT9", "TUBE", idtmed[2015], tpar, 3);
233     tpar[0] = r2;
234     gMC->Gsvolu("QTB9", "TUBE", idtmed[2018], tpar, 3);
235     gMC->Gspos("QTB9", 1, "QDT9", 0., 0., 0., 0, "ONLY");
236     zpos = absorberEnd + tpar[2];
237     gMC->Gspos("QDT9", 1, "ALIC", 0., 0., zpos, 0, "ONLY");
238   }
239 }
240
241 //_____________________________________________________________________________
242 void AliPIPEv1::DrawModule() const
243 {
244   //
245   // Draw a shaded view of the Beam Pipe
246   //
247
248   // Set everything unseen
249   gMC->Gsatt("*", "seen", -1);
250   // 
251   // Set ALIC mother transparent
252   gMC->Gsatt("ALIC","SEEN",0);
253   //
254   // Set the volumes visible
255   gMC->Gsatt("QQMO","seen",1);
256   gMC->Gsatt("QDT1","seen",1);
257   gMC->Gsatt("QTB1","seen",1);
258   gMC->Gsatt("QDT2","seen",1);
259   gMC->Gsatt("QTB2","seen",1);
260   gMC->Gsatt("QDT5","seen",1);
261   gMC->Gsatt("QTB5","seen",1);
262   gMC->Gsatt("QDT7","seen",1);
263   gMC->Gsatt("QTB7","seen",1);
264   gMC->Gsatt("QN63","seen",1);
265   //
266   gMC->Gdopt("hide", "on");
267   gMC->Gdopt("shad", "on");
268   gMC->Gsatt("*", "fill", 7);
269   gMC->SetClipBox(".");
270   gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
271   gMC->DefaultRange();
272   gMC->Gdraw("alic", 40, 30, 0, 3, 5, .04, .04);
273   gMC->Gdhead(1111, "Beam Pipe");
274   gMC->Gdman(16, 6, "MAN");
275   gMC->Gdopt("hide","off");
276 }
277
278 //_____________________________________________________________________________
279 void AliPIPEv1::CreateMaterials()
280 {
281   //
282   // Create materials for beam pipe
283   //
284
285   Int_t   isxfld = gAlice->Field()->Integ();
286   Float_t sxmgmx = gAlice->Field()->Max();
287   
288   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
289   Float_t zsteel[4] = { 26.,24.,28.,14. };
290   Float_t wsteel[4] = { .715,.18,.1,.005 };
291   
292   Float_t epsil, stmin, tmaxfd, deemax, stemax;
293   
294   //     STEEL 
295   
296   
297   // --- Define the various materials for GEANT --- 
298   AliMaterial(5, "BERILLIUM$", 9.01, 4., 1.848, 35.3, 36.7);
299   AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
300   AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
301   AliMixture(19, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
302   
303   // **************** 
304   //     Defines tracking media parameters. 
305   //     Les valeurs sont commentees pour laisser le defaut 
306   //     a GEANT (version 3-21, page CONS200), f.m. 
307   epsil  = .001;  // Tracking precision, 
308   stemax = -1.;   // Maximum displacement for multiple scat 
309   tmaxfd = -20.;  // Maximum angle due to field deflection 
310   deemax = -.3;   // Maximum fractional energy loss, DLS 
311   stmin  = -.8;
312   
313   //    Air 
314   
315   AliMedium(15, "AIR_L3_US", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
316   
317   //    Beryllium 
318   
319   AliMedium(5, "BE_L3_US", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
320   
321   //    Vacuum 
322   
323   AliMedium(16, "VA_L3_US", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
324   
325   //    Steel 
326   
327   AliMedium(19, "ST_L3_US", 19, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
328 }
329