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