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

Holder for +- extents in 3 dimensions with a rotation and translation. More...

#include <BDSExtentGlobal.hh>

Inheritance diagram for BDSExtentGlobal:
Inheritance graph
Collaboration diagram for BDSExtentGlobal:
Collaboration graph

Public Member Functions

 BDSExtentGlobal ()
 Default constructor gives 0 in all extents - typically unphysical. More...
 
 BDSExtentGlobal (const BDSExtent &extentIn, const G4Transform3D &transformIn=G4Transform3D::Identity)
 
virtual ~BDSExtentGlobal ()
 
G4bool Overlaps (const BDSExtentGlobal &other) const
 
G4bool EncompassesGlobal (G4double x, G4double y, G4double z) const
 Return whether the extent encompasses the point. Similar, but with separate x,y,z coordinates. More...
 
G4bool Encompasses (const BDSExtentGlobal &otherExtent)
 Return whether the extent encompasses another extent. More...
 
G4bool Encompasses (const std::vector< BDSExtentGlobal > &otherExtents)
 Return whether the extent encompasses multiple other extents. More...
 
G4ThreeVector GetMaximumExtentAbsolute () const
 Get the maximum extent absolute in each dimension. More...
 
BDSExtentGlobal ExpandToEncompass (const BDSExtentGlobal &other) const
 Return a copy of this extent but expanded to encompass another global extent. More...
 
G4double MaximumAbsGlobal () const
 Return the maximum absolute value considering all dimensions. More...
 
std::pair< G4double, G4double > ExtentXGlobal () const
 Accessor. More...
 
std::pair< G4double, G4double > ExtentYGlobal () const
 Accessor. More...
 
std::pair< G4double, G4double > ExtentZGlobal () const
 Accessor. More...
 
G4double XNegGlobal () const
 Accessor. More...
 
G4double XPosGlobal () const
 Accessor. More...
 
G4double YNegGlobal () const
 Accessor. More...
 
G4double YPosGlobal () const
 Accessor. More...
 
G4double ZNegGlobal () const
 Accessor. More...
 
G4double ZPosGlobal () const
 Accessor. More...
 
G4ThreeVector ExtentPositiveGlobal () const
 Accessor. More...
 
G4ThreeVector ExtentNegativeGlobal () const
 Accessor. More...
 
std::vector< G4ThreeVector > AllBoundaryPointsGlobal () const
 All 8 boundary points of the bounding box. More...
 
G4double DXGlobal () const
 The difference in a dimension. More...
 
G4double DYGlobal () const
 The difference in a dimension. More...
 
G4double DZGlobal () const
 The difference in a dimension. More...
 
G4bool TransverselyLessThanGlobal (const BDSExtentGlobal &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
G4bool TransverselyGreaterThanGlobal (const BDSExtentGlobal &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
G4bool TransverselyLessEqualsGlobal (const BDSExtentGlobal &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
G4bool TransverselyGreaterEqualsGlobal (const BDSExtentGlobal &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
BDSExtentGlobal TranslateGlobal (G4ThreeVector offset) const
 Provide a new copy of this extent with an offset applied. More...
 
BDSExtentGlobal TranslateGlobal (G4double dx, G4double dy, G4double dz) const
 Provide a new copy of this extent with an offset applied. More...
 
- Public Member Functions inherited from BDSExtent
 BDSExtent ()
 Default constructor gives 0 in all extents - typically unphysical. More...
 
 BDSExtent (const std::pair< G4double, G4double > &extXIn, const std::pair< G4double, G4double > &extYIn, const std::pair< G4double, G4double > &extZIn)
 Construct with pairs of extents. More...
 
 BDSExtent (G4double extXNegIn, G4double extXPosIn, G4double extYNegIn, G4double extYPosIn, G4double extZNegIn, G4double extZPosIn)
 Construct with individual extents. More...
 
 BDSExtent (G4double extXIn, G4double extYIn, G4double extZIn)
 Symmetric variant - assumed to be +/- same amount. More...
 
 BDSExtent (G4ThreeVector extInNeg, G4ThreeVector extInPos)
 Threevectors of positive and negative extents. More...
 
 BDSExtent (G4ThreeVector extIn)
 Symmetric from three vector. More...
 
G4bool Encompasses (const G4ThreeVector &point) const
 Return whether the extent encompasses the point. True if point lies inside the extent. More...
 
G4bool Encompasses (const BDSExtent &other) const
 
G4bool Encompasses (G4double x, G4double y, G4double z) const
 Return whether the extent encompasses the point. Similar, but with separate x,y,z coordinates. More...
 
G4bool Encompasses (const BDSParticleCoords &coords) const
 
BDSExtent Tilted (G4double angle) const
 Provide a new copy of this extent but rotated along Z by a given tilt angle. More...
 
BDSExtent TiltOffset (const BDSTiltOffset *tiltOffset) const
 Provide a new copy of this extent with both a tilt and an offset applied. More...
 
G4double MaximumAbs () const
 Return the maximum absolute value considering all dimensions. More...
 
G4double MinimumAbs () const
 Return the minimum absolute value considering all dimensions. More...
 
G4double MaximumX () const
 
G4double MaximumY () const
 
G4double MaximumZ () const
 
G4double MaximumAbsTransverse () const
 Return the maximum absolute value considering only x,y. More...
 
G4double MinimumAbsTransverse () const
 Return the minimum absolute value considering only x,y. More...
 
G4double TransverseBoundingRadius () const
 Return a radius that would encompass the maximum x,y extent. More...
 
BDSExtent ExpandBy (G4double margin) const
 Return a copy expanded in all dimensions by the given margin. More...
 
BDSExtent ExpandTransverselyBy (G4double margin) const
 Return a copy expanded in x and y by the given margin. More...
 
void ExpandToEncompass (const BDSExtent &other)
 
std::pair< G4double, G4double > ExtentX () const
 Accessor. More...
 
std::pair< G4double, G4double > ExtentY () const
 Accessor. More...
 
std::pair< G4double, G4double > ExtentZ () const
 Accessor. More...
 
G4double XNeg () const
 Accessor. More...
 
G4double XPos () const
 Accessor. More...
 
G4double YNeg () const
 Accessor. More...
 
G4double YPos () const
 Accessor. More...
 
G4double ZNeg () const
 Accessor. More...
 
G4double ZPos () const
 Accessor. More...
 
G4ThreeVector ExtentPositive () const
 Accessor. More...
 
G4ThreeVector ExtentNegative () const
 Accessor. More...
 
std::vector< G4ThreeVector > AllBoundaryPoints () const
 All 8 boundary points of the bounding box. More...
 
G4double DX () const
 The difference in a dimension. More...
 
G4double DY () const
 The difference in a dimension. More...
 
G4double DZ () const
 The difference in a dimension. More...
 
G4bool operator< (const BDSExtent &r) const
 Comparison operator. More...
 
G4bool operator> (const BDSExtent &r) const
 Comparison operator. More...
 
G4bool operator<= (const BDSExtent &r) const
 Comparison operator. More...
 
G4bool operator>= (const BDSExtent &r) const
 Comparison operator. More...
 
G4bool operator== (const BDSExtent &r) const
 Equality operator. More...
 
G4bool operator!= (const BDSExtent &r) const
 Equality operator. More...
 
G4bool TransverselyLessThan (const BDSExtent &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
G4bool TransverselyGreaterThan (const BDSExtent &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
G4bool TransverselyLessEquals (const BDSExtent &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
G4bool TransverselyGreaterEquals (const BDSExtent &r) const
 Comparison operator for x,y only. Ignores z (length). More...
 
BDSExtent Translate (const G4ThreeVector &offset) const
 Provide a new copy of this extent with an offset applied. More...
 
BDSExtent Translate (G4double dx, G4double dy, G4double dz) const
 Provide a new copy of this extent with an offset applied. More...
 

Private Attributes

G4Transform3D transform
 
G4double extXNegG
 Extent. More...
 
G4double extXPosG
 Extent. More...
 
G4double extYNegG
 Extent. More...
 
G4double extYPosG
 Extent. More...
 
G4double extZNegG
 Extent. More...
 
G4double extZPosG
 Extent. More...
 

Friends

std::ostream & operator<< (std::ostream &out, BDSExtentGlobal const &ext)
 Output stream. More...
 

Detailed Description

Holder for +- extents in 3 dimensions with a rotation and translation.

Holds both a local extent as a 3D cuboid in local xyz as well as a rotation and translation to give an extent in a different frame.

Author
Laurie Nevay

Definition at line 43 of file BDSExtentGlobal.hh.

Constructor & Destructor Documentation

◆ BDSExtentGlobal() [1/2]

BDSExtentGlobal::BDSExtentGlobal ( )

Default constructor gives 0 in all extents - typically unphysical.

Definition at line 36 of file BDSExtentGlobal.cc.

Referenced by ExpandToEncompass(), and TranslateGlobal().

Here is the caller graph for this function:

◆ BDSExtentGlobal() [2/2]

BDSExtentGlobal::BDSExtentGlobal ( const BDSExtent extentIn,
const G4Transform3D &  transformIn = G4Transform3D::Identity 
)
explicit

Constructor with extent in only local frame + transform. We use only the G4Transform3D to avoid ambiguity about active or passive transforms.

Definition at line 46 of file BDSExtentGlobal.cc.

References BDSExtent::AllBoundaryPoints(), extXNegG, extXPosG, extYNegG, extYPosG, extZNegG, and extZPosG.

Here is the call graph for this function:

◆ ~BDSExtentGlobal()

BDSExtentGlobal::~BDSExtentGlobal ( )
virtual

Constructor with extents already in global frame. The transform here is the transform that the points were created with respect to. It is not applied to the points.

Definition at line 86 of file BDSExtentGlobal.cc.

Member Function Documentation

◆ AllBoundaryPointsGlobal()

std::vector< G4ThreeVector > BDSExtentGlobal::AllBoundaryPointsGlobal ( ) const

All 8 boundary points of the bounding box.

Definition at line 89 of file BDSExtentGlobal.cc.

References extXNegG, extXPosG, extYNegG, extYPosG, extZNegG, and extZPosG.

Referenced by EncompassesGlobal(), and BDSBeamline::UpdateExtents().

Here is the caller graph for this function:

◆ DXGlobal()

G4double BDSExtentGlobal::DXGlobal ( ) const
inline

The difference in a dimension.

Definition at line 90 of file BDSExtentGlobal.hh.

References extXNegG, and extXPosG.

◆ DYGlobal()

G4double BDSExtentGlobal::DYGlobal ( ) const
inline

The difference in a dimension.

Definition at line 91 of file BDSExtentGlobal.hh.

References extYNegG, and extYPosG.

◆ DZGlobal()

G4double BDSExtentGlobal::DZGlobal ( ) const
inline

The difference in a dimension.

Definition at line 92 of file BDSExtentGlobal.hh.

References extZNegG, and extZPosG.

◆ Encompasses() [1/2]

G4bool BDSExtentGlobal::Encompasses ( const BDSExtentGlobal otherExtent)

Return whether the extent encompasses another extent.

Definition at line 186 of file BDSExtentGlobal.cc.

References ExtentXGlobal(), ExtentYGlobal(), ExtentZGlobal(), extXNegG, extXPosG, extYNegG, extYPosG, extZNegG, and extZPosG.

Referenced by BDSDetectorConstruction::BuildWorld(), and Encompasses().

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

◆ Encompasses() [2/2]

G4bool BDSExtentGlobal::Encompasses ( const std::vector< BDSExtentGlobal > &  otherExtents)

Return whether the extent encompasses multiple other extents.

Definition at line 197 of file BDSExtentGlobal.cc.

References Encompasses().

Here is the call graph for this function:

◆ EncompassesGlobal()

G4bool BDSExtentGlobal::EncompassesGlobal ( G4double  x,
G4double  y,
G4double  z 
) const

Return whether the extent encompasses the point. Similar, but with separate x,y,z coordinates.

Definition at line 154 of file BDSExtentGlobal.cc.

References AllBoundaryPointsGlobal().

Here is the call graph for this function:

◆ ExpandToEncompass()

BDSExtentGlobal BDSExtentGlobal::ExpandToEncompass ( const BDSExtentGlobal other) const

Return a copy of this extent but expanded to encompass another global extent.

Definition at line 121 of file BDSExtentGlobal.cc.

References BDSExtentGlobal(), extXNegG, extXPosG, extYNegG, extYPosG, extZNegG, and extZPosG.

Referenced by BDSDetectorConstruction::CalculateExtentOfSamplerPlacements(), BDSDetectorConstruction::CalculateExtentOfScorerMeshes(), and BDSLinkDetectorConstruction::UpdateWorldSolid().

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

◆ ExtentNegativeGlobal()

G4ThreeVector BDSExtentGlobal::ExtentNegativeGlobal ( ) const
inline

Accessor.

Definition at line 80 of file BDSExtentGlobal.hh.

References extXNegG, extYNegG, and extZNegG.

Referenced by GetMaximumExtentAbsolute().

Here is the caller graph for this function:

◆ ExtentPositiveGlobal()

G4ThreeVector BDSExtentGlobal::ExtentPositiveGlobal ( ) const
inline

Accessor.

Definition at line 77 of file BDSExtentGlobal.hh.

References extXPosG, extYPosG, and extZPosG.

Referenced by GetMaximumExtentAbsolute().

Here is the caller graph for this function:

◆ ExtentXGlobal()

std::pair< G4double, G4double > BDSExtentGlobal::ExtentXGlobal ( ) const
inline

Accessor.

Definition at line 66 of file BDSExtentGlobal.hh.

References extXNegG, and extXPosG.

Referenced by Encompasses().

Here is the caller graph for this function:

◆ ExtentYGlobal()

std::pair< G4double, G4double > BDSExtentGlobal::ExtentYGlobal ( ) const
inline

Accessor.

Definition at line 67 of file BDSExtentGlobal.hh.

References extYNegG, and extYPosG.

Referenced by Encompasses().

Here is the caller graph for this function:

◆ ExtentZGlobal()

std::pair< G4double, G4double > BDSExtentGlobal::ExtentZGlobal ( ) const
inline

Accessor.

Definition at line 68 of file BDSExtentGlobal.hh.

References extZNegG, and extZPosG.

Referenced by Encompasses().

Here is the caller graph for this function:

◆ GetMaximumExtentAbsolute()

G4ThreeVector BDSExtentGlobal::GetMaximumExtentAbsolute ( ) const

Get the maximum extent absolute in each dimension.

Definition at line 210 of file BDSExtentGlobal.cc.

References ExtentNegativeGlobal(), and ExtentPositiveGlobal().

Referenced by BDSLinkDetectorConstruction::UpdateWorldSolid().

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

◆ MaximumAbsGlobal()

G4double BDSExtentGlobal::MaximumAbsGlobal ( ) const

Return the maximum absolute value considering all dimensions.

Definition at line 146 of file BDSExtentGlobal.cc.

References extXNegG, extXPosG, extYNegG, extYPosG, extZNegG, and extZPosG.

◆ Overlaps()

G4bool BDSExtentGlobal::Overlaps ( const BDSExtentGlobal other) const

Definition at line 103 of file BDSExtentGlobal.cc.

◆ TranslateGlobal() [1/2]

BDSExtentGlobal BDSExtentGlobal::TranslateGlobal ( G4double  dx,
G4double  dy,
G4double  dz 
) const

Provide a new copy of this extent with an offset applied.

Definition at line 108 of file BDSExtentGlobal.cc.

References BDSExtentGlobal(), extXNegG, extXPosG, extYNegG, extYPosG, extZNegG, and extZPosG.

Here is the call graph for this function:

◆ TranslateGlobal() [2/2]

BDSExtentGlobal BDSExtentGlobal::TranslateGlobal ( G4ThreeVector  offset) const
inline

Provide a new copy of this extent with an offset applied.

Definition at line 117 of file BDSExtentGlobal.hh.

References TranslateGlobal().

Referenced by TranslateGlobal().

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

◆ TransverselyGreaterEqualsGlobal()

G4bool BDSExtentGlobal::TransverselyGreaterEqualsGlobal ( const BDSExtentGlobal r) const
inline

Comparison operator for x,y only. Ignores z (length).

Definition at line 99 of file BDSExtentGlobal.hh.

References TransverselyLessThanGlobal().

Here is the call graph for this function:

◆ TransverselyGreaterThanGlobal()

G4bool BDSExtentGlobal::TransverselyGreaterThanGlobal ( const BDSExtentGlobal r) const
inline

Comparison operator for x,y only. Ignores z (length).

Definition at line 97 of file BDSExtentGlobal.hh.

References TransverselyLessThanGlobal().

Referenced by TransverselyLessEqualsGlobal().

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

◆ TransverselyLessEqualsGlobal()

G4bool BDSExtentGlobal::TransverselyLessEqualsGlobal ( const BDSExtentGlobal r) const
inline

Comparison operator for x,y only. Ignores z (length).

Definition at line 98 of file BDSExtentGlobal.hh.

References TransverselyGreaterThanGlobal().

Here is the call graph for this function:

◆ TransverselyLessThanGlobal()

G4bool BDSExtentGlobal::TransverselyLessThanGlobal ( const BDSExtentGlobal r) const
inline

Comparison operator for x,y only. Ignores z (length).

Definition at line 144 of file BDSExtentGlobal.hh.

References extXNegG, extXPosG, extYNegG, and extYPosG.

Referenced by TransverselyGreaterEqualsGlobal(), and TransverselyGreaterThanGlobal().

Here is the caller graph for this function:

◆ XNegGlobal()

G4double BDSExtentGlobal::XNegGlobal ( ) const
inline

Accessor.

Definition at line 70 of file BDSExtentGlobal.hh.

References extXNegG.

◆ XPosGlobal()

G4double BDSExtentGlobal::XPosGlobal ( ) const
inline

Accessor.

Definition at line 71 of file BDSExtentGlobal.hh.

References extXPosG.

◆ YNegGlobal()

G4double BDSExtentGlobal::YNegGlobal ( ) const
inline

Accessor.

Definition at line 72 of file BDSExtentGlobal.hh.

References extYNegG.

◆ YPosGlobal()

G4double BDSExtentGlobal::YPosGlobal ( ) const
inline

Accessor.

Definition at line 73 of file BDSExtentGlobal.hh.

References extYPosG.

◆ ZNegGlobal()

G4double BDSExtentGlobal::ZNegGlobal ( ) const
inline

Accessor.

Definition at line 74 of file BDSExtentGlobal.hh.

References extZNegG.

◆ ZPosGlobal()

G4double BDSExtentGlobal::ZPosGlobal ( ) const
inline

Accessor.

Definition at line 75 of file BDSExtentGlobal.hh.

References extZPosG.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
BDSExtentGlobal const &  ext 
)
friend

Output stream.

Definition at line 133 of file BDSExtentGlobal.cc.

Field Documentation

◆ extXNegG

G4double BDSExtentGlobal::extXNegG
private

◆ extXPosG

G4double BDSExtentGlobal::extXPosG
private

◆ extYNegG

G4double BDSExtentGlobal::extYNegG
private

◆ extYPosG

G4double BDSExtentGlobal::extYPosG
private

◆ extZNegG

G4double BDSExtentGlobal::extZNegG
private

◆ extZPosG

G4double BDSExtentGlobal::extZPosG
private

◆ transform

G4Transform3D BDSExtentGlobal::transform
private

Definition at line 132 of file BDSExtentGlobal.hh.


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