BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTunnelFactorySquare.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "BDSTunnelFactoryBase.hh"
20#include "BDSTunnelFactorySquare.hh"
21#include "BDSTunnelFactoryRectangular.hh"
22#include "BDSTunnelInfo.hh"
23
24#include "globals.hh"
25
26BDSTunnelFactorySquare::BDSTunnelFactorySquare()
27{
28 rectangular = new BDSTunnelFactoryRectangular();
29}
30
31BDSTunnelFactorySquare::~BDSTunnelFactorySquare()
32{
33 delete rectangular;
34}
35
37 G4double length,
38 G4double tunnelThickness,
39 G4double tunnelSoilThickness,
40 G4Material* tunnelMaterial,
41 G4Material* tunnelSoilMaterial,
42 G4bool tunnelFloor,
43 G4double tunnelFloorOffset,
44 G4double tunnel1,
45 G4double /*tunnel2*/,
46 G4bool visible)
47{
48 // test input parameters - set global options as default if not specified
49 TestInputParameters(length, tunnelThickness, tunnelSoilThickness, tunnelMaterial,
50 tunnelSoilMaterial, tunnelFloorOffset, tunnel1);
51 return rectangular->CreateTunnelSection(name, length, tunnelThickness,
52 tunnelSoilThickness, tunnelMaterial,
53 tunnelSoilMaterial, tunnelFloor,
54 tunnelFloorOffset, tunnel1, tunnel1, visible);
55}
56
58 G4double length,
59 G4ThreeVector inputFace,
60 G4ThreeVector outputFace,
61 G4double tunnelThickness,
62 G4double tunnelSoilThickness,
63 G4Material* tunnelMaterial,
64 G4Material* tunnelSoilMaterial,
65 G4bool tunnelFloor,
66 G4double tunnelFloorOffset,
67 G4double tunnel1,
68 G4double /*tunnel2*/,
69 G4bool visible)
70{
71 // test input parameters - set global options as default if not specified
72 TestInputParameters(length, tunnelThickness, tunnelSoilThickness, tunnelMaterial,
73 tunnelSoilMaterial, tunnelFloorOffset, tunnel1);
74 return rectangular->CreateTunnelSectionAngled(name, length, inputFace, outputFace,
75 tunnelThickness,
76 tunnelSoilThickness, tunnelMaterial,
77 tunnelSoilMaterial, tunnelFloor,
78 tunnelFloorOffset, tunnel1, tunnel1, visible);
79}
80
83 G4double& tunnelThickness,
84 G4double& tunnelSoilThickness,
85 G4Material*& tunnelMaterial,
86 G4Material*& tunnelSoilMaterial,
87 G4double& tunnelFloorOffset,
88 G4double& tunnel1)
89{
90 CommontTestInputParameters(length, tunnelThickness, tunnelSoilThickness, tunnelMaterial, tunnelSoilMaterial);
91
92 if (tunnelFloorOffset < 1e-10)
93 {tunnelFloorOffset = defaultModel->floorOffset;}
94
95 if (tunnel1 < 1e-10)
96 {tunnel1 = defaultModel->aper1;}
97}
void CommontTestInputParameters(G4double &length, G4double &tunnelThickness, G4double &tunnelSoilThickness, G4Material *&tunnelMaterial, G4Material *&tunnelSoilMaterial)
virtual BDSTunnelSection * CreateTunnelSectionAngled(G4String name, G4double length, G4ThreeVector inputFaceIn, G4ThreeVector outputFaceIn, G4double tunnelThickness, G4double tunnelSoilThickness, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4bool tunnelFloor, G4double tunnelFloorOffset, G4double tunnel1, G4double tunnel2, G4bool visible)=0
Create a tunnel section with an angled input and output face. Pure virtual.
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)=0
Create a tunnel section with flat input and output faces. Pure virtual.
Factory for rectangular tunnel segments. Builds floor, tunnel and soil.
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)
functions below here are private to this particular factory
G4double aper1
Tunnel aperture / shape parameter 1.
Class that represents a section of tunnel.