File indexing completed on 2026-03-30 07:50:13
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "GeometryConstruction.hh"
0030
0031 #include "G4Box.hh"
0032 #include "G4Colour.hh"
0033 #include "G4Element.hh"
0034 #include "G4LogicalVolume.hh"
0035 #include "G4Material.hh"
0036 #include "G4PVPlacement.hh"
0037 #include "G4PhysicalConstants.hh"
0038 #include "G4Sphere.hh"
0039 #include "G4SystemOfUnits.hh"
0040 #include "G4ThreeVector.hh"
0041 #include "G4VisAttributes.hh"
0042
0043
0044
0045 GeometryConstruction::GeometryConstruction()
0046 : G4VUserDetectorConstruction(), fUniverse_phys(0), fAl_phys(0), fSphere_phys(0)
0047 {
0048 ;
0049 }
0050
0051
0052
0053 GeometryConstruction::~GeometryConstruction()
0054 {
0055 ;
0056 }
0057
0058
0059
0060 G4VPhysicalVolume* GeometryConstruction::Construct()
0061 {
0062
0063
0064
0065
0066 G4double a, z, density, pressure, temperature;
0067 G4String name, symbol;
0068
0069 density = universe_mean_density;
0070 pressure = 3.e-18 * pascal;
0071 temperature = 2.73 * kelvin;
0072 G4Material* Vacuum =
0073 new G4Material("Vacuum", 1., 1.01 * g / mole, density, kStateGas, temperature, pressure);
0074 a = 26.98154 * g / mole;
0075 density = 2.70 * g / cm3;
0076 G4Material* Aluminium = new G4Material(name = "aluminium", z = 13., a, density);
0077
0078 a = 28.0855 * g / mole;
0079 G4Element* elSi = new G4Element(name = "silicon", symbol = "Si", z = 14., a);
0080
0081 a = 16.00 * g / mole;
0082 G4Element* elO = new G4Element(name = "Oxygen", symbol = "O", z = 8., a);
0083
0084 density = 2.65 * g / cm3;
0085 G4Material* SiliconDioxide = new G4Material(name = "silicon oxide", density, 2);
0086 SiliconDioxide->AddElement(elSi, 1);
0087 SiliconDioxide->AddElement(elO, 2);
0088
0089
0090
0091 G4double world_r = 18 * cm;
0092
0093 G4double box_x = 10 * cm;
0094 G4double box_y = 10 * cm;
0095 G4double box_z = 10 * cm;
0096
0097 G4double sphere_r = 5 * cm;
0098
0099
0100
0101
0102 G4Sphere* universe_s = new G4Sphere("universe_s", 0, world_r, 0, twopi, 0, pi);
0103 G4LogicalVolume* universe_log = new G4LogicalVolume(universe_s, Vacuum, "universe_L", 0, 0, 0);
0104
0105 fUniverse_phys = new G4PVPlacement(0, G4ThreeVector(), "universe_P", universe_log, 0, false, 0);
0106
0107
0108
0109 G4Box* Al_box = new G4Box("Al_b", box_x, box_y, box_z);
0110 G4LogicalVolume* Al_log = new G4LogicalVolume(Al_box, Aluminium, "Box_log", 0, 0, 0);
0111
0112 fAl_phys =
0113 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), "Box_phys", Al_log, fUniverse_phys, false, 0);
0114
0115
0116
0117 G4Sphere* aSphere_sph = new G4Sphere("aSphere", 0, sphere_r, 0, twopi, 0, pi);
0118 G4LogicalVolume* aSphere_log =
0119 new G4LogicalVolume(aSphere_sph, SiliconDioxide, "Sphere_log", 0, 0, 0);
0120
0121 fSphere_phys =
0122 new G4PVPlacement(0, G4ThreeVector(0., 0., 0.), "Sphere_phys", aSphere_log, fAl_phys, false, 0);
0123
0124
0125 universe_log->SetVisAttributes(G4VisAttributes::GetInvisible());
0126 G4VisAttributes* aVisAtt = new G4VisAttributes(G4Colour(0, 1.0, 1.0));
0127 Al_log->SetVisAttributes(aVisAtt);
0128 G4VisAttributes* bVisAtt = new G4VisAttributes(G4Colour(1.0, 2.0, .0));
0129 aSphere_log->SetVisAttributes(bVisAtt);
0130
0131 return fUniverse_phys;
0132 }
0133
0134