ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::BinUtility Class Reference

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. More...

#include <Acts/Utilities/BinUtility.hpp>

Public Member Functions

 BinUtility ()
 Constructor for equidistant.
 BinUtility (BinUtility &&sbu)=default
 Move constructor.
 BinUtility (const BinningData &bData, const Transform3 &tForm=Transform3::Identity())
 Constructor from BinningData directly.
 BinUtility (const BinUtility &sbu)=default
 Copy constructor.
 BinUtility (const DirectedProtoAxis &dpAxis)
 Create from a DirectedProtoAxis.
 BinUtility (const std::vector< DirectedProtoAxis > &dpAxes)
 Create from several DirectedProtoAxis objects.
 BinUtility (const Transform3 &tForm)
 Constructor with only a Transform3.
 BinUtility (std::size_t bins, float min, float max, BinningOption opt=open, AxisDirection value=AxisDirection::AxisX, const Transform3 &tForm=Transform3::Identity())
 Constructor for equidistant.
 BinUtility (std::vector< float > &bValues, BinningOption opt=open, AxisDirection value=AxisDirection::AxisPhi, const Transform3 &tForm=Transform3::Identity())
 Constructor for arbitrary.
 ~BinUtility ()=default
 Virtual Destructor.
std::size_t bin (const Vector2 &lposition, std::size_t ba=0) const
 Bin from a 2D vector (following local parameters definitions).
std::size_t bin (const Vector3 &position, std::size_t ba=0) const
 Bin from a 3D vector (already in binning frame).
const std::vector< BinningData > & binningData () const
 Return the binning data vector.
AxisDirection binningValue (std::size_t ba=0) const
 The type/value of the binning.
std::size_t bins () const
 Return the total number of bins.
std::size_t bins (std::size_t ba) const
 Number of bins.
std::array< std::size_t, 3 > binTriple (const Vector3 &position) const
 Bin-triple fast access.
std::size_t dimensions () const
 First bin maximal value.
bool inside (const Vector3 &position) const
 Check if bin is inside from Vector2 - optional transform applied.
std::size_t max (std::size_t ba=0) const
 First bin maximal value.
int nextDirection (const Vector3 &position, const Vector3 &direction, std::size_t ba=0) const
 Return the other direction for fast interlinking.
BinUtilityoperator+= (const BinUtility &gbu)
 Operator+= to make multidimensional BinUtility.
BinUtilityoperator= (BinUtility &&)=default
 Move assignment operator.
BinUtilityoperator= (const BinUtility &sbu)
 Assignment operator.
bool operator== (const BinUtility &other) const
 Equality operator.
std::size_t serialize (const std::array< std::size_t, 3 > &bin) const
 Serialize the bin triple.
std::ostream & toStream (std::ostream &sl, const std::string &indent="") const
 Output Method for std::ostream, to be overloaded by child classes.
std::string toString (const std::string &indent="") const
 Output into a string.
const Transform3transform () const
 Transform applied to global positions before lookup.

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.

Constructor & Destructor Documentation

◆ BinUtility() [1/9]

Acts::BinUtility::BinUtility ( )

Constructor for equidistant.

◆ BinUtility() [2/9]

Acts::BinUtility::BinUtility ( const Transform3 & tForm)
explicit

Constructor with only a Transform3.

Parameters
tFormis the local to global transform

◆ BinUtility() [3/9]

Acts::BinUtility::BinUtility ( const BinningData & bData,
const Transform3 & tForm = Transform3::Identity() )
explicit

Constructor from BinningData directly.

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

◆ BinUtility() [4/9]

Acts::BinUtility::BinUtility ( std::size_t bins,
float min,
float max,
BinningOption opt = open,
AxisDirection value = AxisDirection::AxisX,
const Transform3 & tForm = Transform3::Identity() )

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 axis direction : AxisX, AxisY, AxisZ, etc.
tFormis the (optional) transform

◆ BinUtility() [5/9]

Acts::BinUtility::BinUtility ( std::vector< float > & bValues,
BinningOption opt = open,
AxisDirection value = AxisDirection::AxisPhi,
const Transform3 & tForm = Transform3::Identity() )
explicit

