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) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include "BDSTunnelFactoryBase.hh"
19#include "BDSTunnelFactorySquare.hh"
20#include "BDSTunnelFactoryRectangular.hh"
21#include "BDSTunnelInfo.hh"
22
23#include "globals.hh"
24
25BDSTunnelFactorySquare::BDSTunnelFactorySquare()
26{
27 rectangular = new BDSTunnelFactoryRectangular();
28}
29
30BDSTunnelFactorySquare::~BDSTunnelFactorySquare()
31{
32 delete rectangular;
33}
34
36 G4double length,
37 G4double tunnelThickness,
38 G4double tunnelSoilThickness,
39 G4Material* tunnelMaterial,
40 G4Material* tunnelSoilMaterial,
41 G4bool tunnelFloor,
42 G4double tunnelFloorOffset,
43 G4double tunnel1,
44 G4double /*tunnel2*/,
45 G4bool visible)
46{
47 // test input parameters - set global options as default if not specified
48 TestInputParameters(length, tunnelThickness, tunnelSoilThickness, tunnelMaterial,
49 tunnelSoilMaterial, tunnelFloorOffset, tunnel1);
50 return rectangular->CreateTunnelSection(name, length, tunnelThickness,
51 tunnelSoilThickness, tunnelMaterial,
52 tunnelSoilMaterial, tunnelFloor,
53 tunnelFloorOffset, tunnel1, tunnel1, visible);
54}
55
57 G4double length,
58 G4ThreeVector inputFace,
59 G4ThreeVector outputFace,
60 G4double tunnelThickness,
61 G4double tunnelSoilThickness,
62 G4Material* tunnelMaterial,
63 G4Material* tunnelSoilMaterial,
64 G4bool tunnelFloor,
65 G4double tunnelFloorOffset,
66 G4double tunnel1,
67 G4double /*tunnel2*/,
68 G4bool visible)
69{
70 // test input parameters - set global options as default if not specified
71 TestInputParameters(length, tunnelThickness, tunnelSoilThickness, tunnelMaterial,
72 tunnelSoilMaterial, tunnelFloorOffset, tunnel1);
73 return rectangular->CreateTunnelSectionAngled(name, length, inputFace, outputFace,
74 tunnelThickness,
75 tunnelSoilThickness, tunnelMaterial,
76 tunnelSoilMaterial, tunnelFloor,
77 tunnelFloorOffset, tunnel1, tunnel1, visible);
78}
79
82 G4double& tunnelThickness,
83 G4double& tunnelSoilThickness,
84 G4Material*& tunnelMaterial,
85 G4Material*& tunnelSoilMaterial,
86 G4double& tunnelFloorOffset,
87 G4double& tunnel1)
88{
89 CommontTestInputParameters(length, tunnelThickness, tunnelSoilThickness, tunnelMaterial, tunnelSoilMaterial);
90
91 if (tunnelFloorOffset < 1e-10)
92 {tunnelFloorOffset = defaultModel->floorOffset;}
93
94 if (tunnel1 < 1e-10)
95 {tunnel1 = defaultModel->aper1;}
96}
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.