BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Private Member Functions
BDSBeamPipeFactoryRectEllipse Class Reference

Factory for rectellipse aperture model beampipes. More...

#include <BDSBeamPipeFactoryRectEllipse.hh>

Inheritance diagram for BDSBeamPipeFactoryRectEllipse:
Inheritance graph
Collaboration diagram for BDSBeamPipeFactoryRectEllipse:
Collaboration graph

Public Member Functions

virtual BDSBeamPipeCreateBeamPipe (const G4String &nameIn, G4double lengthIn, G4double aper1=0, G4double aper2=0, G4double aper3=0, G4double aper4=0, G4Material *vacuumMaterialIn=nullptr, G4double beamPipeThicknessIn=0, G4Material *beamPipeMaterialIn=nullptr, const G4String &pointsFileIn="", const G4String &pointsUnitIn="")
 create a flat ended beampipe More...
 
virtual BDSBeamPipeCreateBeamPipe (const G4String &nameIn, G4double lengthIn, const G4ThreeVector &inputFaceNormalIn, const G4ThreeVector &outputFaceNormalIn, G4double aper1=0, G4double aper2=0, G4double aper3=0, G4double aper4=0, G4Material *vacuumMaterialIn=nullptr, G4double beamPipeThicknessIn=0, G4Material *beamPipeMaterialIn=nullptr, const G4String &pointsFileIn="", const G4String &pointsUnitIn="")
 
- Public Member Functions inherited from BDSBeamPipeFactoryBase
virtual BDSBeamPipeCreateBeamPipe (const G4String &nameIn, G4double lengthIn, G4double aper1=0, G4double aper2=0, G4double aper3=0, G4double aper4=0, G4Material *vacuumMaterialIn=nullptr, G4double beamPipeThicknessIn=0, G4Material *beamPipeMaterialIn=nullptr, const G4String &pointsFileIn="", const G4String &pointsUnitIn="")=0
 create a flat ended beampipe More...
 
virtual BDSBeamPipeCreateBeamPipe (const G4String &nameIn, G4double lengthIn, const G4ThreeVector &inputFaceNormalIn, const G4ThreeVector &outputFaceNormalIn, G4double aper1=0, G4double aper2=0, G4double aper3=0, G4double aper4=0, G4Material *vacuumMaterialIn=nullptr, G4double beamPipeThicknessIn=0, G4Material *beamPipeMaterialIn=nullptr, const G4String &pointsFileIn="", const G4String &pointsUnitIn="")=0
 
virtual ~BDSBeamPipeFactoryBase ()
 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...
 

Private Member Functions

BDSBeamPipeCommonFinalConstruction (const G4String &nameIn, G4Material *vacuumMaterialIn, G4Material *beamPipeMaterialIn, G4double lengthIn, G4double widthIn, G4double heightIn)
 
void CreateGeneralAngledSolids (const G4String &nameIn, G4double lengthIn, G4double aper1In, G4double aper2In, G4double aper3In, G4double aper4In, G4double beamPipeThicknessIn, const G4ThreeVector &inputfaceIn, const G4ThreeVector &outputfaceIn)
 
void CreateContainerSubtractionSolid (const G4String &nameIn, G4double &lengthIn, G4double &beamPipeThicknessIn, G4double &aper1In, G4double &aper2In, G4double &aper3In, G4double &aper4In)
 

Additional Inherited Members

- Protected Member Functions inherited from BDSBeamPipeFactoryBase
 BDSBeamPipeFactoryBase ()
 base constructor More...
 
void CleanUpBase ()
 
virtual void CleanUp ()
 
void CommonConstruction (const G4String &nameIn, G4Material *vacuumMaterialIn, G4Material *beamPipeMaterialIn, G4double length)
 finalise beampipe construction More...
 
BDSBeamPipeBuildBeamPipeAndRegisterVolumes (BDSExtent extent, G4double containerRadius, G4bool containerIsCircular=false)
 build beampipe and register logical volumes More...
 
