Geant4  10.00.p02
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 //
26 // $Id: exGPSGeometryConstruction.cc 68020 2013-03-13 13:34:15Z gcosmo $
27 //
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 
51  fUniverse_phys(0),
52  fAl_phys(0),
53  fSphere_phys(0)
54 {;}
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
57 
59 {;}
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
62 
64 {
65  //
66  //
67  // Define materials.
68  //
69  G4double a, iz, z, density,pressure, temperature;
71 
72 
73  density = universe_mean_density; //from PhysicalConstants.h
74  pressure = 3.e-18*pascal;
75  temperature = 2.73*kelvin;
76  G4Material* Vacuum = new G4Material("Vacuum",
77  1., 1.01*g/mole, density,
78  kStateGas,temperature,pressure);
79  a = 26.98154*g/mole;
80  density = 2.70*g/cm3;
81  G4Material* Aluminium = new G4Material(name="aluminium", z=13., a, density);
82 
83  a = 28.0855*g/mole;
84  G4Element* elSi = new G4Element(name="silicon", symbol="Si", iz=14., a);
85 
86  a = 16.00*g/mole;
87  G4Element* elO = new G4Element(name="Oxygen", symbol="O", iz=8., a);
88 
89  density = 2.65*g/cm3;
90  G4Material* SiliconDioxide =
91  new G4Material(name="silicon oxide", density, 2);
92  SiliconDioxide->AddElement(elSi, 1);
93  SiliconDioxide->AddElement(elO, 2);
94  //
95  // Define size of experiment hall and volumes which will fill it.
96  //
97  G4double world_r = 150.0*mm;
98 
99  G4double box_x = 100.0*mm;
100  G4double box_y = 100.0*mm;
101  G4double box_z = 100.0*mm;
102 
103  G4double sphere_r = 50.0*mm;
104 
105  // Define bodies, logical volumes and physical volumes.
106  // First define the experimental hall.
107  //
108  G4Sphere * universe_s
109  = new G4Sphere("universe_s",0,world_r,0.*deg,360.*deg,0.*deg,180.*deg);
110  G4LogicalVolume * universe_log
111  = new G4LogicalVolume(universe_s,Vacuum,"universe_L",0,0,0);
112  //
114  = new G4PVPlacement(0,G4ThreeVector(),"universe_P",
115  universe_log,0,false,0);
116  //define an aluminium box
117  //
118  G4Box * Al_box
119  = new G4Box("Al_b",box_x,box_y,box_z); //
120  G4LogicalVolume * Al_log
121  = new G4LogicalVolume(Al_box,Aluminium,"Box_log",0,0,0);
122  //
123  fAl_phys
124  = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Box_phys",
125  Al_log,fUniverse_phys,false,0);
126  //
127  // Define an inner sphere.
128  //x1
129  G4Sphere * aSphere_sph
130  = new G4Sphere("aSphere",0,sphere_r,0.*deg,360.*deg,0.*deg,180.*deg);
131  G4LogicalVolume * aSphere_log
132  = new G4LogicalVolume(aSphere_sph,SiliconDioxide,"Sphere_log",0,0,0);
133  //
135  = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Sphere_phys",aSphere_log,
136  fAl_phys,false,0);
137 
138 //--------- Visualization attributes -------------------------------
140  G4VisAttributes* aVisAtt= new G4VisAttributes(G4Colour(0,1.0,1.0));
141  Al_log->SetVisAttributes(aVisAtt);
142  G4VisAttributes* bVisAtt= new G4VisAttributes(G4Colour(1.0,2.0,.0));
143  aSphere_log->SetVisAttributes(bVisAtt);
144 
145  return fUniverse_phys;
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4String symbol
Definition: TRTMaterials.hh:40
CLHEP::Hep3Vector G4ThreeVector
G4double z
Definition: TRTMaterials.hh:39
Definition: G4Box.hh:64
G4String name
Definition: TRTMaterials.hh:40
G4double a
Definition: TRTMaterials.hh:39
G4double density
Definition: TRTMaterials.hh:39
G4Element * elO
Definition: TRTMaterials.hh:46
static const double deg
Definition: G4SIunits.hh:133
G4double iz
Definition: TRTMaterials.hh:39
static const double cm3
Definition: G4SIunits.hh:108
static const double kelvin
Definition: G4SIunits.hh:260
#define pascal
Definition: G4SIunits.hh:213
static const double g
Definition: G4SIunits.hh:162
static const G4VisAttributes Invisible
static const double mole
Definition: G4SIunits.hh:265
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:363
virtual G4VPhysicalVolume * Construct()
double G4double
Definition: G4Types.hh:76
Definition of the exGPSGeometryConstruction class.
static const double mm
Definition: G4SIunits.hh:102
void SetVisAttributes(const G4VisAttributes *pVA)