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) 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 "BDSExtent.hh"
19#include "BDSMaterials.hh"
20#include "BDSTunnelInfo.hh"
21#include "BDSTunnelType.hh"
22
23#include "CLHEP/Units/SystemOfUnits.h"
24
26 G4double thicknessIn,
27 G4double soilThicknessIn,
28 G4Material* materialIn,
29 G4Material* soilMaterialIn,
30 G4bool buildFloorIn,
31 G4double floorOffsetIn,
32 G4double aper1In,
33 G4double aper2In,
34 G4bool sensitiveIn,
35 G4bool visibleIn):
36 type(typeIn), thickness(thicknessIn),
37 soilThickness(soilThicknessIn), material(materialIn),
38 soilMaterial(soilMaterialIn), buildFloor(buildFloorIn),
39 floorOffset(floorOffsetIn), aper1(aper1In), aper2(aper2In),
40 sensitive(sensitiveIn), visible(visibleIn)
41{;}
42
44 G4double thicknessIn,
45 G4double soilThicknessIn,
46 G4String materialIn,
47 G4String soilMaterialIn,
48 G4bool buildFloorIn,
49 G4double floorOffsetIn,
50 G4double aper1In,
51 G4double aper2In,
52 G4bool sensitiveIn,
53 G4bool visibleIn):
54 thickness(thicknessIn), soilThickness(soilThicknessIn),
55 buildFloor(buildFloorIn), floorOffset(floorOffsetIn),
56 aper1(aper1In), aper2(aper2In),
57 sensitive(sensitiveIn), visible(visibleIn)
58{
59 type = BDS::DetermineTunnelType(typeIn);
60 material = BDSMaterials::Instance()->GetMaterial(materialIn);
61 soilMaterial = BDSMaterials::Instance()->GetMaterial(soilMaterialIn);
62}
63
64BDSExtent BDSTunnelInfo::IndicativeExtent() const
65{
66 G4double maxParam = std::max(aper1, aper2);
67 maxParam += thickness + soilThickness + 1*CLHEP::cm;
68
69 BDSExtent result = BDSExtent(-maxParam, maxParam,
70 -maxParam, maxParam,
71 0,0);
72 return result;
73}
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
static BDSMaterials * Instance()
Singleton pattern access.
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)