19#include "BDSTunnelFactoryBase.hh"
20#include "BDSTunnelFactoryRectAboveGround.hh"
21#include "BDSTunnelInfo.hh"
22#include "BDSUtilities.hh"
26#include "G4CutTubs.hh"
27#include "G4IntersectionSolid.hh"
28#include "G4LogicalVolume.hh"
29#include "G4SubtractionSolid.hh"
30#include "G4ThreeVector.hh"
31#include "G4UnionSolid.hh"
40BDSTunnelFactoryRectAboveGround::BDSTunnelFactoryRectAboveGround()
44 slabYHalfWidth = 1*CLHEP::m;
59 G4double tunnelThickness,
60 G4double tunnelSoilThickness,
61 G4Material* tunnelMaterial,
62 G4Material* tunnelSoilMaterial,
74 tunnelSoilMaterial, tunnel1, tunnel2);
78 slabXHalfWidth = std::max(tunnel1, tunnel2) * 2;
81 G4double yDisp = tunnel2 + slabYHalfWidth +
lengthSafety;
83 G4ThreeVector slabDisplacement = G4ThreeVector(0,-yDisp,0);
85 slabSolid =
new G4Box(name +
"_slab_solid",
90 G4VSolid* tunnelOuterSolid =
new G4Box(name +
"_tunnel_outer_solid",
91 tunnel1 + tunnelThickness,
92 tunnel2 + tunnelThickness,
95 G4VSolid* tunnelRectSolid =
new G4UnionSolid(name +
"_tunnel_outer_solid",
101 G4VSolid* tunnelInnerSolid =
new G4Box(name +
"_tunnel_outer_solid",
106 tunnelSolid =
new G4SubtractionSolid(name +
"_tunnel_solid",
111 allSolids.insert(tunnelOuterSolid);
112 allSolids.insert(tunnelRectSolid);
113 allSolids.insert(tunnelInnerSolid);
114 allSolids.insert(tunnelRectSolid);
116 containerSolid = BuildContainerStraight(name, length, tunnel1, tunnel2,
117 tunnelThickness, slabDisplacement);
119 CommonConstruction(name, tunnelMaterial, tunnelSoilMaterial, length, containerXRadius, containerYRadius, visible);
121 return tunnelSection;
126 G4ThreeVector inputFace,
127 G4ThreeVector outputFace,
128 G4double tunnelThickness,
129 G4double tunnelSoilThickness,
130 G4Material* tunnelMaterial,
131 G4Material* tunnelSoilMaterial,
143 tunnelSoilMaterial, tunnel1, tunnel2);
148 G4double intersectionRadius = ( std::max(tunnel1,tunnel2) + tunnelThickness + tunnelSoilThickness ) * 3;
149 G4VSolid* faceSolid =
new G4CutTubs(name +
"_face_intersection_solid",
160 slabXHalfWidth = std::max(tunnel1, tunnel2) * 2;
163 G4double yDisp = tunnel2 + slabYHalfWidth +
lengthSafety;
165 G4ThreeVector slabDisplacement = G4ThreeVector(0,-yDisp,0);
167 slabSolid =
new G4Box(name +
"_slab_solid",
174 G4VSolid* tunnelOuterSolid =
new G4Box(name +
"_tunnel_outer_solid",
175 tunnel1 + tunnelThickness,
176 tunnel2 + tunnelThickness,
179 G4VSolid* tunnelRectSolid =
new G4UnionSolid(name +
"_tunnel_outer_solid",
185 G4VSolid* tunnelInnerSolid =
new G4Box(name +
"_tunnel_outer_solid",
190 G4VSolid* tunnelSolidUnAngled =
new G4SubtractionSolid(name +
"_tunnel_square_solid",
195 allSolids.insert(tunnelOuterSolid);
196 allSolids.insert(tunnelRectSolid);
197 allSolids.insert(tunnelInnerSolid);
198 allSolids.insert(tunnelSolidUnAngled);
201 tunnelSolid =
new G4IntersectionSolid(name +
"_tunnel_solid",
205 G4VSolid* straightContainer = BuildContainerStraight(name, length*2.0, tunnel1, tunnel2,
206 tunnelThickness, slabDisplacement);
208 containerSolid =
new G4IntersectionSolid(name +
"_tunnel_container_solid",
212 CommonConstruction(name, tunnelMaterial, tunnelSoilMaterial, length, containerXRadius,
213 containerYRadius, visible);
215 return tunnelSection;
220 G4double& tunnelThickness,
221 G4double& tunnelSoilThickness,
222 G4Material*& tunnelMaterial,
223 G4Material*& tunnelSoilMaterial,
230 {tunnel1 = defaultModel->
aper1;}
233 {tunnel2 = defaultModel->
aper2;}
236G4VSolid* BDSTunnelFactoryRectAboveGround::BuildContainerStraight(G4String
name,
240 G4double tunnelThickness,
241 G4ThreeVector slabDisplacement)
243 G4VSolid* containerSolidL;
246 containerYRadius = tunnel2 + tunnelThickness +
lengthSafety;
249 G4VSolid* tunnelContainerOuterSlab =
new G4Box(name +
"_cont_slab_solid",
253 G4VSolid* tunnelContainerOuterTunnel =
new G4Box(name +
"_cont_tunnel_solid",
257 G4VSolid* tunnelContainerOuter =
new G4UnionSolid(name +
"_cont_outer_solid",
258 tunnelContainerOuterTunnel,
259 tunnelContainerOuterSlab,
263 G4VSolid* tunnelContainerInner =
new G4Box(name +
"_tunnel_cont_solid_inner",
269 allSolids.insert(tunnelContainerOuterSlab);
270 allSolids.insert(tunnelContainerOuterTunnel);
271 allSolids.insert(tunnelContainerOuter);
272 allSolids.insert(tunnelContainerInner);
274 containerSolidL =
new G4SubtractionSolid(name +
"_tunnel_cont_solid",
275 tunnelContainerOuter,
276 tunnelContainerInner);
278 return containerSolidL;
const G4String name
Const protected member variable that may not be changed by derived classes.
G4double lengthSafety
Cache of global constants variable.
void CommontTestInputParameters(G4double &length, G4double &tunnelThickness, G4double &tunnelSoilThickness, G4Material *&tunnelMaterial, G4Material *&tunnelSoilMaterial)
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 &tunnel1, G4double &tunnel2)
functions below here are private to this particular factory
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.
G4double aper2
Tunnel aperture / shape parameter 2.
G4double aper1
Tunnel aperture / shape parameter 1.
Class that represents a section of tunnel.
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())