19#include "BDSTunnelFactoryBase.hh"
20#include "BDSTunnelFactoryRectangular.hh"
21#include "BDSTunnelInfo.hh"
25#include "G4CutTubs.hh"
26#include "G4IntersectionSolid.hh"
27#include "G4LogicalVolume.hh"
28#include "G4SubtractionSolid.hh"
29#include "G4ThreeVector.hh"
38BDSTunnelFactoryRectangular::BDSTunnelFactoryRectangular()
43 G4double tunnelThickness,
44 G4double tunnelSoilThickness,
45 G4Material* tunnelMaterial,
46 G4Material* tunnelSoilMaterial,
48 G4double tunnelFloorOffset,
58 tunnelSoilMaterial, tunnelFloorOffset, tunnel1, tunnel2);
61 G4VSolid* tunnelOuterSolid =
new G4Box(name +
"_tunnel_outer_solid",
62 tunnel1 + tunnelThickness,
63 tunnel2 + tunnelThickness,
66 G4VSolid* tunnelInnerSolid =
new G4Box(name +
"_tunnel_outer_solid",
72 allSolids.insert(tunnelOuterSolid);
73 allSolids.insert(tunnelInnerSolid);
75 tunnelSolid =
new G4SubtractionSolid(name +
"_tunnel_solid",
80 G4double soilInnerX = tunnel1 + tunnelThickness +
lengthSafety;
81 G4double soilInnerY = tunnel2 + tunnelThickness +
lengthSafety;
83 G4double soilOuterX = soilInnerX + tunnelSoilThickness;
84 G4double soilOuterY = soilInnerY + tunnelSoilThickness;
89 G4VSolid* soilOuterSolid =
new G4Box(name +
"_soild_outer_solid",
94 G4VSolid* soilInnerSolid =
new G4Box(name +
"_soil_outer_solid",
100 allSolids.insert(soilOuterSolid);
101 allSolids.insert(soilInnerSolid);
103 soilSolid =
new G4SubtractionSolid(name +
"_soil_solid",
108 G4VSolid* containerSolidOuter =
new G4Box(name +
"_container_outer_solid",
112 G4ThreeVector contInsideDisplacement;
113 G4VSolid* containerSolidInner =
nullptr;
118 G4double floorThickness = tunnel2 - tunnelFloorOffset -
lengthSafety;
121 floorDisplacement = G4ThreeVector(0, -(tunnelFloorOffset + floorThickness*0.5), 0);
122 floorSolid =
new G4Box(name +
"_floor_solid",
127 G4double tunnelContInnerYRadius = tunnel2 - 0.5*floorThickness -
lengthSafety;
129 containerSolidInner =
new G4Box(name +
"_tunnel_cont_solid_inner",
131 tunnelContInnerYRadius,
135 contInsideDisplacement = G4ThreeVector(0, floorThickness*0.5, 0);
139 containerSolidInner =
new G4Box(name +
"_tunnel_cont_solid_inner",
143 contInsideDisplacement = G4ThreeVector(0,0,0);
146 containerSolid =
new G4SubtractionSolid(name +
"_tunnel_cont_solid",
150 contInsideDisplacement);
152 CommonConstruction(name, tunnelMaterial, tunnelSoilMaterial, length, containerX, containerY, visible);
154 return tunnelSection;
160 G4ThreeVector inputFace,
161 G4ThreeVector outputFace,
162 G4double tunnelThickness,
163 G4double tunnelSoilThickness,
164 G4Material* tunnelMaterial,
165 G4Material* tunnelSoilMaterial,
167 G4double tunnelFloorOffset,
177 tunnelSoilMaterial, tunnelFloorOffset, tunnel1, tunnel2);
182 G4double intersectionRadius = ( std::max(tunnel1,tunnel2) + tunnelThickness + tunnelSoilThickness ) * 3;
183 G4VSolid* faceSolid =
new G4CutTubs(name +
"_face_intersection_solid",
194 G4VSolid* tunnelOuterSolid =
new G4Box(name +
"_tunnel_outer_solid",
195 tunnel1 + tunnelThickness,
196 tunnel2 + tunnelThickness,
199 G4VSolid* tunnelInnerSolid =
new G4Box(name +
"_tunnel_outer_solid",
204 G4VSolid* tunnelSolidUnAngled =
new G4SubtractionSolid(name +
"_tunnel_square_solid",
209 allSolids.insert(faceSolid);
210 allSolids.insert(tunnelOuterSolid);
211 allSolids.insert(tunnelInnerSolid);
212 allSolids.insert(tunnelSolidUnAngled);
215 tunnelSolid =
new G4IntersectionSolid(name +
"_tunnel_solid",
220 G4double soilInnerX = tunnel1 + tunnelThickness +
lengthSafety;
221 G4double soilInnerY = tunnel2 + tunnelThickness +
lengthSafety;
223 G4double soilOuterX = soilInnerX + tunnelSoilThickness;
224 G4double soilOuterY = soilInnerY + tunnelSoilThickness;
229 G4VSolid* soilOuterSolid =
new G4Box(name +
"_soil_outer_solid",
234 G4VSolid* soilInnerSolid =
new G4Box(name +
"_soil_inner_solid",
240 G4VSolid* soilSolidUnAngled =
new G4SubtractionSolid(name +
"_soil_square_solid",
245 allSolids.insert(soilOuterSolid);
246 allSolids.insert(soilInnerSolid);
247 allSolids.insert(soilSolidUnAngled);
250 soilSolid =
new G4IntersectionSolid(name +
"_soil_soild",
256 G4VSolid* containerSolidOuter =
new G4Box(name +
"_container_outer_solid",
260 G4ThreeVector contInsideDisplacement;
261 G4VSolid* containerSolidInner =
nullptr;
262 G4VSolid* containerSolidSquare =
nullptr;
264 allSolids.insert(containerSolidOuter);
269 G4double floorThickness = tunnel2 - tunnelFloorOffset -
lengthSafety;
272 floorDisplacement = G4ThreeVector(0, -(tunnelFloorOffset + floorThickness*0.5), 0);
274 G4VSolid* floorSolidSquare =
new G4Box(name +
"_floor_box_solid",
279 floorSolid =
new G4IntersectionSolid(name +
"_floor_solid",
283 allSolids.insert(floorSolidSquare);
286 G4double tunnelContInnerYRadius = ( tunnelFloorOffset + tunnel2 ) * 0.5;
287 containerSolidInner =
new G4Box(name +
"_tunnel_cont_solid_inner",
289 tunnelContInnerYRadius,
293 contInsideDisplacement = G4ThreeVector(0, -(tunnelContInnerYRadius - tunnel2), 0);
297 containerSolidInner =
new G4Box(name +
"_tunnel_cont_solid_inner",
301 contInsideDisplacement = G4ThreeVector(0,0,0);
304 containerSolidSquare =
new G4SubtractionSolid(name +
"_container_square_solid",
308 contInsideDisplacement);
310 containerSolid =
new G4IntersectionSolid(name +
"_container_solid",
311 containerSolidSquare,
314 CommonConstruction(name, tunnelMaterial, tunnelSoilMaterial, length, containerX,
315 containerY, visible);
317 return tunnelSection;
322 G4double& tunnelThickness,
323 G4double& tunnelSoilThickness,
324 G4Material*& tunnelMaterial,
325 G4Material*& tunnelSoilMaterial,
326 G4double& tunnelFloorOffset,
332 if (tunnelFloorOffset < 1e-10)
333 {tunnelFloorOffset = defaultModel->floorOffset;}
336 {tunnel1 = defaultModel->
aper1;}
339 {tunnel2 = defaultModel->
aper2;}
G4double lengthSafety
Cache of global constants variable.
void CommontTestInputParameters(G4double &length, G4double &tunnelThickness, G4double &tunnelSoilThickness, G4Material *&tunnelMaterial, G4Material *&tunnelSoilMaterial)
virtual BDSTunnelSection * CreateTunnelSection(G4String name, G4double length, G4double tunnelThickness, G4double tunnelSoilThickness, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4bool tunnelFloor, G4double tunnelFloorOffset, G4double tunnel1, G4double tunnel2, G4bool visible)
Create a tunnel section with flat input and output faces.
virtual BDSTunnelSection * CreateTunnelSectionAngled(G4String name, G4double length, G4ThreeVector inputFace, G4ThreeVector outputFace, G4double tunnelThickness, G4double tunnelSoilThickness, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4bool tunnelFloor, G4double tunnelFloorOffset, G4double tunnel1, G4double tunnel2, G4bool visible)
Create a tunnel section with an angled input and output face.
void TestInputParameters(G4double &length, G4double &tunnelThickness, G4double &tunnelSoilThickness, G4Material *&tunnelMaterial, G4Material *&tunnelSoildMaterial, G4double &tunnelFloorOffset, G4double &tunnel1, G4double &tunnel2)
functions below here are private to this particular factory
G4double aper2
Tunnel aperture / shape parameter 2.
G4double aper1
Tunnel aperture / shape parameter 1.
Class that represents a section of tunnel.