virtual void BuildLogicalVolumes (const G4String &nameIn, G4Material *vacuumMaterialIn, G4Material *beamPipeMaterialIn)
 build logical volumes More...
 
virtual void SetVisAttributes (G4Material *beamPipeMaterialIn)
 Set visual attributes. More...
 
virtual void SetUserLimits (G4double length)
 Set user limits. More...
 
virtual void PlaceComponents (const G4String &nameIn)
 Place volumes. More...
 
- Static Protected Member Functions inherited from BDSBeamPipeFactoryBase
static void CheckAngledVolumeCanBeBuilt (G4double length, const G4ThreeVector &inputfaceAngle, const G4ThreeVector &outputfaceAngle, G4double horizontalWidth, const G4String &name)
 check if a beam pipe volume with angled faces can be constructed More...
 
- Protected Attributes inherited from BDSBeamPipeFactoryBase
G4bool sensitiveBeamPipe
 Whether the beam pipe will record energy deposition. More...
 
G4bool sensitiveVacuum
 Whether the vacuum will record any energy deposition. More...
 
G4bool storeApertureImpacts
 Whether to store aperture impacts. More...
 
G4VSolid * vacuumSolid
 
G4VSolid * beamPipeSolid
 
G4VSolid * containerSolid
 
G4VSolid * containerSubtractionSolid
 Longer (in length) version of container solid for unambiguous subtraction. More...
 
G4LogicalVolume * vacuumLV
 
G4LogicalVolume * beamPipeLV
 
G4LogicalVolume * containerLV
 
G4PVPlacement * vacuumPV
 
G4PVPlacement * beamPipePV
 
G4ThreeVector inputFaceNormal
 For recording the face normals in the finished pipe component. More...
 
G4ThreeVector outputFaceNormal
 For recording the face normals in the finished pipe component. More...
 
- 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

Factory for rectellipse aperture model beampipes.

This is the overlap of (boolean AND) a rectangle and an ellipse transversely. This factory is similar to the simple LHC factory and uses the intersection of an elliptical tube and a box. This method produces a solid shape, so to achieve a pipe, a smaller duplicate intersection solid is made for subtraction from the outer one. To achieve the angled faces, G4CutTubs is used and the rectangular box is made longer so the first intersection gives the angled face from the easier G4CutTubs primitive.

This factory requires four aperture parameters. Aper1,2 are the horizontal and vertical half widths of the rectangle respectively, and aper3,4 are the horizontal and vertical semi-axes of the ellipse. Note, will aper1,2 should be < aper1,2 otherwise an elliptical tube will be more efficient.

Author
Laurie Nevay

Definition at line 45 of file BDSBeamPipeFactoryRectEllipse.hh.

Constructor & Destructor Documentation

◆ BDSBeamPipeFactoryRectEllipse()

BDSBeamPipeFactoryRectEllipse::BDSBeamPipeFactoryRectEllipse ( )

Definition at line 45 of file BDSBeamPipeFactoryRectEllipse.cc.

◆ ~BDSBeamPipeFactoryRectEllipse()

virtual BDSBeamPipeFactoryRectEllipse::~BDSBeamPipeFactoryRectEllipse ( )
inlinevirtual

Definition at line 49 of file BDSBeamPipeFactoryRectEllipse.hh.

Member Function Documentation

◆ CommonFinalConstruction()

BDSBeamPipe * BDSBeamPipeFactoryRectEllipse::CommonFinalConstruction ( const G4String &  nameIn,
G4Material *  vacuumMaterialIn,
G4Material *  beamPipeMaterialIn,
G4double  lengthIn,
G4double  widthIn,
G4double  heightIn 
)
private

only the solids are unique, once we have those, the logical volumes and placement in the container are the same. group all this functionality together

Definition at line 210 of file BDSBeamPipeFactoryRectEllipse.cc.

