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

Factory for simple parallel geometry for curvilinear coordinates. More...

#include <BDSCurvilinearBuilder.hh>

Collaboration diagram for BDSCurvilinearBuilder:
Collaboration graph

Public Member Functions

BDSBeamlineBuildCurvilinearBeamLine1To1 (BDSBeamline const *const beamline, const G4bool circular)
 Build a beam line of curvilinear geometry based on another beam line. More...
 
BDSBeamlineBuildCurvilinearBridgeBeamLine (BDSBeamline const *const beamline)
 Build bridging volumes to join the curvilinear ones. More...
 

Private Member Functions

 BDSCurvilinearBuilder (const BDSCurvilinearBuilder &)=delete
 
BDSCurvilinearBuilderoperator= (const BDSCurvilinearBuilder &)=delete
 
G4double CurvilinearRadius (const BDSBeamlineElement *el) const
 
BDSBeamlineElementCreateCurvilinearElement (const G4String &elementName, BDSBeamline::const_iterator startElement, BDSBeamline::const_iterator finishElement, G4int index, G4double crRadius)
 
BDSBeamlineElementCreateElementFromComponent (BDSSimpleComponent *component, BDSBeamline::const_iterator startElement, BDSBeamline::const_iterator finishElement, G4int index)
 Create the BDSBeamlineElement by wrapping a BDSSimpleComponent. More...
 
BDSBeamlineElementCreateBridgeSection (BDSAcceleratorComponent *defaultBridge, BDSBeamline::const_iterator element, BDSBeamline::const_iterator nextElement, BDSBeamline::const_iterator end, G4int &numberOfUniqueComponents, const G4int beamlineIndex, G4double crRadius)
 
void PreviousAndNext (BDSBeamline::const_iterator it, BDSBeamline::const_iterator startIt, BDSBeamline::const_iterator endIt, const BDSBeamlineElement *&previous, const BDSBeamlineElement *&next) const
 
BDSAcceleratorComponentCreateDefaultBridgeComponent ()
 
BDSAcceleratorComponentCreateStraightBridgeComponent (G4double width, G4int &numberOfUniqueComponents)
 
BDSAcceleratorComponentCreateAngledBridgeComponent (BDSBeamline::const_iterator element, G4int &numberOfUniqueComponents, G4double suggestedRadius)
 Create a unique accelerator component for an element with angled faces. More...
 
BDSBeamlineElementCreateBridgeElementFromComponent (BDSAcceleratorComponent *component, BDSBeamline::const_iterator element, BDSBeamline::const_iterator nextElement, BDSBeamline::const_iterator end, const G4int beamlineIndex)
 
G4bool Angled (BDSBeamlineElement const *const element) const
 Simple interrogation function to determine if an element has a finite angle or not. More...
 
G4bool TooShort (BDSBeamlineElement const *const element) const
 Whether an element is too short for its own curvilinear volume.
 
BDSBeamlineElementCreateBonusSectionStart (BDSBeamline const *const beamline)
 Create a small section to extend a linear beam line. More...
 
BDSBeamlineElementCreateBonusSectionEnd (BDSBeamline const *const beamline)
 Create a small section to extend a linear beam line. More...
 

Private Attributes

G4double paddingLength
 Length that was used for padding on the beam line we're building with respesct to. More...
 
G4double defaultBridgeLength
 
G4double curvilinearRadius
 Radius for curvilinear geometry. More...
 
G4double radiusTolerance
 
G4double bonusChordLength
 Length of any possible bonus section added to beginning and end. More...
 
BDSCurvilinearFactoryfactory
 Factory to build curvilinear geometry. More...
 

Detailed Description

Factory for simple parallel geometry for curvilinear coordinates.

This builds a beam line of geometry w.r.t. a beam line that can be used for curvilinear coordinates.

Author
Laurie Nevay

Definition at line 37 of file BDSCurvilinearBuilder.hh.

Constructor & Destructor Documentation

◆ BDSCurvilinearBuilder()

BDSCurvilinearBuilder::BDSCurvilinearBuilder ( )

Definition at line 42 of file BDSCurvilinearBuilder.cc.

◆ ~BDSCurvilinearBuilder()

BDSCurvilinearBuilder::~BDSCurvilinearBuilder ( )

Definition at line 72 of file BDSCurvilinearBuilder.cc.

Member Function Documentation

◆ Angled()

G4bool BDSCurvilinearBuilder::Angled ( BDSBeamlineElement const *const  element) const
inlineprivate

Simple interrogation function to determine if an element has a finite angle or not.

Definition at line 144 of file BDSCurvilinearBuilder.hh.

References BDSBeamlineElement::GetAngle(), and BDS::IsFinite().

Referenced by CreateCurvilinearElement().

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

◆ BuildCurvilinearBeamLine1To1()

BDSBeamline * BDSCurvilinearBuilder::BuildCurvilinearBeamLine1To1 ( BDSBeamline const *const  beamline,
const G4bool  circular 
)

