Geant4  10.02.p03
GeometryConstruction Class Reference

#include <GeometryConstruction.hh>

Inheritance diagram for GeometryConstruction:
Collaboration diagram for GeometryConstruction:

Public Member Functions

 GeometryConstruction ()
 
 ~GeometryConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Private Attributes

G4VPhysicalVolumefUniverse_phys
 
G4VPhysicalVolumefAl_phys
 
G4VPhysicalVolumefSphere_phys
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 44 of file GeometryConstruction.hh.

Constructor & Destructor Documentation

◆ GeometryConstruction()

GeometryConstruction::GeometryConstruction ( )

Definition at line 51 of file GeometryConstruction.cc.

53  fUniverse_phys(0),
54  fAl_phys(0),
55  fSphere_phys(0)
56 {;}
G4VPhysicalVolume * fSphere_phys
G4VPhysicalVolume * fAl_phys
G4VPhysicalVolume * fUniverse_phys

◆ ~GeometryConstruction()

GeometryConstruction::~GeometryConstruction ( )

Definition at line 60 of file GeometryConstruction.cc.

61 {;}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * GeometryConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 65 of file GeometryConstruction.cc.

66 {
67  //
68  //
69  // Define materials.
70  //
71  G4double a, z, density,pressure, temperature;
73 
74 
75  density = universe_mean_density; //from PhysicalConstants.h
76  pressure = 3.e-18*pascal;
77  temperature = 2.73*kelvin;
78  G4Material* Vacuum = new G4Material("Vacuum",
79  1., 1.01*g/mole, density,
80  kStateGas,temperature,pressure);
81  a = 26.98154*g/mole;
82  density = 2.70*g/cm3;
83  G4Material* Aluminium = new G4Material(name="aluminium", z=13., a, density);
84 
85  a = 28.0855*g/mole;
86  G4Element* elSi = new G4Element(name="silicon", symbol="Si", z=14., a);
87 
88  a = 16.00*g/mole;
89  G4Element* elO = new G4Element(name="Oxygen", symbol="O", z=8., a);
90 
91  density = 2.65*g/cm3;
92  G4Material* SiliconDioxide =
93  new G4Material(name="silicon oxide", density, 2);
94  SiliconDioxide->AddElement(elSi, 1);
95  SiliconDioxide->AddElement(elO, 2);
96  //
97  // Define size of world and volumes in it.
98  //
99  G4double world_r = 18*cm;
100 
101  G4double box_x = 10*cm;
102  G4double box_y = 10*cm;
103  G4double box_z = 10*cm;
104 
105  G4double sphere_r = 5*cm;
106 
107  // Define bodies, logical volumes and physical volumes.
108  // First define the experimental hall.
109  //
110  G4Sphere * universe_s
111  = new G4Sphere("universe_s", 0, world_r, 0, twopi, 0, pi);
112  G4LogicalVolume * universe_log
113  = new G4LogicalVolume(universe_s,Vacuum,"universe_L",0,0,0);
114  //
116  = new G4PVPlacement(0,G4ThreeVector(),"universe_P",
117  universe_log,0,false,0);
118 
119  //define an aluminium box
120  //
121  G4Box * Al_box
122  = new G4Box("Al_b", box_x, box_y, box_z);
123  G4LogicalVolume * Al_log
124  = new G4LogicalVolume(Al_box,Aluminium,"Box_log",0,0,0);
125  //
126  fAl_phys
127  = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Box_phys",
128  Al_log,fUniverse_phys,false,0);
129 
130  // Define an inner sphere.
131  //
132  G4Sphere * aSphere_sph
133  = new G4Sphere("aSphere", 0, sphere_r, 0, twopi, 0, pi);
134  G4LogicalVolume * aSphere_log
135  = new G4LogicalVolume(aSphere_sph,SiliconDioxide,"Sphere_log",0,0,0);
136  //
138  = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),"Sphere_phys",aSphere_log,
139  fAl_phys,false,0);
140 
141 //--------- Visualization attributes -------------------------------
143  G4VisAttributes* aVisAtt= new G4VisAttributes(G4Colour(0,1.0,1.0));
144  Al_log->SetVisAttributes(aVisAtt);
145  G4VisAttributes* bVisAtt= new G4VisAttributes(G4Colour(1.0,2.0,.0));
146  aSphere_log->SetVisAttributes(bVisAtt);
147 
148  return fUniverse_phys;
149 }
static const double cm
Definition: G4SIunits.hh:118
G4VPhysicalVolume * fSphere_phys
G4String symbol
Definition: TRTMaterials.hh:40
CLHEP::Hep3Vector G4ThreeVector
G4VPhysicalVolume * fAl_phys
int universe_mean_density
Definition: hepunit.py:307
Definition: G4Box.hh:64
G4String name
Definition: TRTMaterials.hh:40
G4VPhysicalVolume * fUniverse_phys
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
G4Element * elO
Definition: TRTMaterials.hh:46
#define pascal
static const double twopi
Definition: G4SIunits.hh:75
static const double cm3
Definition: G4SIunits.hh:120
static const double kelvin
Definition: G4SIunits.hh:278
static const double pi
Definition: G4SIunits.hh:74
static const G4VisAttributes Invisible
static const double mole
Definition: G4SIunits.hh:283
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:364
double G4double
Definition: G4Types.hh:76
void SetVisAttributes(const G4VisAttributes *pVA)
Here is the call graph for this function:

Member Data Documentation

◆ fAl_phys

G4VPhysicalVolume* GeometryConstruction::fAl_phys
private

Definition at line 54 of file GeometryConstruction.hh.

◆ fSphere_phys

G4VPhysicalVolume* GeometryConstruction::fSphere_phys
private

Definition at line 55 of file GeometryConstruction.hh.

◆ fUniverse_phys

G4VPhysicalVolume* GeometryConstruction::fUniverse_phys
private

Definition at line 53 of file GeometryConstruction.hh.


The documentation for this class was generated from the following files: