BDSBeamline Class Reference

Collaboration diagram for BDSBeamline:

Collaboration graph
[legend]

Public Member Functions

 BDSBeamline ()
 BDSBeamline (G4ThreeVector initialGlobalPosition, G4RotationMatrix *initialGlobalRotation)
 ~BDSBeamline ()
void AddSingleComponent (BDSAcceleratorComponent *component)
void AddComponent (BDSAcceleratorComponent *component)
void ApplyTransform3D (BDSTransform3D *component)
void PrintAllComponents (std::ostream &out) const
BDSBeamlineElementGetFirstItem ()
 Return a reference to the first element.
BDSBeamlineElementGetLastItem ()
 Return a reference to the last element.
G4double GetTotalChordLength () const
 Get the total length of the beamline - the sum of the chord length of each element.
G4double GetTotalArcLength () const
 Get the total ARC length fo the beamline - ie the maximum s position.
std::vector< BDSBeamlineElement
* >::size_type 
size () const
 Get the number of elements.
G4ThreeVector GetMaximumExtentPositive () const
 Get the maximum positive extent in all dimensions.
G4ThreeVector GetMaximumExtentNegative () const
 Get the maximum negative extent in all dimensions.
G4ThreeVector GetMaximumExtentAbsolute () const
 Get the maximum extent absolute in each dimension.
BDSBeamlineElementfront () const
 Return a reference to the first element.
BDSBeamlineElementback () const
 Return a reference to the last element.
std::vector< BDSBeamlineElement
* >::iterator 
begin ()
 Return iterator to the beginning.
std::vector< BDSBeamlineElement
* >::iterator 
end ()
 Return iterator to the end.
std::vector< BDSBeamlineElement
* >::reverse_iterator 
rbegin ()
 Return reverse iterator to the reverse beginning.
std::vector< BDSBeamlineElement
* >::reverse_iterator 
rend ()
 Return reverse iterator to the reverse end.
std::vector< BDSBeamlineElement
* >::const_iterator 
begin () const
 Return iterator to the beginning.
std::vector< BDSBeamlineElement
* >::const_iterator 
end () const
 Return iterator to the end.
std::vector< BDSBeamlineElement
* >::const_reverse_iterator 
rbegin () const
 Return reverse iterator to the reverse beginning.
std::vector< BDSBeamlineElement
* >::const_reverse_iterator 
rend () const
 Return reverse iterator to the reverse end.
G4bool empty () const
 Return whether the beamline is empty or not.

Private Member Functions

BDSBeamlineoperator= (const BDSBeamline &)
 assignment and copy constructor not implemented nor used
 BDSBeamline (BDSBeamline &)

Private Attributes

std::vector< BDSBeamlineElement * > beamline
 Beamline vector - the data.
G4double totalChordLength
G4double totalArcLength
G4ThreeVector maximumExtentPositive
 maximum extent in the positive coordinates in each dimension
G4ThreeVector maximumExtentNegative
 maximum extent in the negative coordinates in each dimension
G4RotationMatrix * previousReferenceRotationEnd
 Current reference rotation at the end of the previous element.
G4ThreeVector previousReferencePositionEnd
 Current reference position at the end of the previous element.
G4double previousSPositionEnd
 Current s coordinate at the end of the previous element.
G4ThreeVector xARS
G4ThreeVector yARS
G4ThreeVector zARS
G4ThreeVector xARM
G4ThreeVector yARM
G4ThreeVector zARM
G4ThreeVector xARE
G4ThreeVector yARE
G4ThreeVector zARE

Friends

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

Detailed Description

Definition at line 42 of file BDSBeamline.hh.


Constructor & Destructor Documentation

BDSBeamline::BDSBeamline (  ) 

Default constructor. Beamline started at 0,0,0 with beamline built along the z axis.

Definition at line 20 of file BDSBeamline.cc.

References maximumExtentNegative, maximumExtentPositive, previousReferencePositionEnd, previousReferenceRotationEnd, previousSPositionEnd, totalArcLength, totalChordLength, xARE, xARM, xARS, yARE, yARM, yARS, zARE, zARM, and zARS.

BDSBeamline::BDSBeamline ( G4ThreeVector  initialGlobalPosition,
G4RotationMatrix *  initialGlobalRotation 
)

