24 #include "G4LogicalVolume.hh"
25 #include "G4NistManager.hh"
27 #include "G4PVPlacement.hh"
28 #include "G4RunManager.hh"
29 #include "G4Sphere.hh"
30 #include "G4SystemOfUnits.hh"
37 static_cast<int>(Telescope::TelescopeSurfaceType::Plane),
38 "only plan is supported right now");
43 if (m_world !=
nullptr) {
48 (
m_cfg.positions.back() +
m_cfg.positions.front()) * 0.5 *
mm;
52 G4NistManager* nist = G4NistManager::Instance();
57 std::max({std::abs(
m_cfg.offsets[0]) +
m_cfg.bounds[0] * 0.5,
58 std::abs(
m_cfg.offsets[1]) +
m_cfg.bounds[1] * 0.5,
63 G4double envSizeX =
m_cfg.bounds[0] *
mm;
64 G4double envSizeY =
m_cfg.bounds[1] *
mm;
65 G4double envSizeZ = length +
m_cfg.thickness *
mm;
69 G4bool checkOverlaps =
true;
72 G4Material* galactic = nist->FindOrBuildMaterial(
"G4_Galactic");
74 new G4Material(
"Silicon", 14, 28.0855 *
g / mole, 2.329 *
g /
cm3);
79 G4RotationMatrix* rotation =
nullptr;
80 if (static_cast<Acts::BinningValue>(
m_cfg.binValue) ==
82 rotation =
new G4RotationMatrix({0, 0, 1}, {0, 1, 0}, {-1, 0, 0});
83 }
else if (static_cast<Acts::BinningValue>(
m_cfg.binValue) ==
85 rotation =
new G4RotationMatrix({1, 0, 0}, {0, 0, 1}, {0, -1, 0});
90 G4Box* solidWorld =
new G4Box(
"World Solid", worldSize, worldSize, worldSize);
92 G4LogicalVolume* logicWorld =
93 new G4LogicalVolume(solidWorld, galactic,
"World Logic");
95 m_world =
new G4PVPlacement(
nullptr,
107 new G4Box(
"Envelope Solid",
108 0.5 * envSizeX, 0.5 * envSizeY, 0.5 * envSizeZ);
110 G4LogicalVolume* logicEnv1 =
111 new G4LogicalVolume(solidEnv,
113 "Envelope #1 Logic");
116 new G4PVPlacement(rotation,
127 G4LogicalVolume* logicEnv2 =
128 new G4LogicalVolume(solidEnv,
130 "Envelope #2 Logic");
146 G4Box* solidLayer =
new G4Box(
"Layer Solid", 0.5 *
m_cfg.bounds[0],
147 0.5 *
m_cfg.bounds[1], 0.5 *
m_cfg.thickness);
149 G4LogicalVolume* logicLayer =
new G4LogicalVolume(solidLayer,
153 for (std::size_t
i = 0;
i <
m_cfg.positions.size(); ++
i) {
156 G4ThreeVector(0, 0,
m_cfg.positions[
i] *
mm - center),
172 std::unique_ptr<G4VUserDetectorConstruction>
175 return std::make_unique<TelescopeG4DetectorConstruction>(
m_cfg);