BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTunnelFactoryBase.hh
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#ifndef BDSTUNNELFACTORYBASE_H
20#define BDSTUNNELFACTORYBASE_H
21
22#include "BDSFactoryBase.hh"
23#include "BDSTunnelSection.hh"
24
25#include "globals.hh" // geant4 globals / types
26#include "G4ThreeVector.hh"
27
28#include <set>
29
30class G4LogicalVolume;
31class G4Material;
32class G4VisAttributes;
33class G4VSolid;
34
36class BDSTunnelInfo;
37
60{
61public:
63 virtual BDSTunnelSection* CreateTunnelSection(G4String name,
64 G4double length,
65 G4double tunnelThickness,
66 G4double tunnelSoilThickness,
67 G4Material* tunnelMaterial,
68 G4Material* tunnelSoilMaterial,
69 G4bool tunnelFloor,
70 G4double tunnelFloorOffset,
71 G4double tunnel1,
72 G4double tunnel2,
73 G4bool visible) = 0;
74
77 virtual BDSTunnelSection* CreateTunnelSectionAngledIn(G4String name,
78 G4double length,
79 G4double angleIn,
80 G4double tunnelThickness,
81 G4double tunnelSoilThickness,
82 G4Material* tunnelMaterial,
83 G4Material* tunnelSoilMaterial,
84 G4bool tunnelFloor,
85 G4double tunnelFloorOffset,
86 G4double tunnel1,
87 G4double tunnel2,
88 G4bool visible);
89
93 G4double length,
94 G4double angleOut,
95 G4double tunnelThickness,
96 G4double tunnelSoilThickness,
97 G4Material* tunnelMaterial,
98 G4Material* tunnelSoilMaterial,
99 G4bool tunnelFloor,
100 G4double tunnelFloorOffset,
101 G4double tunnel1,
102 G4double tunnel2,
103 G4bool visible);
104
110 G4double length,
111 G4double angleIn,
112 G4double angleOut,
113 G4double tunnelThickness,
114 G4double tunnelSoilThickness,
115 G4Material* tunnelMaterial,
116 G4Material* tunnelSoilMaterial,
117 G4bool tunnelFloor,
118 G4double tunnelFloorOffset,
119 G4double tunnel1,
120 G4double tunnel2,
121 G4bool visible);
122
125 G4double length,
126 G4ThreeVector inputFaceIn,
127 G4ThreeVector outputFaceIn,
128 G4double tunnelThickness,
129 G4double tunnelSoilThickness,
130 G4Material* tunnelMaterial,
131 G4Material* tunnelSoilMaterial,
132 G4bool tunnelFloor,
133 G4double tunnelFloorOffset,
134 G4double tunnel1,
135 G4double tunnel2,
136 G4bool visible) = 0;
137
140
141protected:
144
148 void CommontTestInputParameters(G4double& length,
149 G4double& tunnelThickness,
150 G4double& tunnelSoilThickness,
151 G4Material*& tunnelMaterial,
152 G4Material*& tunnelSoilMaterial);
153
154 virtual void CommonConstruction(G4String name,
155 G4Material* tunnelMaterial,
156 G4Material* tunnelSoilMaterial,
157 G4double length,
158 G4double containerXRadius,
159 G4double contianerYRadius,
160 G4bool visible);
161
163 virtual void BuildLogicalVolumes(G4String name,
164 G4Material* tunnelMaterial,
165 G4Material* tunnelSoilMaterial);
166
168 virtual void SetVisAttributes(G4bool visible);
169
171 virtual void SetUserLimits();
172
174 virtual void PrepareGeometryComponent(G4double containerXRadius,
175 G4double containerYRadius,
176 G4double containerZRadius);
177
179 virtual void PrepareTunnelSection(G4String name,
180 G4double chordLength);
181
183 virtual void SetSensitiveVolumes();
184
186 virtual void PlaceComponents(G4String name);
187
190 virtual void CleanUp();
191
192 BDSGeometryComponent* tunnelComponent;
193 BDSTunnelSection* tunnelSection;
194
195 G4VSolid* containerSolid;
196 G4VSolid* tunnelSolid;
197 G4VSolid* soilSolid;
198 G4VSolid* floorSolid;
199 G4VSolid* intersectionSolid;
200 G4LogicalVolume* containerLV;
201 G4LogicalVolume* tunnelLV;
202 G4LogicalVolume* soilLV;
203 G4LogicalVolume* floorLV;
204 G4ThreeVector floorDisplacement;
205 BDSTunnelInfo* defaultModel;
206
211};
212
213#endif
Common temporary storage for all factories no matter what geometry.
A generic geometry component for a bdsim model.
Abstract base class for tunnel factory classes.
BDSTunnelFactoryBase()
protected default constructor so only derived classes can use it
virtual BDSTunnelSection * CreateTunnelSectionAngledInOut(G4String name, G4double length, G4double angleIn, G4double angleOut, G4double tunnelThickness, G4double tunnelSoilThickness, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4bool tunnelFloor, G4double tunnelFloorOffset, G4double tunnel1, G4double tunnel2, G4bool visible)
virtual void PrepareGeometryComponent(G4double containerXRadius, G4double containerYRadius, G4double containerZRadius)
Prepare the assembled geometry component.
virtual void SetSensitiveVolumes()
Set the sensitive volumes.
void CommontTestInputParameters(G4double &length, G4double &tunnelThickness, G4double &tunnelSoilThickness, G4Material *&tunnelMaterial, G4Material *&tunnelSoilMaterial)
virtual void SetUserLimits()
Set user limits for all logical volumes in the tunnel section.
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 * CreateTunnelSectionAngledIn(G4String name, G4double length, G4double angleIn, G4double tunnelThickness, G4double tunnelSoilThickness, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4bool tunnelFloor, G4double tunnelFloorOffset, G4double tunnel1, G4double tunnel2, G4bool visible)
virtual void SetVisAttributes(G4bool visible)
Set the visual attributes for each logical volume.
virtual BDSTunnelSection * CreateTunnelSectionAngledOut(G4String name, G4double length, G4double angleOut, G4double tunnelThickness, G4double tunnelSoilThickness, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4bool tunnelFloor, G4double tunnelFloorOffset, G4double tunnel1, G4double tunnel2, G4bool visible)
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.
virtual void PlaceComponents(G4String name)
Place components in container volume.
virtual void PrepareTunnelSection(G4String name, G4double chordLength)
Prepare the output BDSTunnelSection instance.
virtual ~BDSTunnelFactoryBase()
Virtual base destructor.
virtual void BuildLogicalVolumes(G4String name, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial)
Build logical volumes from solids + materials.
Holder struct of all information required to create a section of tunnel.
Class that represents a section of tunnel.