BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Protected Member Functions | Protected Attributes
BDSTunnelFactoryBase Class Referenceabstract

Abstract base class for tunnel factory classes. More...

#include <BDSTunnelFactoryBase.hh>

Inheritance diagram for BDSTunnelFactoryBase:
Inheritance graph
Collaboration diagram for BDSTunnelFactoryBase:
Collaboration graph

Public Member Functions

virtual BDSTunnelSectionCreateTunnelSection (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. More...
 
virtual BDSTunnelSectionCreateTunnelSectionAngledIn (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 BDSTunnelSectionCreateTunnelSectionAngledOut (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 BDSTunnelSectionCreateTunnelSectionAngledInOut (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 BDSTunnelSectionCreateTunnelSectionAngled (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. More...
 
virtual ~BDSTunnelFactoryBase ()
 Virtual base destructor. More...
 
- Public Member Functions inherited from BDSFactoryBase
virtual void FactoryBaseCleanUp ()
 Empty containers for next use - factories are never deleted so can't rely on scope. More...
 

Protected Member Functions

 BDSTunnelFactoryBase ()
 protected default constructor so only derived classes can use it More...
 
void CommontTestInputParameters (G4double &length, G4double &tunnelThickness, G4double &tunnelSoilThickness, G4Material *&tunnelMaterial, G4Material *&tunnelSoilMaterial)
 
virtual void CommonConstruction (G4String name, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial, G4double length, G4double containerXRadius, G4double contianerYRadius, G4bool visible)
 
virtual void BuildLogicalVolumes (G4String name, G4Material *tunnelMaterial, G4Material *tunnelSoilMaterial)
 Build logical volumes from solids + materials. More...
 
virtual void SetVisAttributes (G4bool visible)
 Set the visual attributes for each logical volume. More...
 
virtual void SetUserLimits ()
 Set user limits for all logical volumes in the tunnel section. More...
 
virtual void PrepareGeometryComponent (G4double containerXRadius, G4double containerYRadius, G4double containerZRadius)
 Prepare the assembled geometry component. More...
 
virtual void PrepareTunnelSection (G4String name, G4double chordLength)
 Prepare the output BDSTunnelSection instance. More...
 
virtual void SetSensitiveVolumes ()
 Set the sensitive volumes. More...
 
virtual void PlaceComponents (G4String name)
 Place components in container volume. More...
 
virtual void CleanUp ()
 

Protected Attributes

BDSGeometryComponenttunnelComponent
 
BDSTunnelSectiontunnelSection
 
G4VSolid * containerSolid
 
G4VSolid * tunnelSolid
 
G4VSolid * soilSolid
 
G4VSolid * floorSolid
 
G4VSolid * intersectionSolid
 
G4LogicalVolume * containerLV
 
G4LogicalVolume * tunnelLV
 
G4LogicalVolume * soilLV
 
G4LogicalVolume * floorLV
 
G4ThreeVector floorDisplacement
 
BDSTunnelInfodefaultModel
 
G4double cumulativeAngle
 
- Protected Attributes inherited from BDSFactoryBase
std::set< G4LogicalVolume * > allLogicalVolumes
 
std::set< G4VPhysicalVolume * > allPhysicalVolumes
 
std::set< G4RotationMatrix * > allRotationMatrices
 
std::set< G4UserLimits * > allUserLimits
 
std::set< G4VSolid * > allSolids
 
std::set< G4VisAttributes * > allVisAttributes
 
G4double lengthSafety
 Cache of global constants variable. More...
 
G4double lengthSafetyLarge
 Cache of global constants variable. More...
 
G4bool checkOverlaps
 Cache of global constants variable. More...
 
G4bool visDebug
 Cache of global constants variable. More...
 
G4double nSegmentsPerCircle
 Cache of global constants variable. More...
 
G4VisAttributes * containerVisAttr
 Cache of global constants variable. More...
 
G4UserLimits * defaultUserLimits
 Cache of global constants variable. More...
 

Detailed Description

Abstract base class for tunnel factory classes.

Abstract base class that defines the interface of each factory to build any type of tunnel required. There are four general possibilities apart from the shape (each derived class will give a different cross-section) and these dictate the angled faces.

Uses Geant4 default units by default, ie mm, rad (not metres).

NOTE - no derived classes record the 'angle' parameter for BDSAcceleratorComponent correctly in the BDSTunnelSection instances. This is only acceptable as the tunnel beam line is manually made not using the internal accumulation of coordinates of BDSBeamline. It's also in part necessary as each tunnel segment doesn't obey the no double bending rule of accerlator components so can't be used with angle and arc length accurately.

Author
Laurie Nevay

Definition at line 59 of file BDSTunnelFactoryBase.hh.

Constructor & Destructor Documentation

◆ ~BDSTunnelFactoryBase()

virtual BDSTunnelFactoryBase::~BDSTunnelFactoryBase ( )
inlinevirtual

Virtual base destructor.

Definition at line 139 of file BDSTunnelFactoryBase.hh.

◆ BDSTunnelFactoryBase()

BDSTunnelFactoryBase::BDSTunnelFactoryBase ( )
protected

protected default constructor so only derived classes can use it

Definition at line 43 of file BDSTunnelFactoryBase.cc.

References BDSGlobalConstants::Instance().

Here is the call graph for this function:

Member Function Documentation

◆ BuildLogicalVolumes()

void BDSTunnelFactoryBase::BuildLogicalVolumes ( G4String  name,
G4Material *  tunnelMaterial,
G4Material *  tunnelSoilMaterial 
)
protectedvirtual

Build logical volumes from solids + materials.

Definition at line 154 of file BDSTunnelFactoryBase.cc.

References BDSMaterials::GetMaterial(), BDSGlobalConstants::Instance(), and BDSMaterials::Instance().

Here is the call graph for this function:

◆ CleanUp()

void BDSTunnelFactoryBase::CleanUp ( )
protectedvirtual

◆ CommonConstruction()

void BDSTunnelFactoryBase::CommonConstruction ( G4String  name,
G4Material *  tunnelMaterial,
G4Material *  tunnelSoilMaterial,
G4double  length,
G4double  containerXRadius,
G4double  contianerYRadius,
G4bool  visible 
)
protectedvirtual

Definition at line 136 of file BDSTunnelFactoryBase.cc.

◆ CommontTestInputParameters()

void BDSTunnelFactoryBase::CommontTestInputParameters ( G4double &  length,
G4double &  tunnelThickness,
G4double &  tunnelSoilThickness,
G4Material *&  tunnelMaterial,
G4Material *&  tunnelSoilMaterial 
)
protected

General basic viability tests for input parameters - these are only basic tests and not dependent on the accelerator model, other components or specific tunnel model in the derived factory class

Definition at line 117 of file BDSTunnelFactoryBase.cc.

References BDSFactoryBase::lengthSafety.

Referenced by BDSTunnelFactoryRectAboveGround::TestInputParameters(), BDSTunnelFactoryCircular::TestInputParameters(), BDSTunnelFactorySquare::TestInputParameters(), BDSTunnelFactoryElliptical::TestInputParameters(), and BDSTunnelFactoryRectangular::TestInputParameters().

Here is the caller graph for this function:

◆ CreateTunnelSection()

virtual BDSTunnelSection * BDSTunnelFactoryBase::CreateTunnelSection ( G4String  name,
G4double  length,
G4double  tunnelThickness,
G4double  tunnelSoilThickness,
G4Material *  tunnelMaterial,
G4Material *  tunnelSoilMaterial,
G4bool  tunnelFloor,
G4double  tunnelFloorOffset,
G4double  tunnel1,
G4double  tunnel2,
G4bool  visible 
)
pure virtual

Create a tunnel section with flat input and output faces. Pure virtual.

Implemented in BDSTunnelFactoryCircular, BDSTunnelFactoryElliptical, BDSTunnelFactoryRectAboveGround, BDSTunnelFactoryRectangular, and BDSTunnelFactorySquare.

Referenced by BDSTunnelFactory::CreateTunnelSection(), and BDSTunnelFactorySquare::CreateTunnelSection().

Here is the caller graph for this function:

◆ CreateTunnelSectionAngled()

virtual BDSTunnelSection * BDSTunnelFactoryBase::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 
)
pure virtual

Create a tunnel section with an angled input and output face. Pure virtual.

Implemented in BDSTunnelFactoryCircular, BDSTunnelFactoryElliptical, BDSTunnelFactoryRectAboveGround, BDSTunnelFactoryRectangular, and BDSTunnelFactorySquare.

Referenced by BDSTunnelFactory::CreateTunnelSectionAngled(), BDSTunnelFactorySquare::CreateTunnelSectionAngled(), and CreateTunnelSectionAngledInOut().

Here is the caller graph for this function:

◆ CreateTunnelSectionAngledIn()

BDSTunnelSection * BDSTunnelFactoryBase::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

Create a tunnel section with an angled input face and flat output face. Note, this is implemented in this base class as a dispatch to the AngledInOut function.

Definition at line 61 of file BDSTunnelFactoryBase.cc.

References CreateTunnelSectionAngledInOut().

Referenced by BDSTunnelFactory::CreateTunnelSectionAngledIn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTunnelSectionAngledInOut()

BDSTunnelSection * BDSTunnelFactoryBase::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

Calculates the face normal vectors that all construction uses and then passes along to the also public function CreateTunnelSectionAngled. This allows flexibility in the way the tunnel segments are created - whether in a fairly flat 2d approach along the beam line with only bending the horizontal plane (angles) or in 3d (vectors).

Definition at line 97 of file BDSTunnelFactoryBase.cc.

References BDS::CalculateFaces(), and CreateTunnelSectionAngled().

Referenced by CreateTunnelSectionAngledIn(), BDSTunnelFactory::CreateTunnelSectionAngledInOut(), and CreateTunnelSectionAngledOut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateTunnelSectionAngledOut()

BDSTunnelSection * BDSTunnelFactoryBase::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

Create a tunnel section with an angled output face and flat input face. Note, this is implemented in this base class as a dispatch to the AngledInOut function.

Definition at line 79 of file BDSTunnelFactoryBase.cc.

References CreateTunnelSectionAngledInOut().

Referenced by BDSTunnelFactory::CreateTunnelSectionAngledOut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaceComponents()

void BDSTunnelFactoryBase::PlaceComponents ( G4String  name)
protectedvirtual

Place components in container volume.

Definition at line 282 of file BDSTunnelFactoryBase.cc.

References BDSFactoryBase::checkOverlaps.

◆ PrepareGeometryComponent()

void BDSTunnelFactoryBase::PrepareGeometryComponent ( G4double  containerXRadius,
G4double  containerYRadius,
G4double  containerZRadius 
)
protectedvirtual

Prepare the assembled geometry component.

Definition at line 219 of file BDSTunnelFactoryBase.cc.

References BDSGeometryComponent::RegisterLogicalVolume(), BDSGeometryComponent::RegisterSolid(), BDSGeometryComponent::RegisterVisAttributes(), and BDSGeometryComponent::SetExtent().

Here is the call graph for this function:

◆ PrepareTunnelSection()

void BDSTunnelFactoryBase::PrepareTunnelSection ( G4String  name,
G4double  chordLength 
)
protectedvirtual

Prepare the output BDSTunnelSection instance.

Definition at line 243 of file BDSTunnelFactoryBase.cc.

References cumulativeAngle, BDSAcceleratorComponentRegistry::Instance(), and BDSAcceleratorComponentRegistry::RegisterTunnelComponent().

Here is the call graph for this function:

◆ SetSensitiveVolumes()

void BDSTunnelFactoryBase::SetSensitiveVolumes ( )
protectedvirtual

Set the sensitive volumes.

Definition at line 257 of file BDSTunnelFactoryBase.cc.

References BDSGeometryComponent::RegisterSensitiveVolume().

Here is the call graph for this function:

◆ SetUserLimits()

void BDSTunnelFactoryBase::SetUserLimits ( )
protectedvirtual

Set user limits for all logical volumes in the tunnel section.

Definition at line 270 of file BDSTunnelFactoryBase.cc.

References BDSGlobalConstants::Instance().

Here is the call graph for this function:

◆ SetVisAttributes()

void BDSTunnelFactoryBase::SetVisAttributes ( G4bool  visible)
protectedvirtual

Set the visual attributes for each logical volume.

Definition at line 183 of file BDSTunnelFactoryBase.cc.

References BDSColours::Instance(), and BDSGlobalConstants::Instance().

Here is the call graph for this function:

Field Documentation

◆ containerLV

G4LogicalVolume* BDSTunnelFactoryBase::containerLV
protected

Definition at line 200 of file BDSTunnelFactoryBase.hh.

◆ containerSolid

G4VSolid* BDSTunnelFactoryBase::containerSolid
protected

Definition at line 195 of file BDSTunnelFactoryBase.hh.

◆ cumulativeAngle

G4double BDSTunnelFactoryBase::cumulativeAngle
protected

The total angle by which the coordinates turn by (horizontally) after going through the tunnel - only really needed to fulfill BDSAcceleratorComponent inheritance - unsed further downstream.

Definition at line 210 of file BDSTunnelFactoryBase.hh.

Referenced by CleanUp(), and PrepareTunnelSection().

◆ defaultModel

BDSTunnelInfo* BDSTunnelFactoryBase::defaultModel
protected

Definition at line 205 of file BDSTunnelFactoryBase.hh.

◆ floorDisplacement

G4ThreeVector BDSTunnelFactoryBase::floorDisplacement
protected

Definition at line 204 of file BDSTunnelFactoryBase.hh.

◆ floorLV

G4LogicalVolume* BDSTunnelFactoryBase::floorLV
protected

Definition at line 203 of file BDSTunnelFactoryBase.hh.

◆ floorSolid

G4VSolid* BDSTunnelFactoryBase::floorSolid
protected

Definition at line 198 of file BDSTunnelFactoryBase.hh.

◆ intersectionSolid

G4VSolid* BDSTunnelFactoryBase::intersectionSolid
protected

Definition at line 199 of file BDSTunnelFactoryBase.hh.

◆ soilLV

G4LogicalVolume* BDSTunnelFactoryBase::soilLV
protected

Definition at line 202 of file BDSTunnelFactoryBase.hh.

◆ soilSolid

G4VSolid* BDSTunnelFactoryBase::soilSolid
protected

Definition at line 197 of file BDSTunnelFactoryBase.hh.

◆ tunnelComponent

BDSGeometryComponent* BDSTunnelFactoryBase::tunnelComponent
protected

Definition at line 192 of file BDSTunnelFactoryBase.hh.

◆ tunnelLV

G4LogicalVolume* BDSTunnelFactoryBase::tunnelLV
protected

Definition at line 201 of file BDSTunnelFactoryBase.hh.

◆ tunnelSection

BDSTunnelSection* BDSTunnelFactoryBase::tunnelSection
protected

Definition at line 193 of file BDSTunnelFactoryBase.hh.

◆ tunnelSolid

G4VSolid* BDSTunnelFactoryBase::tunnelSolid
protected

Definition at line 196 of file BDSTunnelFactoryBase.hh.


The documentation for this class was generated from the following files: