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