Build a beam line of curvilinear geometry based on another beam line.

Definition at line 77 of file BDSCurvilinearBuilder.cc.

References BDSBeamline::AddBeamlineElement(), BDSBeamline::begin(), CreateBonusSectionEnd(), CreateBonusSectionStart(), CreateCurvilinearElement(), CurvilinearRadius(), BDSBeamline::empty(), BDSBeamline::end(), and PreviousAndNext().

Referenced by BDSDetectorConstruction::BuildBeamline().

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

◆ BuildCurvilinearBridgeBeamLine()

BDSBeamline * BDSCurvilinearBuilder::BuildCurvilinearBridgeBeamLine ( BDSBeamline const *const  beamline)

Build bridging volumes to join the curvilinear ones.

Definition at line 154 of file BDSCurvilinearBuilder.cc.

References BDSBeamline::AddBeamlineElement(), BDSBeamline::begin(), CreateBridgeSection(), CreateDefaultBridgeComponent(), CurvilinearRadius(), BDSBeamline::end(), and PreviousAndNext().

Referenced by BDSDetectorConstruction::BuildBeamline().

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

◆ CreateAngledBridgeComponent()

BDSAcceleratorComponent * BDSCurvilinearBuilder::CreateAngledBridgeComponent ( BDSBeamline::const_iterator  element,
G4int &  numberOfUniqueComponents,
G4double  suggestedRadius 
)
private

Create a unique accelerator component for an element with angled faces.

Definition at line 309 of file BDSCurvilinearBuilder.cc.

References BDSCurvilinearFactory::CreateCurvilinearVolume(), factory, BDSAcceleratorComponentRegistry::Instance(), BDSAcceleratorComponent::OutputFaceNormal(), and BDSAcceleratorComponentRegistry::RegisterCurvilinearComponent().

Referenced by CreateBridgeSection().

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

◆ CreateBonusSectionEnd()

BDSBeamlineElement * BDSCurvilinearBuilder::CreateBonusSectionEnd ( BDSBeamline const *const  beamline)
private

◆ CreateBonusSectionStart()

BDSBeamlineElement * BDSCurvilinearBuilder::CreateBonusSectionStart ( BDSBeamline const *const  beamline)
private

◆ CreateBridgeElementFromComponent()

BDSBeamlineElement * BDSCurvilinearBuilder::CreateBridgeElementFromComponent ( BDSAcceleratorComponent component,
BDSBeamline::const_iterator  element,
BDSBeamline::const_iterator  nextElement,
BDSBeamline::const_iterator  end,
const G4int  beamlineIndex 
)
private

Package an accelerator component into a beam line element w.r.t. two particular elements. Again, can cope with nextElement == end.

Definition at line 335 of file BDSCurvilinearBuilder.cc.

References BDSAcceleratorComponent::GetChordLength(), BDSBeamlineElement::GetReferencePositionEnd(), BDSBeamlineElement::GetReferenceRotationEnd(), BDSBeamlineElement::GetSPositionEnd(), BDSBeamlineElement::GetSPositionStart(), and BDSBeamlineElement::GetTiltOffset().

Referenced by CreateBridgeSection().

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

◆ CreateBridgeSection()

BDSBeamlineElement * BDSCurvilinearBuilder::CreateBridgeSection ( BDSAcceleratorComponent defaultBridge,
BDSBeamline::const_iterator  element,
BDSBeamline::const_iterator  nextElement,
BDSBeamline::const_iterator  end,
G4int &  numberOfUniqueComponents,
const G4int  beamlineIndex,
G4double  crRadius 
)
private

