]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSGeometryITSV.cxx
Code causing warning messages corrected.
[u/mrichter/AliRoot.git] / ITS / AliITSGeometryITSV.cxx
CommitLineData
162acd47 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
803d1ab0 16/* $Id$ */
162acd47 17
18#include <Riostream.h>
19#include <stdio.h>
20#include <stdlib.h>
21#include <TMath.h>
22#include <TGeometry.h>
23#include <TNode.h>
24#include <TTUBE.h>
25#include <TTUBS.h>
26#include <TPCON.h>
27#include <TFile.h> // only required for Tracking function?
28#include <TCanvas.h>
29#include <TObjArray.h>
30#include <TLorentzVector.h>
31#include <TObjString.h>
32#include <TClonesArray.h>
33#include <TBRIK.h>
34#include <TSystem.h>
35#include <TVector3.h>
36#include <AliRun.h>
37#include <AliITS.h>
38
39#include "AliITSGeometryITSV.h"
40
41ClassImp(AliITSGeometryITSV)
42
43//______________________________________________________________________
44AliITSGeometryITSV::AliITSGeometryITSV() : AliITSBaseGeometry(){
45 //Default Constructor for SSD Cone geometry
46 // Inputs:
47 // none.
48 // Outputs:
49 // none.
50 // Return:
51 // none.
52
53 SetScalemm();
54}
55//______________________________________________________________________
56AliITSGeometryITSV::AliITSGeometryITSV(AliITS *its,const char *moth):
57 AliITSBaseGeometry(its,0){
58 //Standard Constructor for SSD Cone geometry
59 // Inputs:
60 // const char *moth, The volume name into which the ITS mother volume
61 // will reside.
62 // Outputs:
63 // none.
64 // Return:
65 // none.
66
67 fAir = 5; // Air material number.
68
69 fA.Size(16,"ITS Mother Volume");
70 fA.SetVid(ITSG3VnameToIndex("ITSV")); // ITSV is a special name.
71 Double_t rlim = 50.;
72 Double_t zmax = 74.;
73 Double_t ztpc = 284.;
74 //
75 fA.P0() = 0.;
76 fA.dP() = 360.;
77 //
78 fA.Z(0) = -ztpc-5.0-0.1;
79 fA.Rn(0) = 46.0;
80 fA.Rx(0) = 85.0;
81 //
82 fA.Z(1) = -ztpc;
83 fA.Rn(1) = 46;
84 fA.Rx(1) = 85.;
85 //
86 fA.Z(2) = -ztpc;
87 fA.Rn(2) = 46;
88 fA.Rx(2) = rlim+6;
89 //
90 fA.Z(3) = -97.5;
91 fA.Rn(3) = 46;
92 fA.Rx(3) = rlim+6;
93 //
94 fA.Z(4) = -zmax;
95 fA.Rn(4) = 46;
96 fA.Rx(4) = rlim+6;
97 //
98 fA.Z(5) = -48;
99 fA.Rn(5) = 6;
100 fA.Rx(5) = rlim+6;
101 //
102 fA.Z(6) = -28.6;
103 fA.Rn(6) = 6;
104 fA.Rx(6) = rlim+6;
105 //
106 fA.Z(7) = -27.6;
107 fA.Rn(7) = 3.295;
108 fA.Rx(7) = rlim+6;
109 //
110 fA.Z(8) = 27.6;
111 fA.Rn(8) = 3.295;
112 fA.Rx(8) = rlim+6;
113 //
114 fA.Z(9) = 28.6;
115 fA.Rn(9) = 6;
116 fA.Rx(9) = rlim+6;
117 //
118 fA.Z(10) = 48;
119 fA.Rn(10) = 6;
120 fA.Rx(10) = rlim+6;
121 //
122 fA.Z(11) = zmax;
123 fA.Rn(11) = 46;
124 fA.Rx(11) = rlim+6;
125 //
126 fA.Z(12) = 97.5;
127 fA.Rn(12) = 46;
128 fA.Rx(12) = rlim+6;
129 //
130 fA.Z(13) = ztpc;
131 fA.Rn(13) = 62;
132 fA.Rx(13) = 62+4.;
133 //
134 fA.Z(14) = ztpc;
135 fA.Rn(14) = 62;
136 fA.Rx(14) = 85.;
137 //
138 fA.Z(15) = ztpc+4.+0.1;
139 fA.Rn(15) = 62.4;
140 fA.Rx(15) = 85.;
141}
142//______________________________________________________________________
143void AliITSGeometryITSV::CreateG3Geometry(){
144 // Calls Geant 3 geometry inilization routines with the information
145 // stored in this class.
146 // Inputs:
147 // none.
148 // Outputs:
149 // none.
150 // Return:
151 // none.
152
153 PolyCone(fA,fAir);
154 return;
155}
156//______________________________________________________________________
157void AliITSGeometryITSV::PositionGeometry(const char *moth,Int_t cn,
158 TVector3 &t,Int_t irot){
159 // Positions the ITSV geometry in the way needed by Geant3.
160 // Inputs:
161 // const char *moth, The volume name into which the ITS mother volume
162 // will reside.
163 // Int_t copy copy number.
164 // TVector &t Translection vector
165 // Int_t irot Rotation matrix index number
166 // Outputs:
167 // none.
168 // Return:
169 // none.
170
171 gMC->Gspos("ITSV",1,moth,t.X(),t.Y(),t.Z(),irot,"ONLY");
172 return;
173}
174//______________________________________________________________________
175void AliITSGeometryITSV::CreateG3Materials(){
176 // Fills the Geant 3 banks with Material and Medium definisions.
177 // Inputs:
178 // none.
179 // Outputs:
180 // none.
181 // Returns:
182 // none.
183
184 // Dry Air = 78.084% N2, 20.946% O2, 0.934% Ar, 0.033% CO2 by Volume
185 // "Handbook of Chemistry and Physics" 60th eddition, CRC-Press (1980)
186 // page F-211. Others components <0.003% and measured in parts per
187 // million.
188 Int_t i;
189 Int_t Z[4]={6,7,8,18}; //C, N, O, Ar
190 Double_t W[4],f[4]={0.00033,0.78084,0.20946,0.00934};//C02,N2,O2,Ar by vol
191 Double_t T = 293.15; // 20 degrees C.
192 Double_t P = 760.0; // mm of Hg.
193 // op. cite, page F-9.
194 Double_t dens = 1.2929*(273.13/T)*(P/760.0); // Density in grams/leter
195
196 dens *= 1.0E-3; // Convert 1 leter = 1E3 cm^3.
197 // Covert fraction of compounds by volume to graction of atoms by weight.
198 W[0] = GetA(Z[0])*f[0]; // C
199 W[1] = GetA(Z[1])*2.0*f[1]; // N
200 W[2] = GetA(Z[2])*2.0*(f[0]+f[2]); // O
201 W[3] = GetA(Z[3])*f[3];
202 // Renormilize the weights.
203 f[0] = 0.0;
204 for(i=0;i<4;i++) f[0] += W[i];
205 for(i=0;i<4;i++) W[i] /= f[0];
206 MixtureByWeight(fAir,"Dry Standard ITS Air",Z,W,dens,4,0);
207}
208//______________________________________________________________________
209void AliITSGeometryITSV::BuildDisplayGeometry(){
210 // Fill Root geometry banks for fast simple ITS simulation event
211 // display. See Display.C, and related code, for more details.
212 // Inputs:
213 // none.
214 // Outputs:
215 // none.
216 // Return:
217 // none.
218
219 // No need to display ITS cones.
220}
221
222//______________________________________________________________________
223void AliITSGeometryITSV::PolyCone(AliITSPConeData &d,Int_t med){
224 // Interface to TMC->Gsvolu() for ITS PCON geometry. Poly-cone It has 9
225 // parameters or more. See SetScale() for units. Default units are geant
226 // 3 [cm].
227 // Inputs:
228 // AliITSPConeData &d Object with poly cone data stored in it.
229 // Int_t med media index number.
230 // Output:
231 // none.
232 // Return.
233 // none.
234 Float_t *param;
235 Int_t n,i;
236
237 n = 3+3*d.Nz();
238 param = new Float_t[n];
239 param[0] = d.Phi0();
240 param[1] = d.DPhi();
241 param[2] = (Float_t) d.Nz();
242 for(i=0;i<d.Nz();i++){
243 param[3+3*i] = fScale*d.ZAt(i);
244 param[4+3*i] = fScale*d.Rmin(i);
245 param[5+3*i] = fScale*d.Rmax(i);
246 } // end for if
247 if(fVolName==0){ // must create array.
248 fVolNameSize = 38624;
249 fVolName = new TString[fVolNameSize];
250 fVolNameLast = 0;
251 } // end if
252 d.SetVid(ITSG3VnameToIndex("ITSV"));
253 fVolName[d.GetVid()] = (d.GetName())->Data();
254 gMC->Gsvolu("ITSV","PCON",GetMed(med),param,n);
255
256 delete[] param;
257}
258