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