]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliMAG.cxx
Door split in "Crown" and "Door".
[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 */
34 //End_Html
35 //                                                                           //
36 ///////////////////////////////////////////////////////////////////////////////
37  
38 #include <TVirtualMC.h>
39 #include <TGeoMedium.h>
40 #include <TGeoVolume.h>
41 #include <TGeoMatrix.h>
42 #include <TGeoPgon.h>
43 #include <TGeoCompositeShape.h>
44 #include <TGeoManager.h>
45
46 #include "AliMAG.h"
47 #include "AliMagF.h"
48 #include "AliRun.h"
49  
50 ClassImp(AliMAG)
51  
52 //_____________________________________________________________________________
53 AliMAG::AliMAG()
54 {
55   //
56   // Default constructor for L3 magnet
57   //
58 }
59  
60 //_____________________________________________________________________________
61 AliMAG::AliMAG(const char *name, const char *title)
62   : AliModule(name,title)
63 {
64   //
65   // Standard constructor for L3 magnet
66   //
67   //Begin_Html
68   /*
69     <img src="picts/aliMAG.gif">
70   */
71   //End_Html
72   
73   SetMarkerColor(7);
74   SetMarkerStyle(2);
75   SetMarkerSize(0.4);
76 }
77
78 //_____________________________________________________________________________
79 void AliMAG::CreateGeometry()
80 {
81   //
82   // Create geometry for L3 magnet
83   //
84   //Begin_Html
85   /*
86     <img src="picts/mag.gif">
87   */
88   //End_Html
89     
90   //Begin_Html
91   /*
92     <img src="picts/tree_mag.gif">
93     <br> Dimensions taken from drawing: ALIL3___00010
94   //End_Html
95   */
96 // Octagon
97     const Int_t   kNSides              =    8;
98     const Float_t kStartAngle          =   22.5; // deg
99     const Float_t kFullAngle           =  360.0; // deg
100 //  Mother volume 
101     const Float_t kRBMotherInner       = 560.00; // cm
102     const Float_t kRBMotherOuter       = 790.50; // cm
103     const Float_t kLBMother            = 706.00; // cm
104 // Yoke     
105     const Float_t kRYokeInner          = 703.50; // cm
106     const Float_t kRYokeOuter          = 790.50; // cm
107     const Float_t kLYoke               = 620.00; // cm
108 // Coil
109     const Float_t kRCoilInner          = 593.00; // cm
110     const Float_t kRCoilOuter          = 682.00; // cm
111     const Float_t kLCoil               = 587.30; // cm
112 // Thermal Shield    
113     const Float_t kRThermalShieldInner = 566.00; // cm
114     const Float_t kRThermalShieldOuter = 571.00; // cm
115 // Crown    
116     const Float_t kRCrownInner         = 560.00; // cm    
117     const Float_t kRCrownOuter         = 785.50; // cm
118     const Float_t kLCrown1             = 605.00; // cm
119     const Float_t kLCrown2             = 620.00; // cm
120     const Float_t kLCrown3             = 706.00; // cm
121 // Door
122     const Float_t kRDoorInner          = 246.50; // cm
123     const Float_t kRDoorOuter          = 560.00; // cm
124     const Float_t kLDoor1              = 615.50; // cm
125     const Float_t kLDoor2              = 714.60; // cm
126     
127     
128   //
129   // Top volume 
130   TGeoVolume* top = gGeoManager->GetVolume("ALIC");
131   // Media 
132   TGeoMedium* medAir  = gGeoManager->GetMedium("MAG_AIR_C1");
133   TGeoMedium* medAlu  = gGeoManager->GetMedium("MAG_ALU_C1");  
134   TGeoMedium* medAluI = gGeoManager->GetMedium("MAG_ALU_C0");
135   TGeoMedium* medFe   = gGeoManager->GetMedium("MAG_FE_C1");
136   TGeoMedium* medFeI  = gGeoManager->GetMedium("MAG_FE_C0");
137   //
138   // Offset between LHC and LEP axis
139   Float_t os = -30.;
140
141   //
142   //  Define Barrel Mother 
143   //  
144   TGeoPgon* shBMother = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
145   shBMother->DefineSection(0, -kLBMother, kRBMotherInner, kRBMotherOuter);
146   shBMother->DefineSection(1,  kLBMother, kRBMotherInner, kRBMotherOuter);  
147   // 
148   TGeoVolume* voBMother = new TGeoVolume("L3BM", shBMother, medAir);
149   //
150   // Define Thermal Shield
151   //
152   TGeoPgon* shThermSh = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
153   shThermSh->DefineSection(0, -kLCoil, kRThermalShieldInner, kRThermalShieldOuter);
154   shThermSh->DefineSection(1,  kLCoil, kRThermalShieldInner, kRThermalShieldOuter);  
155   // 
156   TGeoVolume* voThermSh = new TGeoVolume("L3TS", shThermSh, medAluI);
157   voBMother->AddNode(voThermSh, 1, new TGeoTranslation(0., 0., 0.));
158   //  
159   // Define Coils
160   //
161   TGeoPgon* shCoils = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
162   shCoils->DefineSection(0, -kLCoil, kRCoilInner, kRCoilOuter);
163   shCoils->DefineSection(1,  kLCoil, kRCoilInner, kRCoilOuter);  
164   // 
165   TGeoVolume* voCoils = new TGeoVolume("L3C0", shCoils, medAlu);
166   voBMother->AddNode(voCoils, 1, new TGeoTranslation(0., 0., 0.));
167   //
168   // Define Yoke
169   //
170   TGeoPgon* shYoke = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
171   shYoke->DefineSection(0, -kLYoke, kRYokeInner, kRYokeOuter);
172   shYoke->DefineSection(1, +kLYoke, kRYokeInner, kRYokeOuter);  
173   // 
174   TGeoVolume* voYoke = new TGeoVolume("L3YO", shYoke, medFe);
175   voBMother->AddNode(voYoke, 1, new TGeoTranslation(0., 0., 0.));
176
177   //
178   // Define Crown
179   //
180   TGeoPgon* shCrown = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 4);
181   shCrown->DefineSection(0,  kLCrown1, kRCrownInner, kRYokeInner);
182   shCrown->DefineSection(1,  kLCrown2, kRCrownInner, kRYokeInner);  
183   shCrown->DefineSection(2,  kLCrown2, kRCrownInner, kRCrownOuter);  
184   shCrown->DefineSection(3,  kLCrown3, kRCrownInner, kRCrownOuter);  
185   // 
186   TGeoVolume* voCrown = new TGeoVolume("L3CR", shCrown, medFe);
187   //
188   // Define Door 
189   //
190   // Original outer part
191   TGeoPgon* shDoorO = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 2);
192   shDoorO->DefineSection(0,  kLDoor1, kRDoorInner, kRDoorOuter);
193   shDoorO->DefineSection(1,  kLDoor2, kRDoorInner, kRDoorOuter);  
194   shDoorO->SetName("A");
195   //
196   // Additional inner part
197   TGeoPgon* shDoorI = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 3);
198   shDoorI->DefineSection(0,  kLDoor1, 163.5, 280.);
199   shDoorI->DefineSection(1,  686.,    163.5, 280.);  
200   shDoorI->DefineSection(2,  kLDoor2, 213.5, 280.);
201   shDoorI->SetName("B"); 
202   //
203   // For transport: low thresholds close to chambers requires special medium
204   //
205   TGeoPgon* shDoorIe = new TGeoPgon(kStartAngle, kFullAngle, kNSides, 3);
206   shDoorIe->DefineSection(0,  kLDoor1, 163.5, 168.5);
207   shDoorIe->DefineSection(1,  686.,    163.5, 168.5);  
208   shDoorIe->DefineSection(2,  kLDoor2, 213.5, 218.5);
209   TGeoVolume* voDoorIe = new TGeoVolume("L3DE", shDoorIe, medFeI);
210   //
211   // Use composite shape here to account for the excentric door opening.
212   // This avoids the overlap with the beam shield and the muon tracking station 1
213   //
214   TGeoTranslation* offset = new TGeoTranslation("t1", 0., -os, 0.);
215   offset->RegisterYourself();
216     
217   TGeoCompositeShape* shDoor = new TGeoCompositeShape("L3Door", "A+B:t1");
218   //
219   TGeoVolume* voDoor = new TGeoVolume("L3DO", shDoor, medFe);
220   voDoor->AddNode(voDoorIe, 1, new TGeoTranslation(0., -os, 0.));
221   // Position crown and door
222   TGeoRotation* rotxz = new TGeoRotation("rotxz",  90., 0., 90., 90., 180., 0.);
223
224   TGeoVolumeAssembly *l3 = new TGeoVolumeAssembly("L3MO");
225   voBMother->AddNode(voCrown, 1, new TGeoTranslation(0., 0., 0.));  
226   voBMother->AddNode(voCrown, 2, new TGeoCombiTrans(0., 0., 0., rotxz));
227   l3->AddNode(voBMother, 1, new TGeoTranslation(0.,0.,0.));
228   l3->AddNode(voDoor,  1, new TGeoTranslation(0., 0., 0.));  
229   l3->AddNode(voDoor,  2, new TGeoCombiTrans(0., 0., 0., rotxz));
230   top->AddNode(l3, 1, new TGeoTranslation(0., os, 0.));
231 }
232
233 //_____________________________________________________________________________
234 void AliMAG::CreateMaterials()
235 {
236   //
237   // Create materials for L3 magnet
238   //
239   
240   Int_t   isxfld = gAlice->Field()->Integ();
241   Float_t sxmgmx = gAlice->Field()->Max();
242   Float_t epsil, stmin, deemax, tmaxfd, stemax;
243
244
245   // --- Define the various materials for GEANT --- 
246   
247   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
248   Float_t zAir[4]={6.,7.,8.,18.};
249   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
250   Float_t dAir = 1.20479E-3;
251
252
253   //     Aluminum 
254   AliMaterial(9, "Al0$", 26.98, 13., 2.7, 8.9, 37.2);
255   AliMaterial(29, "Al1$", 26.98, 13., 2.7, 8.9, 37.2);
256   
257   //     Iron 
258   AliMaterial(10, "Fe0$", 55.85, 26., 7.87, 1.76, 17.1);
259   AliMaterial(30, "Fe1$", 55.85, 26., 7.87, 1.76, 17.1);
260   
261   //     Air 
262   AliMixture(15, "AIR0$      ", aAir, zAir, dAir, 4, wAir);
263   AliMixture(35, "AIR1$      ", aAir, zAir, dAir, 4, wAir);
264   
265   // **************** 
266   //     Defines tracking media parameters. 
267   //     Les valeurs sont commentees pour laisser le defaut 
268   //     a GEANT (version 3-21, page CONS200), f.m. 
269   epsil  = .001;  // Tracking precision, 
270   stemax = -1.;   // Maximum displacement for multiple scat 
271   tmaxfd = -20.;  // Maximum angle due to field deflection 
272   deemax = -.3;   // Maximum fractional energy loss, DLS 
273   stmin  = -.8;
274   // *************** 
275   
276   //    IRON 
277   
278   AliMedium(10, "FE_C0             ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
279   AliMedium(30, "FE_C1             ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
280   
281   //     ALUMINUM 
282
283   AliMedium(9, "ALU_C0            ",  9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
284   AliMedium(29, "ALU_C1            ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
285   
286   //     AIR 
287   
288   AliMedium(15, "AIR_C0            ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
289   AliMedium(35, "AIR_C1            ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
290 }
291
292 //_____________________________________________________________________________
293 void AliMAG::DrawModule() const
294 {
295   //
296   // Draw a shaded view of the L3 magnet
297   //
298 }
299
300 //_____________________________________________________________________________
301 void AliMAG::Init()
302 {
303   //
304   // Initialise L3 magnet after it has been built
305   Int_t i;
306   //
307   if(AliLog::GetGlobalDebugLevel()>0) {
308     printf("\n%s: ",ClassName());
309     for(i=0;i<35;i++) printf("*");
310     printf(" MAG_INIT ");
311     for(i=0;i<35;i++) printf("*");
312     printf("\n%s: ",ClassName());
313     //
314     // Here the MAG initialisation code (if any!)
315     for(i=0;i<80;i++) printf("*");
316     printf("\n");
317   }
318 }
319