File indexing completed on 2026-04-17 07:52:11
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 #include "DetectorConstruction.hh"
0040
0041 #include "G4Box.hh"
0042 #include "G4LogicalVolume.hh"
0043 #include "G4Material.hh"
0044 #include "G4NistManager.hh"
0045 #include "G4PVPlacement.hh"
0046 #include "G4PhysicalConstants.hh"
0047 #include "G4SystemOfUnits.hh"
0048 #include "G4ThreeVector.hh"
0049 #include "globals.hh"
0050
0051
0052
0053 DetectorConstruction::DetectorConstruction() : G4VUserDetectorConstruction(), fAbsorberMaterial(0)
0054 {}
0055
0056
0057
0058 DetectorConstruction::~DetectorConstruction() {}
0059
0060
0061
0062 G4VPhysicalVolume* DetectorConstruction::Construct()
0063 {
0064
0065
0066
0067
0068 G4NistManager* nistManager = G4NistManager::Instance();
0069
0070
0071 G4Material* iron = nistManager->FindOrBuildMaterial("G4_Fe");
0072
0073
0074 G4Material* copper = nistManager->FindOrBuildMaterial("G4_Cu");
0075
0076
0077 G4Material* tungsten = nistManager->FindOrBuildMaterial("G4_W");
0078
0079
0080 G4Material* lead = nistManager->FindOrBuildMaterial("G4_Pb");
0081
0082
0083 G4Material* uranium = nistManager->FindOrBuildMaterial("G4_U");
0084
0085
0086 G4double a, z, density;
0087 density = 1.4 * g / cm3;
0088 a = 39.95 * g / mole;
0089 G4Material* liquidArgon = new G4Material("LiquidArgon", z = 18., a, density);
0090
0091
0092
0093 G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
0094
0095
0096
0097 G4double pressure, temperature, fractionMass;
0098 G4int nel;
0099 density = 1.e-5 * g / cm3;
0100 pressure = 2.e-2 * bar;
0101 temperature = STP_Temperature;
0102 G4Material* vacuum =
0103 new G4Material("G4vacuum", density, nel = 1, kStateGas, temperature, pressure);
0104 vacuum->AddMaterial(air, fractionMass = 1.);
0105
0106
0107
0108
0109 G4int natoms;
0110 G4Element* elH = nistManager->FindOrBuildElement("H");
0111 G4Element* elC = nistManager->FindOrBuildElement("C");
0112 density = 1.032 * g / cm3;
0113 G4Material* polystyrene = new G4Material("Polystyrene", density, nel = 2);
0114 polystyrene->AddElement(elC, natoms = 19);
0115 polystyrene->AddElement(elH, natoms = 21);
0116
0117
0118 G4Element* elPb = nistManager->FindOrBuildElement("Pb");
0119 G4Element* elW = nistManager->FindOrBuildElement("W");
0120 G4Element* elO = nistManager->FindOrBuildElement("O");
0121 density = 8.28 * g / cm3;
0122 G4Material* pbWO4 = new G4Material("PbWO4", density, nel = 3);
0123 pbWO4->AddElement(elPb, natoms = 1);
0124 pbWO4->AddElement(elW, natoms = 1);
0125 pbWO4->AddElement(elO, natoms = 4);
0126
0127
0128
0129
0130
0131
0132
0133 const G4double sizeExpHall = 4.0 * m;
0134
0135
0136 G4double expHall_x = sizeExpHall / 2.0;
0137 G4double expHall_y = sizeExpHall / 2.0;
0138 G4double expHall_z = sizeExpHall / 2.0;
0139
0140 G4Box* experimentalHall_box = new G4Box("expHall_box", expHall_x, expHall_y, expHall_z);
0141
0142 G4LogicalVolume* experimentalHallLog = new G4LogicalVolume(experimentalHall_box,
0143 vacuum,
0144 "expHall_log",
0145 0,
0146 0,
0147 0);
0148
0149 G4VPhysicalVolume* experimentalHallPhys =
0150 new G4PVPlacement(0,
0151 G4ThreeVector(),
0152 "expHall",
0153 experimentalHallLog,
0154 0,
0155 false,
0156 0);
0157
0158
0159
0160
0161 const G4double sizeCalo = 2.0 * m;
0162
0163
0164 G4double xAbsorber = sizeCalo / 2.0;
0165 G4double yAbsorber = sizeCalo / 2.0;
0166 G4double zAbsorber = sizeCalo / 2.0;
0167
0168 G4Box* solidAbsorber = new G4Box("solidAbsorber", xAbsorber, yAbsorber, zAbsorber);
0169
0170 G4LogicalVolume* logicAbsorber = new G4LogicalVolume(solidAbsorber,
0171 fAbsorberMaterial,
0172 "logicAbsorber",
0173 0,
0174 0,
0175 0);
0176
0177 new G4PVPlacement(0,
0178 G4ThreeVector(),
0179 "physiAbsorber",
0180 logicAbsorber,
0181 experimentalHallPhys,
0182 false,
0183 100);
0184
0185
0186 if ((!iron) || (!copper) || (!tungsten) || (!lead) || (!uranium) || (!pbWO4) || (!polystyrene)
0187 || (!liquidArgon))
0188 {
0189 G4cerr << "Failure in building materials." << G4endl;
0190 }
0191
0192
0193 fAbsorberMaterial = iron;
0194
0195
0196
0197
0198
0199
0200
0201
0202 logicAbsorber->SetMaterial(fAbsorberMaterial);
0203
0204 PrintParameters();
0205
0206 return experimentalHallPhys;
0207 }
0208
0209
0210
0211 void DetectorConstruction::PrintParameters()
0212 {
0213 G4cout << G4endl << G4endl << " ------ DetectorConstruction::PrintParameters() ------ " << G4endl
0214 << " Absorber Material = ";
0215 if (fAbsorberMaterial) {
0216 G4cout << fAbsorberMaterial->GetName();
0217 }
0218 else {
0219 G4cout << " UNDEFINED ";
0220 }
0221 G4cout << G4endl << " -------------------------------------------------------- " << G4endl
0222 << G4endl;
0223 }
0224
0225