0a85365ad8c6ab950c536b581e9365d2d3067e54
[u/mrichter/AliRoot.git] / STRUCT / AliBODY.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:32:51  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 //  Alice external volume                                                    //
32 //  This class contains the description of the Alice external volume         //
33 //                                                                           //
34 //Begin_Html
35 /*
36 <img src="picts/AliBODYClass.gif">
37 </pre>
38 <br clear=left>
39 <font size=+2 color=red>
40 <p>The responsible person for this module is
41 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
42 </font>
43 <pre>
44 */
45 //End_Html
46 //                                                                           //
47 //                                                                           //
48 ///////////////////////////////////////////////////////////////////////////////
49
50 #include "AliRun.h"
51 #include "AliMC.h"
52 #include "AliMagF.h"
53 #include "AliBODY.h"
54
55 ClassImp(AliBODY)
56  
57 //_____________________________________________________________________________
58 AliBODY::AliBODY()
59 {
60   //
61   // Default constructor
62   //
63 }
64  
65 //_____________________________________________________________________________
66 AliBODY::AliBODY(const char *name, const char *title)
67        : AliModule(name,title)
68 {
69   //
70   // Standard constructor of the Alice external volume
71   //
72   SetMarkerColor(7);
73   SetMarkerStyle(2);
74   SetMarkerSize(0.4);
75 }
76  
77 //_____________________________________________________________________________
78 void AliBODY::CreateGeometry()
79 {
80   //
81   // Create the geometry of the Alice external body
82   //
83   //Begin_Html
84   /*
85     <img src="picts/AliBODYTree.gif">
86   */
87   //End_Html
88   //
89   // If the ZDC is present we have an asymmetric box
90   // made by a four sides polygone
91   //  
92   //Begin_Html
93   /*
94     <img src="picts/AliBODYLarge.gif">
95   */
96   //End_Html
97   //
98   // If the ZDC is not present make just a BOX
99   //
100   //Begin_Html
101   /*
102     <img src="picts/AliBODYSmall.gif">
103   */
104   //End_Html
105
106   Float_t dALIC[10];
107   Int_t *idtmed = fIdtmed->GetArray()+1;
108   //
109   if(gAlice->GetModule("ZDC")) {
110     //
111     // If the ZDC is present we have an asymmetric box
112     // made by a four sides polygone
113     //
114     dALIC[0]=45;
115     dALIC[1]=360;
116     dALIC[2]=4;
117     dALIC[3]=2;
118     dALIC[4]=-3000;
119     dALIC[5]=0;
120     dALIC[6]=2000;
121     dALIC[7]=15000;
122     dALIC[8]=0;
123     dALIC[9]=2000;
124     gMC->Gsvolu("ALIC","PGON",idtmed[1],dALIC,10);
125   } else if ( gAlice->GetModule("CRT")) {
126     //
127     // If the Cosmic Ray Trigger  is present we need a large box
128     // 
129     //
130     dALIC[0]=5000.;
131     dALIC[1]=5000.;
132     dALIC[2]=15000.;
133     gMC->Gsvolu("ALIC","BOX ",idtmed[1],dALIC,3);
134       
135   } else {
136     //
137     // If the ZDC and CRT are not present make just a BOX
138     //
139     dALIC[0]=2000;
140     dALIC[1]=2000;
141     dALIC[2]=3000;
142     gMC->Gsvolu("ALIC","BOX ",idtmed[1],dALIC,3);
143   }
144 }
145  
146 //_____________________________________________________________________________
147 void AliBODY::CreateMaterials()
148 {
149 // Create materials and media
150   Int_t isxfld = gAlice->Field()->Integ();
151   Float_t sxmgmx = gAlice->Field()->Max();
152   //
153   AliMaterial(1,"Vacuum  $",1.e-16,1.e-16,1.e-16,1.e16,1.e16);
154   AliMaterial(2,"Air     $",14.61,7.3,0.001205,30420,67500);
155   AliMaterial(3,"Be      $", 9.01,4 ,1.848   ,35.30,36.70);
156   //
157   AliMedium(1,"Vacuum  $",1,0,isxfld,sxmgmx,10,1,0.1,0.1,10);
158   AliMedium(2,"Air     $",2,0,isxfld,sxmgmx,10,-1,-0.1,0.1 ,-10);
159   AliMedium(3,"Be pipe $",3,0,isxfld,sxmgmx,10,0.1,0.1,0.01,0.01);
160 }
161  
162 //_____________________________________________________________________________
163 void AliBODY::DrawModule()
164 {
165   //
166   // Draw a view of the Alice outside box
167   //
168   // Set everything unseen
169   gMC->Gsatt("*", "seen", -1);
170   // 
171   // Set ALIC mother visible
172   gMC->Gsatt("ALIC","SEEN",1);
173   //
174   // Set the volumes visible
175   //
176   gMC->Gdopt("hide","off");
177   if(gAlice->GetModule("ZDC")) {
178     //
179     // ZDC is present
180     //
181     gMC->DefaultRange();
182     gMC->Gdraw("alic", 40, 30, 0, 15, 10, .0014, .0014);
183     gMC->Gdhead(1111, "Aice Main body with Zero Degree Calorimeter");
184   } else {
185     //
186     // ZDC is not present
187     //
188     gMC->Gdraw("alic", 40, 30, 0, 10, 9, .0027, .0027);
189     gMC->Gdhead(1111, "Aice Main body");
190   }
191   gMC->Gdman(18, 4, "MAN");
192 }
193  
194