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