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

#include <acts/blob/sPHENIX/Core/include/Acts/Utilities/BinUtility.hpp>

+ Collaboration diagram for Acts::BinUtility:

Public Member Functions

 BinUtility ()
 Constructor for equidistant.
 
 BinUtility (const Transform3D &tForm)
 
 BinUtility (const BinningData &bData, const Transform3D &tForm=Transform3D::Identity())
 
 BinUtility (size_t bins, float min, float max, BinningOption opt=open, BinningValue value=binX, const Transform3D &tForm=Transform3D::Identity())
 
 BinUtility (std::vector< float > &bValues, BinningOption opt=open, BinningValue value=binPhi, const Transform3D &tForm=Transform3D::Identity())
 
 BinUtility (const BinUtility &sbu)
 
BinUtilityoperator= (const BinUtility &sbu)
 
BinUtilityoperator+= (const BinUtility &gbu)
 
 ~BinUtility ()=default
 Virtual Destructor.
 
const std::vector< BinningData > & binningData () const
 return the binning data vector
 
size_t bins () const
 Return the total number of bins.
 
std::array< size_t, 3 > binTriple (const Vector3D &position) const
 
size_t bin (const Vector3D &position, size_t ba=0) const
 
std::vector< size_t > neighbourRange (const Vector3D &position, size_t ba=0) const
 
int nextDirection (const Vector3D &position, const Vector3D &direction, size_t ba=0) const
 
size_t bin (const Vector2D &lposition, size_t ba=0) const
 
bool inside (const Vector3D &position) const
 
bool inside (const Vector2D &lposition) const
 
size_t dimensions () const
 
size_t max (size_t ba=0) const
 
size_t bins (size_t ba) const
 
const Transform3Dtransform () const
 
BinningValue binningValue (size_t ba=0) const
 
size_t serialize (const std::array< size_t, 3 > &bin) const
 
std::ostream & toStream (std::ostream &sl) const
 

Private Attributes

std::vector< BinningDatam_binningData
 
Transform3D m_transform
 vector of BinningData
 
Transform3D m_itransform
 shared transform
 

Detailed Description

The BinUtility class that translated global and local position into a bins of a BinnedArray, most performant is equidistant binning without a transform, however, optionally a transform can be provided, e.g. for binning on shifted object, the transform is usually shared with the geometric object the Array is defined on, for performance reasons, also the inverse transform is stored.

Definition at line 31 of file BinUtility.hpp.

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

Constructor & Destructor Documentation

Acts::BinUtility::BinUtility ( )
inline

Constructor for equidistant.

Definition at line 34 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 34 of file BinUtility.hpp

References m_binningData.

Acts::BinUtility::BinUtility ( const Transform3D tForm)
inline

Constructor with only a Transform3D

Parameters
tFormis the local to global transform

Definition at line 44 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 44 of file BinUtility.hpp

References m_binningData.

Acts::BinUtility::BinUtility ( const BinningData bData,
const Transform3D tForm = Transform3D::Identity() 
)
inline

Constructor from BinningData directly

Parameters
bDatais the provided binning data
tFormis the (optional) transform

Definition at line 53 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 53 of file BinUtility.hpp

References m_binningData.

Acts::BinUtility::BinUtility ( size_t  bins,
float  min,
float  max,
BinningOption  opt = open,
BinningValue  value = binX,
const Transform3D tForm = Transform3D::Identity() 
)
inline

Constructor for equidistant

Parameters
binsis the number of bins
minin the minimal value
maxis the maximal value
optis the binning option : open, closed
valueis the binninb value : binX, binY, binZ, etc.
tFormis the (optional) transform

Definition at line 68 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 68 of file BinUtility.hpp

References m_binningData, and value.

Acts::BinUtility::BinUtility ( std::vector< float > &  bValues,
BinningOption  opt = open,
BinningValue  value = binPhi,
const Transform3D tForm = Transform3D::Identity() 
)
inline

Constructor for arbitrary

Parameters
bValuesis the boundary values of the binning
optis the binning option : open, closed
valueis the binninb value : binX, binY, binZ, etc.
tFormis the (optional) transform

Definition at line 82 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 82 of file BinUtility.hpp

References m_binningData, and value.

Acts::BinUtility::BinUtility ( const BinUtility sbu)
inline

Copy constructor

Parameters
sbuis the source bin utility

Definition at line 93 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 93 of file BinUtility.hpp

Acts::BinUtility::~BinUtility ( )
default

Virtual Destructor.

Member Function Documentation

size_t Acts::BinUtility::bin ( const Vector3D position,
size_t  ba = 0 
) const
inline

Bin from a 3D vector (already in binning frame)

Parameters
positionis the 3D position to be evaluated
bais the bin dimension
Returns
is the bin value

Definition at line 160 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 160 of file BinUtility.hpp

References m_binningData, and m_itransform.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), linit(), lmcmnd(), lmidat(), lmsimp(), neighbourRange(), pollinit(), pybook(), pydump(), pyfact(), pyfill(), pyhist(), pynull(), pyoper(), and pyplot().

+ Here is the caller graph for this function:

size_t Acts::BinUtility::bin ( const Vector2D lposition,
size_t  ba = 0 
) const
inline

Bin from a 2D vector (following local parameters defintitions)

  • no optional transform applied
  • USE WITH CARE !!

You need to make sure that the local position is actually in the binning frame of the BinUtility

Parameters
lpositionis the local position to be set
bais the bin dimension
Returns
bin calculated from local

Definition at line 225 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 225 of file BinUtility.hpp

References m_binningData.

const std::vector<BinningData>& Acts::BinUtility::binningData ( ) const
inline

return the binning data vector

Definition at line 129 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 129 of file BinUtility.hpp

References m_binningData.

Referenced by Acts::adjustBinUtility(), Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::createGrid2D(), Acts::createGrid3D(), Acts::detail::findLocalTopAndBottomEnd(), operator+=(), Acts::JsonGeometryConverter::surfaceMaterialToJson(), and ActsExamples::RootMaterialWriter::write().

+ Here is the caller graph for this function:

BinningValue Acts::BinUtility::binningValue ( size_t  ba = 0) const
inline

The type/value of the binning

Parameters
bais the binaccessor
Returns
the binning value of the accessor entry

Definition at line 301 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 301 of file BinUtility.hpp

References m_binningData.

size_t Acts::BinUtility::bins ( ) const
inline

Return the total number of bins.

Definition at line 132 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 132 of file BinUtility.hpp

References bins().

Referenced by Acts::AccumulatedSurfaceMaterial::AccumulatedSurfaceMaterial(), bins(), Acts::Test::BOOST_AUTO_TEST_CASE(), Acts::JsonGeometryConverter::jsonToSurfaceMaterial(), max(), and ActsExamples::RootMaterialWriter::write().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t Acts::BinUtility::bins ( size_t  ba) const
inline

Number of bins

Parameters
bais the binaccessor
Returns
size_t is the bins of the accessor entry

Definition at line 284 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 284 of file BinUtility.hpp

References bins(), and m_binningData.

+ Here is the call graph for this function:

std::array<size_t, 3> Acts::BinUtility::binTriple ( const Vector3D position) const
inline

Bin-triple fast access

  • calculate the bin triple with one transform
Parameters
positionis the 3D position to be evaluated
Returns
is the bin value in 3D

transform or not

now get the bins

return the triple

Definition at line 141 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 141 of file BinUtility.hpp

References m_binningData, m_itransform, and Acts::VectorHelpers::position().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t Acts::BinUtility::dimensions ( ) const
inline

First bin maximal value

Returns
the dimenstion of the binning data

Definition at line 265 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 265 of file BinUtility.hpp

References m_binningData.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::JsonGeometryConverter::jsonToVolumeMaterial().

+ Here is the caller graph for this function:

bool Acts::BinUtility::inside ( const Vector3D position) const
inline

Check if bin is inside from Vector2D - optional transform applied

Parameters
positionis the global position to be evaluated
Returns
is a boolean check

transform or not

Definition at line 235 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 235 of file BinUtility.hpp

References Acts::BinningData::inside(), m_binningData, m_itransform, and Acts::VectorHelpers::position().

+ Here is the call graph for this function:

bool Acts::BinUtility::inside ( const Vector2D lposition) const
inline

Check if bin is inside from Vector2D - no optional transform applied

Parameters
lpositionis the local position to be evaluated
Returns
is a boolean check

Definition at line 252 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 252 of file BinUtility.hpp

References m_binningData.

size_t Acts::BinUtility::max ( size_t  ba = 0) const
inline

First bin maximal value

Parameters
bais the binaccessor
Returns
size_t is the maximal bin of the accessor entry

Definition at line 272 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 272 of file BinUtility.hpp

References bins(), and m_binningData.

Referenced by Acts::InterpolatedMaterialMap< Mapper_t >::toStream().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector<size_t> Acts::BinUtility::neighbourRange ( const Vector3D position,
size_t  ba = 0 
) const
inline

Bin neighbour range this method calls the increment/decreement methods the bin itself is also contained, so if not an edge-case this would be | n | c | p |

Parameters
positionis the position for the neighbour Range test
bais the binning accessor
Returns
a vector of neighbour sizes

Definition at line 178 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 178 of file BinUtility.hpp

References bin(), and m_binningData.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int Acts::BinUtility::nextDirection ( const Vector3D position,
const Vector3D direction,
size_t  ba = 0 
) const
inline

Return the oder direction for fast interlinking

Parameters
positionis the global position for the next search
directionis the global position for the next search
bais the bin accessor
Returns
the next bin

Definition at line 206 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 206 of file BinUtility.hpp

References m_binningData.

Referenced by Acts::Layer::nextLayer().

+ Here is the caller graph for this function:

BinUtility& Acts::BinUtility::operator+= ( const BinUtility gbu)
inline

Operator++ to make multidimensional BinUtility

Parameters
gbuis the additional BinUtility to be chosen

Definition at line 113 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 113 of file BinUtility.hpp

References binningData(), m_binningData, m_itransform, m_transform, and transform().

+ Here is the call graph for this function:

BinUtility& Acts::BinUtility::operator= ( const BinUtility sbu)
inline

Assignment operator

Parameters
sbuis the source bin utility

Definition at line 101 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 101 of file BinUtility.hpp

References m_binningData, m_itransform, and m_transform.

size_t Acts::BinUtility::serialize ( const std::array< size_t, 3 > &  bin) const
inline

Serialize the bin triple

  • this creates a simple size_t from a triple object
Parameters
binis the bin to be serialized

Definition at line 312 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 312 of file BinUtility.hpp

References m_binningData.

std::ostream& Acts::BinUtility::toStream ( std::ostream &  sl) const
inline

Output Method for std::ostream, to be overloaded by child classes

Parameters
slis the ostream to be dumped into

Definition at line 326 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 326 of file BinUtility.hpp

References Acts::equidistant, and m_binningData.

Referenced by Acts::operator<<().

+ Here is the caller graph for this function:

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

Transform applied to global positions before lookup

Returns
Shared pointer to transform

Definition at line 294 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 294 of file BinUtility.hpp

References m_transform.

Referenced by Acts::createGrid2D(), Acts::createGrid3D(), operator+=(), and Acts::JsonGeometryConverter::surfaceMaterialToJson().

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<BinningData> Acts::BinUtility::m_binningData
private

Definition at line 352 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 352 of file BinUtility.hpp

Referenced by bin(), binningData(), binningValue(), bins(), binTriple(), BinUtility(), dimensions(), inside(), max(), neighbourRange(), nextDirection(), operator+=(), operator=(), serialize(), and toStream().

Transform3D Acts::BinUtility::m_itransform
private

shared transform

Definition at line 354 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 354 of file BinUtility.hpp

Referenced by bin(), binTriple(), inside(), operator+=(), and operator=().

Transform3D Acts::BinUtility::m_transform
private

vector of BinningData

Definition at line 353 of file BinUtility.hpp.

View newest version in sPHENIX GitHub at line 353 of file BinUtility.hpp

Referenced by operator+=(), operator=(), and transform().


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