Constructor for arbitrary.

Parameters
bValuesis the boundary values of the binning
optis the binning option : open, closed
valueis the axis direction : AxisX, AxisY, AxisZ, etc.
tFormis the (optional) transform

◆ BinUtility() [6/9]

Acts::BinUtility::BinUtility ( const BinUtility & sbu)
default

Copy constructor.

Parameters
sbuis the source bin utility

◆ BinUtility() [7/9]

Acts::BinUtility::BinUtility ( BinUtility && sbu)
default

Move constructor.

Parameters
sbuis the source bin utility

◆ BinUtility() [8/9]

Acts::BinUtility::BinUtility ( const DirectedProtoAxis & dpAxis)
explicit

Create from a DirectedProtoAxis.

Parameters
dpAxisthe DirectedProtoAxis to be used

◆ BinUtility() [9/9]

Acts::BinUtility::BinUtility ( const std::vector< DirectedProtoAxis > & dpAxes)
explicit

Create from several DirectedProtoAxis objects.

Parameters
dpAxesthe DirectedProtoAxis to be used with axis directions

◆ ~BinUtility()

Acts::BinUtility::~BinUtility ( )
default

Virtual Destructor.

Member Function Documentation

◆ bin() [1/2]

std::size_t Acts::BinUtility::bin ( const Vector2 & lposition,
std::size_t ba = 0 ) const

Bin from a 2D vector (following local parameters definitions).

  • 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

◆ bin() [2/2]

std::size_t Acts::BinUtility::bin ( const Vector3 & position,
std::size_t ba = 0 ) const

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

◆ binningData()

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

Return the binning data vector.

Returns
Reference to the vector of binning data

◆ binningValue()

AxisDirection Acts::BinUtility::binningValue ( std::size_t ba = 0) const

The type/value of the binning.

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

◆ bins() [1/2]

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

Return the total number of bins.

Returns
Total number of bins across all dimensions

◆ bins() [2/2]

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

Number of bins.

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

◆ binTriple()

std::array< std::size_t, 3 > Acts::BinUtility::binTriple ( const Vector3 & position) const

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

◆ dimensions()

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

First bin maximal value.

Returns
the dimension of the binning data

◆ inside()

bool Acts::BinUtility::inside ( const Vector3 & position) const

Check if bin is inside from Vector2 - optional transform applied.

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

◆ max()

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

First bin maximal value.

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

◆ nextDirection()

int Acts::BinUtility::nextDirection ( const Vector3 & position,
const Vector3 & direction,
std::size_t ba = 0 ) const

Return the other 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
Todo
the
Returns
the next bin

◆ operator+=()

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

Operator+= to make multidimensional BinUtility.

Parameters
gbuis the additional BinUtility to be chosen
Returns
Reference to this BinUtility after addition

◆ operator=() [1/2]

BinUtility & Acts::BinUtility::operator= ( BinUtility && )
default

Move assignment operator.

Returns
Reference to this BinUtility after move assignment

◆ operator=() [2/2]

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

Assignment operator.

Parameters
sbuis the source bin utility
Returns
Reference to this BinUtility after assignment

◆ operator==()

bool Acts::BinUtility::operator== ( const BinUtility & other) const

Equality operator.

Parameters
otherThe other BinUtility to compare with
Returns
True if the BinUtilities are equal, false otherwise

◆ serialize()

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

Serialize the bin triple.

  • this creates a simple std::size_t from a triple object
Parameters
binis the bin to be serialized
Returns
Serialized bin index as a single std::size_t value

◆ toStream()

std::ostream & Acts::BinUtility::toStream ( std::ostream & sl,
const std::string & indent = "" ) const

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

Parameters
slis the ostream to be dumped into
indentthe current indentation
Returns
the input stream

◆ toString()

std::string Acts::BinUtility::toString ( const std::string & indent = "") const

Output into a string.

Parameters
indentthe current indentation
Returns
a string with the stream information

◆ transform()

const Transform3 & Acts::BinUtility::transform ( ) const

Transform applied to global positions before lookup.

Returns
Shared pointer to transform