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