BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTunnelSection.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 "BDSTunnelSection.hh"
20
21#include "G4VSolid.hh"
22
24 G4double chordLengthIn,
25 G4double angleIn,
26 BDSGeometryComponent* tunnelGeometry,
27 G4VSolid* innerIntersectionSolidIn):
28 BDSAcceleratorComponent(nameIn, chordLengthIn, angleIn, "tunnel"),
29 innerIntersectionSolid(innerIntersectionSolidIn)
30{
31 // chordLength is calculated from the angle and the arcLength by BDSAcceleratorComponent
32 // but here we only have chord length. Just reassign chord length.
33 chordLength = chordLengthIn;
34
35 // copy special bits from BDSGeometryComponent. Can't use BDSGeometryComponent in
36 // initialiser list as c++ only allows you to use constructors one up in the inheritance.
37 RegisterDaughter(tunnelGeometry);
38 InheritExtents(tunnelGeometry);
39 containerSolid = tunnelGeometry->GetContainerSolid();
40 containerLogicalVolume = tunnelGeometry->GetContainerLogicalVolume();
41}
42
43BDSTunnelSection::~BDSTunnelSection()
44{
45 delete innerIntersectionSolid;
46}
47
49{;}
50
52{;}
Abstract class that represents a component of an accelerator.
G4double chordLength
Protected member variable that can be modified by derived classes.
A generic geometry component for a bdsim model.
G4LogicalVolume * GetContainerLogicalVolume() const
Accessor - see member for more info.
void InheritExtents(BDSGeometryComponent const *const anotherComponent)
Update the extents of this object with those of another object.
void RegisterDaughter(BDSGeometryComponent *anotherComponent)
G4VSolid * GetContainerSolid() const
Accessor - see member for more info.
BDSTunnelSection()=delete
Private default constructor to force the use of the supplied one.
virtual void BuildContainerLogicalVolume()
Have to provide implementation - does nothing.
virtual void Initialise()