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