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