EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::SurfaceArray Class Reference

Provides Surface binning in N dimensions. More...

#include <acts/blob/sPHENIX/Core/include/Acts/Surfaces/SurfaceArray.hpp>

+ Collaboration diagram for Acts::SurfaceArray:

Classes

struct  ISurfaceGridLookup
 Base interface for all surface lookups. More...
 
struct  SingleElementLookup
 Lookup implementation which wraps one element and always returns this element when lookup is called. More...
 
struct  SurfaceGridLookup
 Lookup helper which encapsulates a Grid. More...
 

Public Member Functions

 SurfaceArray (std::unique_ptr< ISurfaceGridLookup > gridLookup, std::vector< std::shared_ptr< const Surface >> surfaces, const Transform3D &transform=s_idTransform)
 Default constructor which takes a SurfaceLookup and a vector of surfaces.
 
 SurfaceArray (std::shared_ptr< const Surface > srf)
 Constructor which takes concrete type SurfaceGridLookup.
 
SurfaceVectorat (const Vector3D &position)
 Get all surfaces in bin given by position.
 
const SurfaceVectorat (const Vector3D &position) const
 Get all surfaces in bin given by position pos.
 
SurfaceVectorat (size_t bin)
 Get all surfaces in bin given by global bin index bin.
 
const SurfaceVectorat (size_t bin) const
 Get all surfaces in bin given by global bin index.
 
SurfaceVector neighbors (const Vector3D &position) const
 Get all surfaces in bin at pos and its neighbors.
 
size_t size () const
 Get the size of the underlying grid structure including under/overflow bins.
 
Vector3D getBinCenter (size_t bin)
 Get the center of the bin identified by global bin index bin.
 
const SurfaceVectorsurfaces () const
 Get all surfaces attached to this SurfaceArray.
 
std::vector< const IAxis * > getAxes () const
 Get vector of axes spanning the grid as AnyAxis.
 
bool isValidBin (size_t bin) const
 Checks if global bin is valid.
 
const Transform3Dtransform () const
 
std::vector< BinningValuebinningValues () const
 The binning values described by this surface grid lookup They are in order of the axes.
 
std::ostream & toStream (const GeometryContext &gctx, std::ostream &sl) const
 String representation of this SurfaceArray.
 

Private Attributes

std::unique_ptr
< ISurfaceGridLookup
p_gridLookup
 
std::vector< std::shared_ptr
< const Surface > > 
m_surfaces
 
SurfaceVector m_surfacesRawPointers
 
Transform3D m_transform
 

Detailed Description

Provides Surface binning in N dimensions.

Uses Grid under the hood to implement the storage and lookup Contains a lookup struct which talks to the Grid and performs utility actions. This struct needs to be initialised externally and passed to SurfaceArray on construction.

Definition at line 32 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 32 of file SurfaceArray.hpp

Constructor & Destructor Documentation

Acts::SurfaceArray::SurfaceArray ( std::unique_ptr< ISurfaceGridLookup gridLookup,
std::vector< std::shared_ptr< const Surface >>  surfaces,
const Transform3D transform = s_idTransform 
)

Default constructor which takes a SurfaceLookup and a vector of surfaces.

Parameters
gridLookupThe grid storage. SurfaceArray does not fill it on its own
surfacesThe input vector of surfaces. This is only for bookkeeping, so we can ask
transformOptional additional transform for this SurfaceArray

Definition at line 20 of file SurfaceArray.cpp.

View newest version in sPHENIX GitHub at line 20 of file SurfaceArray.cpp

Acts::SurfaceArray::SurfaceArray ( std::shared_ptr< const Surface srf)

Constructor which takes concrete type SurfaceGridLookup.

Parameters
gridLookupThe grid storage. Is static casted to ISurfaceGridLookup
surfacesThe input vector of surfaces. This is only for bookkeeping, so we can ask
transformOptional additional transform for this SurfaceArray
Note
the transform parameter is ONLY used for the serialization. Apart from that, the SGL handles the transforms. Convenience constructor for single element mode. Uses the SingleElementLookup
Parameters
srfThe one and only surface

Definition at line 29 of file SurfaceArray.cpp.

View newest version in sPHENIX GitHub at line 29 of file SurfaceArray.cpp

Member Function Documentation

SurfaceVector& Acts::SurfaceArray::at ( const Vector3D position)
inline

Get all surfaces in bin given by position.

Parameters
positionthe lookup position
Returns
reference to SurfaceVector contained in bin at that position

Definition at line 458 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 458 of file SurfaceArray.hpp

References p_gridLookup.

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE(), Acts::Test::LayerCreatorFixture::checkBinContentSize(), and Acts::LayerCreator::checkBinning().

+ Here is the caller graph for this function:

const SurfaceVector& Acts::SurfaceArray::at ( const Vector3D position) const
inline

Get all surfaces in bin given by position pos.

Parameters
positionthe lookup position
Returns
const reference to SurfaceVector contained in bin at that position

Definition at line 466 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 466 of file SurfaceArray.hpp

References p_gridLookup.

SurfaceVector& Acts::SurfaceArray::at ( size_t  bin)
inline

Get all surfaces in bin given by global bin index bin.

Parameters
binthe global bin index
Returns
reference to SurfaceVector contained in bin

Definition at line 473 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 473 of file SurfaceArray.hpp

References p_gridLookup.

const SurfaceVector& Acts::SurfaceArray::at ( size_t  bin) const
inline

Get all surfaces in bin given by global bin index.

Parameters
binthe global bin index
Returns
const reference to SurfaceVector contained in bin

Definition at line 478 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 478 of file SurfaceArray.hpp

References p_gridLookup.

std::vector<BinningValue> Acts::SurfaceArray::binningValues ( ) const
inline

The binning values described by this surface grid lookup They are in order of the axes.

Definition at line 527 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 527 of file SurfaceArray.hpp

References p_gridLookup.

Referenced by Acts::GeometryView3D::drawSurfaceArray().

+ Here is the caller graph for this function:

std::vector<const IAxis*> Acts::SurfaceArray::getAxes ( ) const
inline

Get vector of axes spanning the grid as AnyAxis.

Returns
vector of AnyAxis
Note
The axes in the vector are copies. Only use for introspection and querying.

Definition at line 514 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 514 of file SurfaceArray.hpp

References p_gridLookup.

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE(), and Acts::GeometryView3D::drawSurfaceArray().

+ Here is the caller graph for this function:

Vector3D Acts::SurfaceArray::getBinCenter ( size_t  bin)
inline

Get the center of the bin identified by global bin index bin.

Parameters
binthe global bin index
Returns
Center position of the bin in global coordinates

Definition at line 501 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 501 of file SurfaceArray.hpp

References p_gridLookup.

bool Acts::SurfaceArray::isValidBin ( size_t  bin) const
inline

Checks if global bin is valid.

Parameters
binthe global bin index
Returns
bool if the bin is valid
Note
Valid means that the index points to a bin which is not a under or overflow bin or out of range in any axis.

Definition at line 521 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 521 of file SurfaceArray.hpp

References p_gridLookup.

Referenced by Acts::Test::LayerCreatorFixture::checkBinContentSize(), and Acts::LayerCreator::checkBinning().

+ Here is the caller graph for this function:

SurfaceVector Acts::SurfaceArray::neighbors ( const Vector3D position) const
inline

Get all surfaces in bin at pos and its neighbors.

Parameters
positionThe position to lookup as nominal
sizeHow many neighbors we want in each direction. (default: 1)
Returns
Merged SurfaceVector of neighbors and nominal
Note
The SurfaceVector will be combined. For technical reasons, the different bin content vectors have to be copied, so the resulting vector contains copies.

Definition at line 489 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 489 of file SurfaceArray.hpp

References p_gridLookup.

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE().

+ Here is the caller graph for this function:

size_t Acts::SurfaceArray::size ( ) const
inline

Get the size of the underlying grid structure including under/overflow bins.

Returns
the size

Definition at line 496 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 496 of file SurfaceArray.hpp

References p_gridLookup.

Referenced by Acts::Test::LayerCreatorFixture::checkBinContentSize(), and Acts::LayerCreator::checkBinning().

+ Here is the caller graph for this function:

const SurfaceVector& Acts::SurfaceArray::surfaces ( ) const
inline

Get all surfaces attached to this SurfaceArray.

Returns
Reference to SurfaceVector containing all surfaces
Note
This does not reflect the actual state of the grid. It only returns what was given in the constructor, without any checks if that is actually whats in the grid.

Definition at line 508 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 508 of file SurfaceArray.hpp

References m_surfacesRawPointers.

Referenced by Acts::LayerCreator::associateSurfacesToLayer(), Acts::LayerCreator::checkBinning(), ActsExamples::RootMaterialWriter::collectMaterial(), Acts::JsonGeometryConverter::convertToRep(), and Acts::GeometryView3D::drawSurfaceArray().

+ Here is the caller graph for this function:

std::ostream & Acts::SurfaceArray::toStream ( const GeometryContext gctx,
std::ostream &  sl 
) const
Initial value:
{
m_surfacesRawPointers.push_back(m_surfaces.at(0).get())

String representation of this SurfaceArray.

Parameters
gctxThe current geometry context object, e.g. alignment
slOutput stream to write to
Returns
the output stream given as sl

Definition at line 36 of file SurfaceArray.cpp.

View newest version in sPHENIX GitHub at line 36 of file SurfaceArray.cpp

References Acts::UnitConstants::e.

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE().

+ Here is the caller graph for this function:

const Transform3D& Acts::SurfaceArray::transform ( ) const
inline

Definition at line 523 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 523 of file SurfaceArray.hpp

References m_transform.

Member Data Documentation

std::vector<std::shared_ptr<const Surface> > Acts::SurfaceArray::m_surfaces
private

Definition at line 540 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 540 of file SurfaceArray.hpp

SurfaceVector Acts::SurfaceArray::m_surfacesRawPointers
private

Definition at line 543 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 543 of file SurfaceArray.hpp

Referenced by surfaces().

Transform3D Acts::SurfaceArray::m_transform
private

Definition at line 546 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 546 of file SurfaceArray.hpp

Referenced by transform().

std::unique_ptr<ISurfaceGridLookup> Acts::SurfaceArray::p_gridLookup
private

Definition at line 538 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 538 of file SurfaceArray.hpp

Referenced by at(), binningValues(), getAxes(), getBinCenter(), isValidBin(), neighbors(), and size().


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