source: trunk/examples/extended/eventgenerator/exgps/src/exGPSGeometryConstruction.cc @ 1337

Last change on this file since 1337 was 807, checked in by garnier, 16 years ago

update

File size: 5.0 KB
Line 
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// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27//
28//
29#include "exGPSGeometryConstruction.hh"
30
31#include "G4Material.hh"
32#include "G4Element.hh"
33#include "G4Box.hh"
34#include "G4Sphere.hh"
35#include "G4LogicalVolume.hh"
36#include "G4ThreeVector.hh"
37#include "G4PVPlacement.hh"
38
39#include "G4VisAttributes.hh"
40#include "G4Colour.hh"
41
42
43////////////////////////////////////////////////////////////////////////////////
44//
45exGPSGeometryConstruction::exGPSGeometryConstruction ()
46{;}
47////////////////////////////////////////////////////////////////////////////////
48//
49exGPSGeometryConstruction::~exGPSGeometryConstruction ()
50{;}
51////////////////////////////////////////////////////////////////////////////////
52//
53G4VPhysicalVolume* exGPSGeometryConstruction::Construct ()
54{
55  //
56  //
57  // Define materials.
58  //
59  G4double a, iz, z, density,pressure, temperature;
60  G4String name, symbol;
61
62 
63  density     = universe_mean_density;    //from PhysicalConstants.h
64  pressure    = 3.e-18*pascal;
65  temperature = 2.73*kelvin;
66  G4Material* Vacuum   = new G4Material("Vacuum",
67                                        1., 1.01*g/mole, density,
68                                        kStateGas,temperature,pressure);   
69  a = 26.98154*g/mole;
70  density = 2.70*g/cm3;
71  G4Material* Aluminium = new G4Material(name="aluminium", z=13., a, density);
72
73  a = 28.0855*g/mole;
74  G4Element* elSi = new G4Element(name="silicon", symbol="Si", iz=14., a);
75
76  a = 16.00*g/mole;
77  G4Element* elO = new G4Element(name="Oxygen", symbol="O", iz=8., a);
78
79  density = 2.65*g/cm3;
80  G4Material* SiliconDioxide =
81    new G4Material(name="silicon oxide", density, 2);
82  SiliconDioxide->AddElement(elSi, 1);
83  SiliconDioxide->AddElement(elO,  2);
84  //
85  // Define size of experiment hall and volumes which will fill it.
86  //
87  G4double world_r = 150.0*mm;
88
89  G4double box_x = 100.0*mm;
90  G4double box_y = 100.0*mm;
91  G4double box_z = 100.0*mm;
92
93  G4double sphere_r = 50.0*mm;
94
95  // Define bodies, logical volumes and physical volumes.
96  // First define the experimental hall.
97  //
98  G4Sphere * universe_s
99    = new G4Sphere("universe_s",0,world_r,0.*deg,360.*deg,0.*deg,180.*deg);
100  G4LogicalVolume * universe_log
101    = new G4LogicalVolume(universe_s,Vacuum,"universe_L",0,0,0);
102  //
103  universe_phys
104    = new G4PVPlacement(0,G4ThreeVector(),"universe_P",
105                        universe_log,0,false,0);
106  //define an aluminium box
107  //
108  G4Box * Al_box
109    = new G4Box("Al_b",box_x,box_y,box_z);  //
110  G4LogicalVolume * Al_log
111    = new G4LogicalVolume(Al_box,Aluminium,"Box_log",0,0,0);
112  //
113  Al_phys
114    = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Box_phys",
115                        Al_log,universe_phys,false,0);
116  //
117  // Define an inner sphere.
118  //x1
119  G4Sphere * aSphere_sph
120    = new G4Sphere("aSphere",0,sphere_r,0.*deg,360.*deg,0.*deg,180.*deg);
121  G4LogicalVolume * aSphere_log
122    = new G4LogicalVolume(aSphere_sph,SiliconDioxide,"Sphere_log",0,0,0);
123  //
124  aSphere_phys
125    = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Sphere_phys",aSphere_log,
126                        Al_phys,false,0);
127 
128//--------- Visualization attributes -------------------------------
129  universe_log->SetVisAttributes(G4VisAttributes::Invisible);
130  G4VisAttributes* aVisAtt= new G4VisAttributes(G4Colour(0,1.0,1.0));
131  Al_log->SetVisAttributes(aVisAtt);
132  G4VisAttributes* bVisAtt= new G4VisAttributes(G4Colour(1.0,2.0,.0));
133  aSphere_log->SetVisAttributes(bVisAtt);
134
135  return universe_phys;
136}
137
138
139
140
141
142
143
144
145
146
147
Note: See TracBrowser for help on using the repository browser.