BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Holder for +- extents in 3 dimensions. More...
#include <BDSExtent.hh>
Public Member Functions | |
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 | |
G4double | extXNeg |
Extent. | |
G4double | extXPos |
Extent. | |
G4double | extYNeg |
Extent. | |
G4double | extYPos |
Extent. | |
G4double | extZNeg |
Extent. | |
G4double | extZPos |
Extent. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, BDSExtent const &ext) |
Output stream. | |
Holder for +- extents in 3 dimensions.
Definition at line 38 of file BDSExtent.hh.
BDSExtent::BDSExtent | ( | ) |
Default constructor gives 0 in all extents - typically unphysical.
Definition at line 34 of file BDSExtent.cc.
Referenced by ExpandToEncompass(), Tilted(), TiltOffset(), and Translate().
BDSExtent::BDSExtent | ( | const std::pair< G4double, G4double > & | extXIn, |
const std::pair< G4double, G4double > & | extYIn, | ||
const std::pair< G4double, G4double > & | extZIn | ||
) |
Construct with pairs of extents.
Definition at line 43 of file BDSExtent.cc.
BDSExtent::BDSExtent | ( | G4double | extXNegIn, |
G4double | extXPosIn, | ||
G4double | extYNegIn, | ||
G4double | extYPosIn, | ||
G4double | extZNegIn, | ||
G4double | extZPosIn | ||
) |
Construct with individual extents.
Definition at line 54 of file BDSExtent.cc.
BDSExtent::BDSExtent | ( | G4double | extXIn, |
G4double | extYIn, | ||
G4double | extZIn | ||
) |
Symmetric variant - assumed to be +/- same amount.
Definition at line 65 of file BDSExtent.cc.
BDSExtent::BDSExtent | ( | G4ThreeVector | extInNeg, |
G4ThreeVector | extInPos | ||
) |
Threevectors of positive and negative extents.
Definition at line 78 of file BDSExtent.cc.
|
explicit |
Symmetric from three vector.
Definition at line 74 of file BDSExtent.cc.
|
virtual |
Definition at line 88 of file BDSExtent.cc.
std::vector< G4ThreeVector > BDSExtent::AllBoundaryPoints | ( | ) | const |
All 8 boundary points of the bounding box.
Definition at line 91 of file BDSExtent.cc.
References extXNeg, extXPos, extYNeg, extYPos, extZNeg, and extZPos.
Referenced by BDSExtentGlobal::BDSExtentGlobal(), and Encompasses().
|
inline |
The difference in a dimension.
Definition at line 83 of file BDSExtent.hh.
References extXNeg, and extXPos.
Referenced by BDSDetectorConstruction::SideToLocalOffset(), and BDSMagnetOuterFactoryCylindrical::TestInputParameters().
|
inline |
The difference in a dimension.
Definition at line 84 of file BDSExtent.hh.
References extYNeg, and extYPos.
Referenced by BDSUndulator::BuildContainerLogicalVolume(), and BDSMagnetOuterFactoryCylindrical::TestInputParameters().
|
inline |
The difference in a dimension.
Definition at line 85 of file BDSExtent.hh.
References extZNeg, and extZPos.
Referenced by BDSLinkDetectorConstruction::AddLinkCollimatorJaw(), BDS::BuildBLMs(), BDSElement::BuildContainerLogicalVolume(), BDS::BuildPlacementGeometry(), and BDSMagnetOuterFactory::CreateMagnetOuter().
G4bool BDSExtent::Encompasses | ( | const BDSExtent & | other | ) | const |
Return whether the boundary points given by a set of extents lie within this extent. True if all points lie within this extent; false if even one lies outside.
Definition at line 198 of file BDSExtent.cc.
References AllBoundaryPoints(), and Encompasses().
G4bool BDSExtent::Encompasses | ( | const BDSParticleCoords & | coords | ) | const |
Definition at line 207 of file BDSExtent.cc.
G4bool BDSExtent::Encompasses | ( | const G4ThreeVector & | point | ) | const |
Return whether the extent encompasses the point. True if point lies inside the extent.
Definition at line 190 of file BDSExtent.cc.
References extXNeg, extXPos, extYNeg, extYPos, extZNeg, and extZPos.
Referenced by BDSCollimatorCrystal::Build(), Encompasses(), BDSLinkPrimaryGeneratorAction::GeneratePrimaries(), BDSPrimaryGeneratorAction::GeneratePrimaries(), BDSFieldEInterpolated2Layer::GetField(), and BDSFieldMagInterpolated2Layer::GetField().
|
inline |
Return whether the extent encompasses the point. Similar, but with separate x,y,z coordinates.
Definition at line 115 of file BDSExtent.hh.
References Encompasses().
BDSExtent BDSExtent::ExpandBy | ( | G4double | margin | ) | const |
void BDSExtent::ExpandToEncompass | ( | const BDSExtent & | other | ) |
Expand this extent to encompass the other one. Takes the max of each extent in this and the other.
Definition at line 236 of file BDSExtent.cc.
References BDSExtent(), extXNeg, extXPos, extYNeg, extYPos, extZNeg, and extZPos.
BDSExtent BDSExtent::ExpandTransverselyBy | ( | G4double | margin | ) | const |
|
inline |
Accessor.
Definition at line 75 of file BDSExtent.hh.
References extXNeg, extYNeg, and extZNeg.
Referenced by BDSGeometryComponent::GetExtentNegative().
|
inline |
Accessor.
Definition at line 72 of file BDSExtent.hh.
References extXPos, extYPos, and extZPos.
Referenced by BDSGeometryComponent::GetExtentPositive().
|
inline |
Accessor.
Definition at line 61 of file BDSExtent.hh.
References extXNeg, and extXPos.
Referenced by BDSGeometryComponent::GetExtentX(), and BDSGeometryComponent::GetInnerExtentX().
|
inline |
Accessor.
Definition at line 62 of file BDSExtent.hh.
References extYNeg, and extYPos.
Referenced by BDSGeometryComponent::GetExtentY(), and BDSGeometryComponent::GetInnerExtentY().
|
inline |
Accessor.
Definition at line 63 of file BDSExtent.hh.
References extZNeg, and extZPos.
Referenced by BDSGeometryComponent::GetExtentZ(), BDSGeometryComponent::GetInnerExtentZ(), and BDSDetectorConstruction::SideToLocalOffset().
G4double BDSExtent::MaximumAbs | ( | ) | const |
G4double BDSExtent::MaximumAbsTransverse | ( | ) | const |
Return the maximum absolute value considering only x,y.
Definition at line 171 of file BDSExtent.cc.
References extXNeg, extXPos, extYNeg, and extYPos.
Referenced by BDSTunnelBuilder::BuildTunnelSections(), BDSBeamPipeFactoryClicPCL::CommonFinalConstruction(), BDSMagnetOuterFactory::CreateContainerForExternal(), BDSApertureInfo::IndicativeRadius(), and BDSBeamPipeInfo::IndicativeRadius().
|
inline |
Definition at line 141 of file BDSExtent.hh.
|
inline |
Definition at line 142 of file BDSExtent.hh.
|
inline |
Definition at line 143 of file BDSExtent.hh.
G4double BDSExtent::MinimumAbs | ( | ) | const |
G4double BDSExtent::MinimumAbsTransverse | ( | ) | const |
Return the minimum absolute value considering only x,y.
Definition at line 177 of file BDSExtent.cc.
References extXNeg, extXPos, extYNeg, and extYPos.
Referenced by BDSBeamPipeInfo::IndicativeRadiusInner().
|
inline |
Equality operator.
Definition at line 97 of file BDSExtent.hh.
|
inline |
|
inline |
Comparison operator.
Definition at line 91 of file BDSExtent.hh.
|
inline |
|
inline |
Comparison operator.
Definition at line 90 of file BDSExtent.hh.
|
inline |
Comparison operator.
Definition at line 92 of file BDSExtent.hh.
BDSExtent BDSExtent::Tilted | ( | G4double | angle | ) | const |
Provide a new copy of this extent but rotated along Z by a given tilt angle.
Definition at line 121 of file BDSExtent.cc.
References BDSExtent(), extXNeg, extXPos, extYNeg, extYPos, extZNeg, extZPos, and BDS::IsFinite().
Referenced by BDS::BuildEndPieceBeamline(), and TiltOffset().
BDSExtent BDSExtent::TiltOffset | ( | const BDSTiltOffset * | tiltOffset | ) | const |
Provide a new copy of this extent with both a tilt and an offset applied.
Definition at line 105 of file BDSExtent.cc.
References BDSExtent(), BDSTiltOffset::GetOffset(), BDSTiltOffset::GetTilt(), Tilted(), and Translate().
Referenced by BDSLinkDetectorConstruction::AddLinkCollimatorJaw().
|
inline |
Provide a new copy of this extent with an offset applied.
Definition at line 125 of file BDSExtent.hh.
References Translate().
Referenced by BDSFieldEInterpolated::Extent(), BDSFieldMagInterpolated::Extent(), BDSGeometryComponent::InheritExtents(), BDS::InspectDisplacedSolid(), BDSGeometryFactorySQL::PlaceComponents(), TiltOffset(), and Translate().
BDSExtent BDSExtent::Translate | ( | G4double | dx, |
G4double | dy, | ||
G4double | dz | ||
) | const |
Provide a new copy of this extent with an offset applied.
Definition at line 114 of file BDSExtent.cc.
References BDSExtent(), extXNeg, extXPos, extYNeg, extYPos, extZNeg, and extZPos.
G4double BDSExtent::TransverseBoundingRadius | ( | ) | const |
Return a radius that would encompass the maximum x,y extent.
Definition at line 183 of file BDSExtent.cc.
References extXNeg, extXPos, extYNeg, and extYPos.
Referenced by BDSLinkDetectorConstruction::AddLinkCollimatorJaw(), and BDSParallelWorldSampler::Place().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 104 of file BDSExtent.hh.
References TransverselyLessThan().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 102 of file BDSExtent.hh.
References TransverselyLessThan().
Referenced by BDSElement::BuildContainerLogicalVolume(), BDS::BuildEndPieceBeamline(), and TransverselyLessEquals().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 103 of file BDSExtent.hh.
References TransverselyGreaterThan().
|
inline |
Comparison operator for x,y only. Ignores z (length).
Definition at line 191 of file BDSExtent.hh.
References extXNeg, extXPos, extYNeg, and extYPos.
Referenced by BDSMagnetOuterFactory::CreateExternal(), BDS::InspectIntersectionSolid(), BDS::InspectSubtractionSolid(), BDS::InspectUnionSolid(), TransverselyGreaterEquals(), and TransverselyGreaterThan().
|
inline |
Accessor.
Definition at line 65 of file BDSExtent.hh.
References extXNeg.
Referenced by BDSDetectorConstruction::CalculateExtentOfSamplerPlacement(), BDSMagnetOuterFactory::CreateContainerForExternal(), BDSCrystalFactory::CreateCrystalTorus(), BDSGeometryFactoryBase::ExpandExtent(), BDS::MaximumCombinedExtent(), BDSDetectorConstruction::SideToLocalOffset(), and BDS::WillIntersect().
|
inline |
Accessor.
Definition at line 66 of file BDSExtent.hh.
References extXPos.
Referenced by BDSDetectorConstruction::CalculateExtentOfSamplerPlacement(), BDSMagnetOuterFactory::CreateContainerForExternal(), BDSCrystalFactory::CreateCrystalTorus(), BDSGeometryFactoryBase::ExpandExtent(), BDSBeamPipeInfo::Extent(), BDS::MaximumCombinedExtent(), BDSDetectorConstruction::SideToLocalOffset(), and BDS::WillIntersect().
|
inline |
Accessor.
Definition at line 67 of file BDSExtent.hh.
References extYNeg.
Referenced by BDSDetectorConstruction::CalculateExtentOfSamplerPlacement(), BDSMagnetOuterFactory::CreateContainerForExternal(), BDSCrystalFactory::CreateCrystalTorus(), BDSGeometryFactoryBase::ExpandExtent(), BDS::MaximumCombinedExtent(), BDSDetectorConstruction::SideToLocalOffset(), and BDS::WillIntersect().
|
inline |
Accessor.
Definition at line 68 of file BDSExtent.hh.
References extYPos.
Referenced by BDSDetectorConstruction::CalculateExtentOfSamplerPlacement(), BDSMagnetOuterFactory::CreateContainerForExternal(), BDSCrystalFactory::CreateCrystalTorus(), BDSGeometryFactoryBase::ExpandExtent(), BDSBeamPipeInfo::Extent(), BDS::MaximumCombinedExtent(), BDSDetectorConstruction::SideToLocalOffset(), and BDS::WillIntersect().
|
inline |
Accessor.
Definition at line 69 of file BDSExtent.hh.
References extZNeg.
Referenced by BDSCrystalFactory::CreateCrystalTorus(), BDSGeometryFactoryBase::ExpandExtent(), and BDS::MaximumCombinedExtent().
|
inline |
Accessor.
Definition at line 70 of file BDSExtent.hh.
References extZPos.
Referenced by BDSCrystalFactory::CreateCrystalTorus(), BDSGeometryFactoryBase::ExpandExtent(), and BDS::MaximumCombinedExtent().
|
friend |
Output stream.
Definition at line 149 of file BDSExtent.cc.
|
private |
Extent.
Definition at line 166 of file BDSExtent.hh.
Referenced by AllBoundaryPoints(), DX(), Encompasses(), ExpandBy(), ExpandToEncompass(), ExpandTransverselyBy(), ExtentNegative(), ExtentX(), MaximumAbs(), MaximumAbsTransverse(), MinimumAbs(), MinimumAbsTransverse(), operator<(), operator==(), Tilted(), Translate(), TransverseBoundingRadius(), TransverselyLessThan(), and XNeg().
|
private |
Extent.
Definition at line 167 of file BDSExtent.hh.
Referenced by AllBoundaryPoints(), DX(), Encompasses(), ExpandBy(), ExpandToEncompass(), ExpandTransverselyBy(), ExtentPositive(), ExtentX(), MaximumAbs(), MaximumAbsTransverse(), MinimumAbs(), MinimumAbsTransverse(), operator<(), operator==(), Tilted(), Translate(), TransverseBoundingRadius(), TransverselyLessThan(), and XPos().
|
private |
Extent.
Definition at line 168 of file BDSExtent.hh.
Referenced by AllBoundaryPoints(), DY(), Encompasses(), ExpandBy(), ExpandToEncompass(), ExpandTransverselyBy(), ExtentNegative(), ExtentY(), MaximumAbs(), MaximumAbsTransverse(), MinimumAbs(), MinimumAbsTransverse(), operator<(), operator==(), Tilted(), Translate(), TransverseBoundingRadius(), TransverselyLessThan(), and YNeg().
|
private |
Extent.
Definition at line 169 of file BDSExtent.hh.
Referenced by AllBoundaryPoints(), DY(), Encompasses(), ExpandBy(), ExpandToEncompass(), ExpandTransverselyBy(), ExtentPositive(), ExtentY(), MaximumAbs(), MaximumAbsTransverse(), MinimumAbs(), MinimumAbsTransverse(), operator<(), operator==(), Tilted(), Translate(), TransverseBoundingRadius(), TransverselyLessThan(), and YPos().
|
private |
Extent.
Definition at line 170 of file BDSExtent.hh.
Referenced by AllBoundaryPoints(), DZ(), Encompasses(), ExpandBy(), ExpandToEncompass(), ExtentNegative(), ExtentZ(), MaximumAbs(), MinimumAbs(), operator<(), operator==(), Tilted(), Translate(), and ZNeg().
|
private |
Extent.
Definition at line 171 of file BDSExtent.hh.
Referenced by AllBoundaryPoints(), DZ(), Encompasses(), ExpandBy(), ExpandToEncompass(), ExtentPositive(), ExtentZ(), MaximumAbs(), MinimumAbs(), operator<(), operator==(), Tilted(), Translate(), and ZPos().