Analysis Software
Documentation for sPHENIX simulation 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 Transform3 &transform=Transform3::Identity())
 Default constructor which takes a SurfaceLookup and a vector of surfaces.
 
 SurfaceArray (std::shared_ptr< const Surface > srf)
 Constructor with a single surface.
 
SurfaceVectorat (const Vector3 &position)
 Get all surfaces in bin given by position.
 
const SurfaceVectorat (const Vector3 &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.
 
const SurfaceVectorneighbors (const Vector3 &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.
 
Vector3 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 Transform3transform () 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
 
Transform3 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 Transform3 transform = Transform3::Identity() 
)

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

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

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

Constructor with a single surface.

Parameters
srfThe one and only surface

Definition at line 30 of file SurfaceArray.cpp.

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

References testing::internal::move().

+ Here is the call graph for this function:

Member Function Documentation

SurfaceVector& Acts::SurfaceArray::at ( const Vector3 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 465 of file SurfaceArray.hpp.

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

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

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

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

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

References p_gridLookup.

Referenced by Acts::Svg::SurfaceArrayConverter::convert(), and 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 520 of file SurfaceArray.hpp.

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

References p_gridLookup.

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

+ Here is the caller graph for this function:

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

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

View newest version in sPHENIX GitHub at line 527 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::neighbors ( const Vector3 position) const
inline

Get all surfaces in bin at pos and its neighbors.

Parameters
positionThe position to lookup as nominal
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 495 of file SurfaceArray.hpp.

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

References p_gridLookup.

Referenced by Acts::Test::BOOST_FIXTURE_TEST_CASE(), and Acts::Svg::SurfaceArrayConverter::convert().

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

View newest version in sPHENIX GitHub at line 502 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 what's in the grid.

Definition at line 514 of file SurfaceArray.hpp.

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

References m_surfacesRawPointers.

Referenced by Acts::LayerCreator::associateSurfacesToLayer(), Acts::LayerCreator::checkBinning(), ActsExamples::RootMaterialWriter::collectMaterial(), Acts::Svg::SurfaceArrayConverter::convert(), 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 37 of file SurfaceArray.cpp.

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

References Acts::UnitConstants::e, i, and j.

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

+ Here is the caller graph for this function:

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

Definition at line 529 of file SurfaceArray.hpp.

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

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

SurfaceVector Acts::SurfaceArray::m_surfacesRawPointers
private

Definition at line 549 of file SurfaceArray.hpp.

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

Referenced by surfaces().

Transform3 Acts::SurfaceArray::m_transform
private

Definition at line 552 of file SurfaceArray.hpp.

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

Referenced by transform().

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

Definition at line 544 of file SurfaceArray.hpp.

View newest version in sPHENIX GitHub at line 544 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: