Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exGPSGeometryConstruction.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 //
31 //
33 
34 #include "G4Material.hh"
35 #include "G4Element.hh"
36 #include "G4Box.hh"
37 #include "G4Sphere.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4ThreeVector.hh"
40 #include "G4PVPlacement.hh"
41 #include "G4VisAttributes.hh"
42 #include "G4Colour.hh"
43 #include "G4PhysicalConstants.hh"
44 #include "G4SystemOfUnits.hh"
45 
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
48 
50 : fUniverse_phys(0),
51  fAl_phys(0),
52  fSphere_phys(0)
53 {;}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
56 
58 {;}
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
61 
63 {
64  //
65  //
66  // Define materials.
67  //
68  G4double a, iz, z, density,pressure, temperature;
70 
71 
72  density = universe_mean_density; //from PhysicalConstants.h
73  pressure = 3.e-18*pascal;
74  temperature = 2.73*kelvin;
75  G4Material* Vacuum = new G4Material("Vacuum",
76  1., 1.01*g/mole, density,
77  kStateGas,temperature,pressure);
78  a = 26.98154*g/mole;
79  density = 2.70*g/cm3;
80  G4Material* Aluminium = new G4Material(name="aluminium", z=13., a, density);
81 
82  a = 28.0855*g/mole;
83  G4Element* elSi = new G4Element(name="silicon", symbol="Si", iz=14., a);
84 
85  a = 16.00*g/mole;
86  G4Element* elO = new G4Element(name="Oxygen", symbol="O", iz=8., a);
87 
88  density = 2.65*g/cm3;
89  G4Material* SiliconDioxide =
90  new G4Material(name="silicon oxide", density, 2);
91  SiliconDioxide->AddElement(elSi, 1);
92  SiliconDioxide->AddElement(elO, 2);
93  //
94  // Define size of experiment hall and volumes which will fill it.
95  //
96  G4double world_r = 150.0*mm;
97 
98  G4double box_x = 100.0*mm;
99  G4double box_y = 100.0*mm;
100  G4double box_z = 100.0*mm;
101 
102  G4double sphere_r = 50.0*mm;
103 
104  // Define bodies, logical volumes and physical volumes.
105  // First define the experimental hall.
106  //
107  G4Sphere * universe_s
108  = new G4Sphere("universe_s",0,world_r,0.*deg,360.*deg,0.*deg,180.*deg);
109  G4LogicalVolume * universe_log
110  = new G4LogicalVolume(universe_s,Vacuum,"universe_L",0,0,0);
111  //
112  fUniverse_phys
113  = new G4PVPlacement(0,G4ThreeVector(),"universe_P",
114  universe_log,0,false,0);
115  //define an aluminium box
116  //
117  G4Box * Al_box
118  = new G4Box("Al_b",box_x,box_y,box_z); //
119  G4LogicalVolume * Al_log
120  = new G4LogicalVolume(Al_box,Aluminium,"Box_log",0,0,0);
121  //
122  fAl_phys
123  = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Box_phys",
124  Al_log,fUniverse_phys,false,0);
125  //
126  // Define an inner sphere.
127  //x1
128  G4Sphere * aSphere_sph
129  = new G4Sphere("aSphere",0,sphere_r,0.*deg,360.*deg,0.*deg,180.*deg);
130  G4LogicalVolume * aSphere_log
131  = new G4LogicalVolume(aSphere_sph,SiliconDioxide,"Sphere_log",0,0,0);
132  //
133  fSphere_phys
134  = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Sphere_phys",aSphere_log,
135  fAl_phys,false,0);
136 
137 //--------- Visualization attributes -------------------------------
139  G4VisAttributes* aVisAtt= new G4VisAttributes(G4Colour(0,1.0,1.0));
140  Al_log->SetVisAttributes(aVisAtt);
141  G4VisAttributes* bVisAtt= new G4VisAttributes(G4Colour(1.0,2.0,.0));
142  aSphere_log->SetVisAttributes(bVisAtt);
143 
144  return fUniverse_phys;
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....