File indexing completed on 2025-02-23 09:20:47
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
0034
0035
0036
0037
0038
0039
0040
0041 #include "RMC01DetectorConstruction.hh"
0042
0043 #include "RMC01DetectorMessenger.hh"
0044 #include "RMC01SD.hh"
0045
0046 #include "G4Box.hh"
0047 #include "G4Colour.hh"
0048 #include "G4GeometryManager.hh"
0049 #include "G4LogicalVolume.hh"
0050 #include "G4LogicalVolumeStore.hh"
0051 #include "G4Material.hh"
0052 #include "G4Orb.hh"
0053 #include "G4PVPlacement.hh"
0054 #include "G4PhysicalConstants.hh"
0055 #include "G4PhysicalVolumeStore.hh"
0056 #include "G4RunManager.hh"
0057 #include "G4SDManager.hh"
0058 #include "G4SolidStore.hh"
0059 #include "G4SystemOfUnits.hh"
0060 #include "G4Tubs.hh"
0061 #include "G4VisAttributes.hh"
0062
0063
0064
0065 RMC01DetectorConstruction::RMC01DetectorConstruction()
0066 : G4VUserDetectorConstruction(),
0067 fDetectorMessenger(0),
0068 fShield_Thickness(5. * mm),
0069 fSensitive_cylinder_H(1. * mm),
0070 fSensitive_cylinder_Rout(1. * mm)
0071 {
0072 fDetectorMessenger = new RMC01DetectorMessenger(this);
0073 }
0074
0075
0076
0077 RMC01DetectorConstruction::~RMC01DetectorConstruction()
0078 {
0079 delete fDetectorMessenger;
0080 }
0081
0082
0083
0084 G4VPhysicalVolume* RMC01DetectorConstruction::Construct()
0085 {
0086 DefineMaterials();
0087 return ConstructSimpleGeometry();
0088 }
0089
0090
0091
0092 void RMC01DetectorConstruction::DefineMaterials()
0093 {
0094 G4String symbol;
0095 G4double a, z, density;
0096 G4double fractionmass;
0097 G4int ncomponents;
0098
0099
0100
0101
0102
0103 G4Element* N = new G4Element("Nitrogen", symbol = "N", z = 7., a = 14.01 * g / mole);
0104 G4Element* O = new G4Element("Oxygen", symbol = "O", z = 8., a = 16.00 * g / mole);
0105
0106
0107
0108
0109
0110 new G4Material("Aluminum", z = 13., a = 26.98 * g / mole, density = 2.700 * g / cm3);
0111 new G4Material("Silicon", z = 14., a = 28.09 * g / mole, density = 2.33 * g / cm3);
0112 new G4Material("Tantalum", z = 73., a = 180.9479 * g / mole, density = 16.654 * g / cm3);
0113
0114
0115
0116
0117
0118 G4Material* Air = new G4Material("Air", density = 1.290 * mg / cm3, ncomponents = 2);
0119 Air->AddElement(N, fractionmass = 0.7);
0120 Air->AddElement(O, fractionmass = 0.3);
0121
0122
0123
0124
0125
0126 new G4Material("Vacuum", z = 1., a = 1.01 * g / mole, density = universe_mean_density, kStateGas,
0127 3.e-18 * pascal, 2.73 * kelvin);
0128 }
0129
0130
0131
0132 G4VPhysicalVolume* RMC01DetectorConstruction::ConstructSimpleGeometry()
0133 {
0134
0135
0136 G4GeometryManager::GetInstance()->OpenGeometry();
0137 G4PhysicalVolumeStore::GetInstance()->Clean();
0138 G4LogicalVolumeStore::GetInstance()->Clean();
0139 G4SolidStore::GetInstance()->Clean();
0140
0141
0142
0143
0144 G4Box* solidWorld = new G4Box("World", 15. * cm, 15. * cm, 15. * cm);
0145 G4LogicalVolume* logicWorld =
0146 new G4LogicalVolume(solidWorld, G4Material::GetMaterial("Vacuum"), "World");
0147
0148 G4VPhysicalVolume* physiWorld = new G4PVPlacement(0,
0149 G4ThreeVector(),
0150 logicWorld,
0151 "World",
0152 0,
0153 false,
0154 0);
0155
0156
0157
0158
0159 G4double radiusShieldingSphere = 10. * cm;
0160
0161 G4Orb* solidShieldingSphere = new G4Orb("Shielding", radiusShieldingSphere);
0162 G4LogicalVolume* logicShieldingSphere =
0163 new G4LogicalVolume(solidShieldingSphere, G4Material::GetMaterial("Aluminum"),
0164 "Shielding");
0165
0166 new G4PVPlacement(0,
0167 G4ThreeVector(),
0168 logicShieldingSphere,
0169 "Shielding",
0170 logicWorld,
0171 false,
0172 0);
0173
0174
0175
0176
0177 G4Orb* solidBulkSphere = new G4Orb("Bulk", radiusShieldingSphere - fShield_Thickness);
0178 G4LogicalVolume* logicBulkSphere =
0179 new G4LogicalVolume(solidBulkSphere,
0180 G4Material::GetMaterial("Air"),
0181 "Bulk");
0182
0183 new G4PVPlacement(0,
0184 G4ThreeVector(),
0185 logicBulkSphere,
0186 "Bulk",
0187 logicShieldingSphere,
0188 false,
0189 0);
0190
0191
0192
0193
0194 G4Tubs* solidDetecting = new G4Tubs("SensitiveVolume", 0., fSensitive_cylinder_Rout,
0195 fSensitive_cylinder_H / 2., 0., twopi);
0196
0197 G4LogicalVolume* logicDetectingCylinder =
0198 new G4LogicalVolume(solidDetecting, G4Material::GetMaterial("Silicon"), "SensitiveVolume");
0199
0200 new G4PVPlacement(0,
0201 G4ThreeVector(0., 0., 0.),
0202 logicDetectingCylinder,
0203 "SensitiveVolume",
0204 logicBulkSphere,
0205 false,
0206 0);
0207
0208 RMC01SD* theSensitiveDetector = new RMC01SD("/SensitiveCylinder");
0209
0210 G4SDManager::GetSDMpointer()->AddNewDetector(theSensitiveDetector);
0211 logicDetectingCylinder->SetSensitiveDetector(theSensitiveDetector);
0212
0213
0214
0215 G4Box* solidPlate = new G4Box("TantalumPlate", 4. * cm, 4. * cm, 0.25 * mm);
0216 G4LogicalVolume* logicPlate =
0217 new G4LogicalVolume(solidPlate,
0218 G4Material::GetMaterial("Tantalum"),
0219 "TantalumPlate");
0220
0221 new G4PVPlacement(0,
0222 G4ThreeVector(0., 0., 6. * cm),
0223 logicPlate,
0224 "TantalumPlate1",
0225 logicBulkSphere,
0226 false,
0227 0);
0228
0229 new G4PVPlacement(0,
0230 G4ThreeVector(0., 0., -6. * cm),
0231 logicPlate,
0232 "TantalumPlate2",
0233 logicBulkSphere,
0234 false,
0235 0);
0236
0237 return physiWorld;
0238 }
0239
0240
0241
0242 void RMC01DetectorConstruction::SetSensitiveVolumeRadius(G4double r)
0243 {
0244 fSensitive_cylinder_Rout = r;
0245 }
0246
0247
0248
0249 void RMC01DetectorConstruction::SetSensitiveVolumeHeight(G4double h)
0250 {
0251 fSensitive_cylinder_H = h;
0252 }
0253
0254
0255
0256 void RMC01DetectorConstruction::SetShieldingThickness(G4double d)
0257 {
0258 fShield_Thickness = d;
0259 }
0260
0261