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

A vector of BDSBeamlineElement instances - a beamline. More...

#include <BDSBeamline.hh>

Collaboration diagram for BDSBeamline:
Collaboration graph

Public Member Functions

BDSBeamlineoperator= (const BDSBeamline &)=delete
 assignment and copy constructor not implemented nor used.
 
 BDSBeamline (BDSBeamline &)=delete
 
 BDSBeamline (const G4ThreeVector &initialGlobalPosition=G4ThreeVector(0, 0, 0), G4RotationMatrix *initialGlobalRotation=nullptr, G4double initialS=0.0)
 
 BDSBeamline (G4Transform3D initialTransform, G4double initialS=0.0)
 Constructor with transform instance that uses other constructor. More...
 
void AddComponent (BDSAcceleratorComponent *component, BDSTiltOffset *tiltOffset=nullptr, BDSSamplerInfo *samplerInfo=nullptr)
 
void ApplyTransform3D (BDSTransform3D *component)
 
void AddBeamlineElement (BDSBeamlineElement *element)
 
void PrintAllComponents (std::ostream &out) const
 
void UpdateExtents (BDSBeamlineElement *element)
 
const BDSBeamlineElementat (int iElement) const
 Return a reference to the element at i. More...
 
const BDSBeamlineElementGetFirstItem () const
 Return a reference to the first element. More...
 
const BDSBeamlineElementGetLastItem () const
 Return a reference to the last element. More...
 
const BDSBeamlineElementGetElement (G4String acceleratorComponentName, G4int i=0) const
 Get the ith placement of an element in the beam line. Returns null pointer if not found. More...
 
G4Transform3D GetTransformForElement (const G4String &acceleratorComponentName, G4int i=0) const
 
G4double GetTotalChordLength () const
 Get the total length of the beamline - the sum of the chord length of each element. More...
 
G4double GetTotalArcLength () const
 Get the total ARC length for the beamline - ie the maximum s position. More...
 
G4double GetTotalAngle () const
 Get the total angle of the beamline. More...
 
G4bool ElementAnglesSumToCircle () const
 Check if the sum of the angle of all elements is two pi. More...
 
BeamlineVector::size_type size () const
 Get the number of elements. More...
 
G4ThreeVector GetMaximumExtentPositive () const
 Get the maximum positive extent in all dimensions
More...
 
G4ThreeVector GetMaximumExtentNegative () const
 Get the maximum negative extent in all dimensions. More...
 
G4ThreeVector GetMaximumExtentAbsolute () const
 Get the maximum extent absolute in each dimension. More...
 
BDSExtentGlobal GetExtentGlobal () const
 Get the global extents for this beamline. More...
 
G4Transform3D GetGlobalEuclideanTransform (G4double s, G4double x=0, G4double y=0, G4int *indexOfFoundElement=nullptr) const
 
const BDSBeamlineElementGetElementFromGlobalS (G4double S, G4int *indexOfFoundElement=nullptr) const
 Return the element in this beam line according to a given s coordinate. More...
 
const_iterator FindFromS (G4double S) const
 Returns an iterator to the beamline element at s. More...
 
std::vector< G4double > GetEdgeSPositions () const
 
const BDSBeamlineElementGetPrevious (const BDSBeamlineElement *element) const
 
const BDSBeamlineElementGetNext (const BDSBeamlineElement *element) const
 
const BDSBeamlineElementGetPrevious (G4int index) const
 
const BDSBeamlineElementGetNext (G4int index) const
 
BDSBeamlineElementfront () const
 Return a reference to the first element. More...
 
BDSBeamlineElementback () const
 Return a reference to the last element. More...
 
void PrintMemoryConsumption () const
 
BDSBeamlineElementProvideEndPieceElementBefore (BDSSimpleComponent *endPiece, G4int index) const
 
BDSBeamlineElementProvideEndPieceElementAfter (BDSSimpleComponent *endPiece, G4int index, G4bool flip=false) const
 
G4bool IndexOK (G4int index) const
 Whether the supplied index will lie within the beam line vector. More...
 
std::vector< G4int > GetIndicesOfElementsOfType (const G4String &type) const
 Return vector of indices for this beam line where element of type name 'type' is found. More...
 
std::vector< G4int > GetIndicesOfElementsOfType (const std::set< G4String > &types) const
 
std::vector< G4int > GetIndicesOfCollimators () const
 Return indices in order of ecol, rcol, jcol and crystalcol elements. More...
 

Static Public Member Functions

static G4double PaddingLength ()
 Access the padding length between each element added to the beamline. More...
 

Private Types

typedef std::vector< BDSBeamlineElement * > BeamlineVector
 Typedefs up first so we can declare public iterators. More...
 

Private Member Functions

void AddSingleComponent (BDSAcceleratorComponent *component, BDSTiltOffset *tiltOffset=nullptr, BDSSamplerInfo *samplerInfo=nullptr)
 
void RegisterElement (BDSBeamlineElement *element)
 

Private Attributes

BeamlineVector beamline
 Vector of beam line elements - the data. More...
 
G4double totalChordLength
 Sum of all chord lengths. More...
 
G4double totalArcLength
 Sum of all arc lengths. More...
 
G4double totalAngle
 Sum of all angles. More...
 
G4ThreeVector maximumExtentPositive
 maximum extent in the positive coordinates in each dimension More...
 
G4ThreeVector maximumExtentNegative
 maximum extent in the negative coordinates in each dimension More...
 
G4RotationMatrix * previousReferenceRotationEnd
 Current reference rotation at the end of the previous element. More...
 
G4ThreeVector previousReferencePositionEnd
 Current reference position at the end of the previous element. More...
 
G4double previousSPositionEnd
 Current s coordinate at the end of the previous element. More...
 
G4bool transformHasJustBeenApplied
 
std::map< G4String, BDSBeamlineElement * > components
 Map of objects by placement name stored in this beam line. More...
 
std::vector< G4double > sEnd
 

Static Private Attributes

static G4double paddingLength = -1
 The gap added for padding between each component. More...
 

Friends

std::ostream & operator<< (std::ostream &out, BDSBeamline const &bl)
 output stream More...
 
typedef BeamlineVector::iterator iterator
 Iterator mechanics. More...
 
typedef BeamlineVector::const_iterator const_iterator
 Iterator mechanics. More...
 
typedef BeamlineVector::reverse_iterator reverse_iterator
 Iterator mechanics. More...
 
typedef BeamlineVector::const_reverse_iterator const_reverse_iterator
 Iterator mechanics. More...
 
iterator begin ()
 Iterator mechanics. More...
 
iterator end ()
 Iterator mechanics. More...
 
const_iterator begin () const
 Iterator mechanics. More...
 
const_iterator end () const
 Iterator mechanics. More...
 
reverse_iterator rbegin ()
 Iterator mechanics. More...
 
reverse_iterator rend ()
 Iterator mechanics. More...
 
const_reverse_iterator rbegin () const
 Iterator mechanics. More...
 
const_reverse_iterator rend () const
 Iterator mechanics. More...
 
G4bool empty () const
 Iterator mechanics. More...
 

Detailed Description

A vector of BDSBeamlineElement instances - a beamline.

This will calculate and construct a beamline as BDSAcceleratorComponents are added in sequence - ie it calculates their placement positions and rotations with respect to the start of the beamline as well as their s position in curvilinear coordinates.

Note, this is not a singleton as geometry hierarchy can be introduced by placing beamline components inside parent volumes and therefore creating a new beamline of parents. It can also be used to create multiple beam lines.

Author
Laurie Nevay

Definition at line 60 of file BDSBeamline.hh.

Member Typedef Documentation

◆ BeamlineVector

typedef std::vector<BDSBeamlineElement*> BDSBeamline::BeamlineVector
private

Typedefs up first so we can declare public iterators.

Definition at line 64 of file BDSBeamline.hh.

◆ const_iterator

typedef BeamlineVector::const_iterator BDSBeamline::const_iterator

Iterator mechanics.

Definition at line 164 of file BDSBeamline.hh.

◆ const_reverse_iterator

typedef BeamlineVector::const_reverse_iterator BDSBeamline::const_reverse_iterator

Iterator mechanics.

Definition at line 166 of file BDSBeamline.hh.

◆ iterator

typedef BeamlineVector::iterator BDSBeamline::iterator

Iterator mechanics.

Definition at line 163 of file BDSBeamline.hh.

◆ reverse_iterator

typedef BeamlineVector::reverse_iterator BDSBeamline::reverse_iterator

Iterator mechanics.

Definition at line 165 of file BDSBeamline.hh.

Constructor & Destructor Documentation

◆ BDSBeamline() [1/2]

BDSBeamline::BDSBeamline ( const G4ThreeVector &  initialGlobalPosition = G4ThreeVector(0,0,0),
G4RotationMatrix *  initialGlobalRotation = nullptr,
G4double  initialS = 0.0 
)

Versatile basic constructor that allows a finite position and rotation to be applied at the beginning of the beamline in global coordinates. Remember the maximum extents of the beamline will also be displaced. The default constructor is in effect achieved via defaults

Definition at line 50 of file BDSBeamline.cc.

References BDSGlobalConstants::Instance(), maximumExtentNegative, maximumExtentPositive, paddingLength, and previousReferenceRotationEnd.

Here is the call graph for this function:

◆ BDSBeamline() [2/2]

BDSBeamline::BDSBeamline ( G4Transform3D  initialTransform,
G4double  initialS = 0.0 
)
explicit

Constructor with transform instance that uses other constructor.

Definition at line 82 of file BDSBeamline.cc.

◆ ~BDSBeamline()

BDSBeamline::~BDSBeamline ( )

Definition at line 89 of file BDSBeamline.cc.

Member Function Documentation

◆ AddBeamlineElement()

void BDSBeamline::AddBeamlineElement ( BDSBeamlineElement element)

Add a pre-assembled beam line element. In this case, the coordinates will have been calculated external to this class and as such, it's the responsibility of the developer to make sure the coordinates are correct and do not cause overlaps. This will be useful for tunnel construction for example or for a non-contiguous beamline. Subsequent components added via the AddComponent() method will be appended in the usual way to the end coordinates of this element.

Definition at line 571 of file BDSBeamline.cc.

References beamline, BDSBeamlineElement::GetAcceleratorComponent(), RegisterElement(), and UpdateExtents().

Referenced by BDS::BuildBLMs(), BDSCurvilinearBuilder::BuildCurvilinearBeamLine1To1(), BDSCurvilinearBuilder::BuildCurvilinearBridgeBeamLine(), BDS::BuildEndPieceBeamline(), BDS::BuildPlacementGeometry(), and BDSTunnelBuilder::BuildTunnelSections().

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

◆ AddComponent()

void BDSBeamline::AddComponent ( BDSAcceleratorComponent component,
BDSTiltOffset tiltOffset = nullptr,
BDSSamplerInfo samplerInfo = nullptr 
)

Add a component, but check to see if it can be dynamically upcast to a line in which case, loop over it and apply AddSingleComponent(BDSAcceleratorComponent* component) to each component Returns vector of components added

Definition at line 122 of file BDSBeamline.cc.

References AddSingleComponent(), back(), BDSBeamlineElement::GetReferencePositionEnd(), BDSBeamlineElement::GetReferencePositionStart(), BDSBeamlineElement::GetReferenceRotationEnd(), BDSBeamlineElement::GetReferenceRotationStart(), BDSBeamlineElement::GetSamplerInfo(), BDSOutput::InvalidSamplerName(), BDSOutput::PrintProtectedNames(), and BDSBeamlineElement::UpdateSamplerPlacementTransform().

Referenced by BDSDetectorConstruction::BuildBeamline(), and BDSTunnelBuilder::BuildTunnelSections().

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

◆ AddSingleComponent()

void BDSBeamline::AddSingleComponent ( BDSAcceleratorComponent component,
BDSTiltOffset tiltOffset = nullptr,
BDSSamplerInfo samplerInfo = nullptr 
)
private

◆ ApplyTransform3D()

void BDSBeamline::ApplyTransform3D ( BDSTransform3D component)

Apply a Transform3D rotation and translation to the reference coordinates. Special method for the special case of unique component Transform3D. Modifies the end rotation and position of the last element in the beamline. Note this applies the offset dx,dy,dz first, then the rotation of coordinates

Definition at line 539 of file BDSBeamline.cc.

References back(), empty(), BDSAcceleratorComponent::GetName(), BDSBeamlineElement::GetReferencePositionEnd(), BDSBeamlineElement::GetReferenceRotationEnd(), previousReferencePositionEnd, and previousReferenceRotationEnd.

Referenced by AddSingleComponent().

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

◆ at()

const BDSBeamlineElement * BDSBeamline::at ( int  iElement) const
inline

Return a reference to the element at i.

Definition at line 120 of file BDSBeamline.hh.

References beamline.

Referenced by GetGlobalEuclideanTransform(), and BDSOutputStructures::PrepareCollimatorInformation().

Here is the caller graph for this function:

◆ back()

BDSBeamlineElement * BDSBeamline::back ( ) const
inline

Return a reference to the last element.

Definition at line 211 of file BDSBeamline.hh.

References beamline.

Referenced by AddComponent(), AddSingleComponent(), ApplyTransform3D(), BDSDetectorConstruction::BuildBeamlines(), BDS::BuildEndPieceBeamline(), BDSTunnelBuilder::BuildTunnelSections(), BDS::CalculateTeleporterDelta(), and GetLastItem().

Here is the caller graph for this function:

◆ begin() [1/2]

iterator BDSBeamline::begin ( )
inline

◆ begin() [2/2]

const_iterator BDSBeamline::begin ( ) const
inline

Iterator mechanics.

Definition at line 169 of file BDSBeamline.hh.

References beamline.

◆ ElementAnglesSumToCircle()

G4bool BDSBeamline::ElementAnglesSumToCircle ( ) const

Check if the sum of the angle of all elements is two pi.

Definition at line 919 of file BDSBeamline.cc.

References totalAngle.

Referenced by BDSDetectorConstruction::BuildBeamlines().

Here is the caller graph for this function:

◆ empty()

G4bool BDSBeamline::empty ( ) const
inline

◆ end() [1/2]

iterator BDSBeamline::end ( )
inline

◆ end() [2/2]

const_iterator BDSBeamline::end ( ) const
inline

Iterator mechanics.

Definition at line 170 of file BDSBeamline.hh.

References beamline.

◆ FindFromS()

BDSBeamline::const_iterator BDSBeamline::FindFromS ( G4double  S) const

Returns an iterator to the beamline element at s.

Definition at line 678 of file BDSBeamline.cc.

References begin(), and sEnd.

Referenced by BDSDetectorConstruction::SideToLocalOffset().

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

◆ front()

BDSBeamlineElement * BDSBeamline::front ( ) const
inline

Return a reference to the first element.

Definition at line 209 of file BDSBeamline.hh.

References beamline.

Referenced by BDS::CalculateTeleporterDelta(), and GetFirstItem().

Here is the caller graph for this function:

◆ GetEdgeSPositions()

std::vector< G4double > BDSBeamline::GetEdgeSPositions ( ) const

Get the global s position of each element all in one - used for histograms. For convenience, s positions are converted to metres in this function.

Definition at line 906 of file BDSBeamline.cc.

References beamline, and BDSBeamlineElement::GetSPositionEnd().

Referenced by BDSOutput::CreateHistograms().

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

◆ GetElement()

const BDSBeamlineElement * BDSBeamline::GetElement ( G4String  acceleratorComponentName,
G4int  i = 0 
) const

Get the ith placement of an element in the beam line. Returns null pointer if not found.

Definition at line 736 of file BDSBeamline.cc.

References begin(), components, end(), BDSBeamlineElement::GetPlacementName(), and BDS::StartsWith().

Referenced by BDSDetectorConstruction::CreatePlacementTransform(), and GetTransformForElement().

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

◆ GetElementFromGlobalS()

const BDSBeamlineElement * BDSBeamline::GetElementFromGlobalS ( G4double  S,
G4int *  indexOfFoundElement = nullptr 
) const

Return the element in this beam line according to a given s coordinate.

Definition at line 667 of file BDSBeamline.cc.

References beamline, and sEnd.

Referenced by GetGlobalEuclideanTransform().

Here is the caller graph for this function:

◆ GetExtentGlobal()

BDSExtentGlobal BDSBeamline::GetExtentGlobal ( ) const

Get the global extents for this beamline.

Definition at line 924 of file BDSBeamline.cc.

References maximumExtentNegative, and maximumExtentPositive.

Referenced by BDSDetectorConstruction::BuildWorld(), and BDSBeamlineSet::GetExtentGlobals().

Here is the caller graph for this function:

◆ GetFirstItem()

const BDSBeamlineElement * BDSBeamline::GetFirstItem ( ) const
inline

Return a reference to the first element.

Definition at line 123 of file BDSBeamline.hh.

References front().

Referenced by BDS::BuildEndPieceBeamline(), and BDSCurvilinearBuilder::CreateBonusSectionStart().

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

◆ GetGlobalEuclideanTransform()

G4Transform3D BDSBeamline::GetGlobalEuclideanTransform ( G4double  s,
G4double  x = 0,
G4double  y = 0,
G4int *  indexOfFoundElement = nullptr 
) const

Get the local to global transform for curvilinear coordinates to global coordinates. 0,0 transverse position by default. Optionally returns the index of the found element in the beam line (by reference variable).

Definition at line 598 of file BDSBeamline.cc.

References at(), BDSAcceleratorComponent::GetAngle(), BDSAcceleratorComponent::GetArcLength(), BDSAcceleratorComponent::GetChordLength(), GetElementFromGlobalS(), BDSBeamlineElement::GetSPositionStart(), BDS::IsFinite(), and totalArcLength.

Referenced by BDSBunch::ApplyCurvilinearTransform(), and BDSDetectorConstruction::CreatePlacementTransform().

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

◆ GetIndicesOfCollimators()

std::vector< G4int > BDSBeamline::GetIndicesOfCollimators ( ) const

Return indices in order of ecol, rcol, jcol and crystalcol elements.

Definition at line 954 of file BDSBeamline.cc.

References GetIndicesOfElementsOfType().

Referenced by BDSOutputStructures::PrepareCollimatorInformation(), and BDSSDCollimator::ProcessHitsOrdered().

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

◆ GetIndicesOfElementsOfType() [1/2]

std::vector< G4int > BDSBeamline::GetIndicesOfElementsOfType ( const G4String &  type) const

Return vector of indices for this beam line where element of type name 'type' is found.

Definition at line 931 of file BDSBeamline.cc.

References beamline, BDSBeamlineElement::GetIndex(), and BDSBeamlineElement::GetType().

Referenced by GetIndicesOfCollimators().

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

◆ GetIndicesOfElementsOfType() [2/2]

std::vector< G4int > BDSBeamline::GetIndicesOfElementsOfType ( const std::set< G4String > &  types) const

Apply above function to get a set of types. These are in order as they appear in the beam line.

Definition at line 942 of file BDSBeamline.cc.

References beamline, BDSBeamlineElement::GetIndex(), and BDSBeamlineElement::GetType().

Here is the call graph for this function:

◆ GetLastItem()

const BDSBeamlineElement * BDSBeamline::GetLastItem ( ) const
inline

Return a reference to the last element.

Definition at line 126 of file BDSBeamline.hh.

References back().

Referenced by BDS::BuildEndPieceBeamline(), BDSOutput::CalculateHistogramParameters(), and BDSCurvilinearBuilder::CreateBonusSectionEnd().

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

◆ GetMaximumExtentAbsolute()

G4ThreeVector BDSBeamline::GetMaximumExtentAbsolute ( ) const

Get the maximum extent absolute in each dimension.

Definition at line 590 of file BDSBeamline.cc.

References maximumExtentNegative, and maximumExtentPositive.

Referenced by BDSBeamlineSet::GetMaximumExtentAbsolute().

Here is the caller graph for this function:

◆ GetMaximumExtentNegative()

G4ThreeVector BDSBeamline::GetMaximumExtentNegative ( ) const
inline

Get the maximum negative extent in all dimensions.

Definition at line 154 of file BDSBeamline.hh.

References maximumExtentNegative.

◆ GetMaximumExtentPositive()

G4ThreeVector BDSBeamline::GetMaximumExtentPositive ( ) const
inline

Get the maximum positive extent in all dimensions

Definition at line 151 of file BDSBeamline.hh.

References maximumExtentPositive.

◆ GetNext() [1/2]

const BDSBeamlineElement * BDSBeamline::GetNext ( const BDSBeamlineElement element) const

Definition at line 706 of file BDSBeamline.cc.

◆ GetNext() [2/2]

const BDSBeamlineElement * BDSBeamline::GetNext ( G4int  index) const

Definition at line 718 of file BDSBeamline.cc.

◆ GetPrevious() [1/2]

const BDSBeamlineElement * BDSBeamline::GetPrevious ( const BDSBeamlineElement element) const

Return a pointer to the previous element. First this beamline is searched for the vector. If there is no such element or no previous element because it's the beginning, then a nullptr is returned. The caller should test on this.

Definition at line 686 of file BDSBeamline.cc.

References beamline, and GetPrevious().

Referenced by AddSingleComponent(), BDS::BuildEndPieceBeamline(), and GetPrevious().

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

◆ GetPrevious() [2/2]

const BDSBeamlineElement * BDSBeamline::GetPrevious ( G4int  index) const

Definition at line 698 of file BDSBeamline.cc.

◆ GetTotalAngle()

G4double BDSBeamline::GetTotalAngle ( ) const
inline

Get the total angle of the beamline.

Definition at line 142 of file BDSBeamline.hh.

References totalAngle.

◆ GetTotalArcLength()

G4double BDSBeamline::GetTotalArcLength ( ) const
inline

Get the total ARC length for the beamline - ie the maximum s position.

Definition at line 139 of file BDSBeamline.hh.

References totalArcLength.

Referenced by BDSDetectorConstruction::BuildBeamline(), BDSRunAction::CheckTrajectoryOptions(), and BDSSurvey::Write().

Here is the caller graph for this function:

◆ GetTotalChordLength()

G4double BDSBeamline::GetTotalChordLength ( ) const
inline

Get the total length of the beamline - the sum of the chord length of each element.

Definition at line 136 of file BDSBeamline.hh.

References totalChordLength.

Referenced by BDSSurvey::Write().

Here is the caller graph for this function:

◆ GetTransformForElement()

G4Transform3D BDSBeamline::GetTransformForElement ( const G4String &  acceleratorComponentName,
G4int  i = 0 
) const

Get the transform to the centre of the ith placement of element by name. Uses GetElement(). Exits if no such element found.

Definition at line 774 of file BDSBeamline.cc.

References GetElement(), BDSBeamlineElement::GetPositionMiddle(), and BDSBeamlineElement::GetRotationMiddle().

Here is the call graph for this function:

◆ IndexOK()

G4bool BDSBeamline::IndexOK ( G4int  index) const

Whether the supplied index will lie within the beam line vector.

Definition at line 898 of file BDSBeamline.cc.

References beamline.

Referenced by ProvideEndPieceElementAfter().

Here is the caller graph for this function:

◆ PaddingLength()

static G4double BDSBeamline::PaddingLength ( )
inlinestatic

Access the padding length between each element added to the beamline.

Definition at line 233 of file BDSBeamline.hh.

References paddingLength.

Referenced by BDSBeamlineElement::BDSBeamlineElement(), and BDS::CalculateTeleporterDelta().

Here is the caller graph for this function:

◆ PrintAllComponents()

void BDSBeamline::PrintAllComponents ( std::ostream &  out) const

Iterate over the beamline and print out the name, position, rotation and s position of each beamline element

Definition at line 100 of file BDSBeamline.cc.

◆ PrintMemoryConsumption()

void BDSBeamline::PrintMemoryConsumption ( ) const

Feedback about memory consumption for this beamline instance - container size, size of all BDSBeamlineElement() and size of all BDSAcceleratorComponent() stored.

Definition at line 106 of file BDSBeamline.cc.

References beamline.

◆ ProvideEndPieceElementAfter()

BDSBeamlineElement * BDSBeamline::ProvideEndPieceElementAfter ( BDSSimpleComponent endPiece,
G4int  index,
G4bool  flip = false 
) const

Calculate the placements for an end piece w.r.t. a particlar beam line element The optional flip flag is used for when the 'before' piece is used again and must be rotated.

Definition at line 853 of file BDSBeamline.cc.

References beamline, BDSAcceleratorComponent::GetChordLength(), BDSBeamlineElement::GetPositionEnd(), BDSBeamlineElement::GetRotationMiddle(), BDSBeamlineElement::GetSPositionEnd(), BDSBeamlineElement::GetTiltOffset(), IndexOK(), and paddingLength.

Referenced by BDS::BuildEndPieceBeamline().

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

◆ ProvideEndPieceElementBefore()

BDSBeamlineElement * BDSBeamline::ProvideEndPieceElementBefore ( BDSSimpleComponent endPiece,
G4int  index 
) const

Definition at line 815 of file BDSBeamline.cc.

◆ rbegin() [1/2]

reverse_iterator BDSBeamline::rbegin ( )
inline

Iterator mechanics.

Definition at line 171 of file BDSBeamline.hh.

References beamline.

Referenced by BDSDetectorConstruction::BuildBeamline().

Here is the caller graph for this function:

◆ rbegin() [2/2]

const_reverse_iterator BDSBeamline::rbegin ( ) const
inline

Iterator mechanics.

Definition at line 173 of file BDSBeamline.hh.

References beamline.

◆ RegisterElement()

void BDSBeamline::RegisterElement ( BDSBeamlineElement element)
private

Register the fully created element to a map of names vs element pointers. Used to look up transforms by name.

Definition at line 726 of file BDSBeamline.cc.

References components, BDSBeamlineElement::GetName(), and BDSBeamlineElement::GetPlacementName().

Referenced by AddBeamlineElement(), and AddSingleComponent().

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

◆ rend() [1/2]

reverse_iterator BDSBeamline::rend ( )
inline

Iterator mechanics.

Definition at line 172 of file BDSBeamline.hh.

References beamline.

Referenced by BDSDetectorConstruction::BuildBeamline().

Here is the caller graph for this function:

◆ rend() [2/2]

const_reverse_iterator BDSBeamline::rend ( ) const
inline

Iterator mechanics.

Definition at line 174 of file BDSBeamline.hh.

References beamline.

◆ size()

BeamlineVector::size_type BDSBeamline::size ( ) const
inline

Get the number of elements.

Definition at line 148 of file BDSBeamline.hh.

References beamline.

Referenced by BDSOutputROOTEventModel::Fill().

Here is the caller graph for this function:

◆ UpdateExtents()

void BDSBeamline::UpdateExtents ( BDSBeamlineElement element)

Once the beamline element has been constructed and all positions and rotations use these to update the world extent of this beam line.

Definition at line 791 of file BDSBeamline.cc.

References BDSExtentGlobal::AllBoundaryPointsGlobal(), BDSBeamlineElement::GetExtentGlobal(), maximumExtentNegative, and maximumExtentPositive.

Referenced by AddBeamlineElement(), and AddSingleComponent().

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

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
BDSBeamline const &  bl 
)
friend

output stream

Definition at line 113 of file BDSBeamline.cc.

Field Documentation

◆ beamline

BeamlineVector BDSBeamline::beamline
private

◆ components

std::map<G4String, BDSBeamlineElement*> BDSBeamline::components
private

Map of objects by placement name stored in this beam line.

Definition at line 283 of file BDSBeamline.hh.

Referenced by GetElement(), and RegisterElement().

◆ maximumExtentNegative

G4ThreeVector BDSBeamline::maximumExtentNegative
private

maximum extent in the negative coordinates in each dimension

Definition at line 264 of file BDSBeamline.hh.

Referenced by BDSBeamline(), GetExtentGlobal(), GetMaximumExtentAbsolute(), GetMaximumExtentNegative(), and UpdateExtents().

◆ maximumExtentPositive

G4ThreeVector BDSBeamline::maximumExtentPositive
private

maximum extent in the positive coordinates in each dimension

Definition at line 263 of file BDSBeamline.hh.

Referenced by BDSBeamline(), GetExtentGlobal(), GetMaximumExtentAbsolute(), GetMaximumExtentPositive(), and UpdateExtents().

◆ paddingLength

G4double BDSBeamline::paddingLength = -1
staticprivate

The gap added for padding between each component.

Definition at line 280 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), BDSBeamline(), PaddingLength(), and ProvideEndPieceElementAfter().

◆ previousReferencePositionEnd

G4ThreeVector BDSBeamline::previousReferencePositionEnd
private

Current reference position at the end of the previous element.

Definition at line 270 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and ApplyTransform3D().

◆ previousReferenceRotationEnd

G4RotationMatrix* BDSBeamline::previousReferenceRotationEnd
private

Current reference rotation at the end of the previous element.

Definition at line 267 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), ApplyTransform3D(), and BDSBeamline().

◆ previousSPositionEnd

G4double BDSBeamline::previousSPositionEnd
private

Current s coordinate at the end of the previous element.

Definition at line 273 of file BDSBeamline.hh.

Referenced by AddSingleComponent().

◆ sEnd

std::vector<G4double> BDSBeamline::sEnd
private

Vector of s coordinates at the end of each element. This is intended so that an iterator pointing to the s position will be the correct index for the beamline element in the main BDSBeamlineVector element. This is filled in order so it's sorted by design.

Definition at line 289 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), FindFromS(), and GetElementFromGlobalS().

◆ totalAngle

G4double BDSBeamline::totalAngle
private

Sum of all angles.

Definition at line 261 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), ElementAnglesSumToCircle(), and GetTotalAngle().

◆ totalArcLength

G4double BDSBeamline::totalArcLength
private

Sum of all arc lengths.

Definition at line 259 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), GetGlobalEuclideanTransform(), and GetTotalArcLength().

◆ totalChordLength

G4double BDSBeamline::totalChordLength
private

Sum of all chord lengths.

Definition at line 257 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and GetTotalChordLength().

◆ transformHasJustBeenApplied

G4bool BDSBeamline::transformHasJustBeenApplied
private

Flag to remember whether a BDSTransform3D which is not a real volume has been applied to make a discrete change in the beam line or not.

Definition at line 277 of file BDSBeamline.hh.

Referenced by AddSingleComponent().


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