BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTunnelInfo.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 "BDSExtent.hh"
20#include "BDSMaterials.hh"
21#include "BDSTunnelInfo.hh"
22#include "BDSTunnelType.hh"
23
24#include "CLHEP/Units/SystemOfUnits.h"
25
27 G4double thicknessIn,
28 G4double soilThicknessIn,
29 G4Material* materialIn,
30 G4Material* soilMaterialIn,
31 G4bool buildFloorIn,
32 G4double floorOffsetIn,
33 G4double aper1In,
34 G4double aper2In,
35 G4bool sensitiveIn,
36 G4bool visibleIn):
37 type(typeIn), thickness(thicknessIn),
38 soilThickness(soilThicknessIn), material(materialIn),
39 soilMaterial(soilMaterialIn), buildFloor(buildFloorIn),
40 floorOffset(floorOffsetIn), aper1(aper1In), aper2(aper2In),
41 sensitive(sensitiveIn), visible(visibleIn)
42{;}
43
45 G4double thicknessIn,
46 G4double soilThicknessIn,
47 G4String materialIn,
48 G4String soilMaterialIn,
49 G4bool buildFloorIn,
50 G4double floorOffsetIn,
51 G4double aper1In,
52 G4double aper2In,
53 G4bool sensitiveIn,
54 G4bool visibleIn):
55 thickness(thicknessIn), soilThickness(soilThicknessIn),
56 buildFloor(buildFloorIn), floorOffset(floorOffsetIn),
57 aper1(aper1In), aper2(aper2In),
58 sensitive(sensitiveIn), visible(visibleIn)
59{
60 type = BDS::DetermineTunnelType(typeIn);
61 material = BDSMaterials::Instance()->GetMaterial(materialIn);
62 soilMaterial = BDSMaterials::Instance()->GetMaterial(soilMaterialIn);
63}
64
65BDSExtent BDSTunnelInfo::IndicativeExtent() const
66{
67 G4double maxParam = std::max(aper1, aper2);
68 maxParam += thickness + soilThickness + 1*CLHEP::cm;
69
70 BDSExtent result = BDSExtent(-maxParam, maxParam,
71 -maxParam, maxParam,
72 0,0);
73 return result;
74}
Holder for +- extents in 3 dimensions.
Definition: BDSExtent.hh:39
static BDSMaterials * Instance()
Singleton pattern access.
Definition: BDSMaterials.cc:39
G4Material * GetMaterial(G4String material) const
Get material by name.
BDSTunnelInfo()=delete
Default constructor, not needed.
G4double aper2
Tunnel aperture / shape parameter 2.
G4double aper1
Tunnel aperture / shape parameter 1.
BDSTunnelType DetermineTunnelType(G4String tunnelType)
Function to determine the enum type of the tunnel (case-insensitive)