References BDSBeamPipeFactoryBase::BuildBeamPipeAndRegisterVolumes(), and BDSBeamPipeFactoryBase::CommonConstruction().

Referenced by CreateBeamPipe().

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

◆ CreateBeamPipe() [1/2]

BDSBeamPipe * BDSBeamPipeFactoryRectEllipse::CreateBeamPipe ( const G4String &  nameIn,
G4double  lengthIn,
const G4ThreeVector &  inputFaceNormalIn,
const G4ThreeVector &  outputFaceNormalIn,
G4double  aper1 = 0,
G4double  aper2 = 0,
G4double  aper3 = 0,
G4double  aper4 = 0,
G4Material *  vacuumMaterialIn = nullptr,
G4double  beamPipeThicknessIn = 0,
G4Material *  beamPipeMaterialIn = nullptr,
const G4String &  pointsFileIn = "",
const G4String &  pointsUnitIn = "" 
)
virtual

Create a beam pipe with angled faces as described by unit normal vectors. The input face normal vector must have a negative z component and the output face a positive z component.

Implements BDSBeamPipeFactoryBase.

Definition at line 164 of file BDSBeamPipeFactoryRectEllipse.cc.

References CommonFinalConstruction(), BDSBeamPipeFactoryElliptical::CreateBeamPipe(), CreateGeneralAngledSolids(), BDSBeamPipeFactoryBase::inputFaceNormal, BDSFactoryBase::lengthSafetyLarge, and BDSBeamPipeFactoryBase::outputFaceNormal.

Here is the call graph for this function:

◆ CreateBeamPipe() [2/2]

BDSBeamPipe * BDSBeamPipeFactoryRectEllipse::CreateBeamPipe ( const G4String &  nameIn,
G4double  lengthIn,
G4double  aper1 = 0,
G4double  aper2 = 0,
G4double  aper3 = 0,
G4double  aper4 = 0,
G4Material *  vacuumMaterialIn = nullptr,
G4double  beamPipeThicknessIn = 0,
G4Material *  beamPipeMaterialIn = nullptr,
const G4String &  pointsFileIn = "",
const G4String &  pointsUnitIn = "" 
)
virtual

create a flat ended beampipe

Implements BDSBeamPipeFactoryBase.

Definition at line 48 of file BDSBeamPipeFactoryRectEllipse.cc.

References CommonFinalConstruction(), BDSBeamPipeFactoryElliptical::CreateBeamPipe(), BDSFactoryBase::lengthSafety, and BDSFactoryBase::lengthSafetyLarge.

Here is the call graph for this function:

◆ CreateContainerSubtractionSolid()

void BDSBeamPipeFactoryRectEllipse::CreateContainerSubtractionSolid ( const G4String &  nameIn,
G4double &  lengthIn,
G4double &  beamPipeThicknessIn,
G4double &  aper1In,
G4double &  aper2In,
G4double &  aper3In,
G4double &  aper4In 
)
private

Definition at line 366 of file BDSBeamPipeFactoryRectEllipse.cc.

◆ CreateGeneralAngledSolids()

void BDSBeamPipeFactoryRectEllipse::CreateGeneralAngledSolids ( const G4String &  nameIn,
G4double  lengthIn,
G4double  aper1In,
G4double  aper2In,
G4double  aper3In,
G4double  aper4In,
G4double  beamPipeThicknessIn,
const G4ThreeVector &  inputfaceIn,
const G4ThreeVector &  outputfaceIn 
)
private

the angled ones have degeneracy in the geant4 solids they used so we can avoid code duplication by grouping common construction tasks

Definition at line 229 of file BDSBeamPipeFactoryRectEllipse.cc.

References BDS::CalculateSafeAngledVolumeLength(), BDSBeamPipeFactoryBase::CheckAngledVolumeCanBeBuilt(), BDSFactoryBase::lengthSafety, and BDSFactoryBase::lengthSafetyLarge.

Referenced by CreateBeamPipe().

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

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