Create a pre-made beam line element (because it's a non-continuous beam line) for a bridge section between two curvilinear volumes. Can cope if nextElement == end. numberOfUniqueComponents will be incremented if a new accelerator component is required. This is only done if the two components that are being bridged have angled faces. beamlineIndex is the index the element will have in the non-continuous beam line; the indices should be continuous. crRadius controls the radius of the component.

Definition at line 263 of file BDSCurvilinearBuilder.cc.

References CreateAngledBridgeComponent(), CreateBridgeElementFromComponent(), CreateStraightBridgeComponent(), and BDS::IsFinite().

Referenced by BuildCurvilinearBridgeBeamLine().

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

◆ CreateCurvilinearElement()

BDSBeamlineElement * BDSCurvilinearBuilder::CreateCurvilinearElement ( const G4String &  elementName,
BDSBeamline::const_iterator  startElement,
BDSBeamline::const_iterator  finishElement,
G4int  index,
G4double  crRadius 
)
private

Create a curvilinear element for a beam line that represents the curvilinear coordinates between startElement and finishElement. This creates a BDSSimpleComponent first then wraps it in a pre-made BDSBeamlineElement. This must ONLY be used for a range of elements with the same tilt for the correct coordinate frame to be produced. The tilt is taken from the first element and assumed to be the same for all. The index is the index it'l have in the curvilinear beam line.

Definition at line 197 of file BDSCurvilinearBuilder.cc.

References Angled(), BDSCurvilinearFactory::CreateCurvilinearVolume(), CreateElementFromComponent(), factory, BDSAcceleratorComponentRegistry::Instance(), BDS::IsFinite(), paddingLength, and BDSAcceleratorComponentRegistry::RegisterCurvilinearComponent().

Referenced by BuildCurvilinearBeamLine1To1().

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

◆ CreateDefaultBridgeComponent()

BDSAcceleratorComponent * BDSCurvilinearBuilder::CreateDefaultBridgeComponent ( )
private

Create a single flat sided accelerator component for a small bridge volume. Intended to be reused as the default.

Definition at line 286 of file BDSCurvilinearBuilder.cc.

References BDSCurvilinearFactory::CreateCurvilinearVolume(), curvilinearRadius, factory, BDSAcceleratorComponentRegistry::Instance(), and BDSAcceleratorComponentRegistry::RegisterCurvilinearComponent().

Referenced by BuildCurvilinearBridgeBeamLine().

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

◆ CreateElementFromComponent()

BDSBeamlineElement * BDSCurvilinearBuilder::CreateElementFromComponent ( BDSSimpleComponent component,
BDSBeamline::const_iterator  startElement,
BDSBeamline::const_iterator  finishElement,
G4int  index 
)
private

◆ CreateStraightBridgeComponent()

BDSAcceleratorComponent * BDSCurvilinearBuilder::CreateStraightBridgeComponent ( G4double  width,
G4int &  numberOfUniqueComponents 
)
private

Create a unique accelerator component for an element that's straight, but with a specific width.

Definition at line 298 of file BDSCurvilinearBuilder.cc.

References BDSCurvilinearFactory::CreateCurvilinearVolume(), factory, BDSAcceleratorComponentRegistry::Instance(), and BDSAcceleratorComponentRegistry::RegisterCurvilinearComponent().

Referenced by CreateBridgeSection().

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

◆ CurvilinearRadius()

G4double BDSCurvilinearBuilder::CurvilinearRadius ( const BDSBeamlineElement el) const
private

Return the minimum of the (default) member curvilinearRadius and the radiusTolerance member * the radius from the arc length and the bending angle. If nullptr give, returns curvilinearRadius.

Definition at line 183 of file BDSCurvilinearBuilder.cc.

References curvilinearRadius, BDSBeamlineElement::GetAngle(), BDSBeamlineElement::GetArcLength(), and BDS::IsFinite().

Referenced by BuildCurvilinearBeamLine1To1(), and BuildCurvilinearBridgeBeamLine().

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

◆ PreviousAndNext()

void BDSCurvilinearBuilder::PreviousAndNext ( BDSBeamline::const_iterator  it,
BDSBeamline::const_iterator  startIt,
BDSBeamline::const_iterator  endIt,
const BDSBeamlineElement *&  previous,
const BDSBeamlineElement *&  next 
) const
private

Safely give a pointer to the previous and next items, excluding items below 0.1mm (ie short items such as fringes). Sets pointers to nullptr if at beginning or end.

Definition at line 116 of file BDSCurvilinearBuilder.cc.

References BDSBeamlineElement::GetArcLength().

Referenced by BuildCurvilinearBeamLine1To1(), and BuildCurvilinearBridgeBeamLine().

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

Field Documentation

◆ bonusChordLength

G4double BDSCurvilinearBuilder::bonusChordLength
private

Length of any possible bonus section added to beginning and end.

Definition at line 138 of file BDSCurvilinearBuilder.hh.

Referenced by CreateBonusSectionEnd(), and CreateBonusSectionStart().

◆ curvilinearRadius

G4double BDSCurvilinearBuilder::curvilinearRadius
private

Radius for curvilinear geometry.

Definition at line 136 of file BDSCurvilinearBuilder.hh.

Referenced by CreateBonusSectionEnd(), CreateBonusSectionStart(), CreateDefaultBridgeComponent(), and CurvilinearRadius().

◆ defaultBridgeLength

G4double BDSCurvilinearBuilder::defaultBridgeLength
private

Definition at line 135 of file BDSCurvilinearBuilder.hh.

◆ factory

BDSCurvilinearFactory* BDSCurvilinearBuilder::factory
private

◆ paddingLength

G4double BDSCurvilinearBuilder::paddingLength
private

Length that was used for padding on the beam line we're building with respesct to.

Definition at line 134 of file BDSCurvilinearBuilder.hh.

Referenced by CreateBonusSectionEnd(), CreateBonusSectionStart(), and CreateCurvilinearElement().

◆ radiusTolerance

G4double BDSCurvilinearBuilder::radiusTolerance
private

Definition at line 137 of file BDSCurvilinearBuilder.hh.


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