Class BinUtility¶
Defined in File BinUtility.hpp
Class Documentation¶
-
class
Acts
::
BinUtility
¶ 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.
Public Functions
-
BinUtility
()¶ Constructor for equidistant.
Constructor from BinningData directly.
- Parameters
bData
: is the provided binning datatForm
: is the (optional) transform
Constructor for equidistant.
- Parameters
bins
: is the number of binsmin
: in the minimal valuemax
: is the maximal valueopt
: is the binning option : open, closedvalue
: is the binninb value : binX, binY, binZ, etc.tForm
: is the (optional) transform
Constructor for arbitrary.
- Parameters
bValues
: is the boundary values of the binningopt
: is the binning option : open, closedvalue
: is the binninb value : binX, binY, binZ, etc.tForm
: is the (optional) transform
-
BinUtility
(const BinUtility &sbu)¶ Copy constructor.
- Parameters
sbu
: is the source bin utility
-
~BinUtility
() = default¶ Virtual Destructor.
-
size_t
bin
(const Vector3D &position, size_t ba = 0) const¶ Bin from a 3D vector (already in binning frame)
- Return
is the bin value
- Parameters
position
: is the 3D position to be evaluatedba
: is the bin dimension
-
size_t
bin
(const Vector2D &lposition, size_t ba = 0) const¶ 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
- Return
bin calculated from local
- Parameters
lposition
: is the local position to be setba
: is the bin dimension
-
const std::vector<BinningData> &
binningData
() const¶ return the binning data vector
-
BinningValue
binningValue
(size_t ba = 0) const¶ The type/value of the binning.
- Return
the binning value of the accessor entry
- Parameters
ba
: is the binaccessor
-
size_t
bins
() const¶ Return the total number of bins.
-
size_t
bins
(size_t ba) const¶ Number of bins.
- Return
size_t is the bins of the accessor entry
- Parameters
ba
: is the binaccessor
-
std::array<size_t, 3>
binTriple
(const Vector3D &position) const¶ Bin-triple fast access.
calculate the bin triple with one transform
- Return
is the bin value in 3D
- Parameters
position
: is the 3D position to be evaluated
-
size_t
dimensions
() const¶ First bin maximal value.
- Return
the dimenstion of the binning data
-
bool
inside
(const Vector3D &position) const¶ Check if bin is inside from Vector2D - optional transform applied.
- Return
is a boolean check
- Parameters
position
: is the global position to be evaluated
-
bool
inside
(const Vector2D &lposition) const¶ Check if bin is inside from Vector2D - no optional transform applied.
- Return
is a boolean check
- Parameters
lposition
: is the local position to be evaluated
-
size_t
max
(size_t ba = 0) const¶ First bin maximal value.
- Return
size_t is the maximal bin of the accessor entry
- Parameters
ba
: is the binaccessor
-
std::vector<size_t>
neighbourRange
(const Vector3D &position, size_t ba = 0) const¶ 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 |.
- Return
a vector of neighbour sizes
- Parameters
position
: is the position for the neighbour Range testba
: is the binning accessor
-
int
nextDirection
(const Vector3D &position, const Vector3D &direction, size_t ba = 0) const¶ Return the oder direction for fast interlinking.
- Parameters
position
: is the global position for the next searchdirection
: is the global position for the next searchba
: is the bin accessor
- Return
the next bin
-
BinUtility &
operator+=
(const BinUtility &gbu)¶ Operator++ to make multidimensional BinUtility.
- Parameters
gbu
: is the additional BinUtility to be chosen
-
BinUtility &
operator=
(const BinUtility &sbu)¶ Assignment operator.
- Parameters
sbu
: is the source bin utility
-
size_t
serialize
(const std::array<size_t, 3> &bin) const¶ Serialize the bin triple.
this creates a simple size_t from a triple object
- Parameters
bin
: is the bin to be serialized
-
std::ostream &
toStream
(std::ostream &sl) const¶ Output Method for std::ostream, to be overloaded by child classes.
- Parameters
sl
: is the ostream to be dumped into
-
std::shared_ptr<const Transform3D>
transform
() const¶ Transform applied to global positions before lookup.
- Return
Shared pointer to transform
-