1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
21 #include <Riostream.h>
25 #include <TGeometry.h>
30 #include <TFile.h> // only required for Tracking function?
32 #include <TObjArray.h>
33 #include <TLorentzVector.h>
34 #include <TObjString.h>
35 #include <TClonesArray.h>
42 #include "AliITSGeometryITSV.h"
44 ClassImp(AliITSGeometryITSV)
46 //______________________________________________________________________
47 AliITSGeometryITSV::AliITSGeometryITSV() : AliITSBaseGeometry(){
48 //Default Constructor for SSD Cone geometry
58 //______________________________________________________________________
59 AliITSGeometryITSV::AliITSGeometryITSV(AliITS *its,const char *moth):
60 AliITSBaseGeometry(its,0){
61 //Standard Constructor for SSD Cone geometry
63 // const char *moth, The volume name into which the ITS mother volume
70 fAir = 5; // Air material number.
72 fA.Size(16,"ITS Mother Volume");
73 fA.SetVid(ITSG3VnameToIndex("ITSV")); // ITSV is a special name.
81 fA.Z(0) = -ztpc-5.0-0.1;
141 fA.Z(15) = ztpc+4.+0.1;
145 //______________________________________________________________________
146 void AliITSGeometryITSV::CreateG3Geometry(){
147 // Calls Geant 3 geometry inilization routines with the information
148 // stored in this class.
159 //______________________________________________________________________
160 void 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.
164 // const char *moth, The volume name into which the ITS mother volume
166 // Int_t copy copy number.
167 // TVector &t Translection vector
168 // Int_t irot Rotation matrix index number
174 gMC->Gspos("ITSV",1,moth,t.X(),t.Y(),t.Z(),irot,"ONLY");
177 //______________________________________________________________________
178 void AliITSGeometryITSV::CreateG3Materials(){
179 // Fills the Geant 3 banks with Material and Medium definisions.
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
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
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.
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);
211 //______________________________________________________________________
212 void AliITSGeometryITSV::BuildDisplayGeometry(){
213 // Fill Root geometry banks for fast simple ITS simulation event
214 // display. See Display.C, and related code, for more details.
222 // No need to display ITS cones.
225 //______________________________________________________________________
226 void 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
231 // AliITSPConeData &d Object with poly cone data stored in it.
232 // Int_t med media index number.
241 param = new Float_t[n];
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);
250 if(fVolName==0){ // must create array.
251 fVolNameSize = 38624;
252 fVolName = new TString[fVolNameSize];
255 d.SetVid(ITSG3VnameToIndex("ITSV"));
256 fVolName[d.GetVid()] = (d.GetName())->Data();
257 gMC->Gsvolu("ITSV","PCON",GetMed(med),param,n);