BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Holder for +- extents in 3 dimensions with a rotation and translation. More...
#include <BDSExtentGlobal.hh>
Public Member Functions | |
BDSExtentGlobal () | |
Default constructor gives 0 in all extents - typically unphysical. | |
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. | |
G4bool | Encompasses (const BDSExtentGlobal &otherExtent) |
Return whether the extent encompasses another extent. | |
G4bool | Encompasses (const std::vector< BDSExtentGlobal > &otherExtents) |
Return whether the extent encompasses multiple other extents. | |
G4ThreeVector | GetMaximumExtentAbsolute () const |
Get the maximum extent absolute in each dimension. | |
BDSExtentGlobal | ExpandToEncompass (const BDSExtentGlobal &other) const |
Return a copy of this extent but expanded to encompass another global extent. | |
G4double | MaximumAbsGlobal () const |
Return the maximum absolute value considering all dimensions. | |
std::pair< G4double, G4double > | ExtentXGlobal () const |
Accessor. | |
std::pair< G4double, G4double > | ExtentYGlobal () const |
Accessor. | |
std::pair< G4double, G4double > | ExtentZGlobal () const |
Accessor. | |
G4double | XNegGlobal () const |
Accessor. | |
G4double | XPosGlobal () const |
Accessor. | |
G4double | YNegGlobal () const |
Accessor. | |
G4double | YPosGlobal () const |
Accessor. | |
G4double | ZNegGlobal () const |
Accessor. | |
G4double | ZPosGlobal () const |
Accessor. | |
G4ThreeVector | ExtentPositiveGlobal () const |
Accessor. | |
G4ThreeVector | ExtentNegativeGlobal () const |
Accessor. | |
std::vector< G4ThreeVector > | AllBoundaryPointsGlobal () const |
All 8 boundary points of the bounding box. | |
G4double | DXGlobal () const |
The difference in a dimension. | |
G4double | DYGlobal () const |
The difference in a dimension. | |
G4double | DZGlobal () const |
The difference in a dimension. | |
G4bool | TransverselyLessThanGlobal (const BDSExtentGlobal &r) const |
Comparison operator for x,y only. Ignores z (length). | |
G4bool | TransverselyGreaterThanGlobal (const BDSExtentGlobal &r) const |
Comparison operator for x,y only. Ignores z (length). | |
G4bool | TransverselyLessEqualsGlobal (const BDSExtentGlobal &r) const |
Comparison operator for x,y only. Ignores z (length). | |
G4bool | TransverselyGreaterEqualsGlobal (const BDSExtentGlobal &r) const |
Comparison operator for x,y only. Ignores z (length). | |
BDSExtentGlobal | TranslateGlobal (G4ThreeVector offset) const |
Provide a new copy of this extent with an offset applied. | |
BDSExtentGlobal | TranslateGlobal (G4double dx, G4double dy, G4double dz) const |
Provide a new copy of this extent with an offset applied. | |
![]() | |
BDSExtent () | |
Default constructor gives 0 in all extents - typically unphysical. | |
BDSExtent (const std::pair< G4double, G4double > &extXIn, const std::pair< G4double, G4double > &extYIn, const std::pair< G4double, G4double > &extZIn) | |
Construct with pairs of extents. | |
BDSExtent (G4double extXNegIn, G4double extXPosIn, G4double extYNegIn, G4double extYPosIn, G4double extZNegIn, G4double extZPosIn) | |
Construct with individual extents. | |
BDSExtent (G4double extXIn, G4double extYIn, G4double extZIn) | |
Symmetric variant - assumed to be +/- same amount. | |
BDSExtent (G4ThreeVector extInNeg, G4ThreeVector extInPos) | |
Threevectors of positive and negative extents. | |
BDSExtent (G4ThreeVector extIn) | |
Symmetric from three vector. | |
G4bool | Encompasses (const G4ThreeVector &point) const |
Return whether the extent encompasses the point. True if point lies inside the extent. | |
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. | |
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. | |
BDSExtent | TiltOffset (const BDSTiltOffset *tiltOffset) const |
Provide a new copy of this extent with both a tilt and an offset applied. | |
G4double | MaximumAbs () const |
Return the maximum absolute value considering all dimensions. | |
G4double | MinimumAbs () const |
Return the minimum absolute value considering all dimensions. | |
G4double | MaximumX () const |
G4double | MaximumY () const |
G4double | MaximumZ () const |
G4double | MaximumAbsTransverse () const |
Return the maximum absolute value considering only x,y. | |
G4double | MinimumAbsTransverse () const |
Return the minimum absolute value considering only x,y. | |
G4double | TransverseBoundingRadius () const |
Return a radius that would encompass the maximum x,y extent. | |
BDSExtent | ExpandBy (G4double margin) const |
Return a copy expanded in all dimensions by the given margin. | |
BDSExtent | ExpandTransverselyBy (G4double margin) const |
Return a copy expanded in x and y by the given margin. | |
void | ExpandToEncompass (const BDSExtent &other) |
std::pair< G4double, G4double > | ExtentX () const |
Accessor. | |
std::pair< G4double, G4double > | ExtentY () const |
Accessor. | |
std::pair< G4double, G4double > | ExtentZ () const |
Accessor. | |
G4double | XNeg () const |
Accessor. | |
G4double | XPos () const |
Accessor. | |
G4double | YNeg () const |
Accessor. | |
G4double | YPos () const |
Accessor. | |
G4double | ZNeg () const |
Accessor. | |
G4double | ZPos () const |
Accessor. | |
G4ThreeVector | ExtentPositive () const |
Accessor. | |
G4ThreeVector | ExtentNegative () const |
Accessor. | |
std::vector< G4ThreeVector > | AllBoundaryPoints () const |
All 8 boundary points of the bounding box. | |
G4double | DX () const |
The difference in a dimension. | |
G4double | DY () const |
The difference in a dimension. | |
G4double | DZ () const |
The difference in a dimension. | |
G4bool | operator< (const BDSExtent &r) const |
Comparison operator. | |
G4bool | operator> (const BDSExtent &r) const |
Comparison operator. | |
G4bool | operator<= (const BDSExtent &r) const |
Comparison operator. | |
G4bool | operator>= (const BDSExtent &r) const |
Comparison operator. | |
G4bool | operator== (const BDSExtent &r) const |
Equality operator. | |
G4bool | operator!= (const BDSExtent &r) const |
Equality operator. | |
G4bool | TransverselyLessThan (const BDSExtent &r) const |
Comparison operator for x,y only. Ignores z (length). | |
G4bool | TransverselyGreaterThan (const BDSExtent &r) const |
Comparison operator for x,y only. Ignores z (length). | |
G4bool | TransverselyLessEquals (const BDSExtent &r) const |
Comparison operator for x,y only. Ignores z (length). | |
G4bool | TransverselyGreaterEquals (const BDSExtent &r) const |
Comparison operator for x,y only. Ignores z (length). | |
BDSExtent | Translate (const G4ThreeVector &offset) const |
Provide a new copy of this extent with an offset applied. | |
BDSExtent | Translate (G4double dx, G4double dy, G4double dz) const |
Provide a new copy of this extent with an offset applied. | |
Private Attributes | |
G4Transform3D | transform |
G4double | extXNegG |
Extent. | |
G4double | extXPosG |
Extent. | |
G4double | extYNegG |
Extent. | |
G4double | extYPosG |
Extent. | |
G4double | extZNegG |
Extent. | |
G4double | extZPosG |
Extent. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, BDSExtentGlobal const &ext) |
Output stream. | |
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.
Definition at line 43 of file BDSExtentGlobal.hh.
BDSExtentGlobal::BDSExtentGlobal | ( | ) |
Default constructor gives 0 in all extents - typically unphysical.
Definition at line 36 of file BDSExtentGlobal.cc.
Referenced by ExpandToEncompass(), and TranslateGlobal().
|
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.
|
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.
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().
|
inline |
The difference in a dimension.
Definition at line 90 of file BDSExtentGlobal.hh.
|
inline |
The difference in a dimension.
Definition at line 91 of file BDSExtentGlobal.hh.
|
inline |
The difference in a dimension.
Definition at line 92 of file BDSExtentGlobal.hh.
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().
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().
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().
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().
|
inline |
Accessor.
Definition at line 80 of file BDSExtentGlobal.hh.
References extXNegG, extYNegG, and extZNegG.
Referenced by GetMaximumExtentAbsolute().
|
inline |
Accessor.
Definition at line 77 of file BDSExtentGlobal.hh.
References extXPosG, extYPosG, and extZPosG.
Referenced by GetMaximumExtentAbsolute().
|
inline |
Accessor.
Definition at line 66 of file BDSExtentGlobal.hh.
References extXNegG, and extXPosG.
Referenced by Encompasses().
|
inline |
Accessor.
Definition at line 67 of file BDSExtentGlobal.hh.
References extYNegG, and extYPosG.
Referenced by Encompasses().
|
inline |
Accessor.
Definition at line 68 of file BDSExtentGlobal.hh.
References extZNegG, and extZPosG.
Referenced by Encompasses().
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().
G4double BDSExtentGlobal::MaximumAbsGlobal | ( | ) | const |
G4bool BDSExtentGlobal::Overlaps | ( | const BDSExtentGlobal & | other | ) | const |
Definition at line 103 of file BDSExtentGlobal.cc.
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.
|
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().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 99 of file BDSExtentGlobal.hh.
References TransverselyLessThanGlobal().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 97 of file BDSExtentGlobal.hh.
References TransverselyLessThanGlobal().
Referenced by TransverselyLessEqualsGlobal().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 98 of file BDSExtentGlobal.hh.
References TransverselyGreaterThanGlobal().
|
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().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
Output stream.
Definition at line 133 of file BDSExtentGlobal.cc.
|
private |
Extent.
Definition at line 135 of file BDSExtentGlobal.hh.
Referenced by AllBoundaryPointsGlobal(), BDSExtentGlobal(), DXGlobal(), Encompasses(), ExpandToEncompass(), ExtentNegativeGlobal(), ExtentXGlobal(), MaximumAbsGlobal(), TranslateGlobal(), TransverselyLessThanGlobal(), and XNegGlobal().
|
private |
Extent.
Definition at line 136 of file BDSExtentGlobal.hh.
Referenced by AllBoundaryPointsGlobal(), BDSExtentGlobal(), DXGlobal(), Encompasses(), ExpandToEncompass(), ExtentPositiveGlobal(), ExtentXGlobal(), MaximumAbsGlobal(), TranslateGlobal(), TransverselyLessThanGlobal(), and XPosGlobal().
|
private |
Extent.
Definition at line 137 of file BDSExtentGlobal.hh.
Referenced by AllBoundaryPointsGlobal(), BDSExtentGlobal(), DYGlobal(), Encompasses(), ExpandToEncompass(), ExtentNegativeGlobal(), ExtentYGlobal(), MaximumAbsGlobal(), TranslateGlobal(), TransverselyLessThanGlobal(), and YNegGlobal().
|
private |
Extent.
Definition at line 138 of file BDSExtentGlobal.hh.
Referenced by AllBoundaryPointsGlobal(), BDSExtentGlobal(), DYGlobal(), Encompasses(), ExpandToEncompass(), ExtentPositiveGlobal(), ExtentYGlobal(), MaximumAbsGlobal(), TranslateGlobal(), TransverselyLessThanGlobal(), and YPosGlobal().
|
private |
Extent.
Definition at line 139 of file BDSExtentGlobal.hh.
Referenced by AllBoundaryPointsGlobal(), BDSExtentGlobal(), DZGlobal(), Encompasses(), ExpandToEncompass(), ExtentNegativeGlobal(), ExtentZGlobal(), MaximumAbsGlobal(), TranslateGlobal(), and ZNegGlobal().
|
private |
Extent.
Definition at line 140 of file BDSExtentGlobal.hh.
Referenced by AllBoundaryPointsGlobal(), BDSExtentGlobal(), DZGlobal(), Encompasses(), ExpandToEncompass(), ExtentPositiveGlobal(), ExtentZGlobal(), MaximumAbsGlobal(), TranslateGlobal(), and ZPosGlobal().
|
private |
Definition at line 132 of file BDSExtentGlobal.hh.