File indexing completed on 2025-02-23 09:22: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 #include "MoviesDetectorConstruction.hh"
0031
0032 #include "G4Box.hh"
0033 #include "G4LogicalVolume.hh"
0034 #include "G4Material.hh"
0035 #include "G4NistManager.hh"
0036 #include "G4PVPlacement.hh"
0037 #include "G4PVReplica.hh"
0038 #include "G4PhysicalConstants.hh"
0039 #include "G4SystemOfUnits.hh"
0040 #include "G4VisAttributes.hh"
0041
0042
0043
0044 G4VPhysicalVolume* MoviesDetectorConstruction::Construct()
0045 {
0046
0047 DefineMaterials();
0048
0049
0050 return DefineVolumes();
0051 }
0052
0053
0054
0055 void MoviesDetectorConstruction::DefineMaterials()
0056 {
0057 auto nistManager = G4NistManager::Instance();
0058
0059
0060 nistManager->FindOrBuildMaterial("G4_Pb");
0061
0062
0063 G4double a;
0064 G4double z;
0065 G4double density;
0066 new G4Material("liquidArgon", z = 18., a = 39.95 * g / mole, density = 1.390 * g / cm3);
0067
0068
0069
0070 nistManager->FindOrBuildMaterial("G4_Galactic");
0071
0072
0073 G4cout << *(G4Material::GetMaterialTable()) << G4endl;
0074 }
0075
0076
0077
0078 G4VPhysicalVolume* MoviesDetectorConstruction::DefineVolumes()
0079 {
0080
0081 const G4bool checkOverlaps = true;
0082
0083
0084 const G4double worldSizeXY = 1. * m;
0085 const G4double worldSizeZ = 1. * m;
0086
0087
0088 G4int nofLayers = 10;
0089 G4double absoThickness = 10. * mm;
0090 G4double gapThickness = 5. * mm;
0091 G4double calorSizeXY = 10. * cm;
0092
0093 auto layerThickness = absoThickness + gapThickness;
0094 auto calorThickness = nofLayers * layerThickness;
0095
0096
0097 auto defaultMaterial = G4Material::GetMaterial("G4_Galactic");
0098 auto absorberMaterial = G4Material::GetMaterial("G4_Pb");
0099 auto gapMaterial = G4Material::GetMaterial("liquidArgon");
0100
0101
0102 auto worldS = new G4Box("World", worldSizeXY / 2, worldSizeXY / 2, worldSizeZ / 2);
0103
0104 auto worldLV = new G4LogicalVolume(worldS,
0105 defaultMaterial,
0106 "World");
0107
0108 auto worldPV = new G4PVPlacement(0,
0109 G4ThreeVector(),
0110 worldLV,
0111 "World",
0112 0,
0113 false,
0114 0,
0115 checkOverlaps);
0116
0117
0118
0119 auto calorimeterS =
0120 new G4Box("Calorimeter", calorSizeXY / 2, calorSizeXY / 2, calorThickness / 2);
0121
0122 auto calorLV = new G4LogicalVolume(calorimeterS,
0123 defaultMaterial,
0124 "Calorimeter");
0125
0126 new G4PVPlacement(0,
0127 G4ThreeVector(),
0128 calorLV,
0129 "Calorimeter",
0130 worldLV,
0131 false,
0132 0,
0133 checkOverlaps);
0134
0135
0136
0137 auto layerS = new G4Box("Layer",
0138 calorSizeXY / 2, calorSizeXY / 2, layerThickness / 2);
0139
0140 auto layerLV = new G4LogicalVolume(layerS,
0141 defaultMaterial,
0142 "Layer");
0143
0144 new G4PVReplica("Layer",
0145 layerLV,
0146 calorLV,
0147 kZAxis,
0148 nofLayers,
0149 layerThickness);
0150
0151
0152
0153 auto absorberS = new G4Box("Abso",
0154 calorSizeXY / 2, calorSizeXY / 2, absoThickness / 2);
0155
0156 auto absorberLV = new G4LogicalVolume(absorberS,
0157 absorberMaterial,
0158 "Abso");
0159
0160 new G4PVPlacement(0,
0161 G4ThreeVector(0., 0., -gapThickness / 2),
0162 absorberLV,
0163 "Abso",
0164 layerLV,
0165 false,
0166 0,
0167 checkOverlaps);
0168
0169
0170
0171 auto gapS = new G4Box("Gap",
0172 calorSizeXY / 2, calorSizeXY / 2, gapThickness / 2);
0173
0174 auto gapLV = new G4LogicalVolume(gapS,
0175 gapMaterial,
0176 "Gap");
0177
0178 new G4PVPlacement(0,
0179 G4ThreeVector(0., 0., absoThickness / 2),
0180 gapLV,
0181 "Gap",
0182 layerLV,
0183 false,
0184 0,
0185 checkOverlaps);
0186
0187
0188 worldLV->SetVisAttributes(G4VisAttributes::GetInvisible());
0189
0190 return worldPV;
0191 }