]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliMAG.cxx
Logging of Debug, Info and Error Messages follwing AliRoot Standard http://aliweb...
[u/mrichter/AliRoot.git] / STRUCT / AliMAG.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 //  L3 Magnet                                                                //
21 //                                                                           //
22 //Begin_Html
23 /*
24 <img src="picts/AliMAGClass.gif">
25 </pre>
26 <br clear=left>
27 <font size=+2 color=red>
28 <p>The responsible person for this module is
29 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
30 </font>
31 <pre>
32 */
33 //End_Html
34 //                                                                           //
35 ///////////////////////////////////////////////////////////////////////////////
36  
37 #include <TVirtualMC.h>
38
39 #include "AliMAG.h"
40 #include "AliMagF.h"
41 #include "AliRun.h"
42  
43 ClassImp(AliMAG)
44  
45 //_____________________________________________________________________________
46 AliMAG::AliMAG()
47 {
48   //
49   // Default constructor for L3 magnet
50   //
51 }
52  
53 //_____________________________________________________________________________
54 AliMAG::AliMAG(const char *name, const char *title)
55   : AliModule(name,title)
56 {
57   //
58   // Standard constructor for L3 magnet
59   //
60   //Begin_Html
61   /*
62     <img src="picts/aliMAG.gif">
63   */
64   //End_Html
65   
66   SetMarkerColor(7);
67   SetMarkerStyle(2);
68   SetMarkerSize(0.4);
69 }
70
71 //_____________________________________________________________________________
72 void AliMAG::CreateGeometry()
73 {
74   //
75   // Create geometry for L3 magnet
76   //
77   //Begin_Html
78   /*
79     <img src="picts/mag.gif">
80   */
81   //End_Html
82   //Begin_Html
83   /*
84     <img src="picts/tree_mag.gif">
85   */
86   //End_Html
87   
88   Int_t *idtmed = fIdtmed->GetArray()-299;
89   
90   Float_t dpar[13];
91   Int_t idrotm[399];
92   Float_t par[10];
93   
94   // ANGLE POLAIRE MAXIMUM 
95   
96   //  Define Mother 
97   
98   par[0] = 22.5;
99   par[1] = 360.;
100   par[2] = 8.;
101   par[3] = 2.;
102   par[4] = -600.;
103   par[5] = 580.;
104   par[6] = 790.;
105   par[7] = 600.;
106   par[8] = 580.;
107   par[9] = 790.;
108   gMC->Gsvolu("L3MO", "PGON", idtmed[334], par, 10);
109   gMC->Gspos("L3MO", 1, "ALIC", 0., -30., 0., 0, "ONLY");
110   
111   // Define coils 
112   
113   par[5] = 585.;
114   par[6] = 690.;
115   par[8] = 585.;
116   par[9] = 690.;
117   gMC->Gsvolu("L3CO", "PGON", idtmed[328], par, 10);
118   gMC->Gspos("L3CO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
119   
120   par[5] = 580.;
121   par[6] = 585.;
122   par[8] = 580.;
123   par[9] = 585.;
124   gMC->Gsvolu("L3C1", "PGON", idtmed[308], par, 10);
125   gMC->Gspos("L3C1", 1, "L3MO", 0., 0., 0., 0, "ONLY");
126   
127   // Define yoke 
128   
129   par[5] = 690.;
130   par[6] = 790.;
131   par[8] = 690.;
132   par[9] = 790.;
133   gMC->Gsvolu("L3YO", "PGON", idtmed[329], par, 10);
134   gMC->Gspos("L3YO", 1, "L3MO", 0., 0., 0., 0, "ONLY");
135   
136   // Define the return yoke of L3 (DOOR) 
137   
138   par[4] = 600.;
139   par[5] = 0.;
140   par[6] = 790.;
141   par[7] = 700.;
142   par[8] = par[5];
143   par[9] = par[6];
144   gMC->Gsvolu("L3DO", "PGON", idtmed[334], par, 10);
145   gMC->Gsvolu("L3DX", "PGON", idtmed[334], par, 10);
146   
147   par[4] = 610.;
148   par[5] = 0.;
149   par[6] = 790.;
150   par[7] = 700.;
151   par[8] = par[5];
152   par[9] = par[6];
153   gMC->Gsvolu("L3FR", "PGON", idtmed[329], par, 10);
154   gMC->Gsvolu("L3FX", "PGON", idtmed[329], par, 10);
155   
156   // INNER LAYER 
157   
158   par[4] = 600.;
159   par[7] = 610.;
160   gMC->Gsvolu("L3IR", "PGON", idtmed[309], par, 10);
161   gMC->Gsvolu("L3IX", "PGON", idtmed[309], par, 10);
162   
163   //     DOOR OPENING 
164   
165   dpar[0] = 22.5;
166   dpar[1] = 360;
167   dpar[2] = 8.;
168   dpar[3] = 3.;
169   dpar[4] = 610.;
170   dpar[5] = 0.;
171   dpar[6] = 163.5;
172   dpar[7] = 670.;
173   dpar[8] = dpar[5];
174   dpar[9] = dpar[6];
175   dpar[10] = 700.;
176   dpar[11] = dpar[5];
177   dpar[12] = dpar[6] + 50.;
178   gMC->Gsvolu("L3O1", "PGON", idtmed[314], dpar, 13);
179   gMC->Gsvolu("L3O3", "PGON", idtmed[314], dpar, 13);
180   par[4] = 600.;
181   par[5] = 0.;
182   par[6] = 163.5;
183   par[7] = 610.;
184   par[8] = 0.;
185   par[9] = 163.5;
186   gMC->Gsvolu("L3O2", "PGON", idtmed[314], par, 10);
187   gMC->Gsvolu("L3O4", "PGON", idtmed[314], par, 10);
188   
189   //     THE DOOR OPENING HAS TO BE PLACED WITH 'MANY' SINCE THE REGION 
190   //     WILL CONTAIN A MUON CHAMBER, BEAM PIPE AND BEAM SHIELD 
191   //     PLACED WITH 'ONLY'. 
192   
193   AliMatrix(idrotm[300], 90., 0., 90., 90., 180., 0.);
194
195   gMC->Gspos("L3DO", 1, "ALIC", 0., -30., 0., 0, "MANY");
196   gMC->Gspos("L3FR", 1, "L3DO", 0., 0., 0., 0, "MANY");
197   gMC->Gspos("L3IR", 1, "L3DO", 0., 0., 0., 0, "MANY");
198   
199   gMC->Gspos("L3DX", 1, "ALIC", 0., -30., 0., idrotm[300], "MANY");
200   gMC->Gspos("L3FX", 1, "L3DX", 0., 0., 0., 0, "MANY");
201   gMC->Gspos("L3IX", 1, "L3DX", 0., 0., 0., 0, "MANY");
202
203   if(!strcmp(gMC->GetName(),"TGeant3")) {
204
205     gMC->Gspos("L3O1", 1, "L3FR", 0., 30., 0., 0, "MANY");
206     gMC->Gspos("L3O2", 1, "L3IR", 0., 30., 0., 0, "MANY");
207     gMC->Gspos("L3O3", 1, "L3FX", 0., 30., 0., 0, "MANY");
208     gMC->Gspos("L3O4", 1, "L3IX", 0., 30., 0., 0, "MANY");
209
210   }
211   else {
212     gMC->Gspos("L3O1", 1, "ALIC", 0., 0., 0., 0, "MANY");
213     gMC->Gspos("L3O2", 1, "ALIC", 0., 0., 0., 0, "MANY");
214     gMC->Gsbool("L3O1", "L3DO");
215     gMC->Gsbool("L3O2", "L3DO");
216   
217     gMC->Gspos("L3O3", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
218     gMC->Gspos("L3O4", 1, "ALIC", 0., 0., 0., idrotm[300], "MANY");
219     gMC->Gsbool("L3O3", "L3DX");
220     gMC->Gsbool("L3O4", "L3DX");
221   }      
222 }
223
224 //_____________________________________________________________________________
225 void AliMAG::CreateMaterials()
226 {
227   //
228   // Create materials for L3 magnet
229   //
230   
231   Int_t   isxfld = gAlice->Field()->Integ();
232   Float_t sxmgmx = gAlice->Field()->Max();
233   Float_t epsil, stmin, deemax, tmaxfd, stemax;
234
235
236   // --- Define the various materials for GEANT --- 
237   
238   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
239   Float_t zAir[4]={6.,7.,8.,18.};
240   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
241   Float_t dAir = 1.20479E-3;
242
243
244   //     Aluminum 
245   AliMaterial(9, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
246   AliMaterial(29, "Al$", 26.98, 13., 2.7, 8.9, 37.2);
247   
248   //     Iron 
249   AliMaterial(10, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
250   AliMaterial(30, "Fe$", 55.85, 26., 7.87, 1.76, 17.1);
251   
252   //     Air 
253   AliMixture(15, "AIR$      ", aAir, zAir, dAir, 4, wAir);
254   AliMixture(35, "AIR$      ", aAir, zAir, dAir, 4, wAir);
255   
256   // **************** 
257   //     Defines tracking media parameters. 
258   //     Les valeurs sont commentees pour laisser le defaut 
259   //     a GEANT (version 3-21, page CONS200), f.m. 
260   epsil  = .001;  // Tracking precision, 
261   stemax = -1.;   // Maximum displacement for multiple scat 
262   tmaxfd = -20.;  // Maximum angle due to field deflection 
263   deemax = -.3;   // Maximum fractional energy loss, DLS 
264   stmin  = -.8;
265   // *************** 
266   
267   //    IRON 
268   
269   AliMedium(10, "FE_C0             ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
270   AliMedium(30, "FE_C1             ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
271   
272   //     ALUMINUM 
273
274   AliMedium(9, "ALU_C0            ",  9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
275   AliMedium(29, "ALU_C1            ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
276   
277   //     AIR 
278   
279   AliMedium(15, "AIR_C0            ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
280   AliMedium(35, "AIR_C1            ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
281 }
282
283 //_____________________________________________________________________________
284 void AliMAG::DrawModule()
285 {
286   //
287   // Draw a shaded view of the L3 magnet
288   //
289 }
290
291 //_____________________________________________________________________________
292 void AliMAG::Init()
293 {
294   //
295   // Initialise L3 magnet after it has been built
296   Int_t i;
297   //
298   if(fDebug) {
299     printf("\n%s: ",ClassName());
300     for(i=0;i<35;i++) printf("*");
301     printf(" MAG_INIT ");
302     for(i=0;i<35;i++) printf("*");
303     printf("\n%s: ",ClassName());
304     //
305     // Here the MAG initialisation code (if any!)
306     for(i=0;i<80;i++) printf("*");
307     printf("\n");
308   }
309 }
310