File indexing completed on 2025-01-31 09:22:04
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 #include "eRositaDetectorConstruction.hh"
0028 #include "eRositaTrackerSD.hh"
0029
0030 #include "G4Box.hh"
0031 #include "G4Colour.hh"
0032 #include "G4GeometryManager.hh"
0033 #include "G4GeometryTolerance.hh"
0034 #include "G4ios.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4Material.hh"
0037 #include "G4PhysicalConstants.hh"
0038 #include "G4PVParameterised.hh"
0039 #include "G4PVPlacement.hh"
0040 #include "G4SDManager.hh"
0041 #include "G4SystemOfUnits.hh"
0042 #include "G4UserLimits.hh"
0043 #include "G4VisAttributes.hh"
0044
0045
0046
0047 eRositaDetectorConstruction::eRositaDetectorConstruction()
0048 {
0049 }
0050
0051
0052
0053 eRositaDetectorConstruction::~eRositaDetectorConstruction()
0054 {
0055 }
0056
0057
0058
0059 auto eRositaDetectorConstruction::Construct() -> G4VPhysicalVolume*
0060 {
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090 constexpr auto COPPER_ATOMIC_NUMBER{29.};
0091 constexpr auto COPPER_DENSITY{8.92 * g / cm3};
0092 constexpr auto COPPER_MOLAR_MASS{63.55 * g / mole};
0093
0094 auto *copper = new G4Material("Copper", COPPER_ATOMIC_NUMBER, COPPER_MOLAR_MASS, COPPER_DENSITY);
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104 constexpr auto SILICON_ATOMIC_NUMBER{14.};
0105 constexpr auto SILICON_DENSITY{2.33 * g / cm3};
0106 constexpr auto SILICON_MOLAR_MASS{28.09 * g / mole};
0107
0108 auto *silicon = new G4Material("Silicon", SILICON_ATOMIC_NUMBER, SILICON_MOLAR_MASS, SILICON_DENSITY);
0109
0110
0111
0112 constexpr auto VACUUM_ATOMIC_NUMBER{1};
0113 constexpr auto VACUUM_DENSITY{universe_mean_density};
0114 constexpr auto VACUUM_MOLAR_MASS{1.01 * g / mole};
0115 constexpr auto VACUUM_PRESSURE{3.e-18 * pascal};
0116 constexpr auto VACUUM_TEMPERATURE{2.73 * kelvin};
0117
0118 vacuum = new G4Material("Galactic", VACUUM_ATOMIC_NUMBER, VACUUM_MOLAR_MASS, VACUUM_DENSITY, kStateGas, VACUUM_TEMPERATURE, VACUUM_PRESSURE);
0119
0120
0121 G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
0122 G4cout << *(G4Material::GetMaterialTable()) << G4endl;
0123
0124
0125
0126
0127 constexpr auto WORLD_HALF_LENGTH{50.0 * mm};
0128
0129 worldHalfLength = WORLD_HALF_LENGTH;
0130
0131
0132 constexpr auto TARGET_HALF_LENGTH{2.5 * mm};
0133 constexpr auto TARGET_HALF_DEPTH{15.0 * mm};
0134
0135 targetHalfLength = TARGET_HALF_LENGTH;
0136 targetHalfDepth = TARGET_HALF_DEPTH;
0137
0138
0139 constexpr auto TRACKER_HALF_LENGTH{20.0 * mm};
0140 constexpr auto TRACKER_HALF_DEPTH{0.225 * mm};
0141
0142 trackerHalfLength = TRACKER_HALF_LENGTH;
0143 trackerHalfDepth = TRACKER_HALF_DEPTH;
0144
0145
0146
0147
0148 constexpr auto TARGET_INITIAL_POSITION_X{0.0 * cm};
0149 constexpr auto TARGET_INITIAL_POSITION_Y{0.0 * cm};
0150 constexpr auto TARGET_INITIAL_POSITION_Z{0.0 * cm};
0151
0152 targetPositionX = TARGET_INITIAL_POSITION_X;
0153 targetPositionY = TARGET_INITIAL_POSITION_Y;
0154 targetPositionZ = TARGET_INITIAL_POSITION_Z;
0155
0156
0157 constexpr auto TRACKER_INITIAL_POSITION_X{0.0 * cm};
0158 constexpr auto TRACKER_INITIAL_POSITION_Y{2.0 * cm};
0159 constexpr auto TRACKER_INITIAL_POSITION_Z{0.0 * cm};
0160
0161 trackerPositionX = TRACKER_INITIAL_POSITION_X;
0162 trackerPositionY = TRACKER_INITIAL_POSITION_Y;
0163 trackerPositionZ = TRACKER_INITIAL_POSITION_Z;
0164
0165
0166
0167
0168
0169
0170 worldMaterial = vacuum;
0171 targetMaterial = copper;
0172 trackerMaterial = silicon;
0173
0174
0175
0176
0177
0178
0179
0180 worldSolid = new G4Box("world", worldHalfLength, worldHalfLength, worldHalfLength);
0181 worldLogicalVolume = new G4LogicalVolume(worldSolid, worldMaterial, "World", nullptr, nullptr, nullptr);
0182
0183
0184 worldPhysicalVolume = new G4PVPlacement(nullptr,
0185 G4ThreeVector(),
0186 worldLogicalVolume,
0187 "World",
0188 nullptr,
0189 false,
0190 0);
0191
0192
0193
0194
0195
0196 auto targetPosition = G4ThreeVector(targetPositionX, targetPositionY, targetPositionZ);
0197
0198 targetSolid = new G4Box("target", targetHalfLength, targetHalfLength, targetHalfDepth);
0199 targetLogicalVolume = new G4LogicalVolume(targetSolid, targetMaterial, "Target", nullptr, nullptr, nullptr);
0200 targetPhysicalVolume = new G4PVPlacement(nullptr,
0201 targetPosition,
0202 targetLogicalVolume,
0203 "Target",
0204 worldLogicalVolume,
0205 false,
0206 0);
0207
0208
0209
0210
0211
0212 auto trackerPosition = G4ThreeVector(trackerPositionX, trackerPositionY, trackerPositionZ);
0213
0214 trackerSolid = new G4Box("tracker", trackerHalfLength, trackerHalfDepth, trackerHalfLength);
0215 trackerLogicalVolume = new G4LogicalVolume(trackerSolid, trackerMaterial, "Tracker", nullptr, nullptr, nullptr);
0216 trackerPhysicalVolume = new G4PVPlacement(nullptr,
0217 trackerPosition,
0218 trackerLogicalVolume,
0219 "Tracker",
0220 worldLogicalVolume,
0221 false,
0222 0);
0223
0224
0225
0226
0227
0228 constexpr auto TRACKER_SENSITIVE_DETECTOR_NAME{"eRosita/TrackerChamberSD"};
0229 auto *trackerSensitiveDetector = new eRositaTrackerSD(TRACKER_SENSITIVE_DETECTOR_NAME);
0230 trackerLogicalVolume->SetSensitiveDetector(trackerSensitiveDetector);
0231
0232
0233
0234
0235
0236
0237 worldVisualizationStyle = new G4VisAttributes();
0238 worldVisualizationStyle->SetVisibility(false);
0239 worldLogicalVolume->SetVisAttributes(worldVisualizationStyle);
0240
0241
0242 targetVisualizationStyle = new G4VisAttributes();
0243
0244 targetVisualizationStyle->SetColor(G4Color(1.0, 1.0, 1.0));
0245 targetLogicalVolume->SetVisAttributes(targetVisualizationStyle);
0246
0247
0248 trackerVisualizationStyle = new G4VisAttributes();
0249
0250 trackerVisualizationStyle->SetColor(G4Color(1.0, 1.0, 1.0));
0251 trackerLogicalVolume->SetVisAttributes(trackerVisualizationStyle);
0252
0253 return worldPhysicalVolume;
0254 }
0255
0256
0257
0258 void eRositaDetectorConstruction::ConstructSDandField()
0259 {
0260 G4SDManager::GetSDMpointer()->SetVerboseLevel(1);
0261 auto *sensitiveDetectorManager = G4SDManager::GetSDMpointer();
0262
0263 constexpr auto TRACKER_SENSITIVE_DETECTOR_NAME{"eRosita/TrackerChamberSD"};
0264 auto *trackerSensitiveDetector = new eRositaTrackerSD(TRACKER_SENSITIVE_DETECTOR_NAME);
0265 sensitiveDetectorManager->AddNewDetector(trackerSensitiveDetector);
0266 trackerLogicalVolume->SetSensitiveDetector(trackerSensitiveDetector);
0267 }
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282