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