ECCE @ 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/master/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, std::shared_ptr< const Transform3D > transform=nullptr)
 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::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
 
std::shared_ptr< const
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 31 of file SurfaceArray.hpp.

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

Constructor & Destructor Documentation

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

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 19 of file SurfaceArray.cpp.

View newest version in sPHENIX GitHub at line 19 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 28 of file SurfaceArray.cpp.

View newest version in sPHENIX GitHub at line 28 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 444 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 444 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 452 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 452 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 459 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 459 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 464 of file SurfaceArray.hpp.

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

References p_gridLookup.

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 500 of file SurfaceArray.hpp.

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

References p_gridLookup.

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

+ 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 487 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 487 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 507 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 507 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 475 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 475 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 482 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 482 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 494 of file SurfaceArray.hpp.

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

References m_surfacesRawPointers.

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

+ 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 35 of file SurfaceArray.cpp.

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

References 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 509 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 509 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 520 of file SurfaceArray.hpp.

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

SurfaceVector Acts::SurfaceArray::m_surfacesRawPointers
private

Definition at line 523 of file SurfaceArray.hpp.

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

Referenced by surfaces().

std::shared_ptr<const Transform3D> Acts::SurfaceArray::m_transform
private

Definition at line 526 of file SurfaceArray.hpp.

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

Referenced by transform().

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

Definition at line 518 of file SurfaceArray.hpp.

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

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


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