Auxiliary constructor that allows a finite poition and rotation to be applied at the beginning of the beamline in global coordinates. Rembmer the maximum extents of the beamline will also be displaced.

Definition at line 46 of file BDSBeamline.cc.

References maximumExtentNegative, maximumExtentPositive, previousReferencePositionEnd, previousReferenceRotationEnd, previousSPositionEnd, totalArcLength, totalChordLength, xARE, xARM, xARS, yARE, yARM, yARS, zARE, zARM, and zARS.


Member Function Documentation

void BDSBeamline::AddComponent ( BDSAcceleratorComponent component  ) 

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

Definition at line 105 of file BDSBeamline.cc.

References AddSingleComponent().

Referenced by BDSDetectorConstruction::BuildBeamline().

Here is the call graph for this function:

Here is the caller graph for this function:

void BDSBeamline::AddSingleComponent ( BDSAcceleratorComponent component  ) 

Add a single component and calculate its position and rotation with respect to the beginning of the beamline

Definition at line 116 of file BDSBeamline.cc.

References ApplyTransform3D(), beamline, BDSTiltOffset::dx, BDSTiltOffset::dy, empty(), BDSAcceleratorComponent::GetName(), BDSTiltOffset::GetTilt(), BDSBeamlineElement::GetXAxisReferenceEnd(), BDSBeamlineElement::GetXAxisReferenceMiddle(), BDSBeamlineElement::GetXAxisReferenceStart(), BDSTiltOffset::GetXOffset(), BDSBeamlineElement::GetYAxisReferenceEnd(), BDSBeamlineElement::GetYAxisReferenceMiddle(), BDSBeamlineElement::GetYAxisReferenceStart(), BDSTiltOffset::GetYOffset(), BDSBeamlineElement::GetZAxisReferenceEnd(), BDSBeamlineElement::GetZAxisReferenceMiddle(), BDSBeamlineElement::GetZAxisReferenceStart(), BDSGlobalConstants::Instance(), BDS::IsFinite(), maximumExtentNegative, maximumExtentPositive, previousReferencePositionEnd, previousReferenceRotationEnd, previousSPositionEnd, BDSGlobalConstants::SetSMax(), BDSTiltOffset::tilt, totalArcLength, totalChordLength, xARE, xARM, xARS, yARE, yARM, yARS, zARE, zARM, and zARS.

Referenced by AddComponent().

Here is the call graph for this function:

Here is the caller graph for this function:

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 370 of file BDSBeamline.cc.

References back(), BDSTiltOffset::dx, BDSTiltOffset::dy, empty(), BDSTransform3D::GetDPhi(), BDSTransform3D::GetDPsi(), BDSTransform3D::GetDTheta(), BDSTransform3D::GetDX(), BDSTransform3D::GetDY(), BDSTransform3D::GetDZ(), BDSAcceleratorComponent::GetName(), BDSBeamlineElement::GetReferencePositionEnd(), BDSBeamlineElement::GetReferenceRotationEnd(), BDSBeamlineElement::GetXAxisReferenceEnd(), BDSBeamlineElement::GetYAxisReferenceEnd(), BDSBeamlineElement::GetZAxisReferenceEnd(), previousReferencePositionEnd, previousReferenceRotationEnd, xARE, yARE, and zARE.

Referenced by AddSingleComponent().

Here is the call graph for this function:

Here is the caller graph for this function:

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 86 of file BDSBeamline.cc.

References begin(), and end().

Here is the call graph for this function:


Field Documentation

G4ThreeVector BDSBeamline::xARE [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

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

G4ThreeVector BDSBeamline::xARM [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and BDSBeamline().

G4ThreeVector BDSBeamline::xARS [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and BDSBeamline().

G4ThreeVector BDSBeamline::yARE [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

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

G4ThreeVector BDSBeamline::yARM [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and BDSBeamline().

G4ThreeVector BDSBeamline::yARS [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and BDSBeamline().

G4ThreeVector BDSBeamline::zARE [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

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

G4ThreeVector BDSBeamline::zARM [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and BDSBeamline().

G4ThreeVector BDSBeamline::zARS [private]

Current rotation axes xARS = xAxisReferenceStart, M = Middle, E = End

Definition at line 135 of file BDSBeamline.hh.

Referenced by AddSingleComponent(), and BDSBeamline().


The documentation for this class was generated from the following files:
Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7