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 **************************************************************************/
18 #include <Riostream.h>
22 #include <TGeometry.h>
27 #include <TFile.h> // only required for Tracking function?
29 #include <TObjArray.h>
30 #include <TLorentzVector.h>
31 #include <TObjString.h>
32 #include <TClonesArray.h>
39 #include "AliITSGeometryITSV.h"
41 ClassImp(AliITSGeometryITSV)
43 //______________________________________________________________________
44 AliITSGeometryITSV::AliITSGeometryITSV() : AliITSBaseGeometry(){
45 //Default Constructor for SSD Cone geometry
55 //______________________________________________________________________
56 AliITSGeometryITSV::AliITSGeometryITSV(AliITS *its,const char *moth):
57 AliITSBaseGeometry(its,0){
58 //Standard Constructor for SSD Cone geometry
60 // const char *moth, The volume name into which the ITS mother volume
67 fAir = 5; // Air material number.
69 fA.Size(16,"ITS Mother Volume");
70 fA.SetVid(ITSG3VnameToIndex("ITSV")); // ITSV is a special name.
78 fA.Z(0) = -ztpc-5.0-0.1;
138 fA.Z(15) = ztpc+4.+0.1;
142 //______________________________________________________________________
143 void AliITSGeometryITSV::CreateG3Geometry(){
144 // Calls Geant 3 geometry inilization routines with the information
145 // stored in this class.
156 //______________________________________________________________________
157 void 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.
161 // const char *moth, The volume name into which the ITS mother volume
163 // Int_t copy copy number.
164 // TVector &t Translection vector
165 // Int_t irot Rotation matrix index number
171 gMC->Gspos("ITSV",1,moth,t.X(),t.Y(),t.Z(),irot,"ONLY");
174 //______________________________________________________________________
175 void AliITSGeometryITSV::CreateG3Materials(){
176 // Fills the Geant 3 banks with Material and Medium definisions.
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
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
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.
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);
208 //______________________________________________________________________
209 void AliITSGeometryITSV::BuildDisplayGeometry(){
210 // Fill Root geometry banks for fast simple ITS simulation event
211 // display. See Display.C, and related code, for more details.
219 // No need to display ITS cones.
222 //______________________________________________________________________
223 void 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
228 // AliITSPConeData &d Object with poly cone data stored in it.
229 // Int_t med media index number.
238 param = new Float_t[n];
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);
247 if(fVolName==0){ // must create array.
248 fVolNameSize = 38624;
249 fVolName = new TString[fVolNameSize];
252 d.SetVid(ITSG3VnameToIndex("ITSV"));
253 fVolName[d.GetVid()] = (d.GetName())->Data();
254 gMC->Gsvolu("ITSV","PCON",GetMed(med),param,n);