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