18#include "BDSTunnelFactoryBase.hh"
19#include "BDSTunnelFactoryRectAboveGround.hh"
20#include "BDSTunnelInfo.hh"
21#include "BDSUtilities.hh"
25#include "G4CutTubs.hh"
26#include "G4IntersectionSolid.hh"
27#include "G4LogicalVolume.hh"
28#include "G4SubtractionSolid.hh"
29#include "G4ThreeVector.hh"
30#include "G4UnionSolid.hh"
39BDSTunnelFactoryRectAboveGround::BDSTunnelFactoryRectAboveGround()
43 slabYHalfWidth = 1*CLHEP::m;
58 G4double tunnelThickness,
59 G4double tunnelSoilThickness,
60 G4Material* tunnelMaterial,
61 G4Material* tunnelSoilMaterial,
73 tunnelSoilMaterial, tunnel1, tunnel2);
77 slabXHalfWidth = std::max(tunnel1, tunnel2) * 2;
80 G4double yDisp = tunnel2 + slabYHalfWidth +
lengthSafety;
82 G4ThreeVector slabDisplacement = G4ThreeVector(0,-yDisp,0);
84 slabSolid =
new G4Box(name +
"_slab_solid",
89 G4VSolid* tunnelOuterSolid =
new G4Box(name +
"_tunnel_outer_solid",
90 tunnel1 + tunnelThickness,
91 tunnel2 + tunnelThickness,
94 G4VSolid* tunnelRectSolid =
new G4UnionSolid(name +
"_tunnel_outer_solid",
100 G4VSolid* tunnelInnerSolid =
new G4Box(name +
"_tunnel_outer_solid",
105 tunnelSolid =
new G4SubtractionSolid(name +
"_tunnel_solid",
110 allSolids.insert(tunnelOuterSolid);
111 allSolids.insert(tunnelRectSolid);
112 allSolids.insert(tunnelInnerSolid);
113 allSolids.insert(tunnelRectSolid);
115 containerSolid = BuildContainerStraight(name, length, tunnel1, tunnel2,
116 tunnelThickness, slabDisplacement);
118 CommonConstruction(name, tunnelMaterial, tunnelSoilMaterial, length, containerXRadius, containerYRadius, visible);
120 return tunnelSection;
125 G4ThreeVector inputFace,
126 G4ThreeVector outputFace,
127 G4double tunnelThickness,
128 G4double tunnelSoilThickness,
129 G4Material* tunnelMaterial,
130 G4Material* tunnelSoilMaterial,
142 tunnelSoilMaterial, tunnel1, tunnel2);
147 G4double intersectionRadius = ( std::max(tunnel1,tunnel2) + tunnelThickness + tunnelSoilThickness ) * 3;
148 G4VSolid* faceSolid =
new G4CutTubs(name +
"_face_intersection_solid",
159 slabXHalfWidth = std::max(tunnel1, tunnel2) * 2;
162 G4double yDisp = tunnel2 + slabYHalfWidth +
lengthSafety;
164 G4ThreeVector slabDisplacement = G4ThreeVector(0,-yDisp,0);
166 slabSolid =
new G4Box(name +
"_slab_solid",
173 G4VSolid* tunnelOuterSolid =
new G4Box(name +
"_tunnel_outer_solid",
174 tunnel1 + tunnelThickness,
175 tunnel2 + tunnelThickness,
178 G4VSolid* tunnelRectSolid =
new G4UnionSolid(name +
"_tunnel_outer_solid",
184 G4VSolid* tunnelInnerSolid =
new G4Box(name +
"_tunnel_outer_solid",
189 G4VSolid* tunnelSolidUnAngled =
new G4SubtractionSolid(name +
"_tunnel_square_solid",
194 allSolids.insert(tunnelOuterSolid);
195 allSolids.insert(tunnelRectSolid);
196 allSolids.insert(tunnelInnerSolid);
197 allSolids.insert(tunnelSolidUnAngled);
200 tunnelSolid =
new G4IntersectionSolid(name +
"_tunnel_solid",
204 G4VSolid* straightContainer = BuildContainerStraight(name, length*2.0, tunnel1, tunnel2,
205 tunnelThickness, slabDisplacement);
207 containerSolid =
new G4IntersectionSolid(name +
"_tunnel_container_solid",
211 CommonConstruction(name, tunnelMaterial, tunnelSoilMaterial, length, containerXRadius,
212 containerYRadius, visible);
214 return tunnelSection;
219 G4double& tunnelThickness,
220 G4double& tunnelSoilThickness,
221 G4Material*& tunnelMaterial,
222 G4Material*& tunnelSoilMaterial,
229 {tunnel1 = defaultModel->
aper1;}
232 {tunnel2 = defaultModel->
aper2;}
235G4VSolid* BDSTunnelFactoryRectAboveGround::BuildContainerStraight(G4String
name,
239 G4double tunnelThickness,
240 G4ThreeVector slabDisplacement)
242 G4VSolid* containerSolidL;
245 containerYRadius = tunnel2 + tunnelThickness +
lengthSafety;
248 G4VSolid* tunnelContainerOuterSlab =
new G4Box(name +
"_cont_slab_solid",
252 G4VSolid* tunnelContainerOuterTunnel =
new G4Box(name +
"_cont_tunnel_solid",
256 G4VSolid* tunnelContainerOuter =
new G4UnionSolid(name +
"_cont_outer_solid",
257 tunnelContainerOuterTunnel,
258 tunnelContainerOuterSlab,
262 G4VSolid* tunnelContainerInner =
new G4Box(name +
"_tunnel_cont_solid_inner",
268 allSolids.insert(tunnelContainerOuterSlab);
269 allSolids.insert(tunnelContainerOuterTunnel);
270 allSolids.insert(tunnelContainerOuter);
271 allSolids.insert(tunnelContainerInner);
273 containerSolidL =
new G4SubtractionSolid(name +
"_tunnel_cont_solid",
274 tunnelContainerOuter,
275 tunnelContainerInner